@opengovsg/refx-ts-sdk 0.0.0-develop-1748575737 → 0.0.0-develop-1749093103

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 (81) hide show
  1. package/README.md +1 -1
  2. package/api/resources/eligibility/client/Client.js +1 -1
  3. package/api/resources/health/client/Client.js +1 -1
  4. package/api/resources/index.d.ts +2 -1
  5. package/api/resources/index.js +3 -2
  6. package/api/resources/links/client/Client.d.ts +2 -9
  7. package/api/resources/links/client/Client.js +3 -10
  8. package/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +11 -19
  9. package/api/resources/notes/client/Client.js +1 -1
  10. package/api/resources/offerings/client/Client.d.ts +14 -0
  11. package/api/resources/offerings/client/Client.js +64 -2
  12. package/api/resources/offerings/client/requests/ApiHoldingControllerGetRecommendedOfferingRequest.d.ts +21 -0
  13. package/api/resources/offerings/client/requests/ApiHoldingControllerGetRecommendedOfferingRequest.js +5 -0
  14. package/api/resources/offerings/client/requests/index.d.ts +1 -0
  15. package/api/resources/offerings/index.d.ts +1 -0
  16. package/api/resources/offerings/index.js +1 -0
  17. package/api/resources/offerings/types/ApiHoldingControllerGetRecommendedOfferingRequestCategory.d.ts +8 -0
  18. package/api/resources/offerings/types/ApiHoldingControllerGetRecommendedOfferingRequestCategory.js +10 -0
  19. package/api/resources/offerings/types/index.d.ts +1 -0
  20. package/api/resources/offerings/types/index.js +17 -0
  21. package/api/resources/public/client/Client.js +1 -1
  22. package/api/resources/referrals/client/Client.js +22 -10
  23. package/api/resources/referrals/client/requests/CreateReferralReq.d.ts +1 -0
  24. package/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +16 -0
  25. package/api/resources/webhooks/client/Client.js +2 -2
  26. package/api/types/FullReferralDto.d.ts +1 -0
  27. package/api/types/OfferingDto.d.ts +2 -0
  28. package/api/types/OfferingDtoCategory.d.ts +11 -0
  29. package/api/types/OfferingDtoCategory.js +10 -0
  30. package/api/types/OfferingWithAllowedDto.d.ts +2 -0
  31. package/api/types/OfferingWithAllowedDtoCategory.d.ts +11 -0
  32. package/api/types/OfferingWithAllowedDtoCategory.js +10 -0
  33. package/api/types/PublicReferralDto.d.ts +1 -0
  34. package/api/types/ReferralDto.d.ts +1 -0
  35. package/api/types/ReferrerIdType.d.ts +1 -1
  36. package/api/types/ReferringDoctorDto.d.ts +2 -0
  37. package/api/types/index.d.ts +2 -0
  38. package/api/types/index.js +2 -0
  39. package/dist/api/resources/eligibility/client/Client.js +1 -1
  40. package/dist/api/resources/health/client/Client.js +1 -1
  41. package/dist/api/resources/index.d.ts +2 -1
  42. package/dist/api/resources/index.js +3 -2
  43. package/dist/api/resources/links/client/Client.d.ts +2 -9
  44. package/dist/api/resources/links/client/Client.js +3 -10
  45. package/dist/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +11 -19
  46. package/dist/api/resources/notes/client/Client.js +1 -1
  47. package/dist/api/resources/offerings/client/Client.d.ts +14 -0
  48. package/dist/api/resources/offerings/client/Client.js +64 -2
  49. package/dist/api/resources/offerings/client/requests/ApiHoldingControllerGetRecommendedOfferingRequest.d.ts +21 -0
  50. package/dist/api/resources/offerings/client/requests/ApiHoldingControllerGetRecommendedOfferingRequest.js +5 -0
  51. package/dist/api/resources/offerings/client/requests/index.d.ts +1 -0
  52. package/dist/api/resources/offerings/index.d.ts +1 -0
  53. package/dist/api/resources/offerings/index.js +1 -0
  54. package/dist/api/resources/offerings/types/ApiHoldingControllerGetRecommendedOfferingRequestCategory.d.ts +8 -0
  55. package/dist/api/resources/offerings/types/ApiHoldingControllerGetRecommendedOfferingRequestCategory.js +10 -0
  56. package/dist/api/resources/offerings/types/index.d.ts +1 -0
  57. package/dist/api/resources/offerings/types/index.js +17 -0
  58. package/dist/api/resources/public/client/Client.js +1 -1
  59. package/dist/api/resources/referrals/client/Client.js +22 -10
  60. package/dist/api/resources/referrals/client/requests/CreateReferralReq.d.ts +1 -0
  61. package/dist/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +16 -0
  62. package/dist/api/resources/webhooks/client/Client.js +2 -2
  63. package/dist/api/types/FullReferralDto.d.ts +1 -0
  64. package/dist/api/types/OfferingDto.d.ts +2 -0
  65. package/dist/api/types/OfferingDtoCategory.d.ts +11 -0
  66. package/dist/api/types/OfferingDtoCategory.js +10 -0
  67. package/dist/api/types/OfferingWithAllowedDto.d.ts +2 -0
  68. package/dist/api/types/OfferingWithAllowedDtoCategory.d.ts +11 -0
  69. package/dist/api/types/OfferingWithAllowedDtoCategory.js +10 -0
  70. package/dist/api/types/PublicReferralDto.d.ts +1 -0
  71. package/dist/api/types/ReferralDto.d.ts +1 -0
  72. package/dist/api/types/ReferrerIdType.d.ts +1 -1
  73. package/dist/api/types/ReferringDoctorDto.d.ts +2 -0
  74. package/dist/api/types/index.d.ts +2 -0
  75. package/dist/api/types/index.js +2 -0
  76. package/dist/version.d.ts +1 -1
  77. package/dist/version.js +1 -1
  78. package/package.json +1 -1
  79. package/reference.md +52 -8
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
package/README.md CHANGED
@@ -13,7 +13,7 @@ npm i -s @opengovsg/refx-ts-sdk
13
13
 
