gdc-common-utils-ts 2.5.10 → 2.5.11

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.
@@ -10,4 +10,5 @@ export declare const FhirCodeSystems: Readonly<{
10
10
  readonly Ucum: "http://unitsofmeasure.org";
11
11
  readonly CommunicationCategory: "http://terminology.hl7.org/CodeSystem/communication-category";
12
12
  readonly ObservationCategory: "http://terminology.hl7.org/CodeSystem/observation-category";
13
+ readonly EventTiming: "http://hl7.org/fhir/event-timing";
13
14
  }>;
@@ -10,4 +10,5 @@ export const FhirCodeSystems = Object.freeze({
10
10
  Ucum: 'http://unitsofmeasure.org',
11
11
  CommunicationCategory: 'http://terminology.hl7.org/CodeSystem/communication-category',
12
12
  ObservationCategory: 'http://terminology.hl7.org/CodeSystem/observation-category',
13
+ EventTiming: 'http://hl7.org/fhir/event-timing',
13
14
  });
@@ -141,6 +141,8 @@ export declare enum ClaimsIndividualProductSchemaorg {
141
141
  }
142
142
  export declare enum ClaimsOrderSchemaorg {
143
143
  acceptedOfferIdentifier = "org.schema.Order.acceptedOffer.identifier",
144
+ /** Schema.org Order.confirmationNumber; used for a customer-supplied order confirmation code. */
145
+ confirmationNumber = "org.schema.Order.confirmationNumber",
144
146
  partOfInvoice = "org.schema.Order.partOfInvoice",
145
147
  paymentMethod = "org.schema.Order.paymentMethod",
146
148
  paymentUrl = "org.schema.Order.paymentUrl",
@@ -148,6 +148,8 @@ export var ClaimsIndividualProductSchemaorg;
148
148
  export var ClaimsOrderSchemaorg;
149
149
  (function (ClaimsOrderSchemaorg) {
150
150
  ClaimsOrderSchemaorg["acceptedOfferIdentifier"] = "org.schema.Order.acceptedOffer.identifier";
151
+ /** Schema.org Order.confirmationNumber; used for a customer-supplied order confirmation code. */
152
+ ClaimsOrderSchemaorg["confirmationNumber"] = "org.schema.Order.confirmationNumber";
151
153
  ClaimsOrderSchemaorg["partOfInvoice"] = "org.schema.Order.partOfInvoice";
152
154
  ClaimsOrderSchemaorg["paymentMethod"] = "org.schema.Order.paymentMethod";
153
155
  ClaimsOrderSchemaorg["paymentUrl"] = "org.schema.Order.paymentUrl";
@@ -4,6 +4,12 @@ export type { CodingDescriptor } from './observation-category';
4
4
  * Canonical LOINC descriptors for the currently supported Vital Signs.
5
5
  */
6
6
  export declare const VitalSignsCodes: Readonly<{
7
+ readonly BodyWeight: Readonly<{
8
+ system: string;
9
+ code: string;
10
+ display?: string;
11
+ claim: string;
12
+ }>;
7
13
  readonly HeartRate: Readonly<{
8
14
  system: string;
9
15
  code: string;
@@ -12,6 +12,7 @@ function defineCoding(system, code, display) {
12
12
  * Canonical LOINC descriptors for the currently supported Vital Signs.
13
13
  */
14
14
  export const VitalSignsCodes = Object.freeze({
15
+ BodyWeight: defineCoding(FhirCodeSystems.Loinc, '29463-7', 'Body weight'),
15
16
  HeartRate: defineCoding(FhirCodeSystems.Loinc, '8867-4', 'Heart rate'),
16
17
  BloodPressure: defineCoding(FhirCodeSystems.Loinc, '85354-9', 'Blood pressure panel'),
17
18
  SystolicBloodPressure: defineCoding(FhirCodeSystems.Loinc, '8480-6', 'Systolic blood pressure'),
@@ -78,6 +78,20 @@ export declare const EXAMPLE_LICENSE_AVAILABLE_RECORD: Readonly<{
78
78
  readonly "org.schema.Person.hasOccupation.identifier.value": "ISCO-08|2211";
79
79
  };
80
80
  }>;
81
+ /** Complete stored device-license fixture for manager and repository tests. */
82
+ export declare const EXAMPLE_DEVICE_LICENSE_AVAILABLE: Readonly<{
83
+ readonly id: "8a8a5e1b-0d8e-4a7c-8c39-3b8034440009";
84
+ readonly tenantId: "acme-id";
85
+ readonly orderId: "invoice-001";
86
+ readonly userClass: "employee";
87
+ readonly userCategory: "ISCO-08|2211";
88
+ readonly type: "mobile";
89
+ readonly status: "available";
90
+ readonly plan: "default";
91
+ readonly renewalCycle: "12m";
92
+ readonly reactivationEnabled: false;
93
+ readonly exp: 1893456000;
94
+ }>;
81
95
  export declare const EXAMPLE_LICENSE_LIST_RESPONSE_BODY: Readonly<{
82
96
  readonly data: readonly [{
83
97
  readonly meta: {
@@ -2,7 +2,7 @@ import { DeviceAppTypes, DeviceBindingStatuses, DeviceUserClasses } from '../con
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_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';
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, EXAMPLE_TENANT_IDENTIFIER, } from './shared.js';
6
6
  import { DEFAULT_LICENSE_DEVICE_ALLOWANCE } from '../utils/license.js';
7
7
  import { EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE } from './employee.js';
8
8
  export const EXAMPLE_EMPLOYEE_DEVICE_BINDINGS = Object.freeze([
@@ -70,6 +70,20 @@ export const EXAMPLE_LICENSE_AVAILABLE_RECORD = Object.freeze({
70
70
  [ClaimsIndividualProductSchemaorg.serialNumber]: EXAMPLE_LICENSE_SEAT_UUID_AVAILABLE,
71
71
  },
72
72
  });
73
+ /** Complete stored device-license fixture for manager and repository tests. */
74
+ export const EXAMPLE_DEVICE_LICENSE_AVAILABLE = Object.freeze({
75
+ id: EXAMPLE_LICENSE_SEAT_UUID_AVAILABLE,
76
+ tenantId: EXAMPLE_TENANT_IDENTIFIER,
77
+ orderId: EXAMPLE_LICENSE_INVOICE_ID,
78
+ userClass: DeviceUserClasses.Employee,
79
+ userCategory: EXAMPLE_HEALTHCARE_ACTOR_ROLE_GENERALIST_MEDICAL_PRACTITIONER,
80
+ type: DeviceAppTypes.Mobile,
81
+ status: LicenseStatuses.Available,
82
+ plan: EXAMPLE_LICENSE_PLAN_DEFAULT,
83
+ renewalCycle: EXAMPLE_LICENSE_RENEWAL_CYCLE_YEARLY,
84
+ reactivationEnabled: false,
85
+ exp: 1_893_456_000,
86
+ });
73
87
  export const EXAMPLE_LICENSE_LIST_RESPONSE_BODY = Object.freeze({
74
88
  data: [
75
89
  {
@@ -296,9 +296,14 @@ export declare const EXAMPLE_LICENSE_CURRENCY: "EUR";
296
296
  export declare const EXAMPLE_LICENSE_PLAN_NAME: "Family starter";
297
297
  export declare const EXAMPLE_LICENSE_SKU: "FAM-START";
298
298
  export declare const EXAMPLE_LICENSE_PAYMENT_METHOD_INVOICE: "invoice";
299
+ export declare const EXAMPLE_LICENSE_PAYMENT_METHOD_STRIPE: "Stripe";
299
300
  export declare const EXAMPLE_LICENSE_CHECKOUT_URL: "https://pay.example/offer-001";
300
301
  export declare const EXAMPLE_LICENSE_PAYMENT_URL: "https://pay.example/invoice-001";
301
302
  export declare const EXAMPLE_LICENSE_INVOICE_ID: "invoice-001";
303
+ export declare const EXAMPLE_POSTAL_ACTIVATION_CODE: "EXAMPLE-ACTIVATION-001";
304
+ export declare const EXAMPLE_POSTAL_ACTIVATION_CODE_INVALID: "EXAMPLE-ACTIVATION-INVALID";
305
+ export declare const EXAMPLE_POSTAL_ACTIVATION_PEPPER: "example-host-pepper";
306
+ export declare const EXAMPLE_POSTAL_ACTIVATION_SALT: "example-base64url-salt";
302
307
  export declare const EXAMPLE_INVOICE_DATE: "2026-06-11T10:00:00Z";
303
308
  export declare const EXAMPLE_INVOICE_CHARGEITEM_PRODUCT_CODE: "08412345678903";
304
309
  export declare const EXAMPLE_INVOICE_CHARGEITEM_PRODUCT_NAME: "Sterile saline bottle 500 mL";
@@ -347,6 +352,24 @@ export declare const EXAMPLE_VITAL_SIGN_VALUE_DIASTOLIC: 78;
347
352
  export declare const EXAMPLE_VITAL_SIGN_VALUE_BODY_TEMPERATURE: 37.1;
348
353
  export declare const EXAMPLE_VITAL_SIGN_UNIT_BEATS_PER_MINUTE: "/min";
349
354
  export declare const EXAMPLE_OBSERVATION_CATEGORY_VITAL_SIGNS: "http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";
355
+ /** Reusable LOINC Coding for body-weight Observation examples and metadata. */
356
+ export declare const EXAMPLE_OBSERVATION_BODY_WEIGHT_CODING: Readonly<{
357
+ system: "http://loinc.org";
358
+ code: "29463-7";
359
+ display: "Body weight";
360
+ }>;
361
+ /** Reusable SNOMED CT Coding for anxiety Observation examples and metadata. */
362
+ export declare const EXAMPLE_OBSERVATION_ANXIETY_CODING: Readonly<{
363
+ system: "http://snomed.info/sct";
364
+ code: "48694002";
365
+ display: "Anxiety";
366
+ }>;
367
+ /** Reusable FHIR event-timing Coding for a night-time event. */
368
+ export declare const EXAMPLE_OBSERVATION_EVENT_TIMING_NIGHT_CODING: Readonly<{
369
+ system: "http://hl7.org/fhir/event-timing";
370
+ code: "NIGHT";
371
+ display: "Night";
372
+ }>;
350
373
  export declare const EXAMPLE_VITAL_SIGN_CODE_HEART_RATE: "8867-4";
351
374
  export declare const EXAMPLE_VITAL_SIGN_CODE_BODY_TEMPERATURE: "8310-5";
352
375
  export declare const EXAMPLE_VITAL_SIGN_CODE_BLOOD_PRESSURE_PANEL: "85354-9";
@@ -338,9 +338,14 @@ export const EXAMPLE_LICENSE_CURRENCY = 'EUR';
338
338
  export const EXAMPLE_LICENSE_PLAN_NAME = 'Family starter';
339
339
  export const EXAMPLE_LICENSE_SKU = 'FAM-START';
340
340
  export const EXAMPLE_LICENSE_PAYMENT_METHOD_INVOICE = 'invoice';
341
+ export const EXAMPLE_LICENSE_PAYMENT_METHOD_STRIPE = 'Stripe';
341
342
  export const EXAMPLE_LICENSE_CHECKOUT_URL = 'https://pay.example/offer-001';
342
343
  export const EXAMPLE_LICENSE_PAYMENT_URL = 'https://pay.example/invoice-001';
343
344
  export const EXAMPLE_LICENSE_INVOICE_ID = 'invoice-001';
345
+ export const EXAMPLE_POSTAL_ACTIVATION_CODE = 'EXAMPLE-ACTIVATION-001';
346
+ export const EXAMPLE_POSTAL_ACTIVATION_CODE_INVALID = 'EXAMPLE-ACTIVATION-INVALID';
347
+ export const EXAMPLE_POSTAL_ACTIVATION_PEPPER = 'example-host-pepper';
348
+ export const EXAMPLE_POSTAL_ACTIVATION_SALT = 'example-base64url-salt';
344
349
  export const EXAMPLE_INVOICE_DATE = '2026-06-11T10:00:00Z';
345
350
  export const EXAMPLE_INVOICE_CHARGEITEM_PRODUCT_CODE = '08412345678903';
346
351
  export const EXAMPLE_INVOICE_CHARGEITEM_PRODUCT_NAME = 'Sterile saline bottle 500 mL';
@@ -389,6 +394,24 @@ export const EXAMPLE_VITAL_SIGN_VALUE_DIASTOLIC = 78;
389
394
  export const EXAMPLE_VITAL_SIGN_VALUE_BODY_TEMPERATURE = 37.1;
390
395
  export const EXAMPLE_VITAL_SIGN_UNIT_BEATS_PER_MINUTE = '/min';
391
396
  export const EXAMPLE_OBSERVATION_CATEGORY_VITAL_SIGNS = 'http://terminology.hl7.org/CodeSystem/observation-category|vital-signs';
397
+ /** Reusable LOINC Coding for body-weight Observation examples and metadata. */
398
+ export const EXAMPLE_OBSERVATION_BODY_WEIGHT_CODING = Object.freeze({
399
+ system: FhirCodeSystems.Loinc,
400
+ code: '29463-7',
401
+ display: 'Body weight',
402
+ });
403
+ /** Reusable SNOMED CT Coding for anxiety Observation examples and metadata. */
404
+ export const EXAMPLE_OBSERVATION_ANXIETY_CODING = Object.freeze({
405
+ system: FhirCodeSystems.SnomedCt,
406
+ code: '48694002',
407
+ display: 'Anxiety',
408
+ });
409
+ /** Reusable FHIR event-timing Coding for a night-time event. */
410
+ export const EXAMPLE_OBSERVATION_EVENT_TIMING_NIGHT_CODING = Object.freeze({
411
+ system: FhirCodeSystems.EventTiming,
412
+ code: 'NIGHT',
413
+ display: 'Night',
414
+ });
392
415
  export const EXAMPLE_VITAL_SIGN_CODE_HEART_RATE = '8867-4';
393
416
  export const EXAMPLE_VITAL_SIGN_CODE_BODY_TEMPERATURE = '8310-5';
394
417
  export const EXAMPLE_VITAL_SIGN_CODE_BLOOD_PRESSURE_PANEL = '85354-9';
@@ -1,4 +1,6 @@
1
1
  import type { VerifiableCredentialV2 } from '../models/verifiable-credential';
2
+ /** Canonical protected-code algorithm used by postal activation bindings. */
3
+ export declare const POSTAL_ACTIVATION_CODE_BINDING_ALGORITHM: "scrypt-v1";
2
4
  /** Lifecycle for a separate postal-address verification credential. */
3
5
  export declare const PostalActivationLicenseStatuses: Readonly<{
4
6
  readonly Issued: "issued";
@@ -22,7 +24,7 @@ export type PostalActivationLicenseBinding = Readonly<{
22
24
  controllerKeyMaterial: string;
23
25
  postalAddressHash: string;
24
26
  protectedCode: Readonly<{
25
- algorithm: 'scrypt-v1';
27
+ algorithm: typeof POSTAL_ACTIVATION_CODE_BINDING_ALGORITHM;
26
28
  salt: string;
27
29
  digest: string;
28
30
  }>;
@@ -34,6 +36,8 @@ export type PostalActivationLicenseBinding = Readonly<{
34
36
  deliveredAt?: string;
35
37
  redeemedAt?: string;
36
38
  }>;
39
+ /** Reusable protected-code slice stored in encrypted host registration state. */
40
+ export type PostalActivationCodeBinding = PostalActivationLicenseBinding['protectedCode'];
37
41
  /** Input for the credential returned out-of-band to the applicant controller. */
38
42
  export type OrganizationTestNetworkCredentialInput = Readonly<{
39
43
  issuerDid: string;
@@ -1,4 +1,6 @@
1
1
  import { ContractCredentialTypes, W3cCredentialContexts, W3cCredentialTypes, } from '../constants/verifiable-credentials.js';
2
+ /** Canonical protected-code algorithm used by postal activation bindings. */
3
+ export const POSTAL_ACTIVATION_CODE_BINDING_ALGORITHM = 'scrypt-v1';
2
4
  /** Lifecycle for a separate postal-address verification credential. */
3
5
  export const PostalActivationLicenseStatuses = Object.freeze({
4
6
  Issued: 'issued',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.5.10",
3
+ "version": "2.5.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -24,7 +24,8 @@
24
24
  "verify:dist": "node scripts/verify-dist-syntax.mjs",
25
25
  "check:product-neutrality": "node scripts/check-product-neutrality.mjs",
26
26
  "prepack": "npm run verify:dist",
27
- "prepublishOnly": "npm run check:product-neutrality && npm run typecheck && npm test -- --watchman=false && npm run build"
27
+ "prepublishOnly": "npm run check:product-neutrality && npm run typecheck && npm test -- --watchman=false && npm run build",
28
+ "prepare": "npm run build"
28
29
  },
29
30
  "main": "./dist/index.js",
30
31
  "types": "./dist/index.d.ts",