gdc-common-utils-ts 2.5.3 → 2.5.6
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/constants/data-capabilities.d.ts +7 -7
- package/dist/constants/device.d.ts +6 -0
- package/dist/constants/device.js +5 -0
- package/dist/constants/employee-lifecycle.d.ts +52 -0
- package/dist/constants/employee-lifecycle.js +48 -0
- package/dist/constants/healthcare.d.ts +2 -0
- package/dist/constants/healthcare.js +2 -0
- package/dist/constants/http.d.ts +28 -0
- package/dist/constants/http.js +28 -0
- package/dist/constants/identity-auth.d.ts +57 -0
- package/dist/constants/identity-auth.js +57 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +4 -0
- package/dist/constants/organization-application.d.ts +27 -0
- package/dist/constants/organization-application.js +29 -0
- package/dist/constants/verifiable-credentials.d.ts +6 -2
- package/dist/constants/verifiable-credentials.js +6 -2
- package/dist/examples/inter-tenant-access-contract.d.ts +7 -7
- package/dist/examples/inter-tenant-access-contract.js +3 -2
- package/dist/examples/license.d.ts +111 -0
- package/dist/examples/license.js +85 -2
- package/dist/examples/shared.d.ts +33 -0
- package/dist/examples/shared.js +32 -0
- package/dist/models/device-license.d.ts +2 -2
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/inter-tenant-access-contract.d.ts +1 -1
- package/dist/models/inter-tenant-access-contract.js +1 -1
- package/dist/models/organization-employee-lifecycle.d.ts +45 -0
- package/dist/models/organization-employee-lifecycle.js +1 -0
- package/dist/models/test-network-organization-registration-form.d.ts +71 -0
- package/dist/models/test-network-organization-registration-form.js +43 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/jwk-thumbprint.d.ts +2 -0
- package/dist/utils/jwk-thumbprint.js +8 -0
- package/dist/utils/legal-organization-verification-transaction.d.ts +5 -0
- package/dist/utils/legal-organization-verification-transaction.js +3 -0
- package/dist/utils/license.js +3 -3
- package/dist/utils/organization-employee-lifecycle.d.ts +12 -0
- package/dist/utils/organization-employee-lifecycle.js +125 -0
- package/dist/utils/{organization-registration-authorization.d.ts → organization-test-network-credential.d.ts} +4 -4
- package/dist/utils/{organization-registration-authorization.js → organization-test-network-credential.js} +6 -6
- package/dist/utils/test-network-organization-credentials.d.ts +35 -0
- package/dist/utils/test-network-organization-credentials.js +144 -0
- package/package.json +1 -1
package/dist/examples/license.js
CHANGED
|
@@ -1,8 +1,36 @@
|
|
|
1
|
-
import { DeviceAppTypes, DeviceUserClasses } from '../constants/device.js';
|
|
1
|
+
import { DeviceAppTypes, DeviceBindingStatuses, DeviceUserClasses } from '../constants/device.js';
|
|
2
2
|
import { ClaimsOrderSchemaorg, ClaimsIndividualProductSchemaorg, ClaimsOfferSchemaorg, ClaimsPersonSchemaorg, } from '../constants/schemaorg.js';
|
|
3
3
|
import { buildLicenseIssueClaims, buildLicensePurchaseClaims, LicenseClaimContext, LicenseCategories, LicenseStatuses, } from '../utils/license.js';
|
|
4
4
|
import { createLicenseOfferOrderEditor } from '../utils/license-offer-order.js';
|
|
5
|
-
import { EXAMPLE_LICENSE_ACCEPTED_OFFER_ID, EXAMPLE_LICENSE_AMOUNT, EXAMPLE_LICENSE_CHECKOUT_URL, EXAMPLE_LICENSE_CURRENCY, EXAMPLE_EMAIL_CONTROLLER_ORG, EXAMPLE_EMPLOYEE_ACTIVATION_CODE, EXAMPLE_HEALTHCARE_ACTOR_ROLE_GENERALIST_MEDICAL_PRACTITIONER, EXAMPLE_LICENSE_INVOICE_ID, EXAMPLE_LICENSE_OFFER_ID, EXAMPLE_LICENSE_PLAN_DEFAULT, EXAMPLE_LICENSE_PAYMENT_METHOD_INVOICE, EXAMPLE_LICENSE_PAYMENT_URL, EXAMPLE_LICENSE_RENEWAL_CYCLE_YEARLY, EXAMPLE_LICENSE_PLAN_NAME, EXAMPLE_LICENSE_SEAT_UUID_ACTIVE, EXAMPLE_LICENSE_SEAT_UUID_AVAILABLE, EXAMPLE_LICENSE_SEAT_UUID_SECONDARY, EXAMPLE_LICENSE_SKU, EXAMPLE_LICENSE_SUBJECT_ID_ACTIVE, EXAMPLE_LICENSE_SUBJECT_ID_AVAILABLE, } from './shared.js';
|
|
5
|
+
import { EXAMPLE_LICENSE_ACCEPTED_OFFER_ID, EXAMPLE_LICENSE_AMOUNT, EXAMPLE_LICENSE_CHECKOUT_URL, EXAMPLE_LICENSE_CURRENCY, EXAMPLE_EMAIL_CONTROLLER_ORG, EXAMPLE_EMPLOYEE_ACTIVATION_CODE, EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_PRIMARY, EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_SECONDARY, EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_PRIMARY, EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_SECONDARY, EXAMPLE_EMPLOYEE_DEVICE_MODEL_PRIMARY, EXAMPLE_HEALTHCARE_ACTOR_ROLE_GENERALIST_MEDICAL_PRACTITIONER, EXAMPLE_LICENSE_INVOICE_ID, EXAMPLE_LICENSE_OFFER_ID, EXAMPLE_LICENSE_PLAN_DEFAULT, EXAMPLE_LICENSE_PAYMENT_METHOD_INVOICE, EXAMPLE_LICENSE_PAYMENT_URL, EXAMPLE_LICENSE_RENEWAL_CYCLE_YEARLY, EXAMPLE_LICENSE_PLAN_NAME, EXAMPLE_LICENSE_SEAT_UUID_ACTIVE, EXAMPLE_LICENSE_SEAT_UUID_AVAILABLE, EXAMPLE_LICENSE_SEAT_UUID_SECONDARY, EXAMPLE_LICENSE_SKU, EXAMPLE_LICENSE_SUBJECT_ID_ACTIVE, EXAMPLE_LICENSE_SUBJECT_ID_AVAILABLE, } from './shared.js';
|
|
6
|
+
import { DEFAULT_LICENSE_DEVICE_ALLOWANCE } from '../utils/license.js';
|
|
7
|
+
import { EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE } from './employee.js';
|
|
8
|
+
export const EXAMPLE_EMPLOYEE_DEVICE_BINDINGS = Object.freeze([
|
|
9
|
+
Object.freeze({
|
|
10
|
+
clientId: EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_PRIMARY,
|
|
11
|
+
clientInstanceId: EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_PRIMARY,
|
|
12
|
+
status: DeviceBindingStatuses.Active,
|
|
13
|
+
deviceInfo: Object.freeze({
|
|
14
|
+
clientInstanceId: EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_PRIMARY,
|
|
15
|
+
model: EXAMPLE_EMPLOYEE_DEVICE_MODEL_PRIMARY,
|
|
16
|
+
}),
|
|
17
|
+
activatedAt: 1_786_570_800,
|
|
18
|
+
}),
|
|
19
|
+
Object.freeze({
|
|
20
|
+
clientId: EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_SECONDARY,
|
|
21
|
+
clientInstanceId: EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_SECONDARY,
|
|
22
|
+
status: DeviceBindingStatuses.Revoked,
|
|
23
|
+
deviceInfo: Object.freeze({ clientInstanceId: EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_SECONDARY }),
|
|
24
|
+
activatedAt: 1_786_570_900,
|
|
25
|
+
revokedAt: 1_786_571_000,
|
|
26
|
+
}),
|
|
27
|
+
]);
|
|
28
|
+
/** Two simultaneously active installations used to test the default allowance. */
|
|
29
|
+
export const EXAMPLE_EMPLOYEE_ACTIVE_DEVICE_BINDINGS = Object.freeze(EXAMPLE_EMPLOYEE_DEVICE_BINDINGS.map((binding) => Object.freeze({
|
|
30
|
+
...binding,
|
|
31
|
+
status: DeviceBindingStatuses.Active,
|
|
32
|
+
revokedAt: undefined,
|
|
33
|
+
})));
|
|
6
34
|
export const EXAMPLE_LICENSE_SEAT_UUIDS = Object.freeze([
|
|
7
35
|
EXAMPLE_LICENSE_SEAT_UUID_ACTIVE,
|
|
8
36
|
EXAMPLE_LICENSE_SEAT_UUID_SECONDARY,
|
|
@@ -60,6 +88,61 @@ export const EXAMPLE_LICENSE_LIST_RESPONSE_BODY = Object.freeze({
|
|
|
60
88
|
},
|
|
61
89
|
],
|
|
62
90
|
});
|
|
91
|
+
/** Shared async GW response for a controller-issued employee activation credential. */
|
|
92
|
+
export const EXAMPLE_LICENSE_ISSUE_RESPONSE_BODY = Object.freeze({
|
|
93
|
+
body: {
|
|
94
|
+
data: [{
|
|
95
|
+
resource: {
|
|
96
|
+
data: [{
|
|
97
|
+
type: 'License:Issued',
|
|
98
|
+
id: EXAMPLE_EMPLOYEE_ACTIVATION_CODE,
|
|
99
|
+
meta: {
|
|
100
|
+
claims: {
|
|
101
|
+
[ClaimsIndividualProductSchemaorg.serialNumber]: EXAMPLE_EMPLOYEE_ACTIVATION_CODE,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
}],
|
|
105
|
+
},
|
|
106
|
+
}],
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
/** Shared license search response containing the default two-installation state. */
|
|
110
|
+
export const EXAMPLE_LICENSE_LIST_RESPONSE_BODY_WITH_DEVICES = Object.freeze({
|
|
111
|
+
body: {
|
|
112
|
+
resource: {
|
|
113
|
+
data: [{
|
|
114
|
+
id: EXAMPLE_LICENSE_ACTIVE_RECORD.id,
|
|
115
|
+
meta: {
|
|
116
|
+
status: EXAMPLE_LICENSE_ACTIVE_RECORD.status,
|
|
117
|
+
subjectId: EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE.resourceId,
|
|
118
|
+
maxDevices: DEFAULT_LICENSE_DEVICE_ALLOWANCE,
|
|
119
|
+
deviceBindings: EXAMPLE_EMPLOYEE_DEVICE_BINDINGS,
|
|
120
|
+
},
|
|
121
|
+
}],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
/** Canonical controller-facing employee projection reused across SDK and portal tests. */
|
|
126
|
+
export const EXAMPLE_EMPLOYEE_LIFECYCLE_RECORD = Object.freeze({
|
|
127
|
+
resourceId: EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE.resourceId,
|
|
128
|
+
email: EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE.email,
|
|
129
|
+
roleCode: EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE.role,
|
|
130
|
+
employeeDid: EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE.identifier,
|
|
131
|
+
status: EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE.status,
|
|
132
|
+
license: Object.freeze({
|
|
133
|
+
id: EXAMPLE_LICENSE_ACTIVE_RECORD.id,
|
|
134
|
+
status: EXAMPLE_LICENSE_ACTIVE_RECORD.status,
|
|
135
|
+
maxDevices: DEFAULT_LICENSE_DEVICE_ALLOWANCE,
|
|
136
|
+
activeDevices: EXAMPLE_EMPLOYEE_DEVICE_BINDINGS.filter((binding) => binding.status === DeviceBindingStatuses.Active).length,
|
|
137
|
+
devices: Object.freeze(EXAMPLE_EMPLOYEE_DEVICE_BINDINGS.map((binding) => Object.freeze({
|
|
138
|
+
clientId: binding.clientId,
|
|
139
|
+
name: ('model' in binding.deviceInfo ? binding.deviceInfo.model : undefined)
|
|
140
|
+
|| binding.deviceInfo.clientInstanceId
|
|
141
|
+
|| binding.clientId,
|
|
142
|
+
status: binding.status,
|
|
143
|
+
}))),
|
|
144
|
+
}),
|
|
145
|
+
});
|
|
63
146
|
export function buildExampleLicenseIssueClaims() {
|
|
64
147
|
return Object.freeze(buildLicenseIssueClaims(EXAMPLE_LICENSE_ISSUE_INPUT));
|
|
65
148
|
}
|
|
@@ -86,6 +86,32 @@ export declare const EXAMPLE_OTP_INVITATION_ID: "invitation-demo-001";
|
|
|
86
86
|
export declare const EXAMPLE_OTP_CHALLENGE_ID: "otp-challenge-demo-001";
|
|
87
87
|
export declare const EXAMPLE_OTP_CODE: "123456";
|
|
88
88
|
export declare const EXAMPLE_DEMO_PORTAL_ID_TOKEN: "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJkZW1vLXVzZXIiLCJlbWFpbCI6ImRlbW9AZXhhbXBsZS5vcmcifQ.demo";
|
|
89
|
+
export declare const EXAMPLE_ACCOUNT_OWNER_ID: "account-owner-example";
|
|
90
|
+
export declare const EXAMPLE_PROFILE_PIN: "482951";
|
|
91
|
+
export declare const EXAMPLE_JWK_THUMBPRINT_SHA256_URN: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB";
|
|
92
|
+
export declare const EXAMPLE_DCR_REDIRECT_URI: "https://portal.example.org/auth/callback";
|
|
93
|
+
export declare const EXAMPLE_EMPLOYEE_DCR_CLIENT_NAME: "Example Professional Employee";
|
|
94
|
+
export declare const EXAMPLE_ASYNC_SUBMIT_STATUS: 202;
|
|
95
|
+
export declare const EXAMPLE_ASYNC_POLL_STATUS: 200;
|
|
96
|
+
export declare const EXAMPLE_ASYNC_POLL_ATTEMPTS: 1;
|
|
97
|
+
export declare const ExampleHttpStatusText: Readonly<{
|
|
98
|
+
readonly Ok: "200";
|
|
99
|
+
readonly Conflict: "409";
|
|
100
|
+
}>;
|
|
101
|
+
export declare const EXAMPLE_ACTIVATION_GRANT_CREATED_AT: "2026-08-13T19:20:00.000Z";
|
|
102
|
+
export declare const EXAMPLE_ACTIVATION_GRANT_EXPIRES_AT: "2027-08-13T19:20:00.000Z";
|
|
103
|
+
/** Wraps any shared response body in the canonical successful async result. */
|
|
104
|
+
export declare function buildExampleSubmitAndPollResult(body: unknown): Readonly<{
|
|
105
|
+
submit: Readonly<{
|
|
106
|
+
status: 202;
|
|
107
|
+
body: Readonly<{}>;
|
|
108
|
+
}>;
|
|
109
|
+
poll: Readonly<{
|
|
110
|
+
status: 200;
|
|
111
|
+
body: unknown;
|
|
112
|
+
attempts: 1;
|
|
113
|
+
}>;
|
|
114
|
+
}>;
|
|
89
115
|
export declare const EXAMPLE_TENANT_ROUTE_CONTEXT: {
|
|
90
116
|
readonly tenantId: "acme-id";
|
|
91
117
|
readonly jurisdiction: "ES";
|
|
@@ -255,6 +281,13 @@ export declare const EXAMPLE_CONTENT_ADDRESSED_CONSENT_IDENTIFIER: "zQmYwAPJzv5C
|
|
|
255
281
|
export declare const EXAMPLE_CONTENT_ADDRESSED_SOURCE_REFERENCE: "zQmWvM9dQmWvM9dQmWvM9dQmWvM9dQmWvM9dQmWvM9dQmWv";
|
|
256
282
|
export declare const EXAMPLE_CONTENT_ADDRESSED_EVIDENCE_RECORD_IDENTIFIER: "zQmXh8Y3mJQ4d7MmX7o9nP5sQ2uT1vW6xY8zA3bC4dE5fG";
|
|
257
283
|
export declare const EXAMPLE_EMPLOYEE_ACTIVATION_CODE: "ACT-001";
|
|
284
|
+
export declare const EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_PRIMARY: "client-employee-primary";
|
|
285
|
+
export declare const EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_SECONDARY: "client-employee-secondary";
|
|
286
|
+
export declare const EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_PRIMARY: "installation-employee-primary";
|
|
287
|
+
export declare const EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_SECONDARY: "installation-employee-secondary";
|
|
288
|
+
export declare const EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_TERTIARY: "installation-employee-tertiary";
|
|
289
|
+
export declare const EXAMPLE_CLIENT_INSTANCE_UUID: "7f5e8d6c-91f4-4f6d-a29f-8bd42e44f101";
|
|
290
|
+
export declare const EXAMPLE_EMPLOYEE_DEVICE_MODEL_PRIMARY: "Shared browser profile";
|
|
258
291
|
export declare const EXAMPLE_LICENSE_OFFER_ID: "urn:offer:family-003";
|
|
259
292
|
export declare const EXAMPLE_LICENSE_INVALID_OFFER_ID: "urn:offer:invalid-001";
|
|
260
293
|
export declare const EXAMPLE_LICENSE_ACCEPTED_OFFER_ID: "urn:offer:family-003";
|
package/dist/examples/shared.js
CHANGED
|
@@ -101,6 +101,31 @@ export const EXAMPLE_OTP_INVITATION_ID = 'invitation-demo-001';
|
|
|
101
101
|
export const EXAMPLE_OTP_CHALLENGE_ID = 'otp-challenge-demo-001';
|
|
102
102
|
export const EXAMPLE_OTP_CODE = '123456';
|
|
103
103
|
export const EXAMPLE_DEMO_PORTAL_ID_TOKEN = 'eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJkZW1vLXVzZXIiLCJlbWFpbCI6ImRlbW9AZXhhbXBsZS5vcmcifQ.demo';
|
|
104
|
+
export const EXAMPLE_ACCOUNT_OWNER_ID = 'account-owner-example';
|
|
105
|
+
export const EXAMPLE_PROFILE_PIN = '482951';
|
|
106
|
+
export const EXAMPLE_JWK_THUMBPRINT_SHA256_URN = 'urn:ietf:params:oauth:jwk-thumbprint:sha-256:BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB';
|
|
107
|
+
export const EXAMPLE_DCR_REDIRECT_URI = 'https://portal.example.org/auth/callback';
|
|
108
|
+
export const EXAMPLE_EMPLOYEE_DCR_CLIENT_NAME = 'Example Professional Employee';
|
|
109
|
+
export const EXAMPLE_ASYNC_SUBMIT_STATUS = 202;
|
|
110
|
+
export const EXAMPLE_ASYNC_POLL_STATUS = 200;
|
|
111
|
+
export const EXAMPLE_ASYNC_POLL_ATTEMPTS = 1;
|
|
112
|
+
export const ExampleHttpStatusText = Object.freeze({
|
|
113
|
+
Ok: '200',
|
|
114
|
+
Conflict: '409',
|
|
115
|
+
});
|
|
116
|
+
export const EXAMPLE_ACTIVATION_GRANT_CREATED_AT = '2026-08-13T19:20:00.000Z';
|
|
117
|
+
export const EXAMPLE_ACTIVATION_GRANT_EXPIRES_AT = '2027-08-13T19:20:00.000Z';
|
|
118
|
+
/** Wraps any shared response body in the canonical successful async result. */
|
|
119
|
+
export function buildExampleSubmitAndPollResult(body) {
|
|
120
|
+
return Object.freeze({
|
|
121
|
+
submit: Object.freeze({ status: EXAMPLE_ASYNC_SUBMIT_STATUS, body: Object.freeze({}) }),
|
|
122
|
+
poll: Object.freeze({
|
|
123
|
+
status: EXAMPLE_ASYNC_POLL_STATUS,
|
|
124
|
+
body,
|
|
125
|
+
attempts: EXAMPLE_ASYNC_POLL_ATTEMPTS,
|
|
126
|
+
}),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
104
129
|
export const EXAMPLE_TENANT_ROUTE_CONTEXT = {
|
|
105
130
|
tenantId: EXAMPLE_TENANT_IDENTIFIER,
|
|
106
131
|
jurisdiction: EXAMPLE_JURISDICTION,
|
|
@@ -298,6 +323,13 @@ export const EXAMPLE_CONTENT_ADDRESSED_CONSENT_IDENTIFIER = 'zQmYwAPJzv5CZsnAzt8
|
|
|
298
323
|
export const EXAMPLE_CONTENT_ADDRESSED_SOURCE_REFERENCE = 'zQmWvM9dQmWvM9dQmWvM9dQmWvM9dQmWvM9dQmWvM9dQmWv';
|
|
299
324
|
export const EXAMPLE_CONTENT_ADDRESSED_EVIDENCE_RECORD_IDENTIFIER = 'zQmXh8Y3mJQ4d7MmX7o9nP5sQ2uT1vW6xY8zA3bC4dE5fG';
|
|
300
325
|
export const EXAMPLE_EMPLOYEE_ACTIVATION_CODE = 'ACT-001';
|
|
326
|
+
export const EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_PRIMARY = 'client-employee-primary';
|
|
327
|
+
export const EXAMPLE_EMPLOYEE_DEVICE_CLIENT_ID_SECONDARY = 'client-employee-secondary';
|
|
328
|
+
export const EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_PRIMARY = 'installation-employee-primary';
|
|
329
|
+
export const EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_SECONDARY = 'installation-employee-secondary';
|
|
330
|
+
export const EXAMPLE_EMPLOYEE_DEVICE_INSTANCE_ID_TERTIARY = 'installation-employee-tertiary';
|
|
331
|
+
export const EXAMPLE_CLIENT_INSTANCE_UUID = '7f5e8d6c-91f4-4f6d-a29f-8bd42e44f101';
|
|
332
|
+
export const EXAMPLE_EMPLOYEE_DEVICE_MODEL_PRIMARY = 'Shared browser profile';
|
|
301
333
|
export const EXAMPLE_LICENSE_OFFER_ID = 'urn:offer:family-003';
|
|
302
334
|
export const EXAMPLE_LICENSE_INVALID_OFFER_ID = 'urn:offer:invalid-001';
|
|
303
335
|
export const EXAMPLE_LICENSE_ACCEPTED_OFFER_ID = EXAMPLE_LICENSE_OFFER_ID;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeviceAppType, DeviceUserClass } from '../constants/device';
|
|
1
|
+
import type { DeviceAppType, DeviceBindingStatus, DeviceUserClass } from '../constants/device';
|
|
2
2
|
/**
|
|
3
3
|
* A fingerprint of a specific device, used for binding a license to it.
|
|
4
4
|
*/
|
|
@@ -24,7 +24,7 @@ export interface DeviceBinding {
|
|
|
24
24
|
/** Stable application installation fingerprint supplied by the client. */
|
|
25
25
|
clientInstanceId: string;
|
|
26
26
|
/** Current relationship between this installation and the seat. */
|
|
27
|
-
status:
|
|
27
|
+
status: DeviceBindingStatus;
|
|
28
28
|
/** Device/application metadata captured during DCR. */
|
|
29
29
|
deviceInfo: DeviceInfo;
|
|
30
30
|
activatedAt: number;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './dataspace-discovery';
|
|
|
19
19
|
export * from './dataspace-discovery-defaults';
|
|
20
20
|
export * from './dataspace-protocol';
|
|
21
21
|
export * from './device-license';
|
|
22
|
+
export * from './organization-employee-lifecycle';
|
|
22
23
|
export * from './did';
|
|
23
24
|
export * from './fhir-documents';
|
|
24
25
|
export * from './gaia-x';
|
|
@@ -53,6 +54,7 @@ export * from './response';
|
|
|
53
54
|
export * from './subject-identifier-ledger';
|
|
54
55
|
export * from './subject-identity';
|
|
55
56
|
export * from './subject-identity-binding';
|
|
57
|
+
export * from './test-network-organization-registration-form';
|
|
56
58
|
export * from './terminology';
|
|
57
59
|
export * from './urlPath';
|
|
58
60
|
export * from './verifiable-credential';
|
package/dist/models/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from './dataspace-discovery.js';
|
|
|
19
19
|
export * from './dataspace-discovery-defaults.js';
|
|
20
20
|
export * from './dataspace-protocol.js';
|
|
21
21
|
export * from './device-license.js';
|
|
22
|
+
export * from './organization-employee-lifecycle.js';
|
|
22
23
|
export * from './did.js';
|
|
23
24
|
export * from './fhir-documents.js';
|
|
24
25
|
export * from './gaia-x.js';
|
|
@@ -53,6 +54,7 @@ export * from './response.js';
|
|
|
53
54
|
export * from './subject-identifier-ledger.js';
|
|
54
55
|
export * from './subject-identity.js';
|
|
55
56
|
export * from './subject-identity-binding.js';
|
|
57
|
+
export * from './test-network-organization-registration-form.js';
|
|
56
58
|
export * from './terminology.js';
|
|
57
59
|
export * from './urlPath.js';
|
|
58
60
|
export * from './verifiable-credential.js';
|
|
@@ -66,7 +66,7 @@ export var ClaimInterTenantAccessContract;
|
|
|
66
66
|
* Allowed business/legal purpose for the access.
|
|
67
67
|
*
|
|
68
68
|
* Example:
|
|
69
|
-
* - `
|
|
69
|
+
* - `HRESCH` (HL7 v3 ActReason: healthcare research)
|
|
70
70
|
*/
|
|
71
71
|
ClaimInterTenantAccessContract["purpose"] = "Contract.term-type";
|
|
72
72
|
/**
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DeviceBindingStatus } from '../constants/device';
|
|
2
|
+
import type { EmployeeActivationGrantVersion, EmployeeDirectoryStatus } from '../constants/employee-lifecycle';
|
|
3
|
+
/** One installation in the controller-facing employee lifecycle projection. */
|
|
4
|
+
export type OrganizationEmployeeDeviceRecord = Readonly<{
|
|
5
|
+
clientId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
status: DeviceBindingStatus;
|
|
8
|
+
}>;
|
|
9
|
+
/** License state attached to one employee directory entry. */
|
|
10
|
+
export type OrganizationEmployeeLicenseRecord = Readonly<{
|
|
11
|
+
id: string;
|
|
12
|
+
status: string;
|
|
13
|
+
maxDevices: number;
|
|
14
|
+
activeDevices: number;
|
|
15
|
+
devices: ReadonlyArray<OrganizationEmployeeDeviceRecord>;
|
|
16
|
+
}>;
|
|
17
|
+
/** Product-neutral employee, seat and installation lifecycle projection. */
|
|
18
|
+
export type OrganizationEmployeeLifecycleRecord = Readonly<{
|
|
19
|
+
resourceId: string;
|
|
20
|
+
email: string;
|
|
21
|
+
roleCode: string;
|
|
22
|
+
employeeDid: string;
|
|
23
|
+
status: EmployeeDirectoryStatus;
|
|
24
|
+
license?: OrganizationEmployeeLicenseRecord;
|
|
25
|
+
}>;
|
|
26
|
+
/** Typed wire request for revoking one installation without releasing its seat. */
|
|
27
|
+
export type EmployeeDeviceRevocationTarget = Readonly<{
|
|
28
|
+
licenseId: string;
|
|
29
|
+
clientId: string;
|
|
30
|
+
}>;
|
|
31
|
+
/** Tenant routing metadata bound to an employee activation credential digest. */
|
|
32
|
+
export type EmployeeActivationGrant = Readonly<{
|
|
33
|
+
version: EmployeeActivationGrantVersion;
|
|
34
|
+
employeeDid: string;
|
|
35
|
+
employeeRoleCode: string;
|
|
36
|
+
employeeActorIdentifier: string;
|
|
37
|
+
providerDid: string;
|
|
38
|
+
routeContext: Readonly<{
|
|
39
|
+
tenantId: string;
|
|
40
|
+
jurisdiction: string;
|
|
41
|
+
sector: string;
|
|
42
|
+
}>;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
expiresAt: string;
|
|
45
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-service fields written by the portal BFF. They are deployment facts,
|
|
3
|
+
* not editable applicant input.
|
|
4
|
+
*/
|
|
5
|
+
export interface TestNetworkProviderPdfForm {
|
|
6
|
+
hostServiceCountry: string;
|
|
7
|
+
hostServiceLegalName: string;
|
|
8
|
+
hostServiceTaxId: string;
|
|
9
|
+
hostServiceUrl: string;
|
|
10
|
+
}
|
|
11
|
+
/** Legal-organization fields captured from the applicant. */
|
|
12
|
+
export interface TestNetworkLegalOrganizationPdfForm {
|
|
13
|
+
'Identification number': string;
|
|
14
|
+
organizationLegalName: string;
|
|
15
|
+
organizationName: string;
|
|
16
|
+
organizationAddressCountry: string;
|
|
17
|
+
organizationAddressRegion: string;
|
|
18
|
+
organizationOfficialLicense: string;
|
|
19
|
+
organizationAddressPostalCode: string;
|
|
20
|
+
organizationAddressLine: string;
|
|
21
|
+
organizationAddressCity: string;
|
|
22
|
+
organizationContactUrl: string;
|
|
23
|
+
organizationContactEmail: string;
|
|
24
|
+
organizationContactPhone: string;
|
|
25
|
+
organizationServiceCategory: string;
|
|
26
|
+
organizationIdentifierType: string;
|
|
27
|
+
organizationIndexProvider: boolean;
|
|
28
|
+
organizationResearchProvider: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Legal-representative fields captured from the applicant. */
|
|
31
|
+
export interface TestNetworkLegalRepresentativePdfForm {
|
|
32
|
+
representativeFullName: string;
|
|
33
|
+
representativeContactEmail: string;
|
|
34
|
+
representativeContactPhone: string;
|
|
35
|
+
representativeIdentifierType: string;
|
|
36
|
+
representativeIdentifierValue: string;
|
|
37
|
+
representativeIdentifierCountry: string;
|
|
38
|
+
representativeIdentifierRegion: string;
|
|
39
|
+
representativeSelfDeclaration: boolean;
|
|
40
|
+
'I confirm that I am duly authorized by the organization to submit this application': boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Technical-controller fields captured from the applicant. */
|
|
43
|
+
export interface TestNetworkControllerPdfForm {
|
|
44
|
+
controllerFullName: string;
|
|
45
|
+
controllerContactEmail: string;
|
|
46
|
+
controllerContactPhone: string;
|
|
47
|
+
controllerIdentifierType: string;
|
|
48
|
+
controllerIdentifierValue: string;
|
|
49
|
+
controllerIdentifierCountry: string;
|
|
50
|
+
controllerIdentifierRegion: string;
|
|
51
|
+
representativeIsController: boolean;
|
|
52
|
+
'The legal representative and the technical controller of the service are the same person': boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Immutable values added by the portal BFF after browser validation. The JWK
|
|
56
|
+
* commitment is generated from the server-created controller key; the browser
|
|
57
|
+
* must never be allowed to replace it.
|
|
58
|
+
*/
|
|
59
|
+
export interface TestNetworkRegistrationDocumentMetadata {
|
|
60
|
+
docVersion: string;
|
|
61
|
+
signDate: string;
|
|
62
|
+
controllerKeyCommitment: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Canonical AcroForm projection used by the Test Network registration PDF.
|
|
66
|
+
* The property names are the PDF field names, including the two historical
|
|
67
|
+
* sentence-shaped checkbox names present in the supplied form.
|
|
68
|
+
*/
|
|
69
|
+
export type TestNetworkOrganizationRegistrationPdfForm = TestNetworkProviderPdfForm & TestNetworkLegalOrganizationPdfForm & TestNetworkLegalRepresentativePdfForm & TestNetworkControllerPdfForm & TestNetworkRegistrationDocumentMetadata;
|
|
70
|
+
export declare const TEST_NETWORK_ORGANIZATION_REGISTRATION_PDF_FIELDS: readonly ["Identification number", "I confirm that I am duly authorized by the organization to submit this application", "The legal representative and the technical controller of the service are the same person", "hostServiceCountry", "hostServiceLegalName", "hostServiceTaxId", "hostServiceUrl", "organizationLegalName", "organizationName", "organizationAddressCountry", "organizationAddressRegion", "organizationOfficialLicense", "organizationAddressPostalCode", "organizationAddressLine", "organizationAddressCity", "organizationContactUrl", "organizationContactEmail", "organizationContactPhone", "representativeContactEmail", "representativeFullName", "representativeIdentifierValue", "representativeIdentifierCountry", "representativeIdentifierRegion", "controllerContactPhone", "controllerFullName", "controllerContactEmail", "controllerIdentifierValue", "controllerIdentifierCountry", "controllerIdentifierRegion", "representativeContactPhone", "organizationServiceCategory", "representativeIdentifierType", "controllerIdentifierType", "representativeSelfDeclaration", "representativeIsController", "docVersion", "signDate", "organizationIndexProvider", "organizationResearchProvider", "organizationIdentifierType", "controllerKeyCommitment"];
|
|
71
|
+
export type TestNetworkOrganizationRegistrationPdfFieldName = typeof TEST_NETWORK_ORGANIZATION_REGISTRATION_PDF_FIELDS[number];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const TEST_NETWORK_ORGANIZATION_REGISTRATION_PDF_FIELDS = Object.freeze([
|
|
2
|
+
'Identification number',
|
|
3
|
+
'I confirm that I am duly authorized by the organization to submit this application',
|
|
4
|
+
'The legal representative and the technical controller of the service are the same person',
|
|
5
|
+
'hostServiceCountry',
|
|
6
|
+
'hostServiceLegalName',
|
|
7
|
+
'hostServiceTaxId',
|
|
8
|
+
'hostServiceUrl',
|
|
9
|
+
'organizationLegalName',
|
|
10
|
+
'organizationName',
|
|
11
|
+
'organizationAddressCountry',
|
|
12
|
+
'organizationAddressRegion',
|
|
13
|
+
'organizationOfficialLicense',
|
|
14
|
+
'organizationAddressPostalCode',
|
|
15
|
+
'organizationAddressLine',
|
|
16
|
+
'organizationAddressCity',
|
|
17
|
+
'organizationContactUrl',
|
|
18
|
+
'organizationContactEmail',
|
|
19
|
+
'organizationContactPhone',
|
|
20
|
+
'representativeContactEmail',
|
|
21
|
+
'representativeFullName',
|
|
22
|
+
'representativeIdentifierValue',
|
|
23
|
+
'representativeIdentifierCountry',
|
|
24
|
+
'representativeIdentifierRegion',
|
|
25
|
+
'controllerContactPhone',
|
|
26
|
+
'controllerFullName',
|
|
27
|
+
'controllerContactEmail',
|
|
28
|
+
'controllerIdentifierValue',
|
|
29
|
+
'controllerIdentifierCountry',
|
|
30
|
+
'controllerIdentifierRegion',
|
|
31
|
+
'representativeContactPhone',
|
|
32
|
+
'organizationServiceCategory',
|
|
33
|
+
'representativeIdentifierType',
|
|
34
|
+
'controllerIdentifierType',
|
|
35
|
+
'representativeSelfDeclaration',
|
|
36
|
+
'representativeIsController',
|
|
37
|
+
'docVersion',
|
|
38
|
+
'signDate',
|
|
39
|
+
'organizationIndexProvider',
|
|
40
|
+
'organizationResearchProvider',
|
|
41
|
+
'organizationIdentifierType',
|
|
42
|
+
'controllerKeyCommitment',
|
|
43
|
+
]);
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export * from './individual-organization-claims';
|
|
|
67
67
|
export * from './inter-tenant-access-contract';
|
|
68
68
|
export * from './legal-organization-onboarding-editor';
|
|
69
69
|
export * from './organization-lifecycle';
|
|
70
|
+
export * from './organization-employee-lifecycle';
|
|
70
71
|
export * from './organization-did-binding';
|
|
71
72
|
export * from './organization-authorization-urn';
|
|
72
73
|
export * from './individual-organization-lifecycle';
|
|
@@ -83,7 +84,8 @@ export * from './jwt-signer';
|
|
|
83
84
|
export * from './jwk-thumbprint';
|
|
84
85
|
export * from './legal-organization-onboarding';
|
|
85
86
|
export * from './legal-organization-verification-transaction';
|
|
86
|
-
export * from './organization-
|
|
87
|
+
export * from './organization-test-network-credential';
|
|
88
|
+
export * from './test-network-organization-credentials';
|
|
87
89
|
export * from './local-terminology-provider';
|
|
88
90
|
export * from './license';
|
|
89
91
|
export * from './license-commercial-search';
|
package/dist/utils/index.js
CHANGED
|
@@ -67,6 +67,7 @@ export * from './individual-organization-claims.js';
|
|
|
67
67
|
export * from './inter-tenant-access-contract.js';
|
|
68
68
|
export * from './legal-organization-onboarding-editor.js';
|
|
69
69
|
export * from './organization-lifecycle.js';
|
|
70
|
+
export * from './organization-employee-lifecycle.js';
|
|
70
71
|
export * from './organization-did-binding.js';
|
|
71
72
|
export * from './organization-authorization-urn.js';
|
|
72
73
|
export * from './individual-organization-lifecycle.js';
|
|
@@ -83,7 +84,8 @@ export * from './jwt-signer.js';
|
|
|
83
84
|
export * from './jwk-thumbprint.js';
|
|
84
85
|
export * from './legal-organization-onboarding.js';
|
|
85
86
|
export * from './legal-organization-verification-transaction.js';
|
|
86
|
-
export * from './organization-
|
|
87
|
+
export * from './organization-test-network-credential.js';
|
|
88
|
+
export * from './test-network-organization-credentials.js';
|
|
87
89
|
export * from './local-terminology-provider.js';
|
|
88
90
|
export * from './license.js';
|
|
89
91
|
export * from './license-commercial-search.js';
|
|
@@ -38,6 +38,8 @@ export declare function computeRfc7638JwkThumbprint(jwk: ThumbprintableJwk): str
|
|
|
38
38
|
* `urn:ietf:params:oauth:jwk-thumbprint:sha-256:<base64url>`
|
|
39
39
|
*/
|
|
40
40
|
export declare function toJwkThumbprintSha256Urn(jwk: ThumbprintableJwk): string;
|
|
41
|
+
/** True only for an RFC 9278 SHA-256 JWK thumbprint URI. */
|
|
42
|
+
export declare function isJwkThumbprintSha256Urn(value: unknown): value is string;
|
|
41
43
|
/**
|
|
42
44
|
* Returns a public JWK whose `kid` is derived exclusively from its public key
|
|
43
45
|
* material. Caller-provided aliases are deliberately replaced so DID methods,
|
|
@@ -55,6 +55,14 @@ export function computeRfc7638JwkThumbprint(jwk) {
|
|
|
55
55
|
export function toJwkThumbprintSha256Urn(jwk) {
|
|
56
56
|
return `${UrnPrefixes.JwkThumbprintSha256KeyId}${computeRfc7638JwkThumbprint(jwk)}`;
|
|
57
57
|
}
|
|
58
|
+
/** True only for an RFC 9278 SHA-256 JWK thumbprint URI. */
|
|
59
|
+
export function isJwkThumbprintSha256Urn(value) {
|
|
60
|
+
const normalized = typeof value === 'string' ? value.trim() : '';
|
|
61
|
+
if (!normalized.startsWith(UrnPrefixes.JwkThumbprintSha256KeyId))
|
|
62
|
+
return false;
|
|
63
|
+
const thumbprint = normalized.slice(UrnPrefixes.JwkThumbprintSha256KeyId.length);
|
|
64
|
+
return /^[A-Za-z0-9_-]{43}$/.test(thumbprint);
|
|
65
|
+
}
|
|
58
66
|
/**
|
|
59
67
|
* Returns a public JWK whose `kid` is derived exclusively from its public key
|
|
60
68
|
* material. Caller-provided aliases are deliberately replaced so DID methods,
|
|
@@ -27,6 +27,8 @@ export type LegalOrganizationVerificationTransactionEntryType = typeof LegalOrga
|
|
|
27
27
|
*/
|
|
28
28
|
export type LegalOrganizationVerificationTransactionController = Readonly<{
|
|
29
29
|
did?: string;
|
|
30
|
+
/** Normalized controller contact bound independently from the representative. */
|
|
31
|
+
email?: string;
|
|
30
32
|
sameAs?: string;
|
|
31
33
|
publicKeyJwk?: Record<string, unknown>;
|
|
32
34
|
jwks?: {
|
|
@@ -80,6 +82,8 @@ export type LegalOrganizationVerificationTransactionInput = Readonly<{
|
|
|
80
82
|
verification?: LegalOrganizationVerificationRouting;
|
|
81
83
|
/** Out-of-band host authorization used only by the Test Network path. */
|
|
82
84
|
authorizationCredential?: VerifiableCredentialV2;
|
|
85
|
+
/** Three reviewer-issued domain VCs accepted only with Test Network authorization. */
|
|
86
|
+
testNetworkCredentials?: readonly VerifiableCredentialV2[];
|
|
83
87
|
attachments?: unknown[];
|
|
84
88
|
}>;
|
|
85
89
|
export type LegalOrganizationVerificationTransactionEntry = Readonly<{
|
|
@@ -102,6 +106,7 @@ export type LegalOrganizationVerificationTransactionEntry = Readonly<{
|
|
|
102
106
|
legalRepresentative?: LegalOrganizationVerificationRepresentativePayload;
|
|
103
107
|
verification?: LegalOrganizationVerificationRouting;
|
|
104
108
|
authorizationCredential?: VerifiableCredentialV2;
|
|
109
|
+
testNetworkCredentials?: readonly VerifiableCredentialV2[];
|
|
105
110
|
[key: string]: unknown;
|
|
106
111
|
};
|
|
107
112
|
[key: string]: unknown;
|
|
@@ -64,6 +64,9 @@ export function buildLegalOrganizationVerificationTransactionBundle(input) {
|
|
|
64
64
|
...(input.authorizationCredential
|
|
65
65
|
? { authorizationCredential: input.authorizationCredential }
|
|
66
66
|
: {}),
|
|
67
|
+
...(input.testNetworkCredentials?.length
|
|
68
|
+
? { testNetworkCredentials: input.testNetworkCredentials }
|
|
69
|
+
: {}),
|
|
67
70
|
},
|
|
68
71
|
}],
|
|
69
72
|
...(Array.isArray(input.attachments) && input.attachments.length > 0
|
package/dist/utils/license.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeviceAppTypes, DeviceUserClasses } from '../constants/device.js';
|
|
1
|
+
import { DeviceAppTypes, DeviceBindingStatuses, DeviceUserClasses } from '../constants/device.js';
|
|
2
2
|
import { ClaimsIndividualProductSchemaorg, ClaimsOfferSchemaorg, ClaimsPersonSchemaorg, } from '../constants/schemaorg.js';
|
|
3
3
|
/** Default simultaneous installation allowance for one professional/member seat. */
|
|
4
4
|
export const DEFAULT_LICENSE_DEVICE_ALLOWANCE = 2;
|
|
@@ -13,7 +13,7 @@ export function resolveLicenseDeviceAllowance(license) {
|
|
|
13
13
|
*/
|
|
14
14
|
export function listActiveLicenseDeviceBindings(license) {
|
|
15
15
|
if (Array.isArray(license.deviceBindings)) {
|
|
16
|
-
return license.deviceBindings.filter((binding) => binding.status ===
|
|
16
|
+
return license.deviceBindings.filter((binding) => binding.status === DeviceBindingStatuses.Active);
|
|
17
17
|
}
|
|
18
18
|
const clientId = String(license.deviceId || '').trim();
|
|
19
19
|
if (!clientId)
|
|
@@ -22,7 +22,7 @@ export function listActiveLicenseDeviceBindings(license) {
|
|
|
22
22
|
return [{
|
|
23
23
|
clientId,
|
|
24
24
|
clientInstanceId: deviceInfo.clientInstanceId || clientId,
|
|
25
|
-
status:
|
|
25
|
+
status: DeviceBindingStatuses.Active,
|
|
26
26
|
deviceInfo,
|
|
27
27
|
activatedAt: Number(license.activatedAt || 0),
|
|
28
28
|
}];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EmployeeDeviceRevocationTarget, OrganizationEmployeeLifecycleRecord } from '../models/organization-employee-lifecycle';
|
|
2
|
+
/** Builds the exact identity/auth revoke request body from a typed target. */
|
|
3
|
+
export declare function buildEmployeeDeviceRevocationBody(target: EmployeeDeviceRevocationTarget): Readonly<Record<string, string>>;
|
|
4
|
+
/** Reads an employee activation credential from canonical and legacy GW envelopes. */
|
|
5
|
+
export declare function readEmployeeActivationCode(value: unknown): string;
|
|
6
|
+
/** Extracts GW search rows regardless of async job envelope depth. */
|
|
7
|
+
export declare function extractGwSearchResources(value: unknown): ReadonlyArray<Record<string, unknown>>;
|
|
8
|
+
/** Combines employee directory and license search results into one typed view. */
|
|
9
|
+
export declare function projectOrganizationEmployeeLifecycle(input: Readonly<{
|
|
10
|
+
employeeResponse: unknown;
|
|
11
|
+
licenseResponse: unknown;
|
|
12
|
+
}>): OrganizationEmployeeLifecycleRecord[];
|