@corva/ui 3.75.0-7 → 3.75.0-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/DateCell/DateCell.js +2 -0
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/DateCell/DateCell.js.map +1 -0
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SkeletonTableRow/SkeletonTableRow.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SkeletonTableRow/SkeletonTableRow.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useTableColumns.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useTableColumns.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/constants.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/constants.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useSortedWells.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useSortedWells.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/utils/doesWellPassFilters.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/utils/doesWellPassFilters.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/utils/sortWellsBy.js +2 -0
- package/cjs-bundle/components/OffsetWellPickerV5/utils/sortWellsBy.js.map +1 -0
- package/cjs-bundle/permissions/useProvidePermissions.js +1 -1
- package/cjs-bundle/permissions/useProvidePermissions.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/DateCell/DateCell.d.ts +12 -0
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/DateCell/DateCell.d.ts.map +1 -0
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/DateCell/DateCell.js +2 -0
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/DateCell/DateCell.js.map +1 -0
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/DateCell/index.d.ts +2 -0
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/{LastActiveCell → DateCell}/index.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/index.d.ts +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/index.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableRow/OffsetWellsTableRow.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SkeletonTableRow/SkeletonTableRow.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SkeletonTableRow/SkeletonTableRow.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SkeletonTableRow/SkeletonTableRow.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useTableColumns.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useTableColumns.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/hooks/useTableColumns.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.d.ts +2 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/useRowInteractions.js.map +1 -1
- package/components/OffsetWellPickerV5/constants.d.ts +10 -3
- package/components/OffsetWellPickerV5/constants.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/constants.js +1 -1
- package/components/OffsetWellPickerV5/constants.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js +1 -1
- package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/useWellDataPipeline.js.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useSortedWells.d.ts +1 -4
- package/components/OffsetWellPickerV5/hooks/useSortedWells.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useSortedWells.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useSortedWells.js.map +1 -1
- package/components/OffsetWellPickerV5/utils/__tests__/sortWellsBy.test.d.ts +2 -0
- package/components/OffsetWellPickerV5/utils/__tests__/sortWellsBy.test.d.ts.map +1 -0
- package/components/OffsetWellPickerV5/utils/doesWellPassFilters.d.ts +0 -1
- package/components/OffsetWellPickerV5/utils/doesWellPassFilters.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/utils/doesWellPassFilters.js +1 -1
- package/components/OffsetWellPickerV5/utils/doesWellPassFilters.js.map +1 -1
- package/components/OffsetWellPickerV5/utils/sortWellsBy.d.ts +22 -0
- package/components/OffsetWellPickerV5/utils/sortWellsBy.d.ts.map +1 -0
- package/components/OffsetWellPickerV5/utils/sortWellsBy.js +2 -0
- package/components/OffsetWellPickerV5/utils/sortWellsBy.js.map +1 -0
- package/mcp-server/server.mjs +1 -1
- package/package.json +1 -1
- package/permissions/useProvidePermissions.d.ts.map +1 -1
- package/permissions/useProvidePermissions.js +1 -1
- package/permissions/useProvidePermissions.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/LastActiveCell/LastActiveCell.js +0 -2
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/LastActiveCell/LastActiveCell.js.map +0 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/LastActiveCell/LastActiveCell.d.ts +0 -10
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/LastActiveCell/LastActiveCell.d.ts.map +0 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/LastActiveCell/LastActiveCell.js +0 -2
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/LastActiveCell/LastActiveCell.js.map +0 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/LastActiveCell/index.d.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortWellsBy.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/OffsetWellPickerV5/utils/__tests__/sortWellsBy.test.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,6 @@ import type { FilterState, PickerSegmentId } from '../stores/filter-store/types'
|
|
|
2
2
|
export declare const WELL_PROPERTY_FILTER_KEYS: (keyof FilterState)[];
|
|
3
3
|
export type FilterableWell = {
|
|
4
4
|
name?: string;
|
|
5
|
-
lastActive?: number;
|
|
6
5
|
lastDrillingAt?: number;
|
|
7
6
|
status?: string;
|
|
8
7
|
companyId?: number | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doesWellPassFilters.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV5/utils/doesWellPassFilters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQjF,eAAO,MAAM,yBAAyB,EAAE,CAAC,MAAM,WAAW,CAAC,EAY1D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"doesWellPassFilters.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV5/utils/doesWellPassFilters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQjF,eAAO,MAAM,yBAAyB,EAAE,CAAC,MAAM,WAAW,CAAC,EAY1D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,EAAE,CAAC;IACpC,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,0BAErC,CAAC;AAEF,eAAO,MAAM,mBAAmB,SACxB,cAAc,WACX,WAAW,GAAG,IAAI,YACjB,0BAA0B,KACnC,OA8EF,CAAC;AAEF,eAAO,MAAM,gCAAgC,SACrC,qBAAqB,WAClB,WAAW,GAAG,IAAI,iBACZ,OAAO,YACZ,0BAA0B,KACnC,OACuF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"@babel/runtime/helpers/slicedToArray";import{getTimestampByPeriod as e}from"./getTimestampByPeriod.js";import{isAssetVisibleToUser as i}from"./isAssetVisibleToUser.js";import{isDrillingOnlyWell as n}from"./isDrillingOnlyWell.js";var t=/\sST0/,l=["status","companyId","rigName","programName","basin","county","area","formation","stringDesign","interventionAsset","padName"],s={excludeKeys:["rigName"]},a=function(i,s,a){var u,o;if(!s)return!0;var m=null==a?void 0:a.excludeKeys;if(!l.every((function(r){if(null!=m&&m.includes(r))return!0;var e=s[r];if(Array.isArray(e)&&e.length>0){var n=i[r],t=e.map(String);return null==n||"Null"===n?t.includes("Null"):Array.isArray(n)?n.some((function(r){return t.includes(String(r))})):t.includes(String(n))}return!0})))return!1;if("intervention"===(null==a?void 0:a.segment)){var v=s.status;if(Array.isArray(v)&&v.map(String).includes("active")&&"active"===i.status&&"intervention"!==i.wellState)return!1}if(s.sideTracks&&t.test(null!==(u=i.name)&&void 0!==u?u:""))return!1;if("intervention"!==(null==a?void 0:a.segment)&&s.drillingWells&&!n(i))return!1;if(s.activeInterventionWells&&(null===(o=i.interventionAsset)||void 0===o||!o.length))return!1;var d=s.period,f=s.timeRangeFrom,g=s.timeRangeTo,c=e(d,f,g),y=r(c,2),p=y[0],A=y[1];if(null!==p&&null!==A&&Number.isFinite(p)&&Number.isFinite(A)){var N=i.lastDrillingAt;if(void 0===N||!(N>=p&&N<=A))return!1}return!0},u=function(r,e,n,t){return i(r,n)&&a(r,e,t)};export{s as EXCLUDE_RIG_NAME_FILTER,l as WELL_PROPERTY_FILTER_KEYS,a as doesWellPassFilters,u as doesWellPassVisibilityAndFilters};
|
|
2
2
|
//# sourceMappingURL=doesWellPassFilters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doesWellPassFilters.js","sources":["../../../../src/components/OffsetWellPickerV5/utils/doesWellPassFilters.ts"],"sourcesContent":["import type { FilterState, PickerSegmentId } from '../stores/filter-store/types';\n\nimport { getTimestampByPeriod } from './getTimestampByPeriod';\nimport { isAssetVisibleToUser } from './isAssetVisibleToUser';\nimport { isDrillingOnlyWell } from './isDrillingOnlyWell';\n\nconst SIDE_TRACK_REGEX = /\\sST0/;\n\nexport const WELL_PROPERTY_FILTER_KEYS: (keyof FilterState)[] = [\n 'status',\n 'companyId',\n 'rigName',\n 'programName',\n 'basin',\n 'county',\n 'area',\n 'formation',\n 'stringDesign',\n 'interventionAsset',\n 'padName',\n];\n\nexport type FilterableWell = {\n name?: string;\n
|
|
1
|
+
{"version":3,"file":"doesWellPassFilters.js","sources":["../../../../src/components/OffsetWellPickerV5/utils/doesWellPassFilters.ts"],"sourcesContent":["import type { FilterState, PickerSegmentId } from '../stores/filter-store/types';\n\nimport { getTimestampByPeriod } from './getTimestampByPeriod';\nimport { isAssetVisibleToUser } from './isAssetVisibleToUser';\nimport { isDrillingOnlyWell } from './isDrillingOnlyWell';\n\nconst SIDE_TRACK_REGEX = /\\sST0/;\n\nexport const WELL_PROPERTY_FILTER_KEYS: (keyof FilterState)[] = [\n 'status',\n 'companyId',\n 'rigName',\n 'programName',\n 'basin',\n 'county',\n 'area',\n 'formation',\n 'stringDesign',\n 'interventionAsset',\n 'padName',\n];\n\nexport type FilterableWell = {\n name?: string;\n lastDrillingAt?: number;\n status?: string;\n companyId?: number | string;\n rigName?: string;\n programName?: string;\n basin?: string;\n county?: string;\n area?: string;\n formation?: string;\n stringDesign?: unknown;\n interventionAsset?: string[];\n padName?: string;\n wellState?: string;\n lastInterventionAt?: number;\n};\n\nexport type FilterableVisibleWell = FilterableWell & { visibility?: string };\n\nexport type DoesWellPassFiltersOptions = {\n excludeKeys?: (keyof FilterState)[];\n segment?: PickerSegmentId;\n};\n\nexport const EXCLUDE_RIG_NAME_FILTER: DoesWellPassFiltersOptions = {\n excludeKeys: ['rigName'],\n};\n\nexport const doesWellPassFilters = (\n well: FilterableWell,\n filters: FilterState | null,\n options?: DoesWellPassFiltersOptions\n): boolean => {\n if (!filters) return true;\n\n const excludeKeys = options?.excludeKeys;\n\n // Check array property filters\n const passesPropertyFilters = WELL_PROPERTY_FILTER_KEYS.every(filterKey => {\n if (excludeKeys?.includes(filterKey)) return true;\n\n const filterValue = filters[filterKey];\n if (Array.isArray(filterValue) && filterValue.length > 0) {\n const wellValue = well[filterKey as keyof FilterableWell];\n const normalized = (filterValue as (string | number)[]).map(String);\n\n if (wellValue == null || wellValue === 'Null') {\n return normalized.includes('Null');\n }\n\n if (Array.isArray(wellValue)) {\n return (wellValue as string[]).some(v => normalized.includes(String(v)));\n }\n\n return normalized.includes(String(wellValue));\n }\n return true;\n });\n\n if (!passesPropertyFilters) {\n return false;\n }\n\n // Intervention segment: \"active\" status additionally requires wellState === 'intervention'\n if (options?.segment === 'intervention') {\n const statusFilter = filters.status;\n if (\n Array.isArray(statusFilter) &&\n statusFilter.map(String).includes('active') &&\n well.status === 'active' &&\n well.wellState !== 'intervention'\n ) {\n return false;\n }\n }\n\n // Check sideTracks filter\n if (filters.sideTracks && SIDE_TRACK_REGEX.test(well.name ?? '')) {\n return false;\n }\n\n if (options?.segment !== 'intervention' && filters.drillingWells && !isDrillingOnlyWell(well)) {\n return false;\n }\n\n // Check activeInterventionWells toggle: only show wells active on an intervention unit\n if (filters.activeInterventionWells && !well.interventionAsset?.length) {\n return false;\n }\n\n // Check time range filter\n const { period, timeRangeFrom, timeRangeTo } = filters;\n const [startTimestamp, endTimestamp] = getTimestampByPeriod(period, timeRangeFrom, timeRangeTo);\n\n if (\n startTimestamp !== null &&\n endTimestamp !== null &&\n Number.isFinite(startTimestamp) &&\n Number.isFinite(endTimestamp)\n ) {\n const { lastDrillingAt } = well;\n if (\n lastDrillingAt === undefined ||\n !(lastDrillingAt >= startTimestamp && lastDrillingAt <= endTimestamp)\n ) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const doesWellPassVisibilityAndFilters = (\n well: FilterableVisibleWell,\n filters: FilterState | null,\n includeHidden: boolean,\n options?: DoesWellPassFiltersOptions\n): boolean =>\n isAssetVisibleToUser(well, includeHidden) && doesWellPassFilters(well, filters, options);\n"],"names":["SIDE_TRACK_REGEX","WELL_PROPERTY_FILTER_KEYS","EXCLUDE_RIG_NAME_FILTER","excludeKeys","doesWellPassFilters","well","filters","options","_well$name","_well$interventionAss","every","filterKey","includes","filterValue","Array","isArray","length","wellValue","normalized","map","String","some","v","segment","statusFilter","status","wellState","sideTracks","test","name","drillingWells","isDrillingOnlyWell","activeInterventionWells","interventionAsset","period","timeRangeFrom","timeRangeTo","_getTimestampByPeriod","getTimestampByPeriod","_getTimestampByPeriod2","_slicedToArray","startTimestamp","endTimestamp","Number","isFinite","lastDrillingAt","undefined","doesWellPassVisibilityAndFilters","includeHidden","isAssetVisibleToUser"],"mappings":"mPAMA,IAAMA,EAAmB,QAEZC,EAAmD,CAC9D,SACA,YACA,UACA,cACA,QACA,SACA,OACA,YACA,eACA,oBACA,WA4BWC,EAAsD,CACjEC,YAAa,CAAC,YAGHC,EAAsB,SACjCC,EACAC,EACAC,GACY,IAAAC,EAAAC,EACZ,IAAKH,EAAS,OAAO,EAErB,IAAMH,EAAcI,aAAAA,EAAAA,EAASJ,YAwB7B,IArB8BF,EAA0BS,OAAM,SAAAC,GAC5D,GAAIR,SAAAA,EAAaS,SAASD,GAAY,OAAO,EAE7C,IAAME,EAAcP,EAAQK,GAC5B,GAAIG,MAAMC,QAAQF,IAAgBA,EAAYG,OAAS,EAAG,CACxD,IAAMC,EAAYZ,EAAKM,GACjBO,EAAcL,EAAoCM,IAAIC,QAE5D,OAAiB,MAAbH,GAAmC,SAAdA,EAChBC,EAAWN,SAAS,QAGzBE,MAAMC,QAAQE,GACRA,EAAuBI,MAAK,SAAAC,GAAC,OAAIJ,EAAWN,SAASQ,OAAOE,OAG/DJ,EAAWN,SAASQ,OAAOH,GACpC,CACA,OAAO,CACT,IAGE,OAAO,EAIT,GAAyB,kBAArBV,aAAO,EAAPA,EAASgB,SAA4B,CACvC,IAAMC,EAAelB,EAAQmB,OAC7B,GACEX,MAAMC,QAAQS,IACdA,EAAaL,IAAIC,QAAQR,SAAS,WAClB,WAAhBP,EAAKoB,QACc,iBAAnBpB,EAAKqB,UAEL,OAAO,CAEX,CAGA,GAAIpB,EAAQqB,YAAc3B,EAAiB4B,KAAkB,QAAbvB,EAAAA,EAAKwB,YAAQ,IAAArB,EAAAA,EAAA,IAC3D,OAAO,EAGT,GAAyB,kBAArBD,eAAAA,EAASgB,UAA8BjB,EAAQwB,gBAAkBC,EAAmB1B,GACtF,OAAO,EAIT,GAAIC,EAAQ0B,0BAAkD,QAAvBvB,EAACJ,EAAK4B,yBAAiB,IAAAxB,IAAtBA,EAAwBO,QAC9D,OAAO,EAIT,IAAQkB,EAAuC5B,EAAvC4B,OAAQC,EAA+B7B,EAA/B6B,cAAeC,EAAgB9B,EAAhB8B,YAC/BC,EAAuCC,EAAqBJ,EAAQC,EAAeC,GAAYG,EAAAC,EAAAH,EAAA,GAAxFI,EAAcF,EAAA,GAAEG,EAAYH,EAAA,GAEnC,GACqB,OAAnBE,GACiB,OAAjBC,GACAC,OAAOC,SAASH,IAChBE,OAAOC,SAASF,GAChB,CACA,IAAQG,EAAmBxC,EAAnBwC,eACR,QACqBC,IAAnBD,KACEA,GAAkBJ,GAAkBI,GAAkBH,GAExD,OAAO,CAEX,CAEA,OAAO,CACT,EAEaK,EAAmC,SAC9C1C,EACAC,EACA0C,EACAzC,GAAoC,OAEpC0C,EAAqB5C,EAAM2C,IAAkB5C,EAAoBC,EAAMC,EAASC,EAAQ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SortDirectionType } from '../constants';
|
|
2
|
+
export type SortableWell = Record<string, unknown> & {
|
|
3
|
+
id: number;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Sorts wells by a column, leaving the input array untouched.
|
|
7
|
+
*
|
|
8
|
+
* Two rules, both of which the table relies on:
|
|
9
|
+
* - wells with no value sink to the bottom in *both* directions, so sorting never
|
|
10
|
+
* surfaces gaps ahead of data;
|
|
11
|
+
* - anything that is not strictly greater or smaller — equal values, arrays with the
|
|
12
|
+
* same contents, coercively equal values of mismatched types (`5` and `"5"`) — is a
|
|
13
|
+
* tie and returns 0, so the stable sort keeps the incoming order instead of
|
|
14
|
+
* shuffling those rows on every re-sort.
|
|
15
|
+
*
|
|
16
|
+
* Values within a column are assumed to share one type (numbers, strings, or string
|
|
17
|
+
* arrays). Mixing numbers with strings in the same column is not supported: the
|
|
18
|
+
* numeric and textual branches of `compareValues` use different orderings, so a mixed
|
|
19
|
+
* column has no consistent order to sort by.
|
|
20
|
+
*/
|
|
21
|
+
export declare const sortWellsBy: (wells: SortableWell[], sortByKey: string, sortDir: SortDirectionType) => SortableWell[];
|
|
22
|
+
//# sourceMappingURL=sortWellsBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortWellsBy.d.ts","sourceRoot":"","sources":["../../../../src/components/OffsetWellPickerV5/utils/sortWellsBy.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE5E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAyCpE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,UACf,YAAY,EAAE,aACV,MAAM,WACR,iBAAiB,KACzB,YAAY,EAuBd,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import r from"@babel/runtime/helpers/toConsumableArray";import{ColumnType as t,SortDirection as n}from"../constants.js";var e=new Set([t.lastDrillingAt,t.lastInterventionAt]),o=function(r){return Array.isArray(r)?r.join(", "):String(r)},i=function(r,t){return"string"==typeof r?!r||"null"===r.toLowerCase():0===r?t:!r},u=function(t,u,a){var f=e.has(u),s=a===n.ASC;return r(t).sort((function(r,t){var n=r[u],e=t[u],a=i(n,f),l=i(e,f);if(a&&l)return 0;if(a)return 1;if(l)return-1;if("string"==typeof n&&"string"==typeof e)return s?n.localeCompare(e):e.localeCompare(n);var p=function(r,t){if("number"==typeof r&&"number"==typeof t)return r===t?0:r>t?1:-1;var n=o(r),e=o(t);return n===e?0:n>e?1:-1}(n,e);return s?p:-p}))};export{u as sortWellsBy};
|
|
2
|
+
//# sourceMappingURL=sortWellsBy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortWellsBy.js","sources":["../../../../src/components/OffsetWellPickerV5/utils/sortWellsBy.ts"],"sourcesContent":["import { ColumnType, SortDirection, SortDirectionType } from '../constants';\n\nexport type SortableWell = Record<string, unknown> & { id: number };\n\n/**\n * Columns holding a unix timestamp, where `0` means \"no date\" rather than a real\n * value — the cell renders it as an em dash, so sorting treats it as missing too.\n */\nconst DATE_COLUMNS: Set<string> = new Set([\n ColumnType.lastDrillingAt,\n ColumnType.lastInterventionAt,\n]);\n\n/** Renders a value the way the table does, so ordering follows what the user reads. */\nconst toText = (value: unknown): string =>\n Array.isArray(value) ? value.join(', ') : String(value);\n\n/** Three-way comparison: 0 means \"tie\", which the caller turns into a stable order. */\nconst compareValues = (a: unknown, b: unknown): number => {\n if (typeof a === 'number' && typeof b === 'number') {\n if (a === b) return 0;\n return a > b ? 1 : -1;\n }\n\n const aText = toText(a);\n const bText = toText(b);\n\n if (aText === bText) return 0;\n return aText > bText ? 1 : -1;\n};\n\nconst isMissing = (value: unknown, treatZeroAsMissing: boolean): boolean => {\n if (typeof value === 'string') {\n return !value || value.toLowerCase() === 'null';\n }\n\n if (value === 0) {\n return treatZeroAsMissing;\n }\n\n return !value;\n};\n\n/**\n * Sorts wells by a column, leaving the input array untouched.\n *\n * Two rules, both of which the table relies on:\n * - wells with no value sink to the bottom in *both* directions, so sorting never\n * surfaces gaps ahead of data;\n * - anything that is not strictly greater or smaller — equal values, arrays with the\n * same contents, coercively equal values of mismatched types (`5` and `\"5\"`) — is a\n * tie and returns 0, so the stable sort keeps the incoming order instead of\n * shuffling those rows on every re-sort.\n *\n * Values within a column are assumed to share one type (numbers, strings, or string\n * arrays). Mixing numbers with strings in the same column is not supported: the\n * numeric and textual branches of `compareValues` use different orderings, so a mixed\n * column has no consistent order to sort by.\n */\nexport const sortWellsBy = (\n wells: SortableWell[],\n sortByKey: string,\n sortDir: SortDirectionType\n): SortableWell[] => {\n const treatZeroAsMissing = DATE_COLUMNS.has(sortByKey);\n const isAscending = sortDir === SortDirection.ASC;\n\n return [...wells].sort((a, b) => {\n const aVal = a[sortByKey];\n const bVal = b[sortByKey];\n\n const aMissing = isMissing(aVal, treatZeroAsMissing);\n const bMissing = isMissing(bVal, treatZeroAsMissing);\n\n if (aMissing && bMissing) return 0;\n if (aMissing) return 1;\n if (bMissing) return -1;\n\n if (typeof aVal === 'string' && typeof bVal === 'string') {\n return isAscending ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);\n }\n\n const order = compareValues(aVal, bVal);\n\n return isAscending ? order : -order;\n });\n};\n"],"names":["DATE_COLUMNS","Set","ColumnType","lastDrillingAt","lastInterventionAt","toText","value","Array","isArray","join","String","isMissing","treatZeroAsMissing","toLowerCase","sortWellsBy","wells","sortByKey","sortDir","has","isAscending","SortDirection","ASC","_toConsumableArray","sort","a","b","aVal","bVal","aMissing","bMissing","localeCompare","order","aText","bText","compareValues"],"mappings":"wHAQA,IAAMA,EAA4B,IAAIC,IAAI,CACxCC,EAAWC,eACXD,EAAWE,qBAIPC,EAAS,SAACC,GAAc,OAC5BC,MAAMC,QAAQF,GAASA,EAAMG,KAAK,MAAQC,OAAOJ,EAAM,EAgBnDK,EAAY,SAACL,EAAgBM,GACjC,MAAqB,iBAAVN,GACDA,GAAiC,SAAxBA,EAAMO,cAGX,IAAVP,EACKM,GAGDN,CACV,EAkBaQ,EAAc,SACzBC,EACAC,EACAC,GAEA,IAAML,EAAqBZ,EAAakB,IAAIF,GACtCG,EAAcF,IAAYG,EAAcC,IAE9C,OAAOC,EAAIP,GAAOQ,MAAK,SAACC,EAAGC,GACzB,IAAMC,EAAOF,EAAER,GACTW,EAAOF,EAAET,GAETY,EAAWjB,EAAUe,EAAMd,GAC3BiB,EAAWlB,EAAUgB,EAAMf,GAEjC,GAAIgB,GAAYC,EAAU,OAAO,EACjC,GAAID,EAAU,OAAO,EACrB,GAAIC,EAAU,OAAQ,EAEtB,GAAoB,iBAATH,GAAqC,iBAATC,EACrC,OAAOR,EAAcO,EAAKI,cAAcH,GAAQA,EAAKG,cAAcJ,GAGrE,IAAMK,EAhEY,SAACP,EAAYC,GACjC,GAAiB,iBAAND,GAA+B,iBAANC,EAClC,OAAID,IAAMC,EAAU,EACbD,EAAIC,EAAI,GAAK,EAGtB,IAAMO,EAAQ3B,EAAOmB,GACfS,EAAQ5B,EAAOoB,GAErB,OAAIO,IAAUC,EAAc,EACrBD,EAAQC,EAAQ,GAAK,CAC9B,CAqDkBC,CAAcR,EAAMC,GAElC,OAAOR,EAAcY,GAASA,CAChC,GACF"}
|
package/mcp-server/server.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProvidePermissions.d.ts","sourceRoot":"","sources":["../../src/permissions/useProvidePermissions.js"],"names":[],"mappings":"AAgBA,iBAAS,qBAAqB;;;
|
|
1
|
+
{"version":3,"file":"useProvidePermissions.d.ts","sourceRoot":"","sources":["../../src/permissions/useProvidePermissions.js"],"names":[],"mappings":"AAgBA,iBAAS,qBAAqB;;;EA0C7B;eAEc,qBAAqB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import{useState as o,useRef as
|
|
1
|
+
import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import{useState as o,useRef as c}from"react";import{parsePermission as i}from"./utils.js";import{getPermissionCheck as u}from"../clients/jsonApi/index.js";function s(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function p(r){return f.apply(this,arguments)}function f(){return(f=t(n.mark((function r(e){return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,u(e);case 3:return r.abrupt("return",r.sent);case 6:return r.prev=6,r.t0=r.catch(0),console.error(r.t0),r.abrupt("return",{active:!1});case 10:case"end":return r.stop()}}),r,null,[[0,6]])})))).apply(this,arguments)}function l(){var r=o({}),u=e(r,2),s=u[0],f=u[1],l=c({}),m=c(new Set);function b(){return(b=t(n.mark((function r(e){var t,o,c;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((t=e.filter((function(r){return!(r in l.current)&&!m.current.has(r)}))).length){r.next=3;break}return r.abrupt("return");case 3:return r.next=5,Promise.all(t.map((function(r){return m.current.add(r),p(i(r))})));case 5:o=r.sent,c=a({},l.current),t.forEach((function(r,e){m.current.delete(r),c[r]=a({loading:!1},o[e])})),l.current=c,f(c);case 10:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return window[Symbol.for("resetPermissionsCache")]=function(){l.current={},f({})},{permissions:s,fetchPermissions:function(r){return b.apply(this,arguments)}}}export{l as default};
|
|
2
2
|
//# sourceMappingURL=useProvidePermissions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProvidePermissions.js","sources":["../../src/permissions/useProvidePermissions.js"],"sourcesContent":["import { useRef, useState } from 'react';\n\nimport { parsePermission } from './utils';\n\nimport { getPermissionCheck } from '~/clients/jsonApi';\n\nasync function fetchPermissionCheck(requestOptions) {\n try {\n return await getPermissionCheck(requestOptions);\n } catch (e) {\n console.error(e);\n // NOTE: Return false by default\n return { active: false };\n }\n}\n\nfunction useProvidePermissions() {\n const [permissions, setPermissions] = useState({});\n // NOTE: Store pending requests to prevent duplicate requests\n const pendingRequests = useRef(new Set());\n\n // NOTE: Called in finishLogIn redux action\n window[Symbol.for('resetPermissionsCache')] = () => setPermissions({});\n\n async function fetchPermissions(permissionKeys) {\n const permissionsToFetch = permissionKeys.filter(\n // NOTE: Send check request ONLY for new permission\n pKey => !(pKey in
|
|
1
|
+
{"version":3,"file":"useProvidePermissions.js","sources":["../../src/permissions/useProvidePermissions.js"],"sourcesContent":["import { useRef, useState } from 'react';\n\nimport { parsePermission } from './utils';\n\nimport { getPermissionCheck } from '~/clients/jsonApi';\n\nasync function fetchPermissionCheck(requestOptions) {\n try {\n return await getPermissionCheck(requestOptions);\n } catch (e) {\n console.error(e);\n // NOTE: Return false by default\n return { active: false };\n }\n}\n\nfunction useProvidePermissions() {\n const [permissions, setPermissions] = useState({});\n // NOTE: Latest permissions. fetchPermissions reads from this ref instead of the `permissions`\n // state, because a consumer may call a fetchPermissions closure created by an earlier render.\n const permissionsRef = useRef({});\n // NOTE: Store pending requests to prevent duplicate requests\n const pendingRequests = useRef(new Set());\n\n // NOTE: Called in finishLogIn redux action\n window[Symbol.for('resetPermissionsCache')] = () => {\n permissionsRef.current = {};\n setPermissions({});\n };\n\n async function fetchPermissions(permissionKeys) {\n const permissionsToFetch = permissionKeys.filter(\n // NOTE: Send check request ONLY for new permission\n pKey => !(pKey in permissionsRef.current) && !pendingRequests.current.has(pKey)\n );\n if (!permissionsToFetch.length) return;\n\n const response = await Promise.all(\n permissionsToFetch.map(pKey => {\n // NOTE: Add permission to pending requests and send check request\n pendingRequests.current.add(pKey);\n\n return fetchPermissionCheck(parsePermission(pKey));\n })\n );\n\n // NOTE: Update the cache and the pending set together, so a permission is never\n // \"not cached and not pending\" in between (that gap caused duplicate requests)\n const nextPermissions = { ...permissionsRef.current };\n permissionsToFetch.forEach((pKey, pIndex) => {\n pendingRequests.current.delete(pKey);\n nextPermissions[pKey] = { loading: false, ...response[pIndex] };\n });\n permissionsRef.current = nextPermissions;\n setPermissions(nextPermissions);\n }\n\n return { permissions, fetchPermissions };\n}\n\nexport default useProvidePermissions;\n"],"names":["fetchPermissionCheck","_x","_fetchPermissionCheck","apply","this","arguments","_asyncToGenerator","_regeneratorRuntime","mark","requestOptions","wrap","_context2","prev","next","getPermissionCheck","abrupt","sent","t0","console","error","active","stop","_callee2","useProvidePermissions","_useState","useState","_useState2","_slicedToArray","permissions","setPermissions","permissionsRef","useRef","pendingRequests","Set","_fetchPermissions","permissionKeys","permissionsToFetch","response","nextPermissions","_context","filter","pKey","current","has","length","Promise","all","map","add","parsePermission","_objectSpread","forEach","pIndex","delete","loading","_callee","window","Symbol","for","fetchPermissions","_x2"],"mappings":"o6BAIuD,SAExCA,EAAoBC,GAAA,OAAAC,EAAAC,MAAAC,KAAAC,UAAA,CAAA,SAAAH,IAQlC,OARkCA,EAAAI,EAAAC,EAAAC,MAAnC,WAAoCC,GAAc,OAAAF,EAAAG,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAC,KAAA,EAAAD,EAAAE,KAAA,EAEjCC,EAAmBL,GAAe,KAAA,EAAA,OAAAE,EAAAI,OAAA,SAAAJ,EAAAK,MAAA,KAAA,EAG/C,OAH+CL,EAAAC,KAAA,EAAAD,EAAAM,GAAAN,EAAA,MAAA,GAE/CO,QAAQC,MAAQR,EAAAM,IAETN,EAAAI,OAAA,SAAA,CAAEK,QAAQ,IAAO,KAAA,GAAA,IAAA,MAAA,OAAAT,EAAAU,OAAA,GAAAC,EAAA,KAAA,CAAA,CAAA,EAAA,IAE3B,MAAAnB,MAAAC,KAAAC,UAAA,CAED,SAASkB,IACP,IAAAC,EAAsCC,EAAS,IAAGC,EAAAC,EAAAH,EAAA,GAA3CI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAG5BI,EAAiBC,EAAO,CAAA,GAExBC,EAAkBD,EAAO,IAAIE,KAQJ,SAAAC,IAyB9B,OAzB8BA,EAAA5B,EAAAC,EAAAC,MAA/B,WAAgC2B,GAAc,IAAAC,EAAAC,EAAAC,EAAA,OAAA/B,EAAAG,MAAA,SAAA6B,GAAA,OAAA,OAAAA,EAAA3B,KAAA2B,EAAA1B,MAAA,KAAA,EAI3C,IAHKuB,EAAqBD,EAAeK,QAExC,SAAAC,GAAI,QAAMA,KAAQX,EAAeY,WAAaV,EAAgBU,QAAQC,IAAIF,OAEpDG,OAAM,CAAAL,EAAA1B,KAAA,EAAA,KAAA,CAAA,OAAA0B,EAAAxB,OAAA,UAAA,KAAA,EAAA,OAAAwB,EAAA1B,KAAA,EAEPgC,QAAQC,IAC7BV,EAAmBW,KAAI,SAAAN,GAIrB,OAFAT,EAAgBU,QAAQM,IAAIP,GAErBzC,EAAqBiD,EAAgBR,GAC7C,KACF,KAAA,EAPKJ,EAAQE,EAAAvB,KAWRsB,EAAeY,EAAA,CAAA,EAAQpB,EAAeY,SAC5CN,EAAmBe,SAAQ,SAACV,EAAMW,GAChCpB,EAAgBU,QAAQW,OAAOZ,GAC/BH,EAAgBG,GAAKS,EAAA,CAAKI,SAAS,GAAUjB,EAASe,GACxD,IACAtB,EAAeY,QAAUJ,EACzBT,EAAeS,GAAiB,KAAA,GAAA,IAAA,MAAA,OAAAC,EAAAlB,OAAA,GAAAkC,EACjC,MAAApD,MAAAC,KAAAC,UAAA,CAED,OAhCAmD,OAAOC,OAAOC,IAAI,0BAA4B,WAC5C5B,EAAeY,QAAU,GACzBb,EAAe,CAAE,IA8BZ,CAAED,YAAAA,EAAa+B,iBA7BpB,SAE6BC,GAAA,OAAA1B,EAAA/B,MAAAC,KAAAC,UAAA,EA4BjC"}
|