sos-data-utils-ts 0.1.0 → 0.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1
4
+
5
+ - Add the shared product-neutral Task artifact schema backed by canonical flat
6
+ FHIR-like claims from `gdc-common-utils-ts`.
7
+ - Require standard `Task.status` and `Task.intent` instead of making a UI
8
+ display label mandatory for machine-created jobs.
9
+
10
+ ## 0.2.0
11
+
12
+ - Add the shared sector-and-country organization-verification policy for
13
+ Canadian and US veterinary and human-health organizations.
14
+ - Keep veterinary official-marketplace-phone OTP confirmation distinct from
15
+ human-health authenticated-email plus postal-code verification.
16
+ - Publish the canonical ConnectHealth production hostnames for animal, human
17
+ health and SOS runtimes.
18
+ - Require legal organizations to use `Organization/_transaction` and keep any
19
+ later DCR activation code separate from verification challenges.
20
+
3
21
  ## 0.1.0
4
22
 
5
23
  - Add the dependency-free shared BFF API-layer contract.
package/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # sos-data-utils-ts
2
2
 
3
3
  Product-neutral contracts shared outward from SOS channel infrastructure into
4
- human-health and animal products. This package has no dependency on GW CORE,
5
- `gdc-*`, `uhc-*` or `vet-*` packages.
4
+ human-health and animal products. It may reuse product-neutral canonical
5
+ vocabulary from `gdc-common-utils-ts`, but has no dependency on GW CORE or any
6
+ `uhc-*` or `vet-*` package.
6
7
 
7
8
  The first contract defines capability-based BFF route roots. Public products
8
9
  use `/api/assistant/*`; `/api/internal/*` is reserved for authenticated
@@ -16,6 +17,29 @@ Sector behavior remains in its owner:
16
17
  - `vet-*`: animal/veterinary extensions;
17
18
  - the terminology service: international terminology and regional catalogs.
18
19
 
20
+ The shared Task authoring schema uses canonical flat FHIR-like claims from
21
+ `gdc-common-utils-ts`. `Task.status` and `Task.intent` are mandatory; display,
22
+ correlation and output claims remain optional so the same contract supports
23
+ human work items and machine-created asynchronous jobs.
24
+
25
+ The organization-verification contract resolves policy by business sector and
26
+ ISO country. The governed CA/US profiles are:
27
+
28
+ - `animal-care`: immutable form/PDF, existing marketplace organization,
29
+ outbound OTP to its official telephone, confirmation by web or telephone,
30
+ and marketplace primary-location evidence;
31
+ - `health-care`: immutable form/PDF, existing marketplace organization,
32
+ authenticated representative/controller email, and a numeric code delivered
33
+ to the legal postal address and confirmed only in the authenticated portal.
34
+
35
+ Both use `Organization/_transaction`. `Order/_batch` is used only when a new
36
+ host Offer exists; the later licence/DCR activation code is a different secret.
37
+ Ungoverned sector/country combinations fail closed.
38
+
39
+ Canonical production operator hosts are `host-vet.connecthealth.info`,
40
+ `host-uhc.connecthealth.info` and `host-sos.connecthealth.info`. Product aliases
41
+ are not host identities or DID domains.
42
+
19
43
  ## Verify
20
44
 
