gdc-common-utils-ts 2.5.6 → 2.5.8

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.
@@ -13,12 +13,12 @@ export declare function isOrganizationRegistrationReviewAction(value: unknown):
13
13
  export declare const OrganizationRegistrationErrors: Readonly<{
14
14
  readonly InvalidReviewAction: "invalid_review_action";
15
15
  readonly ApplicationNotReviewable: "application_not_reviewable";
16
- readonly AuthorizationCredentialRequired: "organization_authorization_credential_required";
16
+ readonly AdmissionCredentialRequired: "organization_test_network_credential_required";
17
17
  readonly ReviewFailed: "review_failed";
18
18
  readonly InvalidOrganization: "invalid_organization";
19
19
  readonly ApplicationFailed: "application_failed";
20
20
  }>;
21
- /** Default and accepted authorization validity window for registration evidence. */
21
+ /** Default and accepted Test Network admission validity window. */
22
22
  export declare const OrganizationRegistrationValidity: Readonly<{
23
23
  readonly DefaultDays: 180;
24
24
  readonly MinimumDays: 1;
@@ -15,12 +15,12 @@ export function isOrganizationRegistrationReviewAction(value) {
15
15
  export const OrganizationRegistrationErrors = Object.freeze({
16
16
  InvalidReviewAction: 'invalid_review_action',
17
17
  ApplicationNotReviewable: 'application_not_reviewable',
18
- AuthorizationCredentialRequired: 'organization_authorization_credential_required',
18
+ AdmissionCredentialRequired: 'organization_test_network_credential_required',
19
19
  ReviewFailed: 'review_failed',
20
20
  InvalidOrganization: 'invalid_organization',
21
21
  ApplicationFailed: 'application_failed',
22
22
  });
23
- /** Default and accepted authorization validity window for registration evidence. */
23
+ /** Default and accepted Test Network admission validity window. */
24
24
  export const OrganizationRegistrationValidity = Object.freeze({
25
25
  DefaultDays: 180,
26
26
  MinimumDays: 1,
@@ -80,8 +80,8 @@ export type LegalOrganizationVerificationTransactionInput = Readonly<{
80
80
  */
81
81
  legalRepresentativePayload?: LegalOrganizationVerificationRepresentativePayload;
82
82
  verification?: LegalOrganizationVerificationRouting;
83
- /** Out-of-band host authorization used only by the Test Network path. */
84
- authorizationCredential?: VerifiableCredentialV2;
83
+ /** Reviewer-issued admission credential used only by the Test Network path. */
84
+ organizationTestNetworkCredential?: VerifiableCredentialV2;
85
85
  /** Three reviewer-issued domain VCs accepted only with Test Network authorization. */
86
86
  testNetworkCredentials?: readonly VerifiableCredentialV2[];
87
87
  attachments?: unknown[];
@@ -105,7 +105,7 @@ export type LegalOrganizationVerificationTransactionEntry = Readonly<{
105
105
  /** @deprecated Legacy ICA wire alias accepted only while migrating old callers. */
106
106
  legalRepresentative?: LegalOrganizationVerificationRepresentativePayload;
107
107
  verification?: LegalOrganizationVerificationRouting;
108
- authorizationCredential?: VerifiableCredentialV2;
108
+ organizationTestNetworkCredential?: VerifiableCredentialV2;
109
109
  testNetworkCredentials?: readonly VerifiableCredentialV2[];
110
110
  [key: string]: unknown;
111
111
  };
@@ -61,8 +61,8 @@ export function buildLegalOrganizationVerificationTransactionBundle(input) {
61
61
  verification: {
62
62
  resourceType: normalizeText(input.verification?.resourceType) || 'contract',
63
63
  },
64
- ...(input.authorizationCredential
65
- ? { authorizationCredential: input.authorizationCredential }
64
+ ...(input.organizationTestNetworkCredential
65
+ ? { organizationTestNetworkCredential: input.organizationTestNetworkCredential }
66
66
  : {}),
67
67
  ...(input.testNetworkCredentials?.length
68
68
  ? { testNetworkCredentials: input.testNetworkCredentials }
@@ -1,5 +1,5 @@
1
1
  import type { VerifiableCredentialV2 } from '../models/verifiable-credential';
2
- /** Lifecycle of the one Test Network activation licence delivered to the legal postal address. */
2
+ /** Lifecycle for a separate postal-address verification credential. */
3
3
  export declare const PostalActivationLicenseStatuses: Readonly<{
4
4
  readonly Issued: "issued";
5
5
  readonly Delivered: "delivered";
@@ -48,13 +48,18 @@ export type OrganizationTestNetworkCredentialInput = Readonly<{
48
48
  applicationId: string;
49
49
  accessPath: 'partner' | 'test-network';
50
50
  targetNetwork: 'test-network' | 'network';
51
- postalLicense: PostalActivationLicenseBinding;
51
+ /**
52
+ * @deprecated Postal-address verification is a separate production-readiness
53
+ * flow. This compatibility input is ignored and is never embedded in a Test
54
+ * Network authorization credential.
55
+ */
56
+ postalLicense?: PostalActivationLicenseBinding;
52
57
  proof?: VerifiableCredentialV2['proof'];
53
58
  }>;
54
59
  /**
55
60
  * Builds the immutable VC that a controller receives out-of-band and attaches
56
- * to `Organization/_transaction`. The postal code itself never appears in the
57
- * credential; its confirmed, purpose-bound licence record is referenced.
61
+ * to `Organization/_transaction`. Postal-address verification is deliberately
62
+ * outside this credential and may be completed independently before production.
58
63
  */
59
64
  export declare function buildOrganizationTestNetworkCredential(input: OrganizationTestNetworkCredentialInput): VerifiableCredentialV2;
60
65
  /**
@@ -1,5 +1,5 @@
1
1
  import { ContractCredentialTypes, W3cCredentialContexts, W3cCredentialTypes, } from '../constants/verifiable-credentials.js';
2
- /** Lifecycle of the one Test Network activation licence delivered to the legal postal address. */
2
+ /** Lifecycle for a separate postal-address verification credential. */
3
3
  export const PostalActivationLicenseStatuses = Object.freeze({
4
4
  Issued: 'issued',
5
5
  Delivered: 'delivered',
@@ -15,23 +15,13 @@ function required(value, name) {
15
15
  }
16
16
  /**
17
17
  * Builds the immutable VC that a controller receives out-of-band and attaches
18
- * to `Organization/_transaction`. The postal code itself never appears in the
19
- * credential; its confirmed, purpose-bound licence record is referenced.
18
+ * to `Organization/_transaction`. Postal-address verification is deliberately
19
+ * outside this credential and may be completed independently before production.
20
20
  */
21
21
  export function buildOrganizationTestNetworkCredential(input) {
22
22
  const applicationId = required(input.applicationId, 'applicationId');
23
23
  const organizationIdentifier = required(input.organizationIdentifier, 'organizationIdentifier');
24
24
  const controllerEmail = required(input.controllerEmail, 'controllerEmail').toLowerCase();
25
- if (input.postalLicense.status !== PostalActivationLicenseStatuses.Delivered) {
26
- throw new Error('Organization registration authorization requires a delivered postal activation licence.');
27
- }
28
- if (input.postalLicense.applicationId !== applicationId
29
- || input.postalLicense.organizationIdentifier !== organizationIdentifier
30
- || input.postalLicense.controllerEmail.trim().toLowerCase() !== controllerEmail
31
- || input.postalLicense.controllerKeyMaterial !== input.controllerKeyMaterial
32
- || input.postalLicense.network !== input.targetNetwork) {
33
- throw new Error('Postal activation licence does not match the organization registration application.');
34
- }
35
25
  return {
36
26
  '@context': [W3cCredentialContexts.V2, 'https://schema.org'],
37
27
  id: required(input.credentialId, 'credentialId'),
@@ -53,17 +43,6 @@ export function buildOrganizationTestNetworkCredential(input) {
53
43
  email: controllerEmail,
54
44
  hasCredential: { material: required(input.controllerKeyMaterial, 'controllerKeyMaterial') },
55
45
  },
56
- postalActivationLicense: {
57
- id: required(input.postalLicense.licenseId, 'postalLicense.licenseId'),
58
- status: input.postalLicense.status,
59
- postalAddressHash: required(input.postalLicense.postalAddressHash, 'postalLicense.postalAddressHash'),
60
- deliveredAt: required(input.postalLicense.deliveredAt, 'postalLicense.deliveredAt'),
61
- protectedCode: {
62
- algorithm: input.postalLicense.protectedCode.algorithm,
63
- salt: required(input.postalLicense.protectedCode.salt, 'postalLicense.protectedCode.salt'),
64
- digest: required(input.postalLicense.protectedCode.digest, 'postalLicense.protectedCode.digest'),
65
- },
66
- },
67
46
  },
68
47
  validFrom: required(input.validFrom, 'validFrom'),
69
48
  validUntil: required(input.validUntil, 'validUntil'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.5.6",
3
+ "version": "2.5.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },