gdc-sdk-node-ts 2.3.16 → 2.3.18
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.
|
@@ -12,7 +12,7 @@ import { activateEmployeeDeviceWithActivationCodeWithDeps, activateEmployeeDevic
|
|
|
12
12
|
import { extractOfferIdFromResponseBody, extractOfferPreviewFromResponseBody, } from './order-offer-summary.js';
|
|
13
13
|
import { confirmOrganizationLicenseOrderWithDeps } from './organization-license-order.js';
|
|
14
14
|
import { startIndividualOrganizationWithDeps } from './individual-start.js';
|
|
15
|
-
import { createOrganizationEmployeeWithDeps, disableIndividualMemberWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, listIndividualLicenseOffersWithDeps, listIndividualLicenseOrdersWithDeps, listIndividualLicensesWithDeps, addFreeIndividualMemberLicensesWithDeps, issueIndividualMemberLicenseWithDeps, transitionIndividualMemberLicenseWithDeps, listOrganizationLicenseOffersWithDeps, listOrganizationLicenseOrdersWithDeps, listOrganizationLicensesWithDeps, grantProfessionalAccessWithDeps, buildClinicalSectionUpdateIngestion, buildClinicalSummaryUpdateIngestion, ingestCommunicationAndUpdateIndexWithDeps, buildVitalSignBatchCommunicationFromSearchResponse, registerBlockchainArtifactAndUpdateIndexWithDeps, requestClinicalSummaryWithDeps, revokeProfessionalAccessWithDeps, searchCommunicationParticipantsWithDeps, purgeIndividualMemberWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, searchIndividualLicensesWithDeps, searchIndividualLicenseOffersWithDeps, searchIndividualLicenseOrdersWithDeps, searchOrganizationLicensesWithDeps, searchOrganizationLicenseOffersWithDeps, searchOrganizationLicenseOrdersWithDeps, searchOrganizationEmployeesWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, normalizeCommunicationPathFormatSegment, } from './resource-operations.js';
|
|
15
|
+
import { createOrganizationEmployeeWithDeps, disableIndividualMemberWithDeps, disableIndividualOrganizationWithDeps, disableOrganizationEmployeeWithDeps, listIndividualLicenseOffersWithDeps, listIndividualLicenseOrdersWithDeps, listIndividualLicensesWithDeps, addFreeIndividualMemberLicensesWithDeps, issueIndividualMemberLicenseWithDeps, transitionIndividualMemberLicenseWithDeps, listOrganizationLicenseOffersWithDeps, listOrganizationLicenseOrdersWithDeps, listOrganizationLicensesWithDeps, grantProfessionalAccessWithDeps, buildClinicalSectionUpdateIngestion, buildClinicalSummaryUpdateIngestion, ingestCommunicationAndUpdateIndexWithDeps, buildVitalSignBatchCommunicationFromSearchResponse, registerBlockchainArtifactAndUpdateIndexWithDeps, requestClinicalSummaryWithDeps, revokeProfessionalAccessWithDeps, searchCommunicationParticipantsWithDeps, purgeIndividualMemberWithDeps, purgeIndividualOrganizationWithDeps, purgeOrganizationEmployeeWithDeps, prepareEmployeeLifecycleMessageForTransport, searchIndividualLicensesWithDeps, searchIndividualLicenseOffersWithDeps, searchIndividualLicenseOrdersWithDeps, searchOrganizationLicensesWithDeps, searchOrganizationLicenseOffersWithDeps, searchOrganizationLicenseOrdersWithDeps, searchOrganizationEmployeesWithDeps, searchClinicalBundleWithDeps, searchLatestIpsWithDeps, upsertRelatedPersonAndPollWithDeps, normalizeCommunicationPathFormatSegment, } from './resource-operations.js';
|
|
16
16
|
import { submitAndPollWithMethods } from './orchestration/client-port.js';
|
|
17
17
|
import { buildRuntimeHeaders, fetchWithTimeout, parseResponseBody, pollBatchResponseWithRuntimeConfig, postJsonWithRuntimeConfig, postRenderedWithRuntimeConfig, } from './runtime-transport.js';
|
|
18
18
|
import { activateOrganizationInGatewayFromIcaProofWithDeps, submitLegalOrganizationIssueWithDeps, submitLegalOrganizationVerificationTransactionWithDeps, submitOrganizationDidBindingWithDeps, } from './runtime-host-submission.js';
|
|
@@ -328,7 +328,7 @@ export class HttpRuntimeClient {
|
|
|
328
328
|
return createOrganizationEmployeeWithDeps(ctx, input, pollOptions, {
|
|
329
329
|
employeeBatchPath: this.paths.employeeBatchPath.bind(this.paths),
|
|
330
330
|
employeePollPath: this.paths.employeePollPath.bind(this.paths),
|
|
331
|
-
submitAndPoll: this.
|
|
331
|
+
submitAndPoll: (submitPath, pollPath, payload, options) => this.submitClinicalMessageAndPoll(submitPath, pollPath, prepareEmployeeLifecycleMessageForTransport(payload, this.transportProfile), this.transportProfile, options),
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
@@ -2,7 +2,7 @@ import type { DeviceAppType } from 'gdc-common-utils-ts/constants/device';
|
|
|
2
2
|
import { type ClinicalSectionUpdateCommunicationInput, type ClinicalUpdateCommunicationInput, type ClinicalSummaryReadResult, type ClinicalSummaryRequestInput } from 'gdc-sdk-core-ts';
|
|
3
3
|
import type { LicenseOfferSearchState, LicenseOrderSearchState } from 'gdc-common-utils-ts/utils/license-commercial-search';
|
|
4
4
|
import type { LicenseListSearchState } from 'gdc-common-utils-ts/utils/license-list-search';
|
|
5
|
-
import type { BundleSearchQuery, CommMsgExtendedCommunicationOutboxJob, CommunicationOutboxJob, CommunicationInput, DateRange, EmployeeSearchValue, IndividualOrganizationLifecycleInput, TransportProfile } from 'gdc-sdk-core-ts';
|
|
5
|
+
import type { BundleSearchQuery, CommMsgExtendedCommunicationOutboxJob, CommunicationOutboxJob, CommunicationInput, DateRange, EmployeeSearchValue, IndividualOrganizationLifecycleInput, TransportProfile, SubmitPayload } from 'gdc-sdk-core-ts';
|
|
6
6
|
import type { BundleEntry, BundleJsonApi } from 'gdc-common-utils-ts/models/bundle';
|
|
7
7
|
import type { SubmitAndPollResult } from './orchestration/client-port.js';
|
|
8
8
|
import type { RouteContext } from './individual-onboarding.js';
|
|
@@ -790,3 +790,12 @@ export declare function generateDigitalTwinFromSubjectDataWithDeps(routeCtx: Rou
|
|
|
790
790
|
}) => Promise<SubmitAndPollResult>;
|
|
791
791
|
}): Promise<SubmitAndPollResult>;
|
|
792
792
|
export declare function normalizeCommunicationPathFormatSegment(raw?: string): string;
|
|
793
|
+
/**
|
|
794
|
+
* Selects only the outer employee wire representation.
|
|
795
|
+
*
|
|
796
|
+
* The BundleEditor-authored entries remain identical across transports:
|
|
797
|
+
* JSON-API `data[]` stays inside DIDComm, while the legacy FHIR profile maps
|
|
798
|
+
* those entries to standard `Bundle.entry[]`. Authorization and encryption
|
|
799
|
+
* remain runtime concerns rather than browser-authored payload fields.
|
|
800
|
+
*/
|
|
801
|
+
export declare function prepareEmployeeLifecycleMessageForTransport(message: SubmitPayload, profile: TransportProfile): SubmitPayload;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { HealthcareBasicSections, ResourceTypesFhirR4 } from 'gdc-common-utils-ts/constants';
|
|
3
3
|
import { Format } from 'gdc-common-utils-ts/constants/Schemas';
|
|
4
4
|
import { RelatedPersonClaim } from 'gdc-common-utils-ts/models/interoperable-claims/related-person-claims';
|
|
5
|
-
import { buildCommunicationParticipantSearchBundle, buildBlockchainArtifactDocumentReference, BundleQuery, createInteroperableResourceOperationEditor, IndividualOrganizationLifecycleEditor, LicenseOfferSearchEditor, LicenseOrderSearchEditor, InteroperableLifecycleStatuses, LicenseListSearchEditor, buildLicenseIssueEntry, buildLicensePurchaseEntry, } from 'gdc-common-utils-ts';
|
|
6
|
-
import {
|
|
5
|
+
import { BundleEditor, buildCommunicationParticipantSearchBundle, buildBlockchainArtifactDocumentReference, BundleQuery, createInteroperableResourceOperationEditor, IndividualOrganizationLifecycleEditor, LicenseOfferSearchEditor, LicenseOrderSearchEditor, InteroperableLifecycleStatuses, LicenseListSearchEditor, buildLicenseIssueEntry, buildLicensePurchaseEntry, } from 'gdc-common-utils-ts';
|
|
6
|
+
import { EmployeeBundleOperations, EmployeeResourceTypes, } from 'gdc-common-utils-ts/utils/employee';
|
|
7
|
+
import { addFhirResourceToCommunication, createCommunicationResource, buildClinicalSummaryCommunicationJob, createClinicalSectionUpdateOutboxJob, createClinicalSummaryUpdateOutboxJob, readClinicalSummaryOperationResult, TransportProfiles, } from 'gdc-sdk-core-ts';
|
|
7
8
|
import { GwCoreLifecycleRequestMethod, GwCoreLifecycleRequestType, GwCoreLifecycleTodo, } from './constants/lifecycle.js';
|
|
8
|
-
import {
|
|
9
|
+
import { buildEmployeeSearchBundle, ConsentClaims, } from 'gdc-sdk-core-ts';
|
|
9
10
|
export function buildClinicalSectionUpdateIngestion(input) {
|
|
10
11
|
return {
|
|
11
12
|
communicationJob: createClinicalSectionUpdateOutboxJob(input),
|
|
@@ -721,6 +722,19 @@ function createRuntimeUuid() {
|
|
|
721
722
|
}
|
|
722
723
|
function buildEmployeeLifecyclePayload(input) {
|
|
723
724
|
const claims = input.employeeClaims || {};
|
|
725
|
+
const editor = new BundleEditor()
|
|
726
|
+
.setBundleOperation(EmployeeBundleOperations.create)
|
|
727
|
+
.setAllowedResourceType(EmployeeResourceTypes.employee);
|
|
728
|
+
const employee = editor.newEntry(input.resourceId).asEmployee();
|
|
729
|
+
for (const [claim, value] of Object.entries(claims)) {
|
|
730
|
+
employee.setClaim(claim, value);
|
|
731
|
+
}
|
|
732
|
+
const authored = employee.doneEntry().buildJsonApi();
|
|
733
|
+
const data = authored.data.map((entry) => ({
|
|
734
|
+
...entry,
|
|
735
|
+
type: input.requestType,
|
|
736
|
+
request: { method: input.requestMethod },
|
|
737
|
+
}));
|
|
724
738
|
return {
|
|
725
739
|
jti: `jti-${createRuntimeUuid()}`,
|
|
726
740
|
iss: input.routeCtx.tenantId,
|
|
@@ -728,14 +742,31 @@ function buildEmployeeLifecyclePayload(input) {
|
|
|
728
742
|
type: 'application/didcomm-plain+json',
|
|
729
743
|
thid: `${input.thidPrefix}-${createRuntimeUuid()}`,
|
|
730
744
|
body: {
|
|
731
|
-
data
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
745
|
+
data,
|
|
746
|
+
},
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Selects only the outer employee wire representation.
|
|
751
|
+
*
|
|
752
|
+
* The BundleEditor-authored entries remain identical across transports:
|
|
753
|
+
* JSON-API `data[]` stays inside DIDComm, while the legacy FHIR profile maps
|
|
754
|
+
* those entries to standard `Bundle.entry[]`. Authorization and encryption
|
|
755
|
+
* remain runtime concerns rather than browser-authored payload fields.
|
|
756
|
+
*/
|
|
757
|
+
export function prepareEmployeeLifecycleMessageForTransport(message, profile) {
|
|
758
|
+
if (profile !== TransportProfiles.FhirJson)
|
|
759
|
+
return message;
|
|
760
|
+
const envelopeBody = message.body;
|
|
761
|
+
if (!Array.isArray(envelopeBody?.data)) {
|
|
762
|
+
throw new Error('Employee FHIR transport requires Bundle data entries.');
|
|
763
|
+
}
|
|
764
|
+
return {
|
|
765
|
+
...message,
|
|
766
|
+
body: {
|
|
767
|
+
resourceType: ResourceTypesFhirR4.Bundle,
|
|
768
|
+
type: 'batch',
|
|
769
|
+
entry: envelopeBody.data,
|
|
739
770
|
},
|
|
740
771
|
};
|
|
741
772
|
}
|
package/dist/smart-token.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export type SmartTokenRequestInput = SmartTokenRequestContract & {
|
|
|
63
63
|
presentationSubmission?: Record<string, unknown>;
|
|
64
64
|
purpose?: string;
|
|
65
65
|
requestBodyClaims?: Record<string, unknown>;
|
|
66
|
+
/** Compatibility bridge until every installed gdc-sdk-core-ts carries this field. */
|
|
67
|
+
vpTokenFallback?: 'id-token' | 'omit';
|
|
66
68
|
smartTokenKind?: 'token-exchange' | 'openid-smart';
|
|
67
69
|
tokenCacheKey?: string;
|
|
68
70
|
endpointId?: string;
|
package/dist/smart-token.js
CHANGED
|
@@ -60,7 +60,12 @@ export async function requestSmartTokenWithDeps(deps) {
|
|
|
60
60
|
code_challenge: deps.input.codeChallenge || 'demo-code-challenge',
|
|
61
61
|
code_challenge_method: deps.input.codeChallengeMethod || 'S256',
|
|
62
62
|
acr_values: deps.input.acrValues || 'urn:antifraud:acr:openid4vp:employee',
|
|
63
|
-
|
|
63
|
+
id_token: deps.input.idToken,
|
|
64
|
+
...(deps.input.vpToken
|
|
65
|
+
? { vp_token: deps.input.vpToken }
|
|
66
|
+
: deps.input.vpTokenFallback === 'omit'
|
|
67
|
+
? {}
|
|
68
|
+
: { vp_token: deps.input.idToken }),
|
|
64
69
|
presentation_submission: deps.input.presentationSubmission,
|
|
65
70
|
expires_in: 300,
|
|
66
71
|
token_type: 'Bearer',
|
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.18",
|
|
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.",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"gdc-common-utils-ts": "^2.3.18",
|
|
41
|
-
"gdc-sdk-core-ts": "~2.3.
|
|
41
|
+
"gdc-sdk-core-ts": "~2.3.14"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^20.14.10",
|