From e64476a53bc59d976b93ec2b416f33bcfa97752c Mon Sep 17 00:00:00 2001 From: Muhammad Gibran Alfarizi Date: Mon, 13 Jul 2026 09:07:04 +0200 Subject: [PATCH] ENH: Update client with the latest API --- .../src/client/@tanstack/react-query.gen.ts | 128 ++++++- frontend/src/client/schemas.gen.ts | 305 +++++++++++++++- frontend/src/client/sdk.gen.ts | 70 +++- frontend/src/client/types.gen.ts | 343 ++++++++++++++++++ 4 files changed, 842 insertions(+), 4 deletions(-) diff --git a/frontend/src/client/@tanstack/react-query.gen.ts b/frontend/src/client/@tanstack/react-query.gen.ts index 9acb8adc..03060e57 100644 --- a/frontend/src/client/@tanstack/react-query.gen.ts +++ b/frontend/src/client/@tanstack/react-query.gen.ts @@ -1,8 +1,8 @@ // This file is auto-generated by @hey-api/openapi-ts -import { type Options, projectDeleteProjectSession, projectGetProject, projectPostProject, projectGetSumoAssets, projectGetGlobalConfigStatus, projectPostInitProject, projectPostGlobalConfig, projectPostLockAcquire, projectPostLockRelease, projectPostLockRefresh, projectGetLockStatus, projectPatchMasterdata, projectPatchModel, projectPatchAccess, projectPatchCacheMaxRevisions, projectGetRmsProjects, projectPatchRms, projectPatchRmsCoordinateSystem, projectPatchRmsStratigraphicFramework, projectPatchRmsWells, projectGetCache, projectGetCacheRevision, projectGetCacheDiff, projectPostCacheRestore, projectGetRestoreCheck, projectPostRestore, projectGetMappings, projectPutMappings, projectGetChangelog, userGetUser, userPatchApiKey, sessionGetSession, sessionPostSession, sessionPatchAccessToken, sessionGetRestoreCheck, sessionPostRestore, rmsDeleteRmsProject, rmsPostRmsProject, rmsGetZones, rmsGetHorizons, rmsGetWells, rmsGetCoordinateSystem, smdaGetHealth, smdaPostField, smdaPostMasterdata, smdaPostStratUnits, matchPostMatch, healthV1HealthCheck, healthHealthCheck } from '../sdk.gen'; +import { type Options, projectDeleteProjectSession, projectGetProject, projectPostProject, projectGetSumoAssets, projectGetGlobalConfigStatus, projectPostInitProject, projectPostGlobalConfig, projectPostLockAcquire, projectPostLockRelease, projectPostLockRefresh, projectGetLockStatus, projectPatchMasterdata, projectPostValidateMasterdataSmda, projectPatchModel, projectPatchAccess, projectPatchCacheMaxRevisions, projectGetRmsProjects, projectPatchRms, projectPatchRmsCoordinateSystem, projectPatchRmsStratigraphicFramework, projectPatchRmsWells, projectGetCache, projectGetCacheRevision, projectGetCacheDiff, projectPostCacheRestore, projectGetRestoreCheck, projectPostRestore, projectGetMappings, projectPutMappings, projectPostMappingsImportRmsEclipseCsv, projectPostMappingsExportRmsSimulatorRenamingTable, projectGetChangelog, userGetUser, userPatchApiKey, sessionGetSession, sessionPostSession, sessionPatchAccessToken, sessionGetRestoreCheck, sessionPostRestore, rmsDeleteRmsProject, rmsPostRmsProject, rmsGetZones, rmsGetHorizons, rmsGetWells, rmsGetCoordinateSystem, smdaGetHealth, smdaPostField, smdaPostMasterdata, smdaPostStratUnits, smdaPostWellHeaders, matchPostMatch, healthV1HealthCheck, healthHealthCheck } from '../sdk.gen'; import { type UseMutationOptions, queryOptions, type DefaultError } from '@tanstack/react-query'; -import type { ProjectDeleteProjectSessionData, ProjectDeleteProjectSessionError, ProjectDeleteProjectSessionResponse, ProjectGetProjectData, ProjectPostProjectData, ProjectPostProjectError, ProjectPostProjectResponse, ProjectGetSumoAssetsData, ProjectGetGlobalConfigStatusData, ProjectPostInitProjectData, ProjectPostInitProjectResponse, ProjectPostGlobalConfigData, ProjectPostGlobalConfigResponse, ProjectPostLockAcquireData, ProjectPostLockAcquireError, ProjectPostLockAcquireResponse, ProjectPostLockReleaseData, ProjectPostLockReleaseError, ProjectPostLockReleaseResponse, ProjectPostLockRefreshData, ProjectPostLockRefreshError, ProjectPostLockRefreshResponse, ProjectGetLockStatusData, ProjectPatchMasterdataData, ProjectPatchMasterdataError, ProjectPatchMasterdataResponse, ProjectPatchModelData, ProjectPatchModelError, ProjectPatchModelResponse, ProjectPatchAccessData, ProjectPatchAccessError, ProjectPatchAccessResponse, ProjectPatchCacheMaxRevisionsData, ProjectPatchCacheMaxRevisionsError, ProjectPatchCacheMaxRevisionsResponse, ProjectGetRmsProjectsData, ProjectPatchRmsData, ProjectPatchRmsError, ProjectPatchRmsResponse, ProjectPatchRmsCoordinateSystemData, ProjectPatchRmsCoordinateSystemResponse, ProjectPatchRmsStratigraphicFrameworkData, ProjectPatchRmsStratigraphicFrameworkResponse, ProjectPatchRmsWellsData, ProjectPatchRmsWellsResponse, ProjectGetCacheData, ProjectGetCacheRevisionData, ProjectGetCacheDiffData, ProjectPostCacheRestoreData, ProjectPostCacheRestoreResponse, ProjectGetRestoreCheckData, ProjectPostRestoreData, ProjectPostRestoreError, ProjectPostRestoreResponse, ProjectGetMappingsData, ProjectPutMappingsData, ProjectPutMappingsResponse, ProjectGetChangelogData, UserGetUserData, UserPatchApiKeyData, UserPatchApiKeyError, UserPatchApiKeyResponse, SessionGetSessionData, SessionPostSessionData, SessionPostSessionError, SessionPostSessionResponse, SessionPatchAccessTokenData, SessionPatchAccessTokenError, SessionPatchAccessTokenResponse, SessionGetRestoreCheckData, SessionPostRestoreData, SessionPostRestoreError, SessionPostRestoreResponse, RmsDeleteRmsProjectData, RmsDeleteRmsProjectError, RmsDeleteRmsProjectResponse, RmsPostRmsProjectData, RmsPostRmsProjectResponse, RmsGetZonesData, RmsGetHorizonsData, RmsGetWellsData, RmsGetCoordinateSystemData, SmdaGetHealthData, SmdaPostFieldData, SmdaPostFieldError, SmdaPostFieldResponse, SmdaPostMasterdataData, SmdaPostMasterdataResponse, SmdaPostStratUnitsData, SmdaPostStratUnitsResponse, MatchPostMatchData, MatchPostMatchResponse, HealthV1HealthCheckData, HealthHealthCheckData } from '../types.gen'; +import type { ProjectDeleteProjectSessionData, ProjectDeleteProjectSessionError, ProjectDeleteProjectSessionResponse, ProjectGetProjectData, ProjectPostProjectData, ProjectPostProjectError, ProjectPostProjectResponse, ProjectGetSumoAssetsData, ProjectGetGlobalConfigStatusData, ProjectPostInitProjectData, ProjectPostInitProjectResponse, ProjectPostGlobalConfigData, ProjectPostGlobalConfigResponse, ProjectPostLockAcquireData, ProjectPostLockAcquireError, ProjectPostLockAcquireResponse, ProjectPostLockReleaseData, ProjectPostLockReleaseError, ProjectPostLockReleaseResponse, ProjectPostLockRefreshData, ProjectPostLockRefreshError, ProjectPostLockRefreshResponse, ProjectGetLockStatusData, ProjectPatchMasterdataData, ProjectPatchMasterdataError, ProjectPatchMasterdataResponse, ProjectPostValidateMasterdataSmdaData, ProjectPostValidateMasterdataSmdaResponse, ProjectPatchModelData, ProjectPatchModelError, ProjectPatchModelResponse, ProjectPatchAccessData, ProjectPatchAccessError, ProjectPatchAccessResponse, ProjectPatchCacheMaxRevisionsData, ProjectPatchCacheMaxRevisionsError, ProjectPatchCacheMaxRevisionsResponse, ProjectGetRmsProjectsData, ProjectPatchRmsData, ProjectPatchRmsError, ProjectPatchRmsResponse, ProjectPatchRmsCoordinateSystemData, ProjectPatchRmsCoordinateSystemResponse, ProjectPatchRmsStratigraphicFrameworkData, ProjectPatchRmsStratigraphicFrameworkResponse, ProjectPatchRmsWellsData, ProjectPatchRmsWellsResponse, ProjectGetCacheData, ProjectGetCacheRevisionData, ProjectGetCacheDiffData, ProjectPostCacheRestoreData, ProjectPostCacheRestoreResponse, ProjectGetRestoreCheckData, ProjectPostRestoreData, ProjectPostRestoreError, ProjectPostRestoreResponse, ProjectGetMappingsData, ProjectPutMappingsData, ProjectPutMappingsResponse, ProjectPostMappingsImportRmsEclipseCsvData, ProjectPostMappingsImportRmsEclipseCsvResponse, ProjectPostMappingsExportRmsSimulatorRenamingTableData, ProjectPostMappingsExportRmsSimulatorRenamingTableResponse, ProjectGetChangelogData, UserGetUserData, UserPatchApiKeyData, UserPatchApiKeyError, UserPatchApiKeyResponse, SessionGetSessionData, SessionPostSessionData, SessionPostSessionError, SessionPostSessionResponse, SessionPatchAccessTokenData, SessionPatchAccessTokenError, SessionPatchAccessTokenResponse, SessionGetRestoreCheckData, SessionPostRestoreData, SessionPostRestoreError, SessionPostRestoreResponse, RmsDeleteRmsProjectData, RmsDeleteRmsProjectError, RmsDeleteRmsProjectResponse, RmsPostRmsProjectData, RmsPostRmsProjectResponse, RmsGetZonesData, RmsGetHorizonsData, RmsGetWellsData, RmsGetCoordinateSystemData, SmdaGetHealthData, SmdaPostFieldData, SmdaPostFieldError, SmdaPostFieldResponse, SmdaPostMasterdataData, SmdaPostMasterdataResponse, SmdaPostStratUnitsData, SmdaPostStratUnitsResponse, SmdaPostWellHeadersData, SmdaPostWellHeadersResponse, MatchPostMatchData, MatchPostMatchResponse, HealthV1HealthCheckData, HealthHealthCheckData } from '../types.gen'; import type { AxiosError } from 'axios'; import { client as _heyApiClient } from '../client.gen'; @@ -319,6 +319,37 @@ export const projectPatchMasterdataMutation = (options?: Partial) => createQueryKey('projectPostValidateMasterdataSmda', options); + +export const projectPostValidateMasterdataSmdaOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await projectPostValidateMasterdataSmda({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: projectPostValidateMasterdataSmdaQueryKey(options) + }); +}; + +export const projectPostValidateMasterdataSmdaMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await projectPostValidateMasterdataSmda({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + export const projectPatchModelMutation = (options?: Partial>): UseMutationOptions, Options> => { const mutationOptions: UseMutationOptions, Options> = { mutationFn: async (localOptions) => { @@ -595,6 +626,68 @@ export const projectPutMappingsMutation = (options?: Partial) => createQueryKey('projectPostMappingsImportRmsEclipseCsv', options); + +export const projectPostMappingsImportRmsEclipseCsvOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await projectPostMappingsImportRmsEclipseCsv({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: projectPostMappingsImportRmsEclipseCsvQueryKey(options) + }); +}; + +export const projectPostMappingsImportRmsEclipseCsvMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await projectPostMappingsImportRmsEclipseCsv({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const projectPostMappingsExportRmsSimulatorRenamingTableQueryKey = (options?: Options) => createQueryKey('projectPostMappingsExportRmsSimulatorRenamingTable', options); + +export const projectPostMappingsExportRmsSimulatorRenamingTableOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await projectPostMappingsExportRmsSimulatorRenamingTable({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: projectPostMappingsExportRmsSimulatorRenamingTableQueryKey(options) + }); +}; + +export const projectPostMappingsExportRmsSimulatorRenamingTableMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await projectPostMappingsExportRmsSimulatorRenamingTable({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + export const projectGetChangelogQueryKey = (options?: Options) => createQueryKey('projectGetChangelog', options); export const projectGetChangelogOptions = (options?: Options) => { @@ -976,6 +1069,37 @@ export const smdaPostStratUnitsMutation = (options?: Partial) => createQueryKey('smdaPostWellHeaders', options); + +export const smdaPostWellHeadersOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await smdaPostWellHeaders({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: smdaPostWellHeadersQueryKey(options) + }); +}; + +export const smdaPostWellHeadersMutation = (options?: Partial>): UseMutationOptions, Options> => { + const mutationOptions: UseMutationOptions, Options> = { + mutationFn: async (localOptions) => { + const { data } = await smdaPostWellHeaders({ + ...options, + ...localOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + export const matchPostMatchQueryKey = (options: Options) => createQueryKey('matchPostMatch', options); export const matchPostMatchOptions = (options: Options) => { diff --git a/frontend/src/client/schemas.gen.ts b/frontend/src/client/schemas.gen.ts index bd1eda35..1974cf3b 100644 --- a/frontend/src/client/schemas.gen.ts +++ b/frontend/src/client/schemas.gen.ts @@ -625,7 +625,7 @@ export const LockInfoSchema = { type: 'string', pattern: '(\\d+(\\.\\d+){0,2}|\\d+\\.\\d+\\.[a-z0-9]+\\+[a-z0-9.]+)', title: 'Version', - default: '0.33.1.dev7+g6feb87797.d20260624' + default: '1.0.0' } }, type: 'object', @@ -1014,6 +1014,9 @@ export const ProjectConfigSchema = { type: 'null' } ] + }, + validation: { + '$ref': '#/components/schemas/ProjectValidation' } }, type: 'object', @@ -1024,6 +1027,34 @@ export const ProjectConfigSchema = { Stored as config.json.` } as const; +export const ProjectValidationSchema = { + properties: { + masterdata_smda: { + anyOf: [ + { + '$ref': '#/components/schemas/ValidationRecord' + }, + { + type: 'null' + } + ] + }, + rms_project: { + anyOf: [ + { + '$ref': '#/components/schemas/ValidationRecord' + }, + { + type: 'null' + } + ] + } + }, + type: 'object', + title: 'ProjectValidation', + description: 'Validation metadata for project configuration data.' +} as const; + export const RestorableFilesResponseSchema = { properties: { files: { @@ -1176,6 +1207,22 @@ export const RmsProjectPathsResultSchema = { description: 'List of RMS project paths within the FMU project.' } as const; +export const RmsSimulatorMappingFilePathSchema = { + properties: { + relative_path: { + type: 'string', + format: 'path', + title: 'Relative Path', + description: 'Relative path in the project to an RMS-to-simulator mapping file.', + examples: ['rms/input/well_modelling/well_info/rms_eclipse.csv'] + } + }, + type: 'object', + required: ['relative_path'], + title: 'RmsSimulatorMappingFilePath', + description: 'A path to an RMS-to-simulator mapping import or export file.' +} as const; + export const RmsStratigraphicFrameworkSchema = { properties: { zones: { @@ -1557,6 +1604,237 @@ export const SmdaStratigraphicUnitsResultSchema = { description: 'Result containing a list of stratigraphic units.' } as const; +export const SmdaWellHeaderSchema = { + properties: { + unique_well_identifier: { + type: 'string', + title: 'Unique Well Identifier', + description: 'Unique SMDA identifier for the well.' + }, + unique_wellbore_identifier: { + type: 'string', + title: 'Unique Wellbore Identifier', + description: 'Unique SMDA identifier for the wellbore.' + }, + official_wellbore_name: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Official Wellbore Name', + description: `Official wellbore name used by the Authorities. + +For Norway and UK, it will be the unique_wellbore_identifier without +country iso code, but for Brazil it can really differs from the Equinor +wellbore name.` + }, + country_identifier: { + type: 'string', + title: 'Country Identifier', + description: 'Country identifier for the wellbore.' + }, + parent_wellbore: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Parent Wellbore', + description: `The unique wellbore identifier this wellbore is kicked off from. + +Ref. kick off depth. This is used for sidetracks. A wellbore starting at +the well origin has no parent.` + }, + wellbore_type: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Wellbore Type', + description: `Type of wellbore, values like exploration, development, other. + +This attribute is automatically maintained in SMDA based on the wellbore +purpose. If the purpose is like wildcat or appraisal, type will be set to +exploration, if the purpose is like production, injection then the type is +set to development.` + }, + wellbore_purpose: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Wellbore Purpose', + description: `Purpose of wellbore. + +Values like wildcat, appraisal, … for exploration wellbores; production, +injection, observation, disposal, … for development wellbores; shallow gas, +pilot hole for other purpose.` + }, + wellbore_status: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Wellbore Status', + description: `Status of the wellbore. + +Value like plugged and abandoned, drilling, plugged, producing ... This +attribute is automatically maintained in SMDA if no good source is found +for it. SMDA will use the wellbore type (exploration or development), the +drill dates information, current_track, etc ... in order to set a plausible +status. If wellbore type=exploration and completed_date < current_date, +then status=plugged and abandoned while development wellbore would be set +to completed.` + }, + wellbore_purpose_planned: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Wellbore Purpose Planned', + description: `Pre-drill purpose of the wellbore. + +Legal values for exploration wellbores: wildcat, appraisal. Example of +legal values for development wellbores: observation, production, injection.` + }, + drill_year: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Drill Year', + description: 'The year when the drilling has started.' + }, + completion_date: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Completion Date', + description: `Date when the wellbore is considered completed. + +For exploration wellbores from moveable facilities, this may be the anchor +handling or jacking-down start date. For fixed facilities and development +wellbores, it is when the wellbore reaches total depth and the last casing, +liner, or screen is set. If immediately plugged, it is the date the last +plug is set.` + }, + discovery_internal_identifier: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Discovery Internal Identifier', + description: 'Internal name of the discovery.' + }, + multilateral: { + anyOf: [ + { + type: 'integer', + enum: [0, 1] + }, + { + type: 'null' + } + ], + title: 'Multilateral', + description: 'Whether the wellbore is multilateral. 0 = no, 1 = yes.' + }, + projected_coordinate_unit: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Projected Coordinate Unit', + description: 'Projected coordinate unit.' + }, + projected_coordinate_system: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Projected Coordinate System', + description: 'Coordinate reference system for the easting/northing values.' + }, + well_uuid: { + type: 'string', + format: 'uuid', + title: 'Well Uuid', + description: 'SMDA UUID for the well.' + }, + wellbore_uuid: { + type: 'string', + format: 'uuid', + title: 'Wellbore Uuid', + description: 'SMDA UUID for the wellbore.' + } + }, + type: 'object', + required: ['unique_well_identifier', 'unique_wellbore_identifier', 'official_wellbore_name', 'country_identifier', 'parent_wellbore', 'wellbore_type', 'wellbore_purpose', 'wellbore_status', 'wellbore_purpose_planned', 'drill_year', 'completion_date', 'discovery_internal_identifier', 'multilateral', 'projected_coordinate_unit', 'projected_coordinate_system', 'well_uuid', 'wellbore_uuid'], + title: 'SmdaWellHeader', + description: 'Well header data from SMDA.' +} as const; + +export const SmdaWellHeadersResultSchema = { + properties: { + well_headers: { + items: { + '$ref': '#/components/schemas/SmdaWellHeader' + }, + type: 'array', + title: 'Well Headers', + description: 'List of well headers from SMDA.' + } + }, + type: 'object', + required: ['well_headers'], + title: 'SmdaWellHeadersResult', + description: 'Result containing a list of well headers.' +} as const; + export const StratigraphicColumnSchema = { properties: { identifier: { @@ -1852,9 +2130,34 @@ export const ValidationErrorSchema = { type: { type: 'string', title: 'Error Type' + }, + input: { + title: 'Input' + }, + ctx: { + type: 'object', + title: 'Context' } }, type: 'object', required: ['loc', 'msg', 'type'], title: 'ValidationError' +} as const; + +export const ValidationRecordSchema = { + properties: { + last_validated_at: { + type: 'string', + format: 'date-time', + title: 'Last Validated At' + }, + last_validated_by: { + type: 'string', + title: 'Last Validated By' + } + }, + type: 'object', + required: ['last_validated_at', 'last_validated_by'], + title: 'ValidationRecord', + description: 'Metadata for a successful validation of project configuration data.' } as const; \ No newline at end of file diff --git a/frontend/src/client/sdk.gen.ts b/frontend/src/client/sdk.gen.ts index 7903490b..0ba6e328 100644 --- a/frontend/src/client/sdk.gen.ts +++ b/frontend/src/client/sdk.gen.ts @@ -1,7 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-axios'; -import type { ProjectDeleteProjectSessionData, ProjectDeleteProjectSessionResponse, ProjectDeleteProjectSessionError, ProjectGetProjectData, ProjectGetProjectResponse, ProjectGetProjectError, ProjectPostProjectData, ProjectPostProjectResponse, ProjectPostProjectError, ProjectGetSumoAssetsData, ProjectGetSumoAssetsResponse, ProjectGetGlobalConfigStatusData, ProjectGetGlobalConfigStatusResponse, ProjectPostInitProjectData, ProjectPostInitProjectResponse, ProjectPostGlobalConfigData, ProjectPostGlobalConfigResponse, ProjectPostLockAcquireData, ProjectPostLockAcquireResponse, ProjectPostLockAcquireError, ProjectPostLockReleaseData, ProjectPostLockReleaseResponse, ProjectPostLockReleaseError, ProjectPostLockRefreshData, ProjectPostLockRefreshResponse, ProjectPostLockRefreshError, ProjectGetLockStatusData, ProjectGetLockStatusResponse, ProjectGetLockStatusError, ProjectPatchMasterdataData, ProjectPatchMasterdataResponse, ProjectPatchMasterdataError, ProjectPatchModelData, ProjectPatchModelResponse, ProjectPatchModelError, ProjectPatchAccessData, ProjectPatchAccessResponse, ProjectPatchAccessError, ProjectPatchCacheMaxRevisionsData, ProjectPatchCacheMaxRevisionsResponse, ProjectPatchCacheMaxRevisionsError, ProjectGetRmsProjectsData, ProjectGetRmsProjectsResponse, ProjectGetRmsProjectsError, ProjectPatchRmsData, ProjectPatchRmsResponse, ProjectPatchRmsError, ProjectPatchRmsCoordinateSystemData, ProjectPatchRmsCoordinateSystemResponse, ProjectPatchRmsStratigraphicFrameworkData, ProjectPatchRmsStratigraphicFrameworkResponse, ProjectPatchRmsWellsData, ProjectPatchRmsWellsResponse, ProjectGetCacheData, ProjectGetCacheResponse, ProjectGetCacheError, ProjectGetCacheRevisionData, ProjectGetCacheRevisionResponse, ProjectGetCacheDiffData, ProjectGetCacheDiffResponse, ProjectPostCacheRestoreData, ProjectPostCacheRestoreResponse, ProjectGetRestoreCheckData, ProjectGetRestoreCheckResponse, ProjectGetRestoreCheckError, ProjectPostRestoreData, ProjectPostRestoreResponse, ProjectPostRestoreError, ProjectGetMappingsData, ProjectGetMappingsResponse, ProjectPutMappingsData, ProjectPutMappingsResponse, ProjectGetChangelogData, ProjectGetChangelogResponse, UserGetUserData, UserGetUserResponse, UserGetUserError, UserPatchApiKeyData, UserPatchApiKeyResponse, UserPatchApiKeyError, SessionGetSessionData, SessionGetSessionResponse, SessionGetSessionError, SessionPostSessionData, SessionPostSessionResponse, SessionPostSessionError, SessionPatchAccessTokenData, SessionPatchAccessTokenResponse, SessionPatchAccessTokenError, SessionGetRestoreCheckData, SessionGetRestoreCheckResponse, SessionGetRestoreCheckError, SessionPostRestoreData, SessionPostRestoreResponse, SessionPostRestoreError, RmsDeleteRmsProjectData, RmsDeleteRmsProjectResponse, RmsDeleteRmsProjectError, RmsPostRmsProjectData, RmsPostRmsProjectResponse, RmsGetZonesData, RmsGetZonesResponse, RmsGetZonesError, RmsGetHorizonsData, RmsGetHorizonsResponse, RmsGetHorizonsError, RmsGetWellsData, RmsGetWellsResponse, RmsGetWellsError, RmsGetCoordinateSystemData, RmsGetCoordinateSystemResponse, RmsGetCoordinateSystemError, SmdaGetHealthData, SmdaGetHealthResponse, SmdaGetHealthError, SmdaPostFieldData, SmdaPostFieldResponse, SmdaPostFieldError, SmdaPostMasterdataData, SmdaPostMasterdataResponse, SmdaPostStratUnitsData, SmdaPostStratUnitsResponse, MatchPostMatchData, MatchPostMatchResponse, HealthV1HealthCheckData, HealthV1HealthCheckResponse, HealthV1HealthCheckError, HealthHealthCheckData, HealthHealthCheckResponse } from './types.gen'; +import type { ProjectDeleteProjectSessionData, ProjectDeleteProjectSessionResponse, ProjectDeleteProjectSessionError, ProjectGetProjectData, ProjectGetProjectResponse, ProjectGetProjectError, ProjectPostProjectData, ProjectPostProjectResponse, ProjectPostProjectError, ProjectGetSumoAssetsData, ProjectGetSumoAssetsResponse, ProjectGetGlobalConfigStatusData, ProjectGetGlobalConfigStatusResponse, ProjectPostInitProjectData, ProjectPostInitProjectResponse, ProjectPostGlobalConfigData, ProjectPostGlobalConfigResponse, ProjectPostLockAcquireData, ProjectPostLockAcquireResponse, ProjectPostLockAcquireError, ProjectPostLockReleaseData, ProjectPostLockReleaseResponse, ProjectPostLockReleaseError, ProjectPostLockRefreshData, ProjectPostLockRefreshResponse, ProjectPostLockRefreshError, ProjectGetLockStatusData, ProjectGetLockStatusResponse, ProjectGetLockStatusError, ProjectPatchMasterdataData, ProjectPatchMasterdataResponse, ProjectPatchMasterdataError, ProjectPostValidateMasterdataSmdaData, ProjectPostValidateMasterdataSmdaResponse, ProjectPatchModelData, ProjectPatchModelResponse, ProjectPatchModelError, ProjectPatchAccessData, ProjectPatchAccessResponse, ProjectPatchAccessError, ProjectPatchCacheMaxRevisionsData, ProjectPatchCacheMaxRevisionsResponse, ProjectPatchCacheMaxRevisionsError, ProjectGetRmsProjectsData, ProjectGetRmsProjectsResponse, ProjectGetRmsProjectsError, ProjectPatchRmsData, ProjectPatchRmsResponse, ProjectPatchRmsError, ProjectPatchRmsCoordinateSystemData, ProjectPatchRmsCoordinateSystemResponse, ProjectPatchRmsStratigraphicFrameworkData, ProjectPatchRmsStratigraphicFrameworkResponse, ProjectPatchRmsWellsData, ProjectPatchRmsWellsResponse, ProjectGetCacheData, ProjectGetCacheResponse, ProjectGetCacheError, ProjectGetCacheRevisionData, ProjectGetCacheRevisionResponse, ProjectGetCacheDiffData, ProjectGetCacheDiffResponse, ProjectPostCacheRestoreData, ProjectPostCacheRestoreResponse, ProjectGetRestoreCheckData, ProjectGetRestoreCheckResponse, ProjectGetRestoreCheckError, ProjectPostRestoreData, ProjectPostRestoreResponse, ProjectPostRestoreError, ProjectGetMappingsData, ProjectGetMappingsResponse, ProjectPutMappingsData, ProjectPutMappingsResponse, ProjectPostMappingsImportRmsEclipseCsvData, ProjectPostMappingsImportRmsEclipseCsvResponse, ProjectPostMappingsExportRmsSimulatorRenamingTableData, ProjectPostMappingsExportRmsSimulatorRenamingTableResponse, ProjectGetChangelogData, ProjectGetChangelogResponse, UserGetUserData, UserGetUserResponse, UserGetUserError, UserPatchApiKeyData, UserPatchApiKeyResponse, UserPatchApiKeyError, SessionGetSessionData, SessionGetSessionResponse, SessionGetSessionError, SessionPostSessionData, SessionPostSessionResponse, SessionPostSessionError, SessionPatchAccessTokenData, SessionPatchAccessTokenResponse, SessionPatchAccessTokenError, SessionGetRestoreCheckData, SessionGetRestoreCheckResponse, SessionGetRestoreCheckError, SessionPostRestoreData, SessionPostRestoreResponse, SessionPostRestoreError, RmsDeleteRmsProjectData, RmsDeleteRmsProjectResponse, RmsDeleteRmsProjectError, RmsPostRmsProjectData, RmsPostRmsProjectResponse, RmsGetZonesData, RmsGetZonesResponse, RmsGetZonesError, RmsGetHorizonsData, RmsGetHorizonsResponse, RmsGetHorizonsError, RmsGetWellsData, RmsGetWellsResponse, RmsGetWellsError, RmsGetCoordinateSystemData, RmsGetCoordinateSystemResponse, RmsGetCoordinateSystemError, SmdaGetHealthData, SmdaGetHealthResponse, SmdaGetHealthError, SmdaPostFieldData, SmdaPostFieldResponse, SmdaPostFieldError, SmdaPostMasterdataData, SmdaPostMasterdataResponse, SmdaPostStratUnitsData, SmdaPostStratUnitsResponse, SmdaPostWellHeadersData, SmdaPostWellHeadersResponse, MatchPostMatchData, MatchPostMatchResponse, HealthV1HealthCheckData, HealthV1HealthCheckResponse, HealthV1HealthCheckError, HealthHealthCheckData, HealthHealthCheckResponse } from './types.gen'; import { client as _heyApiClient } from './client.gen'; export type Options = ClientOptions & { @@ -190,6 +190,19 @@ export const projectPatchMasterdata = (opt }); }; +/** + * Validates project masterdata against SMDA + * Validates the saved project SMDA masterdata against current SMDA data. + * If validation succeeds, validation metadata is updated in the project + * config. If validation fails, no validation metadata is written. + */ +export const projectPostValidateMasterdataSmda = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v1/project/validate/masterdata/smda', + ...options + }); +}; + /** * Saves model data to the project .fmu directory * Saves model data to the project .fmu directory. @@ -448,6 +461,43 @@ export const projectPutMappings = (options }); }; +/** + * Imports RMS-to-simulator wellbore mappings from rms_eclipse.csv. + * Reads an rms_eclipse.csv-format file from the project and returns the + * imported RMS-to-simulator mappings in the internal wellbore mapping format. + * The path is relative to the project root. If no path is provided, the default + * path relative to the project root is + * rms/input/well_modelling/well_info/rms_eclipse.csv. + */ +export const projectPostMappingsImportRmsEclipseCsv = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v1/project/mappings/import/rms_eclipse_csv', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + +/** + * Exports RMS-to-simulator wellbore mappings to a renaming table. + * Reads RMS-to-simulator wellbore mappings from mappings.json and writes them + * to an rms_simulator renaming-table file. The path is relative to the project + * root. If no path is provided, the default path relative to the project root is + * rms/input/well_modelling/well_info/rms_simulator.renaming_table. + */ +export const projectPostMappingsExportRmsSimulatorRenamingTable = (options?: Options) => { + return (options?.client ?? _heyApiClient).post({ + url: '/api/v1/project/mappings/export/rms_simulator_renaming_table', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + /** * Returns changelog for the project. * Retrieves changelog from the project's .fmu directory. @@ -766,6 +816,24 @@ export const smdaPostStratUnits = (options }); }; +/** + * Retrieves well headers for a field + * A route to gather well header data from SMDA for a specified field. + * + * This route receives a valid field identifier and returns the well header + * fields needed to identify and map SMDA wellbores against model well names. + */ +export const smdaPostWellHeaders = (options: Options) => { + return (options.client ?? _heyApiClient).post({ + url: '/api/v1/smda/well_headers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; + /** * Match source names to target names * Match source names to target names using strict name similarity. diff --git a/frontend/src/client/types.gen.ts b/frontend/src/client/types.gen.ts index 7ba93f6b..aee7a057 100644 --- a/frontend/src/client/types.gen.ts +++ b/frontend/src/client/types.gen.ts @@ -469,6 +469,15 @@ export type ProjectConfig = { access?: Access | null; cache_max_revisions?: number; rms?: RmsProject | null; + validation?: ProjectValidation; +}; + +/** + * Validation metadata for project configuration data. + */ +export type ProjectValidation = { + masterdata_smda?: ValidationRecord | null; + rms_project?: ValidationRecord | null; }; /** @@ -528,6 +537,16 @@ export type RmsProjectPathsResult = { results: Array; }; +/** + * A path to an RMS-to-simulator mapping import or export file. + */ +export type RmsSimulatorMappingFilePath = { + /** + * Relative path in the project to an RMS-to-simulator mapping file. + */ + relative_path: string; +}; + /** * RMS stratigraphic framework consisting of zones and horizons. */ @@ -731,6 +750,123 @@ export type SmdaStratigraphicUnitsResult = { stratigraphic_units: Array; }; +/** + * Well header data from SMDA. + */ +export type SmdaWellHeader = { + /** + * Unique SMDA identifier for the well. + */ + unique_well_identifier: string; + /** + * Unique SMDA identifier for the wellbore. + */ + unique_wellbore_identifier: string; + /** + * Official wellbore name used by the Authorities. + * + * For Norway and UK, it will be the unique_wellbore_identifier without + * country iso code, but for Brazil it can really differs from the Equinor + * wellbore name. + */ + official_wellbore_name: string | null; + /** + * Country identifier for the wellbore. + */ + country_identifier: string; + /** + * The unique wellbore identifier this wellbore is kicked off from. + * + * Ref. kick off depth. This is used for sidetracks. A wellbore starting at + * the well origin has no parent. + */ + parent_wellbore: string | null; + /** + * Type of wellbore, values like exploration, development, other. + * + * This attribute is automatically maintained in SMDA based on the wellbore + * purpose. If the purpose is like wildcat or appraisal, type will be set to + * exploration, if the purpose is like production, injection then the type is + * set to development. + */ + wellbore_type: string | null; + /** + * Purpose of wellbore. + * + * Values like wildcat, appraisal, … for exploration wellbores; production, + * injection, observation, disposal, … for development wellbores; shallow gas, + * pilot hole for other purpose. + */ + wellbore_purpose: string | null; + /** + * Status of the wellbore. + * + * Value like plugged and abandoned, drilling, plugged, producing ... This + * attribute is automatically maintained in SMDA if no good source is found + * for it. SMDA will use the wellbore type (exploration or development), the + * drill dates information, current_track, etc ... in order to set a plausible + * status. If wellbore type=exploration and completed_date < current_date, + * then status=plugged and abandoned while development wellbore would be set + * to completed. + */ + wellbore_status: string | null; + /** + * Pre-drill purpose of the wellbore. + * + * Legal values for exploration wellbores: wildcat, appraisal. Example of + * legal values for development wellbores: observation, production, injection. + */ + wellbore_purpose_planned: string | null; + /** + * The year when the drilling has started. + */ + drill_year: number | null; + /** + * Date when the wellbore is considered completed. + * + * For exploration wellbores from moveable facilities, this may be the anchor + * handling or jacking-down start date. For fixed facilities and development + * wellbores, it is when the wellbore reaches total depth and the last casing, + * liner, or screen is set. If immediately plugged, it is the date the last + * plug is set. + */ + completion_date: string | null; + /** + * Internal name of the discovery. + */ + discovery_internal_identifier: string | null; + /** + * Whether the wellbore is multilateral. 0 = no, 1 = yes. + */ + multilateral: (0 | 1) | null; + /** + * Projected coordinate unit. + */ + projected_coordinate_unit: string | null; + /** + * Coordinate reference system for the easting/northing values. + */ + projected_coordinate_system: string | null; + /** + * SMDA UUID for the well. + */ + well_uuid: string; + /** + * SMDA UUID for the wellbore. + */ + wellbore_uuid: string; +}; + +/** + * Result containing a list of well headers. + */ +export type SmdaWellHeadersResult = { + /** + * List of well headers from SMDA. + */ + well_headers: Array; +}; + /** * The ``masterdata.smda.stratigraphic_column`` block contains the * stratigraphic column known to SMDA. @@ -854,6 +990,18 @@ export type ValidationError = { loc: Array; msg: string; type: string; + input?: unknown; + ctx?: { + [key: string]: unknown; + }; +}; + +/** + * Metadata for a successful validation of project configuration data. + */ +export type ValidationRecord = { + last_validated_at: string; + last_validated_by: string; }; export type ProjectDeleteProjectSessionData = { @@ -1361,6 +1509,59 @@ export type ProjectPatchMasterdataResponses = { export type ProjectPatchMasterdataResponse = ProjectPatchMasterdataResponses[keyof ProjectPatchMasterdataResponses]; +export type ProjectPostValidateMasterdataSmdaData = { + body?: never; + path?: never; + query?: never; + url: '/api/v1/project/validate/masterdata/smda'; +}; + +export type ProjectPostValidateMasterdataSmdaErrors = { + /** + * No active or valid session was found + */ + 401: unknown; + /** + * The OS returned a permissions error while locating or creating .fmu + */ + 403: unknown; + /** + * + * The .fmu directory was unable to be found at or above a given path, or + * the requested path to create a project .fmu directory at does not exist. + * + */ + 404: unknown; + /** + * Project masterdata is missing or does not match SMDA + */ + 422: unknown; + /** + * + * The project is locked by another process and cannot be modified. + * The project can still be read but write operations are blocked. + * + */ + 423: unknown; + /** + * SMDA returns a malformed response + */ + 500: unknown; + /** + * An API call to SMDA times out or fails + */ + 503: unknown; +}; + +export type ProjectPostValidateMasterdataSmdaResponses = { + /** + * Successful Response + */ + 200: Message; +}; + +export type ProjectPostValidateMasterdataSmdaResponse = ProjectPostValidateMasterdataSmdaResponses[keyof ProjectPostValidateMasterdataSmdaResponses]; + export type ProjectPatchModelData = { body: Model; path?: never; @@ -2149,6 +2350,97 @@ export type ProjectPutMappingsResponses = { export type ProjectPutMappingsResponse = ProjectPutMappingsResponses[keyof ProjectPutMappingsResponses]; +export type ProjectPostMappingsImportRmsEclipseCsvData = { + body?: RmsSimulatorMappingFilePath | null; + path?: never; + query?: never; + url: '/api/v1/project/mappings/import/rms_eclipse_csv'; +}; + +export type ProjectPostMappingsImportRmsEclipseCsvErrors = { + /** + * No active or valid session was found + */ + 401: unknown; + /** + * The RMS-to-simulator wellbore mapping file could not be read or written + */ + 403: unknown; + /** + * The RMS-to-simulator wellbore mapping file could not be found + */ + 404: unknown; + /** + * + * The RMS-to-simulator wellbore mapping file contains invalid content, + * or no mappings can be exported. + * + */ + 422: unknown; + /** + * Something unexpected has happened + */ + 500: unknown; +}; + +export type ProjectPostMappingsImportRmsEclipseCsvResponses = { + /** + * Successful Response + */ + 200: InternalMappings; +}; + +export type ProjectPostMappingsImportRmsEclipseCsvResponse = ProjectPostMappingsImportRmsEclipseCsvResponses[keyof ProjectPostMappingsImportRmsEclipseCsvResponses]; + +export type ProjectPostMappingsExportRmsSimulatorRenamingTableData = { + body?: RmsSimulatorMappingFilePath | null; + path?: never; + query?: never; + url: '/api/v1/project/mappings/export/rms_simulator_renaming_table'; +}; + +export type ProjectPostMappingsExportRmsSimulatorRenamingTableErrors = { + /** + * No active or valid session was found + */ + 401: unknown; + /** + * The RMS-to-simulator wellbore mapping file could not be read or written + */ + 403: unknown; + /** + * The RMS-to-simulator wellbore mapping file could not be found + */ + 404: unknown; + /** + * + * The RMS-to-simulator wellbore mapping file contains invalid content, + * or no mappings can be exported. + * + */ + 422: unknown; + /** + * + * The project is locked by another process and cannot be modified. + * The project can still be read but write operations are blocked. + * + */ + 423: unknown; + /** + * Something unexpected has happened + */ + 500: unknown; +}; + +export type ProjectPostMappingsExportRmsSimulatorRenamingTableResponses = { + /** + * Successful Response + */ + 200: Message; +}; + +export type ProjectPostMappingsExportRmsSimulatorRenamingTableResponse = ProjectPostMappingsExportRmsSimulatorRenamingTableResponses[keyof ProjectPostMappingsExportRmsSimulatorRenamingTableResponses]; + export type ProjectGetChangelogData = { body?: never; path?: never; @@ -2897,6 +3189,57 @@ export type SmdaPostStratUnitsResponses = { export type SmdaPostStratUnitsResponse = SmdaPostStratUnitsResponses[keyof SmdaPostStratUnitsResponses]; +export type SmdaPostWellHeadersData = { + body: SmdaField; + path?: never; + query?: never; + url: '/api/v1/smda/well_headers'; +}; + +export type SmdaPostWellHeadersErrors = { + /** + * Invalid parameters are provided to SMDA API + */ + 400: unknown; + /** + * No active or valid session was found + */ + 401: unknown; + /** + * A requested resource is not found in SMDA + */ + 404: unknown; + /** + * + * SMDA returns valid data but it doesn't meet expected criteria, + * or no results are found for a valid query. + * + */ + 422: unknown; + /** + * + * SMDA returns a malformed response that doesn't match + * the expected structure. + * + */ + 500: unknown; + /** + * + * An API call to SMDA times out or the service is unavailable. + * + */ + 503: unknown; +}; + +export type SmdaPostWellHeadersResponses = { + /** + * Successful Response + */ + 200: SmdaWellHeadersResult; +}; + +export type SmdaPostWellHeadersResponse = SmdaPostWellHeadersResponses[keyof SmdaPostWellHeadersResponses]; + export type MatchPostMatchData = { body: MatchRequest; path?: never;