@opengovsg/refx-ts-sdk 0.0.0-develop-1759151439 → 0.0.0-develop-alpha-1762412839

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 (121) hide show
  1. package/README.md +18 -0
  2. package/api/resources/eligibility/client/Client.d.ts +3 -0
  3. package/api/resources/eligibility/client/Client.js +7 -10
  4. package/api/resources/eligibility/client/requests/EligibilityGetRequest.d.ts +8 -5
  5. package/api/resources/health/client/Client.js +1 -1
  6. package/api/resources/index.d.ts +2 -1
  7. package/api/resources/index.js +3 -2
  8. package/api/resources/links/client/Client.js +1 -1
  9. package/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +8 -0
  10. package/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +11 -0
  11. package/api/resources/links/types/CreateLinkReqUpsertClinicType.js +10 -0
  12. package/api/resources/links/types/index.d.ts +1 -0
  13. package/api/resources/links/types/index.js +1 -0
  14. package/api/resources/notes/client/Client.js +1 -1
  15. package/api/resources/offerings/client/Client.d.ts +6 -2
  16. package/api/resources/offerings/client/Client.js +13 -15
  17. package/api/resources/offerings/client/requests/OfferingsListRequest.d.ts +10 -6
  18. package/api/resources/public/client/Client.js +1 -1
  19. package/api/resources/referrals/client/Client.js +9 -9
  20. package/api/resources/referrals/client/requests/CreateReferralReq.d.ts +6 -0
  21. package/api/resources/referrals/index.d.ts +1 -0
  22. package/api/resources/referrals/index.js +1 -0
  23. package/api/resources/referrals/types/CreateReferralReqClinicType.d.ts +11 -0
  24. package/api/resources/referrals/types/CreateReferralReqClinicType.js +10 -0
  25. package/api/resources/referrals/types/index.d.ts +1 -0
  26. package/api/resources/referrals/types/index.js +17 -0
  27. package/api/resources/webhooks/client/Client.js +2 -2
  28. package/api/types/AdditionalReferralField.d.ts +2 -1
  29. package/api/types/AdditionalReferralField.js +1 -0
  30. package/api/types/AppointmentDto.d.ts +12 -0
  31. package/api/types/AppointmentDto.js +5 -0
  32. package/api/types/AppointmentDtoStatus.d.ts +11 -0
  33. package/api/types/AppointmentDtoStatus.js +13 -0
  34. package/api/types/CreatePatientReq.d.ts +2 -0
  35. package/api/types/FullReferralDto.d.ts +7 -0
  36. package/api/types/FullReferralDtoClinicType.d.ts +11 -0
  37. package/api/types/FullReferralDtoClinicType.js +10 -0
  38. package/api/types/GetReferralPatientDto.d.ts +2 -0
  39. package/api/types/PublicReferralDto.d.ts +6 -0
  40. package/api/types/PublicReferralDtoClinicType.d.ts +11 -0
  41. package/api/types/PublicReferralDtoClinicType.js +10 -0
  42. package/api/types/ReferralDto.d.ts +6 -0
  43. package/api/types/ReferralDtoClinicType.d.ts +11 -0
  44. package/api/types/ReferralDtoClinicType.js +10 -0
  45. package/api/types/ReferralLinkType.d.ts +2 -1
  46. package/api/types/ReferralLinkType.js +1 -0
  47. package/api/types/ReferrerIdType.d.ts +2 -1
  48. package/api/types/ReferrerIdType.js +1 -0
  49. package/api/types/UpdateEmailAckOfferingReq.d.ts +9 -0
  50. package/api/types/UpdateEmailAckOfferingReq.js +5 -0
  51. package/api/types/index.d.ts +6 -0
  52. package/api/types/index.js +6 -0
  53. package/browser/jsonwebtoken-stub.d.ts +5 -0
  54. package/browser/jsonwebtoken-stub.js +10 -0
  55. package/dist/api/resources/eligibility/client/Client.d.ts +3 -0
  56. package/dist/api/resources/eligibility/client/Client.js +7 -10
  57. package/dist/api/resources/eligibility/client/requests/EligibilityGetRequest.d.ts +8 -5
  58. package/dist/api/resources/health/client/Client.js +1 -1
  59. package/dist/api/resources/index.d.ts +2 -1
  60. package/dist/api/resources/index.js +3 -2
  61. package/dist/api/resources/links/client/Client.js +1 -1
  62. package/dist/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +8 -0
  63. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +11 -0
  64. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.js +10 -0
  65. package/dist/api/resources/links/types/index.d.ts +1 -0
  66. package/dist/api/resources/links/types/index.js +1 -0
  67. package/dist/api/resources/notes/client/Client.js +1 -1
  68. package/dist/api/resources/offerings/client/Client.d.ts +6 -2
  69. package/dist/api/resources/offerings/client/Client.js +13 -15
  70. package/dist/api/resources/offerings/client/requests/OfferingsListRequest.d.ts +10 -6
  71. package/dist/api/resources/public/client/Client.js +1 -1
  72. package/dist/api/resources/referrals/client/Client.js +9 -9
  73. package/dist/api/resources/referrals/client/requests/CreateReferralReq.d.ts +6 -0
  74. package/dist/api/resources/referrals/index.d.ts +1 -0
  75. package/dist/api/resources/referrals/index.js +1 -0
  76. package/dist/api/resources/referrals/types/CreateReferralReqClinicType.d.ts +11 -0
  77. package/dist/api/resources/referrals/types/CreateReferralReqClinicType.js +10 -0
  78. package/dist/api/resources/referrals/types/index.d.ts +1 -0
  79. package/dist/api/resources/referrals/types/index.js +17 -0
  80. package/dist/api/resources/webhooks/client/Client.js +2 -2
  81. package/dist/api/types/AdditionalReferralField.d.ts +2 -1
  82. package/dist/api/types/AdditionalReferralField.js +1 -0
  83. package/dist/api/types/AppointmentDto.d.ts +12 -0
  84. package/dist/api/types/AppointmentDto.js +5 -0
  85. package/dist/api/types/AppointmentDtoStatus.d.ts +11 -0
  86. package/dist/api/types/AppointmentDtoStatus.js +13 -0
  87. package/dist/api/types/CreatePatientReq.d.ts +2 -0
  88. package/dist/api/types/FullReferralDto.d.ts +7 -0
  89. package/dist/api/types/FullReferralDtoClinicType.d.ts +11 -0
  90. package/dist/api/types/FullReferralDtoClinicType.js +10 -0
  91. package/dist/api/types/GetReferralPatientDto.d.ts +2 -0
  92. package/dist/api/types/PublicReferralDto.d.ts +6 -0
  93. package/dist/api/types/PublicReferralDtoClinicType.d.ts +11 -0
  94. package/dist/api/types/PublicReferralDtoClinicType.js +10 -0
  95. package/dist/api/types/ReferralDto.d.ts +6 -0
  96. package/dist/api/types/ReferralDtoClinicType.d.ts +11 -0
  97. package/dist/api/types/ReferralDtoClinicType.js +10 -0
  98. package/dist/api/types/ReferralLinkType.d.ts +2 -1
  99. package/dist/api/types/ReferralLinkType.js +1 -0
  100. package/dist/api/types/ReferrerIdType.d.ts +2 -1
  101. package/dist/api/types/ReferrerIdType.js +1 -0
  102. package/dist/api/types/UpdateEmailAckOfferingReq.d.ts +9 -0
  103. package/dist/api/types/UpdateEmailAckOfferingReq.js +5 -0
  104. package/dist/api/types/index.d.ts +6 -0
  105. package/dist/api/types/index.js +6 -0
  106. package/dist/browser/jsonwebtoken-stub.d.ts +5 -0
  107. package/dist/browser/jsonwebtoken-stub.js +10 -0
  108. package/dist/index.d.ts +1 -0
  109. package/dist/index.js +3 -1
  110. package/dist/version.d.ts +1 -1
  111. package/dist/version.js +1 -1
  112. package/dist/wrapper/ReferralExchangeJwtClient.d.ts +10 -0
  113. package/dist/wrapper/ReferralExchangeJwtClient.js +81 -0
  114. package/index.d.ts +1 -0
  115. package/index.js +3 -1
  116. package/package.json +6 -2
  117. package/reference.md +8 -1
  118. package/version.d.ts +1 -1
  119. package/version.js +1 -1
  120. package/wrapper/ReferralExchangeJwtClient.d.ts +10 -0
  121. package/wrapper/ReferralExchangeJwtClient.js +81 -0