14
14
  ## Reference
15
15
 
16
- A full reference for this library is available [here](./reference.md).
16
+ A full reference for this library is available [here](https://github.com/opengovsg/refer-ts-sdk/blob/HEAD/./reference.md).
17
17
 
18
18
  ## Usage
19
19
 
@@ -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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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,9 +1,10 @@
1
+ export * as offerings from "./offerings";
2
+ export * from "./offerings/types";
1
3
  export * as links from "./links";
2
4
  export * from "./links/types";
3
5
  export * as eligibility from "./eligibility";
4
6
  export * as referrals from "./referrals";
5
7
  export * as notes from "./notes";
6
- export * as offerings from "./offerings";
7
8
  export * as public_ from "./public";
8
9
  export * as webhooks from "./webhooks";
9
10
  export * as health from "./health";
@@ -36,13 +36,14 @@ 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.notes = exports.referrals = exports.eligibility = exports.links = exports.offerings = void 0;
40
+ exports.offerings = __importStar(require("./offerings"));
41
+ __exportStar(require("./offerings/types"), exports);
40
42
  exports.links = __importStar(require("./links"));
41
43
  __exportStar(require("./links/types"), exports);
42
44
  exports.eligibility = __importStar(require("./eligibility"));
43
45
  exports.referrals = __importStar(require("./referrals"));
44
46
  exports.notes = __importStar(require("./notes"));
45
- exports.offerings = __importStar(require("./offerings"));
46
47
  exports.public_ = __importStar(require("./public"));
47
48
  exports.webhooks = __importStar(require("./webhooks"));
48
49
  exports.health = __importStar(require("./health"));
@@ -37,15 +37,8 @@ export declare class Links {
37
37
  * referrerInstitutionId: "referrerInstitutionId",
38
38
  * referrerInstitutionName: "referrerInstitutionName",
39
39
  * referrerId: "referrerId",
40
- * referrerName: "referrerName",
41
- * referrerIdType: "referrerIdType",
42
- * referrerEmail: "referrerEmail",
43
- * referrerContactNumber: "referrerContactNumber",
44
- * patientUin: "patientUin",
45
- * patientName: "patientName",
46
- * patientPhoneNumber: "91234567",
47
- * patientDob: "1990-01-01",
48
- * patientGender: "Male"
40
+ * referrerIdType: "mcr",
41
+ * referrerName: "referrerName"
49
42
  * })
