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
5 changes: 5 additions & 0 deletions .changeset/wide-moose-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ankhorage/templates': patch
---

Consume the published Zefix API descriptor in the Acquisition template.
5 changes: 4 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"@ankhorage/capability": "^0.2.3",
"@ankhorage/color-theory": "^0.3.4",
"@ankhorage/contracts": "^26.17.1",
"@ankhorage/data-sources": "^2.4.0",
"@ankhorage/navigator": "^3.6.7",
"@ankhorage/runtime": "^5.6.2",
"@ankhorage/utility": "^1.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
ScreenSpec,
UiNode,
} from '@ankhorage/contracts';
import { createZefixPublicRestApi } from '@ankhorage/data-sources';

/*** Return the one portable, draft-stage Acquisition app manifest. */
export default function createAppManifest(): AppManifest {
Expand Down Expand Up @@ -547,51 +548,7 @@ const manifest = {
},
modules: {},
apis: {
zefix: {
id: 'zefix',
origin: 'external',
protocol: 'rest',
name: 'Zefix PublicREST',
description: 'Swiss official commercial register; vendor responses are not CRM records.',
baseUrl: 'https://www.zefix.admin.ch/ZefixPublicREST',
credential: { id: 'zefix-credentials', kind: 'basic' },
endpoints: {
'company-search': {
id: 'company-search',
kind: 'http',
path: '/api/v1/company/search',
operations: {
'company.search': {
id: 'company.search',
endpointId: 'company-search',
protocol: 'http',
intent: 'read',
method: 'POST',
request: { contentType: 'application/json' },
},
},
},
'company-by-uid': {
id: 'company-by-uid',
kind: 'http',
path: '/api/v1/company/uid/{uid}',
operations: {
'company.by-uid': {
id: 'company.by-uid',
endpointId: 'company-by-uid',
protocol: 'http',
intent: 'read',
method: 'GET',
request: {
parameters: [
{ name: 'uid', location: 'path', required: true, schema: { type: 'string' } },
],
},
},
},
},
},
},
zefix: createZefixPublicRestApi(),
},
},
media: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ derivation:
decision: "Neo4j was explicitly selected for Acquisition graph persistence. The currently published InfraManifest has no graphDatabase capability, so do not serialize an unsupported Neo4j provider in the generated ankh.config.json. Existing graph and relational selections are separate; see ankhorage/infra#197."
- owner: "@ankhorage/data-sources"
path: "createZefixPublicRestApi"
decision: "Published @ankhorage/data-sources 2.3.0 does not export the canonical descriptor. Draft data-sources#318 defines company-uid/company.get-by-uid with path parameter id, which differs from this manifest's company-by-uid/company.by-uid/uid contract. Do not import the PR branch or add an unpublished dependency. After publication, consume the released descriptor and prove infra.apis.zefix equals it."
decision: "Published @ankhorage/data-sources 2.4.0 exports the canonical descriptor. The manifest consumes createZefixPublicRestApi directly, preserving company-uid/company.get-by-uid with path parameter id."
tokens:
light:
source: "manifest acquisition theme; owner compilation required at downstream integration"
Expand Down
33 changes: 5 additions & 28 deletions test/acquisition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { tmpdir } from 'node:os';
import { join } from 'node:path';

import { isAppManifest } from '@ankhorage/contracts';
import { createZefixPublicRestApi } from '@ankhorage/data-sources';
import { createNavigatorPlan } from '@ankhorage/navigator';
import { expect, test } from 'bun:test';

Expand Down Expand Up @@ -38,7 +39,7 @@ test('Acquisition registers one portable draft manifest with its bundled design
expect(JSON.parse(JSON.stringify(manifest))).toEqual(manifest);
});

test('Acquisition configures Minikube with Supabase Vault but no Zefix result persistence or embedded secrets', () => {
test('Acquisition consumes the published Zefix descriptor without Zefix result persistence or embedded secrets', () => {
const manifest = resolveTemplate('business_productivity', 'acquisition').createAppManifest();
const vendor = manifest.infra.apis?.zefix;

Expand All @@ -54,33 +55,7 @@ test('Acquisition configures Minikube with Supabase Vault but no Zefix result pe
expect(manifest.infra.environments.local).not.toHaveProperty('graphDatabase');
expect(manifest.infra.environments.local).not.toHaveProperty('objectStorage');
expect(manifest.infra.environments.local).not.toHaveProperty('auth');
expect(vendor).toMatchObject({
id: 'zefix',
origin: 'external',
protocol: 'rest',
baseUrl: 'https://www.zefix.admin.ch/ZefixPublicREST',
credential: { id: 'zefix-credentials', kind: 'basic' },
endpoints: {
'company-search': {
path: '/api/v1/company/search',
operations: { 'company.search': { intent: 'read', method: 'POST' } },
},
'company-by-uid': {
path: '/api/v1/company/uid/{uid}',
operations: {
'company.by-uid': {
intent: 'read',
method: 'GET',
request: {
parameters: [
{ name: 'uid', location: 'path', required: true, schema: { type: 'string' } },
],
},
},
},
},
},
});
expect(vendor).toEqual(createZefixPublicRestApi());
const serialized = JSON.stringify(manifest);
expect(serialized).not.toContain('ZEFIX_USERNAME');
expect(serialized).not.toContain('ZEFIX_PASSWORD');
Expand Down Expand Up @@ -187,6 +162,8 @@ test('Acquisition declares raw Zefix result-slot rows without mixing them with l
expect(serializedTable).not.toContain('website');
expect(serializedTable).not.toContain('contact');
expect(serializedTable).not.toContain('route');
expect(serializedTable).not.toContain('wire');
expect(JSON.stringify(zefixBinding)).not.toContain('wire');
});

test('Acquisition delegates each responsive pane scroll owner to published MasterDetail', () => {
Expand Down
Loading