package/README.md CHANGED
@@ -165,6 +165,24 @@ const client = new ReferralExchangeClient({
165
165
  });
166
166
  ```
167
167
 
168
+ ### JWT Authenticated Client
169
+
170
+ If you need to authenticate requests by signing short-lived JWTs locally, use the `ReferralExchangeJwtClient`. It
171
+ accepts a PEM-encoded ES256 private key and the API key name to embed as the issuer claim. Each request automatically
172
+ receives a freshly signed token (15 second TTL) in the `Authorization` header.
173
+
174
+ ```typescript
175
+ import { ReferralExchangeJwtClient } from "@opengovsg/refx-ts-sdk";
176
+
177
+ const client = new ReferralExchangeJwtClient({
178
+ privateKey: process.env.REFX_PRIVATE_KEY!,
179
+ apiKeyName: process.env.REFX_API_KEY_NAME!,
180
+ environment: "Production", // or pass baseUrl
181
+ });
182
+
183
+ const offerings = await client.offerings.list();
184
+ ```
185
+
168
186
  ## Contributing
169
187
 
170
188
  While we value open-source contributions to this SDK, this library is generated programmatically.
@@ -34,6 +34,9 @@ export declare class Eligibility {
34
34
  *
35
35
  * @example
36
36
  * await client.eligibility.get({
37
+ * referrerId: "referrerId",
38
+ * referrerIdType: "mcr",
39
+ * referrerInstitutionId: "referrerInstitutionId",
37
40
  * uin: "uin",
38
41
  * offeringId: "offeringId"
39
42
  * })
@@ -66,6 +66,9 @@ class Eligibility {
66
66
  *
67
67
  * @example
68
68
  * await client.eligibility.get({
69
+ * referrerId: "referrerId",
70
+ * referrerIdType: "mcr",
71
+ * referrerInstitutionId: "referrerInstitutionId",
69
72
  * uin: "uin",
70
73
  * offeringId: "offeringId"
71
74
  * })
@@ -75,15 +78,9 @@ class Eligibility {
75
78
  var _a, _b, _c;
76
79
  const { referrerId, referrerIdType, referrerInstitutionId, patientPostalCode, uin, offeringId } = request;
77
80
  const _queryParams = {};
78
- if (referrerId != null) {
79
- _queryParams["referrerId"] = referrerId;
80
- }
81
- if (referrerIdType != null) {
82
- _queryParams["referrerIdType"] = referrerIdType;
83
- }
84
- if (referrerInstitutionId != null) {
85
- _queryParams["referrerInstitutionId"] = referrerInstitutionId;
86
- }
81
+ _queryParams["referrerId"] = referrerId;
82
+ _queryParams["referrerIdType"] = referrerIdType;
83
+ _queryParams["referrerInstitutionId"] = referrerInstitutionId;
87
84
  if (patientPostalCode != null) {
88
85
  _queryParams["patientPostalCode"] = patientPostalCode;
89
86
  }
@@ -92,7 +89,7 @@ class Eligibility {
92
89
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
93
90
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/eligibility"),
94
91
  method: "GET",
95
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
96
93
  contentType: "application/json",
97
94
  queryParameters: _queryParams,
98
95
  requestType: "json",
@@ -5,20 +5,23 @@ import * as ReferralExchange from "../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {
8
+ * referrerId: "referrerId",
9
+ * referrerIdType: "mcr",
10
+ * referrerInstitutionId: "referrerInstitutionId",
8
11
  * uin: "uin",
9
12
  * offeringId: "offeringId"
10
13
  * }
11
14
  */
12
15
  export interface EligibilityGetRequest {
13
16
  /**
14
- * ID of the referring individual. Use together with `referralIdType` and `referrerInstitutionId` to filter based on referrer.
17
+ * ID of the referring individual.
15
18
  */
16
- referrerId?: string;
17
- referrerIdType?: ReferralExchange.ReferrerIdType;
19
+ referrerId: string;
20
+ referrerIdType: ReferralExchange.ReferrerIdType;
18
21
  /**
19
- * ID of the referring institution. Use together with `referrerId` and `referrerIdType` to filter based on referrer.
22
+ * ID of the referring institution.
20
23
  */
21
- referrerInstitutionId?: string;
24
+ referrerInstitutionId: string;
22
25
  /**
23
26
  * Postal code of the patient
24
27
  */
@@ -69,7 +69,7 @@ class Health {
69
69
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
70
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/health"),
71
71
  method: "GET",
72
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
72
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
73
73
  contentType: "application/json",
74
74
  requestType: "json",
75
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -1,7 +1,8 @@
1
+ export * as referrals from "./referrals";
2
+ export * from "./referrals/types";
1
3
  export * as links from "./links";
2
4
  export * from "./links/types";
3
5
  export * as eligibility from "./eligibility";
4
- export * as referrals from "./referrals";
5
6
  export * as notes from "./notes";
6
7
  export * as offerings from "./offerings";
7
8
  export * as public_ from "./public";
@@ -36,11 +36,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.notes = exports.referrals = exports.eligibility = exports.links = void 0;
39
+ exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.notes = exports.eligibility = exports.links = exports.referrals = void 0;
40
+ exports.referrals = __importStar(require("./referrals"));
41
+ __exportStar(require("./referrals/types"), exports);
40
42
  exports.links = __importStar(require("./links"));
41
43
  __exportStar(require("./links/types"), exports);
42
44
  exports.eligibility = __importStar(require("./eligibility"));
43
- exports.referrals = __importStar(require("./referrals"));
44
45
  exports.notes = __importStar(require("./notes"));
45
46
  exports.offerings = __importStar(require("./offerings"));
46
47
  exports.public_ = __importStar(require("./public"));
@@ -79,7 +79,7 @@ class Links {
79
79
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
80
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/links/upsert"),
81
81
  method: "POST",
82
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  body: request,
@@ -39,4 +39,12 @@ export interface CreateLinkReqUpsert {
39
39
  address?: ReferralExchange.CreateAddressReq;
40
40
  /** Patient residential status */
41
41
  residentialStatus?: ReferralExchange.CreateLinkReqUpsertResidentialStatus;
42
+ /** Patient Healthier SG (HSG) enrolment status */
43
+ isPatientHsgEnrolled?: boolean;
44
+ /** Clinic license number */
45
+ clinicLicenseNumber?: string;
46
+ /** Clinic type */
47
+ clinicType?: ReferralExchange.CreateLinkReqUpsertClinicType;
48
+ /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
49
+ clinicalInfo?: string;
42
50
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Clinic type
6
+ */
7
+ export type CreateLinkReqUpsertClinicType = "CHAS-only" | "CHAS and HSG";
8
+ export declare const CreateLinkReqUpsertClinicType: {
9
+ readonly ChasOnly: "CHAS-only";
10
+ readonly ChasAndHsg: "CHAS and HSG";
11
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CreateLinkReqUpsertClinicType = void 0;
7
+ exports.CreateLinkReqUpsertClinicType = {
8
+ ChasOnly: "CHAS-only",
9
+ ChasAndHsg: "CHAS and HSG",
10
+ };
@@ -1,2 +1,3 @@
1
1
  export * from "./CreateLinkReqUpsertPatientGender";
2
2
  export * from "./CreateLinkReqUpsertResidentialStatus";
3
+ export * from "./CreateLinkReqUpsertClinicType";
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CreateLinkReqUpsertPatientGender"), exports);
18
18
  __exportStar(require("./CreateLinkReqUpsertResidentialStatus"), exports);
19
+ __exportStar(require("./CreateLinkReqUpsertClinicType"), exports);
@@ -76,7 +76,7 @@ class Notes {
76
76
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
77
77
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/notes`),
78
78
  method: "POST",
