@opengovsg/refx-ts-sdk 0.0.0-develop-alpha-1763535866 → 0.0.0-develop-alpha-1764841391

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 (40) hide show
  1. package/api/resources/eligibility/client/Client.js +1 -1
  2. package/api/resources/health/client/Client.js +1 -1
  3. package/api/resources/links/client/Client.js +1 -1
  4. package/api/resources/notes/client/Client.js +1 -1
  5. package/api/resources/offerings/client/Client.js +3 -3
  6. package/api/resources/public/client/Client.js +1 -1
  7. package/api/resources/referrals/client/Client.d.ts +12 -0
  8. package/api/resources/referrals/client/Client.js +98 -16
  9. package/api/resources/referrals/client/requests/ReferralsListByInstitutionRequest.d.ts +35 -0
  10. package/api/resources/referrals/client/requests/ReferralsListByInstitutionRequest.js +5 -0
  11. package/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +8 -8
  12. package/api/resources/referrals/client/requests/index.d.ts +1 -0
  13. package/api/resources/webhooks/client/Client.js +2 -2
  14. package/api/types/InstitutionIdType.d.ts +4 -0
  15. package/api/types/InstitutionIdType.js +5 -0
  16. package/api/types/index.d.ts +1 -0
  17. package/api/types/index.js +1 -0
  18. package/dist/api/resources/eligibility/client/Client.js +1 -1
  19. package/dist/api/resources/health/client/Client.js +1 -1
  20. package/dist/api/resources/links/client/Client.js +1 -1
  21. package/dist/api/resources/notes/client/Client.js +1 -1
  22. package/dist/api/resources/offerings/client/Client.js +3 -3
  23. package/dist/api/resources/public/client/Client.js +1 -1
  24. package/dist/api/resources/referrals/client/Client.d.ts +12 -0
  25. package/dist/api/resources/referrals/client/Client.js +98 -16
  26. package/dist/api/resources/referrals/client/requests/ReferralsListByInstitutionRequest.d.ts +35 -0
  27. package/dist/api/resources/referrals/client/requests/ReferralsListByInstitutionRequest.js +5 -0
  28. package/dist/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +8 -8
  29. package/dist/api/resources/referrals/client/requests/index.d.ts +1 -0
  30. package/dist/api/resources/webhooks/client/Client.js +2 -2
  31. package/dist/api/types/InstitutionIdType.d.ts +4 -0
  32. package/dist/api/types/InstitutionIdType.js +5 -0
  33. package/dist/api/types/index.d.ts +1 -0
  34. package/dist/api/types/index.js +1 -0
  35. package/dist/version.d.ts +1 -1
  36. package/dist/version.js +1 -1
  37. package/package.json +1 -1
  38. package/reference.md +64 -0
  39. package/version.d.ts +1 -1
  40. package/version.js +1 -1
