gdc-common-utils-ts 2.5.16 → 2.5.17

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.
@@ -1 +1,2 @@
1
+ export declare const EXAMPLE_LEGAL_ORGANIZATION_SERVICE_TYPE: string;
1
2
  export declare const EXAMPLE_LEGAL_ORGANIZATION_VERIFICATION_TRANSACTION_BUNDLE: import("..").BundleJsonApi<import("..").ErrorEntry | import("..").BundleEntry>;
@@ -30,6 +30,15 @@ const exampleControllerBinding = {
30
30
  }
31
31
  : {}),
32
32
  };
33
+ /** Canonical capabilities reused by organization-onboarding editor tests. */
34
+ const exampleLegalOrganizationServiceType = serializeServiceCapabilityTokens([
35
+ ServiceCapability.IndexProvider,
36
+ ServiceCapability.DigitalTwinReader,
37
+ ]);
38
+ if (!exampleLegalOrganizationServiceType) {
39
+ throw new Error('Canonical legal-organization example capabilities must not be empty.');
40
+ }
41
+ export const EXAMPLE_LEGAL_ORGANIZATION_SERVICE_TYPE = exampleLegalOrganizationServiceType;
33
42
  export const EXAMPLE_LEGAL_ORGANIZATION_VERIFICATION_TRANSACTION_BUNDLE = buildLegalOrganizationVerificationTransactionBundle({
34
43
  claims: {
35
44
  '@context': 'org.schema',
@@ -42,10 +51,7 @@ export const EXAMPLE_LEGAL_ORGANIZATION_VERIFICATION_TRANSACTION_BUNDLE = buildL
42
51
  [ClaimsServiceSchemaorg.category]: EXAMPLE_SECTOR,
43
52
  [ClaimsServiceSchemaorg.identifier]: EXAMPLE_TENANT_SERVICE_DID,
44
53
  [ClaimsServiceSchemaorg.url]: `https://operator.example.net/acme/cds-${String(EXAMPLE_JURISDICTION).toLowerCase()}/v1/${EXAMPLE_SECTOR}`,
45
- [ClaimsServiceSchemaorg.serviceType]: serializeServiceCapabilityTokens([
46
- ServiceCapability.IndexProvider,
47
- ServiceCapability.DigitalTwinReader,
48
- ]),
54
+ [ClaimsServiceSchemaorg.serviceType]: EXAMPLE_LEGAL_ORGANIZATION_SERVICE_TYPE,
49
55
  },
50
56
  controller: exampleControllerBinding,
51
57
  organization: {
@@ -10,6 +10,8 @@ export type LegalOrganizationFormTemplateFields = Readonly<{
10
10
  controllerRole?: string;
11
11
  serviceCategory?: string;
12
12
  serviceIdentifier?: string;
13
+ /** Canonical CSV of capabilities stored in `org.schema.Service.serviceType`. */
14
+ serviceType?: string;
13
15
  serviceUrl?: string;
14
16
  tenantAlias?: string;
15
17
  }>;
@@ -90,6 +92,8 @@ export interface LegalOrganizationOnboardingFacade {
90
92
  getServiceCategory(fields: LegalOrganizationFormTemplateFields): string | undefined;
91
93
  setServiceIdentifier(fields: LegalOrganizationFormTemplateFields, value: string): LegalOrganizationFormTemplateFields;
92
94
  getServiceIdentifier(fields: LegalOrganizationFormTemplateFields): string | undefined;
95
+ setServiceType(fields: LegalOrganizationFormTemplateFields, value: string): LegalOrganizationFormTemplateFields;
96
+ getServiceType(fields: LegalOrganizationFormTemplateFields): string | undefined;
93
97
  setServiceUrl(fields: LegalOrganizationFormTemplateFields, value: string): LegalOrganizationFormTemplateFields;
94
98
  getServiceUrl(fields: LegalOrganizationFormTemplateFields): string | undefined;
95
99
  /**
@@ -136,6 +140,8 @@ export interface LegalOrganizationOnboardingEditor {
136
140
  getServiceCategory(): string | undefined;
137
141
  setServiceIdentifier(value: string): LegalOrganizationOnboardingEditor;
138
142
  getServiceIdentifier(): string | undefined;
143
+ setServiceType(value: string): LegalOrganizationOnboardingEditor;
144
+ getServiceType(): string | undefined;
139
145
  setServiceUrl(value: string): LegalOrganizationOnboardingEditor;
140
146
  getServiceUrl(): string | undefined;
141
147
  setTenantAlias(value: string): LegalOrganizationOnboardingEditor;
@@ -51,6 +51,8 @@ function createEditorFromFacade(facade, initial) {
51
51
  getServiceCategory() { return facade.getServiceCategory(formFields); },
52
52
  setServiceIdentifier(value) { formFields = facade.setServiceIdentifier(formFields, value); return editor; },
53
53
  getServiceIdentifier() { return facade.getServiceIdentifier(formFields); },
54
+ setServiceType(value) { formFields = facade.setServiceType(formFields, value); return editor; },
55
+ getServiceType() { return facade.getServiceType(formFields); },
54
56
  setServiceUrl(value) { formFields = facade.setServiceUrl(formFields, value); return editor; },
55
57
  getServiceUrl() { return facade.getServiceUrl(formFields); },
56
58
  setTenantAlias(value) { formFields = facade.setTenantAlias(formFields, value); return editor; },
@@ -133,6 +135,12 @@ export function createLegalOrganizationOnboardingFacade() {
133
135
  getServiceIdentifier(fields) {
134
136
  return normalizeOptionalText(fields.serviceIdentifier);
135
137
  },
138
+ setServiceType(fields, value) {
139
+ return patchFields(fields, { serviceType: normalizeText(value) });
140
+ },
141
+ getServiceType(fields) {
142
+ return normalizeOptionalText(fields.serviceType);
143
+ },
136
144
  setServiceUrl(fields, value) {
137
145
  return patchFields(fields, { serviceUrl: normalizeText(value) });
138
146
  },
@@ -176,6 +184,9 @@ export function createLegalOrganizationOnboardingFacade() {
176
184
  if (normalizeOptionalText(fields.serviceIdentifier)) {
177
185
  claims[ClaimsServiceSchemaorg.identifier] = normalizeText(fields.serviceIdentifier);
178
186
  }
187
+ if (normalizeOptionalText(fields.serviceType)) {
188
+ claims[ClaimsServiceSchemaorg.serviceType] = normalizeText(fields.serviceType);
189
+ }
179
190
  if (normalizeOptionalText(fields.serviceUrl)) {
180
191
  claims[ClaimsServiceSchemaorg.url] = normalizeText(fields.serviceUrl);
181
192
  }
@@ -236,6 +247,14 @@ export function createLegalOrganizationOnboardingFacade() {
236
247
  field: 'serviceCategory',
237
248
  });
238
249
  }
250
+ if (!normalizeOptionalText(fields.serviceType)) {
251
+ issues.push({
252
+ severity: 'error',
253
+ code: 'missing-service-type',
254
+ message: 'serviceType is required because GW authorizes activation capabilities from it.',
255
+ field: 'serviceType',
256
+ });
257
+ }
239
258
  if (!normalizeOptionalText(fields.controllerRole)) {
240
259
  issues.push({
241
260
  severity: 'warning',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.5.16",
3
+ "version": "2.5.17",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },