Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ const onClearFilters = () => {

onMounted(async () => {
workspaces.value = await hs.workspaces.listAllItems({
order_by: ['name'],
sortby: ['name'],
})
workspacesLoaded.value = true
void applyRouteState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ async function loadFallbackData() {
? Promise.resolve([])
: hs.monitoringSites.listAllItems({
workspace_id: [workspaceId],
order_by: ['name'],
sortby: ['name'],
} as any),
])
fetchedDatastreams.value = datastreams as Datastream[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1629,15 +1629,15 @@ const loadLinkedTasks = async () => {
const [etlTasks, dataProductTasks, monitoringTasks] = await Promise.all([
hs.tasks.listAllItems({
monitoring_site_id: [site.id],
order_by: ['name'],
sortby: ['name'],
}),
hs.dataProductTasks.listAllItems({
monitoring_site_id: [site.id],
order_by: ['name'],
sortby: ['name'],
}),
hs.monitoringTasks.listAllItems({
monitoring_site_id: [site.id],
order_by: ['name'],
sortby: ['name'],
}),
])
if (requestId !== linkedTasksRequestId) return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ async function loadDatastreams() {
try {
const items = await hs.datastreams.listAllItems({
workspace_id: [workspaceId],
order_by: ['name'],
sortby: ['name'],
expand_related: true,
} as any)
datastreams.value = items as Datastream[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ async function loadDatastreams() {
try {
const items = await hs.datastreams.listAllItems({
workspace_id: [workspaceId],
order_by: ['name'],
sortby: ['name'],
expand_related: true,
} as any)
datastreams.value = items as Datastream[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ async function loadOptions() {
try {
const datastreamItems = await hs.datastreams.listAllItems({
workspace_id: [workspaceId],
order_by: ['name'],
sortby: ['name'],
expand_related: true,
} as any)
datastreams.value = datastreamItems as Datastream[]
Expand Down Expand Up @@ -391,7 +391,7 @@ async function loadRatingCurves(monitoringSiteId: string) {
const items = await hs.ratingCurves.listItemsForMonitoringSite(
monitoringSiteId,
{
order_by: ['name'],
sortby: ['name'],
}
)
ratingCurves.value = [...items].sort((a, b) => a.name.localeCompare(b.name))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ async function refreshRatingCurves() {
backendLoading.value = true
try {
const items = await hs.ratingCurves.listItemsForMonitoringSite(props.monitoringSiteId, {
order_by: ['name'],
sortby: ['name'],
})
backendRatingCurves.value = items.sort((a, b) =>
a.name.localeCompare(b.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ async function loadDatastreams() {
try {
const items = await hs.datastreams.listAllItems({
workspace_id: [selectedWorkspace.value.id],
order_by: ['name'],
sortby: ['name'],
expand_related: true,
} as any)
datastreams.value = items as Datastream[]
Expand Down Expand Up @@ -497,7 +497,7 @@ async function loadExistingTask() {
hs.monitoringTasks.get(props.editTaskId),
hs.monitoringRules.list({
task_id: props.editTaskId,
order_by: ['datastreamId', 'ruleType'],
sortby: ['datastreamId', 'ruleType'],
} as any),
])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ async function loadCollaboratorData() {
const [cRes, rolesResponse] = await Promise.all([
hs.workspaces.getCollaborators(props.workspace.id),
hs.workspaces.getRoles({
order_by: ['name'],
sortby: ['name'],
}),
])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ async function loadRoles() {
try {
const res = await hs.workspaces.getRoles({
workspace_id: [workspaceId.value, 'null'],
order_by: ['name'],
sortby: ['name'],
})
if (!res.ok) {
rolesLoadError.value = 'Unable to load service account roles.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('useOrchestrationData', () => {
expect(data.monitoringSites.value.map((item) => item.id)).toEqual(['monitoringSite-1'])
expect(dataConnectionsListMock).toHaveBeenCalledWith({
workspace_id: 'workspace-1',
order_by: 'name',
sortby: 'name',
})
expect(monitoringSitesTaskSummariesMock).toHaveBeenCalledWith({
workspace_id: ['workspace-1'],
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('useOrchestrationData', () => {
expect(tasksListMock).toHaveBeenCalledWith({
workspace_id: ['workspace-1'],
data_connection_id: ['dc-1'],
order_by: ['name'],
sortby: ['name'],
expand_related: true,
})

Expand All @@ -108,15 +108,15 @@ describe('useOrchestrationData', () => {
expect(dataProductTasksListMock).toHaveBeenCalledWith({
workspace_id: ['workspace-1'],
monitoring_site_id: ['monitoringSite-1'],
order_by: ['name'],
sortby: ['name'],
})

await data.fetchTasksForGroup('quality', 'monitoringSite-1', 'workspace-1')
expect(data.monitoringTasks.value.map((item) => item.id)).toEqual(['mon-1'])
expect(monitoringTasksListMock).toHaveBeenCalledWith({
workspace_id: ['workspace-1'],
monitoring_site_id: ['monitoringSite-1'],
order_by: ['name'],
sortby: ['name'],
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function useOrchestrationData() {
const [dcItems, taskSummaryResponse] = await Promise.all([
hs.dataConnections.listAllItems({
workspace_id: requestedWorkspaceId,
order_by: 'name',
sortby: 'name',
} as any),
hs.monitoringSites.listTaskSummaries({
workspace_id: [requestedWorkspaceId],
Expand Down Expand Up @@ -99,7 +99,7 @@ export function useOrchestrationData() {
}
dataConnections.value = await hs.dataConnections.listAllItems({
workspace_id: requestedWorkspaceId,
order_by: 'name',
sortby: 'name',
} as any)
}

Expand Down Expand Up @@ -135,7 +135,7 @@ export function useOrchestrationData() {
const items = await hs.tasks.listAllItems({
workspace_id: [requestedWorkspaceId],
data_connection_id: [groupId],
order_by: ['name'],
sortby: ['name'],
expand_related: true,
} as any)
if (requestId !== taskRequestId) return
Expand All @@ -144,15 +144,15 @@ export function useOrchestrationData() {
const items = await hs.dataProductTasks.listAllItems({
workspace_id: [requestedWorkspaceId],
monitoring_site_id: [groupId],
order_by: ['name'],
sortby: ['name'],
} as any)
if (requestId !== taskRequestId) return
dataProductTasks.value = items as any
} else {
const items = await hs.monitoringTasks.listAllItems({
workspace_id: [requestedWorkspaceId],
monitoring_site_id: [groupId],
order_by: ['name'],
sortby: ['name'],
} as any)
if (requestId !== taskRequestId) return
monitoringTasks.value = items as any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export function useSimpleTaskDetails(
loadingRuns.value = true
try {
const response = await service.getTaskRuns(task.value.id, {
order_by: ['-startedAt'],
sortby: ['-startedAt'],
offset: 0,
limit: 50,
})
Expand Down
10 changes: 5 additions & 5 deletions apps/data-management/src/composables/useMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ export function useMetadata(localWorkspace?: Ref<Workspace | undefined>) {
methodsResponse,
resultQualifiersResponse,
] = await Promise.all([
hs.units.listAllItems({ order_by: ['name'], ...workspaceFilter }),
hs.units.listAllItems({ sortby: ['name'], ...workspaceFilter }),
hs.observedProperties.listAllItems({
order_by: ['name'],
sortby: ['name'],
...workspaceFilter,
}),
hs.processingLevels.listAllItems({
order_by: ['code'],
sortby: ['code'],
...workspaceFilter,
}),
hs.methods.listAllItems({ order_by: ['name'], ...workspaceFilter }),
hs.methods.listAllItems({ sortby: ['name'], ...workspaceFilter }),
hs.resultQualifiers.listAllItems({
order_by: ['code'],
sortby: ['code'],
...workspaceFilter,
}),
])
Expand Down
2 changes: 1 addition & 1 deletion apps/data-management/src/store/orchestration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const useOrchestrationStore = defineStore('orchestration', () => {
const requestId = ++workspaceMonitoringSitesRequestId
const list = await hs.monitoringSites.listAllItems({
workspace_id: [requestedWorkspaceId],
order_by: ['name'],
sortby: ['name'],
} as any)
if (requestId !== workspaceMonitoringSitesRequestId) {
return workspaceMonitoringSites.value
Expand Down
2 changes: 1 addition & 1 deletion apps/data-management/src/store/ratingCurves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const useRatingCurveStore = defineStore('ratingCurves', () => {
loading.value = true
try {
const items = await hs.ratingCurves.listItemsForMonitoringSite(monitoringSiteId, {
order_by: ['name'],
sortby: ['name'],
})
existingRatingCurves.value = [...items].sort((a, b) =>
a.name.localeCompare(b.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('fetchRecentObservationsPage', () => {
])
expect(getObservationsMock).toHaveBeenCalledWith('123', {
offset: 0,
order_by: ['-phenomenonTime'],
sortby: ['-phenomenonTime'],
limit: 200,
format: 'column',
})
Expand Down
4 changes: 2 additions & 2 deletions apps/data-management/src/utils/observationsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const fetchObservations = async (
if (!phenomenonBeginTime || !phenomenonEndTime) return []

const options: any = {
order_by: ['phenomenonTime'],
sortby: ['phenomenonTime'],
limit: 50_000,
format: 'column',
phenomenon_time_min: startTime ?? phenomenonBeginTime,
Expand All @@ -57,7 +57,7 @@ export const fetchRecentObservationsPage = async (
) => {
const res = await hs.datastreams.getObservations(datastream.id, {
offset: 0,
order_by: ['-phenomenonTime'],
sortby: ['-phenomenonTime'],
limit: pageSize,
format: 'column',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Most endpoints support query params such as:

- `page`
- `page_size`
- `order_by`
- `sortby`
- `expand_related`
- Resource-specific filters

Expand Down Expand Up @@ -96,11 +96,11 @@ const allWorkspaces = await hs.workspaces.listAllItems({

```ts
const ordered = await hs.workspaces.list({
order_by: ["name"],
sortby: ["name"],
});

const multiOrdered = await hs.workspaces.list({
order_by: ["-name", "isPrivate"],
sortby: ["-name", "isPrivate"],
});
```

Expand Down Expand Up @@ -567,7 +567,7 @@ const observations = await hs.datastreams.getObservations(
"00000000-0000-0000-0000-000000000000",
{
format: "row",
order_by: ["phenomenonTime"],
sortby: ["phenomenonTime"],
phenomenon_time_min: "2025-01-01T00:00:00Z",
phenomenon_time_max: "2025-12-31T23:59:59Z",
page_size: 1000,
Expand Down Expand Up @@ -758,7 +758,7 @@ const taskId = "00000000-0000-0000-0000-000000000000";

const runs = await hs.tasks.getTaskRuns(taskId, {
page_size: 50,
order_by: ["-startedAt"],
sortby: ["-startedAt"],
});

const run = await hs.tasks.getTaskRun(
Expand Down Expand Up @@ -906,7 +906,7 @@ const sourceRes = await hs.datastreams.getObservations(
history.sourceDatastream.id,
{
format: "record",
order_by: ["phenomenonTime"],
sortby: ["phenomenonTime"],
phenomenon_time_min: rangeStart,
phenomenon_time_max: rangeEnd,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const row = ({ name, latitude, longitude }: MonitoringSite) => {
const res = await hs.monitoringSites.list({
page: 1,
page_size: 50,
order_by: ["name"],
sortby: ["name"],
is_private: false,
});

Expand Down
6 changes: 3 additions & 3 deletions apps/docs/docs/user-guides/how-to/using-the-python-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ All `list()` methods accept these parameters in addition to any entity-specific
|---|---|---|---|
| `page` | `int` | `1` | Page number to fetch |
| `page_size` | `int` | `100` | Results per page |
| `order_by` | `List[str]` | `[]` | Fields to sort by; prefix with `-` for descending |
| `sortby` | `List[str]` | `[]` | Fields to sort by; prefix with `-` for descending |
| `fetch_all` | `bool` | `False` | If `True`, fetches and merges all pages automatically |

### Model methods
Expand Down Expand Up @@ -423,7 +423,7 @@ datastream.get_observations(
result_qualifier_code=None,
page=1,
page_size=100000,
order_by=None,
sortby=None,
fetch_all=False,
) -> ObservationCollection
```
Expand Down Expand Up @@ -562,7 +562,7 @@ Mappings are a list of dicts with `source_identifier` and `target_datastream_id`
| Method | Returns | Description |
|---|---|---|
| `trigger()` | `TaskRun` | Dispatch an immediate run |
| `list_runs(status=None, started_at_min=None, started_at_max=None, finished_at_min=None, finished_at_max=None, page=1, page_size=100, order_by=None)` | `List[TaskRun]` | Fetch run history |
| `list_runs(status=None, started_at_min=None, started_at_max=None, finished_at_min=None, finished_at_max=None, page=1, page_size=100, sortby=None)` | `List[TaskRun]` | Fetch run history |
| `get_run(run_id)` | `TaskRun` | Fetch a single run by ID |

---
Expand Down
2 changes: 1 addition & 1 deletion apps/qc-app/docs/API_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ qc-utils service layer lives under `packages/qc-utils/src/services/`.
### Observation read

Paged GET against `/data/datastreams/{id}/observations` with
`format=column`, `order_by=phenomenonTime`, `page_size=50000`, and
`format=column`, `sortby=phenomenonTime`, `page_size=50000`, and
`phenomenon_time_min` / `phenomenon_time_max` ISO-8601 bounds. The app
paginates client-side and caches the merged window in
`useObservationStore`.
Expand Down
2 changes: 1 addition & 1 deletion apps/qc-app/src/utils/observations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const fetchObservationsSync = async (
limit: 50_000,
phenomenon_time_min: startTime?.toISOString() ?? phenomenonBeginTime,
phenomenon_time_max: endTime?.toISOString() ?? phenomenonEndTime,
order_by: ['phenomenonTime'],
sortby: ['phenomenonTime'],
format: 'column',
})

Expand Down
Loading
Loading