50
43
  */
51
44
  createUpsertLink(request: ReferralExchange.CreateLinkReqUpsert, requestOptions?: Links.RequestOptions): Promise<ReferralExchange.ReferralLinkDto>;
@@ -69,15 +69,8 @@ class Links {
69
69
  * referrerInstitutionId: "referrerInstitutionId",
70
70
  * referrerInstitutionName: "referrerInstitutionName",
71
71
  * referrerId: "referrerId",
72
- * referrerName: "referrerName",
73
- * referrerIdType: "referrerIdType",
74
- * referrerEmail: "referrerEmail",
75
- * referrerContactNumber: "referrerContactNumber",
76
- * patientUin: "patientUin",
77
- * patientName: "patientName",
78
- * patientPhoneNumber: "91234567",
79
- * patientDob: "1990-01-01",
80
- * patientGender: "Male"
72
+ * referrerIdType: "mcr",
73
+ * referrerName: "referrerName"
81
74
  * })
82
75
  */
83
76
  createUpsertLink(request, requestOptions) {
@@ -86,7 +79,7 @@ class Links {
86
79
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
87
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"),
88
81
  method: "POST",
89
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
90
83
  contentType: "application/json",
91
84
  requestType: "json",
92
85
  body: request,
@@ -8,15 +8,8 @@ import * as ReferralExchange from "../../../../index";
8
8
  * referrerInstitutionId: "referrerInstitutionId",
9
9
  * referrerInstitutionName: "referrerInstitutionName",
10
10
  * referrerId: "referrerId",
11
- * referrerName: "referrerName",
12
- * referrerIdType: "referrerIdType",
13
- * referrerEmail: "referrerEmail",
14
- * referrerContactNumber: "referrerContactNumber",
15
- * patientUin: "patientUin",
16
- * patientName: "patientName",
17
- * patientPhoneNumber: "91234567",
18
- * patientDob: "1990-01-01",
19
- * patientGender: "Male"
11
+ * referrerIdType: "mcr",
12
+ * referrerName: "referrerName"
20
13
  * }
21
14
  */
22
15
  export interface CreateLinkReqUpsert {
@@ -24,24 +17,23 @@ export interface CreateLinkReqUpsert {
24
17
  referrerInstitutionId: string;
25
18
  /** Name of the institution authoring this referral. */
26
19
  referrerInstitutionName: string;
27
- /** MCR number of the doctor authoring this referral. */
20
+ /** Id of the doctor authoring this referral. */
28
21
  referrerId: string;
22
+ referrerIdType: ReferralExchange.ReferrerIdType;
29
23
  /** Name of the doctor authoring this referral. */
30
24
  referrerName: string;
31
- /** Type of the referrer ID */
32
- referrerIdType: string;
33
25
  /** Email of the doctor authoring this referral. */
34
- referrerEmail: string;
26
+ referrerEmail?: string;
35
27
  /** Contact number of the doctor authoring this referral. */
36
- referrerContactNumber: string;
28
+ referrerContactNumber?: string;
37
29
  /** Patient UIN, e.g. NRIC or FIN */
38
- patientUin: string;
30
+ patientUin?: string;
39
31
  /** Patient name */
40
- patientName: string;
32
+ patientName?: string;
41
33
  /** Patient phone number - only Singaporean accepted for now */
42
- patientPhoneNumber: string;
34
+ patientPhoneNumber?: string;
43
35
  /** Patient date of birth */
44
- patientDob: string;
36
+ patientDob?: string;
45
37
  /** Patient gender */
46
- patientGender: ReferralExchange.CreateLinkReqUpsertPatientGender;
38
+ patientGender?: ReferralExchange.CreateLinkReqUpsertPatientGender;
47
39
  }
@@ -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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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,
@@ -36,6 +36,20 @@ export declare class Offerings {
36
36
  * await client.offerings.list()
37
37
  */
38
38
  list(request?: ReferralExchange.OfferingsListRequest, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingWithAllowedDto[]>;
39
+ /**
40
+ * @param {ReferralExchange.ApiHoldingControllerGetRecommendedOfferingRequest} request
41
+ * @param {Offerings.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link ReferralExchange.UnauthorizedError}
44
+ * @throws {@link ReferralExchange.NotFoundError}
45
+ *
46
+ * @example
47
+ * await client.offerings.apiHoldingControllerGetRecommendedOffering({
48
+ * category: "aac service",
49
+ * postalCode: "postalCode"
50
+ * })
51
+ */
52
+ apiHoldingControllerGetRecommendedOffering(request: ReferralExchange.ApiHoldingControllerGetRecommendedOfferingRequest, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingDto>;
39
53
  /**
40
54
  * @param {string} offeringId
41
55
  * @param {ReferralExchange.OfferingsListTimeslotsRequest} request
@@ -84,7 +84,7 @@ class Offerings {
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/offerings"),
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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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",
@@ -121,6 +121,68 @@ class Offerings {
121
121
  }
122
122
  });
123
123
  }
124
+ /**
125
+ * @param {ReferralExchange.ApiHoldingControllerGetRecommendedOfferingRequest} request
126
+ * @param {Offerings.RequestOptions} requestOptions - Request-specific configuration.
127
+ *
128
+ * @throws {@link ReferralExchange.UnauthorizedError}
129
+ * @throws {@link ReferralExchange.NotFoundError}
130
+ *
131
+ * @example
132
+ * await client.offerings.apiHoldingControllerGetRecommendedOffering({
133
+ * category: "aac service",
134
+ * postalCode: "postalCode"
135
+ * })
136
+ */
137
+ apiHoldingControllerGetRecommendedOffering(request, requestOptions) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ var _a, _b, _c;
140
+ const { category, postalCode } = request;
141
+ const _queryParams = {};
142
+ _queryParams["category"] = category;
143
+ _queryParams["postalCode"] = postalCode;
144
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
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
+ 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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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
+ contentType: "application/json",
149
+ queryParameters: _queryParams,
150
+ requestType: "json",
151
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
152
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
153
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
154
+ });
155
+ if (_response.ok) {
156
+ return _response.body;
157
+ }
158
+ if (_response.error.reason === "status-code") {
159
+ switch (_response.error.statusCode) {
160
+ case 401:
161
+ throw new ReferralExchange.UnauthorizedError(_response.error.body);
162
+ case 404:
163
+ throw new ReferralExchange.NotFoundError(_response.error.body);
164
+ default:
165
+ throw new errors.ReferralExchangeError({
166
+ statusCode: _response.error.statusCode,
167
+ body: _response.error.body,
168
+ });
169
+ }
170
+ }
171
+ switch (_response.error.reason) {
172
+ case "non-json":
173
+ throw new errors.ReferralExchangeError({
174
+ statusCode: _response.error.statusCode,
175
+ body: _response.error.rawBody,
176
+ });
177
+ case "timeout":
178
+ throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling GET /api/v1/offerings/recommended.");
179
+ case "unknown":
180
+ throw new errors.ReferralExchangeError({
181
+ message: _response.error.errorMessage,
182
+ });
183
+ }
184
+ });
185
+ }
124
186
  /**
125
187
  * @param {string} offeringId
126
188
  * @param {ReferralExchange.OfferingsListTimeslotsRequest} request
@@ -145,7 +207,7 @@ class Offerings {
145
207
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
146
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`),
147
209
  method: "GET",
148
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
149
211
  contentType: "application/json",
150
212
  queryParameters: _queryParams,
151
213
  requestType: "json",
@@ -0,0 +1,21 @@
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
+ * category: "aac service",
9
+ * postalCode: "postalCode"
10
+ * }
11
+ */
12
+ export interface ApiHoldingControllerGetRecommendedOfferingRequest {
13
+ /**
14
+ * Offering category to retrieve recommendation for
15
+ */
16
+ category: ReferralExchange.ApiHoldingControllerGetRecommendedOfferingRequestCategory;
17
+ /**
18
+ * Postal code of the patient to retrieve recommendation for
19
+ */
20
+ postalCode: string;
21
+ }
@@ -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 });
@@ -1,2 +1,3 @@
1
1
  export { type OfferingsListRequest } from "./OfferingsListRequest";