79
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
79
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
80
80
  contentType: "application/json",
81
81
  requestType: "json",
82
82
  body: request,
@@ -33,9 +33,13 @@ export declare class Offerings {
33
33
  * @throws {@link ReferralExchange.UnauthorizedError}
34
34
  *
35
35
  * @example
36
- * await client.offerings.list()
36
+ * await client.offerings.list({
37
+ * referrerId: "referrerId",
38
+ * referrerIdType: "mcr",
39
+ * referrerInstitutionId: "referrerInstitutionId"
40
+ * })
37
41
  */
38
- list(request?: ReferralExchange.OfferingsListRequest, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingWithAllowedDto[]>;
42
+ list(request: ReferralExchange.OfferingsListRequest, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingWithAllowedDto[]>;
39
43
  /**
40
44
  * @param {ReferralExchange.ApiHoldingControllerGetRecommendedOfferingRequest} request
41
45
  * @param {Offerings.RequestOptions} requestOptions - Request-specific configuration.
@@ -65,29 +65,27 @@ class Offerings {
65
65
  * @throws {@link ReferralExchange.UnauthorizedError}
66
66
  *
67
67
  * @example
68
- * await client.offerings.list()
68
+ * await client.offerings.list({
69
+ * referrerId: "referrerId",
70
+ * referrerIdType: "mcr",
71
+ * referrerInstitutionId: "referrerInstitutionId"
72
+ * })
69
73
  */
70
- list() {
71
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
+ list(request, requestOptions) {
75
+ return __awaiter(this, void 0, void 0, function* () {
72
76
  var _a, _b, _c;
73
77
  const { referrerId, referrerIdType, referrerInstitutionId, patientPostalCode } = request;
74
78
  const _queryParams = {};
75
- if (referrerId != null) {
76
- _queryParams["referrerId"] = referrerId;
77
- }
78
- if (referrerIdType != null) {
79
- _queryParams["referrerIdType"] = referrerIdType;
80
- }
81
- if (referrerInstitutionId != null) {
82
- _queryParams["referrerInstitutionId"] = referrerInstitutionId;
83
- }
79
+ _queryParams["referrerId"] = referrerId;
80
+ _queryParams["referrerIdType"] = referrerIdType;
81
+ _queryParams["referrerInstitutionId"] = referrerInstitutionId;
84
82
  if (patientPostalCode != null) {
85
83
  _queryParams["patientPostalCode"] = patientPostalCode;
86
84
  }
87
85
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
88
86
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/offerings"),
89
87
  method: "GET",
90
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
89
  contentType: "application/json",
92
90
  queryParameters: _queryParams,
93
91
  requestType: "json",
@@ -146,7 +144,7 @@ class Offerings {
146
144
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
147
145
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/offerings/recommended"),
148
146
  method: "GET",
149
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
147
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
150
148
  contentType: "application/json",
151
149
  queryParameters: _queryParams,
152
150
  requestType: "json",
@@ -209,7 +207,7 @@ class Offerings {
209
207
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
210
208
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/offerings/${encodeURIComponent(offeringId)}/timeslots`),
211
209
  method: "GET",
212
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
210
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
211
  contentType: "application/json",
214
212
  queryParameters: _queryParams,
215
213
  requestType: "json",
@@ -4,18 +4,22 @@
4
4
  import * as ReferralExchange from "../../../../index";
5
5
  /**
6
6
  * @example
7
- * {}
7
+ * {
8
+ * referrerId: "referrerId",
9
+ * referrerIdType: "mcr",
10
+ * referrerInstitutionId: "referrerInstitutionId"
11
+ * }
8
12
  */
9
13
  export interface OfferingsListRequest {
10
14
  /**
11
- * ID of the referring individual. Use together with `referralIdType` and `referrerInstitutionId` to filter based on referrer.
15
+ * ID of the referring individual.
12
16
  */
13
- referrerId?: string;
14
- referrerIdType?: ReferralExchange.ReferrerIdType;
17
+ referrerId: string;
18
+ referrerIdType: ReferralExchange.ReferrerIdType;
15
19
  /**
16
- * ID of the referring institution. Use together with `referrerId` and `referrerIdType` to filter based on referrer.
20
+ * ID of the referring institution.
17
21
  */
18
- referrerInstitutionId?: string;
22
+ referrerInstitutionId: string;
19
23
  /**
20
24
  * Postal code of the patient
21
25
  */
@@ -84,7 +84,7 @@ class Public {
84
84
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
85
85
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/public/referrals/${encodeURIComponent(referralId)}`),
86
86
  method: "GET",
87
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
88
  contentType: "application/json",
89
89
  queryParameters: _queryParams,
90
90
  requestType: "json",
@@ -107,7 +107,7 @@ class Referrals {
107
107
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
108
108
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/referrals"),
109
109
  method: "GET",
110
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
110
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
111
111
  contentType: "application/json",
112
112
  queryParameters: _queryParams,
113
113
  requestType: "json",
@@ -183,7 +183,7 @@ class Referrals {
183
183
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
184
184
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/referrals"),
185
185
  method: "POST",
186
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
186
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
187
187
  contentType: "application/json",
188
188
  requestType: "json",
189
189
  body: request,
@@ -249,7 +249,7 @@ class Referrals {
249
249
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
250
250
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}`),
251
251
  method: "GET",
252
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
252
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
253
253
  contentType: "application/json",
254
254
  queryParameters: _queryParams,
255
255
  requestType: "json",
@@ -303,7 +303,7 @@ class Referrals {
303
303
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
304
304
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}`),
305
305
  method: "DELETE",
306
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
306
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
307
307
  contentType: "application/json",
308
308
  requestType: "json",
309
309
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -355,7 +355,7 @@ class Referrals {
355
355
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
356
356
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/cancel`),
357
357
  method: "POST",
358
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
358
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
359
359
  contentType: "application/json",
360
360
  requestType: "json",
361
361
  body: request,
@@ -410,7 +410,7 @@ class Referrals {
410
410
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
411
411
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/amend`),
412
412
  method: "POST",
413
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
413
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
414
414
  contentType: "application/json",
415
415
  requestType: "json",
416
416
  body: request,
@@ -463,7 +463,7 @@ class Referrals {
463
463
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
464
464
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/accept`),
465
465
  method: "POST",
466
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
466
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
467
467
  contentType: "application/json",
468
468
  requestType: "json",
469
469
  body: request,
@@ -518,7 +518,7 @@ class Referrals {
518
518
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
519
519
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/reject`),
520
520
  method: "POST",
521
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
521
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
522
522
  contentType: "application/json",
523
523
  requestType: "json",
524
524
  body: request,
@@ -570,7 +570,7 @@ class Referrals {
570
570
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
571
571
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/back-to-draft`),
572
572
  method: "POST",
573
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
573
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
574
574
  contentType: "application/json",
575
575
  requestType: "json",
576
576
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -55,4 +55,10 @@ export interface CreateReferralReq {
55
55
  timeslotStartAt?: number;
56
56
  /** Form responses */
57
57
  formResponses: ReferralExchange.FormResponse[];
58
+ /** Clinic license number */
59
+ clinicLicenseNumber?: string;
60
+ /** Clinic type */
61
+ clinicType?: ReferralExchange.CreateReferralReqClinicType;
62
+ /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
63
+ clinicalInfo?: string;
58
64
  }
@@ -1 +1,2 @@
1
+ export * from "./types";
1
2
  export * from "./client";
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
17
18
  __exportStar(require("./client"), exports);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Clinic type
6
+ */
7
+ export type CreateReferralReqClinicType = "CHAS-only" | "CHAS and HSG";
8
+ export declare const CreateReferralReqClinicType: {
9
+ readonly ChasOnly: "CHAS-only";
10
+ readonly ChasAndHsg: "CHAS and HSG";
11
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CreateReferralReqClinicType = void 0;
7
+ exports.CreateReferralReqClinicType = {
8
+ ChasOnly: "CHAS-only",
9
+ ChasAndHsg: "CHAS and HSG",
10
+ };
@@ -0,0 +1 @@
1
+ export * from "./CreateReferralReqClinicType";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CreateReferralReqClinicType"), exports);
@@ -69,7 +69,7 @@ class Webhooks {
69
69
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
70
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/webhooks/formsg/singhealth-profile"),
71
71
  method: "POST",
72
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
72
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
73
73
  contentType: "application/json",
74
74
  requestType: "json",
75
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -113,7 +113,7 @@ class Webhooks {
113
113
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
114
114
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/webhooks/formsg/form-submission/${encodeURIComponent(formId)}`),
115
115
  method: "POST",
116
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
116
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
117
117
  contentType: "application/json",
118
118
  requestType: "json",
119
119
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type AdditionalReferralField = "attachments" | "url" | "link";
4
+ export type AdditionalReferralField = "attachments" | "url" | "link" | "appointments";
5
5
  export declare const AdditionalReferralField: {
6
6
  readonly Attachments: "attachments";
7
7
  readonly Url: "url";
8
8
  readonly Link: "link";
9
+ readonly Appointments: "appointments";
9
10
  };
@@ -8,4 +8,5 @@ exports.AdditionalReferralField = {
8
8
  Attachments: "attachments",
9
9
  Url: "url",
10
10
  Link: "link",
11
+ Appointments: "appointments",
11
12
  };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as ReferralExchange from "../index";
5
+ export interface AppointmentDto {
6
+ status: ReferralExchange.AppointmentDtoStatus;
7
+ institutionName?: string;
8
+ specialtyName?: string;
9
+ subSpecialtyName?: string;
10
+ visitDateTime: string;
11
+ isDischarged: boolean;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type AppointmentDtoStatus = "booked" | "actualized" | "noShow" | "cancelled" | "unknown";
5
+ export declare const AppointmentDtoStatus: {
6
+ readonly Booked: "booked";
7
+ readonly Actualized: "actualized";
8
+ readonly NoShow: "noShow";
9
+ readonly Cancelled: "cancelled";
10
+ readonly Unknown: "unknown";
11
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AppointmentDtoStatus = void 0;
7
+ exports.AppointmentDtoStatus = {
8
+ Booked: "booked",
9
+ Actualized: "actualized",
10
+ NoShow: "noShow",
11
+ Cancelled: "cancelled",
12
+ Unknown: "unknown",
13
+ };
@@ -16,4 +16,6 @@ export interface CreatePatientReq {
16
16
  address?: ReferralExchange.CreateAddressReq;
17
17
  /** Patient residential status */
18
18
  residentialStatus?: ReferralExchange.CreatePatientReqResidentialStatus;
19
+ /** Patient Healthier SG (HSG) enrolment status */
20
+ isHsgEnrolled?: boolean;
19
21
  }