@@ -89,7 +89,7 @@ class Eligibility {
89
89
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
90
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"),
91
91
  method: "GET",
92
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
93
93
  contentType: "application/json",
94
94
  queryParameters: _queryParams,
95
95
  requestType: "json",
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -85,7 +85,7 @@ class Offerings {
85
85
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
86
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"),
87
87
  method: "GET",
88
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
89
89
  contentType: "application/json",
90
90
  queryParameters: _queryParams,
91
91
  requestType: "json",
@@ -144,7 +144,7 @@ class Offerings {
144
144
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
145
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"),
146
146
  method: "GET",
147
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
148
148
  contentType: "application/json",
149
149
  queryParameters: _queryParams,
150
150
  requestType: "json",
@@ -207,7 +207,7 @@ class Offerings {
207
207
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
208
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`),
209
209
  method: "GET",
210
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
211
211
  contentType: "application/json",
212
212
  queryParameters: _queryParams,
213
213
  requestType: "json",
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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",
@@ -70,6 +70,18 @@ export declare class Referrals {
70
70
  * })
71
71
  */
72
72
  upsert(request: ReferralExchange.CreateReferralReq, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
73
+ /**
74
+ * @param {ReferralExchange.InstitutionIdType} institutionIdType - The type of institution ID
75
+ * @param {string} institutionId - The institution ID
76
+ * @param {ReferralExchange.ReferralsListByInstitutionRequest} request
77
+ * @param {Referrals.RequestOptions} requestOptions - Request-specific configuration.
78
+ *
79
+ * @throws {@link ReferralExchange.UnauthorizedError}
80
+ *
81
+ * @example
82
+ * await client.referrals.listByInstitution("hci", "institutionId")
83
+ */
84
+ listByInstitution(institutionIdType: ReferralExchange.InstitutionIdType, institutionId: string, request?: ReferralExchange.ReferralsListByInstitutionRequest, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.PaginatedReferralsDto>;
73
85
  /**
74
86
  * @param {string} referralId - Referral ID
75
87
  * @param {ReferralExchange.ReferralsGetRequest} request
@@ -70,7 +70,7 @@ class Referrals {
70
70
  list() {
71
71
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
72
72
  var _a, _b, _c;
73
- const { offset, pageSize, hciCode, status, role, referrerId, referrerIdType, institutionId, patientUin } = request;
73
+ const { offset, pageSize, status, role, referrerId, referrerIdType, patientUin, hciCode, institutionId } = request;
74
74
  const _queryParams = {};
75
75
  if (offset != null) {
76
76
  _queryParams["offset"] = offset.toString();
@@ -78,9 +78,6 @@ class Referrals {
78
78
  if (pageSize != null) {
79
79
  _queryParams["pageSize"] = pageSize.toString();
80
80
  }
81
- if (hciCode != null) {
82
- _queryParams["hciCode"] = hciCode;
83
- }
84
81
  if (status != null) {
85
82
  if (Array.isArray(status)) {
86
83
  _queryParams["status"] = status.map((item) => item);
@@ -98,16 +95,19 @@ class Referrals {
98
95
  if (referrerIdType != null) {
99
96
  _queryParams["referrerIdType"] = referrerIdType;
100
97
  }
101
- if (institutionId != null) {
102
- _queryParams["institutionId"] = institutionId;
103
- }
104
98
  if (patientUin != null) {
105
99
  _queryParams["patientUin"] = patientUin;
106
100
  }
101
+ if (hciCode != null) {
102
+ _queryParams["hciCode"] = hciCode;
103
+ }
104
+ if (institutionId != null) {
105
+ _queryParams["institutionId"] = institutionId;
106
+ }
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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -222,6 +222,88 @@ class Referrals {
222
222
  }
223
223
  });
224
224
  }
225
+ /**
226
+ * @param {ReferralExchange.InstitutionIdType} institutionIdType - The type of institution ID
227
+ * @param {string} institutionId - The institution ID
228
+ * @param {ReferralExchange.ReferralsListByInstitutionRequest} request
229
+ * @param {Referrals.RequestOptions} requestOptions - Request-specific configuration.
230
+ *
231
+ * @throws {@link ReferralExchange.UnauthorizedError}
232
+ *
233
+ * @example
234
+ * await client.referrals.listByInstitution("hci", "institutionId")
235
+ */
236
+ listByInstitution(institutionIdType_1, institutionId_1) {
237
+ return __awaiter(this, arguments, void 0, function* (institutionIdType, institutionId, request = {}, requestOptions) {
238
+ var _a, _b, _c;
239
+ const { offset, pageSize, status, role, referrerId, referrerIdType, patientUin } = request;
240
+ const _queryParams = {};
241
+ if (offset != null) {
242
+ _queryParams["offset"] = offset.toString();
243
+ }
244
+ if (pageSize != null) {
245
+ _queryParams["pageSize"] = pageSize.toString();
246
+ }
247
+ if (status != null) {
248
+ if (Array.isArray(status)) {
249
+ _queryParams["status"] = status.map((item) => item);
250
+ }
251
+ else {
252
+ _queryParams["status"] = status;
253
+ }
254
+ }
255
+ if (role != null) {
256
+ _queryParams["role"] = role;
257
+ }
258
+ if (referrerId != null) {
259
+ _queryParams["referrerId"] = referrerId;
260
+ }
261
+ if (referrerIdType != null) {
262
+ _queryParams["referrerIdType"] = referrerIdType;
263
+ }
264
+ if (patientUin != null) {
265
+ _queryParams["patientUin"] = patientUin;
266
+ }
267
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
268
+ 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/institutions/${encodeURIComponent(institutionIdType)}/${encodeURIComponent(institutionId)}/referrals`),
269
+ method: "GET",
270
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
271
+ contentType: "application/json",
272
+ queryParameters: _queryParams,
273
+ requestType: "json",
274
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
275
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
276
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
277
+ });
278
+ if (_response.ok) {
279
+ return _response.body;
280
+ }
281
+ if (_response.error.reason === "status-code") {
282
+ switch (_response.error.statusCode) {
283
+ case 401:
284
+ throw new ReferralExchange.UnauthorizedError(_response.error.body);
285
+ default:
286
+ throw new errors.ReferralExchangeError({
287
+ statusCode: _response.error.statusCode,
288
+ body: _response.error.body,
289
+ });
290
+ }
291
+ }
292
+ switch (_response.error.reason) {
293
+ case "non-json":
294
+ throw new errors.ReferralExchangeError({
295
+ statusCode: _response.error.statusCode,
296
+ body: _response.error.rawBody,
297
+ });
298
+ case "timeout":
299
+ throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling GET /api/v1/institutions/{institutionIdType}/{institutionId}/referrals.");
300
+ case "unknown":
301
+ throw new errors.ReferralExchangeError({
302
+ message: _response.error.errorMessage,
303
+ });
304
+ }
305
+ });
306
+ }
225
307
  /**
226
308
  * @param {string} referralId - Referral ID
227
309
  * @param {ReferralExchange.ReferralsGetRequest} request
@@ -249,7 +331,7 @@ class Referrals {
249
331
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
250
332
  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
333
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
334
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
335
  contentType: "application/json",
254
336
  queryParameters: _queryParams,
255
337
  requestType: "json",
@@ -303,7 +385,7 @@ class Referrals {
303
385
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
304
386
  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
387
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
388
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
389
  contentType: "application/json",
308
390
  requestType: "json",
309
391
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -355,7 +437,7 @@ class Referrals {
355
437
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
356
438
  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
439
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
440
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
441
  contentType: "application/json",
360
442
  requestType: "json",
361
443
  body: request,
@@ -410,7 +492,7 @@ class Referrals {
410
492
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
411
493
  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
494
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
495
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
496
  contentType: "application/json",
415
497
  requestType: "json",
416
498
  body: request,
@@ -463,7 +545,7 @@ class Referrals {
463
545
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
464
546
  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
547
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
548
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
549
  contentType: "application/json",
468
550
  requestType: "json",
469
551
  body: request,
@@ -518,7 +600,7 @@ class Referrals {
518
600
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
519
601
  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
602
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
603
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
604
  contentType: "application/json",
523
605
  requestType: "json",
524
606
  body: request,
@@ -570,7 +652,7 @@ class Referrals {
570
652
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
571
653
  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
654
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
655
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
656
  contentType: "application/json",
575
657
  requestType: "json",
576
658
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,35 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as ReferralExchange from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface ReferralsListByInstitutionRequest {
10
+ /**
11
+ * Offset for pagination
12
+ */
13
+ offset?: number;
14
+ /**
15
+ * Number of items per page
16
+ */
17
+ pageSize?: number;
18
+ status?: ReferralExchange.ReferralStatusFilter | ReferralExchange.ReferralStatusFilter[];
19
+ /**
20
+ * To filter by the institution's role in the referral. e.g. For outbound referrals, use "sender'
21
+ */
22
+ role?: ReferralExchange.ReferralRole;
23
+ /**
24
+ * To filter by the referrer ID
25
+ */
26
+ referrerId?: string;
27
+ /**
28
+ * Type of ID specified in referrerId. Use together with `referrerId` to filter based on referrer.
29
+ */
30
+ referrerIdType?: ReferralExchange.ReferrerIdType;
31
+ /**
32
+ * To filter by the patient UIN
33
+ */
34
+ patientUin?: string;
35
+ }
@@ -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 });
@@ -15,10 +15,6 @@ export interface ReferralsListRequest {
15
15
  * Number of items per page
16
16
  */
17
17
  pageSize?: number;
18
- /**
19
- * To identify the requesting institution
20
- */
21
- hciCode?: string;
22
18
  status?: ReferralExchange.ReferralStatusFilter | ReferralExchange.ReferralStatusFilter[];
23
19
  /**
24
20
  * To filter by the institution's role in the referral. e.g. For outbound referrals, use "sender'
@@ -32,12 +28,16 @@ export interface ReferralsListRequest {
32
28
  * Type of ID specified in referrerId. Use together with `referrerId` to filter based on referrer.
33
29
  */
34
30
  referrerIdType?: ReferralExchange.ReferrerIdType;
35
- /**
36
- * To filter by the requesting institution
37
- */
38
- institutionId?: string;
39
31
  /**
40
32
  * To filter by the patient UIN
41
33
  */
42
34
  patientUin?: string;
35
+ /**
36
+ * To identify the requesting institution
37
+ */
38
+ hciCode?: string;
39
+ /**
40
+ * To filter by the requesting institution
41
+ */
42
+ institutionId?: string;
43
43
  }
@@ -1,5 +1,6 @@
1
1
  export { type ReferralsListRequest } from "./ReferralsListRequest";
2
2
  export { type CreateReferralReq } from "./CreateReferralReq";
3
+ export { type ReferralsListByInstitutionRequest } from "./ReferralsListByInstitutionRequest";
3
4
  export { type ReferralsGetRequest } from "./ReferralsGetRequest";
4
5
  export { type CancelReferralReq } from "./CancelReferralReq";
5
6
  export { type AmendReferralReq } from "./AmendReferralReq";
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type InstitutionIdType = "hci";
@@ -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 });
@@ -28,6 +28,7 @@ export * from "./ReferralDto";
28
28
  export * from "./PaginatedQuery";
29
29
  export * from "./PaginationMetadata";
30
30
  export * from "./PaginatedReferralsDto";
31
+ export * from "./InstitutionIdType";
31
32
  export * from "./AdditionalReferralField";
32
33
  export * from "./TimelineEventType";
33
34
  export * from "./TimelineEventDtoSystem";
@@ -44,6 +44,7 @@ __exportStar(require("./ReferralDto"), exports);
44
44
  __exportStar(require("./PaginatedQuery"), exports);
45
45
  __exportStar(require("./PaginationMetadata"), exports);
46
46
  __exportStar(require("./PaginatedReferralsDto"), exports);
47
+ __exportStar(require("./InstitutionIdType"), exports);
47
48
  __exportStar(require("./AdditionalReferralField"), exports);
48
49
  __exportStar(require("./TimelineEventType"), exports);
49
50
  __exportStar(require("./TimelineEventDtoSystem"), exports);
@@ -89,7 +89,7 @@ class Eligibility {
89
89
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
90
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"),
91
91
  method: "GET",
92
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
93
93
  contentType: "application/json",
94
94
  queryParameters: _queryParams,
95
95
  requestType: "json",
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -85,7 +85,7 @@ class Offerings {
85
85
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
86
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"),
87
87
  method: "GET",
88
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
89
89
  contentType: "application/json",
90
90
  queryParameters: _queryParams,
91
91
  requestType: "json",
@@ -144,7 +144,7 @@ class Offerings {
144
144
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
145
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"),
146
146
  method: "GET",
147
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
148
148
  contentType: "application/json",
149
149
  queryParameters: _queryParams,
150
150
  requestType: "json",
@@ -207,7 +207,7 @@ class Offerings {
207
207
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
208
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`),
209
209
  method: "GET",
210
- 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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
211
211
  contentType: "application/json",
212
212
  queryParameters: _queryParams,
213
213
  requestType: "json",
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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",
@@ -70,6 +70,18 @@ export declare class Referrals {
70
70
  * })
71
71
  */
72
72
  upsert(request: ReferralExchange.CreateReferralReq, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
73
+ /**
74
+ * @param {ReferralExchange.InstitutionIdType} institutionIdType - The type of institution ID
75
+ * @param {string} institutionId - The institution ID
76
+ * @param {ReferralExchange.ReferralsListByInstitutionRequest} request
77
+ * @param {Referrals.RequestOptions} requestOptions - Request-specific configuration.
78
+ *
79
+ * @throws {@link ReferralExchange.UnauthorizedError}
80
+ *
81
+ * @example
82
+ * await client.referrals.listByInstitution("hci", "institutionId")
83
+ */
84
+ listByInstitution(institutionIdType: ReferralExchange.InstitutionIdType, institutionId: string, request?: ReferralExchange.ReferralsListByInstitutionRequest, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.PaginatedReferralsDto>;
73
85
  /**
74
86
  * @param {string} referralId - Referral ID
75
87
  * @param {ReferralExchange.ReferralsGetRequest} request
@@ -70,7 +70,7 @@ class Referrals {
70
70
  list() {
71
71
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
72
72
  var _a, _b, _c;
73
- const { offset, pageSize, hciCode, status, role, referrerId, referrerIdType, institutionId, patientUin } = request;
73
+ const { offset, pageSize, status, role, referrerId, referrerIdType, patientUin, hciCode, institutionId } = request;
74
74
  const _queryParams = {};
75
75
  if (offset != null) {
76
76
  _queryParams["offset"] = offset.toString();
@@ -78,9 +78,6 @@ class Referrals {
78
78
  if (pageSize != null) {
79
79
  _queryParams["pageSize"] = pageSize.toString();
80
80
  }
81
- if (hciCode != null) {
82
- _queryParams["hciCode"] = hciCode;
83
- }
84
81
  if (status != null) {
85
82
  if (Array.isArray(status)) {
86
83
  _queryParams["status"] = status.map((item) => item);
@@ -98,16 +95,19 @@ class Referrals {
98
95
  if (referrerIdType != null) {
99
96
  _queryParams["referrerIdType"] = referrerIdType;
100
97
  }
101
- if (institutionId != null) {
102
- _queryParams["institutionId"] = institutionId;
103
- }
104
98
  if (patientUin != null) {
105
99
  _queryParams["patientUin"] = patientUin;
106
100
  }
101
+ if (hciCode != null) {
102
+ _queryParams["hciCode"] = hciCode;
103
+ }
104
+ if (institutionId != null) {
105
+ _queryParams["institutionId"] = institutionId;
106
+ }
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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -222,6 +222,88 @@ class Referrals {
222
222
  }
223
223
  });
224
224
  }
225
+ /**
226
+ * @param {ReferralExchange.InstitutionIdType} institutionIdType - The type of institution ID
227
+ * @param {string} institutionId - The institution ID
228
+ * @param {ReferralExchange.ReferralsListByInstitutionRequest} request
229
+ * @param {Referrals.RequestOptions} requestOptions - Request-specific configuration.
230
+ *
231
+ * @throws {@link ReferralExchange.UnauthorizedError}
232
+ *
233
+ * @example
234
+ * await client.referrals.listByInstitution("hci", "institutionId")
235
+ */
236
+ listByInstitution(institutionIdType_1, institutionId_1) {
237
+ return __awaiter(this, arguments, void 0, function* (institutionIdType, institutionId, request = {}, requestOptions) {
238
+ var _a, _b, _c;
239
+ const { offset, pageSize, status, role, referrerId, referrerIdType, patientUin } = request;
240
+ const _queryParams = {};
241
+ if (offset != null) {
242
+ _queryParams["offset"] = offset.toString();
243
+ }
244
+ if (pageSize != null) {
245
+ _queryParams["pageSize"] = pageSize.toString();
246
+ }
247
+ if (status != null) {
248
+ if (Array.isArray(status)) {
249
+ _queryParams["status"] = status.map((item) => item);
250
+ }
251
+ else {
252
+ _queryParams["status"] = status;
253
+ }
254
+ }
255
+ if (role != null) {
256
+ _queryParams["role"] = role;
257
+ }
258
+ if (referrerId != null) {
259
+ _queryParams["referrerId"] = referrerId;
260
+ }
261
+ if (referrerIdType != null) {
262
+ _queryParams["referrerIdType"] = referrerIdType;
263
+ }
264
+ if (patientUin != null) {
265
+ _queryParams["patientUin"] = patientUin;
266
+ }
267
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
268
+ 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/institutions/${encodeURIComponent(institutionIdType)}/${encodeURIComponent(institutionId)}/referrals`),
269
+ method: "GET",
270
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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),
271
+ contentType: "application/json",
272
+ queryParameters: _queryParams,
273
+ requestType: "json",
274
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
275
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
276
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
277
+ });
278
+ if (_response.ok) {
279
+ return _response.body;
280
+ }
281
+ if (_response.error.reason === "status-code") {
282
+ switch (_response.error.statusCode) {
283
+ case 401:
284
+ throw new ReferralExchange.UnauthorizedError(_response.error.body);
285
+ default:
286
+ throw new errors.ReferralExchangeError({
287
+ statusCode: _response.error.statusCode,
288
+ body: _response.error.body,
289
+ });
290
+ }
291
+ }
292
+ switch (_response.error.reason) {
293
+ case "non-json":
294
+ throw new errors.ReferralExchangeError({
295
+ statusCode: _response.error.statusCode,
296
+ body: _response.error.rawBody,
297
+ });
298
+ case "timeout":
299
+ throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling GET /api/v1/institutions/{institutionIdType}/{institutionId}/referrals.");
300
+ case "unknown":
301
+ throw new errors.ReferralExchangeError({
302
+ message: _response.error.errorMessage,
303
+ });
304
+ }
305
+ });
306
+ }
225
307
  /**
226
308
  * @param {string} referralId - Referral ID
227
309
  * @param {ReferralExchange.ReferralsGetRequest} request
@@ -249,7 +331,7 @@ class Referrals {
249
331
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
250
332
  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
333
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
334
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
335
  contentType: "application/json",
254
336
  queryParameters: _queryParams,
255
337
  requestType: "json",
@@ -303,7 +385,7 @@ class Referrals {
303
385
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
304
386
  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
387
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
388
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
389
  contentType: "application/json",
308
390
  requestType: "json",
309
391
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -355,7 +437,7 @@ class Referrals {
355
437
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
356
438
  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
439
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
440
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
441
  contentType: "application/json",
360
442
  requestType: "json",
361
443
  body: request,
@@ -410,7 +492,7 @@ class Referrals {
410
492
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
411
493
  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
494
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
495
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
496
  contentType: "application/json",
415
497
  requestType: "json",
416
498
  body: request,
@@ -463,7 +545,7 @@ class Referrals {
463
545
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
464
546
  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
547
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
548
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
549
  contentType: "application/json",
468
550
  requestType: "json",
469
551
  body: request,
@@ -518,7 +600,7 @@ class Referrals {
518
600
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
519
601
  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
602
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
603
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
604
  contentType: "application/json",
523
605
  requestType: "json",
524
606
  body: request,
@@ -570,7 +652,7 @@ class Referrals {
570
652
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
571
653
  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
654
  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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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),
655
+ 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-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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
656
  contentType: "application/json",
575
657
  requestType: "json",
576
658
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,35 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as ReferralExchange from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface ReferralsListByInstitutionRequest {
10
+ /**
11
+ * Offset for pagination
12
+ */
13
+ offset?: number;
14
+ /**
15
+ * Number of items per page
16
+ */
17
+ pageSize?: number;
18
+ status?: ReferralExchange.ReferralStatusFilter | ReferralExchange.ReferralStatusFilter[];
19
+ /**
20
+ * To filter by the institution's role in the referral. e.g. For outbound referrals, use "sender'
21
+ */
22
+ role?: ReferralExchange.ReferralRole;
23
+ /**
24
+ * To filter by the referrer ID
25
+ */
26
+ referrerId?: string;
27
+ /**
28
+ * Type of ID specified in referrerId. Use together with `referrerId` to filter based on referrer.
29
+ */
30
+ referrerIdType?: ReferralExchange.ReferrerIdType;
31
+ /**
32
+ * To filter by the patient UIN
33
+ */
34
+ patientUin?: string;
35
+ }
@@ -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 });
@@ -15,10 +15,6 @@ export interface ReferralsListRequest {
15
15
  * Number of items per page
16
16
  */
17
17
  pageSize?: number;
18
- /**
19
- * To identify the requesting institution
20
- */
21
- hciCode?: string;
22
18
  status?: ReferralExchange.ReferralStatusFilter | ReferralExchange.ReferralStatusFilter[];
23
19
  /**
24
20
  * To filter by the institution's role in the referral. e.g. For outbound referrals, use "sender'
@@ -32,12 +28,16 @@ export interface ReferralsListRequest {
32
28
  * Type of ID specified in referrerId. Use together with `referrerId` to filter based on referrer.
33
29
  */
34
30
  referrerIdType?: ReferralExchange.ReferrerIdType;
35
- /**
36
- * To filter by the requesting institution
37
- */
38
- institutionId?: string;
39
31
  /**
40
32
  * To filter by the patient UIN
41
33
  */
42
34
  patientUin?: string;
35
+ /**
36
+ * To identify the requesting institution
37
+ */
38
+ hciCode?: string;
39
+ /**
40
+ * To filter by the requesting institution
41
+ */
42
+ institutionId?: string;
43
43
  }
