From fb9bf723cb60c5f5ee26de4e857df8f4b7d750ab Mon Sep 17 00:00:00 2001 From: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> Date: Fri, 24 May 2024 11:40:02 +0200 Subject: [PATCH 01/27] H-2768: Prevent passing wrong parameters when loading external types (#4510) --- apps/hash-graph/libs/api/src/rest/data_type.rs | 3 ++- apps/hash-graph/libs/api/src/rest/entity_type.rs | 2 +- apps/hash-graph/libs/api/src/rest/property_type.rs | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/hash-graph/libs/api/src/rest/data_type.rs b/apps/hash-graph/libs/api/src/rest/data_type.rs index 3e4b4fb992f..6e706cb9bfb 100644 --- a/apps/hash-graph/libs/api/src/rest/data_type.rs +++ b/apps/hash-graph/libs/api/src/rest/data_type.rs @@ -267,10 +267,11 @@ where } #[derive(Debug, Serialize, Deserialize, ToSchema)] -#[serde(untagged)] +#[serde(deny_unknown_fields, untagged)] enum LoadExternalDataTypeRequest { #[serde(rename_all = "camelCase")] Fetch { data_type_id: VersionedUrl }, + #[serde(rename_all = "camelCase")] Create { #[schema(value_type = VAR_DATA_TYPE)] schema: DataType, diff --git a/apps/hash-graph/libs/api/src/rest/entity_type.rs b/apps/hash-graph/libs/api/src/rest/entity_type.rs index 372571fb631..ad11ea591cd 100644 --- a/apps/hash-graph/libs/api/src/rest/entity_type.rs +++ b/apps/hash-graph/libs/api/src/rest/entity_type.rs @@ -534,7 +534,7 @@ where } #[derive(Debug, Serialize, Deserialize, ToSchema)] -#[serde(untagged)] +#[serde(deny_unknown_fields, untagged)] enum LoadExternalEntityTypeRequest { #[serde(rename_all = "camelCase")] Fetch { entity_type_id: VersionedUrl }, diff --git a/apps/hash-graph/libs/api/src/rest/property_type.rs b/apps/hash-graph/libs/api/src/rest/property_type.rs index cb7275b835a..e1b6608806f 100644 --- a/apps/hash-graph/libs/api/src/rest/property_type.rs +++ b/apps/hash-graph/libs/api/src/rest/property_type.rs @@ -273,10 +273,11 @@ where } #[derive(Debug, Serialize, Deserialize, ToSchema)] -#[serde(untagged)] +#[serde(deny_unknown_fields, untagged)] enum LoadExternalPropertyTypeRequest { #[serde(rename_all = "camelCase")] Fetch { property_type_id: VersionedUrl }, + #[serde(rename_all = "camelCase")] Create { #[schema(value_type = VAR_PROPERTY_TYPE)] schema: PropertyType, From d1146edee842d6bd61db726f9b3cafa5a4553a68 Mon Sep 17 00:00:00 2001 From: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> Date: Fri, 24 May 2024 11:51:51 +0200 Subject: [PATCH 02/27] H-2766: Make `label_property` camelCase instead of snake_case (#4508) --- apps/hash-graph/libs/api/src/rest/entity_type.rs | 1 + apps/hash-graph/openapi/openapi.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/hash-graph/libs/api/src/rest/entity_type.rs b/apps/hash-graph/libs/api/src/rest/entity_type.rs index ad11ea591cd..ac529261bae 100644 --- a/apps/hash-graph/libs/api/src/rest/entity_type.rs +++ b/apps/hash-graph/libs/api/src/rest/entity_type.rs @@ -538,6 +538,7 @@ where enum LoadExternalEntityTypeRequest { #[serde(rename_all = "camelCase")] Fetch { entity_type_id: VersionedUrl }, + #[serde(rename_all = "camelCase")] Create { #[schema(value_type = VAR_ENTITY_TYPE)] schema: EntityType, diff --git a/apps/hash-graph/openapi/openapi.json b/apps/hash-graph/openapi/openapi.json index 43f9bccdb5c..8b583a937ba 100644 --- a/apps/hash-graph/openapi/openapi.json +++ b/apps/hash-graph/openapi/openapi.json @@ -5734,7 +5734,7 @@ "type": "string", "nullable": true }, - "label_property": { + "labelProperty": { "allOf": [ { "$ref": "#/components/schemas/BaseUrl" From 52cc542976cc62dd4443e3c321b6698e26100df3 Mon Sep 17 00:00:00 2001 From: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> Date: Fri, 24 May 2024 12:14:10 +0200 Subject: [PATCH 03/27] H-2764: Add optional `userAgent` string field to origin provenance (#4511) --- apps/hash-graph/openapi/openapi.json | 18 ++++++++++++++++++ .../rust/src/knowledge/entity/provenance.rs | 10 +++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/apps/hash-graph/openapi/openapi.json b/apps/hash-graph/openapi/openapi.json index 8b583a937ba..4559ef75541 100644 --- a/apps/hash-graph/openapi/openapi.json +++ b/apps/hash-graph/openapi/openapi.json @@ -6260,6 +6260,9 @@ "web-app" ] }, + "userAgent": { + "type": "string" + }, "version": { "type": "string", "description": "The origin version, in whatever format the origin natively\nprovides." @@ -6296,6 +6299,9 @@ "mobile-app" ] }, + "userAgent": { + "type": "string" + }, "version": { "type": "string", "description": "The origin version, in whatever format the origin natively\nprovides." @@ -6332,6 +6338,9 @@ "browser-extension" ] }, + "userAgent": { + "type": "string" + }, "version": { "type": "string", "description": "The origin version, in whatever format the origin natively\nprovides." @@ -6368,6 +6377,9 @@ "api" ] }, + "userAgent": { + "type": "string" + }, "version": { "type": "string", "description": "The origin version, in whatever format the origin natively\nprovides." @@ -6410,6 +6422,9 @@ "flow" ] }, + "userAgent": { + "type": "string" + }, "version": { "type": "string", "description": "The origin version, in whatever format the origin natively\nprovides." @@ -6446,6 +6461,9 @@ "migration" ] }, + "userAgent": { + "type": "string" + }, "version": { "type": "string", "description": "The origin version, in whatever format the origin natively\nprovides." diff --git a/libs/@local/hash-graph-types/rust/src/knowledge/entity/provenance.rs b/libs/@local/hash-graph-types/rust/src/knowledge/entity/provenance.rs index 17c8d657e28..ae25aedf25f 100644 --- a/libs/@local/hash-graph-types/rust/src/knowledge/entity/provenance.rs +++ b/libs/@local/hash-graph-types/rust/src/knowledge/entity/provenance.rs @@ -132,12 +132,14 @@ pub struct OriginProvenance { pub session_id: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub api_key_public_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user_agent: Option, } #[cfg(feature = "utoipa")] impl<'__s> ToSchema<'__s> for OriginProvenance { fn schema() -> (&'__s str, RefOr) { - let common_types: [(&'static str, RefOr); 7] = [ + let common_types: [(&'static str, RefOr); 8] = [ ( "id", RefOr::T(Schema::from( @@ -185,6 +187,12 @@ provides.", ObjectBuilder::new().schema_type(SchemaType::String), )), ), + ( + "userAgent", + RefOr::T(Schema::from( + ObjectBuilder::new().schema_type(SchemaType::String), + )), + ), ]; let mut builder = OneOfBuilder::new(); From b046448369a7005d2d4d8d13661bf611e4ccb1cc Mon Sep 17 00:00:00 2001 From: Ciaran Morinan <37743469+CiaranMn@users.noreply.github.com> Date: Fri, 24 May 2024 13:25:54 +0100 Subject: [PATCH 04/27] Upgrade Sentry dependencies (#4513) --- apps/hash-ai-worker-ts/package.json | 2 +- apps/hash-api/package.json | 2 +- apps/hash-frontend/package.json | 4 +- apps/hash-integration-worker/package.json | 2 +- apps/plugin-browser/package.json | 2 +- libs/@local/hash-backend-utils/package.json | 2 +- .../@local/hash-isomorphic-utils/package.json | 2 +- yarn.lock | 279 +++++++----------- 8 files changed, 122 insertions(+), 173 deletions(-) diff --git a/apps/hash-ai-worker-ts/package.json b/apps/hash-ai-worker-ts/package.json index c99df98cbd1..98c9c19bf95 100644 --- a/apps/hash-ai-worker-ts/package.json +++ b/apps/hash-ai-worker-ts/package.json @@ -47,7 +47,7 @@ "@local/hash-subgraph": "0.0.0-private", "@local/internal-api-client": "0.0.0-private", "@local/status": "0.0.0-private", - "@sentry/node": "7.109.0", + "@sentry/node": "7.116.0", "@temporalio/activity": "1.8.1", "@temporalio/common": "1.8.1", "@temporalio/worker": "1.8.1", diff --git a/apps/hash-api/package.json b/apps/hash-api/package.json index fad30a48d62..07b98d19ffe 100644 --- a/apps/hash-api/package.json +++ b/apps/hash-api/package.json @@ -51,7 +51,7 @@ "@ory/hydra-client": "2.2.0-rc.3", "@ory/kratos-client": "1.0.0", "@rudderstack/rudder-sdk-node": "2.0.3", - "@sentry/node": "7.109.0", + "@sentry/node": "7.116.0", "@snowplow/node-tracker": "3.3.1", "@temporalio/client": "1.8.1", "@temporalio/proto": "1.8.1", diff --git a/apps/hash-frontend/package.json b/apps/hash-frontend/package.json index 96125c2bb31..4115ffd1fe3 100644 --- a/apps/hash-frontend/package.json +++ b/apps/hash-frontend/package.json @@ -47,8 +47,8 @@ "@ory/client": "1.1.41", "@ory/integrations": "1.1.4", "@popperjs/core": "2.11.8", - "@sentry/nextjs": "7.93.0", - "@sentry/react": "7.93.0", + "@sentry/nextjs": "7.116.0", + "@sentry/react": "7.116.0", "@svgr/webpack": "8.1.0", "@tldraw/editor": "2.0.0-alpha.12", "@tldraw/primitives": "2.0.0-alpha.12", diff --git a/apps/hash-integration-worker/package.json b/apps/hash-integration-worker/package.json index fa3ea2bdfaf..1bfd3831af6 100644 --- a/apps/hash-integration-worker/package.json +++ b/apps/hash-integration-worker/package.json @@ -25,7 +25,7 @@ "@local/hash-graph-client": "0.0.0-private", "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", - "@sentry/node": "7.109.0", + "@sentry/node": "7.116.0", "@temporalio/activity": "1.8.1", "@temporalio/worker": "1.8.1", "@temporalio/workflow": "1.8.1", diff --git a/apps/plugin-browser/package.json b/apps/plugin-browser/package.json index 2d567a0e0f2..29de2c581d0 100755 --- a/apps/plugin-browser/package.json +++ b/apps/plugin-browser/package.json @@ -33,7 +33,7 @@ "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", "@mui/material": "5.14.11", - "@sentry/browser": "7.93.0", + "@sentry/browser": "7.116.0", "bowser": "2.11.0", "date-fns": "2.28.0", "fractional-indexing": "2.1.0", diff --git a/libs/@local/hash-backend-utils/package.json b/libs/@local/hash-backend-utils/package.json index ebeece869f6..838f13aae89 100644 --- a/libs/@local/hash-backend-utils/package.json +++ b/libs/@local/hash-backend-utils/package.json @@ -33,7 +33,7 @@ "@local/hash-subgraph": "0.0.0-private", "@local/status": "0.0.0-private", "@opensearch-project/opensearch": "1.1.0", - "@sentry/node": "7.109.0", + "@sentry/node": "7.116.0", "@temporalio/activity": "1.8.1", "@temporalio/client": "1.8.1", "@temporalio/proto": "1.8.1", diff --git a/libs/@local/hash-isomorphic-utils/package.json b/libs/@local/hash-isomorphic-utils/package.json index 219131c8061..4b5f538c6f5 100644 --- a/libs/@local/hash-isomorphic-utils/package.json +++ b/libs/@local/hash-isomorphic-utils/package.json @@ -30,7 +30,7 @@ "@local/advanced-types": "0.0.0-private", "@local/hash-graph-client": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", - "@sentry/browser": "7.93.0", + "@sentry/browser": "7.116.0", "apollo-server-express": "3.9.0", "fractional-indexing": "2.1.0", "id128": "1.6.6", diff --git a/yarn.lock b/yarn.lock index 2a6aaf1d445..02379525f0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5780,44 +5780,47 @@ domhandler "^4.2.0" selderee "^0.6.0" -"@sentry-internal/feedback@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.93.0.tgz#c6648ce625792c72d7afdbee8f5db878c7f16fee" - integrity sha512-4G7rMeQbYGfCHxEoFroABX+UREYc2BSbFqjLmLbIcWowSpgzcwweLLphWHKOciqK6f7DnNDK0jZzx3u7NrkWHw== - dependencies: - "@sentry/core" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" - -"@sentry-internal/tracing@7.109.0": - version "7.109.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.109.0.tgz#3effaa132c41a65378fa98146aea61228d528953" - integrity sha512-PzK/joC5tCuh2R/PRh+7dp+uuZl7pTsBIjPhVZHMTtb9+ls65WkdZJ1/uKXPouyz8NOo9Xok7aEvEo9seongyw== - dependencies: - "@sentry/core" "7.109.0" - "@sentry/types" "7.109.0" - "@sentry/utils" "7.109.0" - -"@sentry-internal/tracing@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.93.0.tgz#8cee8b610695d828af75edd2929b64b7caf0385d" - integrity sha512-DjuhmQNywPp+8fxC9dvhGrqgsUb6wI/HQp25lS2Re7VxL1swCasvpkg8EOYP4iBniVQ86QK0uITkOIRc5tdY1w== - dependencies: - "@sentry/core" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" - -"@sentry/browser@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.93.0.tgz#acb559125ab0576091a3fc9718e520ba9b2eb1b9" - integrity sha512-MtLTcQ7y3rfk+aIvnnwCfSJvYhTJnIJi+Mf6y/ap6SKObdlsKMbQoJLlRViglGLq+nKxHLAvU0fONiCEmKfV6A== - dependencies: - "@sentry-internal/feedback" "7.93.0" - "@sentry-internal/tracing" "7.93.0" - "@sentry/core" "7.93.0" - "@sentry/replay" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" +"@sentry-internal/feedback@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.116.0.tgz#f1352b1a0d5fd7b7167775330ccf03bcc1b7892b" + integrity sha512-tmfO+RTCrhIWMs3yg8X0axhbjWRZLsldSfoXBgfjNCk/XwkYiVGp7WnYVbb+IO+01mHCsis9uaYOBggLgFRB5Q== + dependencies: + "@sentry/core" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" + +"@sentry-internal/replay-canvas@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.116.0.tgz#1cd4a85f99dd3cd61120e087232f5cbea21d5eb2" + integrity sha512-Sy0ydY7A97JY/IFTIj8U25kHqR5rL9oBk3HFE5EK9Phw56irVhHzEwLWae0jlFeCQEWoBYqpPgO5vXsaYzrWvw== + dependencies: + "@sentry/core" "7.116.0" + "@sentry/replay" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" + +"@sentry-internal/tracing@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.116.0.tgz#af3e4e264c440aa5525b5877a10b9a0f870b40e3" + integrity sha512-y5ppEmoOlfr77c/HqsEXR72092qmGYS4QE5gSz5UZFn9CiinEwGfEorcg2xIrrCuU7Ry/ZU2VLz9q3xd04drRA== + dependencies: + "@sentry/core" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" + +"@sentry/browser@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.116.0.tgz#950c1a9672bf886c556c2c7b9198b90189e3f0c2" + integrity sha512-2aosATT5qE+QLKgTmyF9t5Emsluy1MBczYNuPmLhDxGNfB+MA86S8u7Hb0CpxdwjS0nt14gmbiOtJHoeAF3uTw== + dependencies: + "@sentry-internal/feedback" "7.116.0" + "@sentry-internal/replay-canvas" "7.116.0" + "@sentry-internal/tracing" "7.116.0" + "@sentry/core" "7.116.0" + "@sentry/integrations" "7.116.0" + "@sentry/replay" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" "@sentry/bundler-plugin-core@2.10.2": version "2.10.2" @@ -5899,126 +5902,97 @@ proxy-from-env "^1.1.0" which "^2.0.2" -"@sentry/core@7.109.0": - version "7.109.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.109.0.tgz#7a02f4af4a676950f6555f552a2a232d4458fcd5" - integrity sha512-xwD4U0IlvvlE/x/g/W1I8b4Cfb16SsCMmiEuBf6XxvAa3OfWBxKoqLifb3GyrbxMC4LbIIZCN/SvLlnGJPgszA== +"@sentry/core@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.116.0.tgz#7cff43134878a696b2b3b981ae384ec3db9ac8c3" + integrity sha512-J6Wmjjx+o7RwST0weTU1KaKUAlzbc8MGkJV1rcHM9xjNTWTva+nrcCM3vFBagnk2Gm/zhwv3h0PvWEqVyp3U1Q== dependencies: - "@sentry/types" "7.109.0" - "@sentry/utils" "7.109.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" -"@sentry/core@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.93.0.tgz#50a14bf305130dfef51810e4c97fcba4972a57ef" - integrity sha512-vZQSUiDn73n+yu2fEcH+Wpm4GbRmtxmnXnYCPgM6IjnXqkVm3awWAkzrheADblx3kmxrRiOlTXYHw9NTWs56fg== +"@sentry/integrations@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.116.0.tgz#b641342249da76cd2feb2fb5511424b66f967449" + integrity sha512-UZb60gaF+7veh1Yv79RiGvgGYOnU6xA97H+hI6tKgc1uT20YpItO4X56Vhp0lvyEyUGFZzBRRH1jpMDPNGPkqw== dependencies: - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" - -"@sentry/integrations@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.93.0.tgz#23ce18919e8b19f97b9b0fdf69d2ecaa6f1730ad" - integrity sha512-uGQ8+DiqUr6SbhdJJHyIqDJ6kHnFuSv8nZWtj2tJ1I8q8u8MX8t8Om6R/R4ap45gCkWg/zqZq7B+gQV6TYewjQ== - dependencies: - "@sentry/core" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" + "@sentry/core" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" localforage "^1.8.1" -"@sentry/nextjs@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.93.0.tgz#7c52e73f4fd8410ad032dc713e21091f8db77db4" - integrity sha512-/O4Xl+hMSEM6/sVfmKXCZhLUUGNJbi+L0tasTiw4wB4EQQeMDKf4cBfx8e4mNBMzhA2SZnfQZAwJGqhvFJniPQ== +"@sentry/nextjs@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.116.0.tgz#56225d3d279e0180c65aa20f29e2b497fde544de" + integrity sha512-FhPokzfjejc1a66cy/eyfMVhZk0r2ogvN0+1ezu7l4k78voS1NW+MyDxqHdgNmDoGdLnqw7Zc2CNursREwq7KQ== dependencies: "@rollup/plugin-commonjs" "24.0.0" - "@sentry/core" "7.93.0" - "@sentry/integrations" "7.93.0" - "@sentry/node" "7.93.0" - "@sentry/react" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" - "@sentry/vercel-edge" "7.93.0" + "@sentry/core" "7.116.0" + "@sentry/integrations" "7.116.0" + "@sentry/node" "7.116.0" + "@sentry/react" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" + "@sentry/vercel-edge" "7.116.0" "@sentry/webpack-plugin" "1.21.0" chalk "3.0.0" resolve "1.22.8" rollup "2.78.0" stacktrace-parser "^0.1.10" -"@sentry/node@7.109.0", "@sentry/node@^7.60.0": - version "7.109.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.109.0.tgz#dbf152212e42a9b1648ff758ec5bffcb6bb0fa49" - integrity sha512-tqMNAES4X/iBl1eZRCmc29p//0id01FBLEiesNo5nk6ECl6/SaGMFAEwu1gsn90h/Bjgr04slwFOS4cR45V2PQ== - dependencies: - "@sentry-internal/tracing" "7.109.0" - "@sentry/core" "7.109.0" - "@sentry/types" "7.109.0" - "@sentry/utils" "7.109.0" - -"@sentry/node@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.93.0.tgz#7786d05d1e3e984207a866b07df1bf891355892e" - integrity sha512-nUXPCZQm5Y9Ipv7iWXLNp5dbuyi1VvbJ3RtlwD7utgsNkRYB4ixtKE9w2QU8DZZAjaEF6w2X94OkYH6C932FWw== - dependencies: - "@sentry-internal/tracing" "7.93.0" - "@sentry/core" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" - https-proxy-agent "^5.0.0" - -"@sentry/react@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.93.0.tgz#c6a07cf18c0fbd59e3d534300989f843ad518148" - integrity sha512-B0bzziV1lEyN7xd0orUPyJdpoK6CtcyodmQkfY0WsHLm/1d9xi95M05lObHnsMWO1js6c9B9d9kO8RlKFz947A== - dependencies: - "@sentry/browser" "7.93.0" - "@sentry/core" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" +"@sentry/node@7.116.0", "@sentry/node@^7.60.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.116.0.tgz#199c304e203f35ca0e814fb7fc8a9b3f30b2c612" + integrity sha512-HB/4TrJWbnu6swNzkid+MlwzLwY/D/klGt3R0aatgrgWPo2jJm6bSl4LUT39Cr2eg5I1gsREQtXE2mAlC6gm8w== + dependencies: + "@sentry-internal/tracing" "7.116.0" + "@sentry/core" "7.116.0" + "@sentry/integrations" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" + +"@sentry/react@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.116.0.tgz#7157200c66675949b126feaa5de155fe83510dd8" + integrity sha512-b7sYSIewK/h3dGzm7Rx6tBUzA6w7zw6m5rVIO3fWCy7T3xEUDggUaqklrFVHXUYx2yjzEgTFPg/Dd2NrSzua4w== + dependencies: + "@sentry/browser" "7.116.0" + "@sentry/core" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" hoist-non-react-statics "^3.3.2" -"@sentry/replay@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.93.0.tgz#55e3c424cd5529041fbc987e4c2e74e30a94b1b8" - integrity sha512-dMlLU8v+OkUeGCrPvTu5NriH7BGj3el4rGHWWAYicfJ2QXqTTq50vfasQBP1JeVNcFqnf1y653TdEIvo4RH4tw== +"@sentry/replay@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.116.0.tgz#cde921133c8927be92d60baf03c2b0aea73380f1" + integrity sha512-OrpDtV54pmwZuKp3g7PDiJg6ruRMJKOCzK08TF7IPsKrr4x4UQn56rzMOiABVuTjuS8lNfAWDar6c6vxXFz5KA== dependencies: - "@sentry-internal/tracing" "7.93.0" - "@sentry/core" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" - -"@sentry/types@7.109.0": - version "7.109.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.109.0.tgz#d8778358114ed05be734661cc9e1e261f4494947" - integrity sha512-egCBnDv3YpVFoNzRLdP0soVrxVLCQ+rovREKJ1sw3rA2/MFH9WJ+DZZexsX89yeAFzy1IFsCp7/dEqudusml6g== + "@sentry-internal/tracing" "7.116.0" + "@sentry/core" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" -"@sentry/types@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.93.0.tgz#d76d26259b40cd0688e1d634462fbff31476c1ec" - integrity sha512-UnzUccNakhFRA/esWBWP+0v7cjNg+RilFBQC03Mv9OEMaZaS29zSbcOGtRzuFOXXLBdbr44BWADqpz3VW0XaNw== - -"@sentry/utils@7.109.0", "@sentry/utils@^7.60.0": - version "7.109.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.109.0.tgz#7078e1400197abc1b0c436679bef980639500a86" - integrity sha512-3RjxMOLMBwZ5VSiH84+o/3NY2An4Zldjz0EbfEQNRY9yffRiCPJSQiCJID8EoylCFOh/PAhPimBhqbtWJxX6iw== - dependencies: - "@sentry/types" "7.109.0" +"@sentry/types@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.116.0.tgz#0be3434e7e53c86db4993e668af1c3a65bfb7519" + integrity sha512-QCCvG5QuQrwgKzV11lolNQPP2k67Q6HHD9vllZ/C4dkxkjoIym8Gy+1OgAN3wjsR0f/kG9o5iZyglgNpUVRapQ== -"@sentry/utils@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.93.0.tgz#36225038661fe977baf01e4695ef84794d591e45" - integrity sha512-Iovj7tUnbgSkh/WrAaMrd5UuYjW7AzyzZlFDIUrwidsyIdUficjCG2OIxYzh76H6nYIx9SxewW0R54Q6XoB4uA== +"@sentry/utils@7.116.0", "@sentry/utils@^7.60.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.116.0.tgz#f32463ab10f76f464274233a9df202e5357d17ff" + integrity sha512-Vn9fcvwTq91wJvCd7WTMWozimqMi+dEZ3ie3EICELC2diONcN16ADFdzn65CQQbYwmUzRjN9EjDN2k41pKZWhQ== dependencies: - "@sentry/types" "7.93.0" + "@sentry/types" "7.116.0" -"@sentry/vercel-edge@7.93.0": - version "7.93.0" - resolved "https://registry.yarnpkg.com/@sentry/vercel-edge/-/vercel-edge-7.93.0.tgz#56bb814f7af4c479b0d3bbce2e297aad2a3b409b" - integrity sha512-3jddd6gVUpGX8Sis9gxODL7zPR+lZohYYvOJVhf8UMglZSiWa3/xYJQ5VISj3UH6sVSxvfMxgssmQEHcvuubHQ== +"@sentry/vercel-edge@7.116.0": + version "7.116.0" + resolved "https://registry.yarnpkg.com/@sentry/vercel-edge/-/vercel-edge-7.116.0.tgz#09be1df26e381f0cd9580eb43737d58f6f74d1e7" + integrity sha512-II956v8ch99+DwhkFh7MDcYlnDURIO2rjy7U60Tol+xhlU5RcyySzRt/Ki1Zw2DiKXBuAk7C1JMioTr0FF9mAQ== dependencies: - "@sentry-internal/tracing" "7.93.0" - "@sentry/core" "7.93.0" - "@sentry/types" "7.93.0" - "@sentry/utils" "7.93.0" + "@sentry-internal/tracing" "7.116.0" + "@sentry/core" "7.116.0" + "@sentry/integrations" "7.116.0" + "@sentry/types" "7.116.0" + "@sentry/utils" "7.116.0" "@sentry/webpack-plugin@1.21.0": version "1.21.0" @@ -24292,7 +24266,7 @@ string-trim-spaces-only@^5.0.10: resolved "https://registry.yarnpkg.com/string-trim-spaces-only/-/string-trim-spaces-only-5.0.10.tgz#62f1d32ff8191cbfccb43c08e645c38444d61b77" integrity sha512-MhmjE5jNqb1Ylo+BARPRlsdChGLrnPpAUWrT1VOxo9WhWwKVUU6CbZTfjwKaQPYTGS/wsX/4Zek88FM2rEb5iA== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -24310,15 +24284,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -24439,7 +24404,7 @@ stringify-object@^5.0.0: is-obj "^3.0.0" is-regexp "^3.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -24460,13 +24425,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -26771,7 +26729,7 @@ worker-timers@^7.1.4: worker-timers-broker "^6.1.8" worker-timers-worker "^7.0.71" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -26797,15 +26755,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 8e305723d69fe47b6287483857635848fc093e57 Mon Sep 17 00:00:00 2001 From: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> Date: Fri, 24 May 2024 13:38:34 +0200 Subject: [PATCH 05/27] H-2758: Add package for graph SDK (#4503) Co-authored-by: Ciaran Morinan <37743469+CiaranMn@users.noreply.github.com> --- .../hash-graph-sdk/typescript/.eslintrc.cjs | 7 + .../hash-graph-sdk/typescript/LICENSE.md | 607 ++++++++++++++++++ .../hash-graph-sdk/typescript/package.json | 33 + .../hash-graph-sdk/typescript/src/entity.ts | 14 + .../typescript/tests/entity.test.ts | 58 ++ .../hash-graph-sdk/typescript/tsconfig.json | 4 + libs/@local/hash-graph-sdk/vitest.config.js | 19 + 7 files changed, 742 insertions(+) create mode 100644 libs/@local/hash-graph-sdk/typescript/.eslintrc.cjs create mode 100644 libs/@local/hash-graph-sdk/typescript/LICENSE.md create mode 100644 libs/@local/hash-graph-sdk/typescript/package.json create mode 100644 libs/@local/hash-graph-sdk/typescript/src/entity.ts create mode 100644 libs/@local/hash-graph-sdk/typescript/tests/entity.test.ts create mode 100644 libs/@local/hash-graph-sdk/typescript/tsconfig.json create mode 100644 libs/@local/hash-graph-sdk/vitest.config.js diff --git a/libs/@local/hash-graph-sdk/typescript/.eslintrc.cjs b/libs/@local/hash-graph-sdk/typescript/.eslintrc.cjs new file mode 100644 index 00000000000..ae0bc9befab --- /dev/null +++ b/libs/@local/hash-graph-sdk/typescript/.eslintrc.cjs @@ -0,0 +1,7 @@ +/** @type {import("eslint").Linter.Config} */ +module.exports = { + ...require("@local/eslint-config/generate-workspace-config.cjs")(__dirname), + rules: { + "global-require": "off", + }, +}; diff --git a/libs/@local/hash-graph-sdk/typescript/LICENSE.md b/libs/@local/hash-graph-sdk/typescript/LICENSE.md new file mode 100644 index 00000000000..c7d627721e2 --- /dev/null +++ b/libs/@local/hash-graph-sdk/typescript/LICENSE.md @@ -0,0 +1,607 @@ +GNU Affero General Public License +================================= + +_Version 3, 19 November 2007_ +_Copyright © 2007 Free Software Foundation, Inc. <>_ + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +## Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: **(1)** assert copyright on the software, and **(2)** offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +## TERMS AND CONDITIONS + +### 0. Definitions + +“This License” refers to version 3 of the GNU Affero General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based +on the Program. + +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that **(1)** displays an appropriate copyright notice, and **(2)** +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +### 1. Source Code + +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work. + +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other +than the work as a whole, that **(a)** is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and **(b)** serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + +The Corresponding Source for a work in source code form is that +same work. + +### 2. Basic Permissions + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + +### 4. Conveying Verbatim Copies + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + +* **a)** The work must carry prominent notices stating that you modified +it, and giving a relevant date. +* **b)** The work must carry prominent notices stating that it is +released under this License and any conditions added under section 7. +This requirement modifies the requirement in section 4 to +“keep intact all notices”. +* **c)** You must license the entire work, as a whole, under this +License to anyone who comes into possession of a copy. This +License will therefore apply, along with any applicable section 7 +additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no +permission to license the work in any other way, but it does not +invalidate such permission if you have separately received it. +* **d)** If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your +work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +### 6. Conveying Non-Source Forms + +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + +* **a)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium +customarily used for software interchange. +* **b)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a +written offer, valid for at least three years and valid for as +long as you offer spare parts or customer support for that product +model, to give anyone who possesses the object code either **(1)** a +copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical +medium customarily used for software interchange, for a price no +more than your reasonable cost of physically performing this +conveying of source, or **(2)** access to copy the +Corresponding Source from a network server at no charge. +* **c)** Convey individual copies of the object code with a copy of the +written offer to provide the Corresponding Source. This +alternative is allowed only occasionally and noncommercially, and +only if you received the object code with such an offer, in accord +with subsection 6b. +* **d)** Convey the object code by offering access from a designated +place (gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to +copy the object code is a network server, the Corresponding Source +may be on a different server (operated by you or a third party) +that supports equivalent copying facilities, provided you maintain +clear directions next to the object code saying where to find the +Corresponding Source. Regardless of what server hosts the +Corresponding Source, you remain obligated to ensure that it is +available for as long as needed to satisfy these requirements. +* **e)** Convey the object code using peer-to-peer transmission, provided +you inform other peers where the object code and Corresponding +Source of the work are being offered to the general public at no +charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A “User Product” is either **(1)** a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or **(2)** anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +### 7. Additional Terms + +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + +* **a)** Disclaiming warranty or limiting liability differently from the +terms of sections 15 and 16 of this License; or +* **b)** Requiring preservation of specified reasonable legal notices or +author attributions in that material or in the Appropriate Legal +Notices displayed by works containing it; or +* **c)** Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or +* **d)** Limiting the use for publicity purposes of names of licensors or +authors of the material; or +* **e)** Declining to grant rights under trademark law for use of some +trade names, trademarks, or service marks; or +* **f)** Requiring indemnification of licensors and authors of that +material by anyone who conveys the material (or modified versions of +it) with contractual assumptions of liability to the recipient, for +any liability that these contractual assumptions directly impose on +those licensors and authors. + +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + +### 8. Termination + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated **(a)** +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and **(b)** permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +### 9. Acceptance Not Required for Having Copies + +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +### 11. Patents + +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either **(1)** cause the Corresponding Source to be so +available, or **(2)** arrange to deprive yourself of the benefit of the +patent license for this particular work, or **(3)** arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license **(a)** in connection with copies of the covered work +conveyed by you (or copies made from those copies), or **(b)** primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +### 12. No Surrender of Others' Freedom + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + +### 13. Remote Network Interaction; Use with the GNU General Public License + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +### 14. Revised Versions of this License + +The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +### 15. Disclaimer of Warranty + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +### 16. Limitation of Liability + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16 + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. diff --git a/libs/@local/hash-graph-sdk/typescript/package.json b/libs/@local/hash-graph-sdk/typescript/package.json new file mode 100644 index 00000000000..369c803c605 --- /dev/null +++ b/libs/@local/hash-graph-sdk/typescript/package.json @@ -0,0 +1,33 @@ +{ + "name": "@local/hash-graph-sdk", + "version": "0.0.0-private", + "private": true, + "description": "SDK for the HASH Graph.", + "license": "AGPL-3.0", + "type": "module", + "exports": { + ".": { + "types": "./src/*.ts", + "node": "./src/*.ts", + "default": "./src/*.ts" + } + }, + "scripts": { + "fix:eslint": "eslint --fix .", + "lint:eslint": "eslint --report-unused-disable-directives .", + "lint:tsc": "tsc --noEmit", + "test:unit": "vitest --run" + }, + "dependencies": { + "@local/hash-graph-client": "0.0.0-private", + "@local/hash-subgraph": "0.0.0-private" + }, + "devDependencies": { + "@local/eslint-config": "0.0.0-private", + "@local/tsconfig": "0.0.0-private", + "@vitest/coverage-istanbul": "1.6.0", + "eslint": "8.57.0", + "typescript": "5.1.6", + "vitest": "1.6.0" + } +} diff --git a/libs/@local/hash-graph-sdk/typescript/src/entity.ts b/libs/@local/hash-graph-sdk/typescript/src/entity.ts new file mode 100644 index 00000000000..afebf58102d --- /dev/null +++ b/libs/@local/hash-graph-sdk/typescript/src/entity.ts @@ -0,0 +1,14 @@ +import type { Entity as GraphApiEntity } from "@local/hash-graph-client/api"; +import type { EntityId } from "@local/hash-subgraph"; + +export class Entity { + #entity: GraphApiEntity; + + constructor(entity: GraphApiEntity) { + this.#entity = entity; + } + + public get entityId(): EntityId { + return this.#entity.metadata.recordId.entityId as EntityId; + } +} diff --git a/libs/@local/hash-graph-sdk/typescript/tests/entity.test.ts b/libs/@local/hash-graph-sdk/typescript/tests/entity.test.ts new file mode 100644 index 00000000000..d3c6a2ad644 --- /dev/null +++ b/libs/@local/hash-graph-sdk/typescript/tests/entity.test.ts @@ -0,0 +1,58 @@ +import type { Entity as GraphApiEntity } from "@local/hash-graph-client/api"; +import { expect, test } from "vitest"; + +import { Entity } from "../src/entity"; + +test("Entity can be created from Graph API", () => { + const graph_api_entity: GraphApiEntity = { + metadata: { + archived: false, + confidence: 0.5, + entityTypeIds: ["https://hash.ai/@hash/types/entity-type/person/v/1"], + properties: [], + provenance: { + createdAtDecisionTime: "2001-01-01T00:00:00Z", + createdAtTransactionTime: "2001-01-01T00:00:00Z", + createdById: "4ed14962-7132-4453-8fc5-39b5c2131d45", + firstNonDraftCreatedAtDecisionTime: "2001-01-01T00:00:00Z", + firstNonDraftCreatedAtTransactionTime: "2001-01-01T00:00:00Z", + edition: { + createdById: "4ed14962-7132-4453-8fc5-39b5c2131d45", + }, + }, + temporalVersioning: { + decisionTime: { + start: { + kind: "inclusive", + limit: "2001-01-01T00:00:00Z", + }, + end: { + kind: "unbounded", + }, + }, + transactionTime: { + start: { + kind: "inclusive", + limit: "2001-01-01T00:00:00Z", + }, + end: { + kind: "unbounded", + }, + }, + }, + recordId: { + // random uuid + editionId: "b152948f-5bc2-43e6-a6ff-87d8006f0fae", + entityId: + "36fb3cd2-a500-493e-ab1e-e0b3a40839aa~17562306-35b5-4bb1-bda3-1c5ddea833ea", + }, + }, + properties: {}, + }; + + const entityInstance = new Entity(graph_api_entity); + + expect(entityInstance.entityId).toBe( + graph_api_entity.metadata.recordId.entityId, + ); +}); diff --git a/libs/@local/hash-graph-sdk/typescript/tsconfig.json b/libs/@local/hash-graph-sdk/typescript/tsconfig.json new file mode 100644 index 00000000000..18b4379ad80 --- /dev/null +++ b/libs/@local/hash-graph-sdk/typescript/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "@local/tsconfig/legacy-base-tsconfig-to-refactor.json", + "include": ["./"] +} diff --git a/libs/@local/hash-graph-sdk/vitest.config.js b/libs/@local/hash-graph-sdk/vitest.config.js new file mode 100644 index 00000000000..d4519b2e7db --- /dev/null +++ b/libs/@local/hash-graph-sdk/vitest.config.js @@ -0,0 +1,19 @@ +/// +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + coverage: { + enabled: process.env.TEST_COVERAGE === "true", + provider: "istanbul", + reporter: ["lcov", "text"], + include: ["**/*.{c,m,}{j,t}s{x,}"], + exclude: ["**/node_modules/**", "**/dist/**"], + }, + environment: "node", + testTimeout: 60_000, + typecheck: { + enabled: true, + }, + }, +}); From a99e8a2c5fed7aca41b81625e4f6e0404a6ab172 Mon Sep 17 00:00:00 2001 From: Ciaran Morinan <37743469+CiaranMn@users.noreply.github.com> Date: Fri, 24 May 2024 14:37:16 +0100 Subject: [PATCH 06/27] H-2473, H-2584: Add new HASH app homepage screens (#4502) Co-authored-by: Ben Werner <42802102+benwerner01@users.noreply.github.com> --- apps/hash-ai-worker-ts/package.json | 1 - .../flow-activities/web-search-action.ts | 4 +- .../get-web-search-results-activity.ts | 4 +- apps/hash-api/README.md | 1 + .../015-add-flow-types.dev.migration.ts | 2 + ...use-case-form-and-example-org.migration.ts | 153 +++++ .../migrate-ontology-types/util.ts | 9 +- .../system-webs-and-entities.ts | 11 +- .../knowledge/system-types/account.fields.ts | 1 - .../src/graph/ontology/primitive/util.ts | 2 +- apps/hash-api/src/graphql/resolvers/index.ts | 5 + .../knowledge/user/get-waitlist-position.ts | 40 ++ .../user/submit-early-access-form.ts | 71 +++ .../src/components/hooks/use-logout-flow.ts | 2 +- .../src/graphql/queries/user.queries.ts | 12 + .../edit-pinned-entity-types-modal.tsx | 49 +- .../shared/flow-visualizer/run-flow-modal.tsx | 29 +- .../swimlane/custom-node/question-modal.tsx | 108 ++-- apps/hash-frontend/src/pages/_app.page.tsx | 1 + apps/hash-frontend/src/pages/index.page.tsx | 81 +-- .../src/pages/index.page/logged-in.tsx | 103 ++++ .../src/pages/index.page/logged-out.tsx | 67 +++ .../pages/index.page/shared/discord-card.tsx | 25 + .../index.page/shared/follow-us-button.tsx | 12 + .../pages/index.page/shared/homepage-card.tsx | 43 ++ .../pages/index.page/shared/homepage-grid.tsx | 14 + .../pages/index.page/shared/typography.tsx | 69 +++ .../src/pages/index.page/shared/uses-card.tsx | 41 ++ .../src/pages/index.page/waitlisted.tsx | 224 ++++++++ .../waitlisted/early-access-modal.tsx | 215 +++++++ .../convert-quick-note-to-page-modal.tsx | 43 +- .../src/pages/shared/hidden-types.ts | 17 +- .../signup.page/signup-registration-form.tsx | 1 + .../src/shared/layout/layout-with-header.tsx | 5 +- .../layout-with-header/account-dropdown.tsx | 55 +- .../layout/layout-with-header/page-header.tsx | 32 +- .../src/shared/layout/layout-with-sidebar.tsx | 8 +- apps/hash-frontend/src/shared/ui/modal.tsx | 71 ++- apps/hashdotdev/src/components/footer.tsx | 6 +- .../src/components/icons/twitter-icon.tsx | 19 - .../src/components/icons/x-twitter-icon.tsx | 17 + infra/terraform/hash/main.tf | 4 + .../design-system/src/components.ts | 5 + .../@hashintel/design-system/src/icon-bug.tsx | 21 + .../design-system/src/icon-chrome.tsx | 526 ++++++++++++++++++ .../design-system/src/icon-discord.tsx | 9 + .../src/icon-lightbulb-on-rainbow.tsx | 38 ++ .../design-system/src/icon-x-twitter.tsx | 17 + .../inputs/mui-button-theme-options.ts | 101 ++-- .../design-system/theme-override.d.ts | 1 + libs/@local/hash-backend-utils/package.json | 1 + .../src}/internal-api-client.ts | 5 +- .../src/graphql/scalar-mapping.ts | 2 + .../type-defs/knowledge/user.typedef.ts | 10 + .../hash-isomorphic-utils/src/instance.ts | 9 + .../src/ontology-type-ids.ts | 34 +- .../system-types/googlesheetsintegration.ts | 166 ------ .../src/system-types/linearintegration.ts | 25 +- .../src/system-types/prospectiveuser.ts | 51 ++ .../src/system-types/shared.ts | 17 - .../src/system-types/usagerecord.ts | 2 +- .../internal-api-client/typescript/api.ts | 133 +++++ .../typescript/package.json | 2 +- .../hash-playwright/tests/guest-user.spec.ts | 4 + tests/hash-playwright/tests/signup.spec.ts | 3 + 65 files changed, 2297 insertions(+), 562 deletions(-) create mode 100644 apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts create mode 100644 apps/hash-api/src/graphql/resolvers/knowledge/user/get-waitlist-position.ts create mode 100644 apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts create mode 100644 apps/hash-frontend/src/pages/index.page/logged-in.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/logged-out.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/shared/discord-card.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/shared/follow-us-button.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/shared/homepage-card.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/shared/homepage-grid.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/shared/typography.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/shared/uses-card.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/waitlisted.tsx create mode 100644 apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx delete mode 100644 apps/hashdotdev/src/components/icons/twitter-icon.tsx create mode 100644 apps/hashdotdev/src/components/icons/x-twitter-icon.tsx create mode 100644 libs/@hashintel/design-system/src/icon-bug.tsx create mode 100644 libs/@hashintel/design-system/src/icon-chrome.tsx create mode 100644 libs/@hashintel/design-system/src/icon-discord.tsx create mode 100644 libs/@hashintel/design-system/src/icon-lightbulb-on-rainbow.tsx create mode 100644 libs/@hashintel/design-system/src/icon-x-twitter.tsx rename {apps/hash-ai-worker-ts/src/activities/shared => libs/@local/hash-backend-utils/src}/internal-api-client.ts (85%) create mode 100644 libs/@local/hash-isomorphic-utils/src/instance.ts delete mode 100644 libs/@local/hash-isomorphic-utils/src/system-types/googlesheetsintegration.ts create mode 100644 libs/@local/hash-isomorphic-utils/src/system-types/prospectiveuser.ts diff --git a/apps/hash-ai-worker-ts/package.json b/apps/hash-ai-worker-ts/package.json index 98c9c19bf95..b63501b9366 100644 --- a/apps/hash-ai-worker-ts/package.json +++ b/apps/hash-ai-worker-ts/package.json @@ -45,7 +45,6 @@ "@local/hash-graph-client": "0.0.0-private", "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", - "@local/internal-api-client": "0.0.0-private", "@local/status": "0.0.0-private", "@sentry/node": "7.116.0", "@temporalio/activity": "1.8.1", diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/web-search-action.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/web-search-action.ts index 2674a228b8f..62ee05baefc 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/web-search-action.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/web-search-action.ts @@ -1,7 +1,7 @@ +import { internalApiClient } from "@local/hash-backend-utils/internal-api-client"; import { getSimplifiedActionInputs } from "@local/hash-isomorphic-utils/flows/action-definitions"; import { StatusCode } from "@local/status"; -import { internalApi } from "../shared/internal-api-client"; import type { FlowActionActivity } from "./types"; export const webSearchAction: FlowActionActivity = async ({ inputs }) => { @@ -12,7 +12,7 @@ export const webSearchAction: FlowActionActivity = async ({ inputs }) => { const { data: { webSearchResults }, - } = await internalApi.getWebSearchResults(query); + } = await internalApiClient.getWebSearchResults(query); const webPagesUrls = webSearchResults .map(({ url }) => url) diff --git a/apps/hash-ai-worker-ts/src/activities/get-web-search-results-activity.ts b/apps/hash-ai-worker-ts/src/activities/get-web-search-results-activity.ts index 4fcedb0f0d8..bcb37090af3 100644 --- a/apps/hash-ai-worker-ts/src/activities/get-web-search-results-activity.ts +++ b/apps/hash-ai-worker-ts/src/activities/get-web-search-results-activity.ts @@ -1,11 +1,11 @@ -import { internalApi } from "./shared/internal-api-client"; +import { internalApiClient } from "@local/hash-backend-utils/internal-api-client"; export const getWebSearchResultsActivity = async (params: { query: string; }) => { const { data: { webSearchResults }, - } = await internalApi.getWebSearchResults(params.query); + } = await internalApiClient.getWebSearchResults(params.query); return webSearchResults; }; diff --git a/apps/hash-api/README.md b/apps/hash-api/README.md index 40f74d6dd36..86d97bbf512 100644 --- a/apps/hash-api/README.md +++ b/apps/hash-api/README.md @@ -47,6 +47,7 @@ The HASH Backend API service is configured using the following environment varia - `HASH_OPENSEARCH_PASSWORD`: the password to use when making the connection. - `HASH_OPENSEARCH_HTTPS_ENABLED`: (optional) set to "1" to connect to the cluster over an HTTPS connection. +- `INTERNAL_API_KEY`: The API key used to authenticate with HASH (the company)'s internal API, required for some functionality specific to hosted HASH (the app) - `STATSD_ENABLED`: (optional) set to "1" if the service should report metrics to a StatsD server. If enabled, the following variables must be set: - `STATSD_HOST`: the hostname of the StatsD server. diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts index 8d4608dc6c0..764e3a3f33a 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts @@ -104,6 +104,8 @@ const migrate: MigrationFunction = async ({ entityTypeDefinition: { title: "Flow Definition", description: "The definition of a HASH flow.", + labelProperty: blockProtocolPropertyTypes.name + .propertyTypeBaseUrl as BaseUrl, properties: [ { propertyType: blockProtocolPropertyTypes.name.propertyTypeId, diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts new file mode 100644 index 00000000000..37c8e5f10c7 --- /dev/null +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts @@ -0,0 +1,153 @@ +import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; +import { + systemEntityTypes, + systemPropertyTypes, +} from "@local/hash-isomorphic-utils/ontology-type-ids"; +import type { BaseUrl } from "@local/hash-subgraph"; + +import { + createOrg, + getOrgByShortname, +} from "../../../knowledge/system-types/org"; +import type { MigrationFunction } from "../types"; +import { + anyUserInstantiator, + createSystemEntityTypeIfNotExists, + createSystemPropertyTypeIfNotExists, +} from "../util"; + +const migrate: MigrationFunction = async ({ + context, + authentication, + migrationState, +}) => { + if (isSelfHostedInstance) { + /** + * Functionality is only relevant to hosted HASH, i.e. the instance at https://[app].hash.ai + */ + return migrationState; + } + + /** + * Create the entity type to hold information about a user's potential use(s) of HASH + */ + + const rolePropertyType = await createSystemPropertyTypeIfNotExists( + context, + authentication, + { + propertyTypeDefinition: { + title: "Role", + description: "The name of someone or something's role.", + possibleValues: [{ primitiveDataType: "text" }], + }, + webShortname: "hash", + migrationState, + }, + ); + + const intendedUsePropertyType = await createSystemPropertyTypeIfNotExists( + context, + authentication, + { + propertyTypeDefinition: { + title: "Intended Use", + description: + "The name or description of someone's intended use of something", + possibleValues: [{ primitiveDataType: "text" }], + }, + webShortname: "hash", + migrationState, + }, + ); + + const currentApproachPropertyType = await createSystemPropertyTypeIfNotExists( + context, + authentication, + { + propertyTypeDefinition: { + title: "Current Approach", + description: + "The name or description of the current approach to something", + possibleValues: [{ primitiveDataType: "text" }], + }, + webShortname: "hash", + migrationState, + }, + ); + + const willingToPayPropertyType = await createSystemPropertyTypeIfNotExists( + context, + authentication, + { + propertyTypeDefinition: { + title: "Willing To Pay", + description: "The amount that someone is willing to pay for something", + possibleValues: [{ primitiveDataType: "text" }], + }, + webShortname: "hash", + migrationState, + }, + ); + + const _prospectiveUserDefinitionEntityType = + await createSystemEntityTypeIfNotExists(context, authentication, { + entityTypeDefinition: { + title: "Prospective User", + description: + "Information about a prospective user of an application or system", + labelProperty: systemPropertyTypes.email.propertyTypeBaseUrl as BaseUrl, + properties: [ + { + propertyType: systemPropertyTypes.websiteUrl.propertyTypeId, + required: true, + }, + { + propertyType: systemPropertyTypes.email.propertyTypeId, + required: true, + }, + { + propertyType: rolePropertyType, + required: true, + }, + { + propertyType: intendedUsePropertyType, + required: true, + }, + { + propertyType: currentApproachPropertyType, + required: true, + }, + { + propertyType: willingToPayPropertyType, + required: true, + }, + ], + }, + webShortname: "hash", + migrationState, + instantiator: anyUserInstantiator, + }); + + /** + * Create an `@example` org + */ + const exampleOrg = await getOrgByShortname(context, authentication, { + shortname: "example", + }); + if (!exampleOrg) { + await createOrg(context, authentication, { + shortname: "example", + name: "Example", + websiteUrl: "https://example.com", + entityTypeVersion: + migrationState.entityTypeVersions[ + systemEntityTypes.organization.entityTypeBaseUrl as BaseUrl + ], + }); + } + + return migrationState; +}; + +export default migrate; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts index 63d17b9cfe4..ca07a2e0d9b 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts @@ -30,6 +30,7 @@ import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, } from "@local/hash-isomorphic-utils/graph-queries"; +import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; import { blockProtocolDataTypes, systemDataTypes, @@ -86,10 +87,7 @@ import { getPropertyTypeById, } from "../../ontology/primitive/property-type"; import type { PrimitiveDataTypeKey } from "../system-webs-and-entities"; -import { - getOrCreateOwningAccountGroupId, - isSelfHostedInstance, -} from "../system-webs-and-entities"; +import { getOrCreateOwningAccountGroupId } from "../system-webs-and-entities"; import type { MigrationState } from "./types"; import { upgradeWebEntities } from "./util/upgrade-entities"; import { upgradeEntityTypeDependencies } from "./util/upgrade-entity-type-dependencies"; @@ -609,6 +607,7 @@ export type EntityTypeDefinition = { entityTypeId: VersionedUrl; title: string; description?: string; + labelProperty?: BaseUrl; properties?: { propertyType: PropertyTypeWithMetadata | VersionedUrl; required?: boolean; @@ -801,6 +800,7 @@ export const createSystemEntityTypeIfNotExists: ImpureGraphFunction< // Specify the schema so that self-hosted instances don't need network access to hash.ai schema: entityTypeSchema, relationships, + labelProperty: entityTypeDefinition.labelProperty, }); return await getEntityTypeById(context, authentication, { @@ -816,6 +816,7 @@ export const createSystemEntityTypeIfNotExists: ImpureGraphFunction< schema: entityTypeSchema, webShortname, relationships, + labelProperty: entityTypeDefinition.labelProperty, }, ).catch((createError) => { // logger.warn(`Failed to create entity type: ${entityTypeSchema.$id}`); diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts index eb41abee33f..e226318b080 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts @@ -5,7 +5,6 @@ import { createMachineActorEntity, getMachineActorId, } from "@local/hash-backend-utils/machine-actors"; -import { frontendUrl } from "@local/hash-isomorphic-utils/environment"; import type { blockProtocolDataTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { SystemTypeWebShortname } from "@local/hash-isomorphic-utils/ontology-types"; import type { @@ -26,13 +25,6 @@ import type { ImpureGraphContext } from "../context-types"; import { createOrg, getOrgByShortname } from "../knowledge/system-types/org"; import { systemAccountId } from "../system-account"; -// Whether this is a self-hosted instance, rather than the central HASH hosted instance -export const isSelfHostedInstance = - process.env.SELF_HOSTED_HASH === "true" || - !["http://localhost:3000", "https://app.hash.ai", "https://hash.ai"].includes( - frontendUrl, - ); - export const owningWebs: Record< SystemTypeWebShortname, { @@ -166,7 +158,8 @@ export const ensureSystemWebEntitiesExist = async ({ * * Note: these are different from the web-scoped machine actors that EVERY org (system or not) has associated with. * - the web-scoped machine actors are for taking action in the web, e.g. to grant other bots permissions in it - * - _these_ machine actors are for performing actions across the system related to the types they create, e.g. Linear actions + * - _these_ machine actors are for performing actions across the system related to the types they create, e.g. + * Linear actions */ try { await getMachineActorId(context, authentication, { diff --git a/apps/hash-api/src/graph/knowledge/system-types/account.fields.ts b/apps/hash-api/src/graph/knowledge/system-types/account.fields.ts index 5673c1cf09b..f1156021055 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/account.fields.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/account.fields.ts @@ -27,7 +27,6 @@ export const RESTRICTED_SHORTNAMES = [ "dashboard", "deploy.html", "dw", - "example", "explore", "favicon.ico", "favicon.png", diff --git a/apps/hash-api/src/graph/ontology/primitive/util.ts b/apps/hash-api/src/graph/ontology/primitive/util.ts index aa2eccc5df5..d7fd537c663 100644 --- a/apps/hash-api/src/graph/ontology/primitive/util.ts +++ b/apps/hash-api/src/graph/ontology/primitive/util.ts @@ -4,6 +4,7 @@ import type { WebPermission, } from "@local/hash-graph-client"; import { frontendUrl } from "@local/hash-isomorphic-utils/environment"; +import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; import type { EntityUuid, OwnedById, @@ -13,7 +14,6 @@ import type { import { entityIdFromComponents } from "@local/hash-subgraph"; import type { ImpureGraphFunction } from "../../context-types"; -import { isSelfHostedInstance } from "../../ensure-system-graph-is-initialized/system-webs-and-entities"; import { getOrgById } from "../../knowledge/system-types/org"; import { getUserById } from "../../knowledge/system-types/user"; diff --git a/apps/hash-api/src/graphql/resolvers/index.ts b/apps/hash-api/src/graphql/resolvers/index.ts index 9c21c9932b6..4d9fe419946 100644 --- a/apps/hash-api/src/graphql/resolvers/index.ts +++ b/apps/hash-api/src/graphql/resolvers/index.ts @@ -65,9 +65,11 @@ import { checkUserPermissionsOnEntity, } from "./knowledge/shared/check-permissions"; import { getUsageRecordsResolver } from "./knowledge/user/get-usage-records"; +import { getWaitlistPositionResolver } from "./knowledge/user/get-waitlist-position"; import { hasAccessToHashResolver } from "./knowledge/user/has-access-to-hash"; import { isShortnameTakenResolver } from "./knowledge/user/is-shortname-taken"; import { meResolver } from "./knowledge/user/me"; +import { submitEarlyAccessFormResolver } from "./knowledge/user/submit-early-access-form"; import { loggedInMiddleware } from "./middlewares/logged-in"; import { loggedInAndSignedUpMiddleware } from "./middlewares/logged-in-and-signed-up"; import { getDataType, queryDataTypes } from "./ontology/data-type"; @@ -98,6 +100,7 @@ export const resolvers: Omit & { getBlockProtocolBlocks: getBlockProtocolBlocksResolver, // Logged in users only me: loggedInMiddleware(meResolver), + getWaitlistPosition: loggedInMiddleware(getWaitlistPositionResolver), // Admins getUsageRecords: loggedInMiddleware(getUsageRecordsResolver), // Any user @@ -175,6 +178,8 @@ export const resolvers: Omit & { createOrg: loggedInAndSignedUpMiddleware(createOrgResolver), + submitEarlyAccessForm: loggedInMiddleware(submitEarlyAccessFormResolver), + addEntityOwner: loggedInAndSignedUpMiddleware(addEntityOwnerResolver), removeEntityOwner: loggedInAndSignedUpMiddleware(removeEntityOwnerResolver), addEntityEditor: loggedInAndSignedUpMiddleware(addEntityEditorResolver), diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/user/get-waitlist-position.ts b/apps/hash-api/src/graphql/resolvers/knowledge/user/get-waitlist-position.ts new file mode 100644 index 00000000000..50f7eab4f50 --- /dev/null +++ b/apps/hash-api/src/graphql/resolvers/knowledge/user/get-waitlist-position.ts @@ -0,0 +1,40 @@ +import { internalApiClient } from "@local/hash-backend-utils/internal-api-client"; +import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; +import type { GetWaitlistPosition200Response } from "@local/internal-api-client"; + +import type { Query, ResolverFn } from "../../../api-types.gen"; +import type { LoggedInGraphQLContext } from "../../../context"; + +export const getWaitlistPositionResolver: ResolverFn< + Query["getWaitlistPosition"], + Record, + LoggedInGraphQLContext, + Record +> = async (_, _args, graphQLContext) => { + if (isSelfHostedInstance) { + throw new Error( + `This functionality is not relevant to self-hosted instances.`, + ); + } + + const { user } = graphQLContext; + + const email = user.emails[0]; + + if (!email) { + throw new Error("No email address found for user"); + } + + let data: GetWaitlistPosition200Response; + try { + ({ data } = await internalApiClient.getWaitlistPosition(email)); + } catch (err) { + throw new Error("Error fetching waitlist position"); + } + + if (typeof data.waitlistPosition !== "number") { + throw new Error("No waitlist position found for user"); + } + + return data.waitlistPosition; +}; diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts new file mode 100644 index 00000000000..d908d6d7083 --- /dev/null +++ b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts @@ -0,0 +1,71 @@ +import { getHashInstanceAdminAccountGroupId } from "@local/hash-backend-utils/hash-instance"; +import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; +import type { OwnedById } from "@local/hash-subgraph"; + +import { createEntity } from "../../../../graph/knowledge/primitive/entity"; +import { systemAccountId } from "../../../../graph/system-account"; +import type { + MutationSubmitEarlyAccessFormArgs, + ResolverFn, +} from "../../../api-types.gen"; +import type { LoggedInGraphQLContext } from "../../../context"; +import { graphQLContextToImpureGraphContext } from "../../util"; + +export const submitEarlyAccessFormResolver: ResolverFn< + Promise, + Record, + LoggedInGraphQLContext, + MutationSubmitEarlyAccessFormArgs +> = async (_, { properties }, graphQLContext) => { + const { user } = graphQLContext; + const context = graphQLContextToImpureGraphContext(graphQLContext); + + const adminAccountGroupId = await getHashInstanceAdminAccountGroupId( + context, + { actorId: systemAccountId }, + ); + + await createEntity( + context, + /** The user does not yet have permissions to create entities, so we do it with the HASH system account instead */ + { actorId: systemAccountId }, + { + ownedById: user.accountId as OwnedById, + entityTypeId: systemEntityTypes.prospectiveUser.entityTypeId, + properties, + relationships: [ + { + relation: "administrator", + subject: { + kind: "account", + subjectId: systemAccountId, + }, + }, + { + relation: "viewer", + subject: { + kind: "accountGroup", + subjectId: adminAccountGroupId, + }, + }, + { + relation: "setting", + subject: { + kind: "setting", + subjectId: "administratorFromWeb", + }, + }, + + { + relation: "setting", + subject: { + kind: "setting", + subjectId: "viewFromWeb", + }, + }, + ], + }, + ); + + return true; +}; diff --git a/apps/hash-frontend/src/components/hooks/use-logout-flow.ts b/apps/hash-frontend/src/components/hooks/use-logout-flow.ts index 489cc092066..853e11a271e 100644 --- a/apps/hash-frontend/src/components/hooks/use-logout-flow.ts +++ b/apps/hash-frontend/src/components/hooks/use-logout-flow.ts @@ -35,7 +35,7 @@ export const useLogoutFlow = () => { * hook on the current page. */ await router.push({ - pathname: "/signin", + pathname: "/", query: { return_to: router.asPath }, }); } diff --git a/apps/hash-frontend/src/graphql/queries/user.queries.ts b/apps/hash-frontend/src/graphql/queries/user.queries.ts index 058a28403da..102059d7ed9 100644 --- a/apps/hash-frontend/src/graphql/queries/user.queries.ts +++ b/apps/hash-frontend/src/graphql/queries/user.queries.ts @@ -13,6 +13,12 @@ export const hasAccessToHashQuery = gql` } `; +export const getWaitlistPositionQuery = gql` + query getWaitlistPosition { + getWaitlistPosition + } +`; + export const meQuery = gql` query me { me( @@ -28,3 +34,9 @@ export const meQuery = gql` } ${subgraphFieldsFragment} `; + +export const submitEarlyAccessFormMutation = gql` + mutation submitEarlyAccessForm($properties: ProspectiveUserProperties!) { + submitEarlyAccessForm(properties: $properties) + } +`; diff --git a/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx b/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx index c54f5c655d4..f5a4b54e1aa 100644 --- a/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx +++ b/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx @@ -1,9 +1,5 @@ import { useMutation } from "@apollo/client"; -import { - AsteriskRegularIcon, - IconButton, - Modal, -} from "@hashintel/design-system"; +import { AsteriskRegularIcon, IconButton } from "@hashintel/design-system"; import { systemEntityTypes, systemPropertyTypes, @@ -11,7 +7,7 @@ import { import type { EntityTypeWithMetadata, OwnedById } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import type { ModalProps } from "@mui/material"; -import { Box, Divider, Typography, typographyClasses } from "@mui/material"; +import { Box, Typography, typographyClasses } from "@mui/material"; import type { FunctionComponent, ReactElement } from "react"; import { useCallback, useEffect, useRef, useState } from "react"; import type { @@ -38,7 +34,7 @@ import { CustomLinkIcon } from "../../shared/icons/custom-link-icon"; import { GripDotsVerticalRegularIcon } from "../../shared/icons/grip-dots-vertical-regular-icon"; import { PlusRegularIcon } from "../../shared/icons/plus-regular"; import { XMarkRegularIcon } from "../../shared/icons/x-mark-regular-icon"; -import { Button, Link } from "../../shared/ui"; +import { Button, Link, Modal } from "../../shared/ui"; import { entityTypeIcons } from "../../shared/use-entity-icon"; import { ProfileSectionHeading } from "../[shortname]/shared/profile-section-heading"; import { useAuthenticatedUser } from "../shared/auth-info-context"; @@ -231,43 +227,14 @@ export const EditPinnedEntityTypesModal: FunctionComponent< padding: 0, }, }} + header={{ + title: "Pinned types", + subtitle: + "Choose up to 5 types to appear in the top-bar of your profile", + }} onClose={onClose} > - - - palette.gray[80], - }} - > - Pinned types - - palette.gray[80] }} - > - Choose up to 5 types to appear in the top-bar of your profile - - - - - - - - - - `1px solid ${palette.gray[20]}`, - py: 1, - pl: 2.5, - pr: 1.5, - }} - > - palette.gray[80] }} - > - Run flow - - - - - - <> - + + `1px solid ${palette.gray[20]}`, - py: 1, - pl: 2.5, - pr: 1.5, + color: ({ palette }) => palette.gray[70], + fontSize: 15, + fontWeight: 500, + lineHeight: 1.5, + mb: 2.5, }} > - palette.gray[80] }} - > - Your worker has asked you{" "} - {multipleQuestions ? "questions" : "a question"} - - - - - - - palette.gray[70], - fontSize: 15, - fontWeight: 500, - lineHeight: 1.5, - mb: 2.5, + Please respond to help me with my research – thank you! + + {inputRequest.data.questions.map((question, index) => ( + { + setAnswers((prevAnswers) => { + const newAnswers = [...prevAnswers]; + newAnswers[index] = updatedAnswer; + return newAnswers; + }); }} - > - Please respond to help me with my research – thank you! - - {inputRequest.data.questions.map((question, index) => ( - { - setAnswers((prevAnswers) => { - const newAnswers = [...prevAnswers]; - newAnswers[index] = updatedAnswer; - return newAnswers; - }); - }} - question={question} - key={question} - /> - ))} + question={question} + key={question} + /> + ))} - - - + + ); }; diff --git a/apps/hash-frontend/src/pages/_app.page.tsx b/apps/hash-frontend/src/pages/_app.page.tsx index c5c9c64926e..d1be2fb86a5 100644 --- a/apps/hash-frontend/src/pages/_app.page.tsx +++ b/apps/hash-frontend/src/pages/_app.page.tsx @@ -214,6 +214,7 @@ const publiclyAccessiblePagePathnames = [ "/signin", "/signup", "/recovery", + "/", ]; /** diff --git a/apps/hash-frontend/src/pages/index.page.tsx b/apps/hash-frontend/src/pages/index.page.tsx index 32b2aa6d31e..89fc1752070 100644 --- a/apps/hash-frontend/src/pages/index.page.tsx +++ b/apps/hash-frontend/src/pages/index.page.tsx @@ -1,12 +1,15 @@ import { useQuery } from "@apollo/client"; -import { Box, Typography } from "@mui/material"; +import { Stack } from "@mui/material"; +import { useRouter } from "next/router"; import { useMemo } from "react"; import type { HasAccessToHashQuery } from "../graphql/api-types.gen"; import { hasAccessToHashQuery } from "../graphql/queries/user.queries"; import type { NextPageWithLayout } from "../shared/layout"; import { getLayoutWithSidebar } from "../shared/layout"; -import { Link } from "../shared/ui"; +import { LoggedIn } from "./index.page/logged-in"; +import { LoggedOut } from "./index.page/logged-out"; +import { Waitlisted } from "./index.page/waitlisted"; import { useAuthInfo } from "./shared/auth-info-context"; const Page: NextPageWithLayout = () => { @@ -16,6 +19,8 @@ const Page: NextPageWithLayout = () => { { skip: !authenticatedUser || authenticatedUser.accountSignupComplete }, ); + const { push } = useRouter(); + const hasAccessToHash = useMemo(() => { if (authenticatedUser?.accountSignupComplete) { return true; @@ -24,61 +29,27 @@ const Page: NextPageWithLayout = () => { } }, [authenticatedUser, hasAccessToHashResponse]); - return hasAccessToHash ? ( - - - Welcome to HASH - - - - HASH is an open-source, data-centric, all-in-one workspace. - - - Please visit the{" "} - - GitHub repository - {" "} - for the latest updates, or check out our{" "} - - development roadmap - {" "} - to see what lies ahead. - - - HASH is stil pre-v1. As such, your feedback is greatly appreciated. - Join our{" "} - - community forum - {" "} - or{" "} - - contact us - {" "} - directly at any time. - - - - ) : ( - - - Welcome to HASH - - - You are currently signed up and on the waitlist. You'll - receive an email from us when it's your turn to access HASH. If you'd - like to jump ahead,{" "} - tell us about your use case{" "} - and we'll move you up the list. - - - In the meantime,{" "} - follow us on X for preview - videos and updates. - - + if (!authenticatedUser?.accountSignupComplete) { + if (hasAccessToHash) { + void push("/signup"); + return null; + } + + return ( + + {authenticatedUser ? : } + + ); + } + + return ( + + + ); }; -Page.getLayout = (page) => getLayoutWithSidebar(page); +Page.getLayout = (page) => + getLayoutWithSidebar(page, { grayBackground: false, fullWidth: true }); export default Page; diff --git a/apps/hash-frontend/src/pages/index.page/logged-in.tsx b/apps/hash-frontend/src/pages/index.page/logged-in.tsx new file mode 100644 index 00000000000..e0b88d1180d --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/logged-in.tsx @@ -0,0 +1,103 @@ +import { ArrowRightIconRegular, BugIcon } from "@hashintel/design-system"; +import { Box } from "@mui/material"; + +import { EnvelopeRegularIcon } from "../../shared/icons/envelope-regular-icon"; +import { Button } from "../../shared/ui/button"; +import { DiscordCard } from "./shared/discord-card"; +import { HomepageCard } from "./shared/homepage-card"; +import { HomepageGrid } from "./shared/homepage-grid"; +import { HomepageBigText, HomepageMediumText } from "./shared/typography"; +import { UsesCard } from "./shared/uses-card"; + +export const LoggedIn = () => { + return ( + + + + Get{" "} + palette.purple[70] }} + > + support + + + 1:1 help with HASH + + + + + Request{" "} + palette.teal[70] }} + > + a feature + + + or suggest a change + + + + + Report{" "} + palette.pink[80] }} + > + a bug + + + or unexpected behavior + + + + + + ); +}; diff --git a/apps/hash-frontend/src/pages/index.page/logged-out.tsx b/apps/hash-frontend/src/pages/index.page/logged-out.tsx new file mode 100644 index 00000000000..70e2ea47272 --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/logged-out.tsx @@ -0,0 +1,67 @@ +import { ArrowRightIconRegular } from "@hashintel/design-system"; +import { Box } from "@mui/material"; + +import { Button } from "../../shared/ui/button"; +import { DiscordCard } from "./shared/discord-card"; +import { FollowUsButton } from "./shared/follow-us-button"; +import { HomepageCard } from "./shared/homepage-card"; +import { HomepageGrid } from "./shared/homepage-grid"; +import { HomepageBigText, HomepageSmallCaps } from "./shared/typography"; +import { UsesCard } from "./shared/uses-card"; + +export const LoggedOut = () => { + return ( + + + + You are{" "} + palette.blue[70] }} + > + not yet + + + on the waitlist + + Stay tuned + palette.blue[70], ml: 0.8 }} + > + for access + + + + + + + palette.teal[60] }} + > + See videos + + + of + + + + HASH in action + + Watch videos + + + + + + ); +}; diff --git a/apps/hash-frontend/src/pages/index.page/shared/discord-card.tsx b/apps/hash-frontend/src/pages/index.page/shared/discord-card.tsx new file mode 100644 index 00000000000..00031fd54a2 --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/shared/discord-card.tsx @@ -0,0 +1,25 @@ +import { DiscordIcon } from "@hashintel/design-system"; + +import { Button } from "../../../shared/ui/button"; +import { HomepageCard } from "./homepage-card"; +import { HomepageBigText } from "./typography"; + +export const DiscordCard = () => ( + + Join our user + + Discord forum + + + +); diff --git a/apps/hash-frontend/src/pages/index.page/shared/follow-us-button.tsx b/apps/hash-frontend/src/pages/index.page/shared/follow-us-button.tsx new file mode 100644 index 00000000000..2c9bd8d409c --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/shared/follow-us-button.tsx @@ -0,0 +1,12 @@ +import { XTwitterIcon } from "@hashintel/design-system"; + +import { Button } from "../../../shared/ui/button"; + +export const FollowUsButton = () => ( + +); diff --git a/apps/hash-frontend/src/pages/index.page/shared/homepage-card.tsx b/apps/hash-frontend/src/pages/index.page/shared/homepage-card.tsx new file mode 100644 index 00000000000..d0b24aab3a8 --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/shared/homepage-card.tsx @@ -0,0 +1,43 @@ +import { Box, Grid } from "@mui/material"; +import type { PropsWithChildren } from "react"; + +import { useSidebarContext } from "../../../shared/layout/layout-with-sidebar/sidebar-context"; + +export const HomepageCard = ({ + children, + wide, +}: PropsWithChildren<{ wide?: boolean }>) => { + const { sidebarOpen } = useSidebarContext(); + + return ( + + ({ + background: palette.gray[10], + border: `1px solid ${palette.gray[30]}`, + borderRadius: 2, + maxWidth: sidebarOpen + ? { md: 600, lg: "100%" } + : { sm: 600, md: "100%" }, + px: 6, + py: 6, + minHeight: 268, + [breakpoints.up(sidebarOpen ? "xl" : "lg")]: wide + ? { + px: 10, + py: 7, + } + : {}, + })} + > + {children} + + + ); +}; diff --git a/apps/hash-frontend/src/pages/index.page/shared/homepage-grid.tsx b/apps/hash-frontend/src/pages/index.page/shared/homepage-grid.tsx new file mode 100644 index 00000000000..d6ddc8a82b9 --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/shared/homepage-grid.tsx @@ -0,0 +1,14 @@ +import { Box, Grid } from "@mui/material"; +import type { PropsWithChildren } from "react"; + +export const HomepageGrid = ({ children }: PropsWithChildren) => ( + + + {children} + + +); diff --git a/apps/hash-frontend/src/pages/index.page/shared/typography.tsx b/apps/hash-frontend/src/pages/index.page/shared/typography.tsx new file mode 100644 index 00000000000..efdf968d7e1 --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/shared/typography.tsx @@ -0,0 +1,69 @@ +import type { SxProps, Theme } from "@mui/material"; +import { Typography } from "@mui/material"; +import type { PropsWithChildren } from "react"; + +export const HomepageBigText = ({ + children, + sx, +}: PropsWithChildren<{ sx?: SxProps }>) => ( + ({ + color: palette.gray[90], + fontSize: 32, + fontFamily: typography.h3.fontFamily, + fontWeight: 500, + lineHeight: 1.1, + "&:last-of-type": { + mb: 3, + }, + }), + ...(Array.isArray(sx) ? sx : [sx]), + ]} + > + {children} + +); + +export const HomepageMediumText = ({ + children, + sx, +}: PropsWithChildren<{ sx?: SxProps }>) => ( + ({ + color: palette.gray[60], + fontSize: 24, + letterSpacing: "-2%", + fontWeight: 500, + mb: 3, + mt: 1, + }), + ...(Array.isArray(sx) ? sx : [sx]), + ]} + > + {children} + +); + +export const HomepageSmallCaps = ({ + children, + sx, +}: PropsWithChildren<{ sx?: SxProps }>) => ( + ({ + color: palette.gray[60], + fontSize: 13, + letterSpacing: "10%", + fontWeight: 600, + mb: 1, + mt: 3.5, + textTransform: "uppercase", + }), + ...(Array.isArray(sx) ? sx : []), + ]} + > + {children} + +); diff --git a/apps/hash-frontend/src/pages/index.page/shared/uses-card.tsx b/apps/hash-frontend/src/pages/index.page/shared/uses-card.tsx new file mode 100644 index 00000000000..c8e87510c69 --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/shared/uses-card.tsx @@ -0,0 +1,41 @@ +import { LightbulbOnRainbowIcon } from "@hashintel/design-system"; +import { Box } from "@mui/material"; + +import { Button } from "../../../shared/ui/button"; +import { HomepageCard } from "./homepage-card"; +import { HomepageBigText } from "./typography"; + +export const UsesCard = () => ( + + + See how{" "} + + other people + + + are using HASH + + +); diff --git a/apps/hash-frontend/src/pages/index.page/waitlisted.tsx b/apps/hash-frontend/src/pages/index.page/waitlisted.tsx new file mode 100644 index 00000000000..67eee27ddb8 --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/waitlisted.tsx @@ -0,0 +1,224 @@ +import { useMutation, useQuery } from "@apollo/client"; +import { + ArrowRightIconRegular, + ArrowUpRightRegularIcon, + CheckIcon, + ChromeIcon, +} from "@hashintel/design-system"; +import { + currentTimeInstantTemporalAxes, + generateVersionedUrlMatchingFilter, + zeroedGraphResolveDepths, +} from "@local/hash-isomorphic-utils/graph-queries"; +import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; +import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; +import type { ProspectiveUserProperties } from "@local/hash-isomorphic-utils/system-types/prospectiveuser"; +import { Box } from "@mui/material"; +import { useCallback, useState } from "react"; + +import type { + GetEntitySubgraphQuery, + GetEntitySubgraphQueryVariables, + GetWaitlistPositionQuery, + SubmitEarlyAccessFormMutation, + SubmitEarlyAccessFormMutationVariables, +} from "../../graphql/api-types.gen"; +import { getEntitySubgraphQuery } from "../../graphql/queries/knowledge/entity.queries"; +import { + getWaitlistPositionQuery, + submitEarlyAccessFormMutation, +} from "../../graphql/queries/user.queries"; +import { Button } from "../../shared/ui/button"; +import { DiscordCard } from "./shared/discord-card"; +import { FollowUsButton } from "./shared/follow-us-button"; +import { HomepageCard } from "./shared/homepage-card"; +import { HomepageGrid } from "./shared/homepage-grid"; +import { HomepageBigText, HomepageSmallCaps } from "./shared/typography"; +import { UsesCard } from "./shared/uses-card"; +import { EarlyAccessFormModal } from "./waitlisted/early-access-modal"; + +const SelfHostedAccessDenied = () => ( + + You do not have access + to this instance + Sign up for hosted HASH instead + + +); + +export const Waitlisted = () => { + const { data: waitlistPositionData } = useQuery( + getWaitlistPositionQuery, + { skip: isSelfHostedInstance }, + ); + + const [earlyAccessFormState, setEarlyAccessFormState] = useState< + "closed" | "open" | "submitted" + >("closed"); + + useQuery( + getEntitySubgraphQuery, + { + variables: { + request: { + filter: generateVersionedUrlMatchingFilter( + systemEntityTypes.prospectiveUser.entityTypeId, + ), + graphResolveDepths: zeroedGraphResolveDepths, + includeDrafts: false, + temporalAxes: currentTimeInstantTemporalAxes, + }, + includePermissions: false, + }, + fetchPolicy: "cache-and-network", + onCompleted: (data) => { + if (data.getEntitySubgraph.subgraph.roots.length) { + setEarlyAccessFormState("submitted"); + } + }, + }, + ); + + const position = waitlistPositionData?.getWaitlistPosition; + + const [submitToApi] = useMutation< + SubmitEarlyAccessFormMutation, + SubmitEarlyAccessFormMutationVariables + >(submitEarlyAccessFormMutation); + + const submitForm = useCallback( + async (properties: ProspectiveUserProperties) => { + await submitToApi({ + variables: { + properties, + }, + }); + + setEarlyAccessFormState("submitted"); + }, + [submitToApi], + ); + + const hasSubmittedForm = earlyAccessFormState === "submitted"; + + return ( + <> + {!isSelfHostedInstance && !hasSubmittedForm && ( + setEarlyAccessFormState("closed")} + open={earlyAccessFormState === "open"} + onSubmit={submitForm} + /> + )} + + {isSelfHostedInstance ? ( + + ) : ( + <> + + + You are{" "} + + position ? palette.teal[60] : "inherit", + }} + > + {position ? `#${position}` : "currently"} + + + on the waitlist + + Stay tuned + palette.teal[60], ml: 0.8 }} + > + for access + + + + + + Skip the wait + palette.blue[70] }} + > + get early access + + Jump the queue + + + + )} + + + Install the{" "} + + palette.aqua[70], fontWeight: 700 }} + > + HASH extension + + Get ready + + + + + + + ); +}; diff --git a/apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx b/apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx new file mode 100644 index 00000000000..9d535cbce4a --- /dev/null +++ b/apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx @@ -0,0 +1,215 @@ +import { Select, TextField } from "@hashintel/design-system"; +import { typedEntries, typedKeys } from "@local/advanced-types/typed-entries"; +import type { ProspectiveUserProperties } from "@local/hash-isomorphic-utils/system-types/prospectiveuser"; +import { Box, Stack, Typography } from "@mui/material"; +import type { FormEvent } from "react"; +import { useState } from "react"; + +import { Button } from "../../../shared/ui/button"; +import { MenuItem } from "../../../shared/ui/menu-item"; +import { Modal } from "../../../shared/ui/modal"; +import { useAuthenticatedUser } from "../../shared/auth-info-context"; + +type FormFieldMetadata = { + label: string; + multiline?: boolean; + options?: string[]; + placeholder: string; + type?: string; + url?: boolean; +}; + +type FormFields = Record; + +const formFields: FormFields = { + "https://hash.ai/@hash/types/property-type/website-url/": { + label: "Your company website", + placeholder: "e.g. starbucks.com", + url: true, + }, + "https://hash.ai/@hash/types/property-type/role/": { + label: "Your role/title", + placeholder: "e.g. CEO", + }, + "https://hash.ai/@hash/types/property-type/email/": { + label: "Your work email address", + placeholder: "e.g. howard@starbucks.com", + type: "email", + }, + "https://hash.ai/@hash/types/property-type/intended-use/": { + label: "What do you plan on using HASH for?", + placeholder: + "Provide as much detail as possible to increase your likelihood of being invited as an earlier user of HASH.", + multiline: true, + }, + "https://hash.ai/@hash/types/property-type/current-approach/": { + label: "How do you currently do your work?", + placeholder: + "Let us know how you currently complete the above described workflow, what tools you use, etc.", + multiline: true, + }, + "https://hash.ai/@hash/types/property-type/willing-to-pay/": { + label: "How much are you willing to pay for a fully automated solution?", + placeholder: "", + options: [ + "$1—$20 per month", + "$21-$50 per month", + "$51-$250 per month", + "$250+ per month", + "On an 'as needed' basis", + "I'm not willing to pay", + ], + }, +}; + +const Input = ({ + label, + multiline, + onChange, + options, + placeholder, + type, + url, + value, +}: { + onChange: (value: string) => void; + value: string; +} & FormFieldMetadata) => ( + + palette.gray[70], + fontWeight: 500, + lineHeight: 1.5, + }} + > + {label} + palette.blue[70], ml: 0.5 }} + > + * + + + {options ? ( + + ) : ( + onChange(event.target.value)} + placeholder={placeholder} + sx={{ width: multiline ? "100%" : 330 }} + type={type ?? "text"} + value={value} + /> + )} + + + +); + +type EarlyAccessFormModalProps = { + open: boolean; + onClose: () => void; + onSubmit: (properties: ProspectiveUserProperties) => Promise; +}; + +export const EarlyAccessFormModal = ({ + open, + onClose, + onSubmit, +}: EarlyAccessFormModalProps) => { + const { authenticatedUser } = useAuthenticatedUser(); + + const [formState, setFormState] = useState>( + () => + typedKeys(formFields).reduce( + (acc, key) => { + if (key === "https://hash.ai/@hash/types/property-type/email/") { + acc[key] = authenticatedUser.emails[0]!.address; + } else { + acc[key] = ""; + } + return acc; + }, + {} as Record, + ), + ); + + const [pending, setPending] = useState(false); + + const submitValues = async (event: FormEvent) => { + event.preventDefault(); + + setPending(true); + + await onSubmit(formState); + }; + + const allValuesPresent = Object.values(formState).every( + (value) => value.trim().length > 0, + ); + + return ( + + + {typedEntries(formFields).map(([key, metadata]) => { + return ( + + setFormState((currentState) => ({ + ...currentState, + [key]: value, + })) + } + value={formState[key]} + /> + ); + })} + + + + + + + ); +}; diff --git a/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx b/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx index 53b866aa071..cb7e5788452 100644 --- a/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx +++ b/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx @@ -1,9 +1,4 @@ -import { - Autocomplete, - IconButton, - Modal, - TextField, -} from "@hashintel/design-system"; +import { Autocomplete, TextField } from "@hashintel/design-system"; import { systemEntityTypes, systemLinkEntityTypes, @@ -14,7 +9,6 @@ import type { ModalProps } from "@mui/material"; import { autocompleteClasses, Box, - Divider, outlinedInputClasses, Typography, } from "@mui/material"; @@ -28,8 +22,7 @@ import { useBlockProtocolUpdateEntity } from "../../components/hooks/block-proto import type { SimplePage } from "../../components/hooks/use-account-pages"; import { useAccountPages } from "../../components/hooks/use-account-pages"; import { PageIcon } from "../../components/page-icon"; -import { XMarkRegularIcon } from "../../shared/icons/x-mark-regular-icon"; -import { Button } from "../../shared/ui"; +import { Button, Modal } from "../../shared/ui"; import { useAuthenticatedUser } from "../shared/auth-info-context"; export type PageWithParentLink = SimplePage & { parentLinkEntity?: Entity }; @@ -142,38 +135,12 @@ export const ConvertQuickNoteToPageModal: FunctionComponent< padding: 0, }, }} + header={{ + title: "Convert note to page", + }} onClose={onClose} > - - palette.gray[80], - }} - > - Convert note to page - - spacing(1), - right: ({ spacing }) => spacing(1), - }} - > - - - - palette.gray[20] }} /> { ({ data }) => data?.hasAccessToHash, ); if (!hasAccessToHash) { + await refetch(); void router.push("/"); return; } diff --git a/apps/hash-frontend/src/shared/layout/layout-with-header.tsx b/apps/hash-frontend/src/shared/layout/layout-with-header.tsx index 7d6e1e65ab8..8abc4c80a4b 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-header.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-header.tsx @@ -1,17 +1,14 @@ import type { FunctionComponent, ReactNode } from "react"; -import { useIsReadonlyModeForApp } from "../readonly-mode"; import { PageHeader } from "./layout-with-header/page-header"; import { PlainLayout } from "./plain-layout"; export const LayoutWithHeader: FunctionComponent<{ children?: ReactNode; }> = ({ children }) => { - const isReadonlyMode = useIsReadonlyModeForApp(); - return ( - {!isReadonlyMode && } + {children} ); diff --git a/apps/hash-frontend/src/shared/layout/layout-with-header/account-dropdown.tsx b/apps/hash-frontend/src/shared/layout/layout-with-header/account-dropdown.tsx index f93c7970b55..d6396fb6b92 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-header/account-dropdown.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-header/account-dropdown.tsx @@ -83,7 +83,9 @@ export const AccountDropdown: FunctionComponent = ({ > = ({ - popupState.close()}> - - - {isInstanceAdmin ? ( - popupState.close()}> - - - ) : null} - popupState.close()} - > - - - {/* - Commented out menu items whose functionality have not been implemented yet - @todo uncomment when functionality has been implemented - */} - {/* - - - - */} - + {authenticatedUser.accountSignupComplete && [ + popupState.close()} + > + + , + isInstanceAdmin ? ( + popupState.close()} + > + + + ) : null, + popupState.close()} + > + + , + , + ]} + diff --git a/apps/hash-frontend/src/shared/layout/layout-with-header/page-header.tsx b/apps/hash-frontend/src/shared/layout/layout-with-header/page-header.tsx index 6161ca590c7..c549567853d 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-header/page-header.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-header/page-header.tsx @@ -79,7 +79,7 @@ export const PageHeader: FunctionComponent = () => { /> - {authenticatedUser ? : null} + {authenticatedUser?.accountSignupComplete ? : null} {authenticatedUser ? ( { }, }} > - - - - - - } - count={draftEntities?.length} - /> - - + {authenticatedUser.accountSignupComplete && ( + <> + + + + + + } + count={draftEntities?.length} + /> + + + + )} ) : ( diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar.tsx index e75d7045e66..82fd3bc7af8 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar.tsx @@ -60,12 +60,16 @@ export const LayoutWithSidebar: FunctionComponent = ({ easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.enteringScreen, }), - ...(sidebarOpen && { + ...((sidebarOpen || isReadonlyMode) && { marginLeft: 0, }), })} > - + ({ diff --git a/apps/hash-frontend/src/shared/ui/modal.tsx b/apps/hash-frontend/src/shared/ui/modal.tsx index 9dbd40b31fc..222ca35edf5 100644 --- a/apps/hash-frontend/src/shared/ui/modal.tsx +++ b/apps/hash-frontend/src/shared/ui/modal.tsx @@ -1,7 +1,21 @@ import type { ModalProps } from "@hashintel/design-system"; -import { Modal as BaseModal } from "@hashintel/design-system"; +import { IconButton, Modal as BaseModal } from "@hashintel/design-system"; +import { Box, Stack, Typography } from "@mui/material"; -export const Modal = ({ sx, ...props }: ModalProps) => ( +import { XMarkRegularIcon } from "../icons/x-mark-regular-icon"; + +export const Modal = ({ + sx, + header, + children, + ...props +}: ModalProps & { + header?: { + hideCloseButton?: boolean; + subtitle?: string; + title?: string; + }; +}) => ( ({ @@ -12,5 +26,56 @@ export const Modal = ({ sx, ...props }: ModalProps) => ( ...(Array.isArray(sx) ? sx : [sx]), ]} {...props} - /> + > + <> + {header && ( + `1px solid ${palette.gray[20]}`, + py: header.subtitle ? 1.5 : 1, + pl: 2.5, + pr: 1, + }} + > + + {header.title && ( + palette.gray[80], + }} + gutterBottom={!!header.subtitle} + > + {header.title} + + )} + {header.subtitle && ( + palette.gray[80], + }} + > + {header.subtitle} + + )} + + + {!header.hideCloseButton && props.onClose && ( + props.onClose?.(event, "escapeKeyDown")} + sx={{ "& svg": { fontSize: 20 } }} + > + + + )} + + )} + {children} + + ); diff --git a/apps/hashdotdev/src/components/footer.tsx b/apps/hashdotdev/src/components/footer.tsx index bc436bb723f..ee205368e22 100644 --- a/apps/hashdotdev/src/components/footer.tsx +++ b/apps/hashdotdev/src/components/footer.tsx @@ -13,7 +13,7 @@ import { SITE_DESCRIPTION } from "../config"; import { DiscordIcon } from "./icons/discord-icon"; import { FontAwesomeIcon } from "./icons/font-awesome-icon"; import { GithubIcon } from "./icons/github-icon"; -import { TwitterIcon } from "./icons/twitter-icon"; +import { XTwitterIcon } from "./icons/x-twitter-icon"; import { Link } from "./link"; import { Logo } from "./logo"; import { Spacer } from "./spacer"; @@ -154,8 +154,8 @@ export const Footer: FunctionComponent = () => ( - - + + diff --git a/apps/hashdotdev/src/components/icons/twitter-icon.tsx b/apps/hashdotdev/src/components/icons/twitter-icon.tsx deleted file mode 100644 index 318dca43b80..00000000000 --- a/apps/hashdotdev/src/components/icons/twitter-icon.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { SvgIconProps } from "@mui/material"; -import { SvgIcon } from "@mui/material"; -import type { FunctionComponent } from "react"; - -export const TwitterIcon: FunctionComponent = ({ - sx = [], - ...props -}) => ( - - - -); diff --git a/apps/hashdotdev/src/components/icons/x-twitter-icon.tsx b/apps/hashdotdev/src/components/icons/x-twitter-icon.tsx new file mode 100644 index 00000000000..bca1bb51281 --- /dev/null +++ b/apps/hashdotdev/src/components/icons/x-twitter-icon.tsx @@ -0,0 +1,17 @@ +import type { SvgIconProps } from "@mui/material"; +import { SvgIcon } from "@mui/material"; +import type { FunctionComponent } from "react"; + +export const XTwitterIcon: FunctionComponent = (props) => { + return ( + + + + ); +}; diff --git a/infra/terraform/hash/main.tf b/infra/terraform/hash/main.tf index ab99e0e678c..1ddadc77e68 100644 --- a/infra/terraform/hash/main.tf +++ b/infra/terraform/hash/main.tf @@ -361,6 +361,10 @@ module "application" { name = "HASH_VAULT_ROOT_TOKEN", secret = true, value = sensitive(data.vault_kv_secret_v2.secrets.data["hash_vault_root_token"]) }, + { + name = "INTERNAL_API_KEY", secret = true, + value = sensitive(data.vault_kv_secret_v2.secrets.data["internal_api_key"]) + }, # { name = "LINEAR_CLIENT_ID", secret = true, value = sensitive(data.vault_kv_secret_v2.secrets.data["linear_client_id"]) }, # { name = "LINEAR_CLIENT_SECRET", secret = true, value = sensitive(data.vault_kv_secret_v2.secrets.data["linear_client_secret"]) }, { diff --git a/libs/@hashintel/design-system/src/components.ts b/libs/@hashintel/design-system/src/components.ts index f509846c373..96f746ff7a9 100644 --- a/libs/@hashintel/design-system/src/components.ts +++ b/libs/@hashintel/design-system/src/components.ts @@ -23,10 +23,12 @@ export * from "./icon-arrow-up-wide-short-light"; export * from "./icon-asterisk-regular"; export * from "./icon-at-regular"; export * from "./icon-barcode"; +export * from "./icon-bug"; export * from "./icon-bullseye-light"; export * from "./icon-button"; export * from "./icon-caret-down-solid"; export * from "./icon-check"; +export * from "./icon-chrome"; export * from "./icon-circle-check-regular"; export * from "./icon-circle-ellipsis-regular"; export * from "./icon-circle-nodes-light"; @@ -35,6 +37,7 @@ export * from "./icon-circle-plus"; export * from "./icon-clock-regular"; export * from "./icon-close"; export * from "./icon-dash"; +export * from "./icon-discord"; export * from "./icon-download-regular"; export * from "./icon-eye-regular"; export * from "./icon-eye-slash-regular"; @@ -49,6 +52,7 @@ export * from "./icon-image-solid"; export * from "./icon-infinity-light"; export * from "./icon-input-pipe"; export * from "./icon-input-pipe-regular"; +export * from "./icon-lightbulb-on-rainbow"; export * from "./icon-lightbulb-on-regular"; export * from "./icon-link"; export * from "./icon-list-regular"; @@ -68,6 +72,7 @@ export * from "./icon-sparkles-light"; export * from "./icon-table-light"; export * from "./icon-terminal-light"; export * from "./icon-wand-magic-sparkles"; +export * from "./icon-x-twitter"; export * from "./image-with-checked-background"; export * from "./input-props"; export * from "./loading-spinner"; diff --git a/libs/@hashintel/design-system/src/icon-bug.tsx b/libs/@hashintel/design-system/src/icon-bug.tsx new file mode 100644 index 00000000000..928eba938fc --- /dev/null +++ b/libs/@hashintel/design-system/src/icon-bug.tsx @@ -0,0 +1,21 @@ +import type { SvgIconProps } from "@mui/material"; +import { SvgIcon } from "@mui/material"; +import type { FunctionComponent } from "react"; + +export const BugIcon: FunctionComponent = ({ + sx = [], + ...props +}) => { + return ( + + + + ); +}; diff --git a/libs/@hashintel/design-system/src/icon-chrome.tsx b/libs/@hashintel/design-system/src/icon-chrome.tsx new file mode 100644 index 00000000000..57bf30db486 --- /dev/null +++ b/libs/@hashintel/design-system/src/icon-chrome.tsx @@ -0,0 +1,526 @@ +import type { SvgIconProps } from "@mui/material"; +import { SvgIcon } from "@mui/material"; +import type { FunctionComponent } from "react"; + +export const ChromeIcon: FunctionComponent = ({ + sx = [], + ...props +}) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/libs/@hashintel/design-system/src/icon-discord.tsx b/libs/@hashintel/design-system/src/icon-discord.tsx new file mode 100644 index 00000000000..a7cf8e4a9cf --- /dev/null +++ b/libs/@hashintel/design-system/src/icon-discord.tsx @@ -0,0 +1,9 @@ +import type { SvgIconProps } from "@mui/material"; +import { SvgIcon } from "@mui/material"; +import type { FunctionComponent } from "react"; + +export const DiscordIcon: FunctionComponent = (props) => ( + + + +); diff --git a/libs/@hashintel/design-system/src/icon-lightbulb-on-rainbow.tsx b/libs/@hashintel/design-system/src/icon-lightbulb-on-rainbow.tsx new file mode 100644 index 00000000000..991a5fec84f --- /dev/null +++ b/libs/@hashintel/design-system/src/icon-lightbulb-on-rainbow.tsx @@ -0,0 +1,38 @@ +import type { SvgIconProps } from "@mui/material"; +import { SvgIcon } from "@mui/material"; +import type { FunctionComponent } from "react"; + +export const LightbulbOnRainbowIcon: FunctionComponent = ( + props, +) => { + return ( + + + + + + + + + + + + + + + ); +}; diff --git a/libs/@hashintel/design-system/src/icon-x-twitter.tsx b/libs/@hashintel/design-system/src/icon-x-twitter.tsx new file mode 100644 index 00000000000..bca1bb51281 --- /dev/null +++ b/libs/@hashintel/design-system/src/icon-x-twitter.tsx @@ -0,0 +1,17 @@ +import type { SvgIconProps } from "@mui/material"; +import { SvgIcon } from "@mui/material"; +import type { FunctionComponent } from "react"; + +export const XTwitterIcon: FunctionComponent = (props) => { + return ( + + + + ); +}; diff --git a/libs/@hashintel/design-system/src/theme/components/inputs/mui-button-theme-options.ts b/libs/@hashintel/design-system/src/theme/components/inputs/mui-button-theme-options.ts index c081e36298f..644e8e4bc73 100644 --- a/libs/@hashintel/design-system/src/theme/components/inputs/mui-button-theme-options.ts +++ b/libs/@hashintel/design-system/src/theme/components/inputs/mui-button-theme-options.ts @@ -77,6 +77,46 @@ export const MuiButtonThemeOptions: Components["MuiButton"] = { borderColor: theme.palette.blue["70"], }; + /** ====================== SIZE specific styling ============================= */ + + baseStyles = { + ...baseStyles, + borderRadius: `${buttonBorderRadius.md}px`, + ...(size === "large" && { + padding: "16px 32px", + minHeight: 56, + minWidth: 120, + borderRadius: `${buttonBorderRadius.lg}px`, + ...theme.typography.largeTextLabels, + }), + ...(size === "medium" && { + padding: "12px 20px", + minHeight: 48, + minWidth: 104, + ...theme.typography.regularTextLabels, + }), + ...(size === "small" && { + padding: "12px 20px", + minHeight: 42, + minWidth: 78, + ...theme.typography.smallTextLabels, + }), + ...(size === "xs" && { + padding: "8px 16px", + minHeight: 34, + minWidth: 52, + ...theme.typography.smallTextLabels, + fontSize: + variant === "secondary_quiet" + ? "var(--step--2)" + : theme.typography.smallTextLabels.fontSize, + }), + fontWeight: 600, + ...(["tertiary", "tertiary_quiet"].includes(variant ?? "primary") && { + fontWeight: 500, + }), + }; + /** ====================== VARIANTS specific styling ============================= */ if (variant === "primary") { @@ -211,47 +251,28 @@ export const MuiButtonThemeOptions: Components["MuiButton"] = { ...hoverStyles, background: theme.palette.red[70], }; - } - - /** ====================== SIZE specific styling ============================= */ + } else if (variant === "white_cta") { + baseStyles = { + ...baseStyles, + background: theme.palette.common.white, + border: "1px solid transparent", + boxShadow: theme.boxShadows.md, + borderRadius: 8, + color: theme.palette.common.black, + transition: "none", + }; - baseStyles = { - ...baseStyles, - borderRadius: `${buttonBorderRadius.md}px`, - ...(size === "large" && { - padding: "16px 32px", - minHeight: 56, - minWidth: 120, - borderRadius: `${buttonBorderRadius.lg}px`, - ...theme.typography.largeTextLabels, - }), - ...(size === "medium" && { - padding: "12px 20px", - minHeight: 48, - minWidth: 104, - ...theme.typography.regularTextLabels, - }), - ...(size === "small" && { - padding: "12px 20px", - minHeight: 42, - minWidth: 78, - ...theme.typography.smallTextLabels, - }), - ...(size === "xs" && { - padding: "8px 16px", - minHeight: 34, - minWidth: 52, - ...theme.typography.smallTextLabels, - fontSize: - variant === "secondary_quiet" - ? "var(--step--2)" - : theme.typography.smallTextLabels.fontSize, - }), - fontWeight: 600, - ...(["tertiary", "tertiary_quiet"].includes(variant ?? "primary") && { - fontWeight: 500, - }), - }; + hoverStyles = { + ...hoverStyles, + background: "linear-gradient(87.69deg, #EDFBFF 0%, #FFFFFF 96.24%)", + boxShadow: + "0px 0.2px 0.63px 0px rgba(33, 77, 223, 0.07), 0px 4.24px 8.1px 0px rgba(21, 68, 222, 0.06), 0px 7.13px 18.37px 0px rgba(22, 70, 225, 0.05), 0px 11px 30px 0px rgba(22, 69, 221, 0.04)", + transition: theme.transitions.create("background"), + svg: { + filter: "brightness(120%)", + }, + }; + } return { ...baseStyles, diff --git a/libs/@hashintel/design-system/theme-override.d.ts b/libs/@hashintel/design-system/theme-override.d.ts index da8b69becef..3d13bb45c6c 100644 --- a/libs/@hashintel/design-system/theme-override.d.ts +++ b/libs/@hashintel/design-system/theme-override.d.ts @@ -140,6 +140,7 @@ declare module "@mui/material/Button" { secondary_quiet: true; tertiary: true; tertiary_quiet: true; + white_cta: true; warning: true; danger: true; // Disable defaults diff --git a/libs/@local/hash-backend-utils/package.json b/libs/@local/hash-backend-utils/package.json index 838f13aae89..27581b288fb 100644 --- a/libs/@local/hash-backend-utils/package.json +++ b/libs/@local/hash-backend-utils/package.json @@ -31,6 +31,7 @@ "@local/hash-graph-client": "0.0.0-private", "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", + "@local/internal-api-client": "0.0.0-private", "@local/status": "0.0.0-private", "@opensearch-project/opensearch": "1.1.0", "@sentry/node": "7.116.0", diff --git a/apps/hash-ai-worker-ts/src/activities/shared/internal-api-client.ts b/libs/@local/hash-backend-utils/src/internal-api-client.ts similarity index 85% rename from apps/hash-ai-worker-ts/src/activities/shared/internal-api-client.ts rename to libs/@local/hash-backend-utils/src/internal-api-client.ts index da4583db774..5c154f44451 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/internal-api-client.ts +++ b/libs/@local/hash-backend-utils/src/internal-api-client.ts @@ -1,3 +1,4 @@ +import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; import { Configuration, DefaultApi as InternalApiClient, @@ -9,7 +10,7 @@ const basePath = process.env.INTERNAL_API_HOST ?? "http://localhost:5002"; const internalApiKey = process.env.INTERNAL_API_KEY; -if (!internalApiKey) { +if (!isSelfHostedInstance && !internalApiKey) { throw new Error("INTERNAL_API_KEY is required"); } @@ -36,7 +37,7 @@ axiosInstance.interceptors.response.use( }, ); -export const internalApi = new InternalApiClient( +export const internalApiClient = new InternalApiClient( config, basePath, axiosInstance, diff --git a/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts b/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts index 94f34131ad0..136c2328808 100644 --- a/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts +++ b/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts @@ -45,6 +45,8 @@ export const scalars = { UserPermissions: "@local/hash-isomorphic-utils/types#UserPermissions", UserPermissionsOnEntityType: "@local/hash-isomorphic-utils/types#UserPermissionsOnEntityType", + ProspectiveUserProperties: + "@local/hash-isomorphic-utils/system-types/prospectiveuser#ProspectiveUserProperties", GraphElementVertexId: "@local/hash-subgraph#GraphElementVertexId", Edges: "@local/hash-subgraph#Edges", diff --git a/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/user.typedef.ts b/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/user.typedef.ts index 5724c735119..7adcc5937d8 100644 --- a/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/user.typedef.ts +++ b/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/user.typedef.ts @@ -2,6 +2,7 @@ import { gql } from "apollo-server-express"; export const userTypedef = gql` scalar AggregatedUsageRecord + scalar ProspectiveUserProperties type UserUsageRecords { shortname: String! @@ -23,5 +24,14 @@ export const userTypedef = gql` hasAccessToHash: Boolean! getUsageRecords: [UserUsageRecords!]! + + """ + Get the user's position on the access waitlist (for hosted HASH) + """ + getWaitlistPosition: Int! + } + + extend type Mutation { + submitEarlyAccessForm(properties: ProspectiveUserProperties!): Boolean } `; diff --git a/libs/@local/hash-isomorphic-utils/src/instance.ts b/libs/@local/hash-isomorphic-utils/src/instance.ts new file mode 100644 index 00000000000..565971f18d3 --- /dev/null +++ b/libs/@local/hash-isomorphic-utils/src/instance.ts @@ -0,0 +1,9 @@ +import { frontendUrl } from "@local/hash-isomorphic-utils/environment"; + +// Whether this is a self-hosted instance, rather than the central HASH hosted instance +export const isSelfHostedInstance = + process.env.SELF_HOSTED_HASH === "true" || + process.env.NEXT_PUBLIC_SELF_HOSTED_HASH === "true" || + !["http://localhost:3000", "https://app.hash.ai", "https://hash.ai"].includes( + frontendUrl, + ); diff --git a/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts b/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts index 28529a9360f..320cb252e63 100644 --- a/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts +++ b/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts @@ -69,12 +69,6 @@ export const systemEntityTypes = { entityTypeBaseUrl: "https://hash.ai/@hash/types/entity-type/github-account/", }, - googleSheetsIntegration: { - entityTypeId: - "https://hash.ai/@hash/types/entity-type/google-sheets-integration/v/1", - entityTypeBaseUrl: - "https://hash.ai/@hash/types/entity-type/google-sheets-integration/", - }, graphChangeNotification: { entityTypeId: "https://hash.ai/@hash/types/entity-type/graph-change-notification/v/1", @@ -149,6 +143,12 @@ export const systemEntityTypes = { entityTypeId: "https://hash.ai/@hash/types/entity-type/profile-bio/v/1", entityTypeBaseUrl: "https://hash.ai/@hash/types/entity-type/profile-bio/", }, + prospectiveUser: { + entityTypeId: + "https://hash.ai/@hash/types/entity-type/prospective-user/v/1", + entityTypeBaseUrl: + "https://hash.ai/@hash/types/entity-type/prospective-user/", + }, quickNote: { entityTypeId: "https://hash.ai/@hash/types/entity-type/quick-note/v/1", entityTypeBaseUrl: "https://hash.ai/@hash/types/entity-type/quick-note/", @@ -381,6 +381,12 @@ export const systemPropertyTypes = { propertyTypeBaseUrl: "https://hash.ai/@hash/types/property-type/connection-source-name/", }, + currentApproach: { + propertyTypeId: + "https://hash.ai/@hash/types/property-type/current-approach/v/1", + propertyTypeBaseUrl: + "https://hash.ai/@hash/types/property-type/current-approach/", + }, dataAudience: { propertyTypeId: "https://hash.ai/@hash/types/property-type/data-audience/v/1", @@ -504,6 +510,12 @@ export const systemPropertyTypes = { propertyTypeBaseUrl: "https://hash.ai/@hash/types/property-type/input-unit-count/", }, + intendedUse: { + propertyTypeId: + "https://hash.ai/@hash/types/property-type/intended-use/v/1", + propertyTypeBaseUrl: + "https://hash.ai/@hash/types/property-type/intended-use/", + }, kratosIdentityId: { propertyTypeId: "https://hash.ai/@hash/types/property-type/kratos-identity-id/v/1", @@ -610,6 +622,10 @@ export const systemPropertyTypes = { propertyTypeBaseUrl: "https://hash.ai/@hash/types/property-type/resolved-at/", }, + role: { + propertyTypeId: "https://hash.ai/@hash/types/property-type/role/v/1", + propertyTypeBaseUrl: "https://hash.ai/@hash/types/property-type/role/", + }, rotationInRads: { propertyTypeId: "https://hash.ai/@hash/types/property-type/rotation-in-rads/v/1", @@ -700,6 +716,12 @@ export const systemPropertyTypes = { propertyTypeBaseUrl: "https://hash.ai/@hash/types/property-type/width-in-pixels/", }, + willingToPay: { + propertyTypeId: + "https://hash.ai/@hash/types/property-type/willing-to-pay/v/1", + propertyTypeBaseUrl: + "https://hash.ai/@hash/types/property-type/willing-to-pay/", + }, xPosition: { propertyTypeId: "https://hash.ai/@hash/types/property-type/x-position/v/1", propertyTypeBaseUrl: diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/googlesheetsintegration.ts b/libs/@local/hash-isomorphic-utils/src/system-types/googlesheetsintegration.ts deleted file mode 100644 index ada659c311e..00000000000 --- a/libs/@local/hash-isomorphic-utils/src/system-types/googlesheetsintegration.ts +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was automatically generated – do not edit it. - */ - -import type { Entity, LinkData } from "@local/hash-subgraph"; - -import type { - ConnectionSourceNamePropertyValue, - DisplayNamePropertyValue, - EmailPropertyValue, - ExpiredAtPropertyValue, - Link, - LinkOutgoingLinkAndTarget, - LinkOutgoingLinksByLinkEntityTypeId, - LinkProperties, - ObjectDataType, - TextDataType, - UserSecret, - UserSecretOutgoingLinkAndTarget, - UserSecretOutgoingLinksByLinkEntityTypeId, - UserSecretProperties, - UsesUserSecret, - UsesUserSecretOutgoingLinkAndTarget, - UsesUserSecretOutgoingLinksByLinkEntityTypeId, - UsesUserSecretProperties, - VaultPathPropertyValue, -} from "./shared"; - -export type { - ConnectionSourceNamePropertyValue, - DisplayNamePropertyValue, - EmailPropertyValue, - ExpiredAtPropertyValue, - Link, - LinkOutgoingLinkAndTarget, - LinkOutgoingLinksByLinkEntityTypeId, - LinkProperties, - ObjectDataType, - TextDataType, - UserSecret, - UserSecretOutgoingLinkAndTarget, - UserSecretOutgoingLinksByLinkEntityTypeId, - UserSecretProperties, - UsesUserSecret, - UsesUserSecretOutgoingLinkAndTarget, - UsesUserSecretOutgoingLinksByLinkEntityTypeId, - UsesUserSecretProperties, - VaultPathPropertyValue, -}; - -export type Account = Entity; - -/** - * A unique identifier for a Google account. - */ -export type AccountIdPropertyValue = TextDataType; - -export type AccountOutgoingLinkAndTarget = AccountUsesUserSecretLink; - -export type AccountOutgoingLinksByLinkEntityTypeId = { - "https://hash.ai/@hash/types/entity-type/uses-user-secret/v/1": AccountUsesUserSecretLink; -}; - -/** - * A Google user account. - */ -export type AccountProperties = { - "https://blockprotocol.org/@blockprotocol/types/property-type/display-name/": DisplayNamePropertyValue; - "https://hash.ai/@google/types/property-type/account-id/": AccountIdPropertyValue; - "https://hash.ai/@hash/types/property-type/email/": EmailPropertyValue; -}; - -export type AccountUsesUserSecretLink = { - linkEntity: UsesUserSecret; - rightEntity: UserSecret; -}; - -/** - * The type of thing that can, should or will act on something. - */ -export type ActorTypeDataType = "human" | "machine"; - -export type AssociatedWithAccount = Entity & { - linkData: LinkData; -}; - -export type AssociatedWithAccountOutgoingLinkAndTarget = never; - -export type AssociatedWithAccountOutgoingLinksByLinkEntityTypeId = {}; - -/** - * The account that something is associated with. - */ -export type AssociatedWithAccountProperties = AssociatedWithAccountProperties1 & - AssociatedWithAccountProperties2; -export type AssociatedWithAccountProperties1 = LinkProperties; - -export type AssociatedWithAccountProperties2 = {}; - -/** - * The expected audience for some data. - */ -export type DataAudiencePropertyValue = ActorTypeDataType; - -/** - * A system identifier for a file. - */ -export type FileIdPropertyValue = TextDataType; - -export type GoogleSheetsIntegration = Entity; - -export type GoogleSheetsIntegrationAssociatedWithAccountLink = { - linkEntity: AssociatedWithAccount; - rightEntity: Account; -}; - -export type GoogleSheetsIntegrationHasQueryLink = { - linkEntity: HasQuery; - rightEntity: Query; -}; - -export type GoogleSheetsIntegrationOutgoingLinkAndTarget = - | GoogleSheetsIntegrationHasQueryLink - | GoogleSheetsIntegrationAssociatedWithAccountLink; - -export type GoogleSheetsIntegrationOutgoingLinksByLinkEntityTypeId = { - "https://blockprotocol.org/@hash/types/entity-type/has-query/v/1": GoogleSheetsIntegrationHasQueryLink; - "https://hash.ai/@hash/types/entity-type/associated-with-account/v/1": GoogleSheetsIntegrationAssociatedWithAccountLink; -}; - -/** - * An integration with Google Sheets. - */ -export type GoogleSheetsIntegrationProperties = { - "https://hash.ai/@hash/types/property-type/data-audience/": DataAudiencePropertyValue; - "https://hash.ai/@hash/types/property-type/file-id/": FileIdPropertyValue; -}; - -export type HasQuery = Entity & { linkData: LinkData }; - -export type HasQueryOutgoingLinkAndTarget = never; - -export type HasQueryOutgoingLinksByLinkEntityTypeId = {}; - -/** - * The query that something has. - */ -export type HasQueryProperties = HasQueryProperties1 & HasQueryProperties2; -export type HasQueryProperties1 = LinkProperties; - -export type HasQueryProperties2 = {}; - -export type Query = Entity; - -export type QueryOutgoingLinkAndTarget = never; - -export type QueryOutgoingLinksByLinkEntityTypeId = {}; - -export type QueryProperties = { - "https://blockprotocol.org/@hash/types/property-type/query/": QueryPropertyValue; -}; - -/** - * The query for something. - */ -export type QueryPropertyValue = ObjectDataType; diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts b/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts index 50478182d2d..ef8d576fd38 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts @@ -134,10 +134,6 @@ import type { UserSecretOutgoingLinkAndTarget, UserSecretOutgoingLinksByLinkEntityTypeId, UserSecretProperties, - UsesUserSecret, - UsesUserSecretOutgoingLinkAndTarget, - UsesUserSecretOutgoingLinksByLinkEntityTypeId, - UsesUserSecretProperties, VaultPathPropertyValue, WebsiteURLPropertyValue, } from "./shared"; @@ -272,10 +268,6 @@ export type { UserSecretOutgoingLinkAndTarget, UserSecretOutgoingLinksByLinkEntityTypeId, UserSecretProperties, - UsesUserSecret, - UsesUserSecretOutgoingLinkAndTarget, - UsesUserSecretOutgoingLinksByLinkEntityTypeId, - UsesUserSecretProperties, VaultPathPropertyValue, WebsiteURLPropertyValue, }; @@ -336,3 +328,20 @@ export type SyncLinearDataWithProperties1 = LinkProperties; export type SyncLinearDataWithProperties2 = { "https://hash.ai/@hash/types/property-type/linear-team-id/"?: LinearTeamIdPropertyValue[]; }; + +export type UsesUserSecret = Entity & { + linkData: LinkData; +}; + +export type UsesUserSecretOutgoingLinkAndTarget = never; + +export type UsesUserSecretOutgoingLinksByLinkEntityTypeId = {}; + +/** + * The user secret something uses. + */ +export type UsesUserSecretProperties = UsesUserSecretProperties1 & + UsesUserSecretProperties2; +export type UsesUserSecretProperties1 = LinkProperties; + +export type UsesUserSecretProperties2 = {}; diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/prospectiveuser.ts b/libs/@local/hash-isomorphic-utils/src/system-types/prospectiveuser.ts new file mode 100644 index 00000000000..6d89082d553 --- /dev/null +++ b/libs/@local/hash-isomorphic-utils/src/system-types/prospectiveuser.ts @@ -0,0 +1,51 @@ +/** + * This file was automatically generated – do not edit it. + */ + +import type { Entity } from "@local/hash-subgraph"; + +import type { + EmailPropertyValue, + TextDataType, + WebsiteURLPropertyValue, +} from "./shared"; + +export type { EmailPropertyValue, TextDataType, WebsiteURLPropertyValue }; + +/** + * The name or description of the current approach to something + */ +export type CurrentApproachPropertyValue = TextDataType; + +/** + * The name or description of someone's intended use of something + */ +export type IntendedUsePropertyValue = TextDataType; + +export type ProspectiveUser = Entity; + +export type ProspectiveUserOutgoingLinkAndTarget = never; + +export type ProspectiveUserOutgoingLinksByLinkEntityTypeId = {}; + +/** + * The + */ +export type ProspectiveUserProperties = { + "https://hash.ai/@hash/types/property-type/current-approach/": CurrentApproachPropertyValue; + "https://hash.ai/@hash/types/property-type/email/": EmailPropertyValue; + "https://hash.ai/@hash/types/property-type/intended-use/": IntendedUsePropertyValue; + "https://hash.ai/@hash/types/property-type/role/": RolePropertyValue; + "https://hash.ai/@hash/types/property-type/website-url/": WebsiteURLPropertyValue; + "https://hash.ai/@hash/types/property-type/willing-to-pay/": WillingToPayPropertyValue; +}; + +/** + * The name of someone or something's role. + */ +export type RolePropertyValue = TextDataType; + +/** + * The amount that someone is willing to pay for something + */ +export type WillingToPayPropertyValue = TextDataType; diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts b/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts index 64ac05625b8..2ef08a373c5 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts @@ -994,23 +994,6 @@ export type UserSecretProperties = { "https://hash.ai/@hash/types/property-type/vault-path/": VaultPathPropertyValue; }; -export type UsesUserSecret = Entity & { - linkData: LinkData; -}; - -export type UsesUserSecretOutgoingLinkAndTarget = never; - -export type UsesUserSecretOutgoingLinksByLinkEntityTypeId = {}; - -/** - * The user secret something uses. - */ -export type UsesUserSecretProperties = UsesUserSecretProperties1 & - UsesUserSecretProperties2; -export type UsesUserSecretProperties1 = LinkProperties; - -export type UsesUserSecretProperties2 = {}; - /** * The path to a secret in Hashicorp Vault. */ diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts b/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts index eb9ea23e59f..2f9b87be484 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts @@ -87,7 +87,7 @@ export type IncurredInOutgoingLinkAndTarget = never; export type IncurredInOutgoingLinksByLinkEntityTypeId = {}; /** - * Something that was incurred by something else. + * Something that was incurred in something else. */ export type IncurredInProperties = IncurredInProperties1 & IncurredInProperties2; diff --git a/libs/@local/internal-api-client/typescript/api.ts b/libs/@local/internal-api-client/typescript/api.ts index 22fb44c0098..7ba2cec3891 100644 --- a/libs/@local/internal-api-client/typescript/api.ts +++ b/libs/@local/internal-api-client/typescript/api.ts @@ -508,6 +508,25 @@ export interface GetUpcomingInvoice200Response { */ upcomingInvoice: StripeUpcomingInvoice; } +/** + * + * @export + * @interface GetWaitlistPosition200Response + */ +export interface GetWaitlistPosition200Response { + /** + * + * @type {GetWaitlistPosition200ResponseWaitlistPosition} + * @memberof GetWaitlistPosition200Response + */ + waitlistPosition: GetWaitlistPosition200ResponseWaitlistPosition; +} +/** + * @type GetWaitlistPosition200ResponseWaitlistPosition + * @export + */ +export type GetWaitlistPosition200ResponseWaitlistPosition = null | number; + /** * * @export @@ -1485,6 +1504,53 @@ export const DefaultApiAxiosParamCreator = function ( options: localVarRequestOptions, }; }, + /** + * + * @summary Get position of a user in the HASH waitlist + * @param {string} email The email of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getWaitlistPosition: async ( + email: string, + options: AxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'email' is not null or undefined + assertParamExists("getWaitlistPosition", "email", email); + const localVarPath = `/waitlist-position`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (email !== undefined) { + localVarQueryParameter["email"] = email; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary Get web search results based on a text query @@ -2108,6 +2174,31 @@ export const DefaultApiFp = function (configuration?: Configuration) { configuration, ); }, + /** + * + * @summary Get position of a user in the HASH waitlist + * @param {string} email The email of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getWaitlistPosition( + email: string, + options?: AxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getWaitlistPosition(email, options); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + ); + }, /** * * @summary Get web search results based on a text query @@ -2441,6 +2532,21 @@ export const DefaultApiFactory = function ( .getUpcomingInvoice(newSubscriptionTier, options) .then((request) => request(axios, basePath)); }, + /** + * + * @summary Get position of a user in the HASH waitlist + * @param {string} email The email of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getWaitlistPosition( + email: string, + options?: any, + ): AxiosPromise { + return localVarFp + .getWaitlistPosition(email, options) + .then((request) => request(axios, basePath)); + }, /** * * @summary Get web search results based on a text query @@ -2692,6 +2798,19 @@ export interface DefaultApiInterface { options?: AxiosRequestConfig, ): AxiosPromise; + /** + * + * @summary Get position of a user in the HASH waitlist + * @param {string} email The email of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getWaitlistPosition( + email: string, + options?: AxiosRequestConfig, + ): AxiosPromise; + /** * * @summary Get web search results based on a text query @@ -2965,6 +3084,20 @@ export class DefaultApi extends BaseAPI implements DefaultApiInterface { .then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary Get position of a user in the HASH waitlist + * @param {string} email The email of the user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getWaitlistPosition(email: string, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration) + .getWaitlistPosition(email, options) + .then((request) => request(this.axios, this.basePath)); + } + /** * * @summary Get web search results based on a text query diff --git a/libs/@local/internal-api-client/typescript/package.json b/libs/@local/internal-api-client/typescript/package.json index 9c03fad348c..76d64ec384d 100644 --- a/libs/@local/internal-api-client/typescript/package.json +++ b/libs/@local/internal-api-client/typescript/package.json @@ -7,7 +7,7 @@ "type": "module", "main": "index.ts", "scripts": { - "generate": "openapi-generator-cli generate && yarn workspace @local/internal-api-client build && prettier --cache --write --ignore-unknown .", + "generate": "openapi-generator-cli generate && prettier --cache --write --ignore-unknown .", "validate": "openapi-generator-cli validate" }, "dependencies": { diff --git a/tests/hash-playwright/tests/guest-user.spec.ts b/tests/hash-playwright/tests/guest-user.spec.ts index d2e8ba8c8ac..24824e48344 100644 --- a/tests/hash-playwright/tests/guest-user.spec.ts +++ b/tests/hash-playwright/tests/guest-user.spec.ts @@ -10,6 +10,10 @@ test.beforeEach(async () => { test("guest user navigation to login and signup pages", async ({ page }) => { await page.goto("/"); + + await expect(page.locator("text=Create an account")).toBeVisible(); + await page.click("text=Sign in"); + await page.waitForURL("**/signin"); await expect(page.locator("text=SIGN IN TO YOUR ACCOUNT")).toBeVisible(); diff --git a/tests/hash-playwright/tests/signup.spec.ts b/tests/hash-playwright/tests/signup.spec.ts index edf2ac542cb..b783626ae9b 100644 --- a/tests/hash-playwright/tests/signup.spec.ts +++ b/tests/hash-playwright/tests/signup.spec.ts @@ -7,6 +7,9 @@ test.beforeEach(async () => { test("user can sign up", async ({ page }) => { await page.goto("/"); + + await page.click("text=Sign in"); + await page.waitForURL("**/signin"); await expect(page.locator("text=SIGN IN TO YOUR ACCOUNT")).toBeVisible(); From d2a94b9a7bf5dec7b819173b89e94d722bbae559 Mon Sep 17 00:00:00 2001 From: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> Date: Fri, 24 May 2024 16:10:17 +0200 Subject: [PATCH 07/27] H-2772: Move `graph-benches` to `tests/` (#4514) --- Cargo.toml | 2 +- apps/hash-graph/package.json | 1 - libs/@local/repo-chores/rust/turbo.json | 2 +- {apps/hash-graph/bench => tests/hash-graph-benches}/Cargo.toml | 0 {apps/hash-graph/bench => tests/hash-graph-benches}/LICENSE.md | 0 .../hash-graph/bench => tests/hash-graph-benches}/package.json | 0 .../read_scaling/knowledge/complete/entity.rs | 0 .../hash-graph-benches}/read_scaling/knowledge/complete/mod.rs | 0 .../read_scaling/knowledge/linkless/entity.rs | 0 .../hash-graph-benches}/read_scaling/knowledge/linkless/mod.rs | 0 .../hash-graph-benches}/read_scaling/knowledge/mod.rs | 0 .../bench => tests/hash-graph-benches}/read_scaling/lib.rs | 0 .../hash-graph-benches}/representative_read/knowledge/entity.rs | 0 .../hash-graph-benches}/representative_read/knowledge/mod.rs | 0 .../hash-graph-benches}/representative_read/lib.rs | 0 .../representative_read/ontology/entity_type.rs | 0 .../hash-graph-benches}/representative_read/ontology/mod.rs | 0 .../hash-graph-benches}/representative_read/seed.rs | 0 {apps/hash-graph/bench => tests/hash-graph-benches}/util.rs | 0 .../hash-graph/bench => tests/hash-graph-benches}/writes/lib.rs | 0 20 files changed, 2 insertions(+), 3 deletions(-) rename {apps/hash-graph/bench => tests/hash-graph-benches}/Cargo.toml (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/LICENSE.md (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/package.json (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/read_scaling/knowledge/complete/entity.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/read_scaling/knowledge/complete/mod.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/read_scaling/knowledge/linkless/entity.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/read_scaling/knowledge/linkless/mod.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/read_scaling/knowledge/mod.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/read_scaling/lib.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/representative_read/knowledge/entity.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/representative_read/knowledge/mod.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/representative_read/lib.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/representative_read/ontology/entity_type.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/representative_read/ontology/mod.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/representative_read/seed.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/util.rs (100%) rename {apps/hash-graph/bench => tests/hash-graph-benches}/writes/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index f13379b487a..b9d3e24a0cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,6 @@ cargo-features = ["edition2024"] [workspace] members = [ - "apps/hash-graph/bench", "apps/hash-graph/bins/cli", "apps/hash-graph/libs/*", "libs/@blockprotocol/type-system/rust", @@ -15,6 +14,7 @@ members = [ "libs/@local/repo-chores/rust", "libs/@local/temporal-client", "libs/@local/temporal-versioning", + "tests/hash-graph-benches", "tests/hash-graph-integration", "tests/hash-graph-test-data/rust", "libs/@local/harpc/wire-protocol", diff --git a/apps/hash-graph/package.json b/apps/hash-graph/package.json index 0f77a4c4b0d..757672577ba 100644 --- a/apps/hash-graph/package.json +++ b/apps/hash-graph/package.json @@ -31,7 +31,6 @@ "@rust/graph": "0.0.0-private", "@rust/graph-api": "0.0.0-private", "@rust/hash-graph": "0.0.0-private", - "@rust/repo-chores": "0.0.0-private", "@rust/type-fetcher": "0.0.0-private" }, "devDependencies": { diff --git a/libs/@local/repo-chores/rust/turbo.json b/libs/@local/repo-chores/rust/turbo.json index e3f944e38fd..6206c223cf5 100644 --- a/libs/@local/repo-chores/rust/turbo.json +++ b/libs/@local/repo-chores/rust/turbo.json @@ -2,7 +2,7 @@ "extends": ["//"], "pipeline": { "build": { - "outputs": ["../../../../target/debug/repo-chores-cli"] + "cache": false }, "analyze-benchmarks": { "dependsOn": ["build"], diff --git a/apps/hash-graph/bench/Cargo.toml b/tests/hash-graph-benches/Cargo.toml similarity index 100% rename from apps/hash-graph/bench/Cargo.toml rename to tests/hash-graph-benches/Cargo.toml diff --git a/apps/hash-graph/bench/LICENSE.md b/tests/hash-graph-benches/LICENSE.md similarity index 100% rename from apps/hash-graph/bench/LICENSE.md rename to tests/hash-graph-benches/LICENSE.md diff --git a/apps/hash-graph/bench/package.json b/tests/hash-graph-benches/package.json similarity index 100% rename from apps/hash-graph/bench/package.json rename to tests/hash-graph-benches/package.json diff --git a/apps/hash-graph/bench/read_scaling/knowledge/complete/entity.rs b/tests/hash-graph-benches/read_scaling/knowledge/complete/entity.rs similarity index 100% rename from apps/hash-graph/bench/read_scaling/knowledge/complete/entity.rs rename to tests/hash-graph-benches/read_scaling/knowledge/complete/entity.rs diff --git a/apps/hash-graph/bench/read_scaling/knowledge/complete/mod.rs b/tests/hash-graph-benches/read_scaling/knowledge/complete/mod.rs similarity index 100% rename from apps/hash-graph/bench/read_scaling/knowledge/complete/mod.rs rename to tests/hash-graph-benches/read_scaling/knowledge/complete/mod.rs diff --git a/apps/hash-graph/bench/read_scaling/knowledge/linkless/entity.rs b/tests/hash-graph-benches/read_scaling/knowledge/linkless/entity.rs similarity index 100% rename from apps/hash-graph/bench/read_scaling/knowledge/linkless/entity.rs rename to tests/hash-graph-benches/read_scaling/knowledge/linkless/entity.rs diff --git a/apps/hash-graph/bench/read_scaling/knowledge/linkless/mod.rs b/tests/hash-graph-benches/read_scaling/knowledge/linkless/mod.rs similarity index 100% rename from apps/hash-graph/bench/read_scaling/knowledge/linkless/mod.rs rename to tests/hash-graph-benches/read_scaling/knowledge/linkless/mod.rs diff --git a/apps/hash-graph/bench/read_scaling/knowledge/mod.rs b/tests/hash-graph-benches/read_scaling/knowledge/mod.rs similarity index 100% rename from apps/hash-graph/bench/read_scaling/knowledge/mod.rs rename to tests/hash-graph-benches/read_scaling/knowledge/mod.rs diff --git a/apps/hash-graph/bench/read_scaling/lib.rs b/tests/hash-graph-benches/read_scaling/lib.rs similarity index 100% rename from apps/hash-graph/bench/read_scaling/lib.rs rename to tests/hash-graph-benches/read_scaling/lib.rs diff --git a/apps/hash-graph/bench/representative_read/knowledge/entity.rs b/tests/hash-graph-benches/representative_read/knowledge/entity.rs similarity index 100% rename from apps/hash-graph/bench/representative_read/knowledge/entity.rs rename to tests/hash-graph-benches/representative_read/knowledge/entity.rs diff --git a/apps/hash-graph/bench/representative_read/knowledge/mod.rs b/tests/hash-graph-benches/representative_read/knowledge/mod.rs similarity index 100% rename from apps/hash-graph/bench/representative_read/knowledge/mod.rs rename to tests/hash-graph-benches/representative_read/knowledge/mod.rs diff --git a/apps/hash-graph/bench/representative_read/lib.rs b/tests/hash-graph-benches/representative_read/lib.rs similarity index 100% rename from apps/hash-graph/bench/representative_read/lib.rs rename to tests/hash-graph-benches/representative_read/lib.rs diff --git a/apps/hash-graph/bench/representative_read/ontology/entity_type.rs b/tests/hash-graph-benches/representative_read/ontology/entity_type.rs similarity index 100% rename from apps/hash-graph/bench/representative_read/ontology/entity_type.rs rename to tests/hash-graph-benches/representative_read/ontology/entity_type.rs diff --git a/apps/hash-graph/bench/representative_read/ontology/mod.rs b/tests/hash-graph-benches/representative_read/ontology/mod.rs similarity index 100% rename from apps/hash-graph/bench/representative_read/ontology/mod.rs rename to tests/hash-graph-benches/representative_read/ontology/mod.rs diff --git a/apps/hash-graph/bench/representative_read/seed.rs b/tests/hash-graph-benches/representative_read/seed.rs similarity index 100% rename from apps/hash-graph/bench/representative_read/seed.rs rename to tests/hash-graph-benches/representative_read/seed.rs diff --git a/apps/hash-graph/bench/util.rs b/tests/hash-graph-benches/util.rs similarity index 100% rename from apps/hash-graph/bench/util.rs rename to tests/hash-graph-benches/util.rs diff --git a/apps/hash-graph/bench/writes/lib.rs b/tests/hash-graph-benches/writes/lib.rs similarity index 100% rename from apps/hash-graph/bench/writes/lib.rs rename to tests/hash-graph-benches/writes/lib.rs From 8659d05db5744c5cdd48c3fdeba7e2b61aec42bb Mon Sep 17 00:00:00 2001 From: Ciaran Morinan <37743469+CiaranMn@users.noreply.github.com> Date: Fri, 24 May 2024 18:34:40 +0100 Subject: [PATCH 08/27] H-2722: Add AI-generated name for flow runs (#4504) --- .../src/activities/flow-activities.ts | 2 + .../generate-flow-run-name-activity.ts | 141 ++++++++++++++++++ .../flow-activities/persist-flow-activity.ts | 14 +- .../src/activities/shared/get-llm-response.ts | 26 ++-- .../mock-get-flow-context.ts | 13 +- apps/hash-ai-worker-ts/src/workflows.ts | 4 +- .../src/workflows/run-flow-workflow.ts | 16 ++ .../get-all-steps-in-flow.ts | 4 +- .../run-flow-workflow/initialize-flow.ts | 10 +- .../pass-outputs-to-unprocessed-steps.ts | 4 +- .../015-add-flow-types.dev.migration.ts | 12 +- .../[shortname]/shared/flow-visualizer.tsx | 1 + .../flow-visualizer/flow-run-sidebar.tsx | 47 ++++-- .../src/pages/goals.page/goals-list.tsx | 2 +- .../src/pages/shared/hidden-types.ts | 2 +- apps/hash-frontend/src/pages/workers.page.tsx | 2 +- .../src/graphql/queries/flow.queries.ts | 1 + .../flows/get-flow-run-details.ts | 4 + libs/@local/hash-backend-utils/src/flows.ts | 53 ++++--- .../flows/browser-plugin-flow-definitions.ts | 4 +- .../src/flows/example-flow-definitions.ts | 14 +- .../src/flows/mappings.ts | 30 ++-- .../src/flows/temporal-types.ts | 6 +- .../hash-isomorphic-utils/src/flows/types.ts | 3 +- .../src/graphql/queries/flow.queries.ts | 2 + .../type-defs/knowledge/flow.typedef.ts | 5 + .../src/ontology-type-ids.ts | 8 +- .../src/system-types/flowdefinition.ts | 9 +- .../src/system-types/{flow.ts => flowrun.ts} | 18 ++- .../src/system-types/shared.ts | 18 ++- .../src/system-types/usagerecord.ts | 20 +-- 31 files changed, 370 insertions(+), 125 deletions(-) create mode 100644 apps/hash-ai-worker-ts/src/activities/flow-activities/generate-flow-run-name-activity.ts rename libs/@local/hash-isomorphic-utils/src/system-types/{flow.ts => flowrun.ts} (64%) diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities.ts index 4d419c973df..3c5fa6736ca 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities.ts @@ -2,6 +2,7 @@ import type { VaultClient } from "@local/hash-backend-utils/vault"; import type { ActionDefinitionId } from "@local/hash-isomorphic-utils/flows/action-definitions"; import { answerQuestionAction } from "./flow-activities/answer-question-action"; +import { generateFlowRunName } from "./flow-activities/generate-flow-run-name-activity"; import { generateWebQueriesAction } from "./flow-activities/generate-web-queries-action"; import { getFileFromUrlAction } from "./flow-activities/get-file-from-url-action"; import { getWebPageByUrlAction } from "./flow-activities/get-web-page-by-url-action"; @@ -46,6 +47,7 @@ export const createFlowActivities = ({ vaultClient: VaultClient; }) => ({ ...createFlowActionActivities({ vaultClient }), + generateFlowRunName, persistFlowActivity, userHasPermissionToRunFlowInWebActivity, }); diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-flow-run-name-activity.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-flow-run-name-activity.ts new file mode 100644 index 00000000000..c08cf76e50d --- /dev/null +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-flow-run-name-activity.ts @@ -0,0 +1,141 @@ +import { + automaticBrowserInferenceFlowDefinition, + manualBrowserInferenceFlowDefinition, +} from "@local/hash-isomorphic-utils/flows/browser-plugin-flow-definitions"; +import type { + AutomaticInferenceTriggerInputName, + ManualInferenceTriggerInputName, +} from "@local/hash-isomorphic-utils/flows/browser-plugin-flow-types"; +import type { GoalFlowTriggerInput } from "@local/hash-isomorphic-utils/flows/example-flow-definitions"; +import { goalFlowDefinition } from "@local/hash-isomorphic-utils/flows/example-flow-definitions"; +import type { + FlowDefinition, + FlowTrigger, + PayloadKind, + PayloadKindValues, +} from "@local/hash-isomorphic-utils/flows/types"; + +import { getFlowContext } from "../shared/get-flow-context"; +import type { UsageTrackingParams } from "../shared/get-llm-response"; +import { getLlmResponse } from "../shared/get-llm-response"; +import { getTextContentFromLlmMessage } from "../shared/get-llm-response/llm-message"; +import { graphApiClient } from "../shared/graph-api-client"; + +type PersistFlowActivityParams = { + flowDefinition: FlowDefinition; + flowTrigger: FlowTrigger; +}; + +const systemPrompt = ` +You are a workflow naming agent. A workflow is an automated process that produces a result of interest. +Multiple workflows of the same kind are run with different inputs, and the user requires a unique name for each run, to distinguish it from other runs of the same kind. + +The user provides you with a description of the goal of the workflow, or a description of the template and a list of its inputs, and you generate a short name for the run. Provide only the name – don't include any other text. + +The name should be descriptive enough to distinguish it from other runs from the same template, and must always be a single human-readable sentence, with proper grammar and spacing between words. +Don't include any quotation marks or special characters around the name. +Don't include the word 'workflow' in the name – the user already knows it's a workflow. +`; + +const getModelSuggestedFlowRunName = async ( + context: string, + usageTrackingParams: UsageTrackingParams, +) => { + const llmResponse = await getLlmResponse( + { + systemPrompt, + messages: [ + { + role: "user", + content: [ + { + type: "text", + text: `User:${context}\nWorkflow name:`, + }, + ], + }, + ], + model: "claude-3-haiku-20240307", + }, + usageTrackingParams, + ); + + if (llmResponse.status !== "ok") { + throw new Error(`Failed to generate flow run name: ${llmResponse.status}`); + } + + const text = getTextContentFromLlmMessage({ message: llmResponse.message }); + + if (!text) { + throw new Error( + `Failed to generate flow run name: no text content found in LLM message`, + ); + } + + return text; +}; + +const outputKindsToIgnore: PayloadKind[] = ["GoogleSheet", "GoogleAccountId"]; + +export const generateFlowRunName = async ( + params: PersistFlowActivityParams, +) => { + const { flowDefinition, flowTrigger } = params; + + if ( + [ + automaticBrowserInferenceFlowDefinition.flowDefinitionId, + manualBrowserInferenceFlowDefinition.flowDefinitionId, + ].includes(flowDefinition.flowDefinitionId) + ) { + const webPage = flowTrigger.outputs?.find( + ({ outputName }) => + outputName === + ("visitedWebPage" satisfies AutomaticInferenceTriggerInputName & + ManualInferenceTriggerInputName), + )?.payload.value as PayloadKindValues["WebPage"] | undefined; + + if (!webPage) { + throw new Error(`Web page not found in browser flow trigger outputs`); + } + + return `${flowDefinition.flowDefinitionId === automaticBrowserInferenceFlowDefinition.flowDefinitionId ? "Auto-analyze" : "Analyze"} webpage: ${webPage.url}`; + } + + const { userAuthentication, flowEntityId, webId } = await getFlowContext(); + + const usageTrackingParams: UsageTrackingParams = { + userAccountId: userAuthentication.actorId, + graphApiClient, + incurredInEntities: [{ entityId: flowEntityId }], + webId, + }; + + if (flowDefinition.flowDefinitionId === goalFlowDefinition.flowDefinitionId) { + const researchBrief = flowTrigger.outputs?.find( + ({ outputName }) => + outputName === ("Research guidance" satisfies GoalFlowTriggerInput), + )?.payload.value as PayloadKindValues["Text"] | undefined; + + if (!researchBrief) { + throw new Error(`Research brief not found in goal flow trigger outputs`); + } + + return getModelSuggestedFlowRunName( + `The research brief for the workflow: ${researchBrief}`, + usageTrackingParams, + ); + } + + const inputsOfInterest = flowTrigger.outputs?.filter( + (output) => + !["draft", "create as draft"].includes(output.outputName.toLowerCase()) && + !outputKindsToIgnore.includes(output.payload.kind), + ); + + return getModelSuggestedFlowRunName( + `The workflow template is named ${flowDefinition.name} with a description of ${flowDefinition.description}. + The inputs to the workflow run to be named: ${inputsOfInterest?.map((input) => JSON.stringify(input)).join("\n")}`, + usageTrackingParams, + ); +}; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts index 1e6d9db631e..79620e1a7de 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts @@ -1,6 +1,6 @@ import { getFlowRunEntityById } from "@local/hash-backend-utils/flows"; -import { mapFlowToEntityProperties } from "@local/hash-isomorphic-utils/flows/mappings"; -import type { Flow } from "@local/hash-isomorphic-utils/flows/types"; +import { mapFlowRunToEntityProperties } from "@local/hash-isomorphic-utils/flows/mappings"; +import type { LocalFlowRun } from "@local/hash-isomorphic-utils/flows/types"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { AccountId, OwnedById } from "@local/hash-subgraph"; @@ -8,7 +8,7 @@ import type { AccountId, OwnedById } from "@local/hash-subgraph"; import { graphApiClient } from "../shared/graph-api-client"; type PersistFlowActivityParams = { - flow: Flow; + flow: LocalFlowRun; userAuthentication: { actorId: AccountId }; webId: OwnedById; }; @@ -20,7 +20,7 @@ export const persistFlowActivity = async ( const { flowRunId } = flow; - const flowProperties = mapFlowToEntityProperties(flow); + const flowRunProperties = mapFlowRunToEntityProperties(flow); const existingFlowEntity = await getFlowRunEntityById({ flowRunId, @@ -35,7 +35,7 @@ export const persistFlowActivity = async ( { op: "replace", path: [], - value: flowProperties, + value: flowRunProperties, }, ], }); @@ -43,8 +43,8 @@ export const persistFlowActivity = async ( await graphApiClient.createEntity(userAuthentication.actorId, { ownedById: webId, entityUuid: flowRunId, - entityTypeIds: [systemEntityTypes.flow.entityTypeId], - properties: flowProperties, + entityTypeIds: [systemEntityTypes.flowRun.entityTypeId], + properties: flowRunProperties, draft: false, relationships: createDefaultAuthorizationRelationships(userAuthentication), diff --git a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts index 38d4026eff0..1303bee57fa 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts @@ -858,24 +858,26 @@ const getOpenAiResponse = async ( return response; }; +export type UsageTrackingParams = { + /** + * Required for tracking usage on a per-user basis. + * + * @todo: consider abstracting this in a wrapper method, or via + * generic params (via a `logUsage` method). + */ + userAccountId: AccountId; + webId: OwnedById; + graphApiClient: GraphApi; + incurredInEntities: { entityId: EntityId }[]; +}; + /** * This function sends a request to the Anthropic or OpenAI API based on the * `model` provided in the parameters. */ export const getLlmResponse = async ( llmParams: T, - usageTrackingParams: { - /** - * Required for tracking usage on a per-user basis. - * - * @todo: consider abstracting this in a wrapper method, or via - * generic params (via a `logUsage` method). - */ - userAccountId: AccountId; - webId: OwnedById; - graphApiClient: GraphApi; - incurredInEntities: { entityId: EntityId }[]; - }, + usageTrackingParams: UsageTrackingParams, ): Promise> => { const { graphApiClient, userAccountId, webId } = usageTrackingParams; diff --git a/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts b/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts index ec46433c309..fee78d58f6d 100644 --- a/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts +++ b/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts @@ -1,7 +1,7 @@ import type { RunFlowWorkflowParams } from "@local/hash-isomorphic-utils/flows/temporal-types"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { FlowProperties } from "@local/hash-isomorphic-utils/system-types/shared"; +import type { FlowRunProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import { type AccountId, type EntityId, @@ -28,8 +28,11 @@ type DeepPartial = { const createDummyFlow = async (params: { actorId: AccountId }) => { const { actorId } = params; - const dummyFlowProperties: FlowProperties = { - "https://hash.ai/@hash/types/property-type/flow-definition-id/": "dummy", + const dummyFlowRunProperties: FlowRunProperties = { + "https://blockprotocol.org/@blockprotocol/types/property-type/name/": + "dummy-name", + "https://hash.ai/@hash/types/property-type/flow-definition-id/": + "dummy-def", "https://hash.ai/@hash/types/property-type/step/": [{}], "https://hash.ai/@hash/types/property-type/trigger/": { "https://hash.ai/@hash/types/property-type/trigger-definition-id/": @@ -41,8 +44,8 @@ const createDummyFlow = async (params: { actorId: AccountId }) => { actorId, { ownedById: actorId, - entityTypeIds: [systemEntityTypes.flow.entityTypeId], - properties: dummyFlowProperties, + entityTypeIds: [systemEntityTypes.flowRun.entityTypeId], + properties: dummyFlowRunProperties, draft: false, relationships: createDefaultAuthorizationRelationships({ actorId }), }, diff --git a/apps/hash-ai-worker-ts/src/workflows.ts b/apps/hash-ai-worker-ts/src/workflows.ts index 065b6019bf3..1add1483d4f 100644 --- a/apps/hash-ai-worker-ts/src/workflows.ts +++ b/apps/hash-ai-worker-ts/src/workflows.ts @@ -393,14 +393,14 @@ export const updateEntityEmbeddings = async ( for (const entity of entities) { /** - * Don't try to create embeddings for `Flow` entities, due to the size + * Don't try to create embeddings for `FlowRun` entities, due to the size * of their property values. * * @todo: consider having a general approach for declaring which entity/property * types should be skipped when generating embeddings. */ if ( - systemEntityTypes.flow.entityTypeId === entity.metadata.entityTypeId + systemEntityTypes.flowRun.entityTypeId === entity.metadata.entityTypeId ) { continue; } diff --git a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts index 46b31f2949e..96171a88cfd 100644 --- a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts +++ b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts @@ -219,10 +219,26 @@ export const runFlowWorkflow = async ( flowDefinition, flowTrigger, flowRunId: workflowId as EntityUuid, + /** use the flow definition's name as a placeholder – we need the Flow persisted to link the generating name usage to it */ + name: flowDefinition.name, }); await persistFlowActivity({ flow, userAuthentication, webId }); + const generateFlowRunNameActivity = proxyFlowActivity({ + actionId: "generateFlowRunName", + maximumAttempts: 1, + activityId: "generate-flow-run-name", + }); + + const generatedName = await generateFlowRunNameActivity({ + flowDefinition, + flowTrigger, + }); + + flow.name = generatedName; + await persistFlowActivity({ flow, userAuthentication, webId }); + setQueryAndSignalHandlers(); const processedStepIds: string[] = []; diff --git a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/get-all-steps-in-flow.ts b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/get-all-steps-in-flow.ts index b621b5f9989..e5b51d71a45 100644 --- a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/get-all-steps-in-flow.ts +++ b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/get-all-steps-in-flow.ts @@ -1,6 +1,6 @@ import type { - Flow, FlowStep, + LocalFlowRun, ParallelGroupStep, } from "@local/hash-isomorphic-utils/flows/types"; @@ -13,7 +13,7 @@ const getAllStepsInParallelGroupStep = ( ) ?? []), ]; -export const getAllStepsInFlow = (flow: Flow): FlowStep[] => [ +export const getAllStepsInFlow = (flow: LocalFlowRun): FlowStep[] => [ ...flow.steps, ...flow.steps.flatMap((step) => step.kind === "parallel-group" ? getAllStepsInParallelGroupStep(step) : [], diff --git a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts index 72170bc2151..4c5f19ecf22 100644 --- a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts +++ b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts @@ -3,10 +3,10 @@ import type { ActionStep, ActionStepDefinition, ArrayPayload, - Flow, FlowDefinition, FlowStep, FlowTrigger, + LocalFlowRun, ParallelGroupStep, ParallelGroupStepDefinition, Payload, @@ -25,7 +25,7 @@ export const initializeActionStep = (params: { kind: "parallel-group-input"; }>; overrideStepId?: string; - existingFlow?: Flow; + existingFlow?: LocalFlowRun; parallelGroupInputPayload?: Payload; }): ActionStep => { const { @@ -175,10 +175,12 @@ export const initializeFlow = (params: { flowRunId: EntityUuid; flowDefinition: FlowDefinition; flowTrigger: FlowTrigger; -}): Flow => { - const { flowRunId, flowDefinition, flowTrigger } = params; + name: string; +}): LocalFlowRun => { + const { flowRunId, flowDefinition, flowTrigger, name } = params; return { + name, flowRunId, trigger: { triggerDefinitionId: flowTrigger.triggerDefinitionId, diff --git a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/pass-outputs-to-unprocessed-steps.ts b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/pass-outputs-to-unprocessed-steps.ts index ce6569a709f..117732f026c 100644 --- a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/pass-outputs-to-unprocessed-steps.ts +++ b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/pass-outputs-to-unprocessed-steps.ts @@ -2,8 +2,8 @@ import { actionDefinitions } from "@local/hash-isomorphic-utils/flows/action-def import type { ArrayPayload, DeepReadOnly, - Flow, FlowDefinition, + LocalFlowRun, OutputDefinition, Payload, StepInputSource, @@ -20,7 +20,7 @@ import { getStepDefinitionFromFlowDefinition } from "./get-step-definition-from- * that may depend on them in their inputs. */ export const passOutputsToUnprocessedSteps = (params: { - flow: Flow; + flow: LocalFlowRun; flowDefinition: FlowDefinition; stepId: string; outputDefinitions: DeepReadOnly; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts index 764e3a3f33a..46fb16fc4ec 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts @@ -103,7 +103,7 @@ const migrate: MigrationFunction = async ({ { entityTypeDefinition: { title: "Flow Definition", - description: "The definition of a HASH flow.", + description: "The definition of a HASH flow.", labelProperty: blockProtocolPropertyTypes.name .propertyTypeBaseUrl as BaseUrl, properties: [ @@ -225,9 +225,15 @@ const migrate: MigrationFunction = async ({ authentication, { entityTypeDefinition: { - title: "Flow", - description: "A HASH flow run.", + title: "Flow Run", + description: "An execution run of a flow.", + labelProperty: blockProtocolPropertyTypes.name + .propertyTypeBaseUrl as BaseUrl, properties: [ + { + propertyType: blockProtocolPropertyTypes.name.propertyTypeId, + required: true, + }, { propertyType: triggerPropertyType, required: true, diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer.tsx index 6e240525ad7..6b1ba0ed5f4 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer.tsx @@ -460,6 +460,7 @@ export const FlowVisualizer = () => { ) : null} diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/flow-run-sidebar.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/flow-run-sidebar.tsx index 74d1c3aa162..941f803941a 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/flow-run-sidebar.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/flow-run-sidebar.tsx @@ -5,6 +5,7 @@ import { CircleEllipsisRegularIcon, CloseIcon, } from "@hashintel/design-system"; +import { goalFlowDefinition } from "@local/hash-isomorphic-utils/flows/example-flow-definitions"; import type { FlowDefinition, StepDefinition, @@ -18,10 +19,12 @@ import { } from "@mui/material"; import { differenceInMilliseconds, intervalToDuration } from "date-fns"; import type { PropsWithChildren } from "react"; -import { useEffect, useMemo, useState } from "react"; +import { Fragment, useEffect, useMemo, useState } from "react"; +import type { FlowRun } from "../../../../graphql/api-types.gen"; import { isNonNullable } from "../../../../lib/typeguards"; import { EllipsisRegularIcon } from "../../../../shared/icons/ellipsis-regular-icon"; +import { Link } from "../../../../shared/ui/link"; import { statusToSimpleStatus, useStatusForStep, @@ -291,30 +294,52 @@ const GroupStatus = ({ type FlowRunSidebarProps = { flowDefinition: FlowDefinition; groups: FlowMaybeGrouped["groups"]; + name: FlowRun["name"]; }; export const FlowRunSidebar = ({ flowDefinition, groups, + name, }: FlowRunSidebarProps) => { + const nameParts = useMemo<{ text: string; url?: boolean }[]>(() => { + const parts = name.split(/( )/g); + const urlRegex = /^https?:\/\//; + + return parts.map((part) => ({ + text: part, + url: urlRegex.test(part), + })); + }, [name]); + return ( - + - {flowDefinition.name} - - - {flowDefinition.description} + {nameParts.map((part, index) => + part.url ? ( + // eslint-disable-next-line react/no-array-index-key + + {part.text} + + ) : ( + // eslint-disable-next-line react/no-array-index-key + {part.text} + ), + )} diff --git a/apps/hash-frontend/src/pages/goals.page/goals-list.tsx b/apps/hash-frontend/src/pages/goals.page/goals-list.tsx index 561acd937ce..c164c4d67cb 100644 --- a/apps/hash-frontend/src/pages/goals.page/goals-list.tsx +++ b/apps/hash-frontend/src/pages/goals.page/goals-list.tsx @@ -92,7 +92,7 @@ export const GoalsList = () => { /** * @todo H-2722 – decide how to store an informative name per goal / flow run */ - name: goalFlowDefinition.name, + name: run.name, status, web, }; diff --git a/apps/hash-frontend/src/pages/shared/hidden-types.ts b/apps/hash-frontend/src/pages/shared/hidden-types.ts index b4ef6b85bff..ff1428914b0 100644 --- a/apps/hash-frontend/src/pages/shared/hidden-types.ts +++ b/apps/hash-frontend/src/pages/shared/hidden-types.ts @@ -14,7 +14,7 @@ export const hiddenEntityTypeIds: VersionedUrl[] = [ systemEntityTypes.comment.entityTypeId, systemEntityTypes.commentNotification.entityTypeId, systemEntityTypes.facebookAccount.entityTypeId, - systemEntityTypes.flow.entityTypeId, + systemEntityTypes.flowRun.entityTypeId, systemEntityTypes.flowDefinition.entityTypeId, systemEntityTypes.githubAccount.entityTypeId, systemEntityTypes.graphChangeNotification.entityTypeId, diff --git a/apps/hash-frontend/src/pages/workers.page.tsx b/apps/hash-frontend/src/pages/workers.page.tsx index 83f35c3c965..ca0618efde1 100644 --- a/apps/hash-frontend/src/pages/workers.page.tsx +++ b/apps/hash-frontend/src/pages/workers.page.tsx @@ -306,7 +306,7 @@ const WorkersPageContent = () => { flowRunId, web, type, - name: flowDefinition.name, + name: flowRun.name, closedAt: closedAt ?? null, executedAt: executedAt ?? null, status: flowRunStatusToStatusText(status), diff --git a/apps/plugin-browser/src/graphql/queries/flow.queries.ts b/apps/plugin-browser/src/graphql/queries/flow.queries.ts index 0cfb0b53a8c..2bb4ed86ee3 100644 --- a/apps/plugin-browser/src/graphql/queries/flow.queries.ts +++ b/apps/plugin-browser/src/graphql/queries/flow.queries.ts @@ -1,6 +1,7 @@ export const getMinimalFlowRunsQuery = /* GraphQL */ ` query getMinimalFlowRuns { getFlowRuns { + name flowDefinitionId flowRunId webId diff --git a/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts b/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts index 9752e215982..64e2ef956d9 100644 --- a/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts +++ b/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts @@ -466,10 +466,12 @@ const getFlowRunDetailedFields = async ({ }; export const getSparseFlowRunFromWorkflowId = async ({ + name, webId, workflowId, temporalClient, }: { + name: string; webId: OwnedById; workflowId: string; temporalClient: TemporalClient; @@ -480,6 +482,7 @@ export const getSparseFlowRunFromWorkflowId = async ({ await handle.describe(); return { + name, flowDefinitionId: (memo?.flowDefinitionId as string | undefined) ?? "unknown", flowRunId: workflowId, @@ -492,6 +495,7 @@ export const getSparseFlowRunFromWorkflowId = async ({ }; export const getFlowRunFromWorkflowId = async (args: { + name: string; webId: OwnedById; workflowId: string; temporalClient: TemporalClient; diff --git a/libs/@local/hash-backend-utils/src/flows.ts b/libs/@local/hash-backend-utils/src/flows.ts index f2eae9818e9..e69d7e60e8a 100644 --- a/libs/@local/hash-backend-utils/src/flows.ts +++ b/libs/@local/hash-backend-utils/src/flows.ts @@ -14,7 +14,7 @@ import { systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { FlowProperties } from "@local/hash-isomorphic-utils/system-types/shared"; +import type { FlowRunProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { AccountId, Entity, @@ -37,7 +37,7 @@ export const getFlowRunEntityById = async (params: { flowRunId: EntityUuid; graphApiClient: GraphApi; userAuthentication: { actorId: AccountId }; -}): Promise | null> => { +}): Promise | null> => { const { flowRunId, graphApiClient, userAuthentication } = params; const [existingFlowEntity] = await graphApiClient @@ -48,7 +48,7 @@ export const getFlowRunEntityById = async (params: { equal: [{ path: ["uuid"] }, { parameter: flowRunId }], }, generateVersionedUrlMatchingFilter( - systemEntityTypes.flow.entityTypeId, + systemEntityTypes.flowRun.entityTypeId, { ignoreParents: true }, ), ], @@ -62,7 +62,7 @@ export const getFlowRunEntityById = async (params: { mapGraphApiEntityToEntity( entity, userAuthentication.actorId, - ) as Entity, + ) as Entity, ), ); @@ -112,6 +112,9 @@ export async function getFlowRunById({ if (includeDetails) { return getFlowRunFromWorkflowId({ + name: existingFlowEntity.properties[ + "https://blockprotocol.org/@blockprotocol/types/property-type/name/" + ], workflowId: extractEntityUuidFromEntityId( existingFlowEntity.metadata.recordId.entityId, ), @@ -120,6 +123,9 @@ export async function getFlowRunById({ }); } else { return getSparseFlowRunFromWorkflowId({ + name: existingFlowEntity.properties[ + "https://blockprotocol.org/@blockprotocol/types/property-type/name/" + ], workflowId: extractEntityUuidFromEntityId( existingFlowEntity.metadata.recordId.entityId, ), @@ -174,7 +180,7 @@ export async function getFlowRuns({ filter: { all: [ generateVersionedUrlMatchingFilter( - systemEntityTypes.flow.entityTypeId, + systemEntityTypes.flowRun.entityTypeId, { ignoreParents: true }, ), ...(filters.flowDefinitionIds @@ -201,14 +207,23 @@ export async function getFlowRuns({ includeDrafts: false, }) .then(({ data: response }) => { - const flowRunIdToWebId: Record = {}; + const flowRunIdToOwnedByAndName: Record< + EntityUuid, + { ownedById: OwnedById; name: string } + > = {}; for (const entity of response.entities) { const [ownedById, entityUuid] = splitEntityId( entity.metadata.recordId.entityId as EntityId, ); - flowRunIdToWebId[entityUuid] = ownedById; + + flowRunIdToOwnedByAndName[entityUuid] = { + name: (entity.properties as FlowRunProperties)[ + "https://blockprotocol.org/@blockprotocol/types/property-type/name/" + ], + ownedById, + }; } - return flowRunIdToWebId; + return flowRunIdToOwnedByAndName; }); const relevantFlowRunIds = Object.keys(relevantFlows); @@ -234,18 +249,20 @@ export async function getFlowRuns({ const workflows: FlowRun[] = []; for await (const workflow of workflowIterable) { - const webId = relevantFlows[workflow.workflowId as EntityUuid]; - if (!webId) { + const flowDetails = relevantFlows[workflow.workflowId as EntityUuid]; + + if (!flowDetails) { throw new Error( - `Could not find webId for workflowId ${workflow.workflowId}`, + `Could not find details for workflowId ${workflow.workflowId}`, ); } const workflowId = workflow.workflowId; const runInfo = await getFlowRunFromWorkflowId({ + name: flowDetails.name, workflowId, temporalClient, - webId, + webId: flowDetails.ownedById, }); workflows.push(runInfo); } @@ -256,17 +273,19 @@ export async function getFlowRuns({ for await (const workflow of workflowIterable) { const workflowId = workflow.workflowId; - const webId = relevantFlows[workflow.workflowId as EntityUuid]; - if (!webId) { + + const flowDetails = relevantFlows[workflow.workflowId as EntityUuid]; + + if (!flowDetails) { throw new Error( - `Could not find webId for workflowId ${workflow.workflowId}`, + `Could not find details for workflowId ${workflow.workflowId}`, ); } - const runInfo = await getSparseFlowRunFromWorkflowId({ + name: flowDetails.name, workflowId, temporalClient, - webId, + webId: flowDetails.ownedById, }); workflows.push(runInfo); } diff --git a/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts b/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts index 9bf8a4de5dc..139b3d0c5de 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts @@ -13,7 +13,7 @@ import type { FlowDefinition } from "@local/hash-isomorphic-utils/flows/types"; import type { EntityUuid } from "@local/hash-subgraph"; export const manualBrowserInferenceFlowDefinition: FlowDefinition = { - name: "Research triggered manually from browser", + name: "Analyze webpage", flowDefinitionId: "manual-browser-inference" as EntityUuid, description: "Find entities of the requested types in a web page", trigger: { @@ -123,7 +123,7 @@ export const manualBrowserInferenceFlowDefinition: FlowDefinition = { }; export const automaticBrowserInferenceFlowDefinition: FlowDefinition = { - name: "Research triggered automatically from browser", + name: "Auto-analyze webpage", flowDefinitionId: "automatic-browser-inference" as EntityUuid, description: "Find entities in a web page according to the user's passive analysis settings", diff --git a/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts b/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts index 021abc3c8fb..f5a7f442c17 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts @@ -7,7 +7,7 @@ import type { import type { FlowDefinition } from "./types"; export const researchTaskFlowDefinition: FlowDefinition = { - name: "Research Task", + name: "Research task", flowDefinitionId: "research-task" as EntityUuid, description: "Conduct research on a given topic, and provide expert analysis on the discovered data", @@ -197,7 +197,7 @@ export const researchTaskFlowDefinition: FlowDefinition = { }; export const researchEntitiesFlowDefinition: FlowDefinition = { - name: "Research Entities", + name: "Research entities", flowDefinitionId: "research-entities" as EntityUuid, description: "Discover entities according to a research brief, save them to HASH and Google Sheets", @@ -351,7 +351,7 @@ export const researchEntitiesFlowDefinition: FlowDefinition = { }; export const ftseInvestorsFlowDefinition: FlowDefinition = { - name: "FTSE350 Investors", + name: "FTSE350 investors", flowDefinitionId: "ftse-350-investors" as EntityUuid, description: "Research the FTSE350 index, its constituents, and the top investors in the index", @@ -569,7 +569,7 @@ export const ftseInvestorsFlowDefinition: FlowDefinition = { }; export const inferUserEntitiesFromWebPageFlowDefinition: FlowDefinition = { - name: "Infer User Entities from Web Page", + name: "Analyze webpage entities", flowDefinitionId: "infer-user-entities-from-web-page" as EntityUuid, description: "Infer entities from a web page, based on the user's provided entity types", @@ -672,7 +672,7 @@ export const inferUserEntitiesFromWebPageFlowDefinition: FlowDefinition = { }; export const answerQuestionFlow: FlowDefinition = { - name: "Answer Question Flow", + name: "Answer question", flowDefinitionId: "answer-question-flow" as EntityUuid, description: "Answer a question based on the provided context", trigger: { @@ -819,7 +819,7 @@ export const answerQuestionFlow: FlowDefinition = { }; export const saveFileFromUrl: FlowDefinition = { - name: "Save File From Url", + name: "Save file from URL", flowDefinitionId: "save-file-from-url" as EntityUuid, description: "Save file from URL to HASH", trigger: { @@ -896,7 +896,7 @@ export type GoalFlowTriggerInput = | "Create as draft"; export const goalFlowDefinition: FlowDefinition = { - name: "Research Goal", + name: "Research goal", flowDefinitionId: "research-goal" as EntityUuid, description: "Discover entities according to a research brief, save them to HASH", diff --git a/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts b/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts index 30cba0bbd29..bf832408172 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts @@ -2,10 +2,10 @@ import type { Entity, EntityUuid } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { simplifyProperties } from "../simplify-properties"; -import type { FlowProperties } from "../system-types/flow"; import type { FlowDefinitionProperties } from "../system-types/flowdefinition"; +import type { FlowRunProperties } from "../system-types/flowrun"; import type { TriggerDefinitionId } from "./trigger-definitions"; -import type { Flow, FlowDefinition, OutputDefinition } from "./types"; +import type { FlowDefinition, LocalFlowRun, OutputDefinition } from "./types"; export const mapFlowDefinitionToEntityProperties = ( flowDefinition: FlowDefinition, @@ -59,19 +59,26 @@ export const mapFlowDefinitionEntityToFlowDefinition = ( }; }; -export const mapFlowToEntityProperties = (flow: Flow): FlowProperties => ({ +export const mapFlowRunToEntityProperties = ( + flowRun: LocalFlowRun, +): FlowRunProperties => ({ + "https://blockprotocol.org/@blockprotocol/types/property-type/name/": + flowRun.name, "https://hash.ai/@hash/types/property-type/flow-definition-id/": - flow.flowDefinitionId, - "https://hash.ai/@hash/types/property-type/outputs/": flow.outputs, - "https://hash.ai/@hash/types/property-type/step/": flow.steps, + flowRun.flowDefinitionId, + "https://hash.ai/@hash/types/property-type/outputs/": flowRun.outputs, + "https://hash.ai/@hash/types/property-type/step/": flowRun.steps, "https://hash.ai/@hash/types/property-type/trigger/": { "https://hash.ai/@hash/types/property-type/trigger-definition-id/": - flow.trigger.triggerDefinitionId, + flowRun.trigger.triggerDefinitionId, }, }); -export const mapFlowEntityToFlow = (entity: Entity): Flow => { +export const mapFlowEntityToFlow = ( + entity: Entity, +): LocalFlowRun => { const { + name, flowDefinitionId, outputs, step: steps, @@ -79,17 +86,18 @@ export const mapFlowEntityToFlow = (entity: Entity): Flow => { } = simplifyProperties(entity.properties); return { + name, flowRunId: extractEntityUuidFromEntityId(entity.metadata.recordId.entityId), flowDefinitionId: flowDefinitionId as EntityUuid, - outputs: outputs as Flow["outputs"], - steps: steps as Flow["steps"], + outputs: outputs as LocalFlowRun["outputs"], + steps: steps as LocalFlowRun["steps"], trigger: { triggerDefinitionId: trigger[ "https://hash.ai/@hash/types/property-type/trigger-definition-id/" ] as TriggerDefinitionId, outputs: trigger[ "https://hash.ai/@hash/types/property-type/outputs/" - ] as Flow["trigger"]["outputs"], + ] as LocalFlowRun["trigger"]["outputs"], }, }; }; diff --git a/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts b/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts index 9b39157670e..f305d072a19 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts @@ -1,7 +1,7 @@ import type { AccountId, OwnedById } from "@local/hash-subgraph"; import type { Status } from "@local/status"; -import type { Flow, FlowDefinition, FlowTrigger } from "./types"; +import type { FlowDefinition, FlowTrigger, LocalFlowRun } from "./types"; export type RunFlowWorkflowParams = { flowTrigger: FlowTrigger; @@ -11,7 +11,7 @@ export type RunFlowWorkflowParams = { }; export type RunFlowWorkflowResponse = Status<{ - flow?: Flow; - outputs?: Flow["outputs"]; + flow?: LocalFlowRun; + outputs?: LocalFlowRun["outputs"]; stepErrors?: Status<{ stepId: string }>[]; }>; diff --git a/libs/@local/hash-isomorphic-utils/src/flows/types.ts b/libs/@local/hash-isomorphic-utils/src/flows/types.ts index a3375f737a0..7c6b0d6bd8b 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/types.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/types.ts @@ -341,7 +341,8 @@ export type FlowTrigger = { outputs?: StepOutput[]; }; -export type Flow = { +export type LocalFlowRun = { + name: string; flowRunId: EntityUuid; trigger: FlowTrigger; flowDefinitionId: EntityUuid; diff --git a/libs/@local/hash-isomorphic-utils/src/graphql/queries/flow.queries.ts b/libs/@local/hash-isomorphic-utils/src/graphql/queries/flow.queries.ts index 29b0a867bff..e48f88c9707 100644 --- a/libs/@local/hash-isomorphic-utils/src/graphql/queries/flow.queries.ts +++ b/libs/@local/hash-isomorphic-utils/src/graphql/queries/flow.queries.ts @@ -3,6 +3,7 @@ import { gql } from "@apollo/client"; export const getFlowRunsQuery = gql` query getFlowRuns { getFlowRuns { + name flowDefinitionId flowRunId webId @@ -30,6 +31,7 @@ export const getFlowRunsQuery = gql` export const getFlowRunById = gql` query getFlowRunById($flowRunId: String!) { getFlowRunById(flowRunId: $flowRunId) { + name flowDefinitionId flowRunId webId diff --git a/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/flow.typedef.ts b/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/flow.typedef.ts index ce3a58adab1..22ed3900eef 100644 --- a/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/flow.typedef.ts +++ b/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/flow.typedef.ts @@ -133,6 +133,11 @@ export const flowTypedef = gql` """ flowDefinitionId: String! """ + A user-facing name for the flow run to distinguish it from other runs of its kind, + which might include a key input or a summary of its key inputs. + """ + name: String! + """ The web this flow run is associated with """ webId: OwnedById! diff --git a/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts b/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts index 320cb252e63..e74eff33e07 100644 --- a/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts +++ b/libs/@local/hash-isomorphic-utils/src/ontology-type-ids.ts @@ -55,15 +55,15 @@ export const systemEntityTypes = { entityTypeId: "https://hash.ai/@hash/types/entity-type/file/v/2", entityTypeBaseUrl: "https://hash.ai/@hash/types/entity-type/file/", }, - flow: { - entityTypeId: "https://hash.ai/@hash/types/entity-type/flow/v/1", - entityTypeBaseUrl: "https://hash.ai/@hash/types/entity-type/flow/", - }, flowDefinition: { entityTypeId: "https://hash.ai/@hash/types/entity-type/flow-definition/v/1", entityTypeBaseUrl: "https://hash.ai/@hash/types/entity-type/flow-definition/", }, + flowRun: { + entityTypeId: "https://hash.ai/@hash/types/entity-type/flow-run/v/1", + entityTypeBaseUrl: "https://hash.ai/@hash/types/entity-type/flow-run/", + }, githubAccount: { entityTypeId: "https://hash.ai/@hash/types/entity-type/github-account/v/1", entityTypeBaseUrl: diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/flowdefinition.ts b/libs/@local/hash-isomorphic-utils/src/system-types/flowdefinition.ts index 4ebf062e247..a3f62c2a918 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/flowdefinition.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/flowdefinition.ts @@ -6,6 +6,7 @@ import type { Entity } from "@local/hash-subgraph"; import type { DescriptionPropertyValue, + NamePropertyValue, ObjectDataType, TextDataType, TriggerDefinitionIDPropertyValue, @@ -13,6 +14,7 @@ import type { export type { DescriptionPropertyValue, + NamePropertyValue, ObjectDataType, TextDataType, TriggerDefinitionIDPropertyValue, @@ -25,7 +27,7 @@ export type FlowDefinitionOutgoingLinkAndTarget = never; export type FlowDefinitionOutgoingLinksByLinkEntityTypeId = {}; /** - * The definition of a HASH flow. + * The definition of a HASH flow. */ export type FlowDefinitionProperties = { "https://blockprotocol.org/@blockprotocol/types/property-type/description/": DescriptionPropertyValue; @@ -35,11 +37,6 @@ export type FlowDefinitionProperties = { "https://hash.ai/@hash/types/property-type/trigger-definition/": TriggerDefinitionPropertyValue; }; -/** - * A word or set of words by which something is known, addressed, or referred to. - */ -export type NamePropertyValue = TextDataType; - /** * The output definitions of something. */ diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/flow.ts b/libs/@local/hash-isomorphic-utils/src/system-types/flowrun.ts similarity index 64% rename from libs/@local/hash-isomorphic-utils/src/system-types/flow.ts rename to libs/@local/hash-isomorphic-utils/src/system-types/flowrun.ts index ede81f7237f..4d79287b93a 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/flow.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/flowrun.ts @@ -3,11 +3,12 @@ */ import type { - Flow, FlowDefinitionIDPropertyValue, - FlowOutgoingLinkAndTarget, - FlowOutgoingLinksByLinkEntityTypeId, - FlowProperties, + FlowRun, + FlowRunOutgoingLinkAndTarget, + FlowRunOutgoingLinksByLinkEntityTypeId, + FlowRunProperties, + NamePropertyValue, ObjectDataType, OutputsPropertyValue, StepPropertyValue, @@ -17,11 +18,12 @@ import type { } from "./shared"; export type { - Flow, FlowDefinitionIDPropertyValue, - FlowOutgoingLinkAndTarget, - FlowOutgoingLinksByLinkEntityTypeId, - FlowProperties, + FlowRun, + FlowRunOutgoingLinkAndTarget, + FlowRunOutgoingLinksByLinkEntityTypeId, + FlowRunProperties, + NamePropertyValue, ObjectDataType, OutputsPropertyValue, StepPropertyValue, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts b/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts index 2ef08a373c5..e24c8c120ec 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts @@ -295,21 +295,22 @@ export type FileStorageRegionPropertyValue = TextDataType; */ export type FileURLPropertyValue = TextDataType; -export type Flow = Entity; - /** * The ID of the flow definition (the `entityId` of the flow definition entity). */ export type FlowDefinitionIDPropertyValue = TextDataType; -export type FlowOutgoingLinkAndTarget = never; +export type FlowRun = Entity; + +export type FlowRunOutgoingLinkAndTarget = never; -export type FlowOutgoingLinksByLinkEntityTypeId = {}; +export type FlowRunOutgoingLinksByLinkEntityTypeId = {}; /** - * A HASH flow run. + * An execution run of a flow. */ -export type FlowProperties = { +export type FlowRunProperties = { + "https://blockprotocol.org/@blockprotocol/types/property-type/name/": NamePropertyValue; "https://hash.ai/@hash/types/property-type/flow-definition-id/": FlowDefinitionIDPropertyValue; "https://hash.ai/@hash/types/property-type/outputs/"?: OutputsPropertyValue; "https://hash.ai/@hash/types/property-type/step/": StepPropertyValue; @@ -527,6 +528,11 @@ export type MIMETypePropertyValue = TextDataType; */ export type ManualInferenceConfigurationPropertyValue = ObjectDataType; +/** + * A word or set of words by which something is known, addressed, or referred to. + */ +export type NamePropertyValue = TextDataType; + export type Notification = Entity; export type NotificationOutgoingLinkAndTarget = never; diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts b/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts index 2f9b87be484..f343ead2656 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts @@ -9,16 +9,17 @@ import type { AppliesUntilPropertyValue, DateTimeDataType, FeatureNamePropertyValue, - Flow, FlowDefinitionIDPropertyValue, - FlowOutgoingLinkAndTarget, - FlowOutgoingLinksByLinkEntityTypeId, - FlowProperties, + FlowRun, + FlowRunOutgoingLinkAndTarget, + FlowRunOutgoingLinksByLinkEntityTypeId, + FlowRunProperties, InputUnitCostPropertyValue, Link, LinkOutgoingLinkAndTarget, LinkOutgoingLinksByLinkEntityTypeId, LinkProperties, + NamePropertyValue, NumberDataType, ObjectDataType, OutputsPropertyValue, @@ -40,16 +41,17 @@ export type { AppliesUntilPropertyValue, DateTimeDataType, FeatureNamePropertyValue, - Flow, FlowDefinitionIDPropertyValue, - FlowOutgoingLinkAndTarget, - FlowOutgoingLinksByLinkEntityTypeId, - FlowProperties, + FlowRun, + FlowRunOutgoingLinkAndTarget, + FlowRunOutgoingLinksByLinkEntityTypeId, + FlowRunProperties, InputUnitCostPropertyValue, Link, LinkOutgoingLinkAndTarget, LinkOutgoingLinksByLinkEntityTypeId, LinkProperties, + NamePropertyValue, NumberDataType, ObjectDataType, OutputsPropertyValue, @@ -145,7 +147,7 @@ export type UsageRecordCreatedLink = { export type UsageRecordIncurredInLink = { linkEntity: IncurredIn; - rightEntity: Flow; + rightEntity: FlowRun; }; export type UsageRecordOutgoingLinkAndTarget = From f99ea66265f47c302afe000f669baf9af3bf48dc Mon Sep 17 00:00:00 2001 From: Dei Vilkinsons <6226576+vilkinsons@users.noreply.github.com> Date: Fri, 24 May 2024 22:01:56 +0200 Subject: [PATCH 09/27] H-2770: Cleanup `.nvmrc` files (#4512) Co-authored-by: nonparibus --- .nvmrc | 1 + apps/hash-frontend/.nvmrc | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .nvmrc delete mode 100644 apps/hash-frontend/.nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000000..9de2256827a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/iron diff --git a/apps/hash-frontend/.nvmrc b/apps/hash-frontend/.nvmrc deleted file mode 100644 index 112a2eaed3e..00000000000 --- a/apps/hash-frontend/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -lts/gallium \ No newline at end of file From d5837b44f5988faa3a24be51b9434d28032f42a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 02:54:08 +0000 Subject: [PATCH 10/27] Update npm package `lint-staged` to v15.2.4 (#4515) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 131 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 84 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index ef8675c5324..5056f1a2880 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "cross-env": "7.0.3", "dotenv-flow": "3.2.0", "husky": "8.0.3", - "lint-staged": "15.2.2", + "lint-staged": "15.2.4", "lockfile-lint": "4.13.2", "markdownlint-cli": "0.40.0", "npm-run-all": "4.1.5", diff --git a/yarn.lock b/yarn.lock index 02379525f0c..44439b4d975 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10831,12 +10831,12 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity "sha1-NFThpGLujVmeI23zNs2epPiv4Qc= sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==" +braces@^3.0.3, braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" breakword@^1.0.5: version "1.0.5" @@ -11756,10 +11756,10 @@ command-line-usage@^5.0.5: table-layout "^0.4.3" typical "^2.6.1" -commander@11.1.0, commander@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" - integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== +commander@12.1.0, commander@^12.0.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== commander@7, commander@^7.0.0, commander@^7.2.0: version "7.2.0" @@ -11776,10 +11776,10 @@ commander@^10.0.0, commander@^10.0.1: resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -commander@^12.0.0, commander@~12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" - integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== +commander@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" + integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== commander@^2.19.0, commander@^2.20.0, commander@^2.20.3, commander@^2.8.1: version "2.20.3" @@ -11801,6 +11801,11 @@ commander@^9.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" integrity "sha1-0d2PLOb6+TFHKVwN8Tx8IRQc+90= sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==" +commander@~12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" + integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== + commist@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/commist/-/commist-3.2.0.tgz#da9c8e5f245ac21510badc4b10c46b5bcc9b56cd" @@ -14642,10 +14647,10 @@ filesize@^10.1.1: resolved "https://registry.yarnpkg.com/filesize/-/filesize-10.1.1.tgz#eb98ce885aa73741199748e70e5b7339cc22c5ff" integrity sha512-L0cdwZrKlwZQkMSFnCflJ6J2Y+5egO/p3vgRSDQGxQt++QbUZe5gMbRO6kg6gzwQDPvq2Fk9AmoxUNfZ5gdqaQ== -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity "sha1-GRmmp8df44ssfHflGYU12prN2kA= sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==" +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" @@ -17825,10 +17830,10 @@ lie@~3.3.0: dependencies: immediate "~3.0.5" -lilconfig@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.0.0.tgz#f8067feb033b5b74dab4602a5f5029420be749bc" - integrity sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g== +lilconfig@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.1.tgz#9d8a246fa753106cfc205fd2d77042faca56e5e3" + integrity sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ== lines-and-columns@^1.1.6: version "1.1.6" @@ -17842,32 +17847,32 @@ linkify-it@^5.0.0: dependencies: uc.micro "^2.0.0" -lint-staged@15.2.2: - version "15.2.2" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.2.tgz#ad7cbb5b3ab70e043fa05bff82a09ed286bc4c5f" - integrity sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw== +lint-staged@15.2.4: + version "15.2.4" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.4.tgz#b8376b459a308d40e5dfdae302f333fa4c4bf126" + integrity sha512-3F9KRQIS2fVDGtCkBp4Bx0jswjX7zUcKx6OF0ZeY1prksUyKPRIIUqZhIUYAstJfvj6i48VFs4dwVIbCYwvTYQ== dependencies: chalk "5.3.0" - commander "11.1.0" + commander "12.1.0" debug "4.3.4" execa "8.0.1" - lilconfig "3.0.0" - listr2 "8.0.1" - micromatch "4.0.5" + lilconfig "3.1.1" + listr2 "8.2.1" + micromatch "4.0.6" pidtree "0.6.0" string-argv "0.3.2" - yaml "2.3.4" + yaml "2.4.2" -listr2@8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-8.0.1.tgz#4d3f50ae6cec3c62bdf0e94f5c2c9edebd4b9c34" - integrity sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA== +listr2@8.2.1: + version "8.2.1" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-8.2.1.tgz#06a1a6efe85f23c5324180d7c1ddbd96b5eefd6d" + integrity sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g== dependencies: cli-truncate "^4.0.0" colorette "^2.0.20" eventemitter3 "^5.0.1" log-update "^6.0.0" - rfdc "^1.3.0" + rfdc "^1.3.1" wrap-ansi "^9.0.0" listr2@^4.0.5: @@ -19249,13 +19254,13 @@ micromark@^3.0.0: micromark-util-types "^1.0.1" uvu "^0.5.0" -micromatch@4.0.5, micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity "sha1-vImZp8u/d83InxMvbkZwUbSQkMY= sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==" +micromatch@4.0.6, micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: + version "4.0.6" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.6.tgz#ab4e37c42726b9cd788181ba4a2a4fead8e394a3" + integrity sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ== dependencies: - braces "^3.0.2" - picomatch "^2.3.1" + braces "^3.0.3" + picomatch "^4.0.2" millify@6.1.0: version "6.1.0" @@ -21057,6 +21062,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.0, picomatc resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity "sha1-O6ODNzNkbZ0+SZWUbBNlpn+wekI= sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" +picomatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + pidtree@0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" @@ -24266,7 +24276,7 @@ string-trim-spaces-only@^5.0.10: resolved "https://registry.yarnpkg.com/string-trim-spaces-only/-/string-trim-spaces-only-5.0.10.tgz#62f1d32ff8191cbfccb43c08e645c38444d61b77" integrity sha512-MhmjE5jNqb1Ylo+BARPRlsdChGLrnPpAUWrT1VOxo9WhWwKVUU6CbZTfjwKaQPYTGS/wsX/4Zek88FM2rEb5iA== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -24284,6 +24294,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -24404,7 +24423,7 @@ stringify-object@^5.0.0: is-obj "^3.0.0" is-regexp "^3.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -24425,6 +24444,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -26729,7 +26755,7 @@ worker-timers@^7.1.4: worker-timers-broker "^6.1.8" worker-timers-worker "^7.0.71" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -26755,6 +26781,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -26906,10 +26941,10 @@ yaml-ast-parser@0.0.43, yaml-ast-parser@^0.0.43: resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb" integrity "sha1-6KI+b7TDgHarkplcXcoz89PXybs= sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==" -yaml@2.3.4, yaml@^2.3.1: - version "2.3.4" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" - integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== +yaml@2.4.2, yaml@^2.3.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.2.tgz#7a2b30f2243a5fc299e1f14ca58d475ed4bc5362" + integrity sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA== yaml@^1.10.0, yaml@^1.10.2, yaml@^1.5.0: version "1.10.2" From 6d75bd5634b5c11442fa80720aa9c6f5c56dcb28 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 26 May 2024 10:30:42 +0000 Subject: [PATCH 11/27] Update npm package `@playwright/test` to v1.44.1 (#4519) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- tests/hash-playwright/package.json | 2 +- yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/hash-playwright/package.json b/tests/hash-playwright/package.json index 003d346caf0..cf4ce80af0c 100644 --- a/tests/hash-playwright/package.json +++ b/tests/hash-playwright/package.json @@ -16,7 +16,7 @@ "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", "@local/tsconfig": "0.0.0-private", - "@playwright/test": "1.44.0", + "@playwright/test": "1.44.1", "eslint": "8.57.0", "execa": "5.1.1", "graphql": "16.8.1", diff --git a/yarn.lock b/yarn.lock index 44439b4d975..7ac47b8a90a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4936,12 +4936,12 @@ resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.0.tgz#7d8dacb7fdef0e4387caf7396cbd77f179867d06" integrity sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ== -"@playwright/test@1.44.0": - version "1.44.0" - resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.44.0.tgz#ac7a764b5ee6a80558bdc0fcbc525fcb81f83465" - integrity sha512-rNX5lbNidamSUorBhB4XZ9SQTjAqfe5M+p37Z8ic0jPFBMo5iCtQz1kRWkEMg+rYOKSlVycpQmpqjSFq7LXOfg== +"@playwright/test@1.44.1": + version "1.44.1" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.44.1.tgz#cc874ec31342479ad99838040e99b5f604299bcb" + integrity sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q== dependencies: - playwright "1.44.0" + playwright "1.44.1" "@pmmmwh/react-refresh-webpack-plugin@0.5.10", "@pmmmwh/react-refresh-webpack-plugin@^0.5.5": version "0.5.10" @@ -21155,17 +21155,17 @@ platform@^1.3.6: resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg== -playwright-core@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.44.0.tgz#316c4f0bca0551ffb88b6eb1c97bc0d2d861b0d5" - integrity sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ== +playwright-core@1.44.1: + version "1.44.1" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.44.1.tgz#53ec975503b763af6fc1a7aa995f34bc09ff447c" + integrity sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA== -playwright@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.44.0.tgz#22894e9b69087f6beb639249323d80fe2b5087ff" - integrity sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ== +playwright@1.44.1: + version "1.44.1" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.44.1.tgz#5634369d777111c1eea9180430b7a184028e7892" + integrity sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg== dependencies: - playwright-core "1.44.0" + playwright-core "1.44.1" optionalDependencies: fsevents "2.3.2" From 4ac38104e18dfe3889a2c533ca800eec2fbdefad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 26 May 2024 15:07:43 +0000 Subject: [PATCH 12/27] Update npm package `@redocly/cli` to v1.13.0 (#4520) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .../hash-graph-client/typescript/package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/@local/hash-graph-client/typescript/package.json b/libs/@local/hash-graph-client/typescript/package.json index c363b361661..f5cb4f8e2c4 100644 --- a/libs/@local/hash-graph-client/typescript/package.json +++ b/libs/@local/hash-graph-client/typescript/package.json @@ -17,7 +17,7 @@ "@apps/hash-graph": "0.0.0-private", "@local/eslint-config": "0.0.0-private", "@local/tsconfig": "0.0.0-private", - "@redocly/cli": "1.12.2", + "@redocly/cli": "1.13.0", "@types/node": "20.12.3", "@typescript-eslint/parser": "7.2.0", "eslint": "8.57.0", diff --git a/yarn.lock b/yarn.lock index 7ac47b8a90a..b74e75da968 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5557,12 +5557,12 @@ require-from-string "^2.0.2" uri-js "^4.2.2" -"@redocly/cli@1.12.2": - version "1.12.2" - resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.12.2.tgz#15f4cd91df9a2686502bd6112ab767c0d7e76b14" - integrity sha512-oFSI77DAcdnILwkXmpUeY0B1Kg47MVn7HVSV92F9SLZewh2Z4AN99/VSGoFk1LvImTLWJCbhF/bsQbvG2sw3Jw== +"@redocly/cli@1.13.0": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.13.0.tgz#ebc30173d74fff5cfb39c1d917cbae1a9a3c0117" + integrity sha512-2oC8SN+hGtfrFBX2LadFOAzA1ika+2IDmAg9pRl8+yualfmEdxiOuP8rltKeDZ1Uj3NGXyR42g7+CvMj55pKkw== dependencies: - "@redocly/openapi-core" "1.12.2" + "@redocly/openapi-core" "1.13.0" abort-controller "^3.0.0" chokidar "^3.5.1" colorette "^1.2.0" @@ -5586,10 +5586,10 @@ resolved "https://registry.yarnpkg.com/@redocly/config/-/config-0.5.0.tgz#3ba2585f10d7039b85d7604d0e17f4d091d424c2" integrity sha512-oA1ezWPT2tSV9CLk0FtZlViaFKtp+id3iAVeKBme1DdP4xUCdxEdP8umB21iLKdc6leRd5uGa+T5Ox4nHBAXWg== -"@redocly/openapi-core@1.12.2", "@redocly/openapi-core@^1.0.0-rc.2": - version "1.12.2" - resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.12.2.tgz#2ab295922b82d6cf2e136e9062338f4bd9f82cd6" - integrity sha512-dImBZaKws54a4/QdoAVsLDm4/gfVnzAVD68pSGFPMTLNM2AZINvevfUfOrbUNTXwHvG2UJkthUxDGQZLsp3Vaw== +"@redocly/openapi-core@1.13.0", "@redocly/openapi-core@^1.0.0-rc.2": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.13.0.tgz#017125f70f7e030fad782f4073972f158c848967" + integrity sha512-lPvVE4+QjWMXCEIui994pYBZGqvEsodaCJPCJLkx6RK3OL/6Ss8wN17YTDmF49tzw3xgA8t4+x7TqelUSRcZUQ== dependencies: "@redocly/ajv" "^8.11.0" "@redocly/config" "^0.5.0" From cfd3295bde4b8a5f59f0595a3ea4c7a3af11a707 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 26 May 2024 22:48:16 +0000 Subject: [PATCH 13/27] Update GitHub Action `taiki-e/install-action` to v2.33.33 (#4521) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/actions/warm-up-repo/action.yml | 2 +- .github/workflows/bench.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/warm-up-repo/action.yml b/.github/actions/warm-up-repo/action.yml index c635f892c47..be5feb7d31d 100644 --- a/.github/actions/warm-up-repo/action.yml +++ b/.github/actions/warm-up-repo/action.yml @@ -17,7 +17,7 @@ runs: # cache: yarn ## Currently disabled because of frequent timeouts - name: Install WASM tools - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: wasm-pack@0.12.1 diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 73c769aed92..5f564102677 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -93,7 +93,7 @@ jobs: - name: Install Rust tools if: steps.benches.outputs.has-rust == 'true' - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: just@1.13.0,critcmp@0.1.8 @@ -241,7 +241,7 @@ jobs: - name: Install Rust tools if: steps.benches.outputs.has-rust == 'true' - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: just@1.13.0,critcmp@0.1.8 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9eebc2c8fd1..41f2d3c2130 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -105,7 +105,7 @@ jobs: - name: Install Rust tools if: always() && steps.lints.outputs.has-rust == 'true' - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: just@1.13.0,cargo-hack@0.6.28,rust-script@0.23.0,clippy-sarif@0.3.7,sarif-fmt@0.3.7 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5dbc3aa788f..1188434db17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -168,7 +168,7 @@ jobs: - name: Install Rust tools if: always() && steps.tests.outputs.has-rust == 'true' - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: just@1.13.0,cargo-hack@0.6.28,cargo-nextest@0.9.68,cargo-llvm-cov@0.6.9 @@ -285,7 +285,7 @@ jobs: - name: Install Rust tools if: always() && steps.tests.outputs.has-rust == 'true' - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: just@1.13.0,cargo-hack@0.6.28,cargo-nextest@0.9.68,cargo-llvm-cov@0.6.9 @@ -415,7 +415,7 @@ jobs: - name: Install Rust tools if: always() && steps.tests.outputs.has-rust == 'true' - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: just@1.13.0,cargo-hack@0.6.28,cargo-nextest@0.9.68,cargo-llvm-cov@0.6.9 @@ -550,7 +550,7 @@ jobs: - name: Install tools if: always() && steps.publish.outputs.has-rust == 'true' && github.event_name == 'pull_request' || github.event_name == 'merge_group' - uses: taiki-e/install-action@689459d9ffef015a7fbaef7f3b6b9f053f80a64d # v2.33.26 + uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 with: tool: cargo-semver-checks From c3f41d662aae8db6f206b317db7f5e594ce9f41c Mon Sep 17 00:00:00 2001 From: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> Date: Mon, 27 May 2024 15:08:42 +0200 Subject: [PATCH 14/27] H-2782: Add `hash-graph-types` package to define common types (#4523) --- apps/hash-ai-worker-ts/package.json | 1 + .../scripts/compare-llm-response.ts | 2 +- .../scripts/compare-llm-response/types.ts | 2 +- apps/hash-ai-worker-ts/src/activities.ts | 12 +- .../create-inference-usage-record-activity.ts | 2 +- .../infer-entities-from-content-action.ts | 2 +- .../flow-activities/persist-flow-activity.ts | 3 +- .../research-entities-action.ts | 10 +- .../deduplicate-entities.ts | 14 +- .../summarize-existing-entities.ts | 3 +- .../shared/get-file-entity-from-url.ts | 2 +- .../flow-activities/shared/graph-requests.ts | 4 +- .../shared/propose-entities-from-facts.ts | 2 +- .../propose-entity-from-facts.ts | 10 +- .../convert-subgraph-to-sheet-requests.ts | 4 +- .../get-filter-from-bp-query-entity.ts | 4 +- .../get-subgraph-from-filter.ts | 3 +- .../get-ai-assistant-account-id-activity.ts | 3 +- .../get-dereferenced-entity-types-activity.ts | 2 +- .../hash-ai-worker-ts/src/activities/graph.ts | 12 +- .../infer-entity-summaries-from-web-page.ts | 10 +- .../infer-entities/infer-entity-summaries.ts | 12 +- .../infer-entities/inference-types.ts | 3 +- .../infer-entities/propose-entities.ts | 5 +- .../shared/generate-simplified-type-id.ts | 2 +- ...map-simplified-properties-to-properties.ts | 2 +- .../create-inferred-entity-notification.ts | 3 +- .../shared/dereference-entity-type.ts | 4 +- .../src/activities/shared/embeddings.ts | 7 +- .../activities/shared/find-existing-entity.ts | 13 +- .../activities/shared/get-entity-by-filter.ts | 3 +- .../src/activities/shared/get-flow-context.ts | 9 +- .../src/activities/shared/get-llm-response.ts | 4 +- .../src/activities/shared/simplify-entity.ts | 3 +- ...r-exceeded-service-usage-limit-activity.ts | 3 +- .../get-alice-user-account-id.ts | 6 +- .../mock-get-flow-context.ts | 10 +- apps/hash-ai-worker-ts/src/workflows.ts | 16 +- .../src/workflows/run-flow-workflow.ts | 2 +- .../run-flow-workflow/initialize-flow.ts | 2 +- .../hash-api/src/ai/gpt/gpt-query-entities.ts | 2 +- apps/hash-api/src/ai/gpt/shared/webs.ts | 2 +- .../src/ai/infer-entities-websocket.ts | 2 +- .../handle-cancel-infer-entities-request.ts | 2 +- .../src/generate-ontology-type-ids.ts | 4 +- .../graph/account-permission-management.ts | 4 +- ...-system-entities-and-web-bots.migration.ts | 2 +- ...007-create-api-usage-tracking.migration.ts | 3 +- ...-plugin-settings-update-users.migration.ts | 2 +- ...ad-completed-at-property-type.migration.ts | 2 +- .../011-deprecate-preferred-name.migration.ts | 2 +- ...nabled-feature-flags-property.migration.ts | 2 +- .../015-add-flow-types.dev.migration.ts | 2 +- ...use-case-form-and-example-org.migration.ts | 2 +- .../migrate-ontology-types/types.ts | 2 +- .../migrate-ontology-types/util.ts | 16 +- .../util/upgrade-entities.ts | 10 +- .../system-webs-and-entities.ts | 8 +- .../src/graph/knowledge/primitive/entity.ts | 15 +- .../entity/after-create-entity-hooks.ts | 4 +- .../text-after-update-entity-hook-callback.ts | 3 +- ...user-before-update-entity-hook-callback.ts | 3 +- .../graph/knowledge/primitive/link-entity.ts | 9 +- .../system-types/block-collection.ts | 2 +- .../src/graph/knowledge/system-types/block.ts | 3 +- .../graph/knowledge/system-types/comment.ts | 7 +- .../knowledge/system-types/hash-instance.ts | 2 +- .../system-types/linear-integration-entity.ts | 9 +- .../system-types/linear-user-secret.ts | 10 +- .../knowledge/system-types/notification.ts | 3 +- .../knowledge/system-types/org-membership.ts | 4 +- .../src/graph/knowledge/system-types/org.ts | 14 +- .../src/graph/knowledge/system-types/page.ts | 4 +- .../src/graph/knowledge/system-types/text.ts | 3 +- .../knowledge/system-types/user-secret.ts | 10 +- .../src/graph/knowledge/system-types/user.ts | 12 +- .../src/graph/ontology/primitive/data-type.ts | 12 +- .../graph/ontology/primitive/entity-type.ts | 12 +- .../graph/ontology/primitive/property-type.ts | 10 +- .../src/graph/ontology/primitive/util.ts | 10 +- apps/hash-api/src/graph/system-account.ts | 3 +- .../src/graphql/authentication-context.ts | 2 +- .../resolvers/flows/get-flow-run-by-id.ts | 2 +- .../flows/submit-external-input-response.ts | 2 +- .../linear/sync-workspaces-with-teams.ts | 5 +- .../update-block-collection-actions.ts | 4 +- .../resolvers/knowledge/entity/entity.ts | 14 +- .../user/submit-early-access-form.ts | 2 +- .../graphql/resolvers/ontology/entity-type.ts | 12 +- .../resolvers/ontology/property-type.ts | 9 +- .../src/integrations/google/oauth-callback.ts | 2 +- apps/hash-api/src/integrations/linear.ts | 2 +- .../hash-api/src/integrations/linear/oauth.ts | 13 +- .../src/integrations/linear/sync-back.ts | 4 +- .../src/integrations/linear/webhook.ts | 3 +- apps/hash-api/src/seed-data/index.ts | 2 +- .../src/seed-data/seed-flow-test-types.ts | 12 +- apps/hash-api/src/seed-data/seed-pages.ts | 2 +- apps/hash-api/src/storage/index.ts | 3 +- apps/hash-frontend/package.json | 1 + .../src/blocks/use-fetch-block-subgraph.ts | 16 +- .../components/block-loader/block-loader.tsx | 2 +- .../knowledge/knowledge-shim.ts | 3 +- .../use-block-protocol-create-entity.ts | 2 +- .../use-block-protocol-file-upload.ts | 2 +- .../ontology/ontology-types-shim.ts | 6 +- .../use-block-protocol-create-entity-type.ts | 2 +- ...use-block-protocol-create-property-type.ts | 2 +- .../hooks/shared/get-page-refetch-queries.ts | 2 +- .../src/components/hooks/use-account-pages.ts | 8 +- .../src/components/hooks/use-archive-page.ts | 2 +- .../components/hooks/use-create-comment.ts | 2 +- .../src/components/hooks/use-create-page.ts | 2 +- .../components/hooks/use-create-sub-page.ts | 3 +- .../components/hooks/use-delete-comment.ts | 2 +- .../src/components/hooks/use-entity-by-id.ts | 2 +- .../hooks/use-get-account-id-for-shortname.ts | 3 +- .../hooks/use-get-owner-for-entity.ts | 3 +- .../components/hooks/use-orgs-with-links.ts | 3 +- .../src/components/hooks/use-page-comments.ts | 6 +- .../src/components/hooks/use-reorder-page.ts | 2 +- .../components/hooks/use-resolve-comment.ts | 2 +- .../hooks/use-update-comment-text.ts | 2 +- .../components/hooks/use-update-page-title.ts | 2 +- ...se-user-or-org-shortname-by-owned-by-id.ts | 2 +- .../components/hooks/use-users-with-links.ts | 3 +- apps/hash-frontend/src/lib/routes.ts | 2 +- apps/hash-frontend/src/lib/user-and-org.ts | 12 +- .../src/pages/[shortname].page.tsx | 3 +- .../edit-pinned-entity-types-modal.tsx | 3 +- .../user-profile-info-form.tsx | 4 +- .../user-profile-info-modal-header.tsx | 2 +- .../pinned-entity-type-tab-contents.tsx | 10 +- .../pages/[shortname].page/profile-bio.tsx | 3 +- .../src/pages/[shortname].page/util.ts | 6 +- .../pages/[shortname]/[page-slug].page.tsx | 3 +- .../canvas-page/block-creation-dialog.tsx | 2 +- .../canvas-page/block-shape.tsx | 2 +- .../entities/[entity-uuid].page.tsx | 10 +- .../link-table/cells/linked-with-cell.ts | 2 +- .../linked-entity-list-editor.tsx | 16 +- .../linked-entity-selector.tsx | 10 +- .../links-section/link-table/types.ts | 10 +- .../links-section/link-table/use-rows.ts | 3 +- .../property-table/cells/change-type-cell.tsx | 2 +- .../property-table/cells/value-cell.tsx | 2 +- .../value-cell/array-editor/draft-row.tsx | 2 +- .../value-cell/array-editor/sortable-row.tsx | 2 +- .../cells/value-cell/editor-specs.ts | 2 +- .../cells/value-cell/editor-type-picker.tsx | 2 +- .../inputs/number-or-text-input.tsx | 2 +- .../property-table/cells/value-cell/utils.ts | 2 +- .../property-table/types.ts | 2 +- .../generate-property-rows-from-entity.ts | 3 +- .../generate-property-row-recursively.ts | 8 +- .../get-expected-types-of-property-type.ts | 3 +- .../shared/use-draft-entity-subgraph.ts | 12 +- .../shared/use-draft-link-state.ts | 3 +- .../shared/use-mark-link-entity-to-archive.ts | 2 +- .../[shortname]/flows/[flow-def-id].page.tsx | 2 +- .../[shortname]/shared/archive-menu-item.tsx | 3 +- .../shared/flow-visualizer/activity-log.tsx | 6 +- .../outputs/entity-result-table.tsx | 10 +- .../outputs/persisted-entity-graph.tsx | 3 +- .../shared/flow-visualizer/run-flow-modal.tsx | 2 +- .../flow-visualizer/run-flow-modal/types.ts | 8 +- .../shared/use-route-namespace.tsx | 2 +- .../shared/use-update-profile-avatar.tsx | 2 +- .../get-entity-type-base-url.ts | 2 +- .../[shortname]/workers/[run-id].page.tsx | 2 +- apps/hash-frontend/src/pages/actions.page.tsx | 3 +- .../draft-entities-bulk-actions-dropdown.tsx | 3 +- .../src/pages/actions.page/draft-entities.tsx | 10 +- .../draft-entities-context-bar.tsx | 3 +- .../draft-entities/draft-entities-filters.tsx | 10 +- .../admin/users/[user-entity-uuid].page.tsx | 3 +- .../hash-frontend/src/pages/entities.page.tsx | 2 +- .../src/pages/goals/new.page.tsx | 3 +- .../convert-quick-note-to-page-modal.tsx | 3 +- .../pages/notes.page/create-quick-note.tsx | 8 +- .../pages/notes.page/editable-quick-note.tsx | 10 +- .../create-or-edit-sheets-sync.tsx | 2 +- .../settings/integrations/linear/new.page.tsx | 2 +- .../linear/select-linear-teams-table.tsx | 2 +- .../[shortname]/members.page/member-row.tsx | 3 +- .../organizations/shared/org-form.tsx | 2 +- .../src/pages/shared/auth-info-context.tsx | 13 +- .../pages/shared/block-collection-contents.ts | 3 +- .../block-collection/block-collection.tsx | 3 +- .../block-select-data-modal.tsx | 4 +- .../load-entity-menu-content.tsx | 3 +- .../shared/block-collection/block-view.tsx | 2 +- .../comments/comment-block.tsx | 2 +- .../comments/comment-thread.tsx | 3 +- .../comments/create-block-comment-button.tsx | 2 +- .../comments/create-block-comment.tsx | 2 +- .../block-collection/component-view.tsx | 2 +- .../block-collection/create-editor-view.ts | 5 +- .../create-suggester/create-suggester.tsx | 2 +- .../create-text-editor-view.ts | 2 +- .../mention-view/mention-node-view.ts | 2 +- .../mention-view/mention-view.tsx | 2 +- .../shared/block-collection/page-context.tsx | 2 +- .../page-title/page-title.tsx | 2 +- .../shared/mention-suggester.tsx | 15 +- .../mention-suggester-entity.tsx | 6 +- .../src/pages/shared/data-types-context.tsx | 6 +- .../src/pages/shared/entities-table.tsx | 4 +- .../grid-view/grid-view-item.tsx | 3 +- .../entities-table/use-entities-table.tsx | 10 +- ...-get-entities-table-additional-csv-data.ts | 7 +- .../src/pages/shared/entity-selector.tsx | 10 +- .../src/pages/shared/entity-type-page.tsx | 4 +- .../entity-type-page/definition-tab.tsx | 3 +- .../use-editor-ontology-functions.ts | 4 +- .../type-slide-over-slide.tsx | 2 +- .../use-entity-type-value.tsx | 10 +- .../src/pages/shared/entity-type-selector.tsx | 2 +- .../pages/shared/flow-definitions-context.tsx | 2 +- ...link-label-with-source-and-destination.tsx | 2 +- .../src/pages/shared/top-context-bar.tsx | 3 +- .../top-context-bar/archived-item-banner.tsx | 3 +- .../invite-account-form.tsx | 5 +- .../share-entity-section.tsx | 6 +- .../src/pages/shared/top-context-bar/util.ts | 3 +- .../shared/use-create-block-collection.ts | 2 +- .../src/pages/shared/web-selector.tsx | 2 +- .../src/pages/shared/workspace-context.tsx | 2 +- apps/hash-frontend/src/pages/signin.page.tsx | 2 +- .../src/pages/types/[[...type-kind]].page.tsx | 6 +- .../[[...type-kind]].page/types-table.tsx | 4 +- ...[...base64-baseurl-maybe-version].page.tsx | 2 +- .../src/shared/account-pages-variables.ts | 2 +- .../shared/entity-type-entities-context.ts | 8 +- ...use-entity-type-entities-context-value.tsx | 2 +- .../src/shared/entity-types-context/hooks.ts | 5 +- .../use-entity-types-context-value.ts | 2 +- .../shared/context-types.ts | 7 +- .../shared/is-special-entity-type.ts | 2 +- .../src/shared/file-upload-context.tsx | 9 +- apps/hash-frontend/src/shared/is-archived.ts | 8 +- apps/hash-frontend/src/shared/is-of-type.ts | 6 +- .../account-entities-list.tsx | 2 +- .../entity-type-item.tsx | 2 +- .../account-page-list/account-page-list.tsx | 3 +- .../account-page-list/page-menu.tsx | 2 +- .../account-page-list/page-tree-item.tsx | 2 +- .../account-page-list/utils.ts | 2 +- .../workspace-switcher.tsx | 2 +- .../src/shared/page-icon-button.tsx | 2 +- .../src/shared/property-types-context.tsx | 2 +- .../src/shared/readonly-mode.tsx | 2 +- .../src/shared/routing/route-page-info.tsx | 2 +- .../hash-frontend/src/shared/table-header.tsx | 6 +- .../table-header/bulk-actions-dropdown.tsx | 4 +- apps/hash-frontend/src/shared/use-actors.ts | 3 +- .../src/shared/use-entity-icon.tsx | 3 +- .../src/shared/use-entity-type-entities.tsx | 9 +- .../src/shared/use-update-page-icon.ts | 2 +- .../src/shared/use-user-or-org.ts | 6 +- .../shared/use-user-permissions-on-entity.ts | 3 +- .../src/linear-activities.ts | 10 +- .../src/linear-activities/mappings.ts | 4 +- .../src/shared/graph-requests.ts | 10 +- apps/plugin-browser/package.json | 1 + .../shared/entity-type-selector.tsx | 5 +- .../shared/select-web-target.tsx | 2 +- .../shared/select-web-target/web-selector.tsx | 2 +- .../action-center/shared/use-flow-runs.ts | 2 +- .../src/shared/create-default-settings.ts | 2 +- .../src/shared/create-entity.ts | 7 +- apps/plugin-browser/src/shared/get-user.ts | 12 +- apps/plugin-browser/src/shared/messages.ts | 2 +- apps/plugin-browser/src/shared/storage.ts | 6 +- .../src/shared/storage/update-entity.ts | 7 +- .../flows/get-flow-run-details.ts | 2 +- libs/@local/hash-backend-utils/src/error.ts | 2 +- .../hash-backend-utils/src/file-storage.ts | 3 +- libs/@local/hash-backend-utils/src/flows.ts | 11 +- libs/@local/hash-backend-utils/src/google.ts | 9 +- .../hash-backend-utils/src/hash-instance.ts | 6 +- .../src/linear-type-mappings.ts | 7 +- .../hash-backend-utils/src/machine-actors.ts | 8 +- .../hash-backend-utils/src/notifications.ts | 12 +- .../hash-backend-utils/src/pg-tables.ts | 3 +- .../src/public-user-account-id.ts | 2 +- .../hash-backend-utils/src/service-usage.ts | 8 +- .../src/simplified-graph.ts | 3 +- .../temporal-integration-workflow-types.ts | 10 +- .../hash-backend-utils/src/user-secret.ts | 9 +- libs/@local/hash-backend-utils/src/vault.ts | 2 +- .../hash-graph-sdk/typescript/package.json | 13 +- .../hash-graph-sdk/typescript/src/entity.ts | 2 +- .../hash-graph-types/typescript/.eslintrc.cjs | 7 + .../hash-graph-types/typescript/LICENSE.md | 607 ++++++++++++++++++ .../hash-graph-types/typescript/package.json | 35 + .../typescript/src/account.ts | 18 + .../typescript/src/authorization.ts | 4 + .../typescript/src/branded.ts | 4 + .../hash-graph-types/typescript/src/entity.ts | 104 +++ .../typescript/src/ontology.ts | 242 +++++++ .../typescript/src}/temporal-versioning.ts | 10 + .../hash-graph-types/typescript/src/web.ts | 6 + .../hash-graph-types/typescript/tsconfig.json | 4 + .../@local/hash-isomorphic-utils/package.json | 1 + .../src/ai-inference-types.ts | 7 +- .../src/create-prose-mirror-state.ts | 2 +- .../hash-isomorphic-utils/src/data-types.ts | 2 +- .../src/entity-store-plugin.ts | 10 +- .../hash-isomorphic-utils/src/entity-store.ts | 4 +- .../hash-isomorphic-utils/src/entity.ts | 3 +- .../flows/browser-plugin-flow-definitions.ts | 2 +- .../src/flows/browser-plugin-flow-types.ts | 2 +- .../src/flows/example-flow-definitions.ts | 2 +- .../src/flows/mappings.ts | 3 +- .../src/flows/temporal-types.ts | 3 +- .../hash-isomorphic-utils/src/flows/types.ts | 12 +- .../src/frontend-paths.ts | 2 +- .../src/generate-entity-label.ts | 8 +- .../src/google-integration.ts | 2 +- .../src/graph-queries.ts | 6 +- .../src/graphql/scalar-mapping.ts | 37 +- .../src/ontology-types.ts | 2 +- .../src/parse-text-from-file-types.ts | 3 +- .../src/prosemirror-manager.ts | 3 +- libs/@local/hash-isomorphic-utils/src/save.ts | 10 +- .../src/service-usage.ts | 2 +- .../src/subgraph-mapping.ts | 15 +- .../src/system-types/canvas.ts | 3 +- .../src/system-types/commentnotification.ts | 3 +- .../system-types/google/googlesheetsfile.ts | 3 +- .../src/system-types/google/shared.ts | 3 +- .../system-types/googlesheetsintegration.ts | 0 .../src/system-types/linear/attachment.ts | 3 +- .../src/system-types/linear/shared.ts | 3 +- .../src/system-types/linearintegration.ts | 3 +- .../src/system-types/mentionnotification.ts | 3 +- .../src/system-types/shared.ts | 3 +- .../src/system-types/usagerecord.ts | 3 +- .../@local/hash-isomorphic-utils/src/types.ts | 3 +- libs/@local/hash-subgraph/package.json | 1 + .../src/shared/type-system-patch.ts | 3 +- libs/@local/hash-subgraph/src/stdlib/bound.ts | 6 +- .../hash-subgraph/src/stdlib/interval.ts | 3 +- .../src/stdlib/subgraph/edge/link-entity.ts | 10 +- .../src/stdlib/subgraph/element/data-type.ts | 7 +- .../stdlib/subgraph/element/entity-type.ts | 7 +- .../src/stdlib/subgraph/element/entity.ts | 10 +- .../stdlib/subgraph/element/property-type.ts | 7 +- .../src/stdlib/subgraph/temporal-axes.ts | 3 +- .../@local/hash-subgraph/src/types/element.ts | 5 +- .../src/types/element/knowledge.ts | 64 +- .../src/types/element/ontology.ts | 229 +------ libs/@local/hash-subgraph/src/types/shared.ts | 44 -- .../hash-subgraph/src/types/shared/branded.ts | 69 +- .../hash-subgraph/src/types/subgraph.ts | 6 +- .../hash-subgraph/src/types/subgraph/edges.ts | 4 +- .../src/types/subgraph/edges/outward-edge.ts | 6 +- .../src/types/subgraph/element-mappings.ts | 10 +- .../src/types/subgraph/temporal-axes.ts | 3 +- .../src/types/subgraph/vertices.ts | 11 +- .../tests/compatibility.test/map-axes.ts | 2 +- .../tests/compatibility.test/map-edges.ts | 6 +- .../tests/compatibility.test/map-vertices.ts | 26 +- tests/hash-backend-integration/package.json | 1 + .../graph/knowledge/primitive/entity.test.ts | 13 +- .../knowledge/primitive/link-entity.test.ts | 8 +- .../knowledge/system-types/block.test.ts | 8 +- .../system-types/comment-notification.test.ts | 2 +- .../knowledge/system-types/comment.test.ts | 2 +- .../graph/knowledge/system-types/file.test.ts | 4 +- .../system-types/mention-notification.test.ts | 3 +- .../graph/knowledge/system-types/page.test.ts | 2 +- .../ontology/primitive/data-type.test.ts | 4 +- .../ontology/primitive/entity-type.test.ts | 10 +- .../ontology/primitive/property-type.test.ts | 3 +- .../src/tests/subgraph/circular.test.ts | 4 +- .../src/tests/subgraph/friendship.test.ts | 10 +- .../tests/shared/api-queries.ts | 9 +- 379 files changed, 1953 insertions(+), 1263 deletions(-) create mode 100644 libs/@local/hash-graph-types/typescript/.eslintrc.cjs create mode 100644 libs/@local/hash-graph-types/typescript/LICENSE.md create mode 100644 libs/@local/hash-graph-types/typescript/package.json create mode 100644 libs/@local/hash-graph-types/typescript/src/account.ts create mode 100644 libs/@local/hash-graph-types/typescript/src/authorization.ts create mode 100644 libs/@local/hash-graph-types/typescript/src/branded.ts create mode 100644 libs/@local/hash-graph-types/typescript/src/entity.ts create mode 100644 libs/@local/hash-graph-types/typescript/src/ontology.ts rename libs/@local/{hash-subgraph/src/types/shared => hash-graph-types/typescript/src}/temporal-versioning.ts (92%) create mode 100644 libs/@local/hash-graph-types/typescript/src/web.ts create mode 100644 libs/@local/hash-graph-types/typescript/tsconfig.json create mode 100644 libs/@local/hash-isomorphic-utils/src/system-types/googlesheetsintegration.ts diff --git a/apps/hash-ai-worker-ts/package.json b/apps/hash-ai-worker-ts/package.json index b63501b9366..d3392776ed1 100644 --- a/apps/hash-ai-worker-ts/package.json +++ b/apps/hash-ai-worker-ts/package.json @@ -43,6 +43,7 @@ "@local/advanced-types": "0.0.0-private", "@local/hash-backend-utils": "0.0.0-private", "@local/hash-graph-client": "0.0.0-private", + "@local/hash-graph-types": "0.0.0-private", "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", "@local/status": "0.0.0-private", diff --git a/apps/hash-ai-worker-ts/scripts/compare-llm-response.ts b/apps/hash-ai-worker-ts/scripts/compare-llm-response.ts index bd8dc4b85e5..5e95e53ec82 100644 --- a/apps/hash-ai-worker-ts/scripts/compare-llm-response.ts +++ b/apps/hash-ai-worker-ts/scripts/compare-llm-response.ts @@ -2,7 +2,7 @@ import { mkdirSync, writeFileSync } from "node:fs"; import { dirname } from "node:path"; import { fileURLToPath } from "node:url"; -import { type OwnedById } from "@local/hash-subgraph"; +import { type OwnedById } from "@local/hash-graph-types/web"; import { getLlmResponse } from "../src/activities/shared/get-llm-response"; import type { diff --git a/apps/hash-ai-worker-ts/scripts/compare-llm-response/types.ts b/apps/hash-ai-worker-ts/scripts/compare-llm-response/types.ts index 12a2727c96a..fca8597a100 100644 --- a/apps/hash-ai-worker-ts/scripts/compare-llm-response/types.ts +++ b/apps/hash-ai-worker-ts/scripts/compare-llm-response/types.ts @@ -1,4 +1,4 @@ -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; import type { AnthropicLlmParams, diff --git a/apps/hash-ai-worker-ts/src/activities.ts b/apps/hash-ai-worker-ts/src/activities.ts index 1e43783b2c6..8fad9022ad3 100644 --- a/apps/hash-ai-worker-ts/src/activities.ts +++ b/apps/hash-ai-worker-ts/src/activities.ts @@ -3,17 +3,17 @@ import type { EntityEmbedding, GraphApi, } from "@local/hash-graph-client"; +import type { + DataTypeWithMetadata, + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import type { CreateEmbeddingsParams, CreateEmbeddingsReturn, } from "@local/hash-isomorphic-utils/ai-inference-types"; import type { ParseTextFromFileParams } from "@local/hash-isomorphic-utils/parse-text-from-file-types"; -import type { - DataTypeWithMetadata, - EntityPropertiesObject, - EntityTypeWithMetadata, - PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +import type { EntityPropertiesObject } from "@local/hash-subgraph"; import type { CreateEmbeddingResponse } from "openai/resources"; import { createInferenceUsageRecordActivity } from "./activities/create-inference-usage-record-activity"; diff --git a/apps/hash-ai-worker-ts/src/activities/create-inference-usage-record-activity.ts b/apps/hash-ai-worker-ts/src/activities/create-inference-usage-record-activity.ts index 0c8daf31ee9..696a2ec4f85 100644 --- a/apps/hash-ai-worker-ts/src/activities/create-inference-usage-record-activity.ts +++ b/apps/hash-ai-worker-ts/src/activities/create-inference-usage-record-activity.ts @@ -1,6 +1,6 @@ import { createUsageRecord } from "@local/hash-backend-utils/service-usage"; import type { EntityMetadata, GraphApi } from "@local/hash-graph-client"; -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; import type { LlmUsage } from "./shared/get-llm-response/types"; import type { PermittedOpenAiModel } from "./shared/openai-client"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/infer-entities-from-content-action.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/infer-entities-from-content-action.ts index bc9f317b49f..a6a07078ecf 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/infer-entities-from-content-action.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/infer-entities-from-content-action.ts @@ -1,4 +1,5 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { isInferenceModelName } from "@local/hash-isomorphic-utils/ai-inference-types"; import { getSimplifiedActionInputs, @@ -6,7 +7,6 @@ import { } from "@local/hash-isomorphic-utils/flows/action-definitions"; import type { ProposedEntity } from "@local/hash-isomorphic-utils/flows/types"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; -import type { EntityId } from "@local/hash-subgraph"; import { StatusCode } from "@local/status"; import { getAiAssistantAccountIdActivity } from "../get-ai-assistant-account-id-activity"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts index 79620e1a7de..bfdfe7bc4a7 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-flow-activity.ts @@ -1,9 +1,10 @@ import { getFlowRunEntityById } from "@local/hash-backend-utils/flows"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { mapFlowRunToEntityProperties } from "@local/hash-isomorphic-utils/flows/mappings"; import type { LocalFlowRun } from "@local/hash-isomorphic-utils/flows/types"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { AccountId, OwnedById } from "@local/hash-subgraph"; import { graphApiClient } from "../shared/graph-api-client"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action.ts index e4468f5f838..8aa1b9af29c 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action.ts @@ -1,5 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { OriginProvenance } from "@local/hash-graph-client"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { InputNameForAction, OutputNameForAction, @@ -11,7 +12,6 @@ import type { } from "@local/hash-isomorphic-utils/flows/types"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; import type { FileProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { EntityId } from "@local/hash-subgraph"; import { StatusCode } from "@local/status"; import { Context } from "@temporalio/activity"; import dedent from "dedent"; @@ -308,7 +308,7 @@ export const researchEntitiesAction: FlowActionActivity<{ The following entity type IDs are invalid: ${JSON.stringify( invalidEntityTypeIds, )} - + Valid entity type IDs are: ${JSON.stringify(validEntityTypeIds)} `) : "" @@ -319,12 +319,12 @@ export const researchEntitiesAction: FlowActionActivity<{ The following link entity type IDs are invalid: ${JSON.stringify( invalidLinkEntityTypeIds, )} - + The valid link entity types type IDs are: ${JSON.stringify(linkEntityTypeIds)} `) : "" } - + `), isError: true, }; @@ -346,7 +346,7 @@ export const researchEntitiesAction: FlowActionActivity<{ ...toolCall, output: dedent(` An error occurred when inferring facts from the web page with url ${url}: ${status.message} - + Try another website. `), isError: true, diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/deduplicate-entities.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/deduplicate-entities.ts index 9a6de827ea5..466f6dc8f19 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/deduplicate-entities.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/deduplicate-entities.ts @@ -1,4 +1,4 @@ -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import dedent from "dedent"; import { getFlowContext } from "../../shared/get-flow-context"; @@ -23,25 +23,25 @@ import type { ExistingEntitySummary } from "./summarize-existing-entities"; */ export const deduplicationAgentSystemPrompt = ` You are a deduplication agent. Your task is to identify duplicate entities in a list of entities. - + Use your best judgement to determine which entities are duplicates, based on: 1. The name of the entities 2. Their types 3. Their summaries - + Bear in mind that: 1. the same entity may be described in different ways, or be named in slightly different ways 2. the same entity may have different types, where the different types could conceivably apply to the same entity 3. the same or very similar name may refer to different entities 4. the same or very similar summary may refer to different entities - + If in doubt, do not merge entities. If you are confident that two entities are duplicates, merge them. - + Once you have identified duplicates, you must pick a single canonical entity to assign its duplicate(s) too. Choose the one with the best summary. - + If there are no duplicates, return an empty list for the 'duplicates' property. - + Here are the entities you need to consider: `; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/summarize-existing-entities.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/summarize-existing-entities.ts index d68e14231b5..11a2226041e 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/summarize-existing-entities.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/summarize-existing-entities.ts @@ -1,5 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import dedent from "dedent"; import { getFlowContext } from "../../shared/get-flow-context"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/get-file-entity-from-url.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/get-file-entity-from-url.ts index 60e018dcc48..de789e5f4e8 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/get-file-entity-from-url.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/get-file-entity-from-url.ts @@ -26,12 +26,12 @@ import type { PropertyMetadataMap, ProvidedEntityEditionProvenance, } from "@local/hash-graph-client"; +import type { EntityMetadata } from "@local/hash-graph-types/entity"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { mapGraphApiEntityMetadataToMetadata } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { FileProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { EntityMetadata } from "@local/hash-subgraph"; import mime from "mime-types"; import { getAiAssistantAccountIdActivity } from "../../get-ai-assistant-account-id-activity"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/graph-requests.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/graph-requests.ts index 6eb3c2a817b..44455947b83 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/graph-requests.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/graph-requests.ts @@ -3,15 +3,15 @@ import type { GraphApi, PropertyPatchOperation, } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { - AccountId, Entity, - EntityId, EntityPropertiesObject, EntityRootType, } from "@local/hash-subgraph"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts.ts index b15d19f6c47..c7acd800b9a 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts.ts @@ -1,5 +1,5 @@ +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import type { ProposedEntity } from "@local/hash-isomorphic-utils/flows/types"; -import type { BaseUrl } from "@local/hash-subgraph"; import type { DereferencedEntityTypesByTypeId } from "../../infer-entities/inference-types"; import { logger } from "../../shared/activity-logger"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts index e0c0e74923f..ae782ad76d9 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts @@ -1,7 +1,7 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import type { ProposedEntity } from "@local/hash-isomorphic-utils/flows/types"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; -import type { BaseUrl } from "@local/hash-subgraph"; import dedent from "dedent"; import type { JSONSchemaDefinition } from "openai/lib/jsonschema"; @@ -252,10 +252,10 @@ const generateSystemPrompt = (params: { proposingOutgoingLinks: boolean }) => The user will provide you with: - Facts: a list of facts about the entity ${params.proposingOutgoingLinks ? `Possible outgoing link target entities: a list of entities which can be used as target entities when defining outgoing links on the entity` : ``} - + The user has requested that you fill out as many properties as possible, so please do so. Do not optimize for short responses. - The provided facts are your only source of information, so make sure to extract as much information as possible, + The provided facts are your only source of information, so make sure to extract as much information as possible, and do not rely on other information about the entities in question you may know. You must make exactly one tool call. @@ -338,7 +338,7 @@ export const proposeEntityFromFacts = async (params: { )}` : "" } - + `), }, ], @@ -548,7 +548,7 @@ export const proposeEntityFromFacts = async (params: { tool_use_id: proposeEntityToolCall.id, content: dedent(` ${retryToolCallMessages.join("\n")} - + Make another call to "proposeEntity" addressing the issue(s). `), is_error: true, diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts index 8a6f766f858..367922e1f7a 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts @@ -4,12 +4,12 @@ import { typedKeys, typedValues, } from "@local/advanced-types/typed-entries"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { isDraftEntity } from "@local/hash-isomorphic-utils/entity-store"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { blockProtocolEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { - BaseUrl, - EntityId, EntityRootType, EntityVertex, Subgraph, diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-filter-from-bp-query-entity.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-filter-from-bp-query-entity.ts index bf0c42ee39d..3ffe1c81944 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-filter-from-bp-query-entity.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-filter-from-bp-query-entity.ts @@ -1,9 +1,11 @@ import type { MultiFilter } from "@blockprotocol/graph"; import { convertBpFilterToGraphFilter } from "@local/hash-backend-utils/convert-bp-filter-to-graph-filter"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { blockProtocolPropertyTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { QueryProperties } from "@local/hash-isomorphic-utils/system-types/blockprotocol/query"; -import type { AccountId, Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { getLatestEntityById } from "../shared/graph-requests"; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-subgraph-from-filter.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-subgraph-from-filter.ts index 6d665f028cd..71e48b03a71 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-subgraph-from-filter.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/get-subgraph-from-filter.ts @@ -1,10 +1,11 @@ import type { Filter, GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { AccountId, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; export const getSubgraphFromFilter = async ({ authentication, diff --git a/apps/hash-ai-worker-ts/src/activities/get-ai-assistant-account-id-activity.ts b/apps/hash-ai-worker-ts/src/activities/get-ai-assistant-account-id-activity.ts index 8612a4527be..9f3efb96652 100644 --- a/apps/hash-ai-worker-ts/src/activities/get-ai-assistant-account-id-activity.ts +++ b/apps/hash-ai-worker-ts/src/activities/get-ai-assistant-account-id-activity.ts @@ -3,7 +3,8 @@ import { getWebMachineActorId, } from "@local/hash-backend-utils/machine-actors"; import type { GraphApi } from "@local/hash-graph-client"; -import type { AccountId, OwnedById } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { OwnedById } from "@local/hash-graph-types/web"; export const getAiAssistantAccountIdActivity = async (params: { authentication: { actorId: AccountId }; diff --git a/apps/hash-ai-worker-ts/src/activities/get-dereferenced-entity-types-activity.ts b/apps/hash-ai-worker-ts/src/activities/get-dereferenced-entity-types-activity.ts index 52fb37a4c9e..1cfa3820d37 100644 --- a/apps/hash-ai-worker-ts/src/activities/get-dereferenced-entity-types-activity.ts +++ b/apps/hash-ai-worker-ts/src/activities/get-dereferenced-entity-types-activity.ts @@ -1,12 +1,12 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import { typedEntries } from "@local/advanced-types/typed-entries"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { AccountId } from "@local/hash-subgraph"; import type { DereferencedEntityTypesByTypeId } from "./infer-entities/inference-types"; import { dereferenceEntityType } from "./shared/dereference-entity-type"; diff --git a/apps/hash-ai-worker-ts/src/activities/graph.ts b/apps/hash-ai-worker-ts/src/activities/graph.ts index 2509b64accb..c7a4007e732 100644 --- a/apps/hash-ai-worker-ts/src/activities/graph.ts +++ b/apps/hash-ai-worker-ts/src/activities/graph.ts @@ -11,6 +11,13 @@ import type { UpdateEntityTypeEmbeddingParams, UpdatePropertyTypeEmbeddingParams, } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { + DataTypeWithMetadata, + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { @@ -18,17 +25,12 @@ import { mapGraphApiSubgraphToSubgraph, } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { - AccountId, DataTypeRootType, - DataTypeWithMetadata, Entity, EntityRootType, EntityTypeRootType, - EntityTypeWithMetadata, PropertyTypeRootType, - PropertyTypeWithMetadata, Subgraph, - Uuid, } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { diff --git a/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries-from-web-page.ts b/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries-from-web-page.ts index 8d1fb5ee7af..ef9323c8e80 100644 --- a/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries-from-web-page.ts +++ b/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries-from-web-page.ts @@ -1,11 +1,9 @@ import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { WebPage } from "@local/hash-isomorphic-utils/flows/types"; -import type { - AccountId, - Entity, - EntityId, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import dedent from "dedent"; import type { PermittedOpenAiModel } from "../shared/openai-client"; diff --git a/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries.ts b/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries.ts index 1e759542bf0..8bea5ad54c8 100644 --- a/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries.ts +++ b/apps/hash-ai-worker-ts/src/activities/infer-entities/infer-entity-summaries.ts @@ -1,11 +1,9 @@ import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import type { GraphApi } from "@local/hash-graph-client"; -import type { - AccountId, - Entity, - EntityId, - OwnedById, -} from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; +import type { Entity } from "@local/hash-subgraph"; import type { Status } from "@local/status"; import { StatusCode } from "@local/status"; import dedent from "dedent"; @@ -325,7 +323,7 @@ export const inferEntitySummaries = async (params: { You did not suggest any ${missingContentKinds} of the following types: ${typesWithNoSuggestionsToRerequest .map(({ schema }) => schema.$id) .join(", ")}. - + Please reconsider the input text to see if you can identify any ${missingContentKinds} of those types${existingEntities && existingEntities.length > 0 && isMissingLinks ? ", including whether any links can be created to the existing entities provided." : "."} `), role: "user", diff --git a/apps/hash-ai-worker-ts/src/activities/infer-entities/inference-types.ts b/apps/hash-ai-worker-ts/src/activities/infer-entities/inference-types.ts index 5b77c6b83d5..d4447c6d049 100644 --- a/apps/hash-ai-worker-ts/src/activities/infer-entities/inference-types.ts +++ b/apps/hash-ai-worker-ts/src/activities/infer-entities/inference-types.ts @@ -1,9 +1,10 @@ import type { VersionedUrl } from "@blockprotocol/type-system/slim"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import type { InferredEntityChangeResult, ProposedEntity, } from "@local/hash-isomorphic-utils/ai-inference-types"; -import type { BaseUrl, Entity } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import type OpenAI from "openai"; import type { DereferencedEntityType } from "../shared/dereference-entity-type"; diff --git a/apps/hash-ai-worker-ts/src/activities/infer-entities/propose-entities.ts b/apps/hash-ai-worker-ts/src/activities/infer-entities/propose-entities.ts index cdef4063d02..53fc8b07b20 100644 --- a/apps/hash-ai-worker-ts/src/activities/infer-entities/propose-entities.ts +++ b/apps/hash-ai-worker-ts/src/activities/infer-entities/propose-entities.ts @@ -1,7 +1,8 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import { typedEntries } from "@local/advanced-types/typed-entries"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { ProposedEntity } from "@local/hash-isomorphic-utils/ai-inference-types"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import type { Status } from "@local/status"; import { StatusCode } from "@local/status"; import { Context } from "@temporalio/activity"; @@ -461,7 +462,7 @@ export const proposeEntities = async (params: { if (invalidProposedEntities.length > 0) { retryMessageContentText += dedent(` - Some of the entities you suggested for creation were invalid. Please review their properties and try again. + Some of the entities you suggested for creation were invalid. Please review their properties and try again. The entities you should review and make a 'create_entities' call for are: ${invalidProposedEntities .map( diff --git a/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/generate-simplified-type-id.ts b/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/generate-simplified-type-id.ts index ba3462c5baf..55a870ff4db 100644 --- a/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/generate-simplified-type-id.ts +++ b/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/generate-simplified-type-id.ts @@ -1,5 +1,5 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; -import type { BaseUrl } from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; const generateSimplifiedTypeIdFromTitle = (params: { title: string; diff --git a/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/map-simplified-properties-to-properties.ts b/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/map-simplified-properties-to-properties.ts index e0d03708f77..e725d3b3b69 100644 --- a/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/map-simplified-properties-to-properties.ts +++ b/apps/hash-ai-worker-ts/src/activities/infer-entities/shared/map-simplified-properties-to-properties.ts @@ -1,5 +1,5 @@ +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import type { - BaseUrl, Entity, EntityPropertiesObject, EntityPropertyValue, diff --git a/apps/hash-ai-worker-ts/src/activities/shared/create-inferred-entity-notification.ts b/apps/hash-ai-worker-ts/src/activities/shared/create-inferred-entity-notification.ts index 9780be7ab68..03c019834a8 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/create-inferred-entity-notification.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/create-inferred-entity-notification.ts @@ -1,6 +1,7 @@ import { createGraphChangeNotification } from "@local/hash-backend-utils/notifications"; import type { GraphApi } from "@local/hash-graph-client"; -import type { AccountId, Entity } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { Entity } from "@local/hash-subgraph"; import { extractDraftIdFromEntityId } from "@local/hash-subgraph"; export const createInferredEntityNotification = async ({ diff --git a/apps/hash-ai-worker-ts/src/activities/shared/dereference-entity-type.ts b/apps/hash-ai-worker-ts/src/activities/shared/dereference-entity-type.ts index bfc53df1242..e4d2227d6e9 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/dereference-entity-type.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/dereference-entity-type.ts @@ -14,8 +14,8 @@ import type { BaseUrl, CustomDataType, EntityTypeMetadata, - Subgraph, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { Subgraph } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import { getDataTypeById, diff --git a/apps/hash-ai-worker-ts/src/activities/shared/embeddings.ts b/apps/hash-ai-worker-ts/src/activities/shared/embeddings.ts index bfadbf5a4db..40ae5a2504a 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/embeddings.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/embeddings.ts @@ -3,14 +3,15 @@ import type { Embedding, PropertyType } from "@local/hash-graph-client"; import type { BaseUrl, DataTypeWithMetadata, - EntityPropertiesObject, - EntityPropertyValue, EntityTypeWithMetadata, PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { + EntityPropertiesObject, + EntityPropertyValue, } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import OpenAI from "openai"; - import Usage = OpenAI.CreateEmbeddingResponse.Usage; const openai = new OpenAI({ diff --git a/apps/hash-ai-worker-ts/src/activities/shared/find-existing-entity.ts b/apps/hash-ai-worker-ts/src/activities/shared/find-existing-entity.ts index 100d5f63cd2..c64b37a6321 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/find-existing-entity.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/find-existing-entity.ts @@ -4,6 +4,10 @@ import type { CosineDistanceFilter, GraphApi, } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ProposedEntity } from "@local/hash-isomorphic-utils/flows/types"; import { currentTimeInstantTemporalAxes, @@ -12,14 +16,7 @@ import { zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { - AccountId, - BaseUrl, - Entity, - EntityTypeRootType, - LinkData, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity, EntityTypeRootType } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-ai-worker-ts/src/activities/shared/get-entity-by-filter.ts b/apps/hash-ai-worker-ts/src/activities/shared/get-entity-by-filter.ts index bfd43e9c4a7..b011c5a23e7 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/get-entity-by-filter.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/get-entity-by-filter.ts @@ -1,7 +1,8 @@ import type { Filter, GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { AccountId, Entity } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; export const getEntityByFilter = async ({ actorId, diff --git a/apps/hash-ai-worker-ts/src/activities/shared/get-flow-context.ts b/apps/hash-ai-worker-ts/src/activities/shared/get-flow-context.ts index 77a6d7eaa15..ee8909d172f 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/get-flow-context.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/get-flow-context.ts @@ -1,12 +1,9 @@ import { createTemporalClient } from "@local/hash-backend-utils/temporal"; import { parseHistoryItemPayload } from "@local/hash-backend-utils/temporal/parse-history-item-payload"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { RunFlowWorkflowParams } from "@local/hash-isomorphic-utils/flows/temporal-types"; -import type { - AccountId, - EntityId, - EntityUuid, - OwnedById, -} from "@local/hash-subgraph"; import { entityIdFromComponents } from "@local/hash-subgraph"; import { Context } from "@temporalio/activity"; import { caching } from "cache-manager"; diff --git a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts index 1303bee57fa..86ec79cee0e 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response.ts @@ -1,8 +1,10 @@ import { getHashInstanceAdminAccountGroupId } from "@local/hash-backend-utils/hash-instance"; import { createUsageRecord } from "@local/hash-backend-utils/service-usage"; import type { EntityMetadata, GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemLinkEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { AccountId, EntityId, OwnedById } from "@local/hash-subgraph"; import { StatusCode } from "@local/status"; import Ajv from "ajv"; import addFormats from "ajv-formats"; diff --git a/apps/hash-ai-worker-ts/src/activities/shared/simplify-entity.ts b/apps/hash-ai-worker-ts/src/activities/shared/simplify-entity.ts index 96b359947a6..359597af115 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/simplify-entity.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/simplify-entity.ts @@ -1,5 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; type SimplifiedEntity = { entityId: EntityId; diff --git a/apps/hash-ai-worker-ts/src/activities/user-exceeded-service-usage-limit-activity.ts b/apps/hash-ai-worker-ts/src/activities/user-exceeded-service-usage-limit-activity.ts index 70a2f723f38..0633de22596 100644 --- a/apps/hash-ai-worker-ts/src/activities/user-exceeded-service-usage-limit-activity.ts +++ b/apps/hash-ai-worker-ts/src/activities/user-exceeded-service-usage-limit-activity.ts @@ -1,7 +1,8 @@ import { isUserHashInstanceAdmin } from "@local/hash-backend-utils/hash-instance"; import { getUserServiceUsage } from "@local/hash-backend-utils/service-usage"; import type { GraphApi } from "@local/hash-graph-client"; -import type { AccountId, Timestamp } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import type { Status } from "@local/status"; import { StatusCode } from "@local/status"; diff --git a/apps/hash-ai-worker-ts/src/shared/testing-utilities/get-alice-user-account-id.ts b/apps/hash-ai-worker-ts/src/shared/testing-utilities/get-alice-user-account-id.ts index e37e1ec0d76..8e0546d06ce 100644 --- a/apps/hash-ai-worker-ts/src/shared/testing-utilities/get-alice-user-account-id.ts +++ b/apps/hash-ai-worker-ts/src/shared/testing-utilities/get-alice-user-account-id.ts @@ -1,4 +1,5 @@ import { publicUserAccountId } from "@local/hash-backend-utils/public-user-account-id"; +import type { AccountId } from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -8,10 +9,7 @@ import { systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import { - type AccountId, - extractOwnedByIdFromEntityId, -} from "@local/hash-subgraph"; +import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { graphApiClient } from "../../activities/shared/graph-api-client"; diff --git a/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts b/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts index fee78d58f6d..0fca588e2ec 100644 --- a/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts +++ b/apps/hash-ai-worker-ts/src/shared/testing-utilities/mock-get-flow-context.ts @@ -1,13 +1,11 @@ +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { RunFlowWorkflowParams } from "@local/hash-isomorphic-utils/flows/temporal-types"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { FlowRunProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import { - type AccountId, - type EntityId, - extractEntityUuidFromEntityId, - type OwnedById, -} from "@local/hash-subgraph"; +import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import type { Context } from "@temporalio/activity"; // eslint-disable-next-line import/no-extraneous-dependencies import { vi } from "vitest"; diff --git a/apps/hash-ai-worker-ts/src/workflows.ts b/apps/hash-ai-worker-ts/src/workflows.ts index 1add1483d4f..a6175c3549e 100644 --- a/apps/hash-ai-worker-ts/src/workflows.ts +++ b/apps/hash-ai-worker-ts/src/workflows.ts @@ -1,19 +1,19 @@ import type { EntityQueryCursor, Filter } from "@local/hash-graph-client"; import type { Entity as GraphApiEntity } from "@local/hash-graph-client/api"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityMetadata } from "@local/hash-graph-types/entity"; +import type { + DataTypeWithMetadata, + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import type { CreateEmbeddingsParams, CreateEmbeddingsReturn, } from "@local/hash-isomorphic-utils/ai-inference-types"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { ParseTextFromFileParams } from "@local/hash-isomorphic-utils/parse-text-from-file-types"; -import type { - AccountId, - DataTypeWithMetadata, - Entity, - EntityMetadata, - EntityTypeWithMetadata, - PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { ActivityCancellationType, proxyActivities, diff --git a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts index 96171a88cfd..48df08916d3 100644 --- a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts +++ b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow.ts @@ -1,4 +1,5 @@ import { sleep } from "@local/hash-backend-utils/utils"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import { actionDefinitions } from "@local/hash-isomorphic-utils/flows/action-definitions"; import type { RunFlowWorkflowParams, @@ -11,7 +12,6 @@ import type { StepOutput, } from "@local/hash-isomorphic-utils/flows/types"; import { validateFlowDefinition } from "@local/hash-isomorphic-utils/flows/util"; -import type { EntityUuid } from "@local/hash-subgraph"; import type { Status } from "@local/status"; import { StatusCode } from "@local/status"; import { diff --git a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts index 4c5f19ecf22..e14aaf6355d 100644 --- a/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts +++ b/apps/hash-ai-worker-ts/src/workflows/run-flow-workflow/initialize-flow.ts @@ -1,3 +1,4 @@ +import type { EntityUuid } from "@local/hash-graph-types/entity"; import { actionDefinitions } from "@local/hash-isomorphic-utils/flows/action-definitions"; import type { ActionStep, @@ -12,7 +13,6 @@ import type { Payload, StepInput, } from "@local/hash-isomorphic-utils/flows/types"; -import type { EntityUuid } from "@local/hash-subgraph"; import { getAllStepsInFlow } from "./get-all-steps-in-flow"; diff --git a/apps/hash-api/src/ai/gpt/gpt-query-entities.ts b/apps/hash-api/src/ai/gpt/gpt-query-entities.ts index 3ce43f21899..d79016f179a 100644 --- a/apps/hash-api/src/ai/gpt/gpt-query-entities.ts +++ b/apps/hash-api/src/ai/gpt/gpt-query-entities.ts @@ -3,6 +3,7 @@ import type { SimpleLinkWithoutHref, } from "@local/hash-backend-utils/simplified-graph"; import { getSimpleGraph } from "@local/hash-backend-utils/simplified-graph"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; import type { CreateEmbeddingsParams, CreateEmbeddingsReturn, @@ -17,7 +18,6 @@ import type { OrganizationProperties, UserProperties, } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { EntityId, EntityUuid } from "@local/hash-subgraph"; import { entityIdFromComponents, extractEntityUuidFromEntityId, diff --git a/apps/hash-api/src/ai/gpt/shared/webs.ts b/apps/hash-api/src/ai/gpt/shared/webs.ts index f286cbca6af..5be3cf7ff86 100644 --- a/apps/hash-api/src/ai/gpt/shared/webs.ts +++ b/apps/hash-api/src/ai/gpt/shared/webs.ts @@ -1,4 +1,4 @@ -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; import type { ImpureGraphContext } from "../../../graph/context-types"; import { getOrgMembershipOrg } from "../../../graph/knowledge/system-types/org-membership"; diff --git a/apps/hash-api/src/ai/infer-entities-websocket.ts b/apps/hash-api/src/ai/infer-entities-websocket.ts index e43d5d32a8c..364e32985d7 100644 --- a/apps/hash-api/src/ai/infer-entities-websocket.ts +++ b/apps/hash-api/src/ai/infer-entities-websocket.ts @@ -6,13 +6,13 @@ import { getFlowRuns, } from "@local/hash-backend-utils/flows"; import type { Logger } from "@local/hash-backend-utils/logger"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import type { ExternalInputWebsocketRequestMessage, InferenceWebsocketClientMessage, } from "@local/hash-isomorphic-utils/ai-inference-types"; import { externalInputResponseSignal } from "@local/hash-isomorphic-utils/flows/signals"; import type { ExternalInputResponseSignal } from "@local/hash-isomorphic-utils/flows/types"; -import type { EntityUuid } from "@local/hash-subgraph"; import type { Client } from "@temporalio/client"; import type { WebSocket } from "ws"; import { WebSocketServer } from "ws"; diff --git a/apps/hash-api/src/ai/infer-entities-websocket/handle-cancel-infer-entities-request.ts b/apps/hash-api/src/ai/infer-entities-websocket/handle-cancel-infer-entities-request.ts index 0c4ac72912b..efb91cffe36 100644 --- a/apps/hash-api/src/ai/infer-entities-websocket/handle-cancel-infer-entities-request.ts +++ b/apps/hash-api/src/ai/infer-entities-websocket/handle-cancel-infer-entities-request.ts @@ -1,6 +1,6 @@ import { getFlowRunEntityById } from "@local/hash-backend-utils/flows"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import type { CancelInferEntitiesWebsocketRequestMessage } from "@local/hash-isomorphic-utils/ai-inference-types"; -import type { EntityUuid } from "@local/hash-subgraph"; import type { Client } from "@temporalio/client"; import type { GraphApi } from "../../graph/context-types"; diff --git a/apps/hash-api/src/generate-ontology-type-ids.ts b/apps/hash-api/src/generate-ontology-type-ids.ts index 63e5b2a5349..3aaae8e61df 100644 --- a/apps/hash-api/src/generate-ontology-type-ids.ts +++ b/apps/hash-api/src/generate-ontology-type-ids.ts @@ -7,12 +7,12 @@ import { createGraphClient } from "@local/hash-backend-utils/create-graph-client import { getRequiredEnv } from "@local/hash-backend-utils/environment"; import { Logger } from "@local/hash-backend-utils/logger"; import { publicUserAccountId } from "@local/hash-backend-utils/public-user-account-id"; -import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import type { DataTypeWithMetadata, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import type { diff --git a/apps/hash-api/src/graph/account-permission-management.ts b/apps/hash-api/src/graph/account-permission-management.ts index d3078d26a1e..7a8b72b4ab2 100644 --- a/apps/hash-api/src/graph/account-permission-management.ts +++ b/apps/hash-api/src/graph/account-permission-management.ts @@ -6,8 +6,8 @@ import type { import type { AccountGroupId, AccountId, - OwnedById, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/account"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ImpureGraphFunction } from "./context-types"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/005-create-hash-system-entities-and-web-bots.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/005-create-hash-system-entities-and-web-bots.migration.ts index b2af6830a07..52fb0e18ecf 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/005-create-hash-system-entities-and-web-bots.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/005-create-hash-system-entities-and-web-bots.migration.ts @@ -4,7 +4,7 @@ import { createWebMachineActor, getWebMachineActorId, } from "@local/hash-backend-utils/machine-actors"; -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { logger } from "../../../../logger"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/007-create-api-usage-tracking.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/007-create-api-usage-tracking.migration.ts index dcc0d698a34..0a902146f20 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/007-create-api-usage-tracking.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/007-create-api-usage-tracking.migration.ts @@ -1,6 +1,7 @@ +import type { OwnedById } from "@local/hash-graph-types/web"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { ServiceFeatureProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { Entity, OwnedById } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import { logger } from "../../../../logger"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/008-create-plugin-settings-update-users.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/008-create-plugin-settings-update-users.migration.ts index ae5c1728415..96751732a6f 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/008-create-plugin-settings-update-users.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/008-create-plugin-settings-update-users.migration.ts @@ -1,6 +1,6 @@ import type { EntityType } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { BaseUrl } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import { getEntityTypeById } from "../../../ontology/primitive/entity-type"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/009-add-upload-completed-at-property-type.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/009-add-upload-completed-at-property-type.migration.ts index 6105954bd2d..5001f89d19f 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/009-add-upload-completed-at-property-type.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/009-add-upload-completed-at-property-type.migration.ts @@ -1,6 +1,6 @@ import type { EntityType } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { BaseUrl } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { getEntityTypeById } from "../../../ontology/primitive/entity-type"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/011-deprecate-preferred-name.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/011-deprecate-preferred-name.migration.ts index 2e805b65121..a02d6dd4367 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/011-deprecate-preferred-name.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/011-deprecate-preferred-name.migration.ts @@ -1,10 +1,10 @@ import type { EntityType } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { blockProtocolPropertyTypes, systemEntityTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { BaseUrl } from "@local/hash-subgraph"; import { getEntityTypeById } from "../../../ontology/primitive/entity-type"; import type { MigrationFunction } from "../types"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/013-add-enabled-feature-flags-property.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/013-add-enabled-feature-flags-property.migration.ts index 36032507a86..686f528d4bf 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/013-add-enabled-feature-flags-property.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/013-add-enabled-feature-flags-property.migration.ts @@ -1,6 +1,6 @@ import type { EntityType } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { BaseUrl } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { getEntityTypeById } from "../../../ontology/primitive/entity-type"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts index 46fb16fc4ec..32568e95ca3 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/015-add-flow-types.dev.migration.ts @@ -1,9 +1,9 @@ import type { EntityType } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { blockProtocolPropertyTypes, systemEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { BaseUrl } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import { getEntityTypeById } from "../../../ontology/primitive/entity-type"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts index 37c8e5f10c7..0eebd787d97 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/migrations/017-add-use-case-form-and-example-org.migration.ts @@ -1,9 +1,9 @@ +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; import { systemEntityTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { BaseUrl } from "@local/hash-subgraph"; import { createOrg, diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/types.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/types.ts index 548adc90136..38dae0ce85b 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/types.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/types.ts @@ -1,4 +1,4 @@ -import type { BaseUrl } from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import type { AuthenticationContext } from "../../../graphql/authentication-context"; import type { ImpureGraphContext } from "../../context-types"; diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts index ca07a2e0d9b..7855f48dbe7 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util.ts @@ -26,6 +26,15 @@ import type { DataTypeRelationAndSubject, UpdatePropertyType, } from "@local/hash-graph-client"; +import type { + BaseUrl, + ConstructDataTypeParams, + CustomDataType, + DataTypeWithMetadata, + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -47,18 +56,11 @@ import { generateTypeBaseUrl, } from "@local/hash-isomorphic-utils/ontology-types"; import type { - BaseUrl, - ConstructDataTypeParams, - CustomDataType, - DataTypeWithMetadata, Entity, EntityPropertiesObject, EntityTypeInstantiatorSubject, EntityTypeRelationAndSubject, - EntityTypeWithMetadata, - OwnedById, PropertyTypeRelationAndSubject, - PropertyTypeWithMetadata, } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util/upgrade-entities.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util/upgrade-entities.ts index 5f0fdec2d33..1ea154e70a3 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util/upgrade-entities.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/migrate-ontology-types/util/upgrade-entities.ts @@ -1,5 +1,8 @@ import { extractVersion, type VersionedUrl } from "@blockprotocol/type-system"; import { getWebMachineActorId } from "@local/hash-backend-utils/machine-actors"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, @@ -9,12 +12,7 @@ import { systemEntityTypes, systemLinkEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { - AccountId, - BaseUrl, - EntityPropertiesObject, - OwnedById, -} from "@local/hash-subgraph"; +import type { EntityPropertiesObject } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { extractBaseUrl, diff --git a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts index e226318b080..d82596c9e46 100644 --- a/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts +++ b/apps/hash-api/src/graph/ensure-system-graph-is-initialized/system-webs-and-entities.ts @@ -5,13 +5,13 @@ import { createMachineActorEntity, getMachineActorId, } from "@local/hash-backend-utils/machine-actors"; -import type { blockProtocolDataTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { SystemTypeWebShortname } from "@local/hash-isomorphic-utils/ontology-types"; import type { AccountGroupId, AccountId, - OwnedById, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/account"; +import type { OwnedById } from "@local/hash-graph-types/web"; +import type { blockProtocolDataTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; +import type { SystemTypeWebShortname } from "@local/hash-isomorphic-utils/ontology-types"; import { componentsFromVersionedUrl } from "@local/hash-subgraph/type-system-patch"; import { enabledIntegrations } from "../../integrations/enabled-integrations"; diff --git a/apps/hash-api/src/graph/knowledge/primitive/entity.ts b/apps/hash-api/src/graph/knowledge/primitive/entity.ts index b3fcca16c51..2c2747eb270 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/entity.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/entity.ts @@ -17,6 +17,14 @@ import type { PropertyMetadataMap, ProvidedEntityEditionProvenance, } from "@local/hash-graph-client"; +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, @@ -32,19 +40,12 @@ import type { UserPermissionsOnEntities, } from "@local/hash-isomorphic-utils/types"; import type { - AccountGroupId, - AccountId, - BaseUrl, Entity, EntityAuthorizationRelationship, - EntityId, EntityPropertiesObject, EntityRelationAndSubject, EntityRootType, - EntityUuid, - OwnedById, Subgraph, - Timestamp, } from "@local/hash-subgraph"; import { extractDraftIdFromEntityId, diff --git a/apps/hash-api/src/graph/knowledge/primitive/entity/after-create-entity-hooks.ts b/apps/hash-api/src/graph/knowledge/primitive/entity/after-create-entity-hooks.ts index ee39ad52544..a8c76a25869 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/entity/after-create-entity-hooks.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/entity/after-create-entity-hooks.ts @@ -1,3 +1,6 @@ +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, @@ -5,7 +8,6 @@ import { import { isPageEntityTypeId } from "@local/hash-isomorphic-utils/page-entity-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; -import type { EntityUuid, OwnedById, Uuid } from "@local/hash-subgraph"; import { entityIdFromComponents } from "@local/hash-subgraph"; import { isProdEnv } from "../../../../lib/env-config"; diff --git a/apps/hash-api/src/graph/knowledge/primitive/entity/after-update-entity-hooks/text-after-update-entity-hook-callback.ts b/apps/hash-api/src/graph/knowledge/primitive/entity/after-update-entity-hooks/text-after-update-entity-hook-callback.ts index 021f240131f..bd08a22431b 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/entity/after-update-entity-hooks/text-after-update-entity-hook-callback.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/entity/after-update-entity-hooks/text-after-update-entity-hook-callback.ts @@ -1,6 +1,7 @@ +import type { EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { blockProtocolPropertyTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { EntityUuid, OwnedById } from "@local/hash-subgraph"; import { entityIdFromComponents } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; diff --git a/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts b/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts index 42d3dc48d75..4a639f1474d 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts @@ -1,6 +1,7 @@ +import type { AccountId } from "@local/hash-graph-types/account"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; -import type { AccountId, OwnedById } from "@local/hash-subgraph"; import { ApolloError, UserInputError } from "apollo-server-express"; import { userHasAccessToHash } from "../../../../../shared/user-has-access-to-hash"; diff --git a/apps/hash-api/src/graph/knowledge/primitive/link-entity.ts b/apps/hash-api/src/graph/knowledge/primitive/link-entity.ts index fb23c69b2b5..deb6d65fa67 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/link-entity.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/link-entity.ts @@ -3,16 +3,17 @@ import type { PropertyMetadataMap, ProvidedEntityEditionProvenance, } from "@local/hash-graph-client"; -import { mapGraphApiEntityMetadataToMetadata } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { AccountGroupId, AccountId, +} from "@local/hash-graph-types/account"; +import type { EntityId, LinkData } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; +import { mapGraphApiEntityMetadataToMetadata } from "@local/hash-isomorphic-utils/subgraph-mapping"; +import type { Entity, - EntityId, EntityPropertiesObject, EntityRelationAndSubject, - LinkData, - OwnedById, } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; diff --git a/apps/hash-api/src/graph/knowledge/system-types/block-collection.ts b/apps/hash-api/src/graph/knowledge/system-types/block-collection.ts index f6fa757bb95..fccbc11a6ed 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/block-collection.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/block-collection.ts @@ -1,4 +1,5 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { sortBlockCollectionLinks } from "@local/hash-isomorphic-utils/block-collection"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { @@ -13,7 +14,6 @@ import type { HasDataProperties, HasIndexedContentProperties, } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { EntityId } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; diff --git a/apps/hash-api/src/graph/knowledge/system-types/block.ts b/apps/hash-api/src/graph/knowledge/system-types/block.ts index 005a6b9713b..4cd88eaed95 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/block.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/block.ts @@ -1,4 +1,5 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { createDefaultAuthorizationRelationships, currentTimeInstantTemporalAxes, @@ -11,7 +12,7 @@ import { import { contentLinkTypeFilter } from "@local/hash-isomorphic-utils/page-entity-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { BlockProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-api/src/graph/knowledge/system-types/comment.ts b/apps/hash-api/src/graph/knowledge/system-types/comment.ts index 25bab2bc647..387c136f572 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/comment.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/comment.ts @@ -1,4 +1,5 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { blockProtocolPropertyTypes, systemEntityTypes, @@ -8,11 +9,7 @@ import { import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { CommentProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { - Entity, - EntityId, - EntityRelationAndSubject, -} from "@local/hash-subgraph"; +import type { Entity, EntityRelationAndSubject } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import type { diff --git a/apps/hash-api/src/graph/knowledge/system-types/hash-instance.ts b/apps/hash-api/src/graph/knowledge/system-types/hash-instance.ts index 361aa5cda9f..cf54ab99ba2 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/hash-instance.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/hash-instance.ts @@ -4,9 +4,9 @@ import { getHashInstance, getHashInstanceFromEntity, } from "@local/hash-backend-utils/hash-instance"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { HASHInstanceProperties } from "@local/hash-isomorphic-utils/system-types/hashinstance"; -import type { OwnedById } from "@local/hash-subgraph"; import { createAccountGroup } from "../../account-permission-management"; import type { ImpureGraphFunction } from "../../context-types"; diff --git a/apps/hash-api/src/graph/knowledge/system-types/linear-integration-entity.ts b/apps/hash-api/src/graph/knowledge/system-types/linear-integration-entity.ts index 45899ab7574..e5f432c6e81 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/linear-integration-entity.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/linear-integration-entity.ts @@ -1,4 +1,6 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { createDefaultAuthorizationRelationships, currentTimeInstantTemporalAxes, @@ -19,12 +21,7 @@ import type { LinearIntegrationProperties, SyncLinearDataWithProperties, } from "@local/hash-isomorphic-utils/system-types/linearintegration"; -import type { - AccountId, - Entity, - EntityId, - EntityRootType, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-api/src/graph/knowledge/system-types/linear-user-secret.ts b/apps/hash-api/src/graph/knowledge/system-types/linear-user-secret.ts index 7ede34841d3..500ae24ab23 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/linear-user-secret.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/linear-user-secret.ts @@ -3,6 +3,9 @@ import { NotFoundError, } from "@local/hash-backend-utils/error"; import type { VaultClient } from "@local/hash-backend-utils/vault"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -16,12 +19,7 @@ import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-proper import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { LinearIntegrationProperties } from "@local/hash-isomorphic-utils/system-types/linearintegration"; import type { UserSecretProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - AccountId, - Entity, - EntityId, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId, splitEntityId, diff --git a/apps/hash-api/src/graph/knowledge/system-types/notification.ts b/apps/hash-api/src/graph/knowledge/system-types/notification.ts index 32e51752bf7..3ef915ee9dd 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/notification.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/notification.ts @@ -2,6 +2,7 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; import { getWebMachineActorId } from "@local/hash-backend-utils/machine-actors"; import { createNotificationEntityPermissions } from "@local/hash-backend-utils/notifications"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -17,7 +18,7 @@ import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-proper import type { CommentNotificationProperties } from "@local/hash-isomorphic-utils/system-types/commentnotification"; import type { MentionNotificationProperties } from "@local/hash-isomorphic-utils/system-types/mentionnotification"; import type { NotificationProperties } from "@local/hash-isomorphic-utils/system-types/notification"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { getOutgoingLinksForEntity, getRoots, diff --git a/apps/hash-api/src/graph/knowledge/system-types/org-membership.ts b/apps/hash-api/src/graph/knowledge/system-types/org-membership.ts index 36cb515326b..df9d99711ce 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/org-membership.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/org-membership.ts @@ -1,12 +1,12 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createOrgMembershipAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemLinkEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { IsMemberOfProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { AccountEntityId, AccountGroupEntityId, - EntityId, - OwnedById, } from "@local/hash-subgraph"; import { extractAccountGroupId, diff --git a/apps/hash-api/src/graph/knowledge/system-types/org.ts b/apps/hash-api/src/graph/knowledge/system-types/org.ts index 806f3fc3cd7..777d2d215cf 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/org.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/org.ts @@ -1,5 +1,9 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; import { createWebMachineActor } from "@local/hash-backend-utils/machine-actors"; +import type { AccountGroupId } from "@local/hash-graph-types/account"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes, @@ -8,15 +12,7 @@ import { import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { OrganizationProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - AccountGroupEntityId, - AccountGroupId, - BaseUrl, - Entity, - EntityId, - EntityUuid, - OwnedById, -} from "@local/hash-subgraph"; +import type { AccountGroupEntityId, Entity } from "@local/hash-subgraph"; import { extractAccountGroupId } from "@local/hash-subgraph"; import { extractBaseUrl, diff --git a/apps/hash-api/src/graph/knowledge/system-types/page.ts b/apps/hash-api/src/graph/knowledge/system-types/page.ts index 1cf6f8f44e8..56a6ba3c24f 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/page.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/page.ts @@ -1,4 +1,6 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { sortBlockCollectionLinks } from "@local/hash-isomorphic-utils/block-collection"; import { createDefaultAuthorizationRelationships, @@ -21,7 +23,7 @@ import type { HasIndexedContentProperties, PageProperties, } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { Entity, EntityId, OwnedById } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { ApolloError } from "apollo-server-errors"; diff --git a/apps/hash-api/src/graph/knowledge/system-types/text.ts b/apps/hash-api/src/graph/knowledge/system-types/text.ts index c8530b238c2..cac6d182eb8 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/text.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/text.ts @@ -1,4 +1,5 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -14,7 +15,7 @@ import { import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { TextProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import type { diff --git a/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts b/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts index 520dfaee3f9..4e4b921c31d 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts @@ -5,17 +5,15 @@ import type { } from "@local/hash-backend-utils/vault"; import { createUserSecretPath } from "@local/hash-backend-utils/vault"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { UserSecretProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - AccountId, - EntityId, - EntityRelationAndSubject, - OwnedById, -} from "@local/hash-subgraph"; +import type { EntityRelationAndSubject } from "@local/hash-subgraph"; import type { Auth } from "googleapis"; import { archiveEntity, createEntity } from "../primitive/entity"; diff --git a/apps/hash-api/src/graph/knowledge/system-types/user.ts b/apps/hash-api/src/graph/knowledge/system-types/user.ts index 25d6199df42..b68c4b1ba1a 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/user.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/user.ts @@ -1,6 +1,9 @@ import { EntityTypeMismatchError } from "@local/hash-backend-utils/error"; import { getHashInstanceAdminAccountGroupId } from "@local/hash-backend-utils/hash-instance"; import { createWebMachineActor } from "@local/hash-backend-utils/machine-actors"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { FeatureFlag } from "@local/hash-isomorphic-utils/feature-flags"; import { currentTimeInstantTemporalAxes, @@ -14,14 +17,7 @@ import { import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; -import type { - AccountEntityId, - AccountId, - Entity, - EntityId, - EntityUuid, - OwnedById, -} from "@local/hash-subgraph"; +import type { AccountEntityId, Entity } from "@local/hash-subgraph"; import { extractAccountId, extractEntityUuidFromEntityId, diff --git a/apps/hash-api/src/graph/ontology/primitive/data-type.ts b/apps/hash-api/src/graph/ontology/primitive/data-type.ts index 22cc7699efd..aac6958176b 100644 --- a/apps/hash-api/src/graph/ontology/primitive/data-type.ts +++ b/apps/hash-api/src/graph/ontology/primitive/data-type.ts @@ -11,6 +11,13 @@ import type { ProvidedOntologyEditionProvenance, UnarchiveDataTypeParams, } from "@local/hash-graph-client"; +import type { + ConstructDataTypeParams, + DataTypeMetadata, + DataTypeWithMetadata, + OntologyTypeRecordId, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { generateTypeId } from "@local/hash-isomorphic-utils/ontology-types"; import { @@ -18,14 +25,9 @@ import { mapGraphApiSubgraphToSubgraph, } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { - ConstructDataTypeParams, DataTypeAuthorizationRelationship, - DataTypeMetadata, DataTypeRelationAndSubject, DataTypeRootType, - DataTypeWithMetadata, - OntologyTypeRecordId, - OwnedById, Subgraph, } from "@local/hash-subgraph"; import { ontologyTypeRecordIdToVersionedUrl } from "@local/hash-subgraph"; diff --git a/apps/hash-api/src/graph/ontology/primitive/entity-type.ts b/apps/hash-api/src/graph/ontology/primitive/entity-type.ts index 33a78e67a97..cd715e60490 100644 --- a/apps/hash-api/src/graph/ontology/primitive/entity-type.ts +++ b/apps/hash-api/src/graph/ontology/primitive/entity-type.ts @@ -15,6 +15,13 @@ import type { UnarchiveEntityTypeParams, UpdateEntityTypeRequest, } from "@local/hash-graph-client"; +import type { + BaseUrl, + EntityTypeMetadata, + EntityTypeWithMetadata, + OntologyTypeRecordId, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { generateTypeId } from "@local/hash-isomorphic-utils/ontology-types"; import { @@ -26,14 +33,9 @@ import type { UserPermissionsOnEntityType, } from "@local/hash-isomorphic-utils/types"; import type { - BaseUrl, EntityTypeAuthorizationRelationship, - EntityTypeMetadata, EntityTypeRelationAndSubject, EntityTypeRootType, - EntityTypeWithMetadata, - OntologyTypeRecordId, - OwnedById, Subgraph, } from "@local/hash-subgraph"; import { diff --git a/apps/hash-api/src/graph/ontology/primitive/property-type.ts b/apps/hash-api/src/graph/ontology/primitive/property-type.ts index 04b4f274522..eddb281b8cf 100644 --- a/apps/hash-api/src/graph/ontology/primitive/property-type.ts +++ b/apps/hash-api/src/graph/ontology/primitive/property-type.ts @@ -12,6 +12,12 @@ import type { UnarchivePropertyTypeParams, UpdatePropertyTypeRequest, } from "@local/hash-graph-client"; +import type { + OntologyTypeRecordId, + PropertyTypeMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { generateTypeId } from "@local/hash-isomorphic-utils/ontology-types"; import { @@ -20,13 +26,9 @@ import { } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { ConstructPropertyTypeParams } from "@local/hash-isomorphic-utils/types"; import type { - OntologyTypeRecordId, - OwnedById, PropertyTypeAuthorizationRelationship, - PropertyTypeMetadata, PropertyTypeRelationAndSubject, PropertyTypeRootType, - PropertyTypeWithMetadata, Subgraph, } from "@local/hash-subgraph"; import { ontologyTypeRecordIdToVersionedUrl } from "@local/hash-subgraph"; diff --git a/apps/hash-api/src/graph/ontology/primitive/util.ts b/apps/hash-api/src/graph/ontology/primitive/util.ts index d7fd537c663..99e377dda7e 100644 --- a/apps/hash-api/src/graph/ontology/primitive/util.ts +++ b/apps/hash-api/src/graph/ontology/primitive/util.ts @@ -3,14 +3,12 @@ import type { ModifyRelationshipOperation, WebPermission, } from "@local/hash-graph-client"; +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { frontendUrl } from "@local/hash-isomorphic-utils/environment"; import { isSelfHostedInstance } from "@local/hash-isomorphic-utils/instance"; -import type { - EntityUuid, - OwnedById, - Uuid, - WebAuthorizationRelationship, -} from "@local/hash-subgraph"; +import type { WebAuthorizationRelationship } from "@local/hash-subgraph"; import { entityIdFromComponents } from "@local/hash-subgraph"; import type { ImpureGraphFunction } from "../../context-types"; diff --git a/apps/hash-api/src/graph/system-account.ts b/apps/hash-api/src/graph/system-account.ts index 8b58f781af8..3b347acc323 100644 --- a/apps/hash-api/src/graph/system-account.ts +++ b/apps/hash-api/src/graph/system-account.ts @@ -1,7 +1,8 @@ import type { Logger } from "@local/hash-backend-utils/logger"; import { publicUserAccountId } from "@local/hash-backend-utils/public-user-account-id"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { AccountId, BaseUrl } from "@local/hash-subgraph"; import { versionedUrlFromComponents } from "@local/hash-subgraph/type-system-patch"; import { createAccount } from "./account-permission-management"; diff --git a/apps/hash-api/src/graphql/authentication-context.ts b/apps/hash-api/src/graphql/authentication-context.ts index 444542e9c48..088e15b96df 100644 --- a/apps/hash-api/src/graphql/authentication-context.ts +++ b/apps/hash-api/src/graphql/authentication-context.ts @@ -1,4 +1,4 @@ -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; export type AuthenticationContext = { actorId: AccountId; diff --git a/apps/hash-api/src/graphql/resolvers/flows/get-flow-run-by-id.ts b/apps/hash-api/src/graphql/resolvers/flows/get-flow-run-by-id.ts index 5849523f765..f10b89e88f6 100644 --- a/apps/hash-api/src/graphql/resolvers/flows/get-flow-run-by-id.ts +++ b/apps/hash-api/src/graphql/resolvers/flows/get-flow-run-by-id.ts @@ -1,6 +1,6 @@ import { getFlowRunById } from "@local/hash-backend-utils/flows"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import type { SparseFlowRun } from "@local/hash-isomorphic-utils/flows/types"; -import type { EntityUuid } from "@local/hash-subgraph"; import { ApolloError } from "apollo-server-errors"; import type { diff --git a/apps/hash-api/src/graphql/resolvers/flows/submit-external-input-response.ts b/apps/hash-api/src/graphql/resolvers/flows/submit-external-input-response.ts index a6a0ad3f1c0..578ecb0fbe2 100644 --- a/apps/hash-api/src/graphql/resolvers/flows/submit-external-input-response.ts +++ b/apps/hash-api/src/graphql/resolvers/flows/submit-external-input-response.ts @@ -1,6 +1,6 @@ import { getFlowRunEntityById } from "@local/hash-backend-utils/flows"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import { externalInputResponseSignal } from "@local/hash-isomorphic-utils/flows/signals"; -import type { EntityUuid } from "@local/hash-subgraph"; import { ApolloError } from "apollo-server-errors"; import type { diff --git a/apps/hash-api/src/graphql/resolvers/integrations/linear/sync-workspaces-with-teams.ts b/apps/hash-api/src/graphql/resolvers/integrations/linear/sync-workspaces-with-teams.ts index 848fa8a95b1..423b083d230 100644 --- a/apps/hash-api/src/graphql/resolvers/integrations/linear/sync-workspaces-with-teams.ts +++ b/apps/hash-api/src/graphql/resolvers/integrations/linear/sync-workspaces-with-teams.ts @@ -2,8 +2,11 @@ import { getMachineActorId, getWebMachineActorId, } from "@local/hash-backend-utils/machine-actors"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { AccountId, Entity, OwnedById, Uuid } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/block-collection/update-block-collection-actions.ts b/apps/hash-api/src/graphql/resolvers/knowledge/block-collection/update-block-collection-actions.ts index 6721af5208a..54d0220c9b9 100644 --- a/apps/hash-api/src/graphql/resolvers/knowledge/block-collection/update-block-collection-actions.ts +++ b/apps/hash-api/src/graphql/resolvers/knowledge/block-collection/update-block-collection-actions.ts @@ -1,6 +1,8 @@ import { typedEntries } from "@local/advanced-types/typed-entries"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; -import type { Entity, EntityId, OwnedById } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { ApolloError, UserInputError } from "apollo-server-errors"; import produce from "immer"; diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts b/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts index 9d8fec9da3d..a23019f7b7d 100644 --- a/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts +++ b/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts @@ -4,19 +4,19 @@ import type { Filter, QueryTemporalAxesUnresolved, } from "@local/hash-graph-client"; +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships, currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import type { MutationArchiveEntitiesArgs } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; -import type { - AccountGroupId, - AccountId, - Entity, - EntityId, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { splitEntityId } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; import { diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts index d908d6d7083..a2546cbcd4a 100644 --- a/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts +++ b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts @@ -1,6 +1,6 @@ import { getHashInstanceAdminAccountGroupId } from "@local/hash-backend-utils/hash-instance"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { OwnedById } from "@local/hash-subgraph"; import { createEntity } from "../../../../graph/knowledge/primitive/entity"; import { systemAccountId } from "../../../../graph/system-account"; diff --git a/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts b/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts index fcc26e13689..25b8a62c634 100644 --- a/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts +++ b/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts @@ -1,4 +1,9 @@ import type { OntologyTemporalMetadata } from "@local/hash-graph-client"; +import type { + BaseUrl, + EntityTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, defaultEntityTypeAuthorizationRelationships, @@ -6,12 +11,7 @@ import { zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import type { UserPermissionsOnEntityType } from "@local/hash-isomorphic-utils/types"; -import type { - BaseUrl, - EntityTypeWithMetadata, - OwnedById, - Subgraph, -} from "@local/hash-subgraph"; +import type { Subgraph } from "@local/hash-subgraph"; import { archiveEntityType, diff --git a/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts b/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts index 778cc637d63..f3cafb6dd71 100644 --- a/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts +++ b/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts @@ -1,4 +1,6 @@ import type { OntologyTemporalMetadata } from "@local/hash-graph-client"; +import type { PropertyTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, defaultPropertyTypeAuthorizationRelationships, @@ -6,12 +8,7 @@ import { zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { - OwnedById, - PropertyTypeRootType, - PropertyTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +import type { PropertyTypeRootType, Subgraph } from "@local/hash-subgraph"; import { archivePropertyType, diff --git a/apps/hash-api/src/integrations/google/oauth-callback.ts b/apps/hash-api/src/integrations/google/oauth-callback.ts index 4b16caf8169..a7200dd47a9 100644 --- a/apps/hash-api/src/integrations/google/oauth-callback.ts +++ b/apps/hash-api/src/integrations/google/oauth-callback.ts @@ -3,13 +3,13 @@ import { getGoogleAccountById, } from "@local/hash-backend-utils/google"; import { getMachineActorId } from "@local/hash-backend-utils/machine-actors"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { GoogleOAuth2CallbackRequest, GoogleOAuth2CallbackResponse, } from "@local/hash-isomorphic-utils/google-integration"; import { googleEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { AccountProperties as GoogleAccountProperties } from "@local/hash-isomorphic-utils/system-types/google/account"; -import type { OwnedById } from "@local/hash-subgraph"; import type { RequestHandler } from "express"; import { google } from "googleapis"; diff --git a/apps/hash-api/src/integrations/linear.ts b/apps/hash-api/src/integrations/linear.ts index 2d7c0cfc9fe..d181d3c47d4 100644 --- a/apps/hash-api/src/integrations/linear.ts +++ b/apps/hash-api/src/integrations/linear.ts @@ -2,8 +2,8 @@ import type { Organization, Team } from "@linear/sdk"; import { LinearClient } from "@linear/sdk"; import type { TemporalClient } from "@local/hash-backend-utils/temporal"; import type { SyncWorkspaceWorkflow } from "@local/hash-backend-utils/temporal-integration-workflow-types"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; -import type { OwnedById } from "@local/hash-subgraph"; import type { AuthenticationContext } from "../graphql/authentication-context"; diff --git a/apps/hash-api/src/integrations/linear/oauth.ts b/apps/hash-api/src/integrations/linear/oauth.ts index e7ab97d845a..43053d80886 100644 --- a/apps/hash-api/src/integrations/linear/oauth.ts +++ b/apps/hash-api/src/integrations/linear/oauth.ts @@ -2,6 +2,10 @@ import crypto from "node:crypto"; import { LinearClient } from "@linear/sdk"; import { getMachineActorId } from "@local/hash-backend-utils/machine-actors"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { apiOrigin, frontendUrl, @@ -9,14 +13,7 @@ import { import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { LinearIntegrationProperties } from "@local/hash-isomorphic-utils/system-types/linearintegration"; -import type { - AccountId, - Entity, - EntityId, - EntityUuid, - OwnedById, - Uuid, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import type { RequestHandler } from "express"; diff --git a/apps/hash-api/src/integrations/linear/sync-back.ts b/apps/hash-api/src/integrations/linear/sync-back.ts index fb6a8d0d903..72fb2549f30 100644 --- a/apps/hash-api/src/integrations/linear/sync-back.ts +++ b/apps/hash-api/src/integrations/linear/sync-back.ts @@ -5,9 +5,11 @@ import { createTemporalClient } from "@local/hash-backend-utils/temporal"; import type { UpdateLinearDataWorkflow } from "@local/hash-backend-utils/temporal-integration-workflow-types"; import { createVaultClient } from "@local/hash-backend-utils/vault"; import type { GraphApi } from "@local/hash-graph-client"; +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; import { linearPropertyTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { Entity, EntityUuid, Uuid } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { entityIdFromComponents, extractOwnedByIdFromEntityId, diff --git a/apps/hash-api/src/integrations/linear/webhook.ts b/apps/hash-api/src/integrations/linear/webhook.ts index 2720e6e9355..07d7a71c960 100644 --- a/apps/hash-api/src/integrations/linear/webhook.ts +++ b/apps/hash-api/src/integrations/linear/webhook.ts @@ -5,8 +5,9 @@ import { getMachineActorId } from "@local/hash-backend-utils/machine-actors"; import { createTemporalClient } from "@local/hash-backend-utils/temporal"; import type { WorkflowTypeMap } from "@local/hash-backend-utils/temporal-integration-workflow-types"; import { supportedLinearTypes } from "@local/hash-backend-utils/temporal-integration-workflow-types"; +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; -import type { OwnedById, Uuid } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import type { RequestHandler } from "express"; diff --git a/apps/hash-api/src/seed-data/index.ts b/apps/hash-api/src/seed-data/index.ts index dcff05b05b6..4ffe44839a1 100644 --- a/apps/hash-api/src/seed-data/index.ts +++ b/apps/hash-api/src/seed-data/index.ts @@ -1,6 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { Logger } from "@local/hash-backend-utils/logger"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ImpureGraphContext } from "../graph/context-types"; import type { Org } from "../graph/knowledge/system-types/org"; diff --git a/apps/hash-api/src/seed-data/seed-flow-test-types.ts b/apps/hash-api/src/seed-data/seed-flow-test-types.ts index 360e4c4de7e..9d9d036552b 100644 --- a/apps/hash-api/src/seed-data/seed-flow-test-types.ts +++ b/apps/hash-api/src/seed-data/seed-flow-test-types.ts @@ -3,6 +3,11 @@ import { getRequiredEnv } from "@local/hash-backend-utils/environment"; import { NotFoundError } from "@local/hash-backend-utils/error"; import { getMachineActorId } from "@local/hash-backend-utils/machine-actors"; import { publicUserAccountId } from "@local/hash-backend-utils/public-user-account-id"; +import type { + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { defaultEntityTypeAuthorizationRelationships, defaultPropertyTypeAuthorizationRelationships, @@ -12,12 +17,7 @@ import { systemDataTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { - EntityTypeRelationAndSubject, - EntityTypeWithMetadata, - OwnedById, - PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +import type { EntityTypeRelationAndSubject } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import { versionedUrlFromComponents } from "@local/hash-subgraph/type-system-patch"; diff --git a/apps/hash-api/src/seed-data/seed-pages.ts b/apps/hash-api/src/seed-data/seed-pages.ts index 71f8e1cf510..4804bc90f0e 100644 --- a/apps/hash-api/src/seed-data/seed-pages.ts +++ b/apps/hash-api/src/seed-data/seed-pages.ts @@ -1,5 +1,5 @@ import type { Logger } from "@local/hash-backend-utils/logger"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ImpureGraphContext } from "../graph/context-types"; import type { Page } from "../graph/knowledge/system-types/page"; diff --git a/apps/hash-api/src/storage/index.ts b/apps/hash-api/src/storage/index.ts index d4dec9f0612..9d236d62a6f 100644 --- a/apps/hash-api/src/storage/index.ts +++ b/apps/hash-api/src/storage/index.ts @@ -10,6 +10,7 @@ import { storageProviderLookup, } from "@local/hash-backend-utils/file-storage"; import { AwsS3StorageProvider } from "@local/hash-backend-utils/file-storage/aws-s3-storage-provider"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { apiOrigin } from "@local/hash-isomorphic-utils/environment"; import { fullDecisionTimeAxis } from "@local/hash-isomorphic-utils/graph-queries"; import { @@ -18,7 +19,7 @@ import { } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { FileProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { isEntityId, splitEntityId } from "@local/hash-subgraph"; import type { Express } from "express"; diff --git a/apps/hash-frontend/package.json b/apps/hash-frontend/package.json index 4115ffd1fe3..4890c71c260 100644 --- a/apps/hash-frontend/package.json +++ b/apps/hash-frontend/package.json @@ -38,6 +38,7 @@ "@lit-labs/react": "1.0.6", "@local/advanced-types": "0.0.0-private", "@local/hash-graph-client": "0.0.0-private", + "@local/hash-graph-types": "0.0.0-private", "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", "@local/status": "0.0.0-private", diff --git a/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts b/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts index 84419cd2c71..c5d4a9a342b 100644 --- a/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts +++ b/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts @@ -1,21 +1,25 @@ import { useLazyQuery } from "@apollo/client"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; -import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; -import { getEntityQuery } from "@local/hash-isomorphic-utils/graphql/queries/entity.queries"; import type { - CreatedAtDecisionTime, - CreatedAtTransactionTime, CreatedById, EditionCreatedById, +} from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { + CreatedAtDecisionTime, + CreatedAtTransactionTime, + Timestamp, +} from "@local/hash-graph-types/temporal-versioning"; +import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; +import { getEntityQuery } from "@local/hash-isomorphic-utils/graphql/queries/entity.queries"; +import type { Entity, - EntityId, EntityPropertiesObject, EntityRevisionId, EntityRootType, GraphResolveDepths, KnowledgeGraphVertices, Subgraph, - Timestamp, } from "@local/hash-subgraph"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/components/block-loader/block-loader.tsx b/apps/hash-frontend/src/components/block-loader/block-loader.tsx index e6cc6ce08ed..8a050f997be 100644 --- a/apps/hash-frontend/src/components/block-loader/block-loader.tsx +++ b/apps/hash-frontend/src/components/block-loader/block-loader.tsx @@ -5,6 +5,7 @@ import type { } from "@blockprotocol/graph/temporal"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import { typedEntries } from "@local/advanced-types/typed-entries"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { HashBlockMeta } from "@local/hash-isomorphic-utils/blocks"; import type { EntityStore } from "@local/hash-isomorphic-utils/entity-store"; import { @@ -15,7 +16,6 @@ import type { TextualContentPropertyValue } from "@local/hash-isomorphic-utils/s import type { UserPermissionsOnEntities } from "@local/hash-isomorphic-utils/types"; import type { Entity, - EntityId, EntityPropertiesObject, EntityRevisionId, EntityRootType, diff --git a/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/knowledge-shim.ts b/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/knowledge-shim.ts index 7437fa16031..a2f4d1d6418 100644 --- a/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/knowledge-shim.ts +++ b/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/knowledge-shim.ts @@ -14,13 +14,12 @@ import type { UploadFileData as BpUploadFileData, } from "@blockprotocol/graph"; import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { EntityId, LinkData } from "@local/hash-graph-types/entity"; import type { File as FileEntityType } from "@local/hash-isomorphic-utils/system-types/shared"; import type { Entity, - EntityId, EntityPropertiesObject, EntityRootType, - LinkData, Subgraph, } from "@local/hash-subgraph"; diff --git a/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-create-entity.ts b/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-create-entity.ts index c341c9e4f63..41b2c0c5756 100644 --- a/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-create-entity.ts +++ b/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-create-entity.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-file-upload.ts b/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-file-upload.ts index 55852293f24..bead9dd44d1 100644 --- a/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-file-upload.ts +++ b/apps/hash-frontend/src/components/hooks/block-protocol-functions/knowledge/use-block-protocol-file-upload.ts @@ -1,6 +1,6 @@ import { useMutation } from "@apollo/client"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { File as FileEntityType } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { OwnedById } from "@local/hash-subgraph"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/ontology-types-shim.ts b/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/ontology-types-shim.ts index 6a08f604c57..deaa2ae9fc7 100644 --- a/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/ontology-types-shim.ts +++ b/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/ontology-types-shim.ts @@ -16,13 +16,15 @@ import type { PropertyType, VersionedUrl, } from "@blockprotocol/type-system"; +import type { + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import type { EmptyObject } from "@local/hash-isomorphic-utils/util"; import type { DataTypeRootType, EntityTypeRootType, - EntityTypeWithMetadata, PropertyTypeRootType, - PropertyTypeWithMetadata, Subgraph, } from "@local/hash-subgraph"; diff --git a/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-entity-type.ts b/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-entity-type.ts index e050c3c48f7..d6b2ddb35fc 100644 --- a/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-entity-type.ts +++ b/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-entity-type.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-property-type.ts b/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-property-type.ts index 6c8799432d8..bdcf5c8be7f 100644 --- a/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-property-type.ts +++ b/apps/hash-frontend/src/components/hooks/block-protocol-functions/ontology/use-block-protocol-create-property-type.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/shared/get-page-refetch-queries.ts b/apps/hash-frontend/src/components/hooks/shared/get-page-refetch-queries.ts index 1847794ef53..46e894eb572 100644 --- a/apps/hash-frontend/src/components/hooks/shared/get-page-refetch-queries.ts +++ b/apps/hash-frontend/src/components/hooks/shared/get-page-refetch-queries.ts @@ -1,4 +1,4 @@ -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-frontend/src/components/hooks/use-account-pages.ts b/apps/hash-frontend/src/components/hooks/use-account-pages.ts index 194a8c58633..4c690461366 100644 --- a/apps/hash-frontend/src/components/hooks/use-account-pages.ts +++ b/apps/hash-frontend/src/components/hooks/use-account-pages.ts @@ -1,5 +1,7 @@ import type { ApolloQueryResult } from "@apollo/client"; import { useQuery } from "@apollo/client"; +import type { EntityMetadata } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes, @@ -8,11 +10,7 @@ import { import type { SimpleProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - EntityMetadata, - EntityRootType, - OwnedById, -} from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { getOutgoingLinkAndTargetEntities, getRoots, diff --git a/apps/hash-frontend/src/components/hooks/use-archive-page.ts b/apps/hash-frontend/src/components/hooks/use-archive-page.ts index a5e7fa9a2d9..7ef5bbcbb9c 100644 --- a/apps/hash-frontend/src/components/hooks/use-archive-page.ts +++ b/apps/hash-frontend/src/components/hooks/use-archive-page.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-frontend/src/components/hooks/use-create-comment.ts b/apps/hash-frontend/src/components/hooks/use-create-comment.ts index a09b343613d..d504ff27971 100644 --- a/apps/hash-frontend/src/components/hooks/use-create-comment.ts +++ b/apps/hash-frontend/src/components/hooks/use-create-comment.ts @@ -1,6 +1,6 @@ import { useMutation } from "@apollo/client"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { EntityId } from "@local/hash-subgraph"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/use-create-page.ts b/apps/hash-frontend/src/components/hooks/use-create-page.ts index 844e88130bb..625a62e9452 100644 --- a/apps/hash-frontend/src/components/hooks/use-create-page.ts +++ b/apps/hash-frontend/src/components/hooks/use-create-page.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-frontend/src/components/hooks/use-create-sub-page.ts b/apps/hash-frontend/src/components/hooks/use-create-sub-page.ts index d523036c718..8b14771e449 100644 --- a/apps/hash-frontend/src/components/hooks/use-create-sub-page.ts +++ b/apps/hash-frontend/src/components/hooks/use-create-sub-page.ts @@ -1,5 +1,6 @@ import { useMutation } from "@apollo/client"; -import type { EntityId, OwnedById } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { useRouter } from "next/router"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/components/hooks/use-delete-comment.ts b/apps/hash-frontend/src/components/hooks/use-delete-comment.ts index 0d8472c2548..1fbc027a77f 100644 --- a/apps/hash-frontend/src/components/hooks/use-delete-comment.ts +++ b/apps/hash-frontend/src/components/hooks/use-delete-comment.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/use-entity-by-id.ts b/apps/hash-frontend/src/components/hooks/use-entity-by-id.ts index 1de69f9dba7..070658df649 100644 --- a/apps/hash-frontend/src/components/hooks/use-entity-by-id.ts +++ b/apps/hash-frontend/src/components/hooks/use-entity-by-id.ts @@ -1,4 +1,5 @@ import { useQuery } from "@apollo/client"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { mapGqlSubgraphFieldsFragmentToSubgraph, zeroedGraphResolveDepths, @@ -6,7 +7,6 @@ import { import { getEntityQuery } from "@local/hash-isomorphic-utils/graphql/queries/entity.queries"; import type { UserPermissionsOnEntities } from "@local/hash-isomorphic-utils/types"; import type { - EntityId, EntityRootType, GraphResolveDepths, Subgraph, diff --git a/apps/hash-frontend/src/components/hooks/use-get-account-id-for-shortname.ts b/apps/hash-frontend/src/components/hooks/use-get-account-id-for-shortname.ts index 982e939ac2e..f37a1fd3537 100644 --- a/apps/hash-frontend/src/components/hooks/use-get-account-id-for-shortname.ts +++ b/apps/hash-frontend/src/components/hooks/use-get-account-id-for-shortname.ts @@ -1,4 +1,5 @@ -import type { AccountEntityId, AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { AccountEntityId } from "@local/hash-subgraph"; import { extractAccountId } from "@local/hash-subgraph"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/components/hooks/use-get-owner-for-entity.ts b/apps/hash-frontend/src/components/hooks/use-get-owner-for-entity.ts index e15f7fd5d9a..b9f2d3ca72f 100644 --- a/apps/hash-frontend/src/components/hooks/use-get-owner-for-entity.ts +++ b/apps/hash-frontend/src/components/hooks/use-get-owner-for-entity.ts @@ -1,4 +1,5 @@ -import type { Entity, OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; +import type { Entity } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/components/hooks/use-orgs-with-links.ts b/apps/hash-frontend/src/components/hooks/use-orgs-with-links.ts index 2e6d3a811d3..9afd655c1e9 100644 --- a/apps/hash-frontend/src/components/hooks/use-orgs-with-links.ts +++ b/apps/hash-frontend/src/components/hooks/use-orgs-with-links.ts @@ -1,12 +1,13 @@ import type { ApolloQueryResult } from "@apollo/client"; import { useQuery } from "@apollo/client"; +import type { AccountGroupId } from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, mapGqlSubgraphFieldsFragmentToSubgraph, } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { AccountGroupId, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/components/hooks/use-page-comments.ts b/apps/hash-frontend/src/components/hooks/use-page-comments.ts index 79cbb44ba22..8d41427e809 100644 --- a/apps/hash-frontend/src/components/hooks/use-page-comments.ts +++ b/apps/hash-frontend/src/components/hooks/use-page-comments.ts @@ -1,11 +1,11 @@ import { useQuery } from "@apollo/client"; -import type { TextToken } from "@local/hash-isomorphic-utils/types"; import type { - Entity, EntityId, EntityMetadata, EntityTemporalVersioningMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/entity"; +import type { TextToken } from "@local/hash-isomorphic-utils/types"; +import type { Entity } from "@local/hash-subgraph"; import type { GetPageCommentsQuery, diff --git a/apps/hash-frontend/src/components/hooks/use-reorder-page.ts b/apps/hash-frontend/src/components/hooks/use-reorder-page.ts index 4093d100757..1902affa52f 100644 --- a/apps/hash-frontend/src/components/hooks/use-reorder-page.ts +++ b/apps/hash-frontend/src/components/hooks/use-reorder-page.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/components/hooks/use-resolve-comment.ts b/apps/hash-frontend/src/components/hooks/use-resolve-comment.ts index 03d85f8b40c..543f95353f1 100644 --- a/apps/hash-frontend/src/components/hooks/use-resolve-comment.ts +++ b/apps/hash-frontend/src/components/hooks/use-resolve-comment.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/use-update-comment-text.ts b/apps/hash-frontend/src/components/hooks/use-update-comment-text.ts index 2f4ac939272..63c0fae718c 100644 --- a/apps/hash-frontend/src/components/hooks/use-update-comment-text.ts +++ b/apps/hash-frontend/src/components/hooks/use-update-comment-text.ts @@ -1,6 +1,6 @@ import { useMutation } from "@apollo/client"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { EntityId } from "@local/hash-subgraph"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/use-update-page-title.ts b/apps/hash-frontend/src/components/hooks/use-update-page-title.ts index f84a9e60654..bb70caebdb1 100644 --- a/apps/hash-frontend/src/components/hooks/use-update-page-title.ts +++ b/apps/hash-frontend/src/components/hooks/use-update-page-title.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { useCallback } from "react"; import type { diff --git a/apps/hash-frontend/src/components/hooks/use-user-or-org-shortname-by-owned-by-id.ts b/apps/hash-frontend/src/components/hooks/use-user-or-org-shortname-by-owned-by-id.ts index d729f1557e0..c841b3cb347 100644 --- a/apps/hash-frontend/src/components/hooks/use-user-or-org-shortname-by-owned-by-id.ts +++ b/apps/hash-frontend/src/components/hooks/use-user-or-org-shortname-by-owned-by-id.ts @@ -1,5 +1,5 @@ +import type { OwnedById } from "@local/hash-graph-types/web"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; -import type { OwnedById } from "@local/hash-subgraph"; import { useMemo } from "react"; import { useUserOrOrg } from "../../shared/use-user-or-org"; diff --git a/apps/hash-frontend/src/components/hooks/use-users-with-links.ts b/apps/hash-frontend/src/components/hooks/use-users-with-links.ts index 04caf17e74e..65b67f41895 100644 --- a/apps/hash-frontend/src/components/hooks/use-users-with-links.ts +++ b/apps/hash-frontend/src/components/hooks/use-users-with-links.ts @@ -1,12 +1,13 @@ import type { ApolloQueryResult } from "@apollo/client"; import { useQuery } from "@apollo/client"; +import type { AccountId } from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, mapGqlSubgraphFieldsFragmentToSubgraph, } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { AccountId, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/lib/routes.ts b/apps/hash-frontend/src/lib/routes.ts index 89b4c3627da..5c048ab1702 100644 --- a/apps/hash-frontend/src/lib/routes.ts +++ b/apps/hash-frontend/src/lib/routes.ts @@ -1,4 +1,4 @@ -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { getBlockDomId } from "../shared/get-block-dom-id"; diff --git a/apps/hash-frontend/src/lib/user-and-org.ts b/apps/hash-frontend/src/lib/user-and-org.ts index ef8ca81a494..045ca2033c9 100644 --- a/apps/hash-frontend/src/lib/user-and-org.ts +++ b/apps/hash-frontend/src/lib/user-and-org.ts @@ -1,3 +1,10 @@ +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { getFirstEntityRevision } from "@local/hash-isomorphic-utils/entity"; import type { FeatureFlag } from "@local/hash-isomorphic-utils/feature-flags"; import { @@ -16,14 +23,9 @@ import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/u import type { AccountEntityId, AccountGroupEntityId, - AccountGroupId, - AccountId, - BaseUrl, Entity, EntityRootType, - OwnedById, Subgraph, - Timestamp, } from "@local/hash-subgraph"; import { extractAccountGroupId, extractAccountId } from "@local/hash-subgraph"; import { diff --git a/apps/hash-frontend/src/pages/[shortname].page.tsx b/apps/hash-frontend/src/pages/[shortname].page.tsx index 98e3683cc7f..a856b4f366b 100644 --- a/apps/hash-frontend/src/pages/[shortname].page.tsx +++ b/apps/hash-frontend/src/pages/[shortname].page.tsx @@ -1,4 +1,5 @@ import { useQuery } from "@apollo/client"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -7,7 +8,7 @@ import { } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { pluralize } from "@local/hash-isomorphic-utils/pluralize"; -import type { BaseUrl, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { getEntityTypeAndDescendantsById, getRoots, diff --git a/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx b/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx index f5a4b54e1aa..46affedd830 100644 --- a/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx +++ b/apps/hash-frontend/src/pages/[shortname].page/edit-pinned-entity-types-modal.tsx @@ -1,10 +1,11 @@ import { useMutation } from "@apollo/client"; import { AsteriskRegularIcon, IconButton } from "@hashintel/design-system"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { EntityTypeWithMetadata, OwnedById } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import type { ModalProps } from "@mui/material"; import { Box, Typography, typographyClasses } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx b/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx index 317739bd75f..2b2e1da82dc 100644 --- a/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx +++ b/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx @@ -1,10 +1,12 @@ import { Select, TextField } from "@hashintel/design-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { BaseUrl, Entity, OwnedById } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { Box } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx b/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx index 99a4158c0af..eb9142a6ab5 100644 --- a/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx +++ b/apps/hash-frontend/src/pages/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx @@ -5,11 +5,11 @@ import { IconButton, RotateIconRegular, } from "@hashintel/design-system"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { OwnedById } from "@local/hash-subgraph"; import { Box, buttonClasses, styled } from "@mui/material"; import Image from "next/image"; import type { ChangeEventHandler, FunctionComponent } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname].page/pinned-entity-type-tab-contents.tsx b/apps/hash-frontend/src/pages/[shortname].page/pinned-entity-type-tab-contents.tsx index 6a1c8e3e7a5..c28ab917698 100644 --- a/apps/hash-frontend/src/pages/[shortname].page/pinned-entity-type-tab-contents.tsx +++ b/apps/hash-frontend/src/pages/[shortname].page/pinned-entity-type-tab-contents.tsx @@ -1,13 +1,9 @@ +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { isPageEntityTypeId } from "@local/hash-isomorphic-utils/page-entity-type-ids"; -import type { - Entity, - EntityRootType, - EntityTypeWithMetadata, - OwnedById, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { Box, diff --git a/apps/hash-frontend/src/pages/[shortname].page/profile-bio.tsx b/apps/hash-frontend/src/pages/[shortname].page/profile-bio.tsx index 9c9bf0d7093..e1ed27226e6 100644 --- a/apps/hash-frontend/src/pages/[shortname].page/profile-bio.tsx +++ b/apps/hash-frontend/src/pages/[shortname].page/profile-bio.tsx @@ -1,5 +1,6 @@ import { useQuery } from "@apollo/client"; import { IconButton, PenRegularIcon } from "@hashintel/design-system"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; import type { GetEntityQuery, @@ -7,7 +8,7 @@ import type { } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; import { getEntityQuery } from "@local/hash-isomorphic-utils/graphql/queries/entity.queries"; import { systemLinkEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { EntityRootType, OwnedById } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { Box, Skeleton, Typography } from "@mui/material"; import type { FunctionComponent } from "react"; import { useCallback, useMemo, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname].page/util.ts b/apps/hash-frontend/src/pages/[shortname].page/util.ts index 3d0f2f7bec7..adc71032929 100644 --- a/apps/hash-frontend/src/pages/[shortname].page/util.ts +++ b/apps/hash-frontend/src/pages/[shortname].page/util.ts @@ -1,10 +1,8 @@ import type { BaseUrl, - Entity, - EntityRootType, EntityTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import type { NextParsedUrlQuery } from "next/dist/server/request-meta"; export type ProfilePageTab = diff --git a/apps/hash-frontend/src/pages/[shortname]/[page-slug].page.tsx b/apps/hash-frontend/src/pages/[shortname]/[page-slug].page.tsx index 3d2b2fd03bb..708fd5361f9 100644 --- a/apps/hash-frontend/src/pages/[shortname]/[page-slug].page.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/[page-slug].page.tsx @@ -1,11 +1,12 @@ import { useQuery } from "@apollo/client"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { HashBlock } from "@local/hash-isomorphic-utils/blocks"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import { isSafariBrowser } from "@local/hash-isomorphic-utils/util"; -import type { EntityId, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-creation-dialog.tsx b/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-creation-dialog.tsx index 2978bde5f76..1a5c38e2d77 100644 --- a/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-creation-dialog.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-creation-dialog.tsx @@ -1,8 +1,8 @@ import { useMutation } from "@apollo/client"; import type { VersionedUrl } from "@blockprotocol/type-system/dist/cjs-slim/index-slim"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { HashBlockMeta } from "@local/hash-isomorphic-utils/blocks"; import { updateBlockCollectionContents } from "@local/hash-isomorphic-utils/graphql/queries/block-collection.queries"; -import type { OwnedById } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { useApp } from "@tldraw/editor"; import type { DialogProps } from "@tldraw/tldraw"; diff --git a/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-shape.tsx b/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-shape.tsx index d7235579603..886b915ee84 100644 --- a/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-shape.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/[page-slug].page/canvas-page/block-shape.tsx @@ -1,10 +1,10 @@ +import type { EntityId } from "@local/hash-graph-types/entity"; import type { UpdateBlockCollectionContentsMutation, UpdateBlockCollectionContentsMutationVariables, } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; import { updateBlockCollectionContents } from "@local/hash-isomorphic-utils/graphql/queries/block-collection.queries"; import type { HasSpatiallyPositionedContentProperties } from "@local/hash-isomorphic-utils/system-types/canvas"; -import type { EntityId } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { toDomPrecision } from "@tldraw/primitives"; import type { TLBaseShape, TLOpacityType } from "@tldraw/tldraw"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page.tsx index f22a5bb785b..c2333be69c7 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page.tsx @@ -1,4 +1,10 @@ import { useLazyQuery } from "@apollo/client"; +import type { + DraftId, + EntityId, + EntityUuid, +} from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { generateEntityPath } from "@local/hash-isomorphic-utils/frontend-paths"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; @@ -10,13 +16,9 @@ import { import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { - DraftId, Entity, - EntityId, EntityPropertiesObject, EntityRootType, - EntityUuid, - OwnedById, Subgraph, } from "@local/hash-subgraph"; import { diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell.ts index 03b31f837af..b8e74f89938 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell.ts @@ -1,8 +1,8 @@ import type { CustomCell, CustomRenderer } from "@glideapps/glide-data-grid"; import { GridCellKind } from "@glideapps/glide-data-grid"; import { customColors } from "@hashintel/design-system/theme"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; -import type { EntityId } from "@local/hash-subgraph"; import { getCellHorizontalPadding, diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-list-editor.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-list-editor.tsx index 41087b41e8f..ef44c5e873c 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-list-editor.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-list-editor.tsx @@ -1,17 +1,17 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { ProvideEditorComponent } from "@glideapps/glide-data-grid"; -import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import type { - CreatedAtDecisionTime, - CreatedAtTransactionTime, CreatedById, EditionCreatedById, - Entity, - EntityId, - EntityRootType, - Subgraph, +} from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { + CreatedAtDecisionTime, + CreatedAtTransactionTime, Timestamp, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/temporal-versioning"; +import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractDraftIdFromEntityId } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { Box } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-selector.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-selector.tsx index 046dc200b0a..f15b279edbd 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-selector.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/cells/linked-with-cell/linked-entity-selector.tsx @@ -1,13 +1,9 @@ import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import { ArrowLeftIcon, AutocompleteDropdown } from "@hashintel/design-system"; import { GRID_CLICK_IGNORE_CLASS } from "@hashintel/design-system/constants"; -import type { - Entity, - EntityId, - EntityRootType, - EntityTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import type { PaperProps } from "@mui/material"; import { Stack, Typography } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/types.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/types.ts index 4a7d9ccbb1c..e837cd90dbb 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/types.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/types.ts @@ -1,12 +1,8 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { SizedGridColumn } from "@glideapps/glide-data-grid"; -import type { - Entity, - EntityId, - EntityRootType, - EntityTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; export type LinkAndTargetEntity = { rightEntity: Entity; linkEntity: Entity }; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/use-rows.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/use-rows.ts index 898bd77f4ce..e86f682ab38 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/use-rows.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/links-section/link-table/use-rows.ts @@ -1,6 +1,7 @@ import { typedEntries } from "@local/advanced-types/typed-entries"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { generateEntityPath } from "@local/hash-isomorphic-utils/frontend-paths"; -import type { Entity, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractDraftIdFromEntityId } from "@local/hash-subgraph"; import { getEntityTypeAndParentsById, diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/change-type-cell.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/change-type-cell.tsx index 707f3b0caed..ad17ead57b1 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/change-type-cell.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/change-type-cell.tsx @@ -5,7 +5,7 @@ import type { } from "@glideapps/glide-data-grid"; import { GridCellKind } from "@glideapps/glide-data-grid"; import { customColors } from "@hashintel/design-system/theme"; -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import produce from "immer"; import type { RefObject } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell.tsx index c8a24ea75e1..2e2d4dc7e64 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell.tsx @@ -2,9 +2,9 @@ import type { JsonValue } from "@blockprotocol/core"; import type { CustomCell, CustomRenderer } from "@glideapps/glide-data-grid"; import { GridCellKind } from "@glideapps/glide-data-grid"; import { customColors } from "@hashintel/design-system/theme"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import type { FormattedValuePart } from "@local/hash-isomorphic-utils/data-types"; import { formatDataValue } from "@local/hash-isomorphic-utils/data-types"; -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; import { getCellHorizontalPadding, diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/draft-row.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/draft-row.tsx index 910a361289f..ed015ec99f3 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/draft-row.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/draft-row.tsx @@ -1,4 +1,4 @@ -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { useState } from "react"; import { DRAFT_ROW_KEY } from "../array-editor"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/sortable-row.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/sortable-row.tsx index 27bff08d443..a7217bed818 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/sortable-row.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/array-editor/sortable-row.tsx @@ -7,8 +7,8 @@ import { faPencil, faTrash, } from "@fortawesome/free-solid-svg-icons"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { formatDataValue } from "@local/hash-isomorphic-utils/data-types"; -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; import DragIndicatorIcon from "@mui/icons-material/DragIndicator"; import { Box, Divider, Typography } from "@mui/material"; import { useRef, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-specs.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-specs.ts index 49c499d7b70..b8cdb0a3f76 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-specs.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-specs.ts @@ -14,7 +14,7 @@ import { faSquareCheck, faText, } from "@hashintel/design-system"; -import type { CustomDataType } from "@local/hash-subgraph"; +import type { CustomDataType } from "@local/hash-graph-types/ontology"; import type { CustomIcon } from "../../../../../../../../../components/grid/utils/custom-grid-icons"; import type { EditorType } from "./types"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.tsx index 39a7d375b59..216ebdd70c7 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.tsx @@ -1,5 +1,5 @@ import { FontAwesomeIcon } from "@hashintel/design-system"; -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { Box, ButtonBase, Typography } from "@mui/material"; import { getEditorSpecs } from "./editor-specs"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/inputs/number-or-text-input.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/inputs/number-or-text-input.tsx index 798870a9c22..f31ded408cf 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/inputs/number-or-text-input.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/inputs/number-or-text-input.tsx @@ -1,6 +1,6 @@ import type { TextFieldProps } from "@hashintel/design-system"; import { TextField } from "@hashintel/design-system"; -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { format, formatISO, parseISO } from "date-fns"; import type { CellInputProps } from "./types"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/utils.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/utils.ts index a35a2ca24cf..86ed9f293fb 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/utils.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/cells/value-cell/utils.ts @@ -1,4 +1,4 @@ -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import isPlainObject from "lodash/isPlainObject"; import type { EditorType } from "./types"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/types.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/types.ts index a469b02951b..55c9794457b 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/types.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/types.ts @@ -1,5 +1,5 @@ import type { SizedGridColumn } from "@glideapps/glide-data-grid"; -import type { DataTypeWithMetadata } from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import type { VerticalIndentationLineDir } from "../../../../../../../components/grid/utils/draw-vertical-indentation-line"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity.ts index bb87f4bbb16..fa44cbeda3b 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity.ts @@ -1,4 +1,5 @@ -import type { BaseUrl, EntityRootType, Subgraph } from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { EntityRootType, Subgraph } from "@local/hash-subgraph"; import { getEntityTypeAndParentsById, getRoots, diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/generate-property-row-recursively.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/generate-property-row-recursively.ts index 090e9da8d27..03478563d62 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/generate-property-row-recursively.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/generate-property-row-recursively.ts @@ -2,12 +2,8 @@ import type { PropertyTypeReference, ValueOrArray, } from "@blockprotocol/type-system"; -import type { - BaseUrl, - Entity, - EntityRootType, - Subgraph, -} from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { getPropertyTypeById } from "@local/hash-subgraph/stdlib"; import get from "lodash/get"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/get-expected-types-of-property-type.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/get-expected-types-of-property-type.ts index 0f6c5963489..f3b2a17f6f2 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/get-expected-types-of-property-type.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/properties-section/property-table/use-rows/generate-property-rows-from-entity/get-expected-types-of-property-type.ts @@ -3,7 +3,8 @@ import type { PropertyType, PropertyValues, } from "@blockprotocol/type-system"; -import type { DataTypeWithMetadata, Subgraph } from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { Subgraph } from "@local/hash-subgraph"; import { getDataTypeById } from "@local/hash-subgraph/stdlib"; import { isPropertyValueArray } from "../../../../../../../../../lib/typeguards"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-entity-subgraph.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-entity-subgraph.ts index 8c3e07e3aea..e932ed27c2e 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-entity-subgraph.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-entity-subgraph.ts @@ -1,16 +1,20 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { - CreatedAtDecisionTime, - CreatedAtTransactionTime, CreatedById, EditionCreatedById, +} from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { + CreatedAtDecisionTime, + CreatedAtTransactionTime, + Timestamp, +} from "@local/hash-graph-types/temporal-versioning"; +import type { Entity, - EntityId, EntityRevisionId, EntityRootType, EntityVertexId, Subgraph, - Timestamp, } from "@local/hash-subgraph"; import type { Dispatch, SetStateAction } from "react"; import { useEffect, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-link-state.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-link-state.ts index d4b91293adc..a7d2cbfc8fd 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-link-state.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-draft-link-state.ts @@ -1,4 +1,5 @@ -import type { EntityId, EntityRootType, Subgraph } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { EntityRootType, Subgraph } from "@local/hash-subgraph"; import type { Dispatch, SetStateAction } from "react"; import { useState } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-mark-link-entity-to-archive.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-mark-link-entity-to-archive.ts index e7789287c5f..f37783bf925 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-mark-link-entity-to-archive.ts +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/use-mark-link-entity-to-archive.ts @@ -1,4 +1,4 @@ -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { useEntityEditor } from "../entity-editor/entity-editor-context"; diff --git a/apps/hash-frontend/src/pages/[shortname]/flows/[flow-def-id].page.tsx b/apps/hash-frontend/src/pages/[shortname]/flows/[flow-def-id].page.tsx index 2914d6873b0..2c4895aff0e 100644 --- a/apps/hash-frontend/src/pages/[shortname]/flows/[flow-def-id].page.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/flows/[flow-def-id].page.tsx @@ -1,4 +1,4 @@ -import type { EntityUuid } from "@local/hash-subgraph"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import { useRouter } from "next/router"; import type { NextPageWithLayout } from "../../../shared/layout"; diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/archive-menu-item.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/archive-menu-item.tsx index b454e1b5446..5484aaa9cb9 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/archive-menu-item.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/archive-menu-item.tsx @@ -1,5 +1,6 @@ import { useMutation } from "@apollo/client"; -import type { Entity, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { Entity } from "@local/hash-subgraph"; import { ListItemIcon, ListItemText } from "@mui/material"; import type { FunctionComponent } from "react"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/activity-log.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/activity-log.tsx index 9ec7fe88af6..fc9982671d9 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/activity-log.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/activity-log.tsx @@ -1,11 +1,11 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; -import type { StepProgressLog } from "@local/hash-isomorphic-utils/flows/types"; -import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import type { EntityId, EntityMetadata, EntityRecordId, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/entity"; +import type { StepProgressLog } from "@local/hash-isomorphic-utils/flows/types"; +import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { Box, Stack, TableCell, Tooltip } from "@mui/material"; import { format } from "date-fns"; import type { ReactElement } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx index 1a727b48d99..76c349d9e52 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx @@ -1,14 +1,14 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { + EntityId, + EntityMetadata, + EntityRecordId, +} from "@local/hash-graph-types/entity"; import type { PersistedEntity, ProposedEntity, } from "@local/hash-isomorphic-utils/flows/types"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; -import type { - EntityId, - EntityMetadata, - EntityRecordId, -} from "@local/hash-subgraph"; import { TableCell } from "@mui/material"; import { memo, useMemo, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/persisted-entity-graph.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/persisted-entity-graph.tsx index f805fc409f5..69352db535f 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/persisted-entity-graph.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/outputs/persisted-entity-graph.tsx @@ -1,6 +1,7 @@ import { useQuery } from "@apollo/client"; import type { EntityRootType, Subgraph } from "@blockprotocol/graph"; import { EntitiesGraphChart } from "@hashintel/block-design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { PersistedEntity } from "@local/hash-isomorphic-utils/flows/types"; import { fullOntologyResolveDepths, @@ -8,7 +9,7 @@ import { zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { isNotNullish } from "@local/hash-isomorphic-utils/types"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { useMemo } from "react"; import type { diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal.tsx index 7a09c595427..b0923e542cb 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal.tsx @@ -1,11 +1,11 @@ import { typedValues } from "@local/advanced-types/typed-entries"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { FlowDefinition, FlowTrigger, OutputDefinition, StepOutput, } from "@local/hash-isomorphic-utils/flows/types"; -import type { OwnedById } from "@local/hash-subgraph"; import { Box, Typography } from "@mui/material"; import type { PropsWithChildren } from "react"; import { useState } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal/types.ts b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal/types.ts index 5153b3cd3f7..dbe55b3ad72 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal/types.ts +++ b/apps/hash-frontend/src/pages/[shortname]/shared/flow-visualizer/run-flow-modal/types.ts @@ -1,15 +1,13 @@ import type { Subtype } from "@local/advanced-types/subtype"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { FormattedText, GoogleSheet, PayloadKind, } from "@local/hash-isomorphic-utils/flows/types"; import type { ActorTypeDataType } from "@local/hash-isomorphic-utils/system-types/google/googlesheetsfile"; -import type { - Entity, - EntityTypeWithMetadata, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; const unsupportedPayloadKinds = [ /** @todo support ActorType to vary Sheet output formatting */ diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/use-route-namespace.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/use-route-namespace.tsx index 07585b7ef0f..f8eef37c57c 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/use-route-namespace.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/use-route-namespace.tsx @@ -1,4 +1,4 @@ -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; import { useRouter } from "next/router"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/pages/[shortname]/shared/use-update-profile-avatar.tsx b/apps/hash-frontend/src/pages/[shortname]/shared/use-update-profile-avatar.tsx index f7a00467194..a6da10a07cd 100644 --- a/apps/hash-frontend/src/pages/[shortname]/shared/use-update-profile-avatar.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/shared/use-update-profile-avatar.tsx @@ -1,8 +1,8 @@ +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { OwnedById } from "@local/hash-subgraph"; import { useCallback, useState } from "react"; import type { Org, User } from "../../../lib/user-and-org"; diff --git a/apps/hash-frontend/src/pages/[shortname]/types/entity-type/[...slug-maybe-version].page/get-entity-type-base-url.ts b/apps/hash-frontend/src/pages/[shortname]/types/entity-type/[...slug-maybe-version].page/get-entity-type-base-url.ts index fd85a3d6dea..891a6964b5f 100644 --- a/apps/hash-frontend/src/pages/[shortname]/types/entity-type/[...slug-maybe-version].page/get-entity-type-base-url.ts +++ b/apps/hash-frontend/src/pages/[shortname]/types/entity-type/[...slug-maybe-version].page/get-entity-type-base-url.ts @@ -1,7 +1,7 @@ +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { frontendUrl } from "@local/hash-isomorphic-utils/environment"; import type { SystemTypeWebShortname } from "@local/hash-isomorphic-utils/ontology-types"; import { systemTypeWebShortnames } from "@local/hash-isomorphic-utils/ontology-types"; -import type { BaseUrl } from "@local/hash-subgraph"; export const getEntityTypeBaseUrl = ( slug: string, diff --git a/apps/hash-frontend/src/pages/[shortname]/workers/[run-id].page.tsx b/apps/hash-frontend/src/pages/[shortname]/workers/[run-id].page.tsx index 16c20cf666a..410231ce7fd 100644 --- a/apps/hash-frontend/src/pages/[shortname]/workers/[run-id].page.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/workers/[run-id].page.tsx @@ -1,4 +1,4 @@ -import type { EntityUuid } from "@local/hash-subgraph"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import { useRouter } from "next/router"; import type { NextPageWithLayout } from "../../../shared/layout"; diff --git a/apps/hash-frontend/src/pages/actions.page.tsx b/apps/hash-frontend/src/pages/actions.page.tsx index 5bbdbefaec3..ec53951b21d 100644 --- a/apps/hash-frontend/src/pages/actions.page.tsx +++ b/apps/hash-frontend/src/pages/actions.page.tsx @@ -1,11 +1,12 @@ import { useQuery } from "@apollo/client"; import { PenRegularIcon } from "@hashintel/design-system"; import type { Filter } from "@local/hash-graph-client"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { currentTimeInstantTemporalAxes, mapGqlSubgraphFieldsFragmentToSubgraph, } from "@local/hash-isomorphic-utils/graph-queries"; -import type { EntityId, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { Box, diff --git a/apps/hash-frontend/src/pages/actions.page/draft-entities-bulk-actions-dropdown.tsx b/apps/hash-frontend/src/pages/actions.page/draft-entities-bulk-actions-dropdown.tsx index b6dde43b796..3640aea7fc6 100644 --- a/apps/hash-frontend/src/pages/actions.page/draft-entities-bulk-actions-dropdown.tsx +++ b/apps/hash-frontend/src/pages/actions.page/draft-entities-bulk-actions-dropdown.tsx @@ -1,6 +1,7 @@ import { useMutation } from "@apollo/client"; import { AlertModal, CaretDownSolidIcon } from "@hashintel/design-system"; -import type { EntityId, EntityRootType, Subgraph } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractDraftIdFromEntityId } from "@local/hash-subgraph"; import { getEntityRevision, diff --git a/apps/hash-frontend/src/pages/actions.page/draft-entities.tsx b/apps/hash-frontend/src/pages/actions.page/draft-entities.tsx index 5c89c3c2e38..69d8fd1f9b2 100644 --- a/apps/hash-frontend/src/pages/actions.page/draft-entities.tsx +++ b/apps/hash-frontend/src/pages/actions.page/draft-entities.tsx @@ -1,12 +1,8 @@ import { Skeleton } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; -import type { - BaseUrl, - Entity, - EntityId, - EntityRootType, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { Box, Container, Divider, Typography } from "@mui/material"; import type { Dispatch, FunctionComponent, SetStateAction } from "react"; diff --git a/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-context-bar.tsx b/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-context-bar.tsx index 3f395248ed3..6d506acd5fc 100644 --- a/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-context-bar.tsx +++ b/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-context-bar.tsx @@ -1,4 +1,5 @@ -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import { Box, Checkbox, Fade, styled, Typography } from "@mui/material"; import type { Dispatch, FunctionComponent, SetStateAction } from "react"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx b/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx index 4de647e1568..eaea2c56a3e 100644 --- a/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx +++ b/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx @@ -1,15 +1,13 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import { extractVersion } from "@blockprotocol/type-system"; import { WandMagicSparklesIcon } from "@hashintel/design-system"; +import type { AccountId } from "@local/hash-graph-types/account"; import type { - AccountId, BaseUrl, - Entity, - EntityRootType, EntityTypeWithMetadata, - OwnedById, - Subgraph, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { getEntityTypeById } from "@local/hash-subgraph/stdlib"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; diff --git a/apps/hash-frontend/src/pages/admin/users/[user-entity-uuid].page.tsx b/apps/hash-frontend/src/pages/admin/users/[user-entity-uuid].page.tsx index 7a37b640051..275b5598dae 100644 --- a/apps/hash-frontend/src/pages/admin/users/[user-entity-uuid].page.tsx +++ b/apps/hash-frontend/src/pages/admin/users/[user-entity-uuid].page.tsx @@ -1,5 +1,6 @@ +import type { AccountId } from "@local/hash-graph-types/account"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; -import type { AccountId, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { Typography } from "@mui/material"; import { useRouter } from "next/router"; diff --git a/apps/hash-frontend/src/pages/entities.page.tsx b/apps/hash-frontend/src/pages/entities.page.tsx index 68113e77b2b..9cc9048e18b 100644 --- a/apps/hash-frontend/src/pages/entities.page.tsx +++ b/apps/hash-frontend/src/pages/entities.page.tsx @@ -5,9 +5,9 @@ import { EyeIconSolid, PenToSquareIconSolid, } from "@hashintel/design-system"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { pluralize } from "@local/hash-isomorphic-utils/pluralize"; -import type { EntityTypeWithMetadata } from "@local/hash-subgraph"; import { isBaseUrl } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import type { SxProps, Theme } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/goals/new.page.tsx b/apps/hash-frontend/src/pages/goals/new.page.tsx index 757b449d772..71608c79b49 100644 --- a/apps/hash-frontend/src/pages/goals/new.page.tsx +++ b/apps/hash-frontend/src/pages/goals/new.page.tsx @@ -4,11 +4,12 @@ import { BullseyeLightIcon, TextField, } from "@hashintel/design-system"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { GoalFlowTriggerInput } from "@local/hash-isomorphic-utils/flows/example-flow-definitions"; import { goalFlowDefinition } from "@local/hash-isomorphic-utils/flows/example-flow-definitions"; import { generateWorkerRunPath } from "@local/hash-isomorphic-utils/flows/frontend-paths"; import type { StepOutput } from "@local/hash-isomorphic-utils/flows/types"; -import type { EntityTypeWithMetadata, OwnedById } from "@local/hash-subgraph"; import { autocompleteClasses, Box, diff --git a/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx b/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx index cb7e5788452..f5d0e0682c8 100644 --- a/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx +++ b/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx @@ -1,10 +1,11 @@ import { Autocomplete, TextField } from "@hashintel/design-system"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/page"; -import type { Entity, OwnedById } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import type { ModalProps } from "@mui/material"; import { autocompleteClasses, diff --git a/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx b/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx index fe03ca2a4af..7f04345b96b 100644 --- a/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx +++ b/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx @@ -1,10 +1,6 @@ +import type { OwnedById } from "@local/hash-graph-types/web"; import { getBlockCollectionResolveDepth } from "@local/hash-isomorphic-utils/block-collection"; -import type { - Entity, - EntityRootType, - OwnedById, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { Box, Skeleton } from "@mui/material"; import type { FunctionComponent } from "react"; import { useCallback, useEffect, useRef, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx b/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx index 6de371f325c..bd4868f64c0 100644 --- a/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx +++ b/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx @@ -1,5 +1,7 @@ import { useMutation, useQuery } from "@apollo/client"; import { IconButton } from "@hashintel/design-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { getBlockCollectionResolveDepth } from "@local/hash-isomorphic-utils/block-collection"; import { isHashTextBlock } from "@local/hash-isomorphic-utils/blocks"; import { zeroedGraphResolveDepths } from "@local/hash-isomorphic-utils/graph-queries"; @@ -10,13 +12,7 @@ import { } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { QuickNoteProperties } from "@local/hash-isomorphic-utils/system-types/quicknote"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { - BaseUrl, - Entity, - EntityRootType, - OwnedById, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { Box, Fade, Skeleton, Tooltip, Typography } from "@mui/material"; import type { FunctionComponent } from "react"; diff --git a/apps/hash-frontend/src/pages/settings/integrations/google-sheets/create-or-edit-sheets-sync.tsx b/apps/hash-frontend/src/pages/settings/integrations/google-sheets/create-or-edit-sheets-sync.tsx index fb9c6007889..09c41effffc 100644 --- a/apps/hash-frontend/src/pages/settings/integrations/google-sheets/create-or-edit-sheets-sync.tsx +++ b/apps/hash-frontend/src/pages/settings/integrations/google-sheets/create-or-edit-sheets-sync.tsx @@ -2,9 +2,9 @@ import { useMutation } from "@apollo/client"; import type { MultiFilter } from "@blockprotocol/graph"; import { CheckIcon } from "@hashintel/design-system"; import { EntityQueryEditor } from "@hashintel/query-editor"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { blockProtocolEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { QueryProperties } from "@local/hash-isomorphic-utils/system-types/blockprotocol/query"; -import type { OwnedById } from "@local/hash-subgraph"; import { Box, Collapse, Stack, Typography } from "@mui/material"; import type { PropsWithChildren } from "react"; import { useMemo, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/settings/integrations/linear/new.page.tsx b/apps/hash-frontend/src/pages/settings/integrations/linear/new.page.tsx index af231c0cf5f..bbca40a48af 100644 --- a/apps/hash-frontend/src/pages/settings/integrations/linear/new.page.tsx +++ b/apps/hash-frontend/src/pages/settings/integrations/linear/new.page.tsx @@ -1,7 +1,7 @@ import { useLazyQuery, useMutation } from "@apollo/client"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { LinearIntegrationProperties } from "@local/hash-isomorphic-utils/system-types/linearintegration"; -import type { EntityId } from "@local/hash-subgraph"; import { Box, Container, Typography } from "@mui/material"; import { useRouter } from "next/router"; import { useCallback, useEffect, useMemo, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/settings/integrations/linear/select-linear-teams-table.tsx b/apps/hash-frontend/src/pages/settings/integrations/linear/select-linear-teams-table.tsx index a3365c0c31e..84b8e8b14b3 100644 --- a/apps/hash-frontend/src/pages/settings/integrations/linear/select-linear-teams-table.tsx +++ b/apps/hash-frontend/src/pages/settings/integrations/linear/select-linear-teams-table.tsx @@ -1,7 +1,7 @@ import { Chip, Select } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { LinearIntegrationProperties } from "@local/hash-isomorphic-utils/system-types/linearintegration"; -import type { EntityId } from "@local/hash-subgraph"; import { Box, Table, diff --git a/apps/hash-frontend/src/pages/settings/organizations/[shortname]/members.page/member-row.tsx b/apps/hash-frontend/src/pages/settings/organizations/[shortname]/members.page/member-row.tsx index 1e441877f16..b958ed58869 100644 --- a/apps/hash-frontend/src/pages/settings/organizations/[shortname]/members.page/member-row.tsx +++ b/apps/hash-frontend/src/pages/settings/organizations/[shortname]/members.page/member-row.tsx @@ -1,5 +1,6 @@ import { useMutation } from "@apollo/client"; -import type { AccountEntityId, AccountGroupId } from "@local/hash-subgraph"; +import type { AccountGroupId } from "@local/hash-graph-types/account"; +import type { AccountEntityId } from "@local/hash-subgraph"; import { extractAccountId } from "@local/hash-subgraph"; import { TableCell, TableRow, Typography } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/settings/organizations/shared/org-form.tsx b/apps/hash-frontend/src/pages/settings/organizations/shared/org-form.tsx index 86cef727201..c4b8d3baf74 100644 --- a/apps/hash-frontend/src/pages/settings/organizations/shared/org-form.tsx +++ b/apps/hash-frontend/src/pages/settings/organizations/shared/org-form.tsx @@ -1,9 +1,9 @@ import { TextField } from "@hashintel/design-system"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { OwnedById } from "@local/hash-subgraph"; import { Box, outlinedInputClasses, Stack, Typography } from "@mui/material"; import type { PropsWithChildren } from "react"; import { useState } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/auth-info-context.tsx b/apps/hash-frontend/src/pages/shared/auth-info-context.tsx index 66e639bd608..2e77c7ed709 100644 --- a/apps/hash-frontend/src/pages/shared/auth-info-context.tsx +++ b/apps/hash-frontend/src/pages/shared/auth-info-context.tsx @@ -1,16 +1,13 @@ import { useApolloClient, useQuery } from "@apollo/client"; +import type { AccountGroupId } from "@local/hash-graph-types/account"; +import type { Uuid } from "@local/hash-graph-types/branded"; +import type { EntityMetadata } from "@local/hash-graph-types/entity"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; import { checkUserPermissionsOnEntityQuery } from "@local/hash-isomorphic-utils/graphql/queries/entity.queries"; import { systemLinkEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { IsMemberOfProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - AccountGroupId, - EntityMetadata, - EntityRootType, - Subgraph, - Timestamp, - Uuid, -} from "@local/hash-subgraph"; +import type { EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { getOutgoingLinksForEntity, diff --git a/apps/hash-frontend/src/pages/shared/block-collection-contents.ts b/apps/hash-frontend/src/pages/shared/block-collection-contents.ts index 14355b77ff3..5de3e616143 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection-contents.ts +++ b/apps/hash-frontend/src/pages/shared/block-collection-contents.ts @@ -1,3 +1,4 @@ +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; import { sortBlockCollectionLinks } from "@local/hash-isomorphic-utils/block-collection"; import { currentTimeInstantTemporalAxes, @@ -16,9 +17,7 @@ import type { import type { TextToken } from "@local/hash-isomorphic-utils/types"; import type { Entity, - EntityId, EntityRootType, - EntityUuid, GraphResolveDepths, Subgraph, } from "@local/hash-subgraph"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/block-collection.tsx b/apps/hash-frontend/src/pages/shared/block-collection/block-collection.tsx index e5ab2f0130b..12a63597d80 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/block-collection.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/block-collection.tsx @@ -1,8 +1,9 @@ import "prosemirror-view/style/prosemirror.css"; import { useApolloClient } from "@apollo/client"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ProsemirrorManager } from "@local/hash-isomorphic-utils/prosemirror-manager"; -import type { EntityId, OwnedById } from "@local/hash-subgraph"; import type { BoxProps } from "@mui/material"; import { Box } from "@mui/material"; import type { EditorView } from "prosemirror-view"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx index 32e3121c373..c00c2d1b833 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx @@ -2,13 +2,15 @@ import type { MultiFilter } from "@blockprotocol/graph"; import type { ModalProps } from "@hashintel/design-system"; import { IconButton, Modal } from "@hashintel/design-system"; import { EntityQueryEditor } from "@hashintel/query-editor"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { blockProtocolEntityTypes, blockProtocolLinkEntityTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { QueryProperties } from "@local/hash-isomorphic-utils/system-types/blockprotocol/query"; -import type { Entity, EntityId, OwnedById } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { getOutgoingLinkAndTargetEntities, getRoots, diff --git a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx index 4e93bfaca16..fbe204d6f6e 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx @@ -6,10 +6,11 @@ import { LoadingSpinner, TextField, } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { EntityStoreType } from "@local/hash-isomorphic-utils/entity-store"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; -import type { Entity, EntityId, EntityRootType } from "@local/hash-subgraph"; +import type { Entity, EntityRootType } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { Box, diff --git a/apps/hash-frontend/src/pages/shared/block-collection/block-view.tsx b/apps/hash-frontend/src/pages/shared/block-collection/block-view.tsx index 17ccc6c2b19..cc00dba275a 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/block-view.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/block-view.tsx @@ -1,4 +1,5 @@ import type { BlockVariant } from "@blockprotocol/core"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { HashBlockMeta } from "@local/hash-isomorphic-utils/blocks"; import type { EntityStore } from "@local/hash-isomorphic-utils/entity-store"; import { @@ -10,7 +11,6 @@ import { isEntityNode, } from "@local/hash-isomorphic-utils/prosemirror"; import type { ProsemirrorManager } from "@local/hash-isomorphic-utils/prosemirror-manager"; -import type { EntityId } from "@local/hash-subgraph"; import type { Node } from "prosemirror-model"; import { NodeSelection, TextSelection } from "prosemirror-state"; import type { EditorView, NodeView } from "prosemirror-view"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-block.tsx b/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-block.tsx index 4e000760bfc..bdb66d6d8e2 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-block.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-block.tsx @@ -14,10 +14,10 @@ import { IconButton, LoadingSpinner, } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { EntityId } from "@local/hash-subgraph"; import { Box, Collapse, Tooltip, Typography } from "@mui/material"; import { formatDistanceToNowStrict } from "date-fns"; import { isEqual } from "lodash"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-thread.tsx b/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-thread.tsx index 9876b7f1035..b52d81878c5 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-thread.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-thread.tsx @@ -1,7 +1,8 @@ +import type { EntityId } from "@local/hash-graph-types/entity"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { AccountEntityId, EntityId } from "@local/hash-subgraph"; +import type { AccountEntityId } from "@local/hash-subgraph"; import { extractAccountId } from "@local/hash-subgraph"; import ExpandLessIcon from "@mui/icons-material/ExpandLess"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment-button.tsx b/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment-button.tsx index 40b77bb0bd7..7f15b8ca612 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment-button.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment-button.tsx @@ -1,6 +1,6 @@ import { faComment } from "@fortawesome/free-regular-svg-icons"; import { FontAwesomeIcon, IconButton } from "@hashintel/design-system"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { Box, Popper } from "@mui/material"; import type { FunctionComponent } from "react"; import { useCallback, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment.tsx b/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment.tsx index 875cb76f6fc..00654562762 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/comments/create-block-comment.tsx @@ -1,7 +1,7 @@ import { faComment } from "@fortawesome/free-regular-svg-icons"; import { FontAwesomeIcon, IconButton } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { EntityId } from "@local/hash-subgraph"; import { Box } from "@mui/material"; import type { FunctionComponent } from "react"; import { useState } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx b/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx index fe5abc4ed60..f44587ffe62 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx @@ -1,4 +1,5 @@ import type { VersionedUrl } from "@blockprotocol/type-system/slim"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { HashBlock } from "@local/hash-isomorphic-utils/blocks"; import type { BlockEntity } from "@local/hash-isomorphic-utils/entity"; import { @@ -22,7 +23,6 @@ import { } from "@local/hash-isomorphic-utils/prosemirror"; import type { ProsemirrorManager } from "@local/hash-isomorphic-utils/prosemirror-manager"; import { textBlockNodeToEntityProperties } from "@local/hash-isomorphic-utils/text"; -import type { EntityId } from "@local/hash-subgraph"; import * as Sentry from "@sentry/nextjs"; import type { Node } from "prosemirror-model"; import type { Transaction } from "prosemirror-state"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/create-editor-view.ts b/apps/hash-frontend/src/pages/shared/block-collection/create-editor-view.ts index dc761aeb048..f0b4d957b0b 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/create-editor-view.ts +++ b/apps/hash-frontend/src/pages/shared/block-collection/create-editor-view.ts @@ -1,4 +1,6 @@ import type { ApolloClient } from "@apollo/client"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ComponentIdHashBlockMap } from "@local/hash-isomorphic-utils/blocks"; import { paragraphBlockComponentId } from "@local/hash-isomorphic-utils/blocks"; import { createProseMirrorState } from "@local/hash-isomorphic-utils/create-prose-mirror-state"; @@ -10,7 +12,6 @@ import { // import { apiOrigin } from "@local/hash-isomorphic-utils/environment"; import { ProsemirrorManager } from "@local/hash-isomorphic-utils/prosemirror-manager"; import { save } from "@local/hash-isomorphic-utils/save"; -import type { EntityId, OwnedById } from "@local/hash-subgraph"; import debounce from "lodash/debounce"; // import applyDevTools from "prosemirror-dev-tools"; import { Plugin, PluginKey } from "prosemirror-state"; @@ -257,7 +258,7 @@ export const createEditorView = (params: { /** * @todo the collab editor connection is disabled currently. * see https://app.asana.com/0/0/1203099452204542/f - + connection = new EditorConnection( `${apiOrigin}/collab-backend/${accountId}/${pageEntityId}`, view.state.schema, diff --git a/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx b/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx index cda7f24e490..236c0fe3713 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx @@ -1,7 +1,7 @@ import type { BlockVariant } from "@blockprotocol/core"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { HashBlockMeta } from "@local/hash-isomorphic-utils/blocks"; import type { ProsemirrorManager } from "@local/hash-isomorphic-utils/prosemirror-manager"; -import type { OwnedById } from "@local/hash-subgraph"; import { Popper } from "@mui/material"; import type { EditorState, diff --git a/apps/hash-frontend/src/pages/shared/block-collection/create-text-editor-view.ts b/apps/hash-frontend/src/pages/shared/block-collection/create-text-editor-view.ts index 56dc54d5f87..a043c9a0a46 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/create-text-editor-view.ts +++ b/apps/hash-frontend/src/pages/shared/block-collection/create-text-editor-view.ts @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { EditorState } from "prosemirror-state"; import type { DirectEditorProps } from "prosemirror-view"; import { EditorView } from "prosemirror-view"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-node-view.ts b/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-node-view.ts index 42cbef42b12..c20bc337b71 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-node-view.ts +++ b/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-node-view.ts @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { Node } from "prosemirror-model"; import type { EditorView } from "prosemirror-view"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-view.tsx b/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-view.tsx index 3cade95de07..b9a597c4163 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-view.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/mention-view/mention-view.tsx @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { Node } from "prosemirror-model"; import type { EditorView, NodeView } from "prosemirror-view"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/page-context.tsx b/apps/hash-frontend/src/pages/shared/block-collection/page-context.tsx index 248e38501c1..1d76519a1a3 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/page-context.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/page-context.tsx @@ -1,5 +1,5 @@ +import type { EntityId } from "@local/hash-graph-types/entity"; import type { ProsemirrorManager } from "@local/hash-isomorphic-utils/prosemirror-manager"; -import type { EntityId } from "@local/hash-subgraph"; import type { EditorView } from "prosemirror-view"; import type { FunctionComponent, PropsWithChildren, RefObject } from "react"; import { createContext, useContext, useMemo, useRef, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/page-title/page-title.tsx b/apps/hash-frontend/src/pages/shared/block-collection/page-title/page-title.tsx index 48917e3960a..b4fffc5f273 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/page-title/page-title.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/page-title/page-title.tsx @@ -1,4 +1,4 @@ -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { styled, TextareaAutosize } from "@mui/material"; import type { ChangeEventHandler, diff --git a/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester.tsx b/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester.tsx index 323bdeb2cae..237f7ee3638 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester.tsx @@ -1,6 +1,12 @@ import { useQuery } from "@apollo/client"; import type { VersionedUrl } from "@blockprotocol/type-system"; import { LoadingSpinner } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { + BaseUrl, + EntityTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { currentTimeInstantTemporalAxes, @@ -16,14 +22,7 @@ import { isPageEntityTypeId, pageEntityTypeIds, } from "@local/hash-isomorphic-utils/page-entity-type-ids"; -import type { - BaseUrl, - Entity, - EntityId, - EntityRootType, - EntityTypeWithMetadata, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { getEntityTypeById, diff --git a/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester/mention-suggester-entity.tsx b/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester/mention-suggester-entity.tsx index a57fe55ca19..494310769c0 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester/mention-suggester-entity.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/shared/mention-suggester/mention-suggester-entity.tsx @@ -1,11 +1,13 @@ import { AsteriskRegularIcon, IconButton } from "@hashintel/design-system"; +import type { + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import type { Entity, EntityPropertyValue, EntityRootType, - EntityTypeWithMetadata, - PropertyTypeWithMetadata, Subgraph, } from "@local/hash-subgraph"; import type { ListItemButtonProps } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/shared/data-types-context.tsx b/apps/hash-frontend/src/pages/shared/data-types-context.tsx index 3185e9deffd..6f51061ab86 100644 --- a/apps/hash-frontend/src/pages/shared/data-types-context.tsx +++ b/apps/hash-frontend/src/pages/shared/data-types-context.tsx @@ -2,12 +2,10 @@ import { useQuery } from "@apollo/client"; import type { JsonValue } from "@blockprotocol/core"; import type { VersionedUrl } from "@blockprotocol/type-system"; import { typedValues } from "@local/advanced-types/typed-entries"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; import type { FormattedValuePart } from "@local/hash-isomorphic-utils/data-types"; import { formatDataValue } from "@local/hash-isomorphic-utils/data-types"; -import type { - DataTypeWithMetadata, - OntologyTypeRevisionId, -} from "@local/hash-subgraph"; +import type { OntologyTypeRevisionId } from "@local/hash-subgraph"; import { componentsFromVersionedUrl } from "@local/hash-subgraph/type-system-patch"; import type { PropsWithChildren } from "react"; import { createContext, useCallback, useContext, useMemo } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/entities-table.tsx b/apps/hash-frontend/src/pages/shared/entities-table.tsx index 0929459c358..7c55fcf215a 100644 --- a/apps/hash-frontend/src/pages/shared/entities-table.tsx +++ b/apps/hash-frontend/src/pages/shared/entities-table.tsx @@ -8,12 +8,14 @@ import type { CustomCell, Item, TextCell } from "@glideapps/glide-data-grid"; import { GridCellKind } from "@glideapps/glide-data-grid"; import { EntitiesGraphChart } from "@hashintel/block-design-system"; import { ListRegularIcon } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { gridRowHeight } from "@local/hash-isomorphic-utils/data-grid"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { isPageEntityTypeId } from "@local/hash-isomorphic-utils/page-entity-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { BaseUrl, Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/hash-frontend/src/pages/shared/entities-table/grid-view/grid-view-item.tsx b/apps/hash-frontend/src/pages/shared/entities-table/grid-view/grid-view-item.tsx index a9959dfabbd..a8d1199c938 100644 --- a/apps/hash-frontend/src/pages/shared/entities-table/grid-view/grid-view-item.tsx +++ b/apps/hash-frontend/src/pages/shared/entities-table/grid-view/grid-view-item.tsx @@ -1,7 +1,8 @@ +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { FileProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { BaseUrl, Entity } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { Box, Typography } from "@mui/material"; import type { FunctionComponent, ReactNode } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/entities-table/use-entities-table.tsx b/apps/hash-frontend/src/pages/shared/entities-table/use-entities-table.tsx index 74207802907..5f4aa763c43 100644 --- a/apps/hash-frontend/src/pages/shared/entities-table/use-entities-table.tsx +++ b/apps/hash-frontend/src/pages/shared/entities-table/use-entities-table.tsx @@ -1,18 +1,14 @@ import type { EntityType, PropertyType } from "@blockprotocol/type-system"; import { extractVersion } from "@blockprotocol/type-system"; import type { SizedGridColumn } from "@glideapps/glide-data-grid"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { isPageEntityTypeId } from "@local/hash-isomorphic-utils/page-entity-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import { stringifyPropertyValue } from "@local/hash-isomorphic-utils/stringify-property-value"; import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - BaseUrl, - Entity, - EntityId, - EntityRootType, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { format } from "date-fns"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/entities-table/use-get-entities-table-additional-csv-data.ts b/apps/hash-frontend/src/pages/shared/entities-table/use-get-entities-table-additional-csv-data.ts index 53dece8f847..e2fe417e6e5 100644 --- a/apps/hash-frontend/src/pages/shared/entities-table/use-get-entities-table-additional-csv-data.ts +++ b/apps/hash-frontend/src/pages/shared/entities-table/use-get-entities-table-additional-csv-data.ts @@ -1,16 +1,13 @@ import { useLazyQuery } from "@apollo/client"; import type { EntityType, PropertyType } from "@blockprotocol/type-system"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { currentTimeInstantTemporalAxes, mapGqlSubgraphFieldsFragmentToSubgraph, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { stringifyPropertyValue } from "@local/hash-isomorphic-utils/stringify-property-value"; -import type { - Entity, - EntityRootType, - EntityTypeWithMetadata, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { getEntityTypeById, getRoots } from "@local/hash-subgraph/stdlib"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; diff --git a/apps/hash-frontend/src/pages/shared/entity-selector.tsx b/apps/hash-frontend/src/pages/shared/entity-selector.tsx index dffdc204bc1..444245d9837 100644 --- a/apps/hash-frontend/src/pages/shared/entity-selector.tsx +++ b/apps/hash-frontend/src/pages/shared/entity-selector.tsx @@ -4,6 +4,8 @@ import type { TypeListSelectorDropdownProps, } from "@hashintel/design-system"; import { Chip, SelectorAutocomplete } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import { currentTimeInstantTemporalAxes, @@ -11,13 +13,7 @@ import { mapGqlSubgraphFieldsFragmentToSubgraph, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; -import type { - Entity, - EntityId, - EntityRootType, - EntityTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { entityIdFromComponents, extractDraftIdFromEntityId, diff --git a/apps/hash-frontend/src/pages/shared/entity-type-page.tsx b/apps/hash-frontend/src/pages/shared/entity-type-page.tsx index 8e42528bc33..347697f3819 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-page.tsx +++ b/apps/hash-frontend/src/pages/shared/entity-type-page.tsx @@ -13,8 +13,10 @@ import { getFormDataFromEntityType, useEntityTypeForm, } from "@hashintel/type-editor"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { generateLinkMapWithConsistentSelfReferences } from "@local/hash-isomorphic-utils/ontology-types"; -import type { AccountId, BaseUrl, OwnedById } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import type { Theme } from "@mui/material"; import { Box, Container, Typography } from "@mui/material"; diff --git a/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab.tsx b/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab.tsx index 4de1efd6166..1d965e1d459 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab.tsx +++ b/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab.tsx @@ -1,7 +1,8 @@ import type { EntityTypeWithMetadata } from "@blockprotocol/graph"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import { EntityTypeEditor } from "@hashintel/type-editor"; -import type { OwnedById, PropertyTypeWithMetadata } from "@local/hash-subgraph"; +import type { PropertyTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { useMemo } from "react"; import { useEntityTypesContextRequired } from "../../../shared/entity-types-context/hooks/use-entity-types-context-required"; diff --git a/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab/use-editor-ontology-functions.ts b/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab/use-editor-ontology-functions.ts index ba7245d66c7..c103ec681f0 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab/use-editor-ontology-functions.ts +++ b/apps/hash-frontend/src/pages/shared/entity-type-page/definition-tab/use-editor-ontology-functions.ts @@ -5,9 +5,9 @@ import type { } from "@hashintel/type-editor"; import type { EntityTypeWithMetadata, - OwnedById, PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { getEntityTypeById, getPropertyTypeById, diff --git a/apps/hash-frontend/src/pages/shared/entity-type-page/type-slide-over-stack/type-slide-over-slide.tsx b/apps/hash-frontend/src/pages/shared/entity-type-page/type-slide-over-stack/type-slide-over-slide.tsx index 5921f0586ee..c8b204a11fe 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-page/type-slide-over-stack/type-slide-over-slide.tsx +++ b/apps/hash-frontend/src/pages/shared/entity-type-page/type-slide-over-stack/type-slide-over-slide.tsx @@ -16,7 +16,7 @@ import { getFormDataFromEntityType, useEntityTypeForm, } from "@hashintel/type-editor"; -import type { EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { componentsFromVersionedUrl } from "@local/hash-subgraph/type-system-patch"; import { Box, ButtonBase, Slide, Tooltip } from "@mui/material"; import type { FunctionComponent } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-value.tsx b/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-value.tsx index f53925970dc..7fc7e62f3bf 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-value.tsx +++ b/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-value.tsx @@ -5,15 +5,15 @@ import type { ValueOrArray, VersionedUrl, } from "@blockprotocol/type-system"; -import type { ConstructEntityTypeParams } from "@local/hash-isomorphic-utils/types"; +import type { AccountId } from "@local/hash-graph-types/account"; import type { - AccountId, BaseUrl, EntityTypeWithMetadata, - OwnedById, PropertyTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; +import type { ConstructEntityTypeParams } from "@local/hash-isomorphic-utils/types"; +import type { Subgraph } from "@local/hash-subgraph"; import { getEntityTypeById, getEntityTypesByBaseUrl, diff --git a/apps/hash-frontend/src/pages/shared/entity-type-selector.tsx b/apps/hash-frontend/src/pages/shared/entity-type-selector.tsx index af2e118c747..edc7beac9ff 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-selector.tsx +++ b/apps/hash-frontend/src/pages/shared/entity-type-selector.tsx @@ -5,7 +5,7 @@ import { LinkTypeIcon, SelectorAutocomplete, } from "@hashintel/design-system"; -import type { EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import type { BoxProps } from "@mui/material"; import { useMemo, useRef, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/flow-definitions-context.tsx b/apps/hash-frontend/src/pages/shared/flow-definitions-context.tsx index e8cd5a81b51..8b62d3fc731 100644 --- a/apps/hash-frontend/src/pages/shared/flow-definitions-context.tsx +++ b/apps/hash-frontend/src/pages/shared/flow-definitions-context.tsx @@ -1,3 +1,4 @@ +import type { EntityUuid } from "@local/hash-graph-types/entity"; import { automaticBrowserInferenceFlowDefinition, manualBrowserInferenceFlowDefinition, @@ -12,7 +13,6 @@ import { saveFileFromUrl, } from "@local/hash-isomorphic-utils/flows/example-flow-definitions"; import type { FlowDefinition } from "@local/hash-isomorphic-utils/flows/types"; -import type { EntityUuid } from "@local/hash-subgraph"; import type { PropsWithChildren } from "react"; import { createContext, useContext, useMemo, useState } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/link-label-with-source-and-destination.tsx b/apps/hash-frontend/src/pages/shared/link-label-with-source-and-destination.tsx index 1383bfd5808..4afbffdde70 100644 --- a/apps/hash-frontend/src/pages/shared/link-label-with-source-and-destination.tsx +++ b/apps/hash-frontend/src/pages/shared/link-label-with-source-and-destination.tsx @@ -4,12 +4,12 @@ import { Chip, EyeSlashIconRegular, } from "@hashintel/design-system"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; import type { Entity, EntityPropertyValue, EntityRootType, - EntityTypeWithMetadata, Subgraph, } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; diff --git a/apps/hash-frontend/src/pages/shared/top-context-bar.tsx b/apps/hash-frontend/src/pages/shared/top-context-bar.tsx index 01647c5a9f4..385f8d17c32 100644 --- a/apps/hash-frontend/src/pages/shared/top-context-bar.tsx +++ b/apps/hash-frontend/src/pages/shared/top-context-bar.tsx @@ -1,7 +1,8 @@ import { faCheck, faFile } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@hashintel/design-system"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { Entity, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import type { SxProps, Theme } from "@mui/material"; import { Box, diff --git a/apps/hash-frontend/src/pages/shared/top-context-bar/archived-item-banner.tsx b/apps/hash-frontend/src/pages/shared/top-context-bar/archived-item-banner.tsx index 5c9438042f6..d99fb620251 100644 --- a/apps/hash-frontend/src/pages/shared/top-context-bar/archived-item-banner.tsx +++ b/apps/hash-frontend/src/pages/shared/top-context-bar/archived-item-banner.tsx @@ -1,7 +1,8 @@ import { useMutation } from "@apollo/client"; import { faRotateRight } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@hashintel/design-system"; -import type { Entity, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { Entity } from "@local/hash-subgraph"; import { Box, Container, Typography } from "@mui/material"; import { formatDistance } from "date-fns"; import type { FunctionComponent } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/invite-account-form.tsx b/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/invite-account-form.tsx index abe290ed076..2ffdd508434 100644 --- a/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/invite-account-form.tsx +++ b/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/invite-account-form.tsx @@ -1,5 +1,8 @@ import { Autocomplete, Avatar } from "@hashintel/design-system"; -import type { AccountGroupId, AccountId } from "@local/hash-subgraph"; +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; import { autocompleteClasses, Box, diff --git a/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/share-entity-section.tsx b/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/share-entity-section.tsx index 6863fbf6236..4886f26af4e 100644 --- a/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/share-entity-section.tsx +++ b/apps/hash-frontend/src/pages/shared/top-context-bar/share-dropdown-menu/share-entity-section.tsx @@ -1,6 +1,10 @@ import { useMutation } from "@apollo/client"; +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; import { AuthorizationSubjectKind } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; -import type { AccountGroupId, AccountId, Entity } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { Box, Skeleton, Typography } from "@mui/material"; import type { FunctionComponent } from "react"; import { useCallback, useMemo } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/top-context-bar/util.ts b/apps/hash-frontend/src/pages/shared/top-context-bar/util.ts index 292b064bd17..6fdbe247e6e 100644 --- a/apps/hash-frontend/src/pages/shared/top-context-bar/util.ts +++ b/apps/hash-frontend/src/pages/shared/top-context-bar/util.ts @@ -1,4 +1,5 @@ -import type { Entity, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { Entity } from "@local/hash-subgraph"; export const isItemEntityType = ( item: Entity | EntityTypeWithMetadata, diff --git a/apps/hash-frontend/src/pages/shared/use-create-block-collection.ts b/apps/hash-frontend/src/pages/shared/use-create-block-collection.ts index 62f8b9a4f7b..17339c127fd 100644 --- a/apps/hash-frontend/src/pages/shared/use-create-block-collection.ts +++ b/apps/hash-frontend/src/pages/shared/use-create-block-collection.ts @@ -1,3 +1,4 @@ +import type { OwnedById } from "@local/hash-graph-types/web"; import { paragraphBlockComponentId } from "@local/hash-isomorphic-utils/blocks"; import { blockProtocolPropertyTypes, @@ -6,7 +7,6 @@ import { systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { BlockCollectionProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { OwnedById } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { generateKeyBetween } from "fractional-indexing"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/pages/shared/web-selector.tsx b/apps/hash-frontend/src/pages/shared/web-selector.tsx index 0145819829b..1a608756d70 100644 --- a/apps/hash-frontend/src/pages/shared/web-selector.tsx +++ b/apps/hash-frontend/src/pages/shared/web-selector.tsx @@ -3,7 +3,7 @@ import { Autocomplete, Avatar, } from "@hashintel/design-system"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { autocompleteClasses, Box, diff --git a/apps/hash-frontend/src/pages/shared/workspace-context.tsx b/apps/hash-frontend/src/pages/shared/workspace-context.tsx index 351244630a5..a8ee1d81cde 100644 --- a/apps/hash-frontend/src/pages/shared/workspace-context.tsx +++ b/apps/hash-frontend/src/pages/shared/workspace-context.tsx @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { FunctionComponent, ReactElement } from "react"; import { createContext, diff --git a/apps/hash-frontend/src/pages/signin.page.tsx b/apps/hash-frontend/src/pages/signin.page.tsx index ec823c7b7f8..f8f2d424266 100644 --- a/apps/hash-frontend/src/pages/signin.page.tsx +++ b/apps/hash-frontend/src/pages/signin.page.tsx @@ -1,6 +1,6 @@ import { TextField } from "@hashintel/design-system"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { frontendUrl } from "@local/hash-isomorphic-utils/environment"; -import type { OwnedById } from "@local/hash-subgraph"; import { Box, buttonClasses, styled, Typography } from "@mui/material"; import type { LoginFlow } from "@ory/client"; import { isUiNodeInputAttributes } from "@ory/integrations/ui"; diff --git a/apps/hash-frontend/src/pages/types/[[...type-kind]].page.tsx b/apps/hash-frontend/src/pages/types/[[...type-kind]].page.tsx index 56d12cf000a..0764cee335a 100644 --- a/apps/hash-frontend/src/pages/types/[[...type-kind]].page.tsx +++ b/apps/hash-frontend/src/pages/types/[[...type-kind]].page.tsx @@ -1,7 +1,5 @@ -import type { - DataTypeRootType, - DataTypeWithMetadata, -} from "@local/hash-subgraph"; +import type { DataTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { DataTypeRootType } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { Box, Container, Typography } from "@mui/material"; import type { GetServerSideProps } from "next"; diff --git a/apps/hash-frontend/src/pages/types/[[...type-kind]].page/types-table.tsx b/apps/hash-frontend/src/pages/types/[[...type-kind]].page/types-table.tsx index 0b981a9de9e..f3c44f11e84 100644 --- a/apps/hash-frontend/src/pages/types/[[...type-kind]].page/types-table.tsx +++ b/apps/hash-frontend/src/pages/types/[[...type-kind]].page/types-table.tsx @@ -5,12 +5,12 @@ import type { TextCell, } from "@glideapps/glide-data-grid"; import { GridCellKind } from "@glideapps/glide-data-grid"; -import { gridRowHeight } from "@local/hash-isomorphic-utils/data-grid"; import type { DataTypeWithMetadata, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import { gridRowHeight } from "@local/hash-isomorphic-utils/data-grid"; import { isExternalOntologyElementMetadata } from "@local/hash-subgraph"; import { Box, useTheme } from "@mui/material"; import { useRouter } from "next/router"; diff --git a/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.tsx b/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.tsx index 57c8986106d..20953a73c85 100644 --- a/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.tsx +++ b/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.tsx @@ -1,4 +1,4 @@ -import type { BaseUrl } from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { useRouter } from "next/router"; import type { NextPageWithLayout } from "../../../../shared/layout"; diff --git a/apps/hash-frontend/src/shared/account-pages-variables.ts b/apps/hash-frontend/src/shared/account-pages-variables.ts index b0358aded56..d49760c1008 100644 --- a/apps/hash-frontend/src/shared/account-pages-variables.ts +++ b/apps/hash-frontend/src/shared/account-pages-variables.ts @@ -1,10 +1,10 @@ +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, pageOrNotificationNotArchivedFilter, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import { pageEntityTypeFilter } from "@local/hash-isomorphic-utils/page-entity-type-ids"; -import type { OwnedById } from "@local/hash-subgraph"; export const getAccountPagesVariables = ({ ownedById, diff --git a/apps/hash-frontend/src/shared/entity-type-entities-context.ts b/apps/hash-frontend/src/shared/entity-type-entities-context.ts index 47fbcd97158..73285b6398c 100644 --- a/apps/hash-frontend/src/shared/entity-type-entities-context.ts +++ b/apps/hash-frontend/src/shared/entity-type-entities-context.ts @@ -4,12 +4,8 @@ import type { PropertyType, VersionedUrl, } from "@blockprotocol/type-system"; -import type { - BaseUrl, - Entity, - EntityRootType, - Subgraph, -} from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { createContext, useContext } from "react"; import type { GetEntitySubgraphQuery } from "../graphql/api-types.gen"; diff --git a/apps/hash-frontend/src/shared/entity-type-entities-context/use-entity-type-entities-context-value.tsx b/apps/hash-frontend/src/shared/entity-type-entities-context/use-entity-type-entities-context-value.tsx index 5872bfdb352..a76a89907d8 100644 --- a/apps/hash-frontend/src/shared/entity-type-entities-context/use-entity-type-entities-context-value.tsx +++ b/apps/hash-frontend/src/shared/entity-type-entities-context/use-entity-type-entities-context-value.tsx @@ -3,7 +3,7 @@ import type { PropertyType, VersionedUrl, } from "@blockprotocol/type-system"; -import type { BaseUrl } from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { getEntityTypeAndParentsById, getPropertyTypeById, diff --git a/apps/hash-frontend/src/shared/entity-types-context/hooks.ts b/apps/hash-frontend/src/shared/entity-types-context/hooks.ts index 33e8db8772b..7a2fb6ef97a 100644 --- a/apps/hash-frontend/src/shared/entity-types-context/hooks.ts +++ b/apps/hash-frontend/src/shared/entity-types-context/hooks.ts @@ -1,6 +1,9 @@ import type { VersionedUrl } from "@blockprotocol/type-system/dist/cjs"; import type { EntityType } from "@blockprotocol/type-system/slim"; -import type { BaseUrl, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { + BaseUrl, + EntityTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import { useMemo } from "react"; import { isTypeArchived } from "../is-archived"; diff --git a/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts b/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts index 00a1ad5c94f..0cf7a0cf476 100644 --- a/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts +++ b/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts @@ -1,5 +1,5 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; -import type { EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { getEntityTypes } from "@local/hash-subgraph/stdlib"; import { useCallback, useMemo, useRef, useState } from "react"; diff --git a/apps/hash-frontend/src/shared/entity-types-context/shared/context-types.ts b/apps/hash-frontend/src/shared/entity-types-context/shared/context-types.ts index 5e4df9ae2a7..aaafc9d4a50 100644 --- a/apps/hash-frontend/src/shared/entity-types-context/shared/context-types.ts +++ b/apps/hash-frontend/src/shared/entity-types-context/shared/context-types.ts @@ -1,9 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; -import type { - EntityTypeRootType, - EntityTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { EntityTypeRootType, Subgraph } from "@local/hash-subgraph"; export type EntityTypesContextValue = { entityTypes: EntityTypeWithMetadata[] | null; diff --git a/apps/hash-frontend/src/shared/entity-types-context/shared/is-special-entity-type.ts b/apps/hash-frontend/src/shared/entity-types-context/shared/is-special-entity-type.ts index a5b6168e6fc..8c60aab73e5 100644 --- a/apps/hash-frontend/src/shared/entity-types-context/shared/is-special-entity-type.ts +++ b/apps/hash-frontend/src/shared/entity-types-context/shared/is-special-entity-type.ts @@ -3,8 +3,8 @@ import type { EntityType, VersionedUrl, } from "@blockprotocol/type-system/dist/cjs"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { EntityTypeWithMetadata } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; export const getParentIds = ( diff --git a/apps/hash-frontend/src/shared/file-upload-context.tsx b/apps/hash-frontend/src/shared/file-upload-context.tsx index 38f48d66205..3d4f8525445 100644 --- a/apps/hash-frontend/src/shared/file-upload-context.tsx +++ b/apps/hash-frontend/src/shared/file-upload-context.tsx @@ -1,12 +1,9 @@ import { useMutation } from "@apollo/client"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { FileProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - Entity, - EntityId, - EntityPropertiesObject, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity, EntityPropertiesObject } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; import type { PropsWithChildren } from "react"; import { diff --git a/apps/hash-frontend/src/shared/is-archived.ts b/apps/hash-frontend/src/shared/is-archived.ts index c259010adf8..1bf8c50df9b 100644 --- a/apps/hash-frontend/src/shared/is-archived.ts +++ b/apps/hash-frontend/src/shared/is-archived.ts @@ -1,11 +1,11 @@ -import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; -import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { DataTypeWithMetadata, - Entity, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; +import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/shared"; +import type { Entity } from "@local/hash-subgraph"; import { isEntityPageEntity, isType } from "./is-of-type"; diff --git a/apps/hash-frontend/src/shared/is-of-type.ts b/apps/hash-frontend/src/shared/is-of-type.ts index fa8d3126546..df2caf465e5 100644 --- a/apps/hash-frontend/src/shared/is-of-type.ts +++ b/apps/hash-frontend/src/shared/is-of-type.ts @@ -1,10 +1,10 @@ -import { isPageEntityTypeId } from "@local/hash-isomorphic-utils/page-entity-type-ids"; import type { DataTypeWithMetadata, - Entity, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import { isPageEntityTypeId } from "@local/hash-isomorphic-utils/page-entity-type-ids"; +import type { Entity } from "@local/hash-subgraph"; export const isType = ( item: diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entities-list.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entities-list.tsx index 002e4de238c..ffc1d323242 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entities-list.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entities-list.tsx @@ -1,7 +1,7 @@ import { IconButton } from "@hashintel/design-system"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { blockProtocolHubOrigin } from "@local/hash-isomorphic-utils/blocks"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { OwnedById } from "@local/hash-subgraph"; import { isOwnedOntologyElementMetadata } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { Box, Collapse, Fade, Tooltip } from "@mui/material"; diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entity-type-list/entity-type-item.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entity-type-list/entity-type-item.tsx index b08dd108bfe..459f0709da1 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entity-type-list/entity-type-item.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-entity-type-list/entity-type-item.tsx @@ -3,7 +3,7 @@ import { IconButton, LinkTypeIcon, } from "@hashintel/design-system"; -import type { EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import type { BoxProps } from "@mui/material"; import { Box, styled, Tooltip, Typography } from "@mui/material"; diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/account-page-list.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/account-page-list.tsx index 7216c6e4d0a..eb142357c72 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/account-page-list.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/account-page-list.tsx @@ -20,7 +20,8 @@ import { verticalListSortingStrategy, } from "@dnd-kit/sortable"; import { IconButton } from "@hashintel/design-system"; -import type { EntityUuid, OwnedById } from "@local/hash-subgraph"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { extractEntityUuidFromEntityId, isEntityId, diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-menu.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-menu.tsx index 2ed733ff588..ea4b5a6fab9 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-menu.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-menu.tsx @@ -1,7 +1,7 @@ import { faFileAlt } from "@fortawesome/free-regular-svg-icons"; import { faArchive, faLink } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@hashintel/design-system"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { PopoverPosition } from "@mui/material"; import { ListItemIcon, ListItemText, Menu } from "@mui/material"; import type { PopupState } from "material-ui-popup-state/hooks"; diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-tree-item.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-tree-item.tsx index ef71b58b889..51037cde64d 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-tree-item.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/page-tree-item.tsx @@ -2,7 +2,7 @@ import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import type { DraggableAttributes } from "@dnd-kit/core"; import { faChevronRight, faEllipsis } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon, IconButton } from "@hashintel/design-system"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { PopoverPosition } from "@mui/material"; import { Box, Tooltip, Typography } from "@mui/material"; import { bindTrigger, usePopupState } from "material-ui-popup-state/hooks"; diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/utils.ts b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/utils.ts index 0550575ebad..f2c70cb75b9 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/utils.ts +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/account-page-list/utils.ts @@ -1,6 +1,6 @@ import type { UniqueIdentifier } from "@dnd-kit/core"; import { arrayMove } from "@dnd-kit/sortable"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { SimplePage } from "../../../../components/hooks/use-account-pages"; diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/workspace-switcher.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/workspace-switcher.tsx index b79ed4dcbcf..0b17d22fc1b 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/workspace-switcher.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/workspace-switcher.tsx @@ -1,6 +1,6 @@ import { faChevronDown } from "@fortawesome/free-solid-svg-icons"; import { Avatar, FontAwesomeIcon } from "@hashintel/design-system"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { Box, Divider, diff --git a/apps/hash-frontend/src/shared/page-icon-button.tsx b/apps/hash-frontend/src/shared/page-icon-button.tsx index 17afd1d2f5b..8b429825bd9 100644 --- a/apps/hash-frontend/src/shared/page-icon-button.tsx +++ b/apps/hash-frontend/src/shared/page-icon-button.tsx @@ -1,8 +1,8 @@ import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import { faFile } from "@fortawesome/free-regular-svg-icons"; import { FontAwesomeIcon } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { EntityId } from "@local/hash-subgraph"; import type { SxProps, Theme } from "@mui/material"; import type { MouseEventHandler } from "react"; import { useCallback } from "react"; diff --git a/apps/hash-frontend/src/shared/property-types-context.tsx b/apps/hash-frontend/src/shared/property-types-context.tsx index 35a151fba07..a2e44a1f666 100644 --- a/apps/hash-frontend/src/shared/property-types-context.tsx +++ b/apps/hash-frontend/src/shared/property-types-context.tsx @@ -1,6 +1,6 @@ import type { BaseUrl } from "@blockprotocol/type-system"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; -import type { PropertyTypeWithMetadata } from "@local/hash-subgraph"; +import type { PropertyTypeWithMetadata } from "@local/hash-graph-types/ontology"; import type { FunctionComponent, PropsWithChildren } from "react"; import { createContext, useContext, useMemo } from "react"; diff --git a/apps/hash-frontend/src/shared/readonly-mode.tsx b/apps/hash-frontend/src/shared/readonly-mode.tsx index daaad69068d..baf6516b5db 100644 --- a/apps/hash-frontend/src/shared/readonly-mode.tsx +++ b/apps/hash-frontend/src/shared/readonly-mode.tsx @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { useRouter } from "next/router"; import type { User } from "../lib/user-and-org"; diff --git a/apps/hash-frontend/src/shared/routing/route-page-info.tsx b/apps/hash-frontend/src/shared/routing/route-page-info.tsx index 79ffdc261c9..3d215bf761b 100644 --- a/apps/hash-frontend/src/shared/routing/route-page-info.tsx +++ b/apps/hash-frontend/src/shared/routing/route-page-info.tsx @@ -1,4 +1,4 @@ -import type { EntityUuid } from "@local/hash-subgraph"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import type { NextParsedUrlQuery } from "next/dist/server/request-meta"; import { useRouter } from "next/router"; import type { FunctionComponent, ReactNode } from "react"; diff --git a/apps/hash-frontend/src/shared/table-header.tsx b/apps/hash-frontend/src/shared/table-header.tsx index 7923e7b8dd2..2b5bcf54870 100644 --- a/apps/hash-frontend/src/shared/table-header.tsx +++ b/apps/hash-frontend/src/shared/table-header.tsx @@ -9,11 +9,13 @@ import { import type { AccountGroupId, AccountId, +} from "@local/hash-graph-types/account"; +import type { DataTypeWithMetadata, - Entity, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { Entity } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId, isBaseUrl, diff --git a/apps/hash-frontend/src/shared/table-header/bulk-actions-dropdown.tsx b/apps/hash-frontend/src/shared/table-header/bulk-actions-dropdown.tsx index 00d5688bade..5e3b1b1bbb7 100644 --- a/apps/hash-frontend/src/shared/table-header/bulk-actions-dropdown.tsx +++ b/apps/hash-frontend/src/shared/table-header/bulk-actions-dropdown.tsx @@ -2,10 +2,10 @@ import { useMutation } from "@apollo/client"; import { CaretDownSolidIcon, Chip } from "@hashintel/design-system"; import type { DataTypeWithMetadata, - Entity, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { Entity } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { Box, diff --git a/apps/hash-frontend/src/shared/use-actors.ts b/apps/hash-frontend/src/shared/use-actors.ts index 9e377dc6a7f..08613f3c02a 100644 --- a/apps/hash-frontend/src/shared/use-actors.ts +++ b/apps/hash-frontend/src/shared/use-actors.ts @@ -1,4 +1,5 @@ import { useQuery } from "@apollo/client"; +import type { AccountId } from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -7,7 +8,7 @@ import { } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { MachineProperties } from "@local/hash-isomorphic-utils/system-types/machine"; -import type { AccountId, EntityRootType } from "@local/hash-subgraph"; +import type { EntityRootType } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/shared/use-entity-icon.tsx b/apps/hash-frontend/src/shared/use-entity-icon.tsx index c0abbb720ba..3a2ec9e4456 100644 --- a/apps/hash-frontend/src/shared/use-entity-icon.tsx +++ b/apps/hash-frontend/src/shared/use-entity-icon.tsx @@ -1,10 +1,11 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import { AsteriskRegularIcon } from "@hashintel/design-system"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { isPageEntityTypeId } from "@local/hash-isomorphic-utils/page-entity-type-ids"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import type { PageProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { Entity, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { Box } from "@mui/material"; import type { ReactNode } from "react"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/shared/use-entity-type-entities.tsx b/apps/hash-frontend/src/shared/use-entity-type-entities.tsx index ca17e6f6d71..7c7405886d8 100644 --- a/apps/hash-frontend/src/shared/use-entity-type-entities.tsx +++ b/apps/hash-frontend/src/shared/use-entity-type-entities.tsx @@ -1,16 +1,13 @@ import { useQuery } from "@apollo/client"; import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, mapGqlSubgraphFieldsFragmentToSubgraph, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; -import type { - BaseUrl, - EntityRootType, - GraphResolveDepths, - OwnedById, -} from "@local/hash-subgraph"; +import type { EntityRootType, GraphResolveDepths } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { useMemo } from "react"; diff --git a/apps/hash-frontend/src/shared/use-update-page-icon.ts b/apps/hash-frontend/src/shared/use-update-page-icon.ts index 303e3ea0543..17c2bb8ede2 100644 --- a/apps/hash-frontend/src/shared/use-update-page-icon.ts +++ b/apps/hash-frontend/src/shared/use-update-page-icon.ts @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { useCallback } from "react"; import { useGetPageRefetchQueries } from "../components/hooks/shared/get-page-refetch-queries"; diff --git a/apps/hash-frontend/src/shared/use-user-or-org.ts b/apps/hash-frontend/src/shared/use-user-or-org.ts index 678f6eaabab..1dfde0eb124 100644 --- a/apps/hash-frontend/src/shared/use-user-or-org.ts +++ b/apps/hash-frontend/src/shared/use-user-or-org.ts @@ -1,4 +1,8 @@ import { useQuery } from "@apollo/client"; +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -12,8 +16,6 @@ import { import type { OrganizationProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; import type { - AccountGroupId, - AccountId, Entity, EntityRootType, GraphResolveDepths, diff --git a/apps/hash-frontend/src/shared/use-user-permissions-on-entity.ts b/apps/hash-frontend/src/shared/use-user-permissions-on-entity.ts index 9ebcb6f26ca..4c6857e3dff 100644 --- a/apps/hash-frontend/src/shared/use-user-permissions-on-entity.ts +++ b/apps/hash-frontend/src/shared/use-user-permissions-on-entity.ts @@ -1,10 +1,11 @@ import { useQuery } from "@apollo/client"; +import type { EntityMetadata } from "@local/hash-graph-types/entity"; import type { CheckUserPermissionsOnEntityQuery, CheckUserPermissionsOnEntityQueryVariables, } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; import { checkUserPermissionsOnEntityQuery } from "@local/hash-isomorphic-utils/graphql/queries/entity.queries"; -import type { Entity, EntityMetadata } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { useMemo } from "react"; export const useUserPermissionsOnEntity = ( diff --git a/apps/hash-integration-worker/src/linear-activities.ts b/apps/hash-integration-worker/src/linear-activities.ts index 55b6938f7ed..33fb9ef1a28 100644 --- a/apps/hash-integration-worker/src/linear-activities.ts +++ b/apps/hash-integration-worker/src/linear-activities.ts @@ -8,13 +8,11 @@ import type { UpdateLinearDataWorkflow, } from "@local/hash-backend-utils/temporal-integration-workflow-types"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { linearPropertyTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { - AccountId, - BaseUrl, - EntityId, - OwnedById, -} from "@local/hash-subgraph"; import { mapHashEntityToLinearUpdateInput, diff --git a/apps/hash-integration-worker/src/linear-activities/mappings.ts b/apps/hash-integration-worker/src/linear-activities/mappings.ts index 1e36251e153..b321e03fc22 100644 --- a/apps/hash-integration-worker/src/linear-activities/mappings.ts +++ b/apps/hash-integration-worker/src/linear-activities/mappings.ts @@ -7,10 +7,10 @@ import type { import { getLinearMappingByLinearType } from "@local/hash-backend-utils/linear-type-mappings"; import type { PartialEntity } from "@local/hash-backend-utils/temporal-integration-workflow-types"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; import type { - AccountId, Entity, - EntityId, EntityPropertiesObject, EntityPropertyValue, } from "@local/hash-subgraph"; diff --git a/apps/hash-integration-worker/src/shared/graph-requests.ts b/apps/hash-integration-worker/src/shared/graph-requests.ts index 324f977346c..77cde17d715 100644 --- a/apps/hash-integration-worker/src/shared/graph-requests.ts +++ b/apps/hash-integration-worker/src/shared/graph-requests.ts @@ -1,17 +1,15 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, } from "@local/hash-isomorphic-utils/graph-queries"; import { linearPropertyTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { - AccountId, - Entity, - EntityId, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/apps/plugin-browser/package.json b/apps/plugin-browser/package.json index 29de2c581d0..33ae651d862 100755 --- a/apps/plugin-browser/package.json +++ b/apps/plugin-browser/package.json @@ -30,6 +30,7 @@ "@hashintel/block-design-system": "0.0.2", "@hashintel/design-system": "0.0.8", "@local/advanced-types": "0.0.0-private", + "@local/hash-graph-types": "0.0.0-private", "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", "@mui/material": "5.14.11", diff --git a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/entity-type-selector.tsx b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/entity-type-selector.tsx index 32822540997..06a24c3ae6e 100644 --- a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/entity-type-selector.tsx +++ b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/entity-type-selector.tsx @@ -1,7 +1,10 @@ import type { VersionedUrl } from "@blockprotocol/graph"; import { Autocomplete, Chip, MenuItem } from "@hashintel/design-system"; import { typedEntries } from "@local/advanced-types/typed-entries"; -import type { BaseUrl, EntityTypeWithMetadata } from "@local/hash-subgraph"; +import type { + BaseUrl, + EntityTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import type { PopperProps } from "@mui/material"; import { outlinedInputClasses, Typography } from "@mui/material"; import { useMemo } from "react"; diff --git a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target.tsx b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target.tsx index d68eed943a2..24d5a2e908a 100644 --- a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target.tsx +++ b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target.tsx @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { SxProps, Theme } from "@mui/material"; import { FormControlLabel, Radio, RadioGroup, Stack } from "@mui/material"; diff --git a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target/web-selector.tsx b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target/web-selector.tsx index df3b6f6dc23..d278e059c42 100644 --- a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target/web-selector.tsx +++ b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/select-web-target/web-selector.tsx @@ -1,5 +1,5 @@ import { Autocomplete, MenuItem } from "@hashintel/design-system"; -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { Stack, Typography } from "@mui/material"; import type { ReactElement } from "react"; diff --git a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/use-flow-runs.ts b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/use-flow-runs.ts index 3fac8aab491..e72007c7528 100644 --- a/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/use-flow-runs.ts +++ b/apps/plugin-browser/src/pages/popup/popup-contents/action-center/shared/use-flow-runs.ts @@ -1,3 +1,4 @@ +import type { AccountId } from "@local/hash-graph-types/account"; import { automaticBrowserInferenceFlowDefinition, manualBrowserInferenceFlowDefinition, @@ -9,7 +10,6 @@ import type { ManualInferenceTriggerInputName, } from "@local/hash-isomorphic-utils/flows/browser-plugin-flow-types"; import type { PayloadKindValues } from "@local/hash-isomorphic-utils/flows/types"; -import type { AccountId } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { useEffect, useMemo, useState } from "react"; diff --git a/apps/plugin-browser/src/shared/create-default-settings.ts b/apps/plugin-browser/src/shared/create-default-settings.ts index 0da7abe61fb..e00522c34aa 100644 --- a/apps/plugin-browser/src/shared/create-default-settings.ts +++ b/apps/plugin-browser/src/shared/create-default-settings.ts @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { defaultProductionRules } from "../pages/popup/popup-contents/action-center/default-production-rules"; import type { PersistedUserSettings } from "./storage"; diff --git a/apps/plugin-browser/src/shared/create-entity.ts b/apps/plugin-browser/src/shared/create-entity.ts index c926fd1b2ef..8b5f58e5189 100644 --- a/apps/plugin-browser/src/shared/create-entity.ts +++ b/apps/plugin-browser/src/shared/create-entity.ts @@ -1,9 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/graph"; -import type { - Entity, - EntityPropertiesObject, - LinkData, -} from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity, EntityPropertiesObject } from "@local/hash-subgraph"; import type { CreateEntityMutation, diff --git a/apps/plugin-browser/src/shared/get-user.ts b/apps/plugin-browser/src/shared/get-user.ts index dc60ab014fb..196a8e54aa1 100644 --- a/apps/plugin-browser/src/shared/get-user.ts +++ b/apps/plugin-browser/src/shared/get-user.ts @@ -1,3 +1,6 @@ +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { FeatureFlag } from "@local/hash-isomorphic-utils/feature-flags"; import { mapGqlSubgraphFieldsFragmentToSubgraph } from "@local/hash-isomorphic-utils/graph-queries"; import { @@ -11,14 +14,7 @@ import type { OrganizationProperties, } from "@local/hash-isomorphic-utils/system-types/shared"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; -import type { - Entity, - EntityId, - EntityRootType, - OwnedById, - Subgraph, - Timestamp, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { getOutgoingLinkAndTargetEntities, getRoots, diff --git a/apps/plugin-browser/src/shared/messages.ts b/apps/plugin-browser/src/shared/messages.ts index 5712fa0889c..54d5c2d7b29 100644 --- a/apps/plugin-browser/src/shared/messages.ts +++ b/apps/plugin-browser/src/shared/messages.ts @@ -1,6 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/graph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { InferenceModelName } from "@local/hash-isomorphic-utils/ai-inference-types"; -import type { OwnedById } from "@local/hash-subgraph"; export type InferEntitiesRequest = { createAs: "draft" | "live"; diff --git a/apps/plugin-browser/src/shared/storage.ts b/apps/plugin-browser/src/shared/storage.ts index 51e6fdff56e..cfda3b9ddc7 100644 --- a/apps/plugin-browser/src/shared/storage.ts +++ b/apps/plugin-browser/src/shared/storage.ts @@ -1,5 +1,8 @@ import type { VersionedUrl } from "@blockprotocol/graph"; import type { Subtype } from "@local/advanced-types/subtype"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ExternalInputWebsocketRequestMessage, InferenceModelName, @@ -23,10 +26,7 @@ import type { import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; import type { Entity, - EntityId, EntityTypeRootType, - EntityTypeWithMetadata, - OwnedById, Subgraph, } from "@local/hash-subgraph"; import debounce from "lodash.debounce"; diff --git a/apps/plugin-browser/src/shared/storage/update-entity.ts b/apps/plugin-browser/src/shared/storage/update-entity.ts index ff64ceb5a5f..86c91c76f31 100644 --- a/apps/plugin-browser/src/shared/storage/update-entity.ts +++ b/apps/plugin-browser/src/shared/storage/update-entity.ts @@ -1,9 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/graph"; -import type { - Entity, - EntityId, - EntityPropertiesObject, -} from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Entity, EntityPropertiesObject } from "@local/hash-subgraph"; import type { UpdateEntityMutation, diff --git a/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts b/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts index 64e2ef956d9..26caf1760b7 100644 --- a/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts +++ b/libs/@local/hash-backend-utils/flows/get-flow-run-details.ts @@ -1,3 +1,4 @@ +import type { OwnedById } from "@local/hash-graph-types/web"; import type { ExternalInputRequest, ExternalInputRequestSignal, @@ -12,7 +13,6 @@ import type { StepRun, } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; import { FlowStepStatus } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; -import type { OwnedById } from "@local/hash-subgraph"; import { StatusCode } from "@local/status"; import type { Client as TemporalClient } from "@temporalio/client"; import proto from "@temporalio/proto"; diff --git a/libs/@local/hash-backend-utils/src/error.ts b/libs/@local/hash-backend-utils/src/error.ts index edbcbebd09c..bef0547f9a9 100644 --- a/libs/@local/hash-backend-utils/src/error.ts +++ b/libs/@local/hash-backend-utils/src/error.ts @@ -1,5 +1,5 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; -import type { BaseUrl } from "@local/hash-subgraph"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; export class EntityTypeMismatchError extends Error { entityId: string; diff --git a/libs/@local/hash-backend-utils/src/file-storage.ts b/libs/@local/hash-backend-utils/src/file-storage.ts index 04351cc8b8f..5eea06bb476 100644 --- a/libs/@local/hash-backend-utils/src/file-storage.ts +++ b/libs/@local/hash-backend-utils/src/file-storage.ts @@ -1,8 +1,9 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { apiOrigin } from "@local/hash-isomorphic-utils/environment"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { FileProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { Entity, EntityId } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import type { DataSource } from "apollo-datasource"; export const storageTypes = ["AWS_S3", "LOCAL_FILE_SYSTEM"] as const; diff --git a/libs/@local/hash-backend-utils/src/flows.ts b/libs/@local/hash-backend-utils/src/flows.ts index e69d7e60e8a..bf0d4a17654 100644 --- a/libs/@local/hash-backend-utils/src/flows.ts +++ b/libs/@local/hash-backend-utils/src/flows.ts @@ -1,5 +1,8 @@ import type { TemporalClient } from "@local/hash-backend-utils/temporal"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { SparseFlowRun } from "@local/hash-isomorphic-utils/flows/types"; import { currentTimeInstantTemporalAxes, @@ -15,13 +18,7 @@ import { } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { FlowRunProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - AccountId, - Entity, - EntityId, - EntityUuid, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId, extractOwnedByIdFromEntityId, diff --git a/libs/@local/hash-backend-utils/src/google.ts b/libs/@local/hash-backend-utils/src/google.ts index 13a4696e512..bb4d4f89dee 100644 --- a/libs/@local/hash-backend-utils/src/google.ts +++ b/libs/@local/hash-backend-utils/src/google.ts @@ -1,5 +1,7 @@ import { getSecretEntitiesForIntegration } from "@local/hash-backend-utils/user-secret"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -8,12 +10,7 @@ import { import { googleEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { AccountProperties as GoogleAccountProperties } from "@local/hash-isomorphic-utils/system-types/google/account"; -import type { - AccountId, - Entity, - EntityId, - EntityRootType, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import type { Auth } from "googleapis"; import { google } from "googleapis"; diff --git a/libs/@local/hash-backend-utils/src/hash-instance.ts b/libs/@local/hash-backend-utils/src/hash-instance.ts index f4cb8e22854..ebeea9cad21 100644 --- a/libs/@local/hash-backend-utils/src/hash-instance.ts +++ b/libs/@local/hash-backend-utils/src/hash-instance.ts @@ -4,6 +4,10 @@ import { } from "@local/hash-backend-utils/error"; import { getMachineActorId } from "@local/hash-backend-utils/machine-actors"; import type { GraphApi } from "@local/hash-graph-client"; +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -13,7 +17,7 @@ import type { SimpleProperties } from "@local/hash-isomorphic-utils/simplify-pro import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; import { mapGraphApiEntityToEntity } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { HASHInstanceProperties } from "@local/hash-isomorphic-utils/system-types/hashinstance"; -import type { AccountGroupId, AccountId, Entity } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; export type HashInstance = { entity: Entity; diff --git a/libs/@local/hash-backend-utils/src/linear-type-mappings.ts b/libs/@local/hash-backend-utils/src/linear-type-mappings.ts index f107963f89c..d7bc8fc1ef9 100644 --- a/libs/@local/hash-backend-utils/src/linear-type-mappings.ts +++ b/libs/@local/hash-backend-utils/src/linear-type-mappings.ts @@ -6,6 +6,7 @@ import type { UpdateOrganizationInput, UpdateUserInput, } from "@linear/sdk/dist/_generated_documents"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { blockProtocolPropertyTypes, linearEntityTypes, @@ -13,11 +14,7 @@ import { linearPropertyTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { - BaseUrl, - Entity, - EntityPropertyValue, -} from "@local/hash-subgraph"; +import type { Entity, EntityPropertyValue } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; const mapLinearDateToIsoString = (date: string | Date): string => { diff --git a/libs/@local/hash-backend-utils/src/machine-actors.ts b/libs/@local/hash-backend-utils/src/machine-actors.ts index ecd379407ce..30d36221e44 100644 --- a/libs/@local/hash-backend-utils/src/machine-actors.ts +++ b/libs/@local/hash-backend-utils/src/machine-actors.ts @@ -1,6 +1,9 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import { NotFoundError } from "@local/hash-backend-utils/error"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityMetadata } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes, @@ -12,11 +15,6 @@ import { mapGraphApiEntityToEntity, } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { MachineProperties } from "@local/hash-isomorphic-utils/system-types/machine"; -import type { - AccountId, - EntityMetadata, - OwnedById, -} from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; export type WebMachineActorIdentifier = `system-${OwnedById}`; diff --git a/libs/@local/hash-backend-utils/src/notifications.ts b/libs/@local/hash-backend-utils/src/notifications.ts index a0001acaaee..b602d027d1e 100644 --- a/libs/@local/hash-backend-utils/src/notifications.ts +++ b/libs/@local/hash-backend-utils/src/notifications.ts @@ -1,17 +1,15 @@ import { getWebMachineActorId } from "@local/hash-backend-utils/machine-actors"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { systemEntityTypes, systemLinkEntityTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; -import type { - AccountId, - EntityId, - EntityRelationAndSubject, - OwnedById, - Timestamp, -} from "@local/hash-subgraph"; +import type { EntityRelationAndSubject } from "@local/hash-subgraph"; export const createNotificationEntityPermissions = ({ machineActorId, diff --git a/libs/@local/hash-backend-utils/src/pg-tables.ts b/libs/@local/hash-backend-utils/src/pg-tables.ts index d28d9bf3e3d..9d45ab20f08 100644 --- a/libs/@local/hash-backend-utils/src/pg-tables.ts +++ b/libs/@local/hash-backend-utils/src/pg-tables.ts @@ -3,7 +3,8 @@ * names are converted from snake_case to camelCase for consistency. */ import type { JsonObject } from "@blockprotocol/core"; -import type { EditionCreatedById, Uuid } from "@local/hash-subgraph"; +import type { EditionCreatedById } from "@local/hash-graph-types/account"; +import type { Uuid } from "@local/hash-graph-types/branded"; import type { Wal2JsonMsg } from "./wal2json"; diff --git a/libs/@local/hash-backend-utils/src/public-user-account-id.ts b/libs/@local/hash-backend-utils/src/public-user-account-id.ts index 44032a697ff..5b5c644ffa8 100644 --- a/libs/@local/hash-backend-utils/src/public-user-account-id.ts +++ b/libs/@local/hash-backend-utils/src/public-user-account-id.ts @@ -1,4 +1,4 @@ -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; // nosemgrep: export const publicUserAccountId: AccountId = diff --git a/libs/@local/hash-backend-utils/src/service-usage.ts b/libs/@local/hash-backend-utils/src/service-usage.ts index c2038810287..084f9d58b09 100644 --- a/libs/@local/hash-backend-utils/src/service-usage.ts +++ b/libs/@local/hash-backend-utils/src/service-usage.ts @@ -1,5 +1,9 @@ import { getHashInstanceAdminAccountGroupId } from "@local/hash-backend-utils/hash-instance"; import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; +import type { BoundedTimeInterval } from "@local/hash-graph-types/temporal-versioning"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; import { currentTimeInstantTemporalAxes, @@ -20,13 +24,9 @@ import { import type { ServiceFeatureProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { UsageRecordProperties } from "@local/hash-isomorphic-utils/system-types/usagerecord"; import type { - AccountId, - BoundedTimeInterval, Entity, EntityRelationAndSubject, EntityRootType, - EntityUuid, - OwnedById, } from "@local/hash-subgraph"; import { entityIdFromComponents } from "@local/hash-subgraph"; import { diff --git a/libs/@local/hash-backend-utils/src/simplified-graph.ts b/libs/@local/hash-backend-utils/src/simplified-graph.ts index 635b5f3172d..d0156adff6c 100644 --- a/libs/@local/hash-backend-utils/src/simplified-graph.ts +++ b/libs/@local/hash-backend-utils/src/simplified-graph.ts @@ -4,7 +4,8 @@ import { typedKeys, typedValues, } from "@local/advanced-types/typed-entries"; -import type { Entity, EntityId, Subgraph } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Entity, Subgraph } from "@local/hash-subgraph"; import { extractDraftIdFromEntityId, extractOwnedByIdFromEntityId, diff --git a/libs/@local/hash-backend-utils/src/temporal-integration-workflow-types.ts b/libs/@local/hash-backend-utils/src/temporal-integration-workflow-types.ts index 65632e8f092..5b6bc703cf9 100644 --- a/libs/@local/hash-backend-utils/src/temporal-integration-workflow-types.ts +++ b/libs/@local/hash-backend-utils/src/temporal-integration-workflow-types.ts @@ -1,11 +1,9 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { Team } from "@linear/sdk"; -import type { - AccountId, - Entity, - EntityId, - OwnedById, -} from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; +import type { Entity } from "@local/hash-subgraph"; export type PartialEntity = { properties: Partial; diff --git a/libs/@local/hash-backend-utils/src/user-secret.ts b/libs/@local/hash-backend-utils/src/user-secret.ts index 4244c5b4901..bce74a96fc0 100644 --- a/libs/@local/hash-backend-utils/src/user-secret.ts +++ b/libs/@local/hash-backend-utils/src/user-secret.ts @@ -1,4 +1,6 @@ import type { GraphApi } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { currentTimeInstantTemporalAxes, generateVersionedUrlMatchingFilter, @@ -11,12 +13,7 @@ import { import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; import type { UsesUserSecretProperties } from "@local/hash-isomorphic-utils/system-types/google/shared"; import type { UserSecretProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - AccountId, - Entity, - EntityId, - EntityRootType, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { getEntityRevision, getRoots } from "@local/hash-subgraph/stdlib"; diff --git a/libs/@local/hash-backend-utils/src/vault.ts b/libs/@local/hash-backend-utils/src/vault.ts index 75c161ba532..18281ee982f 100644 --- a/libs/@local/hash-backend-utils/src/vault.ts +++ b/libs/@local/hash-backend-utils/src/vault.ts @@ -1,4 +1,4 @@ -import type { AccountId } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; import type { AxiosError, AxiosInstance } from "axios"; import axios from "axios"; diff --git a/libs/@local/hash-graph-sdk/typescript/package.json b/libs/@local/hash-graph-sdk/typescript/package.json index 369c803c605..0138fc6bb73 100644 --- a/libs/@local/hash-graph-sdk/typescript/package.json +++ b/libs/@local/hash-graph-sdk/typescript/package.json @@ -6,10 +6,13 @@ "license": "AGPL-3.0", "type": "module", "exports": { - ".": { - "types": "./src/*.ts", - "node": "./src/*.ts", - "default": "./src/*.ts" + "./*": "./src/*.ts" + }, + "typesVersions": { + "*": { + "*": [ + "./src/*.ts" + ] } }, "scripts": { @@ -20,7 +23,7 @@ }, "dependencies": { "@local/hash-graph-client": "0.0.0-private", - "@local/hash-subgraph": "0.0.0-private" + "@local/hash-graph-types": "0.0.0-private" }, "devDependencies": { "@local/eslint-config": "0.0.0-private", diff --git a/libs/@local/hash-graph-sdk/typescript/src/entity.ts b/libs/@local/hash-graph-sdk/typescript/src/entity.ts index afebf58102d..f14233130a6 100644 --- a/libs/@local/hash-graph-sdk/typescript/src/entity.ts +++ b/libs/@local/hash-graph-sdk/typescript/src/entity.ts @@ -1,5 +1,5 @@ import type { Entity as GraphApiEntity } from "@local/hash-graph-client/api"; -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; export class Entity { #entity: GraphApiEntity; diff --git a/libs/@local/hash-graph-types/typescript/.eslintrc.cjs b/libs/@local/hash-graph-types/typescript/.eslintrc.cjs new file mode 100644 index 00000000000..ae0bc9befab --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/.eslintrc.cjs @@ -0,0 +1,7 @@ +/** @type {import("eslint").Linter.Config} */ +module.exports = { + ...require("@local/eslint-config/generate-workspace-config.cjs")(__dirname), + rules: { + "global-require": "off", + }, +}; diff --git a/libs/@local/hash-graph-types/typescript/LICENSE.md b/libs/@local/hash-graph-types/typescript/LICENSE.md new file mode 100644 index 00000000000..c7d627721e2 --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/LICENSE.md @@ -0,0 +1,607 @@ +GNU Affero General Public License +================================= + +_Version 3, 19 November 2007_ +_Copyright © 2007 Free Software Foundation, Inc. <>_ + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +## Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: **(1)** assert copyright on the software, and **(2)** offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +## TERMS AND CONDITIONS + +### 0. Definitions + +“This License” refers to version 3 of the GNU Affero General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based +on the Program. + +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that **(1)** displays an appropriate copyright notice, and **(2)** +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +### 1. Source Code + +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work. + +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other +than the work as a whole, that **(a)** is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and **(b)** serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + +The Corresponding Source for a work in source code form is that +same work. + +### 2. Basic Permissions + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + +### 4. Conveying Verbatim Copies + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + +* **a)** The work must carry prominent notices stating that you modified +it, and giving a relevant date. +* **b)** The work must carry prominent notices stating that it is +released under this License and any conditions added under section 7. +This requirement modifies the requirement in section 4 to +“keep intact all notices”. +* **c)** You must license the entire work, as a whole, under this +License to anyone who comes into possession of a copy. This +License will therefore apply, along with any applicable section 7 +additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no +permission to license the work in any other way, but it does not +invalidate such permission if you have separately received it. +* **d)** If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your +work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +### 6. Conveying Non-Source Forms + +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + +* **a)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium +customarily used for software interchange. +* **b)** Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a +written offer, valid for at least three years and valid for as +long as you offer spare parts or customer support for that product +model, to give anyone who possesses the object code either **(1)** a +copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical +medium customarily used for software interchange, for a price no +more than your reasonable cost of physically performing this +conveying of source, or **(2)** access to copy the +Corresponding Source from a network server at no charge. +* **c)** Convey individual copies of the object code with a copy of the +written offer to provide the Corresponding Source. This +alternative is allowed only occasionally and noncommercially, and +only if you received the object code with such an offer, in accord +with subsection 6b. +* **d)** Convey the object code by offering access from a designated +place (gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to +copy the object code is a network server, the Corresponding Source +may be on a different server (operated by you or a third party) +that supports equivalent copying facilities, provided you maintain +clear directions next to the object code saying where to find the +Corresponding Source. Regardless of what server hosts the +Corresponding Source, you remain obligated to ensure that it is +available for as long as needed to satisfy these requirements. +* **e)** Convey the object code using peer-to-peer transmission, provided +you inform other peers where the object code and Corresponding +Source of the work are being offered to the general public at no +charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A “User Product” is either **(1)** a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or **(2)** anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +### 7. Additional Terms + +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + +* **a)** Disclaiming warranty or limiting liability differently from the +terms of sections 15 and 16 of this License; or +* **b)** Requiring preservation of specified reasonable legal notices or +author attributions in that material or in the Appropriate Legal +Notices displayed by works containing it; or +* **c)** Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or +* **d)** Limiting the use for publicity purposes of names of licensors or +authors of the material; or +* **e)** Declining to grant rights under trademark law for use of some +trade names, trademarks, or service marks; or +* **f)** Requiring indemnification of licensors and authors of that +material by anyone who conveys the material (or modified versions of +it) with contractual assumptions of liability to the recipient, for +any liability that these contractual assumptions directly impose on +those licensors and authors. + +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + +### 8. Termination + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated **(a)** +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and **(b)** permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +### 9. Acceptance Not Required for Having Copies + +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +### 11. Patents + +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either **(1)** cause the Corresponding Source to be so +available, or **(2)** arrange to deprive yourself of the benefit of the +patent license for this particular work, or **(3)** arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license **(a)** in connection with copies of the covered work +conveyed by you (or copies made from those copies), or **(b)** primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +### 12. No Surrender of Others' Freedom + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + +### 13. Remote Network Interaction; Use with the GNU General Public License + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +### 14. Revised Versions of this License + +The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +### 15. Disclaimer of Warranty + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +### 16. Limitation of Liability + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16 + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. diff --git a/libs/@local/hash-graph-types/typescript/package.json b/libs/@local/hash-graph-types/typescript/package.json new file mode 100644 index 00000000000..ff95d9fb50f --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/package.json @@ -0,0 +1,35 @@ +{ + "name": "@local/hash-graph-types", + "version": "0.0.0-private", + "private": true, + "description": "Type definitions for the HASH Graph.", + "license": "AGPL-3.0", + "type": "module", + "exports": { + "./*": "./src/*.ts" + }, + "typesVersions": { + "*": { + "*": [ + "./src/*.ts" + ] + } + }, + "scripts": { + "fix:eslint": "eslint --fix .", + "lint:eslint": "eslint --report-unused-disable-directives .", + "lint:tsc": "tsc --noEmit" + }, + "dependencies": { + "@blockprotocol/graph": "0.3.4", + "@blockprotocol/type-system": "0.1.1", + "@local/advanced-types": "0.0.0-private", + "@local/hash-graph-client": "0.0.0-private" + }, + "devDependencies": { + "@local/eslint-config": "0.0.0-private", + "@local/tsconfig": "0.0.0-private", + "eslint": "8.57.0", + "typescript": "5.1.6" + } +} diff --git a/libs/@local/hash-graph-types/typescript/src/account.ts b/libs/@local/hash-graph-types/typescript/src/account.ts new file mode 100644 index 00000000000..8eeff442e9f --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/src/account.ts @@ -0,0 +1,18 @@ +import type { Brand } from "@local/advanced-types/brand"; + +import type { Uuid } from "./branded"; + +/** An ID to uniquely identify an account (e.g. a User) */ +export type AccountId = Brand; + +/** An ID to uniquely identify an account group (e.g. an Org) */ +export type AccountGroupId = Brand; + +/** An account ID of creating actor */ +export type CreatedById = Brand; + +/** An account ID of an actor that has created a specific edition */ +export type EditionCreatedById = Brand; + +/** An account ID of an actor that has archived an edition */ +export type EditionArchivedById = Brand; diff --git a/libs/@local/hash-graph-types/typescript/src/authorization.ts b/libs/@local/hash-graph-types/typescript/src/authorization.ts new file mode 100644 index 00000000000..6a4bc5a3fb3 --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/src/authorization.ts @@ -0,0 +1,4 @@ +import type { AccountGroupId, AccountId } from "./account"; + +/** An ID to uniquely identify an authorization subject (either a User or an Org) */ +export type AuthorizationSubjectId = AccountId | AccountGroupId; diff --git a/libs/@local/hash-graph-types/typescript/src/branded.ts b/libs/@local/hash-graph-types/typescript/src/branded.ts new file mode 100644 index 00000000000..836b885cc22 --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/src/branded.ts @@ -0,0 +1,4 @@ +import type { Brand } from "@local/advanced-types/brand"; + +/** Valid Uuids of the system */ +export type Uuid = Brand; diff --git a/libs/@local/hash-graph-types/typescript/src/entity.ts b/libs/@local/hash-graph-types/typescript/src/entity.ts new file mode 100644 index 00000000000..b944ee1eb10 --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/src/entity.ts @@ -0,0 +1,104 @@ +import type { + EntityMetadata as EntityMetadataBp, + EntityRecordId as EntityRecordIdBp, + EntityTemporalVersioningMetadata as EntityTemporalVersioningMetadataBp, + LinkData as LinkDataBp, +} from "@blockprotocol/graph/temporal"; +import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { Brand } from "@local/advanced-types/brand"; +import type { Subtype } from "@local/advanced-types/subtype"; +import type { + ActorType, + PropertyMetadataMap, + ProvidedEntityEditionProvenanceOrigin, + SourceProvenance, +} from "@local/hash-graph-client"; + +import type { + CreatedById, + EditionArchivedById, + EditionCreatedById, +} from "./account"; +import type { Uuid } from "./branded"; +import type { + CreatedAtDecisionTime, + CreatedAtTransactionTime, + ExclusiveLimitedTemporalBound, + InclusiveLimitedTemporalBound, + TemporalAxis, + TimeInterval, + Unbounded, +} from "./temporal-versioning"; +import type { OwnedById } from "./web"; + +/** A `Uuid` that points to an Entity without any edition */ +export type EntityUuid = Brand; + +/** The draft identifier for an entity */ +export type DraftId = Brand; + +export const ENTITY_ID_DELIMITER = "~"; + +/** An ID to uniquely identify an entity */ +export type EntityId = Brand< + `${OwnedById}${typeof ENTITY_ID_DELIMITER}${EntityUuid}`, + "EntityId" +>; + +export type EntityRecordId = Subtype< + EntityRecordIdBp, + { + entityId: EntityId; + editionId: string; + } +>; + +type HalfClosedInterval = TimeInterval< + InclusiveLimitedTemporalBound, + ExclusiveLimitedTemporalBound | Unbounded +>; + +export type EntityTemporalVersioningMetadata = Subtype< + EntityTemporalVersioningMetadataBp, + Record +>; + +export type EntityMetadata = Subtype< + EntityMetadataBp, + { + recordId: EntityRecordId; + entityTypeId: VersionedUrl; + temporalVersioning: EntityTemporalVersioningMetadata; + archived: boolean; + provenance: EntityProvenance; + confidence?: number; + properties?: PropertyMetadataMap; + } +>; + +export type LinkData = Subtype< + LinkDataBp, + { + leftEntityId: EntityId; + rightEntityId: EntityId; + leftEntityConfidence?: number; + rightEntityConfidence?: number; + } +>; + +export type EntityProvenance = { + createdById: CreatedById; + createdAtTransactionTime: CreatedAtTransactionTime; + createdAtDecisionTime: CreatedAtDecisionTime; + edition: EntityEditionProvenance; + firstNonDraftCreatedAtDecisionTime?: CreatedAtDecisionTime; + firstNonDraftCreatedAtTransactionTime?: CreatedAtTransactionTime; +}; + +export type EntityEditionProvenance = { + createdById: EditionCreatedById; + archivedById?: EditionArchivedById; + actorType?: ActorType; + origin?: ProvidedEntityEditionProvenanceOrigin; + sources?: Array; +}; diff --git a/libs/@local/hash-graph-types/typescript/src/ontology.ts b/libs/@local/hash-graph-types/typescript/src/ontology.ts new file mode 100644 index 00000000000..199cbcc6c40 --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/src/ontology.ts @@ -0,0 +1,242 @@ +import type { + DataTypeWithMetadata as DataTypeWithMetadataBp, + EntityTypeWithMetadata as EntityTypeWithMetadataBp, + OntologyElementMetadata as OntologyElementMetadataBp, + PropertyTypeWithMetadata as PropertyTypeWithMetadataBp, +} from "@blockprotocol/graph/temporal"; +import type { + BaseUrl as BaseUrlBp, + DataType, + EntityType, + PropertyType, + VersionedUrl, +} from "@blockprotocol/type-system/slim"; +import type { Brand } from "@local/advanced-types/brand"; +import type { DistributiveOmit } from "@local/advanced-types/distribute"; +import type { Subtype } from "@local/advanced-types/subtype"; +import type { + ActorType, + ProvidedEntityEditionProvenanceOrigin, + SourceProvenance, +} from "@local/hash-graph-client"; + +import type { EditionArchivedById, EditionCreatedById } from "./account"; +import type { + ExclusiveLimitedTemporalBound, + InclusiveLimitedTemporalBound, + TimeInterval, + Timestamp, + Unbounded, +} from "./temporal-versioning"; +import type { OwnedById } from "./web"; + +export type BaseUrl = Brand; + +export type OntologyProvenance = { + edition: OntologyEditionProvenance; +}; + +export type OntologyEditionProvenance = { + createdById: EditionCreatedById; + archivedById?: EditionArchivedById; + actorType?: ActorType; + origin?: ProvidedEntityEditionProvenanceOrigin; + sources?: Array; +}; + +export type OntologyTypeRecordId = { + baseUrl: BaseUrl; + version: number; +}; + +/** @todo-0.3 - Consider redefining `EntityType` and `PropertyType` to use the branded `BaseUrl`s inside them */ + +export type OwnedOntologyElementMetadata = { + recordId: OntologyTypeRecordId; + ownedById: OwnedById; + provenance: OntologyProvenance; + temporalVersioning: { + transactionTime: TimeInterval< + InclusiveLimitedTemporalBound, + ExclusiveLimitedTemporalBound | Unbounded + >; + }; +}; + +export type ExternalOntologyElementMetadata = { + recordId: OntologyTypeRecordId; + fetchedAt: Timestamp; + provenance: OntologyProvenance; + temporalVersioning: { + transactionTime: TimeInterval< + InclusiveLimitedTemporalBound, + ExclusiveLimitedTemporalBound | Unbounded + >; + }; +}; + +type OntologyElementMetadata = Subtype< + OntologyElementMetadataBp, + OwnedOntologyElementMetadata | ExternalOntologyElementMetadata +>; + +/** + * Non-exhaustive list of possible values for 'format' + * + * The presence of a format in this list does _NOT_ mean that: + * 1. The Graph will validate it + * 2. The frontend will treat it differently for input or display + * + * @see https://json-schema.org/understanding-json-schema/reference/string + */ +type StringFormat = + | "date" + | "time" + | "date-time" + | "duration" + | "email" + | "hostname" + | "ipv4" + | "ipv6" + | "regex" + | "uri" + | "uuid"; + +export type StringConstraint = { + format?: StringFormat; + minLength?: number; // Int + maxLength?: number; // Int + pattern?: string; // RegExp + type: "string"; +}; + +export type NumberConstraint = { + minimum?: number; + maximum?: number; + exclusiveMinimum?: number; + exclusiveMaximum?: number; + multipleOf?: number; + type: "number" | "integer"; +}; + +export type BooleanConstraint = { + type: "boolean"; +}; + +export type NullConstraint = { + type: "null"; +}; + +export type ObjectConstraint = { + type: "object"; +}; + +export type StringEnumConstraint = { + enum: string[]; + type: "string"; +}; + +export type NumberEnumConstraint = { + enum: number[]; + type: "number" | "integer"; +}; + +/** @see https://json-schema.org/understanding-json-schema/reference/enum */ +export type EnumConstraint = StringEnumConstraint | NumberEnumConstraint; + +export type StringConstConstraint = { + const: string; + type: "string"; +}; + +export type NumberConstConstraint = { + const: number; + type: "number" | "integer"; +}; + +export type ConstConstraint = StringConstConstraint | NumberConstConstraint; + +type ValueLabel = { + left?: string; + right?: string; +}; + +export type SingleValueConstraint = + | BooleanConstraint + | NullConstraint + | ObjectConstraint + | StringConstraint + | NumberConstraint + | EnumConstraint + | ConstConstraint; + +export type ArrayConstraint = { + type: "array"; + items: ValueConstraint; +}; + +/** @see https://json-schema.org/understanding-json-schema/reference/array#tuple-validation */ +export type TupleConstraint = { + type: "array"; + items: false; // disallow additional items; + prefixItems: ValueConstraint[]; +}; + +export type ValueConstraint = ( + | SingleValueConstraint + | ArrayConstraint + | TupleConstraint +) & { description?: string; label?: ValueLabel }; + +export type CustomDataType = Subtype< + DataType, + { + description?: string; + $id: VersionedUrl; + kind: "dataType"; + $schema: "https://blockprotocol.org/types/modules/graph/0.3/schema/data-type"; + title: string; + } & ValueConstraint +>; + +export type ConstructDataTypeParams = DistributiveOmit< + CustomDataType, + "$id" | "kind" | "$schema" +>; + +export type DataTypeMetadata = OntologyElementMetadata; + +export type PropertyTypeMetadata = OntologyElementMetadata; + +export type EditableOntologyElementMetadata = Pick< + EntityTypeWithMetadataBp["metadata"], + "icon" +> & { + labelProperty?: BaseUrl | null; +}; +export type EntityTypeMetadata = EditableOntologyElementMetadata & + OntologyElementMetadata; + +export type DataTypeWithMetadata = Subtype< + DataTypeWithMetadataBp, + { + schema: CustomDataType; + metadata: OntologyElementMetadata; + } +>; + +export type PropertyTypeWithMetadata = Subtype< + PropertyTypeWithMetadataBp, + { + schema: PropertyType; + metadata: OntologyElementMetadata; + } +>; + +export type EntityTypeWithMetadata = Subtype< + EntityTypeWithMetadataBp, + { + schema: EntityType; + metadata: EntityTypeMetadata; + } +>; diff --git a/libs/@local/hash-subgraph/src/types/shared/temporal-versioning.ts b/libs/@local/hash-graph-types/typescript/src/temporal-versioning.ts similarity index 92% rename from libs/@local/hash-subgraph/src/types/shared/temporal-versioning.ts rename to libs/@local/hash-graph-types/typescript/src/temporal-versioning.ts index cfdb68fd975..61205863fda 100644 --- a/libs/@local/hash-subgraph/src/types/shared/temporal-versioning.ts +++ b/libs/@local/hash-graph-types/typescript/src/temporal-versioning.ts @@ -25,6 +25,16 @@ import type { Subtype } from "@local/advanced-types/subtype"; */ export type Timestamp = Brand; +/** The transaction time when the record was inserted into the database the first time */ +export type CreatedAtTransactionTime = Brand< + Timestamp, + "CreatedAtTransactionTime" +>; + +/** The decision time when the record was inserted into the database the first time. This does not take into account + * if an updated later happened with a decision time before the initial decision time. */ +export type CreatedAtDecisionTime = Brand; + export type TemporalAxis = TemporalAxisBp; export type Unbounded = UnboundedBp; diff --git a/libs/@local/hash-graph-types/typescript/src/web.ts b/libs/@local/hash-graph-types/typescript/src/web.ts new file mode 100644 index 00000000000..edee7a28f98 --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/src/web.ts @@ -0,0 +1,6 @@ +import type { Brand } from "@local/advanced-types/brand"; + +import type { AccountGroupId, AccountId } from "./account"; + +/** An account ID of an actor that is the owner of something */ +export type OwnedById = Brand; diff --git a/libs/@local/hash-graph-types/typescript/tsconfig.json b/libs/@local/hash-graph-types/typescript/tsconfig.json new file mode 100644 index 00000000000..18b4379ad80 --- /dev/null +++ b/libs/@local/hash-graph-types/typescript/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "@local/tsconfig/legacy-base-tsconfig-to-refactor.json", + "include": ["./"] +} diff --git a/libs/@local/hash-isomorphic-utils/package.json b/libs/@local/hash-isomorphic-utils/package.json index 4b5f538c6f5..36f9fcd887c 100644 --- a/libs/@local/hash-isomorphic-utils/package.json +++ b/libs/@local/hash-isomorphic-utils/package.json @@ -29,6 +29,7 @@ "@blockprotocol/graph": "0.3.4", "@local/advanced-types": "0.0.0-private", "@local/hash-graph-client": "0.0.0-private", + "@local/hash-graph-types": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", "@sentry/browser": "7.116.0", "apollo-server-express": "3.9.0", diff --git a/libs/@local/hash-isomorphic-utils/src/ai-inference-types.ts b/libs/@local/hash-isomorphic-utils/src/ai-inference-types.ts index 495a337aa19..68046801324 100644 --- a/libs/@local/hash-isomorphic-utils/src/ai-inference-types.ts +++ b/libs/@local/hash-isomorphic-utils/src/ai-inference-types.ts @@ -1,5 +1,6 @@ import type { VersionedUrl } from "@blockprotocol/graph"; import type { DistributiveOmit } from "@local/advanced-types/distribute"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import type { AutomaticInferenceArguments, ManualInferenceArguments, @@ -8,11 +9,7 @@ import type { ExternalInputRequestSignal, ExternalInputResponseSignal, } from "@local/hash-isomorphic-utils/flows/types"; -import type { - BaseUrl, - Entity, - EntityPropertyValue, -} from "@local/hash-subgraph"; +import type { Entity, EntityPropertyValue } from "@local/hash-subgraph"; import type { Status } from "@local/status"; import type { QueryDefinition } from "@temporalio/workflow"; diff --git a/libs/@local/hash-isomorphic-utils/src/create-prose-mirror-state.ts b/libs/@local/hash-isomorphic-utils/src/create-prose-mirror-state.ts index 423060bb714..7a549ff16ff 100644 --- a/libs/@local/hash-isomorphic-utils/src/create-prose-mirror-state.ts +++ b/libs/@local/hash-isomorphic-utils/src/create-prose-mirror-state.ts @@ -1,4 +1,4 @@ -import type { OwnedById } from "@local/hash-subgraph"; +import type { OwnedById } from "@local/hash-graph-types/web"; import cloneDeep from "lodash/cloneDeep"; import { baseKeymap } from "prosemirror-commands"; import { dropCursor } from "prosemirror-dropcursor"; diff --git a/libs/@local/hash-isomorphic-utils/src/data-types.ts b/libs/@local/hash-isomorphic-utils/src/data-types.ts index dd0ea9e9b7d..dd2e97555cb 100644 --- a/libs/@local/hash-isomorphic-utils/src/data-types.ts +++ b/libs/@local/hash-isomorphic-utils/src/data-types.ts @@ -1,5 +1,5 @@ import type { JsonValue } from "@blockprotocol/core"; -import type { ValueConstraint } from "@local/hash-subgraph"; +import type { ValueConstraint } from "@local/hash-graph-types/ontology"; import { getJsonSchemaTypeFromValue } from "@local/hash-subgraph/stdlib"; export type FormattedValuePart = { diff --git a/libs/@local/hash-isomorphic-utils/src/entity-store-plugin.ts b/libs/@local/hash-isomorphic-utils/src/entity-store-plugin.ts index 30607ad20ac..abbec0d1715 100644 --- a/libs/@local/hash-isomorphic-utils/src/entity-store-plugin.ts +++ b/libs/@local/hash-isomorphic-utils/src/entity-store-plugin.ts @@ -1,10 +1,8 @@ +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { Block } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; -import type { - EntityId, - EntityPropertiesObject, - OwnedById, - Timestamp, -} from "@local/hash-subgraph"; +import type { EntityPropertiesObject } from "@local/hash-subgraph"; import type { Draft } from "immer"; import { castDraft, produce } from "immer"; import isEqual from "lodash/isEqual"; diff --git a/libs/@local/hash-isomorphic-utils/src/entity-store.ts b/libs/@local/hash-isomorphic-utils/src/entity-store.ts index c04d6251975..129008b3478 100644 --- a/libs/@local/hash-isomorphic-utils/src/entity-store.ts +++ b/libs/@local/hash-isomorphic-utils/src/entity-store.ts @@ -2,10 +2,10 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { EntityId, EntityMetadata, - EntityPropertiesObject, EntityTemporalVersioningMetadata, LinkData, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/entity"; +import type { EntityPropertiesObject } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import type { Draft } from "immer"; import { produce } from "immer"; diff --git a/libs/@local/hash-isomorphic-utils/src/entity.ts b/libs/@local/hash-isomorphic-utils/src/entity.ts index 9e2d49d883b..799fd8cc3dd 100644 --- a/libs/@local/hash-isomorphic-utils/src/entity.ts +++ b/libs/@local/hash-isomorphic-utils/src/entity.ts @@ -1,5 +1,6 @@ +import type { EntityId } from "@local/hash-graph-types/entity"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { Entity, EntityId, Subgraph } from "@local/hash-subgraph"; +import type { Entity, Subgraph } from "@local/hash-subgraph"; import { getEntityRevisionsByEntityId } from "@local/hash-subgraph/stdlib"; import type { DraftEntity, EntityStore, EntityStoreType } from "./entity-store"; diff --git a/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts b/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts index 139b3d0c5de..90579f3d366 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-definitions.ts @@ -1,3 +1,4 @@ +import type { EntityUuid } from "@local/hash-graph-types/entity"; import type { InputNameForAction, OutputNameForAction, @@ -10,7 +11,6 @@ import type { } from "@local/hash-isomorphic-utils/flows/browser-plugin-flow-types"; import { browserInferenceFlowOutput } from "@local/hash-isomorphic-utils/flows/browser-plugin-flow-types"; import type { FlowDefinition } from "@local/hash-isomorphic-utils/flows/types"; -import type { EntityUuid } from "@local/hash-subgraph"; export const manualBrowserInferenceFlowDefinition: FlowDefinition = { name: "Analyze webpage", diff --git a/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-types.ts b/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-types.ts index 7c0f8630f73..0e83d83a7fb 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-types.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/browser-plugin-flow-types.ts @@ -1,12 +1,12 @@ import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import type { Subtype } from "@local/advanced-types/subtype"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { InferenceModelName } from "@local/hash-isomorphic-utils/ai-inference-types"; import type { OutputDefinition, Payload, WebPage, } from "@local/hash-isomorphic-utils/flows/types"; -import type { OwnedById } from "@local/hash-subgraph"; export type AutomaticInferenceSettings = { createAs: "draft" | "live"; diff --git a/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts b/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts index f5a7f442c17..64aa5acd24c 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/example-flow-definitions.ts @@ -1,4 +1,4 @@ -import type { EntityUuid } from "@local/hash-subgraph"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; import type { InputNameForAction, diff --git a/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts b/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts index bf832408172..085ef300481 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/mappings.ts @@ -1,4 +1,5 @@ -import type { Entity, EntityUuid } from "@local/hash-subgraph"; +import type { EntityUuid } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { simplifyProperties } from "../simplify-properties"; diff --git a/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts b/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts index f305d072a19..7a6ec6ce1a1 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/temporal-types.ts @@ -1,4 +1,5 @@ -import type { AccountId, OwnedById } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { Status } from "@local/status"; import type { FlowDefinition, FlowTrigger, LocalFlowRun } from "./types"; diff --git a/libs/@local/hash-isomorphic-utils/src/flows/types.ts b/libs/@local/hash-isomorphic-utils/src/flows/types.ts index 7c6b0d6bd8b..b135d624142 100644 --- a/libs/@local/hash-isomorphic-utils/src/flows/types.ts +++ b/libs/@local/hash-isomorphic-utils/src/flows/types.ts @@ -4,16 +4,12 @@ import type { PropertyMetadataMap, ProvidedEntityEditionProvenance, } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { FlowRun } from "@local/hash-isomorphic-utils/graphql/api-types.gen"; import type { ActorTypeDataType } from "@local/hash-isomorphic-utils/system-types/google/googlesheetsfile"; -import type { - AccountId, - Entity, - EntityId, - EntityPropertiesObject, - EntityUuid, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity, EntityPropertiesObject } from "@local/hash-subgraph"; import type { Status } from "@local/status"; import type { ActionDefinitionId } from "./action-definitions"; diff --git a/libs/@local/hash-isomorphic-utils/src/frontend-paths.ts b/libs/@local/hash-isomorphic-utils/src/frontend-paths.ts index acf32c8054a..d0fa0f4d3d7 100644 --- a/libs/@local/hash-isomorphic-utils/src/frontend-paths.ts +++ b/libs/@local/hash-isomorphic-utils/src/frontend-paths.ts @@ -1,4 +1,4 @@ -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; import { splitEntityId } from "@local/hash-subgraph"; export const generateEntityPath = (params: { diff --git a/libs/@local/hash-isomorphic-utils/src/generate-entity-label.ts b/libs/@local/hash-isomorphic-utils/src/generate-entity-label.ts index 8f5813130f5..3aecc123174 100644 --- a/libs/@local/hash-isomorphic-utils/src/generate-entity-label.ts +++ b/libs/@local/hash-isomorphic-utils/src/generate-entity-label.ts @@ -1,11 +1,7 @@ import type { EntityPropertyValue } from "@blockprotocol/graph"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties"; -import type { - Entity, - EntityRootType, - EntityTypeWithMetadata, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { extractEntityUuidFromEntityId } from "@local/hash-subgraph"; import { getEntityTypeAndParentsById, diff --git a/libs/@local/hash-isomorphic-utils/src/google-integration.ts b/libs/@local/hash-isomorphic-utils/src/google-integration.ts index 600ce614759..11bcfb9ab51 100644 --- a/libs/@local/hash-isomorphic-utils/src/google-integration.ts +++ b/libs/@local/hash-isomorphic-utils/src/google-integration.ts @@ -1,4 +1,4 @@ -import type { EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; type ErrorResponse = { error: string }; diff --git a/libs/@local/hash-isomorphic-utils/src/graph-queries.ts b/libs/@local/hash-isomorphic-utils/src/graph-queries.ts index 3e26f8cdb36..c05adc04a5c 100644 --- a/libs/@local/hash-isomorphic-utils/src/graph-queries.ts +++ b/libs/@local/hash-isomorphic-utils/src/graph-queries.ts @@ -8,16 +8,16 @@ import type { PropertyTypeQueryToken, Selector, } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import type { - AccountId, - EntityId, EntityRelationAndSubject, EntityTypeRelationAndSubject, PropertyTypeRelationAndSubject, QueryTemporalAxesUnresolved, Subgraph, SubgraphRootType, - Timestamp, } from "@local/hash-subgraph"; import { splitEntityId } from "@local/hash-subgraph"; import { diff --git a/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts b/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts index 136c2328808..96645d0b178 100644 --- a/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts +++ b/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts @@ -1,11 +1,11 @@ export const scalars = { - BaseUrl: "@blockprotocol/type-system#BaseUrl", + BaseUrl: "@local/hash-graph-types/ontology#BaseUrl", + VersionedUrl: "@blockprotocol/type-system#VersionedUrl", Date: "string", JSONObject: "@blockprotocol/core#JsonObject", QueryOperationInput: "@blockprotocol/graph#QueryOperationInput", - VersionedUrl: "@blockprotocol/type-system#VersionedUrl", TextToken: "@local/hash-isomorphic-utils/types#TextToken", @@ -14,25 +14,27 @@ export const scalars = { HasSpatiallyPositionedContentProperties: "@local/hash-isomorphic-utils/system-types/canvas#HasSpatiallyPositionedContentProperties", - DataTypeWithMetadata: "@local/hash-subgraph#DataTypeWithMetadata", + DataTypeWithMetadata: "@local/hash-graph-types/ontology#DataTypeWithMetadata", ConstructDataTypeParams: "@local/hash-isomorphic-utils/data-types#ConstructDataTypeParams", - EntityTypeWithMetadata: "@local/hash-subgraph#EntityTypeWithMetadata", + EntityTypeWithMetadata: + "@local/hash-graph-types/ontology#EntityTypeWithMetadata", ConstructEntityTypeParams: "@local/hash-isomorphic-utils/types#ConstructEntityTypeParams", - PropertyTypeWithMetadata: "@local/hash-subgraph#PropertyTypeWithMetadata", + PropertyTypeWithMetadata: + "@local/hash-graph-types/ontology#PropertyTypeWithMetadata", ConstructPropertyTypeParams: "@local/hash-isomorphic-utils/types#ConstructPropertyTypeParams", Entity: "@local/hash-subgraph#Entity", - EntityRecordId: "@local/hash-subgraph#EntityRecordId", - EntityMetadata: "@local/hash-subgraph#EntityMetadata", + EntityRecordId: "@local/hash-graph-types/entity#EntityRecordId", + EntityMetadata: "@local/hash-graph-types/entity#EntityMetadata", EntityRelationAndSubject: "@local/hash-subgraph#EntityRelationAndSubject", GetEntitySubgraphRequest: "@local/hash-graph-client#GetEntitySubgraphRequest", EntityTemporalVersioningMetadata: - "@local/hash-subgraph#EntityTemporalVersioningMetadata", + "@local/hash-graph-types/entity#EntityTemporalVersioningMetadata", EntityPropertiesObject: "@local/hash-subgraph#EntityPropertiesObject", Filter: "@local/hash-graph-client#Filter", @@ -51,18 +53,19 @@ export const scalars = { GraphElementVertexId: "@local/hash-subgraph#GraphElementVertexId", Edges: "@local/hash-subgraph#Edges", Vertices: "@local/hash-subgraph#Vertices", - LinkData: "@local/hash-subgraph#LinkData", + LinkData: "@local/hash-graph-types/entity#LinkData", SubgraphTemporalAxes: "@local/hash-subgraph#SubgraphTemporalAxes", - OwnedById: "@local/hash-subgraph#OwnedById", + OwnedById: "@local/hash-graph-types/web#OwnedById", EditionCreatedById: "@local/hash-subgraph#EditionCreatedById", - AccountId: "@local/hash-subgraph#AccountId", - AccountGroupId: "@local/hash-subgraph#AccountGroupId", - AuthorizationSubjectId: "@local/hash-subgraph#AuthorizationSubjectId", - EntityId: "@local/hash-subgraph#EntityId", - - EntityUuid: "@local/hash-subgraph#EntityUuid", - Uuid: "@local/hash-subgraph#Uuid", + AccountId: "@local/hash-graph-types/account#AccountId", + AccountGroupId: "@local/hash-graph-types/account#AccountGroupId", + AuthorizationSubjectId: + "@local/hash-graph-types/authorization#AuthorizationSubjectId", + EntityId: "@local/hash-graph-types/entity#EntityId", + + EntityUuid: "@local/hash-graph-types/entity#EntityUuid", + Uuid: "@local/hash-graph-types/branded#Uuid", OntologyTemporalMetadata: "@local/hash-graph-client#OntologyTemporalMetadata", diff --git a/libs/@local/hash-isomorphic-utils/src/ontology-types.ts b/libs/@local/hash-isomorphic-utils/src/ontology-types.ts index 1d1779d4b0d..42bbba1eb61 100644 --- a/libs/@local/hash-isomorphic-utils/src/ontology-types.ts +++ b/libs/@local/hash-isomorphic-utils/src/ontology-types.ts @@ -2,8 +2,8 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; import type { EntityTypeReference } from "@blockprotocol/type-system/dist/cjs"; import type { EntityType } from "@blockprotocol/type-system/slim"; import { typedEntries } from "@local/advanced-types/typed-entries"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; import { slugifyTypeTitle } from "@local/hash-isomorphic-utils/slugify-type-title"; -import type { BaseUrl } from "@local/hash-subgraph"; import { componentsFromVersionedUrl, versionedUrlFromComponents, diff --git a/libs/@local/hash-isomorphic-utils/src/parse-text-from-file-types.ts b/libs/@local/hash-isomorphic-utils/src/parse-text-from-file-types.ts index 6d910a1dab4..7eb06aa3110 100644 --- a/libs/@local/hash-isomorphic-utils/src/parse-text-from-file-types.ts +++ b/libs/@local/hash-isomorphic-utils/src/parse-text-from-file-types.ts @@ -1,4 +1,5 @@ -import type { AccountId, Entity } from "@local/hash-subgraph"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { Entity } from "@local/hash-subgraph"; import type { FileProperties } from "./system-types/shared"; diff --git a/libs/@local/hash-isomorphic-utils/src/prosemirror-manager.ts b/libs/@local/hash-isomorphic-utils/src/prosemirror-manager.ts index a29ec221762..80e6b5d45e1 100644 --- a/libs/@local/hash-isomorphic-utils/src/prosemirror-manager.ts +++ b/libs/@local/hash-isomorphic-utils/src/prosemirror-manager.ts @@ -1,7 +1,8 @@ import type { BlockVariant, JsonObject } from "@blockprotocol/core"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import type { TextualContentPropertyValue } from "@local/hash-isomorphic-utils/system-types/shared"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { EntityId, OwnedById } from "@local/hash-subgraph"; import type { Node, Schema } from "prosemirror-model"; import type { EditorState, Transaction } from "prosemirror-state"; import type { EditorProps, EditorView } from "prosemirror-view"; diff --git a/libs/@local/hash-isomorphic-utils/src/save.ts b/libs/@local/hash-isomorphic-utils/src/save.ts index 878d56d5afe..c6882d81ef9 100644 --- a/libs/@local/hash-isomorphic-utils/src/save.ts +++ b/libs/@local/hash-isomorphic-utils/src/save.ts @@ -1,14 +1,10 @@ import type { ApolloClient } from "@apollo/client"; import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { updateBlockCollectionContents } from "@local/hash-isomorphic-utils/graphql/queries/block-collection.queries"; import { getEntityQuery } from "@local/hash-isomorphic-utils/graphql/queries/entity.queries"; -import type { - Entity, - EntityId, - EntityRootType, - OwnedById, - Subgraph, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType, Subgraph } from "@local/hash-subgraph"; import { getOutgoingLinkAndTargetEntities, getRoots, diff --git a/libs/@local/hash-isomorphic-utils/src/service-usage.ts b/libs/@local/hash-isomorphic-utils/src/service-usage.ts index 6e456a87567..9d15bcb7792 100644 --- a/libs/@local/hash-isomorphic-utils/src/service-usage.ts +++ b/libs/@local/hash-isomorphic-utils/src/service-usage.ts @@ -1,4 +1,4 @@ -import type { BoundedTimeInterval } from "@local/hash-subgraph"; +import type { BoundedTimeInterval } from "@local/hash-graph-types/temporal-versioning"; export type AggregatedUsageRecord = { serviceName: string; diff --git a/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts b/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts index 23fd3129a29..141b9e87ff1 100644 --- a/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts +++ b/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts @@ -9,21 +9,22 @@ import type { Subgraph as GraphApiSubgraph, Vertices as VerticesGraphApi, } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { EntityId, EntityMetadata } from "@local/hash-graph-types/entity"; +import type { + BaseUrl, + DataTypeWithMetadata, + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; import { systemEntityTypes, systemPropertyTypes, } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { - AccountId, - BaseUrl, - DataTypeWithMetadata, Entity, - EntityId, - EntityMetadata, EntityPropertiesObject, - EntityTypeWithMetadata, KnowledgeGraphVertex, - PropertyTypeWithMetadata, Subgraph, SubgraphRootType, Vertices, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/canvas.ts b/libs/@local/hash-isomorphic-utils/src/system-types/canvas.ts index 8cb30e55b15..1347a56833b 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/canvas.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/canvas.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import type { ArchivedPropertyValue, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/commentnotification.ts b/libs/@local/hash-isomorphic-utils/src/system-types/commentnotification.ts index cb31ccaa89a..fd20a3cb623 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/commentnotification.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/commentnotification.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import type { Actor, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/google/googlesheetsfile.ts b/libs/@local/hash-isomorphic-utils/src/system-types/google/googlesheetsfile.ts index bb559d718d2..8408a008afe 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/google/googlesheetsfile.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/google/googlesheetsfile.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import type { Account, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/google/shared.ts b/libs/@local/hash-isomorphic-utils/src/system-types/google/shared.ts index 5d65ea1fddf..6e7a1f15317 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/google/shared.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/google/shared.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; export type Account = Entity; diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/googlesheetsintegration.ts b/libs/@local/hash-isomorphic-utils/src/system-types/googlesheetsintegration.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/linear/attachment.ts b/libs/@local/hash-isomorphic-utils/src/system-types/linear/attachment.ts index 2f542eecdc3..7d91cf7684b 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/linear/attachment.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/linear/attachment.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import type { ActivePropertyValue, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/linear/shared.ts b/libs/@local/hash-isomorphic-utils/src/system-types/linear/shared.ts index 9524c586a96..938306f0c94 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/linear/shared.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/linear/shared.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; /** * Whether the user account is active or disabled (suspended). diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts b/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts index ef8d576fd38..3406fa24d3e 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/linearintegration.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import type { Actor, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/mentionnotification.ts b/libs/@local/hash-isomorphic-utils/src/system-types/mentionnotification.ts index a6bfdeda3a6..73fffe1a2db 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/mentionnotification.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/mentionnotification.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import type { Actor, diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts b/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts index e24c8c120ec..1040b505fb6 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/shared.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; export type Actor = Entity; diff --git a/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts b/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts index f343ead2656..46e0ede1cd0 100644 --- a/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts +++ b/libs/@local/hash-isomorphic-utils/src/system-types/usagerecord.ts @@ -2,7 +2,8 @@ * This file was automatically generated – do not edit it. */ -import type { Entity, LinkData } from "@local/hash-subgraph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { Entity } from "@local/hash-subgraph"; import type { AppliesFromPropertyValue, diff --git a/libs/@local/hash-isomorphic-utils/src/types.ts b/libs/@local/hash-isomorphic-utils/src/types.ts index 69076c893be..6a7a8c596f0 100644 --- a/libs/@local/hash-isomorphic-utils/src/types.ts +++ b/libs/@local/hash-isomorphic-utils/src/types.ts @@ -1,5 +1,6 @@ import type { EntityType, PropertyType } from "@blockprotocol/type-system/slim"; -import type { BaseUrl, EntityId } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; export type TextToken = | { diff --git a/libs/@local/hash-subgraph/package.json b/libs/@local/hash-subgraph/package.json index 46a0e1f334b..7b8b296adee 100644 --- a/libs/@local/hash-subgraph/package.json +++ b/libs/@local/hash-subgraph/package.json @@ -34,6 +34,7 @@ "@blockprotocol/type-system": "0.1.1", "@local/advanced-types": "0.0.0-private", "@local/hash-graph-client": "0.0.0-private", + "@local/hash-graph-types": "0.0.0-private", "uuid": "9.0.1" }, "devDependencies": { diff --git a/libs/@local/hash-subgraph/src/shared/type-system-patch.ts b/libs/@local/hash-subgraph/src/shared/type-system-patch.ts index 83aa348ba0e..a67a4848f7c 100644 --- a/libs/@local/hash-subgraph/src/shared/type-system-patch.ts +++ b/libs/@local/hash-subgraph/src/shared/type-system-patch.ts @@ -7,8 +7,9 @@ import { extractVersion, validateVersionedUrl, } from "@blockprotocol/type-system/slim"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; -import type { BaseUrl, Entity, EntityPropertiesObject } from "../types"; +import type { Entity, EntityPropertiesObject } from "../types"; export const extractBaseUrl = (versionedUrl: VersionedUrl): BaseUrl => extractBaseUrlBp(versionedUrl) as BaseUrl; diff --git a/libs/@local/hash-subgraph/src/stdlib/bound.ts b/libs/@local/hash-subgraph/src/stdlib/bound.ts index 5be56d715fd..81daaf15c30 100644 --- a/libs/@local/hash-subgraph/src/stdlib/bound.ts +++ b/libs/@local/hash-subgraph/src/stdlib/bound.ts @@ -1,6 +1,8 @@ import { compareBounds as compareBoundsBp } from "@blockprotocol/graph/temporal/stdlib"; - -import type { TemporalBound, TimeInterval } from "../main"; +import type { + TemporalBound, + TimeInterval, +} from "@local/hash-graph-types/temporal-versioning"; export const compareBounds = ( left: TemporalBound, diff --git a/libs/@local/hash-subgraph/src/stdlib/interval.ts b/libs/@local/hash-subgraph/src/stdlib/interval.ts index 4ea5ff5fe89..4f11509cc16 100644 --- a/libs/@local/hash-subgraph/src/stdlib/interval.ts +++ b/libs/@local/hash-subgraph/src/stdlib/interval.ts @@ -13,14 +13,13 @@ import { sortIntervals as sortIntervalsBp, unionOfIntervals as unionOfIntervalsBp, } from "@blockprotocol/graph/temporal/stdlib"; - import type { BoundedTimeInterval, LimitedTemporalBound, TemporalBound, TimeInterval, Timestamp, -} from "../main"; +} from "@local/hash-graph-types/temporal-versioning"; /** * Standard comparison function that returns whether `IntervalA` is before the `IntervalB`. Where "before" diff --git a/libs/@local/hash-subgraph/src/stdlib/subgraph/edge/link-entity.ts b/libs/@local/hash-subgraph/src/stdlib/subgraph/edge/link-entity.ts index 2e7b7e0f1e2..3548667a8df 100644 --- a/libs/@local/hash-subgraph/src/stdlib/subgraph/edge/link-entity.ts +++ b/libs/@local/hash-subgraph/src/stdlib/subgraph/edge/link-entity.ts @@ -6,14 +6,10 @@ import { getOutgoingLinksForEntity as getOutgoingLinksForEntityBp, getRightEntityForLinkEntity as getRightEntityForLinkEntityBp, } from "@blockprotocol/graph/temporal/stdlib"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { TimeInterval } from "@local/hash-graph-types/temporal-versioning"; -import type { - Entity, - EntityId, - LinkEntityAndRightEntity, - Subgraph, - TimeInterval, -} from "../../../main"; +import type { Entity, LinkEntityAndRightEntity, Subgraph } from "../../../main"; /** * Get all outgoing link entities from a given {@link Entity}. diff --git a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/data-type.ts b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/data-type.ts index 48a9fcfaa3a..712bf6c3fce 100644 --- a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/data-type.ts +++ b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/data-type.ts @@ -7,13 +7,12 @@ import { } from "@blockprotocol/graph/temporal/stdlib"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import type { DataType } from "@local/hash-graph-client"; - import type { BaseUrl, DataTypeWithMetadata, - OntologyTypeVertexId, - Subgraph, -} from "../../../main"; +} from "@local/hash-graph-types/ontology"; + +import type { OntologyTypeVertexId, Subgraph } from "../../../main"; /** * Returns all `DataTypeWithMetadata`s within the vertices of the subgraph diff --git a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity-type.ts b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity-type.ts index 4e6a04e5376..f46f387658d 100644 --- a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity-type.ts +++ b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity-type.ts @@ -6,13 +6,12 @@ import { getEntityTypesByBaseUrl as getEntityTypesByBaseUrlBp, } from "@blockprotocol/graph/temporal/stdlib"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; - import type { BaseUrl, EntityTypeWithMetadata, - OntologyTypeVertexId, - Subgraph, -} from "../../../main"; +} from "@local/hash-graph-types/ontology"; + +import type { OntologyTypeVertexId, Subgraph } from "../../../main"; /** * Returns all `EntityTypeWithMetadata`s within the vertices of the subgraph diff --git a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity.ts b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity.ts index 7fc55db884b..32f002c90af 100644 --- a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity.ts +++ b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/entity.ts @@ -5,14 +5,10 @@ import { getEntityRevision as getEntityRevisionBp, getEntityRevisionsByEntityId as getEntityRevisionsByEntityIdBp, } from "@blockprotocol/graph/temporal/stdlib"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { TimeInterval } from "@local/hash-graph-types/temporal-versioning"; -import type { - Entity, - EntityId, - EntityRevisionId, - Subgraph, - TimeInterval, -} from "../../../main"; +import type { Entity, EntityRevisionId, Subgraph } from "../../../main"; /** * Returns all {@link Entity}s within the vertices of the given {@link Subgraph}, optionally filtering to only get their diff --git a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/property-type.ts b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/property-type.ts index b34c92aa8ff..7d75bff69b0 100644 --- a/libs/@local/hash-subgraph/src/stdlib/subgraph/element/property-type.ts +++ b/libs/@local/hash-subgraph/src/stdlib/subgraph/element/property-type.ts @@ -11,14 +11,13 @@ import type { PropertyType, VersionedUrl, } from "@blockprotocol/type-system/slim"; - import type { BaseUrl, DataTypeWithMetadata, - OntologyTypeVertexId, PropertyTypeWithMetadata, - Subgraph, -} from "../../../main"; +} from "@local/hash-graph-types/ontology"; + +import type { OntologyTypeVertexId, Subgraph } from "../../../main"; import { getJsonSchemaTypeFromValue, mustGetDataTypeById } from "./data-type"; import { getEntityTypeAndParentsById } from "./entity-type"; diff --git a/libs/@local/hash-subgraph/src/stdlib/subgraph/temporal-axes.ts b/libs/@local/hash-subgraph/src/stdlib/subgraph/temporal-axes.ts index fdcbe60ac6e..e67cdbca053 100644 --- a/libs/@local/hash-subgraph/src/stdlib/subgraph/temporal-axes.ts +++ b/libs/@local/hash-subgraph/src/stdlib/subgraph/temporal-axes.ts @@ -1,7 +1,8 @@ import type { Subgraph as SubgraphBp } from "@blockprotocol/graph/temporal"; import { getLatestInstantIntervalForSubgraph as getLatestInstantIntervalForSubgraphBp } from "@blockprotocol/graph/temporal/stdlib"; +import type { BoundedTimeInterval } from "@local/hash-graph-types/temporal-versioning"; -import type { BoundedTimeInterval, Subgraph } from "../../main"; +import type { Subgraph } from "../../main"; /** * For a given {@link Subgraph} that supports temporal versioning, this returns a {@link TimeInterval} that spans diff --git a/libs/@local/hash-subgraph/src/types/element.ts b/libs/@local/hash-subgraph/src/types/element.ts index c0467ba8deb..58b5e2a601e 100644 --- a/libs/@local/hash-subgraph/src/types/element.ts +++ b/libs/@local/hash-subgraph/src/types/element.ts @@ -1,9 +1,10 @@ -import type { Entity } from "./element/knowledge"; import type { DataTypeWithMetadata, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "./element/ontology"; +} from "@local/hash-graph-types/ontology"; + +import type { Entity } from "./element/knowledge"; export * from "./element/knowledge"; export * from "./element/ontology"; diff --git a/libs/@local/hash-subgraph/src/types/element/knowledge.ts b/libs/@local/hash-subgraph/src/types/element/knowledge.ts index 4657135002f..fe8a1601429 100644 --- a/libs/@local/hash-subgraph/src/types/element/knowledge.ts +++ b/libs/@local/hash-subgraph/src/types/element/knowledge.ts @@ -1,32 +1,23 @@ import type { Entity as EntityBp, - EntityMetadata as EntityMetadataBp, EntityPropertiesObject as EntityPropertiesObjectBp, EntityPropertyValue as EntityPropertyValueBp, - EntityRecordId as EntityRecordIdBp, EntityRevisionId as EntityRevisionIdBp, - EntityTemporalVersioningMetadata as EntityTemporalVersioningMetadataBp, isEntityRecordId as isEntityRecordIdBp, JsonValue as JsonValueBp, - LinkData as LinkDataBp, LinkEntityAndRightEntity as LinkEntityAndRightEntityBp, } from "@blockprotocol/graph/temporal"; -import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import type { Brand } from "@local/advanced-types/brand"; import type { Subtype } from "@local/advanced-types/subtype"; -import type { PropertyMetadataMap } from "@local/hash-graph-client"; - import type { - BaseUrl, EntityId, - EntityProvenance, - ExclusiveLimitedTemporalBound, - InclusiveLimitedTemporalBound, - TemporalAxis, - TimeInterval, - Timestamp, - Unbounded, -} from "../shared"; + EntityMetadata, + EntityRecordId, + LinkData, +} from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; + import { isEntityId } from "../shared"; // This isn't necessary, it just _could_ provide greater clarity that this corresponds to an exact vertex and can be @@ -36,14 +27,6 @@ export type EntityRevisionId = Subtype< Brand >; -export type EntityRecordId = Subtype< - EntityRecordIdBp, - { - entityId: EntityId; - editionId: string; - } ->; - /** * A string representation of an `EntityRecordId`. * Can be useful for storing in keys of objects and other similar string-focused situations. @@ -76,39 +59,6 @@ export type EntityPropertiesObject = Subtype< } >; -type HalfClosedInterval = TimeInterval< - InclusiveLimitedTemporalBound, - ExclusiveLimitedTemporalBound | Unbounded ->; - -export type EntityTemporalVersioningMetadata = Subtype< - EntityTemporalVersioningMetadataBp, - Record ->; - -export type EntityMetadata = Subtype< - EntityMetadataBp, - { - recordId: EntityRecordId; - entityTypeId: VersionedUrl; - temporalVersioning: EntityTemporalVersioningMetadata; - archived: boolean; - provenance: EntityProvenance; - confidence?: number; - properties?: PropertyMetadataMap; - } ->; - -export type LinkData = Subtype< - LinkDataBp, - { - leftEntityId: EntityId; - rightEntityId: EntityId; - leftEntityConfidence?: number; - rightEntityConfidence?: number; - } ->; - export type Entity< Properties extends EntityPropertiesObject | null = Record< BaseUrl, diff --git a/libs/@local/hash-subgraph/src/types/element/ontology.ts b/libs/@local/hash-subgraph/src/types/element/ontology.ts index 32638dc3171..171aa334eac 100644 --- a/libs/@local/hash-subgraph/src/types/element/ontology.ts +++ b/libs/@local/hash-subgraph/src/types/element/ontology.ts @@ -1,30 +1,13 @@ -import type { - DataTypeWithMetadata as DataTypeWithMetadataBp, - EntityTypeWithMetadata as EntityTypeWithMetadataBp, - OntologyElementMetadata as OntologyElementMetadataBp, - PropertyTypeWithMetadata as PropertyTypeWithMetadataBp, -} from "@blockprotocol/graph/temporal"; -import type { - EntityType, - PropertyType, - VersionedUrl, -} from "@blockprotocol/type-system/slim"; +import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import { validateBaseUrl } from "@blockprotocol/type-system/slim"; import type { Brand } from "@local/advanced-types/brand"; -import type { DistributiveOmit } from "@local/advanced-types/distribute"; -import type { Subtype } from "@local/advanced-types/subtype"; -import type { DataType } from "@local/hash-graph-client"; - import type { - BaseUrl, - ExclusiveLimitedTemporalBound, - InclusiveLimitedTemporalBound, - OntologyProvenance, - OwnedById, - TimeInterval, - Timestamp, - Unbounded, -} from "../shared"; + DataTypeMetadata, + EntityTypeMetadata, + ExternalOntologyElementMetadata, + OntologyTypeRecordId, + OwnedOntologyElementMetadata, +} from "@local/hash-graph-types/ontology"; /** * The second component of the [{@link BaseUrl}, RevisionId] tuple needed to identify a specific ontology type vertex @@ -35,11 +18,6 @@ export type OntologyTypeRevisionId = Brand< "OntologyTypeRevisionId" >; -export type OntologyTypeRecordId = { - baseUrl: BaseUrl; - version: number; -}; - export const ontologyTypeRecordIdToVersionedUrl = ( ontologyTypeRecordId: OntologyTypeRecordId, ): VersionedUrl => { @@ -59,199 +37,6 @@ export const isOntologyTypeRecordId = ( ); }; -/** @todo-0.3 - Consider redefining `EntityType` and `PropertyType` to use the branded `BaseUrl`s inside them */ - -export type OwnedOntologyElementMetadata = { - recordId: OntologyTypeRecordId; - ownedById: OwnedById; - provenance: OntologyProvenance; - temporalVersioning: { - transactionTime: TimeInterval< - InclusiveLimitedTemporalBound, - ExclusiveLimitedTemporalBound | Unbounded - >; - }; -}; - -export type ExternalOntologyElementMetadata = { - recordId: OntologyTypeRecordId; - fetchedAt: Timestamp; - provenance: OntologyProvenance; - temporalVersioning: { - transactionTime: TimeInterval< - InclusiveLimitedTemporalBound, - ExclusiveLimitedTemporalBound | Unbounded - >; - }; -}; - -type OntologyElementMetadata = Subtype< - OntologyElementMetadataBp, - OwnedOntologyElementMetadata | ExternalOntologyElementMetadata ->; - -export type EditableOntologyElementMetadata = Pick< - EntityTypeWithMetadataBp["metadata"], - "icon" -> & { - labelProperty?: BaseUrl | null; -}; - -export type DataTypeMetadata = OntologyElementMetadata; - -export type PropertyTypeMetadata = OntologyElementMetadata; - -export type EntityTypeMetadata = EditableOntologyElementMetadata & - OntologyElementMetadata; - -/** - * Non-exhaustive list of possible values for 'format' - * - * The presence of a format in this list does _NOT_ mean that: - * 1. The Graph will validate it - * 2. The frontend will treat it differently for input or display - * - * @see https://json-schema.org/understanding-json-schema/reference/string - */ -type StringFormat = - | "date" - | "time" - | "date-time" - | "duration" - | "email" - | "hostname" - | "ipv4" - | "ipv6" - | "regex" - | "uri" - | "uuid"; - -export type StringConstraint = { - format?: StringFormat; - minLength?: number; // Int - maxLength?: number; // Int - pattern?: string; // RegExp - type: "string"; -}; - -export type NumberConstraint = { - minimum?: number; - maximum?: number; - exclusiveMinimum?: number; - exclusiveMaximum?: number; - multipleOf?: number; - type: "number" | "integer"; -}; - -export type BooleanConstraint = { - type: "boolean"; -}; - -export type NullConstraint = { - type: "null"; -}; - -export type ObjectConstraint = { - type: "object"; -}; - -export type StringEnumConstraint = { - enum: string[]; - type: "string"; -}; - -export type NumberEnumConstraint = { - enum: number[]; - type: "number" | "integer"; -}; - -/** @see https://json-schema.org/understanding-json-schema/reference/enum */ -export type EnumConstraint = StringEnumConstraint | NumberEnumConstraint; - -export type StringConstConstraint = { - const: string; - type: "string"; -}; - -export type NumberConstConstraint = { - const: number; - type: "number" | "integer"; -}; - -export type ConstConstraint = StringConstConstraint | NumberConstConstraint; - -type ValueLabel = { - left?: string; - right?: string; -}; - -export type SingleValueConstraint = - | BooleanConstraint - | NullConstraint - | ObjectConstraint - | StringConstraint - | NumberConstraint - | EnumConstraint - | ConstConstraint; - -export type ArrayConstraint = { - type: "array"; - items: ValueConstraint; -}; - -/** @see https://json-schema.org/understanding-json-schema/reference/array#tuple-validation */ -export type TupleConstraint = { - type: "array"; - items: false; // disallow additional items; - prefixItems: ValueConstraint[]; -}; - -export type ValueConstraint = ( - | SingleValueConstraint - | ArrayConstraint - | TupleConstraint -) & { description?: string; label?: ValueLabel }; - -export type CustomDataType = Subtype< - DataType, - { - description?: string; - $id: VersionedUrl; - kind: "dataType"; - $schema: "https://blockprotocol.org/types/modules/graph/0.3/schema/data-type"; - title: string; - } & ValueConstraint ->; - -export type ConstructDataTypeParams = DistributiveOmit< - CustomDataType, - "$id" | "kind" | "$schema" ->; - -export type DataTypeWithMetadata = Subtype< - DataTypeWithMetadataBp, - { - schema: CustomDataType; - metadata: OntologyElementMetadata; - } ->; - -export type PropertyTypeWithMetadata = Subtype< - PropertyTypeWithMetadataBp, - { - schema: PropertyType; - metadata: OntologyElementMetadata; - } ->; - -export type EntityTypeWithMetadata = Subtype< - EntityTypeWithMetadataBp, - { - schema: EntityType; - metadata: EntityTypeMetadata; - } ->; - export const isExternalOntologyElementMetadata = ( metadata: DataTypeMetadata | EntityTypeMetadata, ): metadata is ExternalOntologyElementMetadata => "fetchedAt" in metadata; diff --git a/libs/@local/hash-subgraph/src/types/shared.ts b/libs/@local/hash-subgraph/src/types/shared.ts index 96b098d7b4a..cc7491ded27 100644 --- a/libs/@local/hash-subgraph/src/types/shared.ts +++ b/libs/@local/hash-subgraph/src/types/shared.ts @@ -1,45 +1 @@ -import type { - ActorType, - ProvidedEntityEditionProvenanceOrigin, - SourceProvenance, -} from "@local/hash-graph-client"; - -import type { - CreatedAtDecisionTime, - CreatedAtTransactionTime, - CreatedById, - EditionArchivedById, - EditionCreatedById, -} from "./shared/branded"; - export * from "./shared/branded"; -export * from "./shared/temporal-versioning"; - -export type OntologyProvenance = { - edition: OntologyEditionProvenance; -}; - -export type OntologyEditionProvenance = { - createdById: EditionCreatedById; - archivedById?: EditionArchivedById; - actorType?: ActorType; - origin?: ProvidedEntityEditionProvenanceOrigin; - sources?: Array; -}; - -export type EntityProvenance = { - createdById: CreatedById; - createdAtTransactionTime: CreatedAtTransactionTime; - createdAtDecisionTime: CreatedAtDecisionTime; - edition: EntityEditionProvenance; - firstNonDraftCreatedAtDecisionTime?: CreatedAtDecisionTime; - firstNonDraftCreatedAtTransactionTime?: CreatedAtTransactionTime; -}; - -export type EntityEditionProvenance = { - createdById: EditionCreatedById; - archivedById?: EditionArchivedById; - actorType?: ActorType; - origin?: ProvidedEntityEditionProvenanceOrigin; - sources?: Array; -}; diff --git a/libs/@local/hash-subgraph/src/types/shared/branded.ts b/libs/@local/hash-subgraph/src/types/shared/branded.ts index 648ce381459..27a0c6b43d8 100644 --- a/libs/@local/hash-subgraph/src/types/shared/branded.ts +++ b/libs/@local/hash-subgraph/src/types/shared/branded.ts @@ -1,7 +1,4 @@ -import type { - BaseUrl as BaseUrlBp, - VersionedUrl, -} from "@blockprotocol/type-system/slim"; +import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import { validateBaseUrl } from "@blockprotocol/type-system/slim"; import type { Brand } from "@local/advanced-types/brand"; import type { @@ -12,45 +9,24 @@ import type { PropertyTypeRelationAndSubject as PropertyTypeRelationAndSubjectGraph, WebRelationAndSubject as WebRelationAndSubjectGraph, } from "@local/hash-graph-client"; +import type { + AccountGroupId, + AccountId, +} from "@local/hash-graph-types/account"; +import type { + DraftId, + EntityId, + EntityUuid, +} from "@local/hash-graph-types/entity"; +import { ENTITY_ID_DELIMITER } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { validate as validateUuid } from "uuid"; -import type { Timestamp } from "./temporal-versioning"; - -export type BaseUrl = Brand; - export const isBaseUrl = (baseUrl: string): baseUrl is BaseUrl => { return validateBaseUrl(baseUrl).type === "Ok"; }; -/** Valid Uuids of the system */ -export type Uuid = Brand; - -/** An ID to uniquely identify an account (e.g. a User) */ -export type AccountId = Brand; - -/** An ID to uniquely identify an account group (e.g. an Org) */ -export type AccountGroupId = Brand; - -/** An ID to uniquely identify an authorization subject (either a User or an Org) */ -export type AuthorizationSubjectId = AccountId | AccountGroupId; - -/** An account ID of an actor that is the owner of something */ -export type OwnedById = Brand; - -/** A `Uuid` that points to an Entity without any edition */ -export type EntityUuid = Brand; - -/** The draft identifier for an entity */ -export type DraftId = Brand; - -export const ENTITY_ID_DELIMITER = "~"; - -/** An ID to uniquely identify an entity */ -export type EntityId = Brand< - `${OwnedById}${typeof ENTITY_ID_DELIMITER}${EntityUuid}`, - "EntityId" ->; - export const isEntityId = (entityId: string): entityId is EntityId => { const [accountId, entityUuid] = entityId.split(ENTITY_ID_DELIMITER); return ( @@ -98,25 +74,6 @@ export const extractDraftIdFromEntityId = ( return splitEntityId(entityId)[2]; }; -/** An account ID of creating actor */ -export type CreatedById = Brand; - -/** The transaction time when the record was inserted into the database the first time */ -export type CreatedAtTransactionTime = Brand< - Timestamp, - "CreatedAtTransactionTime" ->; - -/** The transaction time when the record was inserted into the database the first time. This does not take into account - * if an updated later happened with a decision time before the initial decision time. */ -export type CreatedAtDecisionTime = Brand; - -/** An account ID of an actor that has created a specific edition */ -export type EditionCreatedById = Brand; - -/** An account ID of an actor that has archived an edition */ -export type EditionArchivedById = Brand; - /** An `EntityId` identifying a `User` Entity */ export type AccountEntityId = Brand; diff --git a/libs/@local/hash-subgraph/src/types/subgraph.ts b/libs/@local/hash-subgraph/src/types/subgraph.ts index 7eb1ac09ea9..ec104a7b1fc 100644 --- a/libs/@local/hash-subgraph/src/types/subgraph.ts +++ b/libs/@local/hash-subgraph/src/types/subgraph.ts @@ -6,13 +6,13 @@ import { type SubgraphRootType as SubgraphRootTypeBp, } from "@blockprotocol/graph/temporal"; import type { Subtype } from "@local/advanced-types/subtype"; - import type { DataTypeWithMetadata, - Entity, EntityTypeWithMetadata, PropertyTypeWithMetadata, -} from "./element"; +} from "@local/hash-graph-types/ontology"; + +import type { Entity } from "./element"; import type { Edges } from "./subgraph/edges"; import type { GraphResolveDepths } from "./subgraph/graph-resolve-depths"; import type { SubgraphTemporalAxes } from "./subgraph/temporal-axes"; diff --git a/libs/@local/hash-subgraph/src/types/subgraph/edges.ts b/libs/@local/hash-subgraph/src/types/subgraph/edges.ts index 4457b129090..59e09e16eae 100644 --- a/libs/@local/hash-subgraph/src/types/subgraph/edges.ts +++ b/libs/@local/hash-subgraph/src/types/subgraph/edges.ts @@ -4,9 +4,11 @@ import { type OntologyRootedEdges as OntologyRootedEdgesBp, } from "@blockprotocol/graph/temporal"; import type { Subtype } from "@local/advanced-types/subtype"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import type { OntologyTypeRevisionId } from "../element"; -import type { BaseUrl, EntityId, Timestamp } from "../shared"; import type { KnowledgeGraphOutwardEdge, OntologyOutwardEdge, diff --git a/libs/@local/hash-subgraph/src/types/subgraph/edges/outward-edge.ts b/libs/@local/hash-subgraph/src/types/subgraph/edges/outward-edge.ts index 158ebd05d6b..e4949c051fd 100644 --- a/libs/@local/hash-subgraph/src/types/subgraph/edges/outward-edge.ts +++ b/libs/@local/hash-subgraph/src/types/subgraph/edges/outward-edge.ts @@ -6,14 +6,14 @@ import { type OutwardEdge as OutwardEdgeBp, } from "@blockprotocol/graph/temporal"; import type { Subtype } from "@local/advanced-types/subtype"; - +import type { EntityId } from "@local/hash-graph-types/entity"; import type { - EntityId, LimitedTemporalBound, TemporalBound, TimeInterval, Timestamp, -} from "../../shared"; +} from "@local/hash-graph-types/temporal-versioning"; + import type { KnowledgeGraphOutwardEdge, OntologyOutwardEdge, diff --git a/libs/@local/hash-subgraph/src/types/subgraph/element-mappings.ts b/libs/@local/hash-subgraph/src/types/subgraph/element-mappings.ts index 6e0e6c4de11..3a9cc36a9d5 100644 --- a/libs/@local/hash-subgraph/src/types/subgraph/element-mappings.ts +++ b/libs/@local/hash-subgraph/src/types/subgraph/element-mappings.ts @@ -1,16 +1,16 @@ import { type GraphElementIdentifiers as GraphElementIdentifiersBp } from "@blockprotocol/graph/temporal"; import type { VersionedUrl } from "@blockprotocol/type-system/slim"; import type { Subtype } from "@local/advanced-types/subtype"; - +import type { EntityId, EntityRecordId } from "@local/hash-graph-types/entity"; import type { + BaseUrl, DataTypeWithMetadata, - Entity, - EntityRecordId, EntityTypeWithMetadata, OntologyTypeRecordId, PropertyTypeWithMetadata, -} from "../element"; -import type { BaseUrl, EntityId } from "../shared"; +} from "@local/hash-graph-types/ontology"; + +import type { Entity } from "../element"; import type { EntityIdWithInterval, EntityIdWithTimestamp } from "./edges"; import type { DataTypeVertex, diff --git a/libs/@local/hash-subgraph/src/types/subgraph/temporal-axes.ts b/libs/@local/hash-subgraph/src/types/subgraph/temporal-axes.ts index 1d062dfa75d..46e485f76b7 100644 --- a/libs/@local/hash-subgraph/src/types/subgraph/temporal-axes.ts +++ b/libs/@local/hash-subgraph/src/types/subgraph/temporal-axes.ts @@ -4,13 +4,12 @@ import { type SubgraphTemporalAxes as SubgraphTemporalAxesBp, } from "@blockprotocol/graph/temporal"; import type { Subtype } from "@local/advanced-types/subtype"; - import type { PinnedTemporalAxis, PinnedTemporalAxisUnresolved, VariableTemporalAxis, VariableTemporalAxisUnresolved, -} from "../shared"; +} from "@local/hash-graph-types/temporal-versioning"; /** * Defines the two possible combinations of pinned/variable temporal axes that are used in queries that return diff --git a/libs/@local/hash-subgraph/src/types/subgraph/vertices.ts b/libs/@local/hash-subgraph/src/types/subgraph/vertices.ts index c3ffb692b54..27001f6f16d 100644 --- a/libs/@local/hash-subgraph/src/types/subgraph/vertices.ts +++ b/libs/@local/hash-subgraph/src/types/subgraph/vertices.ts @@ -21,18 +21,21 @@ import { type Vertices as VerticesBp, } from "@blockprotocol/graph/temporal"; import type { Subtype } from "@local/advanced-types/subtype"; - +import type { EntityId } from "@local/hash-graph-types/entity"; import type { + BaseUrl, DataTypeWithMetadata, + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; + +import type { Entity, EntityPropertiesObject, EntityPropertyValue, EntityRevisionId, - EntityTypeWithMetadata, OntologyTypeRevisionId, - PropertyTypeWithMetadata, } from "../element"; -import type { BaseUrl, EntityId } from "../shared"; export type DataTypeVertex = Subtype< DataTypeVertexBp, diff --git a/libs/@local/hash-subgraph/tests/compatibility.test/map-axes.ts b/libs/@local/hash-subgraph/tests/compatibility.test/map-axes.ts index e378a291185..fc2968d437f 100644 --- a/libs/@local/hash-subgraph/tests/compatibility.test/map-axes.ts +++ b/libs/@local/hash-subgraph/tests/compatibility.test/map-axes.ts @@ -2,10 +2,10 @@ import type { QueryTemporalAxes as QueryTemporalAxesGraphApi, QueryTemporalAxesUnresolved as QueryTemporalAxesUnresolvedGraphApi, } from "@local/hash-graph-client"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import type { QueryTemporalAxes, QueryTemporalAxesUnresolved, - Timestamp, } from "@local/hash-subgraph"; const mapVariableTemporalAxisUnresolvedInterval = ( diff --git a/libs/@local/hash-subgraph/tests/compatibility.test/map-edges.ts b/libs/@local/hash-subgraph/tests/compatibility.test/map-edges.ts index ff9dceaf93e..c41aba00fa3 100644 --- a/libs/@local/hash-subgraph/tests/compatibility.test/map-edges.ts +++ b/libs/@local/hash-subgraph/tests/compatibility.test/map-edges.ts @@ -7,13 +7,13 @@ import type { OntologyOutwardEdge as OntologyOutwardEdgeGraphApi, OntologyTypeVertexId as OntologyTypeVertexIdGraphApi, } from "@local/hash-graph-client"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import type { - BaseUrl, Edges, - EntityId, OntologyTypeRevisionId, OutwardEdge, - Timestamp, } from "@local/hash-subgraph"; import { isEntityId, diff --git a/libs/@local/hash-subgraph/tests/compatibility.test/map-vertices.ts b/libs/@local/hash-subgraph/tests/compatibility.test/map-vertices.ts index 810a2aafaf7..7a07a4dacf4 100644 --- a/libs/@local/hash-subgraph/tests/compatibility.test/map-vertices.ts +++ b/libs/@local/hash-subgraph/tests/compatibility.test/map-vertices.ts @@ -28,27 +28,35 @@ import type { Vertices as VerticesGraphApi, } from "@local/hash-graph-client"; import type { - BaseUrl, - CreatedAtDecisionTime, - CreatedAtTransactionTime, CreatedById, - CustomDataType, - DataTypeMetadata, EditionArchivedById, EditionCreatedById, +} from "@local/hash-graph-types/account"; +import type { EntityId, EntityMetadata, - EntityPropertiesObject, EntityProvenance, EntityRecordId, EntityTemporalVersioningMetadata, - EntityTypeMetadata, - KnowledgeGraphVertex, LinkData, +} from "@local/hash-graph-types/entity"; +import type { + BaseUrl, + CustomDataType, + DataTypeMetadata, + EntityTypeMetadata, OntologyProvenance, OntologyTypeRecordId, - OntologyVertex, +} from "@local/hash-graph-types/ontology"; +import type { + CreatedAtDecisionTime, + CreatedAtTransactionTime, Timestamp, +} from "@local/hash-graph-types/temporal-versioning"; +import type { + EntityPropertiesObject, + KnowledgeGraphVertex, + OntologyVertex, Vertices, } from "@local/hash-subgraph"; import { isEntityId } from "@local/hash-subgraph"; diff --git a/tests/hash-backend-integration/package.json b/tests/hash-backend-integration/package.json index 137b77662d9..96427f0e43f 100644 --- a/tests/hash-backend-integration/package.json +++ b/tests/hash-backend-integration/package.json @@ -18,6 +18,7 @@ "@blockprotocol/type-system": "0.1.1", "@local/hash-backend-utils": "0.0.0-private", "@local/hash-graph-client": "0.0.0-private", + "@local/hash-graph-types": "0.0.0-private", "@local/hash-isomorphic-utils": "0.0.0-private", "@local/hash-subgraph": "0.0.0-private", "@local/status": "0.0.0-private", diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts index f3362a45167..f97a222b834 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts @@ -16,6 +16,11 @@ import { createEntityType } from "@apps/hash-api/src/graph/ontology/primitive/en import { createPropertyType } from "@apps/hash-api/src/graph/ontology/primitive/property-type"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; +import type { + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships, currentTimeInstantTemporalAxes, @@ -23,13 +28,7 @@ import { } from "@local/hash-isomorphic-utils/graph-queries"; import { generateTypeId } from "@local/hash-isomorphic-utils/ontology-types"; import { mapGraphApiSubgraphToSubgraph } from "@local/hash-isomorphic-utils/subgraph-mapping"; -import type { - Entity, - EntityRootType, - EntityTypeWithMetadata, - OwnedById, - PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; +import type { Entity, EntityRootType } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import { beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts index e7a285ea64e..b37c5fa300f 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts @@ -16,13 +16,11 @@ import type { User } from "@apps/hash-api/src/graph/knowledge/system-types/user" import { createEntityType } from "@apps/hash-api/src/graph/ontology/primitive/entity-type"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { generateTypeId } from "@local/hash-isomorphic-utils/ontology-types"; -import type { - Entity, - EntityTypeWithMetadata, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; import { beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts index 6f1af22a870..fb1d6bcd37f 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts @@ -13,13 +13,11 @@ import type { User } from "@apps/hash-api/src/graph/knowledge/system-types/user" import { createEntityType } from "@apps/hash-api/src/graph/ontology/primitive/entity-type"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; +import type { EntityTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { generateTypeId } from "@local/hash-isomorphic-utils/ontology-types"; -import type { - Entity, - EntityTypeWithMetadata, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { beforeAll, describe, expect, it } from "vitest"; import { resetGraph } from "../../../test-server"; diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment-notification.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment-notification.test.ts index beaadb6a362..69e78153db3 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment-notification.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment-notification.test.ts @@ -13,10 +13,10 @@ import type { User } from "@apps/hash-api/src/graph/knowledge/system-types/user" import { joinOrg } from "@apps/hash-api/src/graph/knowledge/system-types/user"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { TextProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { OwnedById } from "@local/hash-subgraph"; import { extractOwnedByIdFromEntityId } from "@local/hash-subgraph"; import { beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts index 2a53a737de0..1d5c78b3eaa 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts @@ -17,10 +17,10 @@ import { import type { User } from "@apps/hash-api/src/graph/knowledge/system-types/user"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { TextProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { OwnedById } from "@local/hash-subgraph"; import { beforeAll, describe, expect, it } from "vitest"; import { resetGraph } from "../../../test-server"; diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/file.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/file.test.ts index 4538d983742..6e3e342aba6 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/file.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/file.test.ts @@ -7,7 +7,9 @@ import { import type { User } from "@apps/hash-api/src/graph/knowledge/system-types/user"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; -import type { EntityId, OwnedById, Timestamp } from "@local/hash-subgraph"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { beforeAll, describe, expect, it, vi } from "vitest"; import { resetGraph } from "../../../test-server"; diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts index dc4ef4e0979..7bb16185a03 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts @@ -27,6 +27,7 @@ import { getTextFromEntity } from "@apps/hash-api/src/graph/knowledge/system-typ import type { User } from "@apps/hash-api/src/graph/knowledge/system-types/user"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { blockProtocolPropertyTypes, systemEntityTypes, @@ -34,7 +35,7 @@ import { } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { TextProperties } from "@local/hash-isomorphic-utils/system-types/shared"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; -import type { Entity, OwnedById } from "@local/hash-subgraph"; +import type { Entity } from "@local/hash-subgraph"; import { extractBaseUrl } from "@local/hash-subgraph/type-system-patch"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts index f3e6023131d..435d5624d2b 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts @@ -20,13 +20,13 @@ import { import type { User } from "@apps/hash-api/src/graph/knowledge/system-types/user"; import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships } from "@local/hash-isomorphic-utils/graph-queries"; import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids"; import type { HasIndexedContentProperties, TextProperties, } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { OwnedById } from "@local/hash-subgraph"; import type { LinkEntity } from "@local/hash-subgraph/type-system-patch"; import { generateKeyBetween } from "fractional-indexing"; import { beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/data-type.test.ts b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/data-type.test.ts index 2908633edaa..4f52e81ee13 100644 --- a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/data-type.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/data-type.test.ts @@ -14,8 +14,8 @@ import { Logger } from "@local/hash-backend-utils/logger"; import type { ConstructDataTypeParams, DataTypeWithMetadata, - OwnedById, -} from "@local/hash-subgraph"; +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { isOwnedOntologyElementMetadata } from "@local/hash-subgraph"; import { beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts index 3bdc68618f9..d6e4a0430c7 100644 --- a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts @@ -13,6 +13,11 @@ import { createPropertyType } from "@apps/hash-api/src/graph/ontology/primitive/ import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; import { publicUserAccountId } from "@local/hash-backend-utils/public-user-account-id"; +import type { + EntityTypeWithMetadata, + PropertyTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, @@ -21,11 +26,6 @@ import type { ConstructEntityTypeParams, SystemDefinedProperties, } from "@local/hash-isomorphic-utils/types"; -import type { - EntityTypeWithMetadata, - OwnedById, - PropertyTypeWithMetadata, -} from "@local/hash-subgraph"; import { isOwnedOntologyElementMetadata, linkEntityTypeUrl, diff --git a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/property-type.test.ts b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/property-type.test.ts index 40b99386269..39a88475a9f 100644 --- a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/property-type.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/property-type.test.ts @@ -12,12 +12,13 @@ import { import { TypeSystemInitializer } from "@blockprotocol/type-system"; import { Logger } from "@local/hash-backend-utils/logger"; import { publicUserAccountId } from "@local/hash-backend-utils/public-user-account-id"; +import type { PropertyTypeWithMetadata } from "@local/hash-graph-types/ontology"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import type { ConstructPropertyTypeParams } from "@local/hash-isomorphic-utils/types"; -import type { OwnedById, PropertyTypeWithMetadata } from "@local/hash-subgraph"; import { isOwnedOntologyElementMetadata } from "@local/hash-subgraph"; import { beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts b/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts index d6c9f9f1cd0..adb1dd2d68a 100644 --- a/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts +++ b/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts @@ -3,19 +3,19 @@ import path from "node:path"; import type { ImpureGraphContext } from "@apps/hash-api/src/graph/context-types"; import { getEntitySubgraph } from "@apps/hash-api/src/graph/knowledge/primitive/entity"; import type { GetEntitySubgraphRequest } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import { ENTITY_ID_DELIMITER } from "@local/hash-graph-types/entity"; import { currentTimeInstantTemporalAxes, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import type { - AccountId, Entity, EntityRootType, GraphResolveDepths, KnowledgeGraphEdgeKind, Subgraph, } from "@local/hash-subgraph"; -import { ENTITY_ID_DELIMITER } from "@local/hash-subgraph"; import { getEntities as getEntitiesSubgraph, getRoots, diff --git a/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts b/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts index 68e00694029..5605d6b4224 100644 --- a/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts +++ b/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts @@ -28,19 +28,21 @@ import type { GetEntityTypesParams, GetPropertyTypesParams, } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import type { + BaseUrl, + EntityTypeWithMetadata, +} from "@local/hash-graph-types/ontology"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import { currentTimeInstantTemporalAxes, fullDecisionTimeAxis, zeroedGraphResolveDepths, } from "@local/hash-isomorphic-utils/graph-queries"; import type { - AccountId, - BaseUrl, Entity, - EntityTypeWithMetadata, OntologyTypeVertexId, QueryTemporalAxesUnresolved, - Timestamp, } from "@local/hash-subgraph"; import { linkEntityTypeUrl } from "@local/hash-subgraph"; import { diff --git a/tests/hash-playwright/tests/shared/api-queries.ts b/tests/hash-playwright/tests/shared/api-queries.ts index ae95364be98..68ad7d9f2d9 100644 --- a/tests/hash-playwright/tests/shared/api-queries.ts +++ b/tests/hash-playwright/tests/shared/api-queries.ts @@ -1,12 +1,9 @@ import type { VersionedUrl } from "@blockprotocol/graph"; +import type { LinkData } from "@local/hash-graph-types/entity"; +import type { OwnedById } from "@local/hash-graph-types/web"; import { apiOrigin } from "@local/hash-isomorphic-utils/environment"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/shared"; -import type { - Entity, - EntityPropertiesObject, - LinkData, - OwnedById, -} from "@local/hash-subgraph"; +import type { Entity, EntityPropertiesObject } from "@local/hash-subgraph"; import { getRoots } from "@local/hash-subgraph/stdlib"; import type { APIRequestContext } from "@playwright/test"; import type { GraphQLError } from "graphql/error"; From c68c246d1f6efed2baab15cbdd32ed397eb669bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 03:54:39 +0000 Subject: [PATCH 15/27] Update Rust crate `sentry` to 0.33.0 (#4525) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- apps/hash-graph/libs/api/Cargo.toml | 2 +- apps/hash-graph/libs/graph/Cargo.toml | 2 +- libs/@local/tracing/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/hash-graph/libs/api/Cargo.toml b/apps/hash-graph/libs/api/Cargo.toml index 8d67c6d96f1..4430a505535 100644 --- a/apps/hash-graph/libs/api/Cargo.toml +++ b/apps/hash-graph/libs/api/Cargo.toml @@ -37,7 +37,7 @@ include_dir = "0.7.3" mime = "0.3.17" opentelemetry = "0.22.0" opentelemetry_sdk = { version = "0.22.1", features = ["rt-tokio"] } -sentry = { version = "0.32.3", features = [ +sentry = { version = "0.33.0", features = [ "tracing", "tower", "tower-http", diff --git a/apps/hash-graph/libs/graph/Cargo.toml b/apps/hash-graph/libs/graph/Cargo.toml index bc77a990dd8..4ae255bd140 100644 --- a/apps/hash-graph/libs/graph/Cargo.toml +++ b/apps/hash-graph/libs/graph/Cargo.toml @@ -45,7 +45,7 @@ mime = "0.3.17" refinery = { version = "0.8.14", features = ["tokio-postgres"] } regex = "1.10.4" semver = { version = "1.0.22", default-features = false, features = ["serde"] } -sentry = { version = "0.32.3", features = [ +sentry = { version = "0.33.0", features = [ "tracing", "tower", "tower-http", diff --git a/libs/@local/tracing/Cargo.toml b/libs/@local/tracing/Cargo.toml index 55f2e358ced..04e0e72e269 100644 --- a/libs/@local/tracing/Cargo.toml +++ b/libs/@local/tracing/Cargo.toml @@ -13,7 +13,7 @@ error-stack = { workspace = true } opentelemetry_sdk = { version = "0.22.1", features = ["rt-tokio"] } opentelemetry = "0.22.0" opentelemetry-otlp = "0.15.0" -sentry = { version = "0.32.3", features = [ +sentry = { version = "0.33.0", features = [ "backtrace", "contexts", "debug-images", From a0ea4603677df1d6ac488915fa1f59adb789542a Mon Sep 17 00:00:00 2001 From: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> Date: Tue, 28 May 2024 10:57:22 +0200 Subject: [PATCH 16/27] H-2745: Revert specifying revision for crc32c crate (#4527) --- Cargo.lock | 53 +++++++++++++++++++++++++++++++++-------------------- Cargo.toml | 3 --- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c84118d1792..c79fc9f2852 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1008,8 +1008,9 @@ dependencies = [ [[package]] name = "crc32c" -version = "0.6.5" -source = "git+https://github.com/zowens/crc32c?rev=04eabbc6ef33e0afe529da729e65916c48f9d032#04eabbc6ef33e0afe529da729e65916c48f9d032" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0227b9f93e535d49bc7ce914c066243424ce85ed90864cebd0874b184e9b6947" dependencies = [ "rustc_version", ] @@ -2366,6 +2367,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -3728,9 +3738,9 @@ dependencies = [ [[package]] name = "sentry" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00421ed8fa0c995f07cde48ba6c89e80f2b312f74ff637326f392fbfd23abe02" +checksum = "3b73ab9d5b35ed718611e89db8c886647821cfce79723b9e2e4e7cb3fd9cdd49" dependencies = [ "httpdate", "reqwest", @@ -3749,9 +3759,9 @@ dependencies = [ [[package]] name = "sentry-backtrace" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a79194074f34b0cbe5dd33896e5928bbc6ab63a889bd9df2264af5acb186921e" +checksum = "8ce52a2633e0332821389f865762b94852e71b359cd8e95cbf91f38c154302cb" dependencies = [ "backtrace", "once_cell", @@ -3761,9 +3771,9 @@ dependencies = [ [[package]] name = "sentry-contexts" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba8870c5dba2bfd9db25c75574a11429f6b95957b0a78ac02e2970dd7a5249a" +checksum = "10565e6eb013737bf7555250f8b4b8248a571e1de4de7230037f5dd5ea51bc63" dependencies = [ "hostname", "libc", @@ -3775,12 +3785,15 @@ dependencies = [ [[package]] name = "sentry-core" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a75011ea1c0d5c46e9e57df03ce81f5c7f0a9e199086334a1f9c0a541e0826" +checksum = "a2c5e7a0430cfa86b7cb6e7bc01a56331937b2ba08ab703c2e7331139a99f121" dependencies = [ + "crc32fast", + "itertools 0.13.0", "once_cell", "rand", + "regex", "sentry-types", "serde", "serde_json", @@ -3788,9 +3801,9 @@ dependencies = [ [[package]] name = "sentry-debug-images" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec2a486336559414ab66548da610da5e9626863c3c4ffca07d88f7dc71c8de8" +checksum = "2be3e693a65dba8578790de0c6adc0a833815979590ed867336aff8fbcf9cbf7" dependencies = [ "findshlibs", "once_cell", @@ -3799,9 +3812,9 @@ dependencies = [ [[package]] name = "sentry-panic" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eaa3ecfa3c8750c78dcfd4637cfa2598b95b52897ed184b4dc77fcf7d95060d" +checksum = "6f4040c0ad5670b90fc60759bbb31e3fc0d6517448d0c7440255a6f7362c50e7" dependencies = [ "sentry-backtrace", "sentry-core", @@ -3809,9 +3822,9 @@ dependencies = [ [[package]] name = "sentry-tower" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df141464944fdf8e2a6f2184eb1d973a20456466f788346b6e3a51791cdaa370" +checksum = "d03daa33dfa3adc8b99da9afe10b1775a8c689e3242bf616badec7455916c525" dependencies = [ "http 1.1.0", "pin-project", @@ -3823,9 +3836,9 @@ dependencies = [ [[package]] name = "sentry-tracing" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f715932bf369a61b7256687c6f0554141b7ce097287e30e3f7ed6e9de82498fe" +checksum = "151ff7c03687737ba11969ccdc6f45eb7775ed7a95880810297c6cc8c3574e75" dependencies = [ "sentry-backtrace", "sentry-core", @@ -3835,9 +3848,9 @@ dependencies = [ [[package]] name = "sentry-types" -version = "0.32.3" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4519c900ce734f7a0eb7aba0869dfb225a7af8820634a7dd51449e3b093cfb7c" +checksum = "10d5ad9e33b9f6f598387a6a23aa23c7f13e4e7740a34cd4d9c8db851bfdae05" dependencies = [ "debugid", "hex", diff --git a/Cargo.toml b/Cargo.toml index b9d3e24a0cc..f0ac4eb08ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,6 +81,3 @@ uuid = { version = "1.8.0", default-features = false } inherits = "release" lto = "fat" strip = "none" - -[patch.crates-io] -crc32c = { git = "https://github.com/zowens/crc32c", rev = "04eabbc6ef33e0afe529da729e65916c48f9d032" } From c2b918a6a1df0e4d32ed05880e1aa46e354b0bda Mon Sep 17 00:00:00 2001 From: Ciaran Morinan <37743469+CiaranMn@users.noreply.github.com> Date: Tue, 28 May 2024 10:33:46 +0100 Subject: [PATCH 17/27] H-2776: Add more instructions for running locally (#4516) Co-authored-by: Tim Diekmann Co-authored-by: Dei Vilkinsons <6226576+vilkinsons@users.noreply.github.com> --- apps/hash/README.md | 44 ++++++++++++++++++++++++++++++++--- apps/plugin-browser/README.md | 3 ++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/apps/hash/README.md b/apps/hash/README.md index 6fc0d6917e8..ce1e424f383 100644 --- a/apps/hash/README.md +++ b/apps/hash/README.md @@ -104,25 +104,38 @@ To run HASH locally, please follow these steps: docker run hello-world ``` +1. If you need to test or develop AI-related features, you will need to create an `.env.local` file in the repository root with the following values: + + ```sh + OPENAI_API_KEY=your-open-ai-api-key # required for most AI features + ANTHROPIC_API_KEY=your-anthropic-api-key # required for most AI features + E2B_API_KEY=your-e2b-api-key # only required for the question-answering flow action + ``` + + **Note on environment files:** `.env.local` is not committed to the repo – **put any secrets that should remain secret here.** The default environment variables are taken from `.env`, extended by `.env.development`, and finally by `.env.local`. If you want to overwrite values specified in `.env` or `.env.development`, you can add them to `.env.local`. Do **not** change any other `.env` files unless you intend to change the defaults for development or testing. + 1. Launch external services (Postgres, the graph query layer, Kratos, Redis, and OpenSearch) as Docker containers: ```sh - yarn external-services up + yarn external-services --wait ``` - 1. You can optionally force a rebuild of the docker containers by adding the `--build` argument(**this is necessary if changes have been made to the graph query layer). It's recommended to do this whenever updating your branch from upstream**. + 1. You can optionally force a rebuild of the Docker containers by adding the `--build` argument(**this is necessary if changes have been made to the graph query layer). It's recommended to do this whenever updating your branch from upstream**. 1. You can keep external services running between app restarts by adding the `--detach` argument to run the containers in the background. It is possible to tear down the external services with `yarn external-services down`. 1. When using `yarn external-services:offline up`, the Graph services does not try to connect to `https://blockprotocol.org` to fetch required schemas. This is useful for development when the internet connection is slow or unreliable. + 1. You can also run the Graph API and AI Temporal worker outside of Docker – this is useful if they are changing frequently and you want to avoid rebuilding the Docker containers. To do so, _stop them_ in Docker and then run `yarn dev:graph` and `yarn workspace @apps/hash-ai-worker-ts dev` respectively in separate terminals. + 1. Launch app services: ```sh yarn dev ``` - This will start backend and frontend in a single terminal. + This will start backend and frontend in a single terminal. Once you see http://localhost:3000, the frontend end is ready to visit there. + The API is online once you see `localhost:5001` in the terminal. Both must be online for the frontend to function. You can also launch parts of the app in separate terminals, e.g.: @@ -133,6 +146,31 @@ To run HASH locally, please follow these steps: See `package.json` → `scripts` for details and more options. +1. Log in + + There are three users seeded automatically for development. Their passwords are all `password`. + + - `alice@example.com`, `bob@example.com` – regular users + - `admin@example.com` – an admin + +If you need to run the browser plugin locally, see the `README.md` in the `apps/plugin-browser` directory. + +#### Resetting the local database + +If you need to reset the local database, to clear out test data or because it has become corrupted during development, you have two options: + +1. The slow option – rebuild in Docker + + 1. In the Docker UI (or via CLI at your preference), stop and delete the `hash-external-services` container + 1. In 'Volumes', search 'hash-external-services' and delete the volumes shown + 1. Run `yarn external-services up --wait` to rebuild the services + +1. The fast option – reset the database via the Graph API + + 1. Run the Graph API in test mode by running `yarn dev:graph:test-server` + 1. Run `yarn graph:reset-database` to reset the database + 1. **If you need to use the frontend**, you will also need to delete the rows in the `identities` table in the `dev_kratos` database, or login will not work. You can do so via any Postgres UI or CLI. The db connection and user details are in `.env` + #### External services test mode The external services of the system can be started in 'test mode' to prevent polluting the development database. diff --git a/apps/plugin-browser/README.md b/apps/plugin-browser/README.md index 47829ab28e6..d7e60c2b4ac 100755 --- a/apps/plugin-browser/README.md +++ b/apps/plugin-browser/README.md @@ -31,8 +31,9 @@ We will add a link to the user guide for the plugin here, when it is available. 1. [about:debugging#/runtime/this-firefox](about:debugging#/runtime/this-firefox) 1. Click 'Load Temporary Add-on...' and select the `manifest.json` file in the `build` folder -**Pages** will reload (the `popup` and `options` screens). +**Pages** (the `popup` and `options` screens) will reload automatically when changes are made. **Scripts** (`background`, `content`) require clicking 'Update' in [Chrome](chrome://extensions) or 'Reload' in [Firefox](about:debugging#/runtime/this-firefox) +– if it seems that a change is not taking effect, 'Remove' and then 'Load unpacked' or 'Load Temporary Add-on...' again. ### Permissions From a49f5ec59007c857a0f106fbdfc64eb2a64f8b75 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 04:30:49 +0000 Subject: [PATCH 18/27] Update npm package `markdownlint-cli` to v0.41.0 (#4530) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 73 ++++++++++++++++++++++++---------------------------- 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 5056f1a2880..ced6d364397 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "husky": "8.0.3", "lint-staged": "15.2.4", "lockfile-lint": "4.13.2", - "markdownlint-cli": "0.40.0", + "markdownlint-cli": "0.41.0", "npm-run-all": "4.1.5", "patch-package": "6.5.0", "postinstall-postinstall": "2.1.0", diff --git a/yarn.lock b/yarn.lock index b74e75da968..76febe497a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11756,7 +11756,7 @@ command-line-usage@^5.0.5: table-layout "^0.4.3" typical "^2.6.1" -commander@12.1.0, commander@^12.0.0: +commander@12.1.0, commander@^12.0.0, commander@~12.1.0: version "12.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== @@ -11801,11 +11801,6 @@ commander@^9.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" integrity "sha1-0d2PLOb6+TFHKVwN8Tx8IRQc+90= sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==" -commander@~12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" - integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== - commist@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/commist/-/commist-3.2.0.tgz#da9c8e5f245ac21510badc4b10c46b5bcc9b56cd" @@ -15357,16 +15352,16 @@ glob@9.3.2: minipass "^4.2.4" path-scurry "^1.6.1" -glob@^10.3.3, glob@^10.3.7, glob@~10.3.12: - version "10.3.12" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.12.tgz#3a65c363c2e9998d220338e88a5f6ac97302960b" - integrity sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg== +glob@^10.3.3, glob@^10.3.7, glob@~10.4.1: + version "10.4.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.1.tgz#0cfb01ab6a6b438177bfe6a58e2576f6efe909c2" + integrity sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw== dependencies: foreground-child "^3.1.0" - jackspeak "^2.3.6" - minimatch "^9.0.1" - minipass "^7.0.4" - path-scurry "^1.10.2" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + path-scurry "^1.11.1" glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.0: version "7.2.3" @@ -17259,10 +17254,10 @@ iterator.prototype@^1.1.2: reflect.getprototypeof "^1.0.4" set-function-name "^2.0.1" -jackspeak@^2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" - integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== +jackspeak@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.1.2.tgz#eada67ea949c6b71de50f1b09c92a961897b90ab" + integrity sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ== dependencies: "@isaacs/cliui" "^8.0.2" optionalDependencies: @@ -18515,14 +18510,14 @@ markdown-to-jsx@^7.1.8: resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.2.0.tgz#e7b46b65955f6a04d48a753acd55874a14bdda4b" integrity sha512-3l4/Bigjm4bEqjCR6Xr+d4DtM1X6vvtGsMGSjJYyep8RjjIvcWtrXBS8Wbfe1/P+atKNMccpsraESIaWVplzVg== -markdownlint-cli@0.40.0: - version "0.40.0" - resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.40.0.tgz#57678cabd543c654d2ea88f752e9ac058b31c207" - integrity sha512-JXhI3dRQcaqwiFYpPz6VJ7aKYheD53GmTz9y4D/d0F1MbZDGOp9pqKlbOfUX/pHP/iAoeiE4wYRmk8/kjLakxA== +markdownlint-cli@0.41.0: + version "0.41.0" + resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.41.0.tgz#2f47cdcfeacf64075ae2d2b80bb28b030a11d79d" + integrity sha512-kp29tKrMKdn+xonfefjp3a/MsNzAd9c5ke0ydMEI9PR98bOjzglYN4nfMSaIs69msUf1DNkgevAIAPtK2SeX0Q== dependencies: - commander "~12.0.0" + commander "~12.1.0" get-stdin "~9.0.0" - glob "~10.3.12" + glob "~10.4.1" ignore "~5.3.1" js-yaml "^4.1.0" jsonc-parser "~3.2.1" @@ -18530,7 +18525,7 @@ markdownlint-cli@0.40.0: markdownlint "~0.34.0" minimatch "~9.0.4" run-con "~1.3.2" - toml "~3.0.0" + smol-toml "~1.2.0" markdownlint-micromark@0.1.9: version "0.1.9" @@ -19380,7 +19375,7 @@ minimatch@^7.4.1: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.1, minimatch@^9.0.3, minimatch@~9.0.4: +minimatch@^9.0.3, minimatch@^9.0.4, minimatch@~9.0.4: version "9.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== @@ -19418,10 +19413,10 @@ minipass@^5.0.0: resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.4: - version "7.1.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.0.tgz#b545f84af94e567386770159302ca113469c80b8" - integrity sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== minizlib@^2.1.1: version "2.1.2" @@ -20837,10 +20832,10 @@ path-root@^0.1.1: dependencies: path-root-regex "^0.1.0" -path-scurry@^1.10.2, path-scurry@^1.6.1: - version "1.10.2" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.2.tgz#8f6357eb1239d5fa1da8b9f70e9c080675458ba7" - integrity sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA== +path-scurry@^1.11.1, path-scurry@^1.6.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== dependencies: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -23890,6 +23885,11 @@ smartwrap@^2.0.2: wcwidth "^1.0.1" yargs "^15.1.0" +smol-toml@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/smol-toml/-/smol-toml-1.2.0.tgz#d1d565093fcb6c2e01bf6a7d50870abc48fae4a4" + integrity sha512-KObxdQANC/xje3OoatMbSwQf2XAvJ0RbK+4nmQRszFNZptbNRnMWqbLF/zb4sMi9xJ6HNyhWXeuZ9zC/I/XY7w== + snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -25084,11 +25084,6 @@ token-types@^4.1.1: "@tokenizer/token" "^0.3.0" ieee754 "^1.2.1" -toml@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" - integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== - totalist@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" From 183cc656685fddea175c4697848a9bf8866bf28e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 05:50:16 +0000 Subject: [PATCH 19/27] Update npm package `lint-staged` to v15.2.5 (#4528) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 135 +++++++++++++++++++++++++-------------------------- 2 files changed, 66 insertions(+), 71 deletions(-) diff --git a/package.json b/package.json index ced6d364397..2d4fd4750e0 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "cross-env": "7.0.3", "dotenv-flow": "3.2.0", "husky": "8.0.3", - "lint-staged": "15.2.4", + "lint-staged": "15.2.5", "lockfile-lint": "4.13.2", "markdownlint-cli": "0.41.0", "npm-run-all": "4.1.5", diff --git a/yarn.lock b/yarn.lock index 76febe497a0..11c3efd624a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11209,7 +11209,7 @@ chalk@5.2.0: resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== -chalk@5.3.0, chalk@^5.0.1, chalk@^5.3.0: +chalk@5.3.0, chalk@^5.0.1, chalk@^5.3.0, chalk@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== @@ -11756,11 +11756,6 @@ command-line-usage@^5.0.5: table-layout "^0.4.3" typical "^2.6.1" -commander@12.1.0, commander@^12.0.0, commander@~12.1.0: - version "12.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" - integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== - commander@7, commander@^7.0.0, commander@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" @@ -11781,6 +11776,11 @@ commander@^11.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== +commander@^12.0.0, commander@~12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== + commander@^2.19.0, commander@^2.20.0, commander@^2.20.3, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -12632,7 +12632,7 @@ debug@2.6.9, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -14195,21 +14195,6 @@ execa@7.2.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" -execa@8.0.1, execa@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" - integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^8.0.1" - human-signals "^5.0.0" - is-stream "^3.0.0" - merge-stream "^2.0.0" - npm-run-path "^5.1.0" - onetime "^6.0.0" - signal-exit "^4.1.0" - strip-final-newline "^3.0.0" - execa@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" @@ -14238,6 +14223,21 @@ execa@^6.1.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" +execa@^8.0.1, execa@~8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" + integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^8.0.1" + human-signals "^5.0.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^4.1.0" + strip-final-newline "^3.0.0" + expand-template@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" @@ -17825,7 +17825,7 @@ lie@~3.3.0: dependencies: immediate "~3.0.5" -lilconfig@3.1.1: +lilconfig@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.1.tgz#9d8a246fa753106cfc205fd2d77042faca56e5e3" integrity sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ== @@ -17842,33 +17842,21 @@ linkify-it@^5.0.0: dependencies: uc.micro "^2.0.0" -lint-staged@15.2.4: - version "15.2.4" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.4.tgz#b8376b459a308d40e5dfdae302f333fa4c4bf126" - integrity sha512-3F9KRQIS2fVDGtCkBp4Bx0jswjX7zUcKx6OF0ZeY1prksUyKPRIIUqZhIUYAstJfvj6i48VFs4dwVIbCYwvTYQ== - dependencies: - chalk "5.3.0" - commander "12.1.0" - debug "4.3.4" - execa "8.0.1" - lilconfig "3.1.1" - listr2 "8.2.1" - micromatch "4.0.6" - pidtree "0.6.0" - string-argv "0.3.2" - yaml "2.4.2" - -listr2@8.2.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-8.2.1.tgz#06a1a6efe85f23c5324180d7c1ddbd96b5eefd6d" - integrity sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g== +lint-staged@15.2.5: + version "15.2.5" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.5.tgz#8c342f211bdb34ffd3efd1311248fa6b50b43b50" + integrity sha512-j+DfX7W9YUvdzEZl3Rk47FhDF6xwDBV5wwsCPw6BwWZVPYJemusQmvb9bRsW23Sqsaa+vRloAWogbK4BUuU2zA== dependencies: - cli-truncate "^4.0.0" - colorette "^2.0.20" - eventemitter3 "^5.0.1" - log-update "^6.0.0" - rfdc "^1.3.1" - wrap-ansi "^9.0.0" + chalk "~5.3.0" + commander "~12.1.0" + debug "~4.3.4" + execa "~8.0.1" + lilconfig "~3.1.1" + listr2 "~8.2.1" + micromatch "~4.0.7" + pidtree "~0.6.0" + string-argv "~0.3.2" + yaml "~2.4.2" listr2@^4.0.5: version "4.0.5" @@ -17884,6 +17872,18 @@ listr2@^4.0.5: through "^2.3.8" wrap-ansi "^7.0.0" +listr2@~8.2.1: + version "8.2.1" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-8.2.1.tgz#06a1a6efe85f23c5324180d7c1ddbd96b5eefd6d" + integrity sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g== + dependencies: + cli-truncate "^4.0.0" + colorette "^2.0.20" + eventemitter3 "^5.0.1" + log-update "^6.0.0" + rfdc "^1.3.1" + wrap-ansi "^9.0.0" + lit-element@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.2.0.tgz#9c981c55dfd9a8f124dc863edb62cc529d434db7" @@ -19249,13 +19249,13 @@ micromark@^3.0.0: micromark-util-types "^1.0.1" uvu "^0.5.0" -micromatch@4.0.6, micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: - version "4.0.6" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.6.tgz#ab4e37c42726b9cd788181ba4a2a4fead8e394a3" - integrity sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ== +micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5, micromatch@~4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5" + integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== dependencies: braces "^3.0.3" - picomatch "^4.0.2" + picomatch "^2.3.1" millify@6.1.0: version "6.1.0" @@ -21057,21 +21057,16 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.0, picomatc resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity "sha1-O6ODNzNkbZ0+SZWUbBNlpn+wekI= sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" -picomatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" - integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== - -pidtree@0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" - integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== - pidtree@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" integrity "sha1-7wmsLMBTPfHzJQzPLE02aw0SEUo= sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==" +pidtree@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" + integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -24227,7 +24222,7 @@ streamx@^2.13.0, streamx@^2.15.0: optionalDependencies: bare-events "^2.2.0" -string-argv@0.3.2: +string-argv@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== @@ -26936,16 +26931,16 @@ yaml-ast-parser@0.0.43, yaml-ast-parser@^0.0.43: resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb" integrity "sha1-6KI+b7TDgHarkplcXcoz89PXybs= sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==" -yaml@2.4.2, yaml@^2.3.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.2.tgz#7a2b30f2243a5fc299e1f14ca58d475ed4bc5362" - integrity sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA== - yaml@^1.10.0, yaml@^1.10.2, yaml@^1.5.0: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity "sha1-IwHF/78StGfejaIzOkWeKeeSDks= sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" +yaml@^2.3.1, yaml@~2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.2.tgz#7a2b30f2243a5fc299e1f14ca58d475ed4bc5362" + integrity sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA== + yargs-parser@21.0.1: version "21.0.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" From 85f9db858909bae69dcb9907be5f22d57c96ca22 Mon Sep 17 00:00:00 2001 From: Ciaran Morinan <37743469+CiaranMn@users.noreply.github.com> Date: Wed, 29 May 2024 10:01:27 +0100 Subject: [PATCH 20/27] H-2244, H-2559: Add history/provenance tab to entity editor (#4518) Co-authored-by: Ben Werner Co-authored-by: Ben Werner <42802102+benwerner01@users.noreply.github.com> --- .../flow-activities/persist-entity-action.ts | 2 +- .../coordinating-agent.ts | 19 +- .../propose-entity-from-facts.ts | 18 ++ .../src/graph/knowledge/primitive/entity.ts | 13 +- apps/hash-api/src/graphql/context.ts | 1 + .../src/graphql/create-apollo-server.ts | 1 + apps/hash-api/src/graphql/resolvers/index.ts | 2 + .../resolvers/knowledge/entity/entity.ts | 31 +- .../knowledge/entity/get-entity-diffs.ts | 36 +++ .../queries/knowledge/entity.queries.ts | 9 + .../[entity-uuid].page/entity-editor-page.tsx | 1 + .../[entity-uuid].page/entity-editor.tsx | 22 +- .../entity-editor/history-section.tsx | 141 ++++++++ .../history-section/get-history-events.ts | 166 ++++++++++ .../history-section/history-table.tsx | 305 ++++++++++++++++++ .../history-table/provenance.tsx | 225 +++++++++++++ .../provenance/sources-slideover.tsx | 189 +++++++++++ .../history-table/shared/chip.tsx | 37 +++ .../history-table/shared/event-detail.tsx | 67 ++++ .../history-section/shared/types.ts | 45 +++ .../entity-page-wrapper.tsx | 2 +- .../entity-page-header.tsx | 11 +- .../shared/entity-editor-tabs.tsx | 53 +++ .../src/pages/admin/users.page.tsx | 2 +- .../src/pages/shared/virtualized-table.tsx | 10 +- libs/@hashintel/design-system/src/chip.tsx | 1 + .../design-system/src/components.ts | 1 + .../design-system/src/icon-code.tsx | 17 + .../src/graphql/scalar-mapping.ts | 2 + .../type-defs/knowledge/entity.typedef.ts | 10 + .../src/subgraph-mapping.ts | 3 + .../src/types/element/knowledge.ts | 13 + 32 files changed, 1424 insertions(+), 31 deletions(-) create mode 100644 apps/hash-api/src/graphql/resolvers/knowledge/entity/get-entity-diffs.ts create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section.tsx create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/get-history-events.ts create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table.tsx create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance.tsx create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance/sources-slideover.tsx create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/chip.tsx create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/event-detail.tsx create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/shared/types.ts create mode 100644 apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/entity-editor-tabs.tsx create mode 100644 libs/@hashintel/design-system/src/icon-code.tsx diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-entity-action.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-entity-action.ts index c29b1f19048..9c62019180e 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-entity-action.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/persist-entity-action.ts @@ -199,7 +199,7 @@ export const persistEntityAction: FlowActionActivity = async ({ inputs }) => { } entityMetadata = await graphApiClient - .patchEntity(actorId, { + .patchEntity(webBotActorId, { draft: existingEntityIsDraft ? true : createEditionAsDraft, entityId: existingEntity.metadata.recordId.entityId, properties: patchOperations, diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/coordinating-agent.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/coordinating-agent.ts index e064a64fda3..04dffa634a9 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/coordinating-agent.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/research-entities-action/coordinating-agent.ts @@ -327,12 +327,19 @@ const createInitialPlan = async (params: { const { questions } = firstToolCall.input as CoordinatorToolCallArguments["requestHumanInput"]; - const responseString = await getAnswersFromHuman(questions); - - return createInitialPlan({ - input, - questionsAndAnswers: (questionsAndAnswers ?? "") + responseString, - }); + if (questions.length) { + const responseString = await getAnswersFromHuman(questions); + + return createInitialPlan({ + input, + questionsAndAnswers: (questionsAndAnswers ?? "") + responseString, + }); + } else { + return createInitialPlan({ + input, + questionsAndAnswers, + }); + } }; const parseCoordinatorInputs = async (params: { diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts index ae782ad76d9..93b1904cde7 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/shared/propose-entities-from-facts/propose-entity-from-facts.ts @@ -1,4 +1,8 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; +import type { + OriginProvenance, + ProvidedEntityEditionProvenance, +} from "@local/hash-graph-client"; import type { BaseUrl } from "@local/hash-graph-types/ontology"; import type { ProposedEntity } from "@local/hash-isomorphic-utils/flows/types"; import { generateUuid } from "@local/hash-isomorphic-utils/generate-uuid"; @@ -431,6 +435,18 @@ export const proposeEntityFromFacts = async (params: { const proposedOutgoingLinkEntities: ProposedEntity[] = []; + const { stepId } = await getFlowContext(); + + const editionProvenance: ProvidedEntityEditionProvenance = { + actorType: "ai", + // @ts-expect-error - `ProvidedEntityEditionProvenanceOrigin` is not being generated correctly from the Graph API + origin: { + type: "flow", + id: flowEntityId, + stepIds: [stepId], + } satisfies OriginProvenance, + }; + if (proposingOutgoingLinks && outgoingLinks) { await Promise.all( outgoingLinks.map(async (outgoingLink) => { @@ -533,6 +549,7 @@ export const proposeEntityFromFacts = async (params: { entityTypeId: outgoingLink.entityTypeId as VersionedUrl, propertyMetadata: outgoingLinkPropertyMetadata, properties: outgoingLinkProperties, + provenance: editionProvenance, }); }), ); @@ -574,6 +591,7 @@ export const proposeEntityFromFacts = async (params: { summary: entitySummary.summary, entityTypeId: dereferencedEntityType.$id, properties, + provenance: editionProvenance, }; return { diff --git a/apps/hash-api/src/graph/knowledge/primitive/entity.ts b/apps/hash-api/src/graph/knowledge/primitive/entity.ts index 2c2747eb270..69c5c781308 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/entity.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/entity.ts @@ -23,7 +23,6 @@ import type { } from "@local/hash-graph-types/account"; import type { EntityId, EntityUuid } from "@local/hash-graph-types/entity"; import type { BaseUrl } from "@local/hash-graph-types/ontology"; -import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; import type { OwnedById } from "@local/hash-graph-types/web"; import { currentTimeInstantTemporalAxes, @@ -40,6 +39,7 @@ import type { UserPermissionsOnEntities, } from "@local/hash-isomorphic-utils/types"; import type { + DiffEntityInput, Entity, EntityAuthorizationRelationship, EntityPropertiesObject, @@ -224,7 +224,7 @@ export const getEntitySubgraph: ImpureGraphFunction< if ( // @ts-expect-error - The subgraph vertices are entity vertices so `Timestamp` is the correct type to get // the latest revision - (editionMap[latestEditionTimestamp]!.inner.metadata as EntityMetadata) + (editionMap[latestEditionTimestamp].inner.metadata as EntityMetadata) .archived && // if the vertex is in the roots of the query, then it is intentionally included !subgraph.roots.find((root) => root.baseId === entityId) @@ -1069,14 +1069,7 @@ export const getEntityAuthorizationRelationships: ImpureGraphFunction< ); export const calculateEntityDiff: ImpureGraphFunction< - { - firstEntityId: EntityId; - firstTransactionTime: Timestamp | null; - firstDecisionTime: Timestamp | null; - secondEntityId: EntityId; - secondDecisionTime: Timestamp | null; - secondTransactionTime: Timestamp | null; - }, + DiffEntityInput, Promise > = async ({ graphApi }, { actorId }, params) => graphApi.diffEntity(actorId, params).then(({ data }) => data); diff --git a/apps/hash-api/src/graphql/context.ts b/apps/hash-api/src/graphql/context.ts index 737d7162ba2..3ab86090a45 100644 --- a/apps/hash-api/src/graphql/context.ts +++ b/apps/hash-api/src/graphql/context.ts @@ -26,6 +26,7 @@ export interface GraphQLContext { authentication: AuthenticationContext; user?: User; temporal: TemporalClient; + userAgent?: string; vault?: VaultClient; } diff --git a/apps/hash-api/src/graphql/create-apollo-server.ts b/apps/hash-api/src/graphql/create-apollo-server.ts index 9a63886816c..2ebd2b6eeaa 100644 --- a/apps/hash-api/src/graphql/create-apollo-server.ts +++ b/apps/hash-api/src/graphql/create-apollo-server.ts @@ -70,6 +70,7 @@ export const createApolloServer = ({ actorId: getActorIdFromRequest(ctx.req), }, user: ctx.req.user, + userAgent: ctx.req.headers["user-agent"], emailTransporter, logger: logger.child({ requestId: ctx.res.get("x-hash-request-id") ?? "", diff --git a/apps/hash-api/src/graphql/resolvers/index.ts b/apps/hash-api/src/graphql/resolvers/index.ts index 4d9fe419946..89e32794fd8 100644 --- a/apps/hash-api/src/graphql/resolvers/index.ts +++ b/apps/hash-api/src/graphql/resolvers/index.ts @@ -49,6 +49,7 @@ import { updateEntitiesResolver, updateEntityResolver, } from "./knowledge/entity/entity"; +import { getEntityDiffsResolver } from "./knowledge/entity/get-entity-diffs"; import { createFileFromUrl } from "./knowledge/file/create-file-from-url"; import { requestFileUpload } from "./knowledge/file/request-file-upload"; import { hashInstanceEntityResolver } from "./knowledge/hash-instance/hash-instance"; @@ -117,6 +118,7 @@ export const resolvers: Omit & { pageComments: loggedInAndSignedUpMiddleware(pageCommentsResolver), blocks: loggedInAndSignedUpMiddleware(blocksResolver), getEntity: getEntityResolver, + getEntityDiffs: getEntityDiffsResolver, getFlowRuns: loggedInAndSignedUpMiddleware(getFlowRunsResolver), getFlowRunById: loggedInAndSignedUpMiddleware(getFlowRunByIdResolver), queryEntities: queryEntitiesResolver, diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts b/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts index a23019f7b7d..6bbc0e2caa6 100644 --- a/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts +++ b/apps/hash-api/src/graphql/resolvers/knowledge/entity/entity.ts @@ -8,7 +8,10 @@ import type { AccountGroupId, AccountId, } from "@local/hash-graph-types/account"; -import type { EntityId } from "@local/hash-graph-types/entity"; +import type { + EntityEditionProvenance, + EntityId, +} from "@local/hash-graph-types/entity"; import type { OwnedById } from "@local/hash-graph-types/web"; import { createDefaultAuthorizationRelationships, @@ -94,7 +97,7 @@ export const createEntityResolver: ResolverFn< }, graphQLContext, ) => { - const { authentication, user } = graphQLContext; + const { authentication, user, userAgent } = graphQLContext; const context = graphQLContextToImpureGraphContext(graphQLContext); /** @@ -106,6 +109,15 @@ export const createEntityResolver: ResolverFn< let entity: Entity | LinkEntity; + const provenance: EntityEditionProvenance = { + actorType: "human", + origin: { + userAgent, + // @ts-expect-error - `ProvidedEntityEditionProvenanceOrigin` is not being generated correctly from the Graph API + type: "web-app", + }, + }; + if (linkData) { const { leftEntityId, rightEntityId } = linkData; @@ -130,6 +142,7 @@ export const createEntityResolver: ResolverFn< relationships ?? createDefaultAuthorizationRelationships(authentication), draft: draft ?? undefined, + provenance, }); } else { entity = await createEntityWithLinks(context, authentication, { @@ -139,6 +152,7 @@ export const createEntityResolver: ResolverFn< linkedEntities: linkedEntities ?? undefined, relationships: createDefaultAuthorizationRelationships(authentication), draft: draft ?? undefined, + provenance, }); } @@ -324,7 +338,7 @@ export const updateEntityResolver: ResolverFn< { entityUpdate: { draft, entityId, updatedProperties, entityTypeId } }, graphQLContext, ) => { - const { authentication, user } = graphQLContext; + const { authentication, user, userAgent } = graphQLContext; const context = graphQLContextToImpureGraphContext(graphQLContext); const isIncompleteUser = !user.isAccountSignupComplete; @@ -344,11 +358,21 @@ export const updateEntityResolver: ResolverFn< let updatedEntity: Entity; + const provenance: EntityEditionProvenance = { + actorType: "human", + origin: { + userAgent, + // @ts-expect-error - `ProvidedEntityEditionProvenanceOrigin` is not being generated correctly from the Graph API + type: "web-app", + }, + }; + if (isEntityLinkEntity(entity)) { updatedEntity = await updateLinkEntity(context, authentication, { linkEntity: entity, properties: updatedProperties, draft: draft ?? undefined, + provenance, }); } else { updatedEntity = await updateEntity(context, authentication, { @@ -356,6 +380,7 @@ export const updateEntityResolver: ResolverFn< entityTypeId: entityTypeId ?? undefined, properties: updatedProperties, draft: draft ?? undefined, + provenance, }); } diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/entity/get-entity-diffs.ts b/apps/hash-api/src/graphql/resolvers/knowledge/entity/get-entity-diffs.ts new file mode 100644 index 00000000000..fa2f7bcdac0 --- /dev/null +++ b/apps/hash-api/src/graphql/resolvers/knowledge/entity/get-entity-diffs.ts @@ -0,0 +1,36 @@ +import { calculateEntityDiff } from "../../../../graph/knowledge/primitive/entity"; +import type { + EntityDiff, + Query, + QueryGetEntityDiffsArgs, + ResolverFn, +} from "../../../api-types.gen"; +import type { GraphQLContext } from "../../../context"; + +export const getEntityDiffsResolver: ResolverFn< + Query["getEntityDiffs"], + Record, + GraphQLContext, + QueryGetEntityDiffsArgs +> = async (_, { inputs }, graphQLContext) => { + const { + dataSources: { graphApi }, + } = graphQLContext; + + const entityDiffs: EntityDiff[] = await Promise.all( + inputs.map(async (input) => { + const diff = await calculateEntityDiff( + { graphApi }, + graphQLContext.authentication, + input, + ); + + return { + diff, + input, + }; + }), + ); + + return entityDiffs; +}; diff --git a/apps/hash-frontend/src/graphql/queries/knowledge/entity.queries.ts b/apps/hash-frontend/src/graphql/queries/knowledge/entity.queries.ts index 8ce03fe2ae4..2259d500d50 100644 --- a/apps/hash-frontend/src/graphql/queries/knowledge/entity.queries.ts +++ b/apps/hash-frontend/src/graphql/queries/knowledge/entity.queries.ts @@ -178,6 +178,15 @@ export const getEntityAuthorizationRelationshipsQuery = gql` } `; +export const getEntityDiffsQuery = gql` + query getEntityDiffs($inputs: [DiffEntityInput!]!) { + getEntityDiffs(inputs: $inputs) { + input + diff + } + } +`; + export const startFlowMutation = gql` mutation startFlow( $flowTrigger: FlowTrigger! diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor-page.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor-page.tsx index e3098bdb3e1..1252cb17df6 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor-page.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor-page.tsx @@ -91,6 +91,7 @@ export const EntityEditorPage = ({ path={`${owner}/entities/${entityUuid}`} /> } + showTabs /> } > diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor.tsx index d0c24bd4025..01885d9b685 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor.tsx @@ -6,10 +6,12 @@ import { useMemo } from "react"; import { useEntityTypesContextRequired } from "../../../../shared/entity-types-context/hooks/use-entity-types-context-required"; import { EntityEditorContextProvider } from "./entity-editor/entity-editor-context"; import { FilePreviewSection } from "./entity-editor/file-preview-section"; +import { HistorySection } from "./entity-editor/history-section"; import { LinkSection } from "./entity-editor/link-section"; import { LinksSection } from "./entity-editor/links-section"; import { PropertiesSection } from "./entity-editor/properties-section"; import { TypesSection } from "./entity-editor/types-section"; +import { useEntityEditorTab } from "./shared/entity-editor-tabs"; import type { DraftLinkState } from "./shared/use-draft-link-state"; export interface EntityEditorProps extends DraftLinkState { @@ -55,19 +57,25 @@ export const EntityEditor = (props: EntityEditorProps) => { [entity, isSpecialEntityTypeLookup], ); + const tab = useEntityEditorTab(); + return ( - - {isLinkEntity ? : } + {tab === "history" ? ( + + ) : ( + + {isLinkEntity ? : } - + - + - {isLinkEntity ? null : } + {isLinkEntity ? null : } - {/* */} - + {/* */} + + )} ); }; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section.tsx new file mode 100644 index 00000000000..a4f66c9cc8d --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section.tsx @@ -0,0 +1,141 @@ +import { useQuery } from "@apollo/client"; +import { Chip, Skeleton, WhiteCard } from "@hashintel/design-system"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import { + fullDecisionTimeAxis, + fullOntologyResolveDepths, + zeroedGraphResolveDepths, +} from "@local/hash-isomorphic-utils/graph-queries"; +import type { DiffEntityInput } from "@local/hash-subgraph"; +import { splitEntityId } from "@local/hash-subgraph"; +import { useMemo } from "react"; + +import type { + GetEntityDiffsQuery, + GetEntityDiffsQueryVariables, + GetEntitySubgraphQuery, + GetEntitySubgraphQueryVariables, +} from "../../../../../graphql/api-types.gen"; +import { + getEntityDiffsQuery, + getEntitySubgraphQuery, +} from "../../../../../graphql/queries/knowledge/entity.queries"; +import { SectionWrapper } from "../../../shared/section-wrapper"; +import { getHistoryEvents } from "./history-section/get-history-events"; +import { HistoryTable } from "./history-section/history-table"; +import type { HistoryEvent } from "./history-section/shared/types"; + +export const HistorySection = ({ entityId }: { entityId: EntityId }) => { + const [ownedById, entityUuid, draftUuid] = splitEntityId(entityId); + + const isDraft = !!draftUuid; + + const { data: editionsData, loading: editionsLoading } = useQuery< + GetEntitySubgraphQuery, + GetEntitySubgraphQueryVariables + >(getEntitySubgraphQuery, { + fetchPolicy: "cache-and-network", + variables: { + request: { + filter: { + all: [ + { + equal: [{ path: ["uuid"] }, { parameter: entityUuid }], + }, + { + equal: [{ path: ["ownedById"] }, { parameter: ownedById }], + }, + ], + }, + graphResolveDepths: { + ...zeroedGraphResolveDepths, + ...fullOntologyResolveDepths, + }, + temporalAxes: fullDecisionTimeAxis, + includeDrafts: isDraft, + }, + includePermissions: false, + }, + }); + + const diffPairs = useMemo(() => { + const editions = editionsData?.getEntitySubgraph.subgraph.roots; + if (!editions) { + return []; + } + + const diffInputs: DiffEntityInput[] = []; + for (const [index, edition] of editions.entries()) { + const nextEdition = editions[index + 1]; + if (!nextEdition) { + break; + } + + diffInputs.push({ + firstEntityId: edition.baseId as EntityId, + firstDecisionTime: edition.revisionId as Timestamp, + firstTransactionTime: null, + secondEntityId: nextEdition.baseId as EntityId, + secondDecisionTime: nextEdition.revisionId as Timestamp, + secondTransactionTime: null, + }); + } + return diffInputs; + }, [editionsData]); + + const { data: diffsData, loading: diffsLoading } = useQuery< + GetEntityDiffsQuery, + GetEntityDiffsQueryVariables + >(getEntityDiffsQuery, { + fetchPolicy: "cache-and-network", + variables: { + inputs: diffPairs, + }, + skip: !diffPairs.length, + }); + + const historyEvents = useMemo(() => { + if ( + editionsLoading || + !editionsData || + (diffPairs.length > 0 && diffsLoading) + ) { + return []; + } + + const diffs = diffsData?.getEntityDiffs; + if (!diffs && diffPairs.length > 0) { + return []; + } + + const { subgraph } = editionsData.getEntitySubgraph; + + return getHistoryEvents(diffs ?? [], subgraph); + }, [diffsData, diffsLoading, diffPairs, editionsData, editionsLoading]); + + const subgraph = editionsData?.getEntitySubgraph.subgraph; + + const loading = editionsLoading || diffsLoading; + + return ( + palette.gray[70] }} + /> + } + > + + {loading || !subgraph ? ( + + ) : ( + + )} + + + ); +}; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/get-history-events.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/get-history-events.ts new file mode 100644 index 00000000000..41dd197d03e --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/get-history-events.ts @@ -0,0 +1,166 @@ +import { typedEntries } from "@local/advanced-types/typed-entries"; +import type { EntityId } from "@local/hash-graph-types/entity"; +import type { BaseUrl } from "@local/hash-graph-types/ontology"; +import type { Timestamp } from "@local/hash-graph-types/temporal-versioning"; +import type { Subgraph } from "@local/hash-subgraph"; +import { + getEntityRevision, + getEntityTypeById, + getPropertyTypeForEntity, +} from "@local/hash-subgraph/stdlib"; +import { isEqual } from "lodash"; + +import type { EntityDiff } from "../../../../../../graphql/api-types.gen"; +import type { HistoryEvent } from "./shared/types"; + +export const getHistoryEvents = (diffs: EntityDiff[], subgraph: Subgraph) => { + const firstEditionIdentifier = subgraph.roots[0]; + if (!firstEditionIdentifier) { + throw new Error("No first edition for entity found in roots"); + } + + const firstEntityEdition = getEntityRevision( + subgraph, + firstEditionIdentifier.baseId as EntityId, + firstEditionIdentifier.revisionId as Timestamp, + ); + + if (!firstEntityEdition) { + throw new Error("No first edition for entity found in vertices"); + } + + const events: HistoryEvent[] = []; + + const entityTypeWithMetadata = getEntityTypeById( + subgraph, + firstEntityEdition.metadata.entityTypeId, + ); + + if (!entityTypeWithMetadata) { + throw new Error( + `Could not find entity type with id ${firstEntityEdition.metadata.entityTypeId} in subgraph`, + ); + } + + for ( + let changedEntityIndex = diffs.length - 1; + changedEntityIndex >= 0; + changedEntityIndex-- + ) { + const diffData = diffs[changedEntityIndex]!; + + const changedEntityEdition = getEntityRevision( + subgraph, + diffData.input.secondEntityId, + diffData.input.secondDecisionTime as Timestamp, + ); + + if (!changedEntityEdition) { + throw new Error( + `Could not find entity with id ${diffData.input.secondEntityId} in subgraph`, + ); + } + + /** + * @todo H-2774 – also handle 'changed type' and 'change draft status' events + */ + + for (const [ + changedPropertyIndex, + propertyDiff, + ] of diffData.diff.properties.entries()) { + const propertyProvenance = changedEntityEdition.metadata.properties?.find( + (map) => isEqual(map.path, propertyDiff.path), + ); + + /** + * @todo H-2775 – handle property objects and changes to array contents + */ + const propertyBaseUrl = propertyDiff.path[0] as BaseUrl; + try { + const propertyTypeWithMetadata = getPropertyTypeForEntity( + subgraph, + firstEntityEdition.metadata.entityTypeId, + + propertyBaseUrl, + ); + + events.push({ + /** + * The original entity is not included in the diffs, so the 0-based index needs +2 + */ + number: `${changedEntityIndex + 2}.${changedPropertyIndex + 1}`, + provenance: { + edition: changedEntityEdition.metadata.provenance.edition, + property: propertyProvenance?.metadata.provenance, + }, + propertyType: propertyTypeWithMetadata.propertyType, + timestamp: + changedEntityEdition.metadata.temporalVersioning.decisionTime.start + .limit, + type: "property-update", + diff: propertyDiff, + }); + } catch (err) { + throw new Error( + `Could not find property type with baseUrl ${propertyBaseUrl} for entity type with id ${firstEntityEdition.metadata.entityTypeId} in subgraph`, + ); + } + } + } + + for (const [index, [key, value]] of typedEntries( + firstEntityEdition.properties, + ).entries()) { + const propertyProvenance = firstEntityEdition.metadata.properties?.find( + /** + * @todo H-2775 – handle property objects and changes to array contents + */ + (map) => map.path[0] === key, + ); + + try { + const propertyTypeWithMetadata = getPropertyTypeForEntity( + subgraph, + firstEntityEdition.metadata.entityTypeId, + key, + ); + + events.push({ + number: `1.${index + 1}`, + provenance: { + edition: firstEntityEdition.metadata.provenance.edition, + property: propertyProvenance?.metadata.provenance, + }, + propertyType: propertyTypeWithMetadata.propertyType, + timestamp: firstEditionIdentifier.revisionId, + type: "property-update", + diff: { + op: "added", + /** + * @todo H-2775 – handle property objects and changes to array contents + */ + path: [key], + added: value, + }, + }); + } catch { + throw new Error( + `Could not find entity type with id ${firstEntityEdition.metadata.entityTypeId} in subgraph`, + ); + } + } + + events.push({ + type: "created", + number: "1", + entity: firstEntityEdition, + entityType: entityTypeWithMetadata.schema, + timestamp: firstEditionIdentifier.revisionId, + provenance: { + edition: firstEntityEdition.metadata.provenance.edition, + }, + }); + + return events; +}; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table.tsx new file mode 100644 index 00000000000..86477a0f697 --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table.tsx @@ -0,0 +1,305 @@ +import { AngleRightRegularIcon, IconButton } from "@hashintel/design-system"; +import type { Subgraph } from "@local/hash-subgraph"; +import type { SxProps, Theme } from "@mui/material"; +import { + Box, + Collapse, + Stack, + TableCell, + tableContainerClasses, + tableHeadClasses, + Typography, +} from "@mui/material"; +import { format } from "date-fns"; +import { memo, useMemo, useState } from "react"; + +import { CircleInfoIcon } from "../../../../../../shared/icons/circle-info-icon"; +import type { + CreateVirtualizedRowContentFn, + VirtualizedTableColumn, + VirtualizedTableRow, + VirtualizedTableSort, +} from "../../../../../shared/virtualized-table"; +import { + defaultCellSx, + headerHeight, + VirtualizedTable, +} from "../../../../../shared/virtualized-table"; +import { Provenance } from "./history-table/provenance"; +import { EventDetail } from "./history-table/shared/event-detail"; +import type { HistoryEvent } from "./shared/types"; + +type FieldId = "number" | "event" | "time" | "actions"; + +export const historyTableRowHeight = 43; + +const generateNumberColumnWidth = (rowCount: number) => + Math.max(50, rowCount.toString().length * 15); + +const createColumns = (rowCount: number): VirtualizedTableColumn[] => [ + { + id: "number", + label: "#", + sortable: false, + textSx: { color: ({ palette }) => palette.gray[50], fontWeight: 400 }, + width: generateNumberColumnWidth(rowCount) + 16, + }, + { + id: "event", + label: "Event", + sortable: false, + textSx: { fontWeight: 600 }, + width: "100%", + }, + { + id: "time", + label: "Timestamp", + sortable: true, + textSx: { fontWeight: 600 }, + width: 180, + }, + { + id: "actions", + label: "Actions", + sortable: false, + textSx: { fontWeight: 600 }, + width: 110, + }, +]; + +const typographySx: SxProps = { + fontSize: 14, +}; + +const historyEventCellSx: SxProps = { + ...typographySx, + ...defaultCellSx, + borderBottom: "none", + color: ({ palette }) => palette.common.black, + height: historyTableRowHeight, + py: 1, + display: "flex", + alignItems: "center", + justifyContent: "center", +}; + +const TableRow = memo( + ({ + event, + isFirstRow, + isLastRow, + numberColumnWidth, + subgraph, + }: HistoryRowData) => { + const { number, timestamp } = event; + + const [showProvenance, setShowProvenance] = useState(false); + + const [editionNumber, changedPropertyNumber] = number.split("."); + + return ( + + ({ + borderRadius: 2, + background: showProvenance + ? palette.blue[15] + : palette.common.white, + border: `1px solid ${showProvenance ? palette.blue[20] : "transparent"}`, + mb: isLastRow || showProvenance ? 1 : 0, + mt: isFirstRow ? 1 : 0, + transition: transitions.create(["background", "border"]), + })} + > + + + {editionNumber} + {changedPropertyNumber && ( + palette.gray[60], + }} + > + .{changedPropertyNumber} + + )} + + + + + + + + {format(new Date(timestamp), "yyyy-MM-dd h:mma")} + + + setShowProvenance((prev) => !prev)} + sx={{ + "&:hover": { background: "none" }, + "& svg": { fontSize: 14 }, + }} + > + + showProvenance ? palette.blue[70] : palette.gray[70], + }} + /> + + showProvenance ? palette.blue[70] : palette.gray[70], + marginLeft: showProvenance ? 0.5 : 1, + marginTop: showProvenance ? 1 : 0, + transition: ({ transitions }) => + transitions.create(["transform", "margin"]), + transform: `rotate(${showProvenance ? 90 : 0}deg)`, + }} + /> + + + + + + + + + ); + }, +); + +type HistoryRowData = { + event: HistoryEvent; + isFirstRow: boolean; + isLastRow: boolean; + numberColumnWidth: number; + subgraph: Subgraph; +}; + +const createRowContent: CreateVirtualizedRowContentFn = ( + _index, + row, +) => ( + +); + +export const HistoryTable = ({ + events, + subgraph, +}: { + events: HistoryEvent[]; + subgraph: Subgraph; +}) => { + const [sort, setSort] = useState>({ + field: "time", + direction: "desc", + }); + + const rows = useMemo[]>(() => { + const numberColumnWidth = generateNumberColumnWidth(events.length); + + return events + .sort((a, b) => { + if (sort.field === "time") { + if (sort.direction === "asc") { + if (a.timestamp === b.timestamp) { + return a.number.localeCompare(b.number); + } + return a.timestamp > b.timestamp ? 1 : -1; + } + + if (a.timestamp === b.timestamp) { + return b.number.localeCompare(a.number); + } + return a.timestamp > b.timestamp ? -1 : 1; + } + + return 0; + }) + .map((event, index) => ({ + id: event.number, + data: { + event, + isFirstRow: index === 0, + isLastRow: index === events.length - 1, + numberColumnWidth, + subgraph, + }, + })); + }, [events, sort, subgraph]); + + const columns = useMemo(() => createColumns(rows.length), [rows]); + + const tableHeight = Math.min( + 600, + Math.max(headerHeight + historyTableRowHeight * events.length + 2, 400), + ); + + return ( + + + + ); +}; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance.tsx new file mode 100644 index 00000000000..c023df0c2ea --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance.tsx @@ -0,0 +1,225 @@ +import { + ArrowUpRightRegularIcon, + CodeIcon, + InfinityLightIcon, + Skeleton, + WandMagicSparklesIcon, +} from "@hashintel/design-system"; +import type { ProvidedEntityEditionProvenanceOriginTypeEnum } from "@local/hash-graph-client"; +import type { AccountId } from "@local/hash-graph-types/account"; +import { generateWorkerRunPath } from "@local/hash-isomorphic-utils/flows/frontend-paths"; +import type { Subgraph } from "@local/hash-subgraph"; +import type { SvgIconProps, SxProps, Theme } from "@mui/material"; +import { Box, Stack, Typography } from "@mui/material"; +import { useRouter } from "next/router"; +import type { FunctionComponent, PropsWithChildren } from "react"; +import { useState } from "react"; + +import { SearchIcon } from "../../../../../../../shared/icons/search-icon"; +import { UserIcon } from "../../../../../../../shared/icons/user-icon"; +import { Link } from "../../../../../../../shared/ui/link"; +import { useActors } from "../../../../../../../shared/use-actors"; +import type { HistoryEvent } from "../shared/types"; +import { SourcesSlideover } from "./provenance/sources-slideover"; + +const ProvenanceHeader = ({ label }: { label: string }) => ( + + {label} + +); + +const provenanceIconSx: SxProps = { + fill: ({ palette }) => palette.gray[50], + fontSize: 14, +}; + +const provenanceIconMap: Record< + | ProvidedEntityEditionProvenanceOriginTypeEnum + /** + * @todo: remove this when remaining possible values have been correctly included in `ProvidedEntityEditionProvenanceOrigin` + */ + | "flow" + | "browser-extension" + | "web-app" + | "mobile-app" + | "api", + FunctionComponent +> = { + flow: InfinityLightIcon, + "browser-extension": UserIcon, + "web-app": UserIcon, + "mobile-app": UserIcon, + api: CodeIcon, + migration: CodeIcon, +}; + +const typographySx: SxProps = { + fontSize: 14, +}; + +const ProvenanceRow = ({ children }: PropsWithChildren) => ( + + {children} + +); + +export const Provenance = ({ + event, + subgraph, +}: { + event: HistoryEvent; + subgraph: Subgraph; +}) => { + const { + provenance: { edition }, + } = event; + + const { actors, loading } = useActors({ + accountIds: [edition.createdById as AccountId], + }); + + const [showSourcesSlideover, setShowSourcesSlideover] = useState(false); + + const { query } = useRouter(); + const shortname = query.shortname as string; + + if (loading) { + return ( + + + + ); + } + + const actor = actors?.[0]; + + if (!actor) { + throw new Error( + `Could not fetch creator actor with id ${edition.createdById}`, + ); + } + + const originType = edition.origin?.type; + const actorType = edition.actorType; + + const originTextPrefix = event.type === "created" ? "Created" : "Updated"; + + let originText = originType + ? `${originTextPrefix} from the` + : `${originTextPrefix} from`; + // @ts-expect-error - `ProvidedEntityEditionProvenanceOrigin` is not being generated correctly from the Graph API + if (originType === "flow" || originType === "migration") { + originText = `${originTextPrefix} by a`; + } + + const OriginIcon = originType && provenanceIconMap[originType]; + + const flowRunId = edition.origin?.id; + + const sources = + event.type === "property-update" + ? event.provenance.property?.sources + : event.provenance.edition.sources; + + return ( + <> + {!!sources?.length && ( + setShowSourcesSlideover(false)} + open={showSourcesSlideover} + subgraph={subgraph} + /> + )} + ({ + background: palette.blue[10], + borderTop: `1px solid ${palette.blue[20]}`, + borderRadius: 2, + })} + > + + + + {originType && ( + + {OriginIcon ? : null} + + {originText} + + {originType.split("-").join(" ")} + + + {flowRunId && ( + + `1px solid ${palette.gray[70]}`, + }} + > + View run + palette.blue[70], ml: 1 }} + /> + + )} + + )} + + {actorType === "ai" ? ( + + ) : OriginIcon ? ( + + ) : ( + + )} + + {originTextPrefix} by + + {actor.kind === "machine" ? ( + actor.displayName + ) : ( + + {actor.displayName} + + )} + + + + + {!!sources?.length && ( + + + + + + Inferred from + setShowSourcesSlideover(true)} + sx={{ + background: "none", + padding: 0, + border: "none", + fontWeight: 600, + color: ({ palette }) => palette.blue[70], + cursor: "pointer", + ml: 0.6, + }} + > + {sources.length}{" "} + {sources.length === 1 ? "source" : "sources"} + + + + + )} + + + + ); +}; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance/sources-slideover.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance/sources-slideover.tsx new file mode 100644 index 00000000000..0ba6891d383 --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/provenance/sources-slideover.tsx @@ -0,0 +1,189 @@ +import { faFile } from "@fortawesome/free-regular-svg-icons"; +import { FontAwesomeIcon } from "@hashintel/design-system"; +import type { Subgraph } from "@local/hash-subgraph"; +import { + Backdrop, + Box, + Slide, + Stack, + Table, + TableBody, + TableCell, + TableHead, + TableRow, + Typography, +} from "@mui/material"; + +import { Link } from "../../../../../../../../shared/ui/link"; +import { Cell } from "../../../../../../../settings/organizations/shared/cell"; +import type { HistoryEvent } from "../../shared/types"; +import { Chip } from "../shared/chip"; +import { EventDetail } from "../shared/event-detail"; + +const boxPadding = { + px: 4, + py: 3, +}; + +export const SourcesSlideover = ({ + event, + onClose, + open, + subgraph, +}: { + event: HistoryEvent; + onClose: () => void; + open: boolean; + subgraph: Subgraph; +}) => { + let headerText; + switch (event.type) { + case "created": + headerText = "Entity Created"; + break; + case "property-update": + headerText = "Attribute Updated"; + break; + case "type-update": + headerText = "Type Updated"; + break; + } + + const sources = + (event.type === "property-update" + ? event.provenance.property?.sources + : event.provenance.edition.sources) ?? []; + + return ( + zIndex.drawer + 2, + justifyContent: "flex-end", + }} + > + + palette.common.white, + }} + > + `1px solid ${palette.gray[20]}`, + }} + > + palette.gray[90], mb: 2 }} + > + {headerText} + + + + + + palette.gray[10], + flexGrow: 1, + }} + > + palette.gray[90], mb: 2 }} + > + Sources + + ({ + background: palette.common.white, + borderRadius: 1, + boxShadow: ({ boxShadows }) => boxShadows.xs, + "th, td": { + padding: "12px 16px", + "&:first-of-type": { + paddingLeft: "24px", + }, + "&:last-of-type": { + paddingRight: "24px", + }, + }, + th: { + borderBottom: `1px solid ${palette.gray[20]}`, + }, + }), + ]} + > + + + Type + Title + Location + + + + {sources.map(({ type, location }, index) => ( + + + + ({ + fontSize: 12, + color: theme.palette.blue[70], + mr: 0.6, + })} + /> + + {type} + + + + palette.gray[80], + }} + > + {location?.name ?? "Unknown"} + + palette.gray[80], + }} + > + {location?.uri ? ( + + {location.uri} + + ) : ( + "Unknown" + )} + + + ))} + +
+
+
+
+
+ ); +}; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/chip.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/chip.tsx new file mode 100644 index 00000000000..b80d6aec5a0 --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/chip.tsx @@ -0,0 +1,37 @@ +import type { SxProps, Theme } from "@mui/material"; +import { Stack } from "@mui/material"; +import type { PropsWithChildren } from "react"; + +export const Chip = ({ + children, + type, + sx, + value, +}: PropsWithChildren<{ + type?: boolean; + sx?: SxProps; + value?: boolean; +}>) => ( + ({ + background: palette.common.white, + border: `1px solid ${palette.gray[30]}`, + borderRadius: type ? 4 : 2, + fontWeight: 500, + fontSize: 12, + maxWidth: 200, + px: value ? 1.2 : 1, + py: 0.5, + overflow: "hidden", + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }), + ...(Array.isArray(sx) ? sx : [sx]), + ]} + > + {children} + +); diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/event-detail.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/event-detail.tsx new file mode 100644 index 00000000000..2506e0aaa3b --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/history-table/shared/event-detail.tsx @@ -0,0 +1,67 @@ +import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label"; +import type { EntityRootType, Subgraph } from "@local/hash-subgraph"; +import { Box } from "@mui/material"; + +import type { HistoryEvent } from "../../shared/types"; +import { Chip } from "./chip"; + +export const EventDetail = ({ + event, + subgraph, +}: { + event: HistoryEvent; + subgraph: Subgraph; +}) => { + switch (event.type) { + case "created": { + const entityLabel = generateEntityLabel( + subgraph as Subgraph, + event.entity, + ); + return ( + <> + {entityLabel} + created with type + {event.entityType.title} + + ); + } + case "property-update": { + const { diff, propertyType } = event; + + switch (diff.op) { + case "added": { + return ( + <> + {propertyType.title} added as + {diff.added} + + ); + } + case "removed": { + return ( + <> + {propertyType.title}{" "} + removed, was + {diff.removed} + + ); + } + case "changed": { + return ( + <> + {propertyType.title}{" "} + updated from + {diff.old} + to + {diff.new} + + ); + } + } + break; + } + case "type-update": + return Updated type; + } +}; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/shared/types.ts b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/shared/types.ts new file mode 100644 index 00000000000..45f0d9fa8ee --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-editor/history-section/shared/types.ts @@ -0,0 +1,45 @@ +import type { + EntityEditionProvenance, + EntityType, + PropertyDiff, + PropertyProvenance, + PropertyType, +} from "@local/hash-graph-client"; +import type { Entity } from "@local/hash-subgraph"; + +type HistoryEventBase = { + number: string; + timestamp: string; +}; + +type CreationEvent = HistoryEventBase & { + type: "created"; + entity: Entity; + entityType: EntityType; + provenance: { + edition: EntityEditionProvenance; + }; +}; + +type PropertyUpdateEvent = HistoryEventBase & { + type: "property-update"; + diff: PropertyDiff; + propertyType: PropertyType; + provenance: { + edition: EntityEditionProvenance; + property?: PropertyProvenance; + }; +}; + +type TypeUpdateEvent = HistoryEventBase & { + type: "type-update"; + entityType: EntityType; + provenance: { + edition: EntityEditionProvenance; + }; +}; + +export type HistoryEvent = + | CreationEvent + | PropertyUpdateEvent + | TypeUpdateEvent; diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper.tsx index 559b325b68f..d19e0b5a0de 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper.tsx @@ -14,7 +14,7 @@ export const EntityPageWrapper = ({ {header} - {children} + {children} ); diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper/entity-page-header.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper/entity-page-header.tsx index 13258f3be78..46e64ef61d7 100644 --- a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper/entity-page-header.tsx +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/entity-page-wrapper/entity-page-header.tsx @@ -11,6 +11,7 @@ import { useContext } from "react"; import { NotificationsWithLinksContextProvider } from "../../../../shared/notifications-with-links-context"; import { TopContextBar } from "../../../../shared/top-context-bar"; import { WorkspaceContext } from "../../../../shared/workspace-context"; +import { EntityEditorTabs } from "../shared/entity-editor-tabs"; import { DraftEntityBanner } from "./draft-entity-banner"; export const EntityPageHeader = ({ @@ -22,6 +23,7 @@ export const EntityPageHeader = ({ chip, editBar, isModifyingEntity, + showTabs, }: { entity?: Entity; entitySubgraph?: Subgraph; @@ -31,6 +33,7 @@ export const EntityPageHeader = ({ chip: ReactNode; editBar?: ReactNode; isModifyingEntity?: boolean; + showTabs?: boolean; }) => { const router = useRouter(); @@ -83,7 +86,8 @@ export const EntityPageHeader = ({ {editBar} ({ background: palette.common.white })} > @@ -99,6 +103,11 @@ export const EntityPageHeader = ({ {entityLabel}
+ {showTabs && ( + + + + )} diff --git a/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/entity-editor-tabs.tsx b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/entity-editor-tabs.tsx new file mode 100644 index 00000000000..18e7beb2edd --- /dev/null +++ b/apps/hash-frontend/src/pages/[shortname]/entities/[entity-uuid].page/shared/entity-editor-tabs.tsx @@ -0,0 +1,53 @@ +import { Box } from "@mui/material"; +import { useRouter } from "next/router"; + +import { TabLink } from "../../../../../shared/ui/tab-link"; +import { Tabs } from "../../../../../shared/ui/tabs"; + +export type EntityEditorTab = "overview" | "history"; + +const defaultTab: EntityEditorTab = "overview"; + +export const getTabUrl = (tab: string) => { + const url = new URL(window.location.href); + const searchParams = new URLSearchParams(url.search); + + searchParams.delete("tab"); + + if (tab === defaultTab) { + return `${url.pathname}?${searchParams.toString()}`; + } + + searchParams.set("tab", tab); + + return `${url.pathname}?${searchParams.toString()}`; +}; + +export const useEntityEditorTab = () => { + const router = useRouter(); + + return router.query.tab ?? defaultTab; +}; + +export const EntityEditorTabs = () => { + const currentTab = useEntityEditorTab(); + + return ( + + + + + + + ); +}; diff --git a/apps/hash-frontend/src/pages/admin/users.page.tsx b/apps/hash-frontend/src/pages/admin/users.page.tsx index a775e8c978f..ab885508abc 100644 --- a/apps/hash-frontend/src/pages/admin/users.page.tsx +++ b/apps/hash-frontend/src/pages/admin/users.page.tsx @@ -27,7 +27,7 @@ const AdminUsersPage: NextPageWithLayout = () => { return ( <> - Registered Users + Registered Users {users ? `(${users.length})` : ""} {/* @todo: we probably want to use a more customizable version of the `EntitiesTable` instead */} = { id: FieldId; label: string; sortable: boolean; + textSx?: SxProps; width: number | string; }; @@ -146,7 +147,14 @@ const HeaderContent = ({ justifyContent="space-between" alignItems="center" > - + {column.label} {column.sortable && ( diff --git a/libs/@hashintel/design-system/src/chip.tsx b/libs/@hashintel/design-system/src/chip.tsx index b8078b219f0..78a2ef48994 100644 --- a/libs/@hashintel/design-system/src/chip.tsx +++ b/libs/@hashintel/design-system/src/chip.tsx @@ -45,6 +45,7 @@ export const Chip = forwardRef( color: palette[color][50], }, }), + py: 0.1, }), ...(Array.isArray(sx) ? sx : [sx]), ]} diff --git a/libs/@hashintel/design-system/src/components.ts b/libs/@hashintel/design-system/src/components.ts index 96f746ff7a9..25f0c772287 100644 --- a/libs/@hashintel/design-system/src/components.ts +++ b/libs/@hashintel/design-system/src/components.ts @@ -36,6 +36,7 @@ export * from "./icon-circle-one-regular"; export * from "./icon-circle-plus"; export * from "./icon-clock-regular"; export * from "./icon-close"; +export * from "./icon-code"; export * from "./icon-dash"; export * from "./icon-discord"; export * from "./icon-download-regular"; diff --git a/libs/@hashintel/design-system/src/icon-code.tsx b/libs/@hashintel/design-system/src/icon-code.tsx new file mode 100644 index 00000000000..19e492fafb9 --- /dev/null +++ b/libs/@hashintel/design-system/src/icon-code.tsx @@ -0,0 +1,17 @@ +import type { SvgIconProps } from "@mui/material"; +import { SvgIcon } from "@mui/material"; +import type { FunctionComponent } from "react"; + +export const CodeIcon: FunctionComponent = (props) => { + return ( + + + + ); +}; diff --git a/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts b/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts index 96645d0b178..891e7ade3c3 100644 --- a/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts +++ b/libs/@local/hash-isomorphic-utils/src/graphql/scalar-mapping.ts @@ -36,6 +36,8 @@ export const scalars = { EntityTemporalVersioningMetadata: "@local/hash-graph-types/entity#EntityTemporalVersioningMetadata", EntityPropertiesObject: "@local/hash-subgraph#EntityPropertiesObject", + DiffEntityInput: "@local/hash-subgraph#DiffEntityInput", + DiffEntityResult: "@local/hash-graph-client#DiffEntityResult", Filter: "@local/hash-graph-client#Filter", diff --git a/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/entity.typedef.ts b/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/entity.typedef.ts index 63c701c44bc..09dd1ec76ec 100644 --- a/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/entity.typedef.ts +++ b/libs/@local/hash-isomorphic-utils/src/graphql/type-defs/knowledge/entity.typedef.ts @@ -82,6 +82,14 @@ export const entityTypedef = gql` subject: EntityAuthorizationSubject! } + scalar DiffEntityInput + scalar DiffEntityResult + + type EntityDiff { + input: DiffEntityInput! + diff: DiffEntityResult! + } + extend type Query { """ Implementation of the Block Protocol queryEntities hook @@ -136,6 +144,8 @@ export const entityTypedef = gql` ): [EntityAuthorizationRelationship!]! checkUserPermissionsOnEntity(metadata: EntityMetadata!): UserPermissions! + + getEntityDiffs(inputs: [DiffEntityInput!]!): [EntityDiff!]! } enum AuthorizationSubjectKind { diff --git a/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts b/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts index 141b9e87ff1..10a0edf566d 100644 --- a/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts +++ b/libs/@local/hash-isomorphic-utils/src/subgraph-mapping.ts @@ -43,12 +43,15 @@ export const mapGraphApiEntityMetadataToMetadata = ( `Expected entity metadata to have exactly one entity type id, but got ${metadata.entityTypeIds.length}`, ); } + return { recordId: metadata.recordId, entityTypeId: metadata.entityTypeIds[0], temporalVersioning: metadata.temporalVersioning, provenance: metadata.provenance, archived: metadata.archived, + confidence: metadata.confidence, + properties: metadata.properties, } as EntityMetadata; }; diff --git a/libs/@local/hash-subgraph/src/types/element/knowledge.ts b/libs/@local/hash-subgraph/src/types/element/knowledge.ts index fe8a1601429..63e349e3501 100644 --- a/libs/@local/hash-subgraph/src/types/element/knowledge.ts +++ b/libs/@local/hash-subgraph/src/types/element/knowledge.ts @@ -9,6 +9,7 @@ import type { } from "@blockprotocol/graph/temporal"; import type { Brand } from "@local/advanced-types/brand"; import type { Subtype } from "@local/advanced-types/subtype"; +import type { DiffEntityParams } from "@local/hash-graph-client"; import type { EntityId, EntityMetadata, @@ -81,3 +82,15 @@ export type LinkEntityAndRightEntity = Subtype< rightEntity: Entity[]; } >; + +export type DiffEntityInput = Subtype< + DiffEntityParams, + { + firstEntityId: EntityId; + firstTransactionTime: Timestamp | null; + firstDecisionTime: Timestamp | null; + secondEntityId: EntityId; + secondDecisionTime: Timestamp | null; + secondTransactionTime: Timestamp | null; + } +>; From 4ee6d4357aaa3771f2f3d0764a55257b992ad90f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 13:35:15 +0000 Subject: [PATCH 21/27] Update Rust toolchains to nightly-2024-05-27 (#4522) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tim Diekmann Co-authored-by: Bilal Mahmoud Co-authored-by: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> --- .clippy.toml | 1 + apps/hash-graph/libs/api/src/rest/account.rs | 2 -- .../hash-graph/libs/api/src/rest/data_type.rs | 2 -- apps/hash-graph/libs/api/src/rest/entity.rs | 2 -- .../libs/api/src/rest/entity_type.rs | 2 -- .../libs/api/src/rest/property_type.rs | 2 -- apps/hash-graph/libs/api/src/rest/web.rs | 2 -- apps/hash-graph/libs/graph/src/lib.rs | 1 - apps/hash-graph/libs/graph/src/store/crud.rs | 10 +++---- .../libs/graph/src/store/fetcher.rs | 2 +- .../libs/graph/src/store/postgres/crud.rs | 20 ++++++------- .../store/postgres/knowledge/entity/query.rs | 12 ++++---- .../graph/src/store/postgres/migration.rs | 1 - .../src/store/postgres/ontology/data_type.rs | 6 ++-- .../store/postgres/ontology/entity_type.rs | 6 ++-- .../graph/src/store/postgres/ontology/mod.rs | 6 ++-- .../store/postgres/ontology/property_type.rs | 6 ++-- .../graph/src/store/postgres/query/mod.rs | 10 +++---- .../libs/graph/src/subgraph/edges/endpoint.rs | 10 +++---- .../libs/graph/src/subgraph/edges/kind.rs | 2 +- apps/hash/README.md | 2 +- libs/@local/codec/src/bytes.rs | 4 +-- .../harpc/wire-protocol/src/codec/buffer.rs | 8 +++++ .../hash-graph-types/rust/src/embedding.rs | 22 ++++++++------ .../rust/src/knowledge/property/mod.rs | 8 ++--- .../rust/src/knowledge/property/object.rs | 4 +++ libs/@local/hash-validation/src/data_type.rs | 16 +++++----- .../@local/hash-validation/src/entity_type.rs | 29 ++++++++---------- libs/@local/hash-validation/src/property.rs | 4 +-- .../hash-validation/src/property_type.rs | 16 +++++----- .../temporal-versioning/src/interval.rs | 8 ++--- libs/antsi/rust-toolchain.toml | 2 +- libs/deer/Cargo.toml | 11 +++++-- libs/deer/desert/Cargo.toml | 15 +++++++--- libs/deer/json/Cargo.toml | 8 +++-- libs/deer/rust-toolchain.toml | 2 +- libs/deer/src/impls/core/num/integral.rs | 16 +++++----- libs/deer/src/impls/core/ops.rs | 5 ++-- libs/deer/src/impls/core/string.rs | 4 +-- libs/deer/tests/test_bound.rs | 30 +++++++++++-------- libs/deer/tests/test_struct_visitor.rs | 12 ++++---- libs/error-stack/README.md | 2 +- libs/error-stack/macros/README.md | 2 +- libs/error-stack/rust-toolchain.toml | 2 +- libs/error-stack/src/lib.rs | 2 +- libs/error-stack/tests/test_debug.rs | 6 ++-- libs/error-stack/tests/ui/into_report.stderr | 8 +++++ libs/sarif/clippy.toml | 5 ---- libs/sarif/rust-toolchain.toml | 2 +- rust-toolchain.toml | 2 +- tests/hash-graph-benches/read_scaling/lib.rs | 4 --- .../representative_read/lib.rs | 4 --- 52 files changed, 194 insertions(+), 176 deletions(-) delete mode 100644 libs/sarif/clippy.toml diff --git a/.clippy.toml b/.clippy.toml index 6786a1d64e4..62bc58c726b 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -3,3 +3,4 @@ allow-expect-in-tests = true allow-print-in-tests = true suppress-restriction-lint-in-const = true doc-valid-idents = ["SpiceDB", "OpenAPI", ".."] +allow-renamed-params-for = ["core::fmt::Debug", "core::fmt::Display", "futures_sink::Sink", ".."] diff --git a/apps/hash-graph/libs/api/src/rest/account.rs b/apps/hash-graph/libs/api/src/rest/account.rs index 3ac0d0e2677..13af1143e96 100644 --- a/apps/hash-graph/libs/api/src/rest/account.rs +++ b/apps/hash-graph/libs/api/src/rest/account.rs @@ -1,7 +1,5 @@ //! Web routes for CRU operations on accounts. -#![expect(clippy::str_to_string)] - use std::sync::Arc; use authorization::{ diff --git a/apps/hash-graph/libs/api/src/rest/data_type.rs b/apps/hash-graph/libs/api/src/rest/data_type.rs index 6e706cb9bfb..77ebd14b9fb 100644 --- a/apps/hash-graph/libs/api/src/rest/data_type.rs +++ b/apps/hash-graph/libs/api/src/rest/data_type.rs @@ -1,7 +1,5 @@ //! Web routes for CRU operations on Data Types. -#![expect(clippy::str_to_string)] - use std::sync::Arc; use authorization::{ diff --git a/apps/hash-graph/libs/api/src/rest/entity.rs b/apps/hash-graph/libs/api/src/rest/entity.rs index 9b6bfde9c0a..c42264532e1 100644 --- a/apps/hash-graph/libs/api/src/rest/entity.rs +++ b/apps/hash-graph/libs/api/src/rest/entity.rs @@ -1,7 +1,5 @@ //! Web routes for CRU operations on entities. -#![expect(clippy::str_to_string)] - use std::sync::Arc; use authorization::{ diff --git a/apps/hash-graph/libs/api/src/rest/entity_type.rs b/apps/hash-graph/libs/api/src/rest/entity_type.rs index ac529261bae..8371ce2de76 100644 --- a/apps/hash-graph/libs/api/src/rest/entity_type.rs +++ b/apps/hash-graph/libs/api/src/rest/entity_type.rs @@ -1,7 +1,5 @@ //! Web routes for CRU operations on Entity types. -#![expect(clippy::str_to_string)] - use std::{collections::hash_map, sync::Arc}; use authorization::{ diff --git a/apps/hash-graph/libs/api/src/rest/property_type.rs b/apps/hash-graph/libs/api/src/rest/property_type.rs index e1b6608806f..0aaa1e0bb1e 100644 --- a/apps/hash-graph/libs/api/src/rest/property_type.rs +++ b/apps/hash-graph/libs/api/src/rest/property_type.rs @@ -1,7 +1,5 @@ //! Web routes for CRU operations on Property types. -#![expect(clippy::str_to_string)] - use std::sync::Arc; use authorization::{ diff --git a/apps/hash-graph/libs/api/src/rest/web.rs b/apps/hash-graph/libs/api/src/rest/web.rs index 5e828e6251b..188cc1d2ef4 100644 --- a/apps/hash-graph/libs/api/src/rest/web.rs +++ b/apps/hash-graph/libs/api/src/rest/web.rs @@ -1,7 +1,5 @@ //! Web routes for CRU operations on webs. -#![expect(clippy::str_to_string)] - use std::sync::Arc; use authorization::{ diff --git a/apps/hash-graph/libs/graph/src/lib.rs b/apps/hash-graph/libs/graph/src/lib.rs index a6b3d96e66d..d24bf5e6a33 100644 --- a/apps/hash-graph/libs/graph/src/lib.rs +++ b/apps/hash-graph/libs/graph/src/lib.rs @@ -17,7 +17,6 @@ #![expect( unreachable_pub, clippy::significant_drop_tightening, - clippy::significant_drop_in_scrutinee, reason = "This should be enabled but it's currently too noisy" )] diff --git a/apps/hash-graph/libs/graph/src/store/crud.rs b/apps/hash-graph/libs/graph/src/store/crud.rs index c86f97b2e7e..0e27e75c4b1 100644 --- a/apps/hash-graph/libs/graph/src/store/crud.rs +++ b/apps/hash-graph/libs/graph/src/store/crud.rs @@ -17,10 +17,10 @@ use crate::{ }; pub trait QueryResult { - type Artifacts: Send; + type Indices: Send; - fn decode_record(&self, artifacts: &Self::Artifacts) -> R; - fn decode_cursor(&self, artifacts: &Self::Artifacts) -> ::Cursor; + fn decode_record(&self, indices: &Self::Indices) -> R; + fn decode_cursor(&self, indices: &Self::Indices) -> ::Cursor; } pub trait Sorting { @@ -165,7 +165,7 @@ pub trait ReadPaginated>: Output = Result< ( Self::ReadPaginatedStream, - >::Artifacts, + >::Indices, ), QueryError, >, @@ -183,7 +183,7 @@ pub trait ReadPaginated>: Output = Result< ( Vec, - >::Artifacts, + >::Indices, ), QueryError, >, diff --git a/apps/hash-graph/libs/graph/src/store/fetcher.rs b/apps/hash-graph/libs/graph/src/store/fetcher.rs index a76defafee8..f5839759166 100644 --- a/apps/hash-graph/libs/graph/src/store/fetcher.rs +++ b/apps/hash-graph/libs/graph/src/store/fetcher.rs @@ -724,7 +724,7 @@ where ) -> Result< ( Self::ReadPaginatedStream, - >::Artifacts, + >::Indices, ), QueryError, > { diff --git a/apps/hash-graph/libs/graph/src/store/postgres/crud.rs b/apps/hash-graph/libs/graph/src/store/postgres/crud.rs index 553220a7e4d..5861d77bc7f 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/crud.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/crud.rs @@ -14,16 +14,16 @@ use crate::{ subgraph::temporal_axes::QueryTemporalAxes, }; -pub struct QueryArtifacts { - record_indices: R::CompilationArtifacts, - cursor_indices: S::CompilationArtifacts, +pub struct QueryIndices { + record_indices: R::Indices, + cursor_indices: S::Indices, } pub trait QueryRecordDecode { - type CompilationArtifacts: Send + Sync + 'static; + type Indices: Send + Sync + 'static; type Output; - fn decode(row: &Row, artifacts: &Self::CompilationArtifacts) -> Self::Output; + fn decode(row: &Row, indices: &Self::Indices) -> Self::Output; } impl QueryResult for Row @@ -31,13 +31,13 @@ where R: QueryRecordDecode, S: Sorting + QueryRecordDecode, { - type Artifacts = QueryArtifacts; + type Indices = QueryIndices; - fn decode_record(&self, indices: &Self::Artifacts) -> R { + fn decode_record(&self, indices: &Self::Indices) -> R { R::decode(self, &indices.record_indices) } - fn decode_cursor(&self, indices: &Self::Artifacts) -> S::Cursor { + fn decode_cursor(&self, indices: &Self::Indices) -> S::Cursor { S::decode(self, &indices.cursor_indices) } } @@ -66,7 +66,7 @@ where sorting: &S, limit: Option, include_drafts: bool, - ) -> Result<(Self::ReadPaginatedStream, QueryArtifacts), Report> { + ) -> Result<(Self::ReadPaginatedStream, QueryIndices), Report> { let cursor_parameters = sorting.encode().change_context(QueryError)?; let mut compiler = SelectCompiler::new(temporal_axes, include_drafts); @@ -95,7 +95,7 @@ where Ok(( stream.map(|row| row.change_context(QueryError)), - QueryArtifacts { + QueryIndices { record_indices, cursor_indices, }, diff --git a/apps/hash-graph/libs/graph/src/store/postgres/knowledge/entity/query.rs b/apps/hash-graph/libs/graph/src/store/postgres/knowledge/entity/query.rs index 568d5802255..35524304261 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/knowledge/entity/query.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/knowledge/entity/query.rs @@ -53,10 +53,10 @@ pub struct EntityVertexIdCursorParameters<'p> { } impl QueryRecordDecode for VertexIdSorting { - type CompilationArtifacts = EntityVertexIdIndices; + type Indices = EntityVertexIdIndices; type Output = EntityVertexId; - fn decode(row: &Row, indices: &Self::CompilationArtifacts) -> Self::Output { + fn decode(row: &Row, indices: &Self::Indices) -> Self::Output { let ClosedTemporalBound::Inclusive(revision_id) = *row .get::<_, LeftClosedTemporalInterval>(indices.revision_id) .start(); @@ -92,7 +92,7 @@ impl<'s> PostgresSorting<'s, Entity> for VertexIdSorting { compiler: &mut SelectCompiler<'p, 'q, Entity>, parameters: Option<&'p Self::CompilationParameters>, temporal_axes: &QueryTemporalAxes, - ) -> Self::CompilationArtifacts { + ) -> Self::Indices { let revision_id_path = match temporal_axes.variable_time_axis() { TimeAxis::TransactionTime => &EntityQueryPath::TransactionTime, TimeAxis::DecisionTime => &EntityQueryPath::DecisionTime, @@ -234,10 +234,10 @@ impl Default for EntityRecordPaths<'_> { } impl QueryRecordDecode for Entity { - type CompilationArtifacts = EntityRecordRowIndices; + type Indices = EntityRecordRowIndices; type Output = Self; - fn decode(row: &Row, indices: &Self::CompilationArtifacts) -> Self { + fn decode(row: &Row, indices: &Self::Indices) -> Self { let link_data = { let left_owned_by_id: Option = row.get(indices.left_entity_owned_by_id); let left_entity_uuid: Option = row.get(indices.left_entity_uuid); @@ -358,7 +358,7 @@ impl PostgresRecord for Entity { fn compile<'p, 'q: 'p>( compiler: &mut SelectCompiler<'p, 'q, Self>, paths: &'p Self::CompilationParameters, - ) -> Self::CompilationArtifacts { + ) -> Self::Indices { EntityRecordRowIndices { owned_by_id: compiler.add_distinct_selection_with_ordering( &EntityQueryPath::OwnedById, diff --git a/apps/hash-graph/libs/graph/src/store/postgres/migration.rs b/apps/hash-graph/libs/graph/src/store/postgres/migration.rs index 2d0b6874355..cb5b9dc9553 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/migration.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/migration.rs @@ -8,7 +8,6 @@ use crate::store::{ migration::{Migration, MigrationState, StoreMigration}, }; -#[expect(clippy::str_to_string)] mod embedded { use refinery::embed_migrations; embed_migrations!("../../postgres_migrations"); diff --git a/apps/hash-graph/libs/graph/src/store/postgres/ontology/data_type.rs b/apps/hash-graph/libs/graph/src/store/postgres/ontology/data_type.rs index e7de5e943fb..09e4717d9df 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/ontology/data_type.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/ontology/data_type.rs @@ -742,10 +742,10 @@ pub struct DataTypeRowIndices { } impl QueryRecordDecode for DataTypeWithMetadata { - type CompilationArtifacts = DataTypeRowIndices; + type Indices = DataTypeRowIndices; type Output = Self; - fn decode(row: &Row, indices: &Self::CompilationArtifacts) -> Self { + fn decode(row: &Row, indices: &Self::Indices) -> Self { let record_id = OntologyTypeRecordId { base_url: row.get(indices.base_url), version: row.get(indices.version), @@ -789,7 +789,7 @@ impl PostgresRecord for DataTypeWithMetadata { fn compile<'p, 'q: 'p>( compiler: &mut SelectCompiler<'p, 'q, Self>, _paths: &Self::CompilationParameters, - ) -> Self::CompilationArtifacts { + ) -> Self::Indices { DataTypeRowIndices { base_url: compiler.add_distinct_selection_with_ordering( &DataTypeQueryPath::BaseUrl, diff --git a/apps/hash-graph/libs/graph/src/store/postgres/ontology/entity_type.rs b/apps/hash-graph/libs/graph/src/store/postgres/ontology/entity_type.rs index 4f19c5d4ba2..a1bade47cc3 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/ontology/entity_type.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/ontology/entity_type.rs @@ -1103,10 +1103,10 @@ pub struct EntityTypeRowIndices { } impl QueryRecordDecode for EntityTypeWithMetadata { - type CompilationArtifacts = EntityTypeRowIndices; + type Indices = EntityTypeRowIndices; type Output = Self; - fn decode(row: &Row, indices: &Self::CompilationArtifacts) -> Self { + fn decode(row: &Row, indices: &Self::Indices) -> Self { let record_id = OntologyTypeRecordId { base_url: row.get(indices.base_url), version: row.get(indices.version), @@ -1156,7 +1156,7 @@ impl PostgresRecord for EntityTypeWithMetadata { fn compile<'p, 'q: 'p>( compiler: &mut SelectCompiler<'p, 'q, Self>, _paths: &Self::CompilationParameters, - ) -> Self::CompilationArtifacts { + ) -> Self::Indices { EntityTypeRowIndices { base_url: compiler.add_distinct_selection_with_ordering( &EntityTypeQueryPath::BaseUrl, diff --git a/apps/hash-graph/libs/graph/src/store/postgres/ontology/mod.rs b/apps/hash-graph/libs/graph/src/store/postgres/ontology/mod.rs index 36d29c4b79d..daa968377f9 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/ontology/mod.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/ontology/mod.rs @@ -148,10 +148,10 @@ pub struct VersionedUrlIndices { macro_rules! impl_ontology_cursor { ($ty:ty, $query_path:ty) => { impl QueryRecordDecode for VertexIdSorting<$ty> { - type CompilationArtifacts = VersionedUrlIndices; + type Indices = VersionedUrlIndices; type Output = <$ty as SubgraphRecord>::VertexId; - fn decode(row: &Row, indices: &Self::CompilationArtifacts) -> Self::Output { + fn decode(row: &Row, indices: &Self::Indices) -> Self::Output { Self::Output { base_id: BaseUrl::new(row.get(indices.base_url)) .expect("invalid base URL returned from Postgres"), @@ -176,7 +176,7 @@ macro_rules! impl_ontology_cursor { compiler: &mut SelectCompiler<'p, 'q, $ty>, parameters: Option<&'p Self::CompilationParameters>, _: &QueryTemporalAxes, - ) -> Self::CompilationArtifacts { + ) -> Self::Indices { if let Some(parameters) = parameters { let base_url_expression = compiler.compile_parameter(¶meters.base_url).0; let version_expression = compiler.compile_parameter(¶meters.version).0; diff --git a/apps/hash-graph/libs/graph/src/store/postgres/ontology/property_type.rs b/apps/hash-graph/libs/graph/src/store/postgres/ontology/property_type.rs index ffb03bab13d..31bed818495 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/ontology/property_type.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/ontology/property_type.rs @@ -883,10 +883,10 @@ pub struct PropertyTypeRowIndices { } impl QueryRecordDecode for PropertyTypeWithMetadata { - type CompilationArtifacts = PropertyTypeRowIndices; + type Indices = PropertyTypeRowIndices; type Output = Self; - fn decode(row: &Row, indices: &Self::CompilationArtifacts) -> Self { + fn decode(row: &Row, indices: &Self::Indices) -> Self { let record_id = OntologyTypeRecordId { base_url: row.get(indices.base_url), version: row.get(indices.version), @@ -930,7 +930,7 @@ impl PostgresRecord for PropertyTypeWithMetadata { fn compile<'p, 'q: 'p>( compiler: &mut SelectCompiler<'p, 'q, Self>, _paths: &Self::CompilationParameters, - ) -> Self::CompilationArtifacts { + ) -> Self::Indices { PropertyTypeRowIndices { base_url: compiler.add_distinct_selection_with_ordering( &PropertyTypeQueryPath::BaseUrl, diff --git a/apps/hash-graph/libs/graph/src/store/postgres/query/mod.rs b/apps/hash-graph/libs/graph/src/store/postgres/query/mod.rs index ac0c2fc8d83..c4bfcf61ee0 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/query/mod.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/query/mod.rs @@ -67,7 +67,7 @@ pub trait PostgresRecord: QueryRecord + QueryRecordDecode { fn compile<'p, 'q: 'p>( compiler: &mut SelectCompiler<'p, 'q, Self>, paths: &'p Self::CompilationParameters, - ) -> Self::CompilationArtifacts; + ) -> Self::Indices; } /// An absolute path inside of a query pointing to an attribute. @@ -110,7 +110,7 @@ pub trait PostgresSorting<'s, R: QueryRecord>: compiler: &mut SelectCompiler<'p, 'q, R>, parameters: Option<&'p Self::CompilationParameters>, temporal_axes: &QueryTemporalAxes, - ) -> Self::CompilationArtifacts + ) -> Self::Indices where 's: 'q; } @@ -211,10 +211,10 @@ impl ToSql for CursorField<'_> { } impl<'s> QueryRecordDecode for EntityQuerySorting<'s> { - type CompilationArtifacts = Vec; + type Indices = Vec; type Output = EntityQueryCursor<'s>; - fn decode(row: &Row, indices: &Self::CompilationArtifacts) -> Self::Output { + fn decode(row: &Row, indices: &Self::Indices) -> Self::Output { EntityQueryCursor { values: indices.iter().map(|i| row.get(i)).collect(), } @@ -237,7 +237,7 @@ where compiler: &mut SelectCompiler<'p, 'q, Entity>, _: Option<&'p Self::CompilationParameters>, _: &QueryTemporalAxes, - ) -> Self::CompilationArtifacts + ) -> Self::Indices where 's: 'q, { diff --git a/apps/hash-graph/libs/graph/src/subgraph/edges/endpoint.rs b/apps/hash-graph/libs/graph/src/subgraph/edges/endpoint.rs index 464ed76a1ef..9ce4dae2780 100644 --- a/apps/hash-graph/libs/graph/src/subgraph/edges/endpoint.rs +++ b/apps/hash-graph/libs/graph/src/subgraph/edges/endpoint.rs @@ -20,8 +20,8 @@ pub trait EdgeEndpointSet: IntoIterator { impl EdgeEndpointSet for HashSet { type EdgeEndpoint = E; - fn insert(&mut self, edge_target_id: Self::EdgeEndpoint) { - Self::insert(self, edge_target_id); + fn insert(&mut self, target_id: Self::EdgeEndpoint) { + Self::insert(self, target_id); } } @@ -89,10 +89,10 @@ impl IntoIterator for EntityIdWithIntervalSet { impl EdgeEndpointSet for EntityIdWithIntervalSet { type EdgeEndpoint = EntityIdWithInterval; - fn insert(&mut self, edge_target_id: Self::EdgeEndpoint) { + fn insert(&mut self, target_id: Self::EdgeEndpoint) { self.inner - .entry(edge_target_id.entity_id) + .entry(target_id.entity_id) .or_default() - .insert(edge_target_id.interval); + .insert(target_id.interval); } } diff --git a/apps/hash-graph/libs/graph/src/subgraph/edges/kind.rs b/apps/hash-graph/libs/graph/src/subgraph/edges/kind.rs index 3e072869bc7..2f02b3da26f 100644 --- a/apps/hash-graph/libs/graph/src/subgraph/edges/kind.rs +++ b/apps/hash-graph/libs/graph/src/subgraph/edges/kind.rs @@ -224,7 +224,7 @@ impl GraphResolveDepths { } pub trait GraphResolveDepthIndex { - fn depth_mut(self, direction: EdgeDirection, dephts: &mut GraphResolveDepths) -> &mut u8; + fn depth_mut(self, direction: EdgeDirection, depths: &mut GraphResolveDepths) -> &mut u8; } impl GraphResolveDepthIndex for OntologyEdgeKind { diff --git a/apps/hash/README.md b/apps/hash/README.md index ce1e424f383..f50058bd5d4 100644 --- a/apps/hash/README.md +++ b/apps/hash/README.md @@ -63,7 +63,7 @@ To run HASH locally, please follow these steps: ## ≥ 1.16 rustc --version - ## ≥ 2024-05-20 (If installed through rustup, this will automatically install the required toolchain) + ## ≥ 2024-05-27 (If installed through rustup, this will automatically install the required toolchain) cargo --version ## Version matching the above rustc version diff --git a/libs/@local/codec/src/bytes.rs b/libs/@local/codec/src/bytes.rs index 253cd83e3a8..4bf9a283cdc 100644 --- a/libs/@local/codec/src/bytes.rs +++ b/libs/@local/codec/src/bytes.rs @@ -66,9 +66,9 @@ impl Decoder for JsonLinesDecoder { type Error = Report; type Item = T; - fn decode(&mut self, buf: &mut BytesMut) -> Result, Self::Error> { + fn decode(&mut self, src: &mut BytesMut) -> Result, Self::Error> { self.lines - .decode(buf) + .decode(src) .map(|line| { self.current_line += 1; line diff --git a/libs/@local/harpc/wire-protocol/src/codec/buffer.rs b/libs/@local/harpc/wire-protocol/src/codec/buffer.rs index 2a678e5bbd7..71a063c4212 100644 --- a/libs/@local/harpc/wire-protocol/src/codec/buffer.rs +++ b/libs/@local/harpc/wire-protocol/src/codec/buffer.rs @@ -94,6 +94,10 @@ where return Err(Report::new(BufferError::EarlyEndOfStream)); } + #[expect( + clippy::needless_borrows_for_generic_args, + reason = "Would move the buffer" + )] Ok(N::unchecked_read_from_buf(&mut self.0)) } @@ -136,6 +140,10 @@ where return Err(Report::new(BufferError::NotEnoughCapacity)); } + #[expect( + clippy::needless_borrows_for_generic_args, + reason = "Would move the buffer" + )] number.unchecked_write_to_buf(&mut self.0); Ok(()) diff --git a/libs/@local/hash-graph-types/rust/src/embedding.rs b/libs/@local/hash-graph-types/rust/src/embedding.rs index 12e61610f20..4ead83dc547 100644 --- a/libs/@local/hash-graph-types/rust/src/embedding.rs +++ b/libs/@local/hash-graph-types/rust/src/embedding.rs @@ -56,13 +56,17 @@ impl<'v> From<&'v [f32]> for Embedding<'v> { impl ToSql for Embedding<'_> { postgres_types::to_sql_checked!(); - fn to_sql(&self, _ty: &Type, w: &mut BytesMut) -> Result> { + fn to_sql( + &self, + _ty: &Type, + out: &mut BytesMut, + ) -> Result> { let dim = self.0.len(); - w.put_u16(dim.try_into()?); - w.put_u16(0); + out.put_u16(dim.try_into()?); + out.put_u16(0); for v in self.0.as_ref() { - w.put_f32(*v); + out.put_f32(*v); } Ok(IsNull::No) @@ -83,12 +87,12 @@ impl<'v> FromSql<'v> for Embedding<'_> { clippy::missing_asserts_for_indexing, reason = "We error if the buffer is too small" )] - fn from_sql(_ty: &Type, buf: &'v [u8]) -> Result> { - if buf.len() < 4 { + fn from_sql(_ty: &Type, raw: &'v [u8]) -> Result> { + if raw.len() < 4 { return Err("expected at least 4 bytes".into()); } - let dim = u16::from_be_bytes(buf[0..2].try_into()?) as usize; - let unused = u16::from_be_bytes(buf[2..4].try_into()?); + let dim = u16::from_be_bytes(raw[0..2].try_into()?) as usize; + let unused = u16::from_be_bytes(raw[2..4].try_into()?); if unused != 0 { return Err("expected unused to be 0".into()); } @@ -96,7 +100,7 @@ impl<'v> FromSql<'v> for Embedding<'_> { let mut vec = Vec::with_capacity(dim); for i in 0..dim { let s = 4 + 4 * i; - vec.push(f32::from_be_bytes(buf[s..s + 4].try_into()?)); + vec.push(f32::from_be_bytes(raw[s..s + 4].try_into()?)); } Ok(Self(Cow::Owned(vec))) diff --git a/libs/@local/hash-graph-types/rust/src/knowledge/property/mod.rs b/libs/@local/hash-graph-types/rust/src/knowledge/property/mod.rs index ec0bcbf7c03..18bfd982a35 100644 --- a/libs/@local/hash-graph-types/rust/src/knowledge/property/mod.rs +++ b/libs/@local/hash-graph-types/rust/src/knowledge/property/mod.rs @@ -225,17 +225,17 @@ impl fmt::Display for Property { } impl PartialEq for Property { - fn eq(&self, rhs: &JsonValue) -> bool { + fn eq(&self, other: &JsonValue) -> bool { match self { Self::Array(lhs) => { - let JsonValue::Array(rhs) = rhs else { + let JsonValue::Array(rhs) = other else { return false; }; lhs == rhs } Self::Object(lhs) => { - let JsonValue::Object(rhs) = rhs else { + let JsonValue::Object(rhs) = other else { return false; }; @@ -245,7 +245,7 @@ impl PartialEq for Property { .map_or(false, |other_value| value == other_value) }) } - Self::Value(lhs) => lhs == rhs, + Self::Value(lhs) => lhs == other, } } } diff --git a/libs/@local/hash-graph-types/rust/src/knowledge/property/object.rs b/libs/@local/hash-graph-types/rust/src/knowledge/property/object.rs index 3e09220e634..3e810a29701 100644 --- a/libs/@local/hash-graph-types/rust/src/knowledge/property/object.rs +++ b/libs/@local/hash-graph-types/rust/src/knowledge/property/object.rs @@ -146,6 +146,10 @@ impl PropertyObject { .collect::, Report>>()?; // TODO: Implement more efficient patching without serialization + #[expect( + clippy::needless_borrows_for_generic_args, + reason = "Would move `self`" + )] let mut this = serde_json::to_value(&self).change_context(PatchError)?; json_patch::patch(&mut this, &patches).change_context(PatchError)?; *self = serde_json::from_value(this).change_context(PatchError)?; diff --git a/libs/@local/hash-validation/src/data_type.rs b/libs/@local/hash-validation/src/data_type.rs index a103adfed78..1f08751de48 100644 --- a/libs/@local/hash-validation/src/data_type.rs +++ b/libs/@local/hash-validation/src/data_type.rs @@ -424,11 +424,11 @@ impl Schema for DataType { async fn validate_value<'a>( &'a self, - property: &'a Property, + value: &'a Property, _: ValidateEntityComponents, _: &'a P, ) -> Result<(), Report> { - match (self.json_type(), property) { + match (self.json_type(), value) { (JsonSchemaValueType::Number, Property::Value(value)) => { #[expect(clippy::float_arithmetic)] check_numeric_additional_property( @@ -458,9 +458,9 @@ impl Schema for DataType { )?; } (expected, _) => ensure!( - property.json_type() == expected, + value.json_type() == expected, DataValidationError::InvalidType { - actual: property.json_type(), + actual: value.json_type(), expected, } ), @@ -469,9 +469,9 @@ impl Schema for DataType { for (additional_key, additional_property) in self.additional_properties() { match additional_key.as_str() { "const" => ensure!( - property == additional_property, + value == additional_property, Report::new(DataTypeConstraint::Const { - actual: property.clone(), + actual: value.clone(), expected: additional_property.clone(), }) .change_context(DataValidationError::ConstraintUnfulfilled) @@ -480,9 +480,9 @@ impl Schema for DataType { ensure!( additional_property .as_array() - .is_some_and(|array| array.iter().any(|expected| property == expected)), + .is_some_and(|array| array.iter().any(|expected| value == expected)), Report::new(DataTypeConstraint::Enum { - actual: property.clone(), + actual: value.clone(), expected: additional_property.clone(), }) .change_context(DataValidationError::ConstraintUnfulfilled) diff --git a/libs/@local/hash-validation/src/entity_type.rs b/libs/@local/hash-validation/src/entity_type.rs index 88f629b6ba7..1baff247772 100644 --- a/libs/@local/hash-validation/src/entity_type.rs +++ b/libs/@local/hash-validation/src/entity_type.rs @@ -86,9 +86,9 @@ where &self, schema: &ClosedEntityType, components: ValidateEntityComponents, - provider: &P, + context: &P, ) -> Result<(), Report> { - schema.validate_value(self, components, provider).await + schema.validate_value(self, components, context).await } } @@ -106,7 +106,7 @@ where &self, schema: &ClosedEntityType, components: ValidateEntityComponents, - provider: &P, + context: &P, ) -> Result<(), Report> { if !components.link_data { return Ok(()); @@ -131,10 +131,7 @@ where extend_report!(status, EntityValidationError::UnexpectedLinkData); } - if let Err(error) = schema - .validate_value(*link_data, components, provider) - .await - { + if let Err(error) = schema.validate_value(*link_data, components, context).await { extend_report!(status, error); } } else if is_link { @@ -159,20 +156,20 @@ where &self, schema: &ClosedEntityType, components: ValidateEntityComponents, - provider: &P, + context: &P, ) -> Result<(), Report> { let mut status: Result<(), Report> = Ok(()); if self.metadata.entity_type_ids.is_empty() { extend_report!(status, EntityValidationError::EmptyEntityTypes); } - if let Err(error) = self.properties.validate(schema, components, provider).await { + if let Err(error) = self.properties.validate(schema, components, context).await { extend_report!(status, error); } if let Err(error) = self .link_data .as_ref() - .validate(schema, components, provider) + .validate(schema, components, context) .await { extend_report!(status, error); @@ -180,7 +177,7 @@ where if let Err(error) = self .metadata .properties - .validate(&self.properties, components, provider) + .validate(&self.properties, components, context) .await { extend_report!(status, error); @@ -200,17 +197,17 @@ where // see https://linear.app/hash/issue/H-972 async fn validate_value<'a>( &'a self, - link_data: &'a LinkData, + value: &'a LinkData, _: ValidateEntityComponents, provider: &'a P, ) -> Result<(), Report> { let mut status: Result<(), Report> = Ok(()); let left_entity = provider - .provide_entity(link_data.left_entity_id) + .provide_entity(value.left_entity_id) .await .change_context_lazy(|| EntityValidationError::EntityRetrieval { - id: link_data.left_entity_id, + id: value.left_entity_id, })?; let left_entity_type = stream::iter(&left_entity.borrow().metadata.entity_type_ids) @@ -230,10 +227,10 @@ where .await?; let right_entity = provider - .provide_entity(link_data.right_entity_id) + .provide_entity(value.right_entity_id) .await .change_context_lazy(|| EntityValidationError::EntityRetrieval { - id: link_data.right_entity_id, + id: value.right_entity_id, })?; let right_entity_type = stream::iter(&right_entity.borrow().metadata.entity_type_ids) diff --git a/libs/@local/hash-validation/src/property.rs b/libs/@local/hash-validation/src/property.rs index e59e807d39a..e1fcca25a43 100644 --- a/libs/@local/hash-validation/src/property.rs +++ b/libs/@local/hash-validation/src/property.rs @@ -21,14 +21,14 @@ where async fn validate( &self, - object: &PropertyObject, + schema: &PropertyObject, _components: ValidateEntityComponents, _provider: &P, ) -> Result<(), Report> { let mut status: Result<(), Report> = Ok(()); for (path, _confidence) in self { - if !object.path_exists(path) { + if !schema.path_exists(path) { extend_report!( status, EntityValidationError::InvalidPropertyPath { diff --git a/libs/@local/hash-validation/src/property_type.rs b/libs/@local/hash-validation/src/property_type.rs index 412fd77f859..08b439d4fd0 100644 --- a/libs/@local/hash-validation/src/property_type.rs +++ b/libs/@local/hash-validation/src/property_type.rs @@ -92,9 +92,9 @@ where &self, schema: &PropertyType, components: ValidateEntityComponents, - provider: &P, + context: &P, ) -> Result<(), Report> { - schema.validate_value(self, components, provider).await + schema.validate_value(self, components, context).await } } @@ -151,7 +151,7 @@ where async fn validate_value<'a>( &'a self, - values: &'a [V], + value: &'a [V], components: ValidateEntityComponents, provider: &'a P, ) -> Result<(), Report> { @@ -159,11 +159,11 @@ where if components.num_items { if let Some(min) = self.min_items() { - if values.len() < min { + if value.len() < min { extend_report!( status, PropertyValidationError::TooFewItems { - actual: values.len(), + actual: value.len(), min, }, ); @@ -171,11 +171,11 @@ where } if let Some(max) = self.max_items().map(NonZero::get) { - if values.len() > max { + if value.len() > max { extend_report!( status, PropertyValidationError::TooManyItems { - actual: values.len(), + actual: value.len(), max, }, ); @@ -183,7 +183,7 @@ where } } - for value in values { + for value in value { if let Err(report) = self .items() .validate_value(value, components, provider) diff --git a/libs/@local/temporal-versioning/src/interval.rs b/libs/@local/temporal-versioning/src/interval.rs index 3b08b8cfa28..a215cf607fc 100644 --- a/libs/@local/temporal-versioning/src/interval.rs +++ b/libs/@local/temporal-versioning/src/interval.rs @@ -539,7 +539,7 @@ where fn to_sql( &self, _: &Type, - buf: &mut BytesMut, + out: &mut BytesMut, ) -> Result> { fn bound_to_sql( bound: Bound<&Timestamp>, @@ -561,7 +561,7 @@ where postgres_protocol::types::range_to_sql( |buf| bound_to_sql(self.start().as_bound(), buf), |buf| bound_to_sql(self.end().as_bound(), buf), - buf, + out, )?; Ok(postgres_types::IsNull::No) } @@ -608,8 +608,8 @@ where S: IntervalBound>, E: IntervalBound>, { - fn from_sql(_: &Type, buf: &[u8]) -> Result> { - match postgres_protocol::types::range_from_sql(buf)? { + fn from_sql(_: &Type, raw: &[u8]) -> Result> { + match postgres_protocol::types::range_from_sql(raw)? { postgres_protocol::types::Range::Empty => { unimplemented!("Empty ranges are not supported") } diff --git a/libs/antsi/rust-toolchain.toml b/libs/antsi/rust-toolchain.toml index eea8b45d89b..62e7b3ebbb0 100644 --- a/libs/antsi/rust-toolchain.toml +++ b/libs/antsi/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-20" +channel = "nightly-2024-05-27" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'rust-analyzer'] diff --git a/libs/deer/Cargo.toml b/libs/deer/Cargo.toml index d71ab1c34bf..18035bb1d80 100644 --- a/libs/deer/Cargo.toml +++ b/libs/deer/Cargo.toml @@ -14,12 +14,17 @@ exclude = ["package.json"] publish = false [dependencies] -error-stack = { git = "https://github.com/hashintel/hash", rev = "0829935", default-features = false } +error-stack = { version = "0.4.1", default-features = false } num-traits = { version = "0.2.19", default-features = false } -serde = { version = "1.0.200", default-features = false, features = ['alloc', 'derive'] } -erased-serde = { version = "0.4.4", default-features = false, features = ['alloc'] } +serde = { version = "1.0.200", default-features = false, features = [ + 'alloc', + 'derive', +] } +erased-serde = { version = "0.4.4", default-features = false, features = [ + 'alloc', +] } [dev-dependencies] serde_json = { version = "1.0.116", features = ['arbitrary_precision'] } diff --git a/libs/deer/desert/Cargo.toml b/libs/deer/desert/Cargo.toml index bbe6eeb6919..fc7c1b02d5f 100644 --- a/libs/deer/desert/Cargo.toml +++ b/libs/deer/desert/Cargo.toml @@ -9,13 +9,20 @@ publish = false [dependencies] deer = { path = ".." } -error-stack = { git = "https://github.com/hashintel/hash", rev = "0829935", default-features = false } -serde_json = { version = "1.0.116", default-features = false, features = ['alloc'] } +error-stack = { version = "0.4.1", default-features = false } +serde_json = { version = "1.0.116", default-features = false, features = [ + 'alloc', +] } serde = { version = "1.0.200", default-features = false, features = ['alloc'] } -bitvec = { version = "1.0.1", default-features = false, features = ['alloc', 'atomic'] } +bitvec = { version = "1.0.1", default-features = false, features = [ + 'alloc', + 'atomic', +] } num-traits = "0.2.19" -similar-asserts = { version = "1.5.0", default-features = false, features = ['serde'], optional = true } +similar-asserts = { version = "1.5.0", default-features = false, features = [ + 'serde', +], optional = true } [features] std = ['deer/std'] diff --git a/libs/deer/json/Cargo.toml b/libs/deer/json/Cargo.toml index 679288ffcd0..6f2b3fcfeef 100644 --- a/libs/deer/json/Cargo.toml +++ b/libs/deer/json/Cargo.toml @@ -15,12 +15,16 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -error-stack = { git = "https://github.com/hashintel/hash", rev = "0829935", default-features = false } +error-stack = { version = "0.4.1", default-features = false } deer = { path = "..", default-features = false } justjson = { version = "0.3.0", default-features = false, features = ['alloc'] } -lexical = { version = "6.1.1", default-features = false, features = ['parse-floats', 'parse-integers', 'format'] } +lexical = { version = "6.1.1", default-features = false, features = [ + 'parse-floats', + 'parse-integers', + 'format', +] } memchr = "2.7.2" [build-dependencies] diff --git a/libs/deer/rust-toolchain.toml b/libs/deer/rust-toolchain.toml index c3e9a0280a4..47349a941d6 100644 --- a/libs/deer/rust-toolchain.toml +++ b/libs/deer/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-20" +channel = "nightly-2024-05-27" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-analyzer'] diff --git a/libs/deer/src/impls/core/num/integral.rs b/libs/deer/src/impls/core/num/integral.rs index 890eccf0f36..8583cd48960 100644 --- a/libs/deer/src/impls/core/num/integral.rs +++ b/libs/deer/src/impls/core/num/integral.rs @@ -130,8 +130,8 @@ impl<'de> Deserialize<'de> for usize { } #[cfg(target_pointer_width = "64")] - fn deserialize>(de: D) -> Result { - u64::deserialize(de).map(|value| value as Self) + fn deserialize>(deserializer: D) -> Result { + u64::deserialize(deserializer).map(|value| value as Self) } } @@ -149,17 +149,17 @@ impl<'de> Deserialize<'de> for isize { type Reflection = Self; #[cfg(target_pointer_width = "16")] - fn deserialize>(de: D) -> Result { - i16::deserialize(de).map(|value| value as Self) + fn deserialize>(deserializer: D) -> Result { + i16::deserialize(deserializer).map(|value| value as Self) } #[cfg(target_pointer_width = "32")] - fn deserialize>(de: D) -> Result { - i32::deserialize(de).map(|value| value as Self) + fn deserialize>(deserializer: D) -> Result { + i32::deserialize(deserializer).map(|value| value as Self) } #[cfg(target_pointer_width = "64")] - fn deserialize>(de: D) -> Result { - i64::deserialize(de).map(|value| value as Self) + fn deserialize>(deserializer: D) -> Result { + i64::deserialize(deserializer).map(|value| value as Self) } } diff --git a/libs/deer/src/impls/core/ops.rs b/libs/deer/src/impls/core/ops.rs index 91f9d294fcf..14d95ab26a3 100644 --- a/libs/deer/src/impls/core/ops.rs +++ b/libs/deer/src/impls/core/ops.rs @@ -100,8 +100,9 @@ where { type Reflection = BoundReflection; - fn deserialize>(de: D) -> Result { - de.deserialize_enum(BoundEnumVisitor(PhantomData)) + fn deserialize>(deserializer: D) -> Result { + deserializer + .deserialize_enum(BoundEnumVisitor(PhantomData)) .change_context(DeserializeError) } } diff --git a/libs/deer/src/impls/core/string.rs b/libs/deer/src/impls/core/string.rs index 4e0608771c6..9c53497403d 100644 --- a/libs/deer/src/impls/core/string.rs +++ b/libs/deer/src/impls/core/string.rs @@ -50,8 +50,8 @@ impl<'de> Visitor<'de> for CharVisitor { Ok(value) } - fn visit_str(self, v: &str) -> Result { - let mut chars = v.chars(); + fn visit_str(self, value: &str) -> Result { + let mut chars = value.chars(); let first = chars.next(); let second = chars.next(); diff --git a/libs/deer/tests/test_bound.rs b/libs/deer/tests/test_bound.rs index 7b9152138c8..ea9b7f6e408 100644 --- a/libs/deer/tests/test_bound.rs +++ b/libs/deer/tests/test_bound.rs @@ -96,8 +96,9 @@ impl<'de> Visitor<'de> for ArrayStatsVisitor { impl<'de> Deserialize<'de> for ArrayStats { type Reflection = Self; - fn deserialize>(de: D) -> Result { - de.deserialize_array(ArrayStatsVisitor) + fn deserialize>(deserializer: D) -> Result { + deserializer + .deserialize_array(ArrayStatsVisitor) .change_context(DeserializeError) } } @@ -180,8 +181,9 @@ impl<'de> Visitor<'de> for DirtyArrayVisitor { impl<'de> Deserialize<'de> for DirtyArray { type Reflection = <() as Deserialize<'de>>::Reflection; - fn deserialize>(de: D) -> Result { - de.deserialize_array(DirtyArrayVisitor) + fn deserialize>(deserializer: D) -> Result { + deserializer + .deserialize_array(DirtyArrayVisitor) .change_context(DeserializeError) } } @@ -234,8 +236,9 @@ impl<'de> Visitor<'de> for CalledTwiceArrayVisitor { impl<'de> Deserialize<'de> for CalledTwiceArray { type Reflection = <() as Deserialize<'de>>::Reflection; - fn deserialize>(de: D) -> Result { - de.deserialize_array(CalledTwiceArrayVisitor) + fn deserialize>(deserializer: D) -> Result { + deserializer + .deserialize_array(CalledTwiceArrayVisitor) .change_context(DeserializeError) } } @@ -349,8 +352,9 @@ impl<'de> Visitor<'de> for ObjectStatsVisitor { impl<'de> Deserialize<'de> for ObjectStats { type Reflection = Self; - fn deserialize>(de: D) -> Result { - de.deserialize_object(ObjectStatsVisitor) + fn deserialize>(deserializer: D) -> Result { + deserializer + .deserialize_object(ObjectStatsVisitor) .change_context(DeserializeError) } } @@ -460,8 +464,9 @@ impl<'de> Visitor<'de> for DirtyObjectVisitor { impl<'de> Deserialize<'de> for DirtyObject { type Reflection = <() as Deserialize<'de>>::Reflection; - fn deserialize>(de: D) -> Result { - de.deserialize_array(DirtyObjectVisitor) + fn deserialize>(deserializer: D) -> Result { + deserializer + .deserialize_array(DirtyObjectVisitor) .change_context(DeserializeError) } } @@ -518,8 +523,9 @@ impl<'de> Visitor<'de> for CalledTwiceObjectVisitor { impl<'de> Deserialize<'de> for CalledTwiceObject { type Reflection = <() as Deserialize<'de>>::Reflection; - fn deserialize>(de: D) -> Result { - de.deserialize_array(CalledTwiceObjectVisitor) + fn deserialize>(deserializer: D) -> Result { + deserializer + .deserialize_array(CalledTwiceObjectVisitor) .change_context(DeserializeError) } } diff --git a/libs/deer/tests/test_struct_visitor.rs b/libs/deer/tests/test_struct_visitor.rs index b8b9564db8f..a5da4047cd7 100644 --- a/libs/deer/tests/test_struct_visitor.rs +++ b/libs/deer/tests/test_struct_visitor.rs @@ -57,8 +57,8 @@ impl<'de> Deserialize<'de> for ExampleFieldDiscriminator { Self::Value::reflection() } - fn visit_str(self, v: &str) -> Result { - match v { + fn visit_str(self, value: &str) -> Result { + match value { "a" => Ok(ExampleFieldDiscriminator::A), "b" => Ok(ExampleFieldDiscriminator::B), "c" => Ok(ExampleFieldDiscriminator::C), @@ -71,8 +71,8 @@ impl<'de> Deserialize<'de> for ExampleFieldDiscriminator { } } - fn visit_bytes(self, v: &[u8]) -> Result { - match v { + fn visit_bytes(self, value: &[u8]) -> Result { + match value { b"a" => Ok(ExampleFieldDiscriminator::A), b"b" => Ok(ExampleFieldDiscriminator::B), b"c" => Ok(ExampleFieldDiscriminator::C), @@ -91,8 +91,8 @@ impl<'de> Deserialize<'de> for ExampleFieldDiscriminator { } } - fn visit_u64(self, v: u64) -> Result { - match v { + fn visit_u64(self, value: u64) -> Result { + match value { 0 => Ok(ExampleFieldDiscriminator::A), 1 => Ok(ExampleFieldDiscriminator::B), 2 => Ok(ExampleFieldDiscriminator::C), diff --git a/libs/error-stack/README.md b/libs/error-stack/README.md index 7b41afaf987..f847c334905 100644 --- a/libs/error-stack/README.md +++ b/libs/error-stack/README.md @@ -8,7 +8,7 @@ [![crates.io](https://img.shields.io/crates/v/error-stack)][crates.io] [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack-orange)][libs.rs] -[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-20&color=blue)][rust-version] +[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-27&color=blue)][rust-version] [![documentation](https://img.shields.io/docsrs/error-stack)][documentation] [![license](https://img.shields.io/crates/l/error-stack)][license] [![discord](https://img.shields.io/discord/840573247803097118)][discord] diff --git a/libs/error-stack/macros/README.md b/libs/error-stack/macros/README.md index 9873b77f71b..96ec3eed76d 100644 --- a/libs/error-stack/macros/README.md +++ b/libs/error-stack/macros/README.md @@ -7,7 +7,7 @@ [![crates.io](https://img.shields.io/crates/v/error-stack-macros)][crates.io] [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack--macros-orange)][libs.rs] -[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-20&color=blue)][rust-version] +[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-27&color=blue)][rust-version] [![documentation](https://img.shields.io/docsrs/error-stack-macros)][documentation] [![license](https://img.shields.io/crates/l/error-stack)][license] [![discord](https://img.shields.io/discord/840573247803097118)][discord] diff --git a/libs/error-stack/rust-toolchain.toml b/libs/error-stack/rust-toolchain.toml index 87b096e1b8f..aef9e05cc77 100644 --- a/libs/error-stack/rust-toolchain.toml +++ b/libs/error-stack/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] # Please also update the badges in `README.md`s (`error-stack` and `error-stack-macros`), and `src/lib.rs` -channel = "nightly-2024-05-20" +channel = "nightly-2024-05-27" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-src', 'rust-analyzer'] diff --git a/libs/error-stack/src/lib.rs b/libs/error-stack/src/lib.rs index a01923e1d28..a632442c72b 100644 --- a/libs/error-stack/src/lib.rs +++ b/libs/error-stack/src/lib.rs @@ -2,7 +2,7 @@ //! //! [![crates.io](https://img.shields.io/crates/v/error-stack)][crates.io] //! [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack-orange)][libs.rs] -//! [![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-20&color=blue)][rust-version] +//! [![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-27&color=blue)][rust-version] //! [![discord](https://img.shields.io/discord/840573247803097118)][discord] //! //! [crates.io]: https://crates.io/crates/error-stack diff --git a/libs/error-stack/tests/test_debug.rs b/libs/error-stack/tests/test_debug.rs index 6f43b7c1755..7eccd0231c0 100644 --- a/libs/error-stack/tests/test_debug.rs +++ b/libs/error-stack/tests/test_debug.rs @@ -574,9 +574,9 @@ mod full { #[cfg(nightly)] impl Error for ContextD { - fn provide<'a>(&'a self, req: &mut Request<'a>) { - req.provide_ref(&self.code); - req.provide_ref(&self.reason); + fn provide<'a>(&'a self, request: &mut Request<'a>) { + request.provide_ref(&self.code); + request.provide_ref(&self.reason); } } diff --git a/libs/error-stack/tests/ui/into_report.stderr b/libs/error-stack/tests/ui/into_report.stderr index 45775ccad7c..9fa766635aa 100644 --- a/libs/error-stack/tests/ui/into_report.stderr +++ b/libs/error-stack/tests/ui/into_report.stderr @@ -14,6 +14,14 @@ error[E0599]: the method `into_report` exists for enum `Result<(), Report { | --------------------- doesn't satisfy `_: IntoReport` | +note: there's an earlier shadowed binding `result` of type `Result<(), RootError>` that has method `into_report` available + --> tests/ui/into_report.rs:19:9 + | +19 | let result = Err::<(), _>(RootError); + | ^^^^^^ `result` of type `Result<(), RootError>` that has method `into_report` defined earlier here +... +22 | let result = Err::<(), _>(Report::new(RootError)); + | ------ earlier `result` shadowed here with type `Result<(), error_stack::Report>` = note: the following trait bounds were not satisfied: `error_stack::Report>: From>` which is required by `Result<(), error_stack::Report>: IntoReport` diff --git a/libs/sarif/clippy.toml b/libs/sarif/clippy.toml deleted file mode 100644 index 197ad298341..00000000000 --- a/libs/sarif/clippy.toml +++ /dev/null @@ -1,5 +0,0 @@ -allow-print-in-tests = true -allow-expect-in-tests = true - -avoid-breaking-exported-api = false -msrv = "1.70.0" diff --git a/libs/sarif/rust-toolchain.toml b/libs/sarif/rust-toolchain.toml index eea8b45d89b..62e7b3ebbb0 100644 --- a/libs/sarif/rust-toolchain.toml +++ b/libs/sarif/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-20" +channel = "nightly-2024-05-27" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'rust-analyzer'] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c3e9a0280a4..47349a941d6 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-20" +channel = "nightly-2024-05-27" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-analyzer'] diff --git a/tests/hash-graph-benches/read_scaling/lib.rs b/tests/hash-graph-benches/read_scaling/lib.rs index 92e195f2c40..bf284343141 100644 --- a/tests/hash-graph-benches/read_scaling/lib.rs +++ b/tests/hash-graph-benches/read_scaling/lib.rs @@ -10,10 +10,6 @@ reason = "This is a benchmark but as we want to document this crate as well this should be a \ warning instead" )] -#![expect( - clippy::significant_drop_in_scrutinee, - reason = "This should be enabled but it's currently too noisy" -)] //! TODO: Introduce benchmarks testing the differing performance of operations as the graph's scale //! changes diff --git a/tests/hash-graph-benches/representative_read/lib.rs b/tests/hash-graph-benches/representative_read/lib.rs index 0b2c107b43e..2ba28614770 100644 --- a/tests/hash-graph-benches/representative_read/lib.rs +++ b/tests/hash-graph-benches/representative_read/lib.rs @@ -10,10 +10,6 @@ reason = "This is a benchmark but as we want to document this crate as well this should be a \ warning instead" )] -#![expect( - clippy::significant_drop_in_scrutinee, - reason = "This should be enabled but it's currently too noisy" -)] //! Benchmarks to check the performance of operations across a "representative" graph. //! From aece2172a48ea8933ced46e776fe40a95d852a46 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 09:30:34 +0200 Subject: [PATCH 22/27] Update GitHub Action `docker/login-action` to v3.2.0 (#4529) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dei Vilkinsons <6226576+vilkinsons@users.noreply.github.com> Co-authored-by: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> --- .github/actions/build-docker-images/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-docker-images/action.yml b/.github/actions/build-docker-images/action.yml index e95acd878c0..03df56be55d 100644 --- a/.github/actions/build-docker-images/action.yml +++ b/.github/actions/build-docker-images/action.yml @@ -50,7 +50,7 @@ runs: uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 - name: Login to GitHub Container Registry - uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 + uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 with: registry: ghcr.io username: ${{ github.actor }} From 8b173a6006b732d4bae78807767d392c07d88c8c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 02:05:51 +0000 Subject: [PATCH 23/27] Update GitHub Action `github/codeql-action` to v3.25.7 (#4531) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/lint.yml | 2 +- .github/workflows/semgrep.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 42597cc0a3a..480e7e49fbe 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -36,7 +36,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6 + uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -47,7 +47,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6 + uses: github/codeql-action/autobuild@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -61,4 +61,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6 + uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 41f2d3c2130..4c7ce2b99a1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -175,7 +175,7 @@ jobs: mv "$tmp" clippy.sarif - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6 + uses: github/codeql-action/upload-sarif@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7 if: always() && steps.lints.outputs.has-clippy == 'true' with: sarif_file: ${{ matrix.directory }}/clippy.sarif diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index 206884aa791..cc6c21899bf 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -43,7 +43,7 @@ jobs: files: "semgrep.sarif" - name: Upload SARIF file for GitHub Advanced Security Dashboard - uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6 + uses: github/codeql-action/upload-sarif@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7 if: steps.sarif_file_check.outputs.files_exists == 'true' with: sarif_file: semgrep.sarif From d16771159654c480f2f417e7b453adfbf0032aa2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 13:12:07 +0000 Subject: [PATCH 24/27] Update npm package `@redocly/cli` to v1.14.0 (#4532) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .../hash-graph-client/typescript/package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/@local/hash-graph-client/typescript/package.json b/libs/@local/hash-graph-client/typescript/package.json index f5cb4f8e2c4..d2c5ae8abfd 100644 --- a/libs/@local/hash-graph-client/typescript/package.json +++ b/libs/@local/hash-graph-client/typescript/package.json @@ -17,7 +17,7 @@ "@apps/hash-graph": "0.0.0-private", "@local/eslint-config": "0.0.0-private", "@local/tsconfig": "0.0.0-private", - "@redocly/cli": "1.13.0", + "@redocly/cli": "1.14.0", "@types/node": "20.12.3", "@typescript-eslint/parser": "7.2.0", "eslint": "8.57.0", diff --git a/yarn.lock b/yarn.lock index 11c3efd624a..3d08bb3cfa2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5557,12 +5557,12 @@ require-from-string "^2.0.2" uri-js "^4.2.2" -"@redocly/cli@1.13.0": - version "1.13.0" - resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.13.0.tgz#ebc30173d74fff5cfb39c1d917cbae1a9a3c0117" - integrity sha512-2oC8SN+hGtfrFBX2LadFOAzA1ika+2IDmAg9pRl8+yualfmEdxiOuP8rltKeDZ1Uj3NGXyR42g7+CvMj55pKkw== +"@redocly/cli@1.14.0": + version "1.14.0" + resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.14.0.tgz#17bfe1499715b957cec5b16e06c463a86e49f0b4" + integrity sha512-GCvJeuZL/JbEOvuCbAav8m1YezzzrJ/rLJWk2WzPYw2YAAdZMjSEQGpiZeVfZTZLV8ntwkUfNFzsET3I2x6TPg== dependencies: - "@redocly/openapi-core" "1.13.0" + "@redocly/openapi-core" "1.14.0" abort-controller "^3.0.0" chokidar "^3.5.1" colorette "^1.2.0" @@ -5586,10 +5586,10 @@ resolved "https://registry.yarnpkg.com/@redocly/config/-/config-0.5.0.tgz#3ba2585f10d7039b85d7604d0e17f4d091d424c2" integrity sha512-oA1ezWPT2tSV9CLk0FtZlViaFKtp+id3iAVeKBme1DdP4xUCdxEdP8umB21iLKdc6leRd5uGa+T5Ox4nHBAXWg== -"@redocly/openapi-core@1.13.0", "@redocly/openapi-core@^1.0.0-rc.2": - version "1.13.0" - resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.13.0.tgz#017125f70f7e030fad782f4073972f158c848967" - integrity sha512-lPvVE4+QjWMXCEIui994pYBZGqvEsodaCJPCJLkx6RK3OL/6Ss8wN17YTDmF49tzw3xgA8t4+x7TqelUSRcZUQ== +"@redocly/openapi-core@1.14.0", "@redocly/openapi-core@^1.0.0-rc.2": + version "1.14.0" + resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.14.0.tgz#74f9daf95f835563d458ce02644f0ad0cd519211" + integrity sha512-sraF4PGVcc6t6CaYw5raO/GWeOaa6UjcEvH/+Qm7zp+q/fbWAMwbj+1QzaNvpMspCwF+xW6TddDcnXrCDmqYVA== dependencies: "@redocly/ajv" "^8.11.0" "@redocly/config" "^0.5.0" From abfca6e6f8ce6040a0598a24e6c60f96026b9561 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 23:28:22 +0000 Subject: [PATCH 25/27] Update npm package `httpyac` to v6.14.0 (#4533) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- apps/hash-graph/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/hash-graph/package.json b/apps/hash-graph/package.json index 757672577ba..6aa89e7b91b 100644 --- a/apps/hash-graph/package.json +++ b/apps/hash-graph/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@rust/graph-test-data": "0.0.0-private", - "httpyac": "6.13.3", + "httpyac": "6.14.0", "quicktype": "^16.0.43", "tsx": "3.13.0", "typescript": "5.1.6" diff --git a/yarn.lock b/yarn.lock index 3d08bb3cfa2..07e8cb68c17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16176,10 +16176,10 @@ https-proxy-agent@^7.0.0, https-proxy-agent@^7.0.1, https-proxy-agent@^7.0.2, ht agent-base "^7.0.2" debug "4" -httpyac@6.13.3: - version "6.13.3" - resolved "https://registry.yarnpkg.com/httpyac/-/httpyac-6.13.3.tgz#06f2683c57d1c005710b407713c1175450b370bf" - integrity sha512-HlI6i5N6//+a465z+liThgaonKaZLXqWr/7Si28riakRs1L1WqWE+y+6BDx8aRq7XNzPI6R7x7RrBgZmpQj3PQ== +httpyac@6.14.0: + version "6.14.0" + resolved "https://registry.yarnpkg.com/httpyac/-/httpyac-6.14.0.tgz#009299e8069937867a5406b996029161d3972920" + integrity sha512-B9fpiR0VyKGr1XPo0DnjBZtaOBfyv5J/D5A/Wx/G6pu5euyJaM9vTTPReYCWHM3dpY+wJ2Kyc7NLZEnRCi9SNA== dependencies: "@cloudamqp/amqp-client" "^2.1.1" "@grpc/grpc-js" "^1.10.7" From caf850d1c7eaefe84ec4188518df19204e44a8d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 22:22:32 +0000 Subject: [PATCH 26/27] Update GitHub Action `taiki-e/install-action` to v2.34.0 (#4535) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/actions/warm-up-repo/action.yml | 2 +- .github/workflows/bench.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/warm-up-repo/action.yml b/.github/actions/warm-up-repo/action.yml index be5feb7d31d..2b4fe6f569a 100644 --- a/.github/actions/warm-up-repo/action.yml +++ b/.github/actions/warm-up-repo/action.yml @@ -17,7 +17,7 @@ runs: # cache: yarn ## Currently disabled because of frequent timeouts - name: Install WASM tools - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: wasm-pack@0.12.1 diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 5f564102677..aa6c2829ff6 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -93,7 +93,7 @@ jobs: - name: Install Rust tools if: steps.benches.outputs.has-rust == 'true' - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: just@1.13.0,critcmp@0.1.8 @@ -241,7 +241,7 @@ jobs: - name: Install Rust tools if: steps.benches.outputs.has-rust == 'true' - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: just@1.13.0,critcmp@0.1.8 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4c7ce2b99a1..0725f10f38a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -105,7 +105,7 @@ jobs: - name: Install Rust tools if: always() && steps.lints.outputs.has-rust == 'true' - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: just@1.13.0,cargo-hack@0.6.28,rust-script@0.23.0,clippy-sarif@0.3.7,sarif-fmt@0.3.7 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1188434db17..cd2d8f94810 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -168,7 +168,7 @@ jobs: - name: Install Rust tools if: always() && steps.tests.outputs.has-rust == 'true' - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: just@1.13.0,cargo-hack@0.6.28,cargo-nextest@0.9.68,cargo-llvm-cov@0.6.9 @@ -285,7 +285,7 @@ jobs: - name: Install Rust tools if: always() && steps.tests.outputs.has-rust == 'true' - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: just@1.13.0,cargo-hack@0.6.28,cargo-nextest@0.9.68,cargo-llvm-cov@0.6.9 @@ -415,7 +415,7 @@ jobs: - name: Install Rust tools if: always() && steps.tests.outputs.has-rust == 'true' - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: just@1.13.0,cargo-hack@0.6.28,cargo-nextest@0.9.68,cargo-llvm-cov@0.6.9 @@ -550,7 +550,7 @@ jobs: - name: Install tools if: always() && steps.publish.outputs.has-rust == 'true' && github.event_name == 'pull_request' || github.event_name == 'merge_group' - uses: taiki-e/install-action@c2bb13fe14454ce1be6b630075c6abb37d14be12 # v2.33.33 + uses: taiki-e/install-action@4e38715ddc7c4e1fd3e44ab4c124a2dcca7306fd # v2.34.0 with: tool: cargo-semver-checks From 1aeef5935a72b589bd6ecd582e19e06cec1f4e36 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:41:45 +0000 Subject: [PATCH 27/27] Update Rust toolchains to nightly-2024-06-03 (#4537) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- apps/hash/README.md | 2 +- libs/antsi/rust-toolchain.toml | 2 +- libs/deer/rust-toolchain.toml | 2 +- libs/error-stack/README.md | 2 +- libs/error-stack/macros/README.md | 2 +- libs/error-stack/rust-toolchain.toml | 2 +- libs/error-stack/src/lib.rs | 2 +- libs/sarif/rust-toolchain.toml | 2 +- rust-toolchain.toml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/hash/README.md b/apps/hash/README.md index f50058bd5d4..77cbfc8681d 100644 --- a/apps/hash/README.md +++ b/apps/hash/README.md @@ -63,7 +63,7 @@ To run HASH locally, please follow these steps: ## ≥ 1.16 rustc --version - ## ≥ 2024-05-27 (If installed through rustup, this will automatically install the required toolchain) + ## ≥ 2024-06-03 (If installed through rustup, this will automatically install the required toolchain) cargo --version ## Version matching the above rustc version diff --git a/libs/antsi/rust-toolchain.toml b/libs/antsi/rust-toolchain.toml index 62e7b3ebbb0..9352a8d03f2 100644 --- a/libs/antsi/rust-toolchain.toml +++ b/libs/antsi/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-27" +channel = "nightly-2024-06-03" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'rust-analyzer'] diff --git a/libs/deer/rust-toolchain.toml b/libs/deer/rust-toolchain.toml index 47349a941d6..24609bd449a 100644 --- a/libs/deer/rust-toolchain.toml +++ b/libs/deer/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-27" +channel = "nightly-2024-06-03" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-analyzer'] diff --git a/libs/error-stack/README.md b/libs/error-stack/README.md index f847c334905..2bd1ea95d9f 100644 --- a/libs/error-stack/README.md +++ b/libs/error-stack/README.md @@ -8,7 +8,7 @@ [![crates.io](https://img.shields.io/crates/v/error-stack)][crates.io] [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack-orange)][libs.rs] -[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-27&color=blue)][rust-version] +[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-06-03&color=blue)][rust-version] [![documentation](https://img.shields.io/docsrs/error-stack)][documentation] [![license](https://img.shields.io/crates/l/error-stack)][license] [![discord](https://img.shields.io/discord/840573247803097118)][discord] diff --git a/libs/error-stack/macros/README.md b/libs/error-stack/macros/README.md index 96ec3eed76d..780ce7568a2 100644 --- a/libs/error-stack/macros/README.md +++ b/libs/error-stack/macros/README.md @@ -7,7 +7,7 @@ [![crates.io](https://img.shields.io/crates/v/error-stack-macros)][crates.io] [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack--macros-orange)][libs.rs] -[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-27&color=blue)][rust-version] +[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-06-03&color=blue)][rust-version] [![documentation](https://img.shields.io/docsrs/error-stack-macros)][documentation] [![license](https://img.shields.io/crates/l/error-stack)][license] [![discord](https://img.shields.io/discord/840573247803097118)][discord] diff --git a/libs/error-stack/rust-toolchain.toml b/libs/error-stack/rust-toolchain.toml index aef9e05cc77..d0e858d3f2f 100644 --- a/libs/error-stack/rust-toolchain.toml +++ b/libs/error-stack/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] # Please also update the badges in `README.md`s (`error-stack` and `error-stack-macros`), and `src/lib.rs` -channel = "nightly-2024-05-27" +channel = "nightly-2024-06-03" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-src', 'rust-analyzer'] diff --git a/libs/error-stack/src/lib.rs b/libs/error-stack/src/lib.rs index a632442c72b..828093e1e0c 100644 --- a/libs/error-stack/src/lib.rs +++ b/libs/error-stack/src/lib.rs @@ -2,7 +2,7 @@ //! //! [![crates.io](https://img.shields.io/crates/v/error-stack)][crates.io] //! [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack-orange)][libs.rs] -//! [![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-05-27&color=blue)][rust-version] +//! [![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-06-03&color=blue)][rust-version] //! [![discord](https://img.shields.io/discord/840573247803097118)][discord] //! //! [crates.io]: https://crates.io/crates/error-stack diff --git a/libs/sarif/rust-toolchain.toml b/libs/sarif/rust-toolchain.toml index 62e7b3ebbb0..9352a8d03f2 100644 --- a/libs/sarif/rust-toolchain.toml +++ b/libs/sarif/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-27" +channel = "nightly-2024-06-03" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'rust-analyzer'] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 47349a941d6..24609bd449a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-05-27" +channel = "nightly-2024-06-03" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-analyzer']