gdc-sdk-node-ts 2.3.12 → 2.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/local-terminology-bff.d.ts +17 -0
- package/dist/local-terminology-bff.js +16 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -572,6 +572,29 @@ Reusable payload examples:
|
|
|
572
572
|
- [gdc-common-utils-ts/src/examples/lifecycle.ts](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/src/examples/lifecycle.ts)
|
|
573
573
|
- [gdc-common-utils-ts/src/examples/api-flow-examples.ts](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/src/examples/api-flow-examples.ts)
|
|
574
574
|
|
|
575
|
+
## Local terminology route for Next.js
|
|
576
|
+
|
|
577
|
+
`LocalTerminologyBffService` keeps complete JSON catalogs in the application
|
|
578
|
+
BFF and returns only matching options:
|
|
579
|
+
|
|
580
|
+
```ts
|
|
581
|
+
const terminology = new LocalTerminologyBffService(catalogs);
|
|
582
|
+
|
|
583
|
+
export async function GET(request: Request) {
|
|
584
|
+
const url = new URL(request.url);
|
|
585
|
+
return Response.json(terminology.search({
|
|
586
|
+
text: url.searchParams.get('text') || '',
|
|
587
|
+
language: url.searchParams.get('language') || 'en',
|
|
588
|
+
jurisdiction: url.searchParams.get('jurisdiction') || undefined,
|
|
589
|
+
systems: url.searchParams.getAll('system'),
|
|
590
|
+
limit: 20,
|
|
591
|
+
}));
|
|
592
|
+
}
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
The application validates which systems are allowed for the specific coded
|
|
596
|
+
form field. This MVP service performs no external terminology request.
|
|
597
|
+
|
|
575
598
|
## API Index
|
|
576
599
|
|
|
577
600
|
## Full Public Surface
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type TerminologyCatalogDocument, type TerminologySearchInput, type TerminologySearchResult } from 'gdc-sdk-core-ts';
|
|
2
|
+
/** Small primary document returned by an application-owned terminology route. */
|
|
3
|
+
export type TerminologySearchPrimaryDocument = Readonly<{
|
|
4
|
+
data: readonly TerminologySearchResult[];
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Framework-neutral local terminology service for Node/BFF applications.
|
|
8
|
+
*
|
|
9
|
+
* A Next.js route validates its query, calls `search(...)`, and returns the
|
|
10
|
+
* resulting primary document. Complete catalogs remain server-side.
|
|
11
|
+
*/
|
|
12
|
+
export declare class LocalTerminologyBffService {
|
|
13
|
+
private readonly provider;
|
|
14
|
+
constructor(catalogs: readonly TerminologyCatalogDocument[]);
|
|
15
|
+
/** Searches the configured local fallback catalogs. */
|
|
16
|
+
search(input: TerminologySearchInput): TerminologySearchPrimaryDocument;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LocalTerminologyProvider, } from 'gdc-sdk-core-ts';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-neutral local terminology service for Node/BFF applications.
|
|
4
|
+
*
|
|
5
|
+
* A Next.js route validates its query, calls `search(...)`, and returns the
|
|
6
|
+
* resulting primary document. Complete catalogs remain server-side.
|
|
7
|
+
*/
|
|
8
|
+
export class LocalTerminologyBffService {
|
|
9
|
+
constructor(catalogs) {
|
|
10
|
+
this.provider = new LocalTerminologyProvider(catalogs);
|
|
11
|
+
}
|
|
12
|
+
/** Searches the configured local fallback catalogs. */
|
|
13
|
+
search(input) {
|
|
14
|
+
return { data: this.provider.search(input) };
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdc-sdk-node-ts",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.13",
|
|
4
4
|
"description": "Next-generation Node runtime package for the GDC SDK family",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Antifraud Services Inc.",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"test:e2e:live-gw:clean": "bash ./scripts/run-live-gw-clean.sh"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"gdc-common-utils-ts": "^2.3.
|
|
41
|
-
"gdc-sdk-core-ts": "~2.3.
|
|
40
|
+
"gdc-common-utils-ts": "^2.3.18",
|
|
41
|
+
"gdc-sdk-core-ts": "~2.3.13"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^20.14.10",
|