@metriport/commonwell-sdk 0.30.0-alpha.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.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/dist/__tests__/env-setup.d.ts +2 -0
  4. package/dist/__tests__/env-setup.d.ts.map +1 -0
  5. package/dist/__tests__/env-setup.js +35 -0
  6. package/dist/__tests__/env-setup.js.map +1 -0
  7. package/dist/client/common.d.ts +39 -0
  8. package/dist/client/common.d.ts.map +1 -0
  9. package/dist/client/common.js +15 -0
  10. package/dist/client/common.js.map +1 -0
  11. package/dist/client/commonwell-api.d.ts +103 -0
  12. package/dist/client/commonwell-api.d.ts.map +1 -0
  13. package/dist/client/commonwell-api.js +3 -0
  14. package/dist/client/commonwell-api.js.map +1 -0
  15. package/dist/client/commonwell-base.d.ts +47 -0
  16. package/dist/client/commonwell-base.d.ts.map +1 -0
  17. package/dist/client/commonwell-base.js +105 -0
  18. package/dist/client/commonwell-base.js.map +1 -0
  19. package/dist/client/commonwell-member-api.d.ts +29 -0
  20. package/dist/client/commonwell-member-api.d.ts.map +1 -0
  21. package/dist/client/commonwell-member-api.js +3 -0
  22. package/dist/client/commonwell-member-api.js.map +1 -0
  23. package/dist/client/commonwell-member.d.ts +168 -0
  24. package/dist/client/commonwell-member.d.ts.map +1 -0
  25. package/dist/client/commonwell-member.js +349 -0
  26. package/dist/client/commonwell-member.js.map +1 -0
  27. package/dist/client/commonwell.d.ts +245 -0
  28. package/dist/client/commonwell.d.ts.map +1 -0
  29. package/dist/client/commonwell.js +502 -0
  30. package/dist/client/commonwell.js.map +1 -0
  31. package/dist/common/__tests__/util.test.d.ts +2 -0
  32. package/dist/common/__tests__/util.test.d.ts.map +1 -0
  33. package/dist/common/__tests__/util.test.js +51 -0
  34. package/dist/common/__tests__/util.test.js.map +1 -0
  35. package/dist/common/__tests__/validate-npi.test.d.ts +2 -0
  36. package/dist/common/__tests__/validate-npi.test.d.ts.map +1 -0
  37. package/dist/common/__tests__/validate-npi.test.js +44 -0
  38. package/dist/common/__tests__/validate-npi.test.js.map +1 -0
  39. package/dist/common/certificate.d.ts +3 -0
  40. package/dist/common/certificate.d.ts.map +1 -0
  41. package/dist/common/certificate.js +11 -0
  42. package/dist/common/certificate.js.map +1 -0
  43. package/dist/common/commonwell-error.d.ts +23 -0
  44. package/dist/common/commonwell-error.d.ts.map +1 -0
  45. package/dist/common/commonwell-error.js +33 -0
  46. package/dist/common/commonwell-error.js.map +1 -0
  47. package/dist/common/fileDownload.d.ts +37 -0
  48. package/dist/common/fileDownload.d.ts.map +1 -0
  49. package/dist/common/fileDownload.js +53 -0
  50. package/dist/common/fileDownload.js.map +1 -0
  51. package/dist/common/make-jwt.d.ts +60 -0
  52. package/dist/common/make-jwt.d.ts.map +1 -0
  53. package/dist/common/make-jwt.js +124 -0
  54. package/dist/common/make-jwt.js.map +1 -0
  55. package/dist/common/util.d.ts +78 -0
  56. package/dist/common/util.d.ts.map +1 -0
  57. package/dist/common/util.js +104 -0
  58. package/dist/common/util.js.map +1 -0
  59. package/dist/common/validate-npi.d.ts +2 -0
  60. package/dist/common/validate-npi.d.ts.map +1 -0
  61. package/dist/common/validate-npi.js +6 -0
  62. package/dist/common/validate-npi.js.map +1 -0
  63. package/dist/common/zod.d.ts +13 -0
  64. package/dist/common/zod.d.ts.map +1 -0
  65. package/dist/common/zod.js +38 -0
  66. package/dist/common/zod.js.map +1 -0
  67. package/dist/index.d.ts +20 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +45 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/models/__tests__/address.test.d.ts +2 -0
  72. package/dist/models/__tests__/address.test.d.ts.map +1 -0
  73. package/dist/models/__tests__/address.test.js +348 -0
  74. package/dist/models/__tests__/address.test.js.map +1 -0
  75. package/dist/models/__tests__/demographics.test.d.ts +2 -0
  76. package/dist/models/__tests__/demographics.test.d.ts.map +1 -0
  77. package/dist/models/__tests__/demographics.test.js +96 -0
  78. package/dist/models/__tests__/demographics.test.js.map +1 -0
  79. package/dist/models/address.d.ts +177 -0
  80. package/dist/models/address.d.ts.map +1 -0
  81. package/dist/models/address.js +94 -0
  82. package/dist/models/address.js.map +1 -0
  83. package/dist/models/certificates.d.ts +77 -0
  84. package/dist/models/certificates.d.ts.map +1 -0
  85. package/dist/models/certificates.js +27 -0
  86. package/dist/models/certificates.js.map +1 -0
  87. package/dist/models/contact.d.ts +47 -0
  88. package/dist/models/contact.d.ts.map +1 -0
  89. package/dist/models/contact.js +30 -0
  90. package/dist/models/contact.js.map +1 -0
  91. package/dist/models/date.d.ts +4 -0
  92. package/dist/models/date.d.ts.map +1 -0
  93. package/dist/models/date.js +10 -0
  94. package/dist/models/date.js.map +1 -0
  95. package/dist/models/demographics.d.ts +290 -0
  96. package/dist/models/demographics.d.ts.map +1 -0
  97. package/dist/models/demographics.js +57 -0
  98. package/dist/models/demographics.js.map +1 -0
  99. package/dist/models/document.d.ts +7823 -0
  100. package/dist/models/document.d.ts.map +1 -0
  101. package/dist/models/document.js +106 -0
  102. package/dist/models/document.js.map +1 -0
  103. package/dist/models/facility.d.ts +82 -0
  104. package/dist/models/facility.d.ts.map +1 -0
  105. package/dist/models/facility.js +11 -0
  106. package/dist/models/facility.js.map +1 -0
  107. package/dist/models/human-name.d.ts +56 -0
  108. package/dist/models/human-name.d.ts.map +1 -0
  109. package/dist/models/human-name.js +39 -0
  110. package/dist/models/human-name.js.map +1 -0
  111. package/dist/models/identifier.d.ts +110 -0
  112. package/dist/models/identifier.d.ts.map +1 -0
  113. package/dist/models/identifier.js +37 -0
  114. package/dist/models/identifier.js.map +1 -0
  115. package/dist/models/organization.d.ts +2390 -0
  116. package/dist/models/organization.d.ts.map +1 -0
  117. package/dist/models/organization.js +139 -0
  118. package/dist/models/organization.js.map +1 -0
  119. package/dist/models/patient-organization.d.ts +36 -0
  120. package/dist/models/patient-organization.d.ts.map +1 -0
  121. package/dist/models/patient-organization.js +10 -0
  122. package/dist/models/patient-organization.js.map +1 -0
  123. package/dist/models/patient.d.ts +5350 -0
  124. package/dist/models/patient.d.ts.map +1 -0
  125. package/dist/models/patient.js +94 -0
  126. package/dist/models/patient.js.map +1 -0
  127. package/dist/models/period.d.ts +13 -0
  128. package/dist/models/period.d.ts.map +1 -0
  129. package/dist/models/period.js +13 -0
  130. package/dist/models/period.js.map +1 -0
  131. package/dist/models/reference.d.ts +109 -0
  132. package/dist/models/reference.d.ts.map +1 -0
  133. package/dist/models/reference.js +12 -0
  134. package/dist/models/reference.js.map +1 -0
  135. package/package.json +82 -0
