chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase
This commit is contained in:
parent
970e08c466
commit
1f7e365a4e
237 changed files with 1951 additions and 49413 deletions
|
|
@ -14,7 +14,12 @@ import {
|
|||
IntegrationBase,
|
||||
HTTPIntegration
|
||||
} from '../core/IntegrationBase.js'
|
||||
import { IntegrationConfig, ODataQueryOptions } from '../core/types.js'
|
||||
import {
|
||||
IntegrationConfig,
|
||||
ODataQueryOptions,
|
||||
RelationTabularRow,
|
||||
TabularRow
|
||||
} from '../core/types.js'
|
||||
import { Entity, Relation, FindParams } from '../../types/brainy.types.js'
|
||||
import { NounType } from '../../types/graphTypes.js'
|
||||
import {
|
||||
|
|
@ -387,12 +392,13 @@ export class ODataIntegration extends IntegrationBase implements HTTPIntegration
|
|||
entities = entities.slice(0, pageSize)
|
||||
}
|
||||
|
||||
// Convert to tabular format
|
||||
let rows = this.exporter.entitiesToRows(entities)
|
||||
// Convert to tabular format. $select projects rows down to a subset of
|
||||
// columns, so the working type is Partial<TabularRow> from the start.
|
||||
let rows: Array<Partial<TabularRow>> = this.exporter.entitiesToRows(entities)
|
||||
|
||||
// Apply $select
|
||||
if (options.select && options.select.length > 0) {
|
||||
rows = applySelect(rows, options.select) as any
|
||||
rows = applySelect(rows, options.select)
|
||||
}
|
||||
|
||||
// Apply $orderby (if not handled by storage)
|
||||
|
|
@ -528,7 +534,7 @@ export class ODataIntegration extends IntegrationBase implements HTTPIntegration
|
|||
return this.errorResponse(400, 'Invalid entity ID')
|
||||
}
|
||||
|
||||
await this.context.brain.delete(idMatch[1])
|
||||
await this.context.brain.remove(idMatch[1])
|
||||
|
||||
return {
|
||||
status: 204,
|
||||
|
|
@ -566,16 +572,18 @@ export class ODataIntegration extends IntegrationBase implements HTTPIntegration
|
|||
offset: options.skip
|
||||
})
|
||||
|
||||
let rows = this.exporter.relationsToRows(relations)
|
||||
// $select projects rows down to a subset of columns, so the working type
|
||||
// is Partial<RelationTabularRow> from the start.
|
||||
let rows: Array<Partial<RelationTabularRow>> = this.exporter.relationsToRows(relations)
|
||||
|
||||
// Apply $filter
|
||||
if (options.filter) {
|
||||
rows = applyFilter(rows, options.filter) as any
|
||||
rows = applyFilter(rows, options.filter)
|
||||
}
|
||||
|
||||
// Apply $select
|
||||
if (options.select && options.select.length > 0) {
|
||||
rows = applySelect(rows, options.select) as any
|
||||
rows = applySelect(rows, options.select)
|
||||
}
|
||||
|
||||
// Apply $orderby
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue