feat(platform): add managed data product history plane
This commit is contained in:
@@ -172,8 +172,9 @@ async function main() {
|
||||
restoreEnvironment('NDC_DATA_PLANE_BASE_URL', previousDefaultProbe);
|
||||
|
||||
const readProperties = nodes.get('NdcDataProductRead').description.properties.map((property) => property.name);
|
||||
assert.equal(readProperties.includes('cursor'), false, 'snapshot endpoint has no cursor input');
|
||||
assert.equal(readProperties.includes('history'), false, 'history must stay hidden until its endpoint exists');
|
||||
assert.equal(readProperties.includes('mode'), true, 'read mode must expose snapshot/history explicitly');
|
||||
assert.equal(readProperties.includes('cursor'), true, 'history endpoint must expose its opaque continuation cursor');
|
||||
assert.equal(readProperties.includes('sourceIds'), true, 'history filtering remains provider-neutral');
|
||||
const pageSizeProperty = nodes.get('NdcDataProductRead').description.properties.find((property) => property.name === 'pageSize');
|
||||
assert.equal(pageSizeProperty.typeOptions.minValue, 1);
|
||||
assert.equal(pageSizeProperty.typeOptions.maxValue, 5000, 'bounded snapshot v1 must not expose more than 5000 facts');
|
||||
@@ -255,6 +256,51 @@ async function assertNodeHttpContracts(nodes, externalContract, constants) {
|
||||
assert.deepEqual(readCalls[0].options.qs, { limit: 1000 });
|
||||
assert.equal(readResult[0][0].json.sourceId, 'fleet.unit.42');
|
||||
|
||||
const historyCalls = [];
|
||||
const historyResponse = {
|
||||
schemaVersion: 'nodedc.data-product.history/v1',
|
||||
dataProduct: { id: 'fleet.positions.current.v1', version: '1.0.0' },
|
||||
generatedAt: '2026-07-15T12:05:00.000Z',
|
||||
query: {
|
||||
from: '2026-07-15T12:00:00.000Z',
|
||||
to: '2026-07-15T12:05:00.000Z',
|
||||
resolutionMs: 60000,
|
||||
sourceIds: ['fleet.unit.42'],
|
||||
order: 'asc',
|
||||
},
|
||||
facts: [{ ...canonicalFact(), receivedAt: '2026-07-15T12:00:00.100Z', bucketStart: '2026-07-15T12:00:00.000Z' }],
|
||||
nextCursor: 'opaque_cursor',
|
||||
};
|
||||
const historyContext = executionContext({
|
||||
parameters: {
|
||||
mode: 'history',
|
||||
dataProductId: 'fleet.positions.current.v1',
|
||||
from: '2026-07-15T12:00:00.000Z',
|
||||
to: '2026-07-15T12:05:00.000Z',
|
||||
resolutionMs: 60000,
|
||||
sourceIds: 'fleet.unit.42',
|
||||
limit: 1000,
|
||||
cursor: '',
|
||||
},
|
||||
response: historyResponse,
|
||||
calls: historyCalls,
|
||||
});
|
||||
const historyResult = await nodes.get('NdcDataProductRead').execute.call(historyContext);
|
||||
assert.equal(historyCalls[0].credentialName, 'ndcDataProductReaderApi');
|
||||
assert.equal(historyCalls[0].options.method, 'GET');
|
||||
assert.equal(
|
||||
historyCalls[0].options.url,
|
||||
'http://data-plane.test/internal/data-plane/v1/data-products/fleet.positions.current.v1/history',
|
||||
);
|
||||
assert.deepEqual(historyCalls[0].options.qs, {
|
||||
from: '2026-07-15T12:00:00.000Z',
|
||||
to: '2026-07-15T12:05:00.000Z',
|
||||
resolutionMs: 60000,
|
||||
sourceIds: 'fleet.unit.42',
|
||||
limit: 1000,
|
||||
});
|
||||
assert.deepEqual(historyResult[0][0].json, historyResponse);
|
||||
|
||||
const foundryCalls = [];
|
||||
const foundryContext = executionContext({
|
||||
parameters: {
|
||||
|
||||
Reference in New Issue
Block a user