@@ -0,0 +1,168 @@
1
+ import { CertificateParam, CertificateResp } from "../models/certificates";
2
+ import { Organization, OrganizationList } from "../models/organization";
3
+ import { APIMode, CommonWellOptions } from "./common";
4
+ import { CommonWellBase } from "./commonwell-base";
5
+ import { BaseOptions, CommonWellMemberAPI, GetDirectoryParams } from "./commonwell-member-api";
6
+ /**
7
+ * Implementation of the CommonWell API, v4.
8
+ * @see https://www.commonwellalliance.org/specification/
9
+ *
10
+ * For the Organization management API (member API):
11
+ * @see https://commonwellalliance.sharepoint.com/sites/CommonWellServicesPlatform/SitePages/Organization-APIs.aspx
12
+ */
13
+ export declare class CommonWellMember extends CommonWellBase implements CommonWellMemberAPI {
14
+ static ORG_ENDPOINT: string;
15
+ static MEMBER_ENDPOINT: string;
16
+ private memberName;
17
+ private _memberId;
18
+ /**
19
+ * Creates a new instance of the CommonWell API client pertaining to an
20
+ * organization to make requests on behalf of.
21
+ *
22
+ * @param orgCert The certificate (public key) for the organization.
23
+ * @param rsaPrivateKey An RSA key corresponding to the specified orgCert.
24
+ * @param memberName The name of the member.
25
+ * @param memberId The ID of the member (not the OID).
26
+ * @param apiMode The mode the client will be running.
27
+ * @param options Optional parameters
28
+ * @param options.timeout Connection timeout in milliseconds, default 120 seconds.
29
+ */
30
+ constructor({ orgCert, rsaPrivateKey, memberName, memberId, apiMode, options, }: {
31
+ orgCert: string;
32
+ rsaPrivateKey: string;
33
+ memberName: string;
34
+ memberId: string;
35
+ apiMode: APIMode;
36
+ options?: CommonWellOptions;
37
+ });
38
+ get memberId(): string;
39
+ /**
40
+ * Lists organizations from the CommonWell Directory.
41
+ *
42
+ * @param params Optional parameters.
43
+ * @param params.orgName Optional, the name of the organization to fetch.
44
+ * @param params.orgId Optional, the ID of the organization to fetch.
45
+ * @param params.offset Optional, the offset of the organizations to fetch.
46
+ * @param params.limit Optional, the limit of the organizations to fetch.
47
+ * @param params.sort Optional, the sort of the organizations to fetch.
48
+ * @param options Optional parameters.
49
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
50
+ * @returns
51
+ */
52
+ listOrganizations(params?: GetDirectoryParams, options?: BaseOptions): Promise<OrganizationList>;
53
+ /**
54
+ * Create an org.
55
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#post-a-new-organization
56
+ *
57
+ * @param organization The org to create.
58
+ * @param options Optional parameters.
59
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
60
+ * @returns
61
+ */
62
+ createOrg(organization: Organization, options?: BaseOptions): Promise<Organization>;
63
+ /**
64
+ * Update an organization.
65
+ *
66
+ * @param organization The org to update.
67
+ * @param options Optional parameters.
68
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
69
+ * @returns
70
+ */
71
+ updateOrg(organization: Organization, options?: BaseOptions): Promise<Organization>;
72
+ /**
73
+ * Get list of orgs.
74
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-a-list-of-all-organizations
75
+ *
76
+ * @param summary Returns only summary data
77
+ * @param offset Sets an offset number from which recorded returns will begin
78
+ * @param limit Limits the number of returned records
79
+ * @param sort Specifies sort order
80
+ * @param options Optional parameters.
81
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
82
+ * @returns
83
+ */
84
+ getAllOrgs(summary?: boolean, offset?: number, limit?: number, sort?: string, options?: BaseOptions): Promise<OrganizationList>;
85
+ /**
86
+ * Get one org.
87
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-a-single-organization
88
+ *
89
+ * @param id The ID of the organization to be returned.
90
+ * @param options Optional parameters.
91
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
92
+ * @returns
93
+ */
94
+ getOneOrg(id: string, options?: BaseOptions): Promise<Organization | undefined>;
95
+ /**
96
+ * Add certificate to org.
97
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#post-new-certificates-to-organizations
98
+ *
99
+ * @param certificate The certificate to add to the org
100
+ * @param id The org to add a certificate to.
101
+ * @param options Optional parameters.
102
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
103
+ * @returns
104
+ */
105
+ addCertificateToOrg(certificate: CertificateParam, id: string, options?: BaseOptions): Promise<CertificateResp>;
106
+ /**
107
+ * Replace certificate for org.
108
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#put-a-list-of-certificates-into-an-organization
109
+ *
110
+ * @param certificate The certificate to replace for the org
111
+ * @param id The org to replace a certificate for.
112
+ * @param options Optional parameters.
113
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
114
+ * @returns
115
+ */
116
+ replaceCertificateForOrg(certificate: CertificateParam, id: string, options?: BaseOptions): Promise<CertificateResp>;
117
+ /**
118
+ * Delete certificate from org.
119
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#delete-certificates-by-thumbprint
120
+ *
121
+ * @param id The org to delete a certificate from.
122
+ * @param thumbprint The thumbprint from the certificate.
123
+ * @param purpose The purpose from the certificate.
124
+ * @param options Optional parameters.
125
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
126
+ * @returns a string with the message resulting from the deletion
127
+ */
128
+ deleteCertificateFromOrg(id: string, thumbprint: string, purpose: string, options?: BaseOptions): Promise<string>;
129
+ /**
130
+ * Get certificate from org.
131
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-certificates-for-an-organization
132
+ *
133
+ * @param id The org to get a certificate from
134
+ * @param thumbprint The thumbprint from the certificate
135
+ * @param purpose The purpose from the certificate
136
+ * @param options Optional parameters.
137
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
138
+ * @returns
139
+ */
140
+ getCertificatesFromOrg(id: string, thumbprint?: string, purpose?: string, options?: BaseOptions): Promise<CertificateResp>;
141
+ /**
142
+ * Get certificate from org (by thumbprint).
143
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-certificates-by-thumbprint
144
+ *
145
+ * @param id The org to get a certificate from
146
+ * @param thumbprint The thumbprint from the certificate
147
+ * @param purpose The purpose from the certificate
148
+ * @param options Optional parameters.
149
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
150
+ * @returns
151
+ */
152
+ getCertificatesFromOrgByThumbprint(id: string, thumbprint: string, purpose?: string, options?: BaseOptions): Promise<CertificateResp>;
153
+ /**
154
+ * Get certificate from org (by thumbprint & purpose).
155
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-certificates-by-thumbprint-and-purpose
156
+ *
157
+ * @param id The org to get a certificate from
158
+ * @param thumbprint The thumbprint from the certificate
159
+ * @param purpose The purpose from the certificate
160
+ * @param options Optional parameters.
161
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
162
+ * @returns
163
+ */
164
+ getCertificatesFromOrgByThumbprintAndPurpose(id: string, thumbprint: string, purpose: string, options?: BaseOptions): Promise<CertificateResp>;
165
+ private buildQueryHeaders;
166
+ private getDescriptiveError;
167
+ }
168
+ //# sourceMappingURL=commonwell-member.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonwell-member.d.ts","sourceRoot":"","sources":["../../src/client/commonwell-member.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAyB,MAAM,wBAAwB,CAAC;AAClG,OAAO,EACL,YAAY,EACZ,gBAAgB,EAGjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,cAAe,YAAW,mBAAmB;IACjF,MAAM,CAAC,YAAY,SAAa;IAChC,MAAM,CAAC,eAAe,SAAgB;IAEtC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;IAE1B;;;;;;;;;;;OAWG;gBACS,EACV,OAAO,EACP,aAAa,EACb,UAAU,EACV,QAAQ,EACR,OAAO,EACP,OAAY,GACb,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,iBAAiB,CAAC;KAC7B;IAWD,IAAI,QAAQ,WAEX;IAED;;;;;;;;;;;;OAYG;IACG,iBAAiB,CACrB,MAAM,GAAE,kBAAuB,EAC/B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,gBAAgB,CAAC;IAuC5B;;;;;;;;OAQG;IACG,SAAS,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YA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AChB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,eAAe,CAAC;IAa3B;;;;;;;;;;OAUG;IACG,4CAA4C,CAChD,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,eAAe,CAAC;IAY3B,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,mBAAmB;CAiB5B"}
@@ -0,0 +1,349 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CommonWellMember = void 0;
7
+ const shared_1 = require("@metriport/shared");
8
+ const axios_1 = require("axios");
9
+ const http_status_1 = __importDefault(require("http-status"));
10
+ const certificate_1 = require("../common/certificate");
11
+ const make_jwt_1 = require("../common/make-jwt");
12
+ const util_1 = require("../common/util");
13
+ const certificates_1 = require("../models/certificates");
14
+ const organization_1 = require("../models/organization");
15
+ const commonwell_base_1 = require("./commonwell-base");
16
+ /**
17
+ * Implementation of the CommonWell API, v4.
18
+ * @see https://www.commonwellalliance.org/specification/
19
+ *
20
+ * For the Organization management API (member API):
21
+ * @see https://commonwellalliance.sharepoint.com/sites/CommonWellServicesPlatform/SitePages/Organization-APIs.aspx
22
+ */
23
+ class CommonWellMember extends commonwell_base_1.CommonWellBase {
24
+ /**
25
+ * Creates a new instance of the CommonWell API client pertaining to an
26
+ * organization to make requests on behalf of.
27
+ *
28
+ * @param orgCert The certificate (public key) for the organization.
29
+ * @param rsaPrivateKey An RSA key corresponding to the specified orgCert.
30
+ * @param memberName The name of the member.
31
+ * @param memberId The ID of the member (not the OID).
32
+ * @param apiMode The mode the client will be running.
33
+ * @param options Optional parameters
34
+ * @param options.timeout Connection timeout in milliseconds, default 120 seconds.
35
+ */
36
+ constructor({ orgCert, rsaPrivateKey, memberName, memberId, apiMode, options = {}, }) {
37
+ super({
38
+ orgCert,
39
+ rsaPrivateKey,
40
+ apiMode,
41
+ options,
42
+ });
43
+ this.memberName = memberName;
44
+ this._memberId = memberId;
45
+ }
46
+ get memberId() {
47
+ return this._memberId;
48
+ }
49
+ /**
50
+ * Lists organizations from the CommonWell Directory.
51
+ *
52
+ * @param params Optional parameters.
53
+ * @param params.orgName Optional, the name of the organization to fetch.
54
+ * @param params.orgId Optional, the ID of the organization to fetch.
55
+ * @param params.offset Optional, the offset of the organizations to fetch.
56
+ * @param params.limit Optional, the limit of the organizations to fetch.
57
+ * @param params.sort Optional, the sort of the organizations to fetch.
58
+ * @param options Optional parameters.
59
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
60
+ * @returns
61
+ */
62
+ async listOrganizations(params = {}, options) {
63
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
64
+ const headers = this.buildQueryHeaders(meta);
65
+ if (params.limit && params.limit > 100) {
66
+ throw new shared_1.BadRequestError("Limit must be less than 100");
67
+ }
68
+ const query = new URLSearchParams();
69
+ if (params.orgName !== undefined)
70
+ query.append("orgName", params.orgName);
71
+ if (params.orgId !== undefined)
72
+ query.append("orgId", params.orgId);
73
+ if (params.offset !== undefined)
74
+ query.append("offset", params.offset.toString());
75
+ if (params.limit !== undefined)
76
+ query.append("limit", params.limit.toString());
77
+ if (params.sort !== undefined)
78
+ query.append("sort", params.sort);
79
+ const url = `${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/network/CommonWell?${query.toString()}`;
80
+ try {
81
+ const resp = await this.executeWithRetriesOn500IfEnabled(() => {
82
+ return this.api.get(url, {
83
+ headers,
84
+ });
85
+ });
86
+ return organization_1.organizationListSchema.parse(resp.data);
87
+ }
88
+ catch (error) {
89
+ if ((0, axios_1.isAxiosError)(error) && error.response?.status === http_status_1.default.NOT_FOUND) {
90
+ return { count: 0, from: 0, to: 0, organizations: [] };
91
+ }
92
+ throw this.getDescriptiveError(error, "Failed to get CW directory");
93
+ }
94
+ }
95
+ // TODO: #322 handle errors in API calls as per
96
+ // https://specification.commonwellalliance.org/services/rest-api-reference (8.6.1 Error)
97
+ // Note that also sometimes these calls 404 when things aren't found and etc
98
+ /**
99
+ * Create an org.
100
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#post-a-new-organization
101
+ *
102
+ * @param organization The org to create.
103
+ * @param options Optional parameters.
104
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
105
+ * @returns
106
+ */
107
+ async createOrg(organization, options) {
108
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
109
+ const headers = this.buildQueryHeaders(meta);
110
+ try {
111
+ const resp = await this.api.post(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org`, organization, {
112
+ headers,
113
+ });
114
+ return organization_1.organizationSchema.parse(resp.data);
115
+ }
116
+ catch (error) {
117
+ throw this.getDescriptiveError(error, "Failed to create CW organization");
118
+ }
119
+ }
120
+ /**
121
+ * Update an organization.
122
+ *
123
+ * @param organization The org to update.
124
+ * @param options Optional parameters.
125
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
126
+ * @returns
127
+ */
128
+ async updateOrg(organization, options) {
129
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
130
+ const headers = this.buildQueryHeaders(meta);
131
+ const id = organization.organizationId;
132
+ try {
133
+ const resp = await this.api.put(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/`, organization, {
134
+ headers,
135
+ });
136
+ return organization_1.organizationSchema.parse(resp.data);
137
+ }
138
+ catch (error) {
139
+ throw this.getDescriptiveError(error, "Failed to update CW organization");
140
+ }
141
+ }
142
+ /**
143
+ * Get list of orgs.
144
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-a-list-of-all-organizations
145
+ *
146
+ * @param summary Returns only summary data
147
+ * @param offset Sets an offset number from which recorded returns will begin
148
+ * @param limit Limits the number of returned records
149
+ * @param sort Specifies sort order
150
+ * @param options Optional parameters.
151
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
152
+ * @returns
153
+ */
154
+ async getAllOrgs(summary, offset, limit, sort, options) {
155
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
156
+ const headers = this.buildQueryHeaders(meta);
157
+ try {
158
+ const resp = await this.api.get(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org`, {
159
+ headers,
160
+ params: { summary, offset, limit, sort },
161
+ });
162
+ return organization_1.organizationListSchema.parse(resp.data);
163
+ }
164
+ catch (error) {
165
+ throw this.getDescriptiveError(error, "Failed to get CW organization list");
166
+ }
167
+ }
168
+ /**
169
+ * Get one org.
170
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-a-single-organization
171
+ *
172
+ * @param id The ID of the organization to be returned.
173
+ * @param options Optional parameters.
174
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
175
+ * @returns
176
+ */
177
+ async getOneOrg(id, options) {
178
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
179
+ const headers = this.buildQueryHeaders(meta);
180
+ const resp = await this.api.get(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/`, {
181
+ headers,
182
+ validateStatus: null, // don't throw on status code > 299
183
+ });
184
+ const status = resp.status;
185
+ if (status === http_status_1.default.NOT_FOUND)
186
+ return undefined;
187
+ if (http_status_1.default[`${status}_CLASS`] === http_status_1.default.classes.SUCCESSFUL) {
188
+ return organization_1.organizationSchema.parse(resp.data);
189
+ }
190
+ // TODO ENG-668 Revert to throwing error on non-404 unsuccessful status codes
191
+ return undefined;
192
+ // throw new MetriportError(`Failed to retrieve Organization`, status);
193
+ }
194
+ /**
195
+ * Add certificate to org.
196
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#post-new-certificates-to-organizations
197
+ *
198
+ * @param certificate The certificate to add to the org
199
+ * @param id The org to add a certificate to.
200
+ * @param options Optional parameters.
201
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
202
+ * @returns
203
+ */
204
+ async addCertificateToOrg(certificate, id, options) {
205
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
206
+ const headers = this.buildQueryHeaders(meta);
207
+ const normalizedCertificates = certificate.Certificates.map(certificate_1.normalizeCertificate);
208
+ const payload = {
209
+ ...certificate,
210
+ Certificates: normalizedCertificates,
211
+ };
212
+ const resp = await this.api.post(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/certificate`, payload, {
213
+ headers,
214
+ });
215
+ return certificates_1.certificateRespSchema.parse(resp.data);
216
+ }
217
+ /**
218
+ * Replace certificate for org.
219
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#put-a-list-of-certificates-into-an-organization
220
+ *
221
+ * @param certificate The certificate to replace for the org
222
+ * @param id The org to replace a certificate for.
223
+ * @param options Optional parameters.
224
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
225
+ * @returns
226
+ */
227
+ async replaceCertificateForOrg(certificate, id, options) {
228
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
229
+ const headers = this.buildQueryHeaders(meta);
230
+ const normalizedCertificates = certificate.Certificates.map(certificate_1.normalizeCertificate);
231
+ const payload = {
232
+ ...certificate,
233
+ Certificates: normalizedCertificates,
234
+ };
235
+ const resp = await this.api.put(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/certificate`, payload, {
236
+ headers,
237
+ });
238
+ return certificates_1.certificateRespSchema.parse(resp.data);
239
+ }
240
+ /**
241
+ * Delete certificate from org.
242
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#delete-certificates-by-thumbprint
243
+ *
244
+ * @param id The org to delete a certificate from.
245
+ * @param thumbprint The thumbprint from the certificate.
246
+ * @param purpose The purpose from the certificate.
247
+ * @param options Optional parameters.
248
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
249
+ * @returns a string with the message resulting from the deletion
250
+ */
251
+ async deleteCertificateFromOrg(id, thumbprint, purpose, options) {
252
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
253
+ const headers = this.buildQueryHeaders(meta);
254
+ const resp = await this.api.delete(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/certificate/${thumbprint}/purpose/${purpose}`, {
255
+ headers,
256
+ });
257
+ return resp.data;
258
+ }
259
+ /**
260
+ * Get certificate from org.
261
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-certificates-for-an-organization
262
+ *
263
+ * @param id The org to get a certificate from
264
+ * @param thumbprint The thumbprint from the certificate
265
+ * @param purpose The purpose from the certificate
266
+ * @param options Optional parameters.
267
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
268
+ * @returns
269
+ */
270
+ async getCertificatesFromOrg(id, thumbprint, purpose, options) {
271
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
272
+ const headers = this.buildQueryHeaders(meta);
273
+ const resp = await this.api.get(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/certificate`, {
274
+ headers,
275
+ params: { thumbprint, purpose },
276
+ });
277
+ return certificates_1.certificateRespSchema.parse(resp.data);
278
+ }
279
+ /**
280
+ * Get certificate from org (by thumbprint).
281
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-certificates-by-thumbprint
282
+ *
283
+ * @param id The org to get a certificate from
284
+ * @param thumbprint The thumbprint from the certificate
285
+ * @param purpose The purpose from the certificate
286
+ * @param options Optional parameters.
287
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
288
+ * @returns
289
+ */
290
+ async getCertificatesFromOrgByThumbprint(id, thumbprint, purpose, options) {
291
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
292
+ const headers = this.buildQueryHeaders(meta);
293
+ const resp = await this.api.get(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/certificate/${thumbprint}`, {
294
+ headers,
295
+ params: { purpose },
296
+ });
297
+ return certificates_1.certificateRespSchema.parse(resp.data);
298
+ }
299
+ /**
300
+ * Get certificate from org (by thumbprint & purpose).
301
+ * See: https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Organization-Management-API---Overview-and-Summary.aspx#get-certificates-by-thumbprint-and-purpose
302
+ *
303
+ * @param id The org to get a certificate from
304
+ * @param thumbprint The thumbprint from the certificate
305
+ * @param purpose The purpose from the certificate
306
+ * @param options Optional parameters.
307
+ * @param options.meta Metadata about the request. Defaults to the data used to initialize the client.
308
+ * @returns
309
+ */
310
+ async getCertificatesFromOrgByThumbprintAndPurpose(id, thumbprint, purpose, options) {
311
+ const meta = options?.meta ?? (0, util_1.buildBaseQueryMeta)(this.memberName);
312
+ const headers = this.buildQueryHeaders(meta);
313
+ const resp = await this.api.get(`${CommonWellMember.MEMBER_ENDPOINT}/${this.memberId}/org/${id}/certificate/${thumbprint}/purpose/${purpose}`, {
314
+ headers,
315
+ });
316
+ return certificates_1.certificateRespSchema.parse(resp.data);
317
+ }
318
+ buildQueryHeaders(meta) {
319
+ const jwt = (0, make_jwt_1.makeJwt)({
320
+ rsaPrivateKey: this.rsaPrivateKey,
321
+ role: meta.role,
322
+ subjectId: meta.subjectId,
323
+ orgName: this.memberName,
324
+ oid: this.memberId,
325
+ purposeOfUse: meta.purposeOfUse,
326
+ });
327
+ return { Authorization: `Bearer ${jwt}` };
328
+ }
329
+ getDescriptiveError(error, title) {
330
+ if ((0, axios_1.isAxiosError)(error)) {
331
+ const status = error.response?.status;
332
+ const data = error.response?.data;
333
+ const responseBody = data ? JSON.stringify(data) : undefined;
334
+ const cwReference = this.lastTransactionId;
335
+ if (status === http_status_1.default.BAD_REQUEST) {
336
+ return new shared_1.BadRequestError(title, error, { status, cwReference, responseBody });
337
+ }
338
+ if (status === http_status_1.default.NOT_FOUND) {
339
+ return new shared_1.NotFoundError(title, error, { status, cwReference, responseBody });
340
+ }
341
+ return new shared_1.MetriportError(title, error, { status, cwReference, responseBody });
342
+ }
343
+ return error instanceof Error ? error : new shared_1.MetriportError(title, error);
344
+ }
345
+ }
346
+ exports.CommonWellMember = CommonWellMember;
347
+ CommonWellMember.ORG_ENDPOINT = "/v1/org";
348
+ CommonWellMember.MEMBER_ENDPOINT = "/v1/member";
349
+ //# sourceMappingURL=commonwell-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonwell-member.js","sourceRoot":"","sources":["../../src/client/commonwell-member.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmF;AACnF,iCAAqC;AACrC,8DAAqC;AACrC,uDAA6D;AAC7D,iDAA6C;AAC7C,yCAAoD;AACpD,yDAAkG;AAClG,yDAKgC;AAEhC,uDAAmD;AAQnD;;;;;;GAMG;AACH,MAAa,gBAAiB,SAAQ,gCAAc;IAOlD;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,EACP,aAAa,EACb,UAAU,EACV,QAAQ,EACR,OAAO,EACP,OAAO,GAAG,EAAE,GAQb;QACC,KAAK,CAAC;YACJ,OAAO;YACP,aAAa;YACb,OAAO;YACP,OAAO;SACR,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;;;;;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