21
45
  ```bash
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
1
  export * from './bff-api.js';
2
+ export * from './organization-verification-policy.js';
3
+ export * from './task-artifact-schema.js';
package/dist/index.js CHANGED
@@ -1 +1,3 @@
1
1
  export * from './bff-api.js';
2
+ export * from './organization-verification-policy.js';
3
+ export * from './task-artifact-schema.js';
@@ -0,0 +1,31 @@
1
+ /** Shared production operator identities; product aliases are never host DIDs. */
2
+ export declare const SharedProductionHostnames: Readonly<{
3
+ readonly animal: "host-vet.connecthealth.info";
4
+ readonly humanHealth: "host-uhc.connecthealth.info";
5
+ readonly sos: "host-sos.connecthealth.info";
6
+ }>;
7
+ export declare const OrganizationVerificationSectors: readonly ["animal-care", "health-care"];
8
+ export declare const OrganizationVerificationCountryCodes: readonly ["CA", "US"];
9
+ export type OrganizationVerificationSector = (typeof OrganizationVerificationSectors)[number];
10
+ export type OrganizationVerificationCountryCode = (typeof OrganizationVerificationCountryCodes)[number];
11
+ export type OrganizationVerificationContactProof = 'official-marketplace-phone-otp' | 'authenticated-representative-email';
12
+ export type OrganizationVerificationLegalAddressProof = 'marketplace-primary-location' | 'postal-numeric-code';
13
+ export type OrganizationVerificationConfirmationChannel = 'web' | 'telephone';
14
+ export type OrganizationVerificationPolicy = Readonly<{
15
+ sector: OrganizationVerificationSector;
16
+ countryCode: OrganizationVerificationCountryCode;
17
+ marketplaceOrganizationRequired: true;
18
+ applicationEvidence: 'immutable-pdf-sha256';
19
+ contactProof: OrganizationVerificationContactProof;
20
+ legalAddressProof: OrganizationVerificationLegalAddressProof;
21
+ confirmationChannels: readonly OrganizationVerificationConfirmationChannel[];
22
+ telephoneLegalActivationAllowed: boolean;
23
+ legalOrganizationRoute: 'Organization/_transaction';
24
+ orderRule: 'only-when-new-host-offer';
25
+ dcrActivationCodeIsSeparate: true;
26
+ }>;
27
+ /** Resolves explicit sector/country policy and fails closed for ungoverned combinations. */
28
+ export declare function resolveOrganizationVerificationPolicy(input: Readonly<{
29
+ sector: string;
30
+ countryCode: string;
31
+ }>): OrganizationVerificationPolicy;
@@ -0,0 +1,53 @@
1
+ /** Shared production operator identities; product aliases are never host DIDs. */
2
+ export const SharedProductionHostnames = Object.freeze({
3
+ animal: 'host-vet.connecthealth.info',
4
+ humanHealth: 'host-uhc.connecthealth.info',
5
+ sos: 'host-sos.connecthealth.info',
6
+ });
7
+ export const OrganizationVerificationSectors = Object.freeze([
8
+ 'animal-care',
9
+ 'health-care',
10
+ ]);
11
+ export const OrganizationVerificationCountryCodes = Object.freeze([
12
+ 'CA',
13
+ 'US',
14
+ ]);
15
+ const POLICIES = new Map();
16
+ for (const countryCode of OrganizationVerificationCountryCodes) {
17
+ POLICIES.set(key('animal-care', countryCode), Object.freeze({
18
+ sector: 'animal-care',
19
+ countryCode,
20
+ marketplaceOrganizationRequired: true,
21
+ applicationEvidence: 'immutable-pdf-sha256',
22
+ contactProof: 'official-marketplace-phone-otp',
23
+ legalAddressProof: 'marketplace-primary-location',
24
+ confirmationChannels: Object.freeze(['web', 'telephone']),
25
+ telephoneLegalActivationAllowed: true,
26
+ legalOrganizationRoute: 'Organization/_transaction',
27
+ orderRule: 'only-when-new-host-offer',
28
+ dcrActivationCodeIsSeparate: true,
29
+ }));
30
+ POLICIES.set(key('health-care', countryCode), Object.freeze({
31
+ sector: 'health-care',
32
+ countryCode,
33
+ marketplaceOrganizationRequired: true,
34
+ applicationEvidence: 'immutable-pdf-sha256',
35
+ contactProof: 'authenticated-representative-email',
36
+ legalAddressProof: 'postal-numeric-code',
37
+ confirmationChannels: Object.freeze(['web']),
38
+ telephoneLegalActivationAllowed: false,
39
+ legalOrganizationRoute: 'Organization/_transaction',
40
+ orderRule: 'only-when-new-host-offer',
41
+ dcrActivationCodeIsSeparate: true,
42
+ }));
43
+ }
44
+ /** Resolves explicit sector/country policy and fails closed for ungoverned combinations. */
45
+ export function resolveOrganizationVerificationPolicy(input) {
46
+ const policy = POLICIES.get(key(input.sector, input.countryCode));
47
+ if (!policy)
48
+ throw new Error('organization_verification_policy_not_configured');
49
+ return policy;
50
+ }
51
+ function key(sector, countryCode) {
52
+ return `${String(sector || '').trim().toLowerCase()}|${String(countryCode || '').trim().toUpperCase()}`;
53
+ }
@@ -0,0 +1,13 @@
1
+ export { TaskClaim } from 'gdc-common-utils-ts/models/interoperable-claims/task-claims';
2
+ /** Product-neutral authoring contract for flat FHIR-like Task claims. */
3
+ export type TaskArtifactSchemaContract = Readonly<{
4
+ resourceType: 'Task';
5
+ requiredClaims: readonly string[];
6
+ optionalClaims: readonly string[];
7
+ }>;
8
+ /**
9
+ * Shared Task contract used by human, animal, service and asynchronous-job
10
+ * channels. FHIR requires both status and intent; presentation fields remain
11
+ * optional because a machine-created job need not have a display title.
12
+ */
13
+ export declare const TaskArtifactSchema: TaskArtifactSchemaContract;
@@ -0,0 +1,61 @@
1
+ import { TaskClaim } from 'gdc-common-utils-ts/models/interoperable-claims/task-claims';
2
+ export { TaskClaim } from 'gdc-common-utils-ts/models/interoperable-claims/task-claims';
3
+ /**
4
+ * Shared Task contract used by human, animal, service and asynchronous-job
5
+ * channels. FHIR requires both status and intent; presentation fields remain
6
+ * optional because a machine-created job need not have a display title.
7
+ */
8
+ export const TaskArtifactSchema = Object.freeze({
9
+ resourceType: 'Task',
10
+ requiredClaims: Object.freeze([
11
+ TaskClaim.Status,
12
+ TaskClaim.Intent,
13
+ ]),
14
+ optionalClaims: Object.freeze([
15
+ TaskClaim.Id,
16
+ TaskClaim.Identifier,
17
+ TaskClaim.GroupIdentifier,
18
+ TaskClaim.StatusReason,
19
+ TaskClaim.BusinessStatus,
20
+ TaskClaim.Code,
21
+ TaskClaim.Description,
22
+ TaskClaim.Subject,
23
+ TaskClaim.For,
24
+ TaskClaim.Requester,
25
+ TaskClaim.Owner,
26
+ TaskClaim.Focus,
27
+ TaskClaim.PartOf,
28
+ TaskClaim.BasedOn,
29
+ TaskClaim.BasedOnDisplay,
30
+ TaskClaim.Language,
31
+ TaskClaim.Channel,
32
+ TaskClaim.AuthoredOn,
33
+ TaskClaim.LastModified,
34
+ TaskClaim.ScheduledAt,
35
+ TaskClaim.RetryIntervalMinutes,
36
+ TaskClaim.MaxAttempts,
37
+ TaskClaim.TriggerType,
38
+ TaskClaim.Attempt,
39
+ TaskClaim.WindowStart,
40
+ TaskClaim.WindowEnd,
41
+ TaskClaim.AutoCloseAt,
42
+ TaskClaim.EscalationRecipient,
43
+ TaskClaim.Confirmed,
44
+ TaskClaim.ConfirmedAt,
45
+ TaskClaim.Repetitions,
46
+ TaskClaim.DaysOfWeek,
47
+ TaskClaim.RepeatCount,
48
+ TaskClaim.RepeatDurationValue,
49
+ TaskClaim.RepeatDurationUnit,
50
+ TaskClaim.Modified,
51
+ TaskClaim.Priority,
52
+ TaskClaim.RestrictionPeriodStart,
53
+ TaskClaim.RestrictionPeriodEnd,
54
+ TaskClaim.ExecutionPeriodStart,
55
+ TaskClaim.ExecutionPeriodEnd,
56
+ TaskClaim.OutputType,
57
+ TaskClaim.OutputValueReference,
58
+ TaskClaim.OutputValueString,
59
+ TaskClaim.UserSelected,
60
+ ]),
61
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sos-data-utils-ts",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Product-neutral SOS channel and BFF contract utilities",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -14,6 +14,14 @@
14
14
  "./bff-api": {
15
15
  "types": "./dist/bff-api.d.ts",
16
16
  "default": "./dist/bff-api.js"
17
+ },
18
+ "./organization-verification-policy": {
19
+ "types": "./dist/organization-verification-policy.d.ts",
20
+ "default": "./dist/organization-verification-policy.js"
21
+ },
22
+ "./task-artifact-schema": {
23
+ "types": "./dist/task-artifact-schema.d.ts",
24
+ "default": "./dist/task-artifact-schema.js"
17
25
  }
18
26
  },
19
27
  "files": [
@@ -37,6 +45,9 @@
37
45
  "node": ">=24"
38
46
  },
39
47
  "private": false,
48
+ "dependencies": {
49
+ "gdc-common-utils-ts": "2.9.21"
50
+ },
40
51
  "publishConfig": {
41
52
  "access": "public"
42
53
  }