2
+ export { type ApiHoldingControllerGetRecommendedOfferingRequest } from "./ApiHoldingControllerGetRecommendedOfferingRequest";
2
3
  export { type OfferingsListTimeslotsRequest } from "./OfferingsListTimeslotsRequest";
@@ -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,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type ApiHoldingControllerGetRecommendedOfferingRequestCategory = "aac service" | "befriending";
5
+ export declare const ApiHoldingControllerGetRecommendedOfferingRequestCategory: {
6
+ readonly AacService: "aac service";
7
+ readonly Befriending: "befriending";
8
+ };
@@ -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.ApiHoldingControllerGetRecommendedOfferingRequestCategory = void 0;
7
+ exports.ApiHoldingControllerGetRecommendedOfferingRequestCategory = {
8
+ AacService: "aac service",
9
+ Befriending: "befriending",
10
+ };
@@ -0,0 +1 @@
1
+ export * from "./ApiHoldingControllerGetRecommendedOfferingRequestCategory";
@@ -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("./ApiHoldingControllerGetRecommendedOfferingRequestCategory"), exports);
@@ -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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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",
@@ -72,7 +72,7 @@ class Referrals {
72
72
  list(request, requestOptions) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
74
  var _a, _b, _c;
75
- const { offset, pageSize, hciCode, status, role } = request;
75
+ const { offset, pageSize, hciCode, status, role, referrerId, referrerIdType, institutionId, patientUin } = request;
76
76
  const _queryParams = {};
77
77
  if (offset != null) {
78
78
  _queryParams["offset"] = offset.toString();
@@ -92,10 +92,22 @@ class Referrals {
92
92
  if (role != null) {
93
93
  _queryParams["role"] = role;
94
94
  }
95
+ if (referrerId != null) {
96
+ _queryParams["referrerId"] = referrerId;
97
+ }
98
+ if (referrerIdType != null) {
99
+ _queryParams["referrerIdType"] = referrerIdType;
100
+ }
101
+ if (institutionId != null) {
102
+ _queryParams["institutionId"] = institutionId;
103
+ }
104
+ if (patientUin != null) {
105
+ _queryParams["patientUin"] = patientUin;
106
+ }
95
107
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
96
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"),
97
109
  method: "GET",
98
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
99
111
  contentType: "application/json",
100
112
  queryParameters: _queryParams,
101
113
  requestType: "json",
@@ -171,7 +183,7 @@ class Referrals {
171
183
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
172
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"),
173
185
  method: "POST",
174
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
175
187
  contentType: "application/json",
176
188
  requestType: "json",
177
189
  body: request,
@@ -237,7 +249,7 @@ class Referrals {
237
249
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
238
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)}`),
239
251
  method: "GET",
240
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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.0-develop-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
241
253
  contentType: "application/json",
242
254
  queryParameters: _queryParams,
243
255
  requestType: "json",
@@ -291,7 +303,7 @@ class Referrals {
291
303
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
292
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)}`),
293
305
  method: "DELETE",
294
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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.0-develop-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
295
307
  contentType: "application/json",
296
308
  requestType: "json",
297
309
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -343,7 +355,7 @@ class Referrals {
343
355
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
344
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`),
345
357
  method: "POST",
346
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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.0-develop-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
347
359
  contentType: "application/json",
348
360
  requestType: "json",
349
361
  body: request,
@@ -398,7 +410,7 @@ class Referrals {
398
410
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
399
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`),
400
412
  method: "POST",
401
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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.0-develop-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
402
414
  contentType: "application/json",
403
415
  requestType: "json",
404
416
  body: request,
@@ -451,7 +463,7 @@ class Referrals {
451
463
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
452
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`),
453
465
  method: "POST",
454
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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.0-develop-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
455
467
  contentType: "application/json",
456
468
  requestType: "json",
457
469
  body: request,
@@ -506,7 +518,7 @@ class Referrals {
506
518
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
507
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`),
508
520
  method: "POST",
509
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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.0-develop-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
510
522
  contentType: "application/json",
511
523
  requestType: "json",
512
524
  body: request,
@@ -558,7 +570,7 @@ class Referrals {
558
570
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
559
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`),
560
572
  method: "POST",
561
- 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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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.0-develop-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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),
562
574
  contentType: "application/json",
563
575
  requestType: "json",
564
576
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -38,6 +38,7 @@ export interface CreateReferralReq {
38
38
  senderInstitutionName: string;
39
39
  /** MCR number of the doctor authoring this referral. */
40
40
  doctorMcr: string;
41
+ referrerIdType?: ReferralExchange.ReferrerIdType;
41
42
  /** Name of the doctor authoring this referral. */
42
43
  doctorName: string;
43
44
  /** Email of the doctor authoring this referral. */
@@ -26,4 +26,20 @@ export interface ReferralsListRequest {
26
26
  * To filter by the institution's role in the referral. e.g. For outbound referrals, use "sender'
27
27
  */
28
28
  role?: ReferralExchange.ReferralRole;
29
+ /**
30
+ * To filter by the referrer ID
31
+ */
32
+ referrerId?: string;
33
+ /**
34
+ * Type of ID specified in referrerId. Use together with `referrerId` to filter based on referrer.
35
+ */
36
+ referrerIdType?: ReferralExchange.ReferrerIdType;
37
+ /**
38
+ * To filter by the requesting institution
39
+ */
40
+ institutionId?: string;
41
+ /**
42
+ * To filter by the patient UIN
43
+ */
44
+ patientUin?: string;
29
45
  }
@@ -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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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-1748575737", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1748575737", "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-1749093103", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1749093103", "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,
@@ -5,6 +5,7 @@ import * as ReferralExchange from "../index";
5
5
  export interface FullReferralDto {
6
6
  id: string;
7
7
  sender: ReferralExchange.InstitutionCoreDto;
8
+ senderSystem: ReferralExchange.System;
8
9
  offering: ReferralExchange.OfferingDto;
9
10
  patient: ReferralExchange.GetReferralPatientDto;
10
11
  referringDoctor: ReferralExchange.ReferringDoctorDto;
@@ -16,4 +16,6 @@ export interface OfferingDto {
16
16
  /** Whether this offering supports subsidized referrals. */
17
17
  isSubsidisable: boolean;
18
18
  timeslotPolicy: ReferralExchange.TimeslotPolicy;
19
+ /** Category of the offering. Used to group offerings together. */
20
+ category?: ReferralExchange.OfferingDtoCategory;
19
21
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Category of the offering. Used to group offerings together.
6
+ */
7
+ export type OfferingDtoCategory = "aac service" | "befriending";
8
+ export declare const OfferingDtoCategory: {
9
+ readonly AacService: "aac service";
10
+ readonly Befriending: "befriending";
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.OfferingDtoCategory = void 0;
7
+ exports.OfferingDtoCategory = {
8
+ AacService: "aac service",
9
+ Befriending: "befriending",
10
+ };