sos-data-utils-ts 0.1.0 → 0.2.0

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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ - Add the shared sector-and-country organization-verification policy for
6
+ Canadian and US veterinary and human-health organizations.
7
+ - Keep veterinary official-marketplace-phone OTP confirmation distinct from
8
+ human-health authenticated-email plus postal-code verification.
9
+ - Publish the canonical ConnectHealth production hostnames for animal, human
10
+ health and SOS runtimes.
11
+ - Require legal organizations to use `Organization/_transaction` and keep any
12
+ later DCR activation code separate from verification challenges.
13
+
3
14
  ## 0.1.0
4
15
 
5
16
  - Add the dependency-free shared BFF API-layer contract.
package/README.md CHANGED
@@ -16,6 +16,24 @@ Sector behavior remains in its owner:
16
16
  - `vet-*`: animal/veterinary extensions;
17
17
  - the terminology service: international terminology and regional catalogs.
18
18
 
19
+ The organization-verification contract resolves policy by business sector and
20
+ ISO country. The governed CA/US profiles are:
21
+
22
+ - `animal-care`: immutable form/PDF, existing marketplace organization,
23
+ outbound OTP to its official telephone, confirmation by web or telephone,
24
+ and marketplace primary-location evidence;
25
+ - `health-care`: immutable form/PDF, existing marketplace organization,
26
+ authenticated representative/controller email, and a numeric code delivered
27
+ to the legal postal address and confirmed only in the authenticated portal.
28
+
29
+ Both use `Organization/_transaction`. `Order/_batch` is used only when a new
30
+ host Offer exists; the later licence/DCR activation code is a different secret.
31
+ Ungoverned sector/country combinations fail closed.
32
+
33
+ Canonical production operator hosts are `host-vet.connecthealth.info`,
34
+ `host-uhc.connecthealth.info` and `host-sos.connecthealth.info`. Product aliases
35
+ are not host identities or DID domains.
36
+
19
37
  ## Verify
20
38
 
21
39
  ```bash
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './bff-api.js';
2
+ export * from './organization-verification-policy.js';
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './bff-api.js';
2
+ export * from './organization-verification-policy.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
+ }
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.0",
4
4
  "description": "Product-neutral SOS channel and BFF contract utilities",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -14,6 +14,10 @@
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"
17
21
  }
18
22
  },
19
23
  "files": [