Skip to content

Commit 9b108f1

Browse files
perkiclaude
andcommitted
Add datasets:// protocol resolution for datasource endpoints
HDSModel stores service-info assets, HDSDatasourceDef resolves custom protocol endpoints (e.g. datasets://medication) against assets map at runtime. Uses lazy getter to avoid singleton issues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1d51b10 commit 9b108f1

17 files changed

Lines changed: 103 additions & 14 deletions

js/HDSModel/HDSDatasourceDef.d.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1+
type AssetsProvider = () => {
2+
[key: string]: string;
3+
};
14
export declare class HDSDatasourceDef {
25
#private;
3-
constructor(key: string, definitionData: any);
6+
constructor(key: string, definitionData: any, getAssets: AssetsProvider);
47
get key(): string;
58
get data(): any;
69
/** label Localized */
710
get label(): string;
811
/** description Localized */
912
get description(): string;
13+
/**
14+
* Resolved endpoint URL.
15+
* If the raw endpoint starts with `http`, it is used as-is.
16+
* Otherwise it is treated as `<assetKey>://<path>` and resolved
17+
* against the service-info assets map.
18+
* e.g. `datasets://medication` → `assets.datasets` + `medication`
19+
*/
1020
get endpoint(): string;
1121
get queryParam(): string;
1222
get minQueryLength(): number;
@@ -17,4 +27,5 @@ export declare class HDSDatasourceDef {
1727
};
1828
get valueFields(): string[];
1929
}
30+
export {};
2031
//# sourceMappingURL=HDSDatasourceDef.d.ts.map

js/HDSModel/HDSDatasourceDef.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/HDSModel/HDSDatasourceDef.js

Lines changed: 25 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/HDSModel/HDSDatasourceDef.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/HDSModel/HDSModel-Datasources.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/HDSModel/HDSModel-Datasources.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/HDSModel/HDSModel.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ export declare class HDSModel {
1515
* @param modelUrl - JSON definition file URL. Should come from service/info assets.hds-model
1616
*/
1717
constructor(modelUrl: string);
18+
/** Service-info assets used for resolving datasource endpoints */
19+
get assets(): {
20+
[key: string]: string;
21+
};
22+
set assets(value: {
23+
[key: string]: string;
24+
});
1825
get isLoaded(): boolean;
1926
/**
2027
* Load model definitions

js/HDSModel/HDSModel.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/HDSModel/HDSModel.js

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/HDSModel/HDSModel.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)