@@ -1,5 +1,6 @@
1
1
  export { type ReferralsListRequest } from "./ReferralsListRequest";
2
2
  export { type CreateReferralReq } from "./CreateReferralReq";
3
+ export { type ReferralsListByInstitutionRequest } from "./ReferralsListByInstitutionRequest";
3
4
  export { type ReferralsGetRequest } from "./ReferralsGetRequest";
4
5
  export { type CancelReferralReq } from "./CancelReferralReq";
5
6
  export { type AmendReferralReq } from "./AmendReferralReq";
@@ -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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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-alpha-1763450943", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1763450943", "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.0-develop-alpha-1764841391", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-alpha-1764841391", "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,
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type InstitutionIdType = "hci";
@@ -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 });
@@ -28,6 +28,7 @@ export * from "./ReferralDto";
28
28
  export * from "./PaginatedQuery";
29
29
  export * from "./PaginationMetadata";
30
30
  export * from "./PaginatedReferralsDto";
31
+ export * from "./InstitutionIdType";
31
32
  export * from "./AdditionalReferralField";
32
33
  export * from "./TimelineEventType";
33
34
  export * from "./TimelineEventDtoSystem";
@@ -44,6 +44,7 @@ __exportStar(require("./ReferralDto"), exports);
44
44
  __exportStar(require("./PaginatedQuery"), exports);
45
45
  __exportStar(require("./PaginationMetadata"), exports);
46
46
  __exportStar(require("./PaginatedReferralsDto"), exports);
47
+ __exportStar(require("./InstitutionIdType"), exports);
47
48
  __exportStar(require("./AdditionalReferralField"), exports);
48
49
  __exportStar(require("./TimelineEventType"), exports);
49
50
  __exportStar(require("./TimelineEventDtoSystem"), exports);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.0-develop-alpha-1763450943";
1
+ export declare const SDK_VERSION = "0.0.0-develop-alpha-1764841391";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.0-develop-alpha-1763450943";
4
+ exports.SDK_VERSION = "0.0.0-develop-alpha-1764841391";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengovsg/refx-ts-sdk",
3
- "version": "0.0.0-develop-alpha-1763535866",
3
+ "version": "0.0.0-develop-alpha-1764841391",
4
4
  "private": false,
5
5
  "repository": "https://github.com/opengovsg/refer-ts-sdk",
6
6
  "main": "./index.js",
package/reference.md CHANGED
@@ -179,6 +179,70 @@ await client.referrals.upsert({
179
179
  </dl>
180
180
  </details>
181
181
 
182
+ <details><summary><code>client.referrals.<a href="/src/api/resources/referrals/client/Client.ts">listByInstitution</a>(institutionIdType, institutionId, { ...params }) -> ReferralExchange.PaginatedReferralsDto</code></summary>
183
+ <dl>
184
+ <dd>
185
+
186
+ #### 🔌 Usage
187
+
188
+ <dl>
189
+ <dd>
190
+
191
+ <dl>
192
+ <dd>
193
+
194
+ ```typescript
195
+ await client.referrals.listByInstitution("hci", "institutionId");
196
+ ```
197
+
198
+ </dd>
199
+ </dl>
200
+ </dd>
201
+ </dl>
202
+
203
+ #### ⚙️ Parameters
204
+
205
+ <dl>
206
+ <dd>
207
+
208
+ <dl>
209
+ <dd>
210
+
211
+ **institutionIdType:** `ReferralExchange.InstitutionIdType` — The type of institution ID
212
+
213
+ </dd>
214
+ </dl>
215
+
216
+ <dl>
217
+ <dd>
218
+
219
+ **institutionId:** `string` — The institution ID
220
+
221
+ </dd>
222
+ </dl>
223
+
224
+ <dl>
225
+ <dd>
226
+
227
+ **request:** `ReferralExchange.ReferralsListByInstitutionRequest`
228
+
229
+ </dd>
230
+ </dl>
231
+
232
+ <dl>
233
+ <dd>
234
+
235
+ **requestOptions:** `Referrals.RequestOptions`
236
+
237
+ </dd>
238
+ </dl>
239
+ </dd>
240
+ </dl>
241
+
242
+ </dd>
243
+ </dl>
244
+ </details>
245
+
182
246
  <details><summary><code>client.referrals.<a href="/src/api/resources/referrals/client/Client.ts">get</a>(referralId, { ...params }) -> ReferralExchange.FullReferralDto</code></summary>
183
247
  <dl>
184
248
  <dd>
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.0-develop-alpha-1763450943";
1
+ export declare const SDK_VERSION = "0.0.0-develop-alpha-1764841391";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.0-develop-alpha-1763450943";
4
+ exports.SDK_VERSION = "0.0.0-develop-alpha-1764841391";