gdc-sdk-node-ts 2.4.3 → 2.4.4

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/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export * from './family-organization-registration.js';
17
17
  export * from './individual-onboarding.js';
18
18
  export * from './device-activation.js';
19
19
  export * from './organization-controller-recovery.js';
20
- export * from './organization-registration-authorization.js';
20
+ export * from './organization-test-network-credential.js';
21
21
  export * from './organization-employee-lifecycle.js';
22
22
  export * from './smart-token.js';
23
23
  export * from './fhir-r5-subscription-runtime.js';
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ export * from './family-organization-registration.js';
18
18
  export * from './individual-onboarding.js';
19
19
  export * from './device-activation.js';
20
20
  export * from './organization-controller-recovery.js';
21
- export * from './organization-registration-authorization.js';
21
+ export * from './organization-test-network-credential.js';
22
22
  export * from './organization-employee-lifecycle.js';
23
23
  export * from './smart-token.js';
24
24
  export * from './fhir-r5-subscription-runtime.js';
@@ -1,7 +1,7 @@
1
1
  import type { VerifiableCredentialV2 } from 'gdc-common-utils-ts/models/verifiable-credential';
2
2
  import type { IWallet, WalletExecutionContext, WalletKeySelection } from 'gdc-sdk-core-ts';
3
3
  /** Input required to add one human-authorizer proof to the out-of-band VC. */
4
- export type SignOrganizationRegistrationAuthorizationInput = Readonly<{
4
+ export type SignOrganizationTestNetworkCredentialInput = Readonly<{
5
5
  credential: VerifiableCredentialV2;
6
6
  wallet: IWallet;
7
7
  context: WalletExecutionContext;
@@ -13,4 +13,9 @@ export type SignOrganizationRegistrationAuthorizationInput = Readonly<{
13
13
  * Adds one detached JWS proof made by the already-unlocked professional
14
14
  * profile. The browser never receives the private key or clear wallet seed.
15
15
  */
16
- export declare function signOrganizationRegistrationAuthorizationCredential(input: SignOrganizationRegistrationAuthorizationInput): Promise<VerifiableCredentialV2>;
16
+ export declare function signOrganizationTestNetworkCredential(input: SignOrganizationTestNetworkCredentialInput): Promise<VerifiableCredentialV2>;
17
+ /**
18
+ * Adds the unlocked reviewer's ML-DSA-65 assertion proof to one of the three
19
+ * normal domain credentials restricted to Test Network.
20
+ */
21
+ export declare function signTestNetworkOrganizationCredential(input: SignOrganizationTestNetworkCredentialInput): Promise<VerifiableCredentialV2>;
@@ -0,0 +1,62 @@
1
+ import { canonicalizeOrganizationTestNetworkCredential, } from 'gdc-common-utils-ts/utils/organization-test-network-credential';
2
+ import { canonicalizeTestNetworkOrganizationCredential, } from 'gdc-common-utils-ts/utils/test-network-organization-credentials';
3
+ /**
4
+ * Adds one detached JWS proof made by the already-unlocked professional
5
+ * profile. The browser never receives the private key or clear wallet seed.
6
+ */
7
+ export async function signOrganizationTestNetworkCredential(input) {
8
+ if (!input.wallet.signDetachedJws) {
9
+ throw new Error('Wallet does not support detached organization authorization proofs.');
10
+ }
11
+ const verificationMethod = String(input.verificationMethod || '').trim();
12
+ if (!verificationMethod)
13
+ throw new Error('Organization authorization proof requires verificationMethod.');
14
+ const payload = canonicalizeOrganizationTestNetworkCredential(input.credential);
15
+ const jws = await input.wallet.signDetachedJws(input.context, {
16
+ payload,
17
+ header: { typ: 'application/vc+ld+json' },
18
+ key: input.key,
19
+ });
20
+ const existingProofs = Array.isArray(input.credential.proof)
21
+ ? input.credential.proof
22
+ : input.credential.proof
23
+ ? [input.credential.proof]
24
+ : [];
25
+ return {
26
+ ...input.credential,
27
+ proof: [...existingProofs, {
28
+ type: 'JsonWebSignature2020',
29
+ created: input.createdAt || new Date().toISOString(),
30
+ proofPurpose: 'contractAgreement',
31
+ verificationMethod,
32
+ jws,
33
+ }],
34
+ };
35
+ }
36
+ /**
37
+ * Adds the unlocked reviewer's ML-DSA-65 assertion proof to one of the three
38
+ * normal domain credentials restricted to Test Network.
39
+ */
40
+ export async function signTestNetworkOrganizationCredential(input) {
41
+ if (!input.wallet.signDetachedJws) {
42
+ throw new Error('Wallet does not support detached Test Network credential proofs.');
43
+ }
44
+ const verificationMethod = String(input.verificationMethod || '').trim();
45
+ if (!verificationMethod)
46
+ throw new Error('Test Network credential proof requires verificationMethod.');
47
+ const jws = await input.wallet.signDetachedJws(input.context, {
48
+ payload: canonicalizeTestNetworkOrganizationCredential(input.credential),
49
+ header: { typ: 'application/vc+ld+json' },
50
+ key: input.key,
51
+ });
52
+ return {
53
+ ...input.credential,
54
+ proof: [{
55
+ type: 'JsonWebSignature2020',
56
+ created: input.createdAt || new Date().toISOString(),
57
+ proofPurpose: 'assertionMethod',
58
+ verificationMethod,
59
+ jws,
60
+ }],
61
+ };
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
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,7 +37,7 @@
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.5.4",
40
+ "gdc-common-utils-ts": "2.5.6",
41
41
  "gdc-sdk-core-ts": "~2.3.18"
42
42
  },
43
43
  "devDependencies": {
@@ -1,34 +0,0 @@
1
- import { canonicalizeOrganizationRegistrationAuthorizationCredential, } from 'gdc-common-utils-ts/utils/organization-registration-authorization';
2
- /**
3
- * Adds one detached JWS proof made by the already-unlocked professional
4
- * profile. The browser never receives the private key or clear wallet seed.
5
- */
6
- export async function signOrganizationRegistrationAuthorizationCredential(input) {
7
- if (!input.wallet.signDetachedJws) {
8
- throw new Error('Wallet does not support detached organization authorization proofs.');
9
- }
10
- const verificationMethod = String(input.verificationMethod || '').trim();
11
- if (!verificationMethod)
12
- throw new Error('Organization authorization proof requires verificationMethod.');
13
- const payload = canonicalizeOrganizationRegistrationAuthorizationCredential(input.credential);
14
- const jws = await input.wallet.signDetachedJws(input.context, {
15
- payload,
16
- header: { typ: 'application/vc+ld+json' },
17
- key: input.key,
18
- });
19
- const existingProofs = Array.isArray(input.credential.proof)
20
- ? input.credential.proof
21
- : input.credential.proof
22
- ? [input.credential.proof]
23
- : [];
24
- return {
25
- ...input.credential,
26
- proof: [...existingProofs, {
27
- type: 'JsonWebSignature2020',
28
- created: input.createdAt || new Date().toISOString(),
29
- proofPurpose: 'contractAgreement',
30
- verificationMethod,
31
- jws,
32
- }],
33
- };
34
- }