@opengovsg/refx-ts-sdk 0.0.59 → 0.0.61

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 (106) hide show
  1. package/api/errors/BadRequestError.d.ts +1 -2
  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 +1 -2
  5. package/api/resources/index.js +2 -3
  6. package/api/resources/links/client/Client.d.ts +3 -1
  7. package/api/resources/links/client/Client.js +5 -1
  8. package/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +2 -1
  9. package/api/resources/notes/client/Client.d.ts +3 -1
  10. package/api/resources/notes/client/Client.js +5 -3
  11. package/api/resources/notes/client/requests/CreateNoteReq.d.ts +5 -1
  12. package/api/resources/offerings/client/Client.js +3 -3
  13. package/api/resources/public/client/Client.d.ts +4 -2
  14. package/api/resources/public/client/Client.js +10 -8
  15. package/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +13 -3
  16. package/api/resources/referrals/client/Client.d.ts +33 -12
  17. package/api/resources/referrals/client/Client.js +62 -33
  18. package/api/resources/referrals/client/requests/AcceptReferralBody.d.ts +6 -1
  19. package/api/resources/referrals/client/requests/AmendReferralReq.d.ts +5 -1
  20. package/api/resources/referrals/client/requests/BackToDraftReferralBody.d.ts +14 -0
  21. package/api/resources/referrals/client/requests/CancelReferralReq.d.ts +6 -1
  22. package/api/resources/referrals/client/requests/CreateReferralReq.d.ts +0 -6
  23. package/api/resources/referrals/client/requests/ReferralsDeleteRequest.d.ts +21 -0
  24. package/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +13 -3
  25. package/api/resources/referrals/client/requests/RejectReferralBody.d.ts +5 -1
  26. package/api/resources/referrals/client/requests/index.d.ts +2 -0
  27. package/api/resources/referrals/index.d.ts +0 -1
  28. package/api/resources/referrals/index.js +0 -1
  29. package/api/resources/webhooks/client/Client.js +2 -2
  30. package/api/types/CreateReferrerReq.d.ts +13 -0
  31. package/{dist/api/resources/referrals/types/CreateReferralReqClinicType.js → api/types/CreateReferrerReq.js} +0 -5
  32. package/api/types/Form.d.ts +3 -0
  33. package/api/types/FullReferralDto.d.ts +1 -1
  34. package/api/types/InstitutionIdType.d.ts +3 -0
  35. package/{dist/api/types/ReferralLinkDto.d.ts → api/types/ReferralActionLinkDto.d.ts} +2 -2
  36. package/api/{resources/referrals/types/CreateReferralReqClinicType.js → types/ReferralActionLinkDto.js} +0 -5
  37. package/{dist/api/types/ReferralLinkType.d.ts → api/types/ReferralActionLinkType.d.ts} +2 -3
  38. package/{dist/api/types/ReferralLinkType.js → api/types/ReferralActionLinkType.js} +2 -3
  39. package/api/types/{ReferralLinkDto.d.ts → ReferralUpsertLinkDto.d.ts} +2 -2
  40. package/api/types/ReferralUpsertLinkDto.js +5 -0
  41. package/api/types/ReferralUpsertLinkType.d.ts +7 -0
  42. package/api/types/ReferralUpsertLinkType.js +5 -0
  43. package/api/types/Timeslot.d.ts +2 -0
  44. package/api/types/index.d.ts +5 -2
  45. package/api/types/index.js +5 -2
  46. package/dist/api/errors/BadRequestError.d.ts +1 -2
  47. package/dist/api/resources/eligibility/client/Client.js +1 -1
  48. package/dist/api/resources/health/client/Client.js +1 -1
  49. package/dist/api/resources/index.d.ts +1 -2
  50. package/dist/api/resources/index.js +2 -3
  51. package/dist/api/resources/links/client/Client.d.ts +3 -1
  52. package/dist/api/resources/links/client/Client.js +5 -1
  53. package/dist/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +2 -1
  54. package/dist/api/resources/notes/client/Client.d.ts +3 -1
  55. package/dist/api/resources/notes/client/Client.js +5 -3
  56. package/dist/api/resources/notes/client/requests/CreateNoteReq.d.ts +5 -1
  57. package/dist/api/resources/offerings/client/Client.js +3 -3
  58. package/dist/api/resources/public/client/Client.d.ts +4 -2
  59. package/dist/api/resources/public/client/Client.js +10 -8
  60. package/dist/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +13 -3
  61. package/dist/api/resources/referrals/client/Client.d.ts +33 -12
  62. package/dist/api/resources/referrals/client/Client.js +62 -33
  63. package/dist/api/resources/referrals/client/requests/AcceptReferralBody.d.ts +6 -1
  64. package/dist/api/resources/referrals/client/requests/AmendReferralReq.d.ts +5 -1
  65. package/dist/api/resources/referrals/client/requests/BackToDraftReferralBody.d.ts +14 -0
  66. package/dist/api/resources/referrals/client/requests/BackToDraftReferralBody.js +5 -0
  67. package/dist/api/resources/referrals/client/requests/CancelReferralReq.d.ts +6 -1
  68. package/dist/api/resources/referrals/client/requests/CreateReferralReq.d.ts +0 -6
  69. package/dist/api/resources/referrals/client/requests/ReferralsDeleteRequest.d.ts +21 -0
  70. package/dist/api/resources/referrals/client/requests/ReferralsDeleteRequest.js +5 -0
  71. package/dist/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +13 -3
  72. package/dist/api/resources/referrals/client/requests/RejectReferralBody.d.ts +5 -1
  73. package/dist/api/resources/referrals/client/requests/index.d.ts +2 -0
  74. package/dist/api/resources/referrals/index.d.ts +0 -1
  75. package/dist/api/resources/referrals/index.js +0 -1
  76. package/dist/api/resources/webhooks/client/Client.js +2 -2
  77. package/dist/api/types/CreateReferrerReq.d.ts +13 -0
  78. package/dist/api/types/CreateReferrerReq.js +5 -0
  79. package/dist/api/types/Form.d.ts +3 -0
  80. package/dist/api/types/FullReferralDto.d.ts +1 -1
  81. package/dist/api/types/InstitutionIdType.d.ts +3 -0
  82. package/dist/api/types/ReferralActionLinkDto.d.ts +11 -0
  83. package/dist/api/types/ReferralActionLinkDto.js +5 -0
  84. package/{api/types/ReferralLinkType.d.ts → dist/api/types/ReferralActionLinkType.d.ts} +2 -3
  85. package/{api/types/ReferralLinkType.js → dist/api/types/ReferralActionLinkType.js} +2 -3
  86. package/dist/api/types/ReferralUpsertLinkDto.d.ts +11 -0
  87. package/dist/api/types/ReferralUpsertLinkDto.js +5 -0
  88. package/dist/api/types/ReferralUpsertLinkType.d.ts +7 -0
  89. package/dist/api/types/ReferralUpsertLinkType.js +5 -0
  90. package/dist/api/types/Timeslot.d.ts +2 -0
  91. package/dist/api/types/index.d.ts +5 -2
  92. package/dist/api/types/index.js +5 -2
  93. package/dist/version.d.ts +1 -1
  94. package/dist/version.js +1 -1
  95. package/package.json +1 -1
  96. package/reference.md +46 -7
  97. package/version.d.ts +1 -1
  98. package/version.js +1 -1
  99. package/api/resources/referrals/types/CreateReferralReqClinicType.d.ts +0 -11
  100. package/api/resources/referrals/types/index.d.ts +0 -1
  101. package/api/resources/referrals/types/index.js +0 -17
  102. package/dist/api/resources/referrals/types/CreateReferralReqClinicType.d.ts +0 -11
  103. package/dist/api/resources/referrals/types/index.d.ts +0 -1
  104. package/dist/api/resources/referrals/types/index.js +0 -17
  105. /package/api/{types/ReferralLinkDto.js → resources/referrals/client/requests/BackToDraftReferralBody.js} +0 -0
  106. /package/{dist/api/types/ReferralLinkDto.js → api/resources/referrals/client/requests/ReferralsDeleteRequest.js} +0 -0
@@ -2,7 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- import * as ReferralExchange from "../index";
6
5
  export declare class BadRequestError extends errors.ReferralExchangeError {
7
- constructor(body: ReferralExchange.BadRequestErrorBody);
6
+ constructor(body?: unknown);
8
7
  }
@@ -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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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,8 +1,7 @@
1
- export * as referrals from "./referrals";
2
- export * from "./referrals/types";
3
1
  export * as links from "./links";
4
2
  export * from "./links/types";
5
3
  export * as eligibility from "./eligibility";
4
+ export * as referrals from "./referrals";
6
5
  export * as notes from "./notes";
7
6
  export * as offerings from "./offerings";
8
7
  export * as public_ from "./public";
@@ -36,12 +36,11 @@ 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.eligibility = exports.links = exports.referrals = void 0;
40
- exports.referrals = __importStar(require("./referrals"));
41
- __exportStar(require("./referrals/types"), exports);
39
+ exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.notes = exports.referrals = exports.eligibility = exports.links = void 0;
42
40
  exports.links = __importStar(require("./links"));
43
41
  __exportStar(require("./links/types"), exports);
44
42
  exports.eligibility = __importStar(require("./eligibility"));
43
+ exports.referrals = __importStar(require("./referrals"));
45
44
  exports.notes = __importStar(require("./notes"));
46
45
  exports.offerings = __importStar(require("./offerings"));
47
46
  exports.public_ = __importStar(require("./public"));
@@ -30,6 +30,7 @@ export declare class Links {
30
30
  * @param {ReferralExchange.CreateLinkReqUpsert} request
31
31
  * @param {Links.RequestOptions} requestOptions - Request-specific configuration.
32
32
  *
33
+ * @throws {@link ReferralExchange.BadRequestError}
33
34
  * @throws {@link ReferralExchange.UnauthorizedError}
34
35
  *
35
36
  * @example
@@ -37,11 +38,12 @@ export declare class Links {
37
38
  * referrerInstitutionId: "referrerInstitutionId",
38
39
  * referrerInstitutionName: "referrerInstitutionName",
39
40
  * referrerId: "referrerId",
41
+ * requesterIdentifier: "requester@example.com",
40
42
  * referrerIdType: "mcr",
41
43
  * referrerName: "referrerName"
42
44
  * })
43
45
  */
44
- createUpsertLink(request: ReferralExchange.CreateLinkReqUpsert, requestOptions?: Links.RequestOptions): Promise<ReferralExchange.ReferralLinkDto>;
46
+ createUpsertLink(request: ReferralExchange.CreateLinkReqUpsert, requestOptions?: Links.RequestOptions): Promise<ReferralExchange.ReferralUpsertLinkDto>;
45
47
  protected _getCustomAuthorizationHeaders(): Promise<{
46
48
  Authorization: string | undefined;
47
49
  }>;
@@ -62,6 +62,7 @@ class Links {
62
62
  * @param {ReferralExchange.CreateLinkReqUpsert} request
63
63
  * @param {Links.RequestOptions} requestOptions - Request-specific configuration.
64
64
  *
65
+ * @throws {@link ReferralExchange.BadRequestError}
65
66
  * @throws {@link ReferralExchange.UnauthorizedError}
66
67
  *
67
68
  * @example
@@ -69,6 +70,7 @@ class Links {
69
70
  * referrerInstitutionId: "referrerInstitutionId",
70
71
  * referrerInstitutionName: "referrerInstitutionName",
71
72
  * referrerId: "referrerId",
73
+ * requesterIdentifier: "requester@example.com",
72
74
  * referrerIdType: "mcr",
73
75
  * referrerName: "referrerName"
74
76
  * })
@@ -79,7 +81,7 @@ class Links {
79
81
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
82
  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
83
  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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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),
84
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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
85
  contentType: "application/json",
84
86
  requestType: "json",
85
87
  body: request,
@@ -92,6 +94,8 @@ class Links {
92
94
  }
93
95
  if (_response.error.reason === "status-code") {
94
96
  switch (_response.error.statusCode) {
97
+ case 400:
98
+ throw new ReferralExchange.BadRequestError(_response.error.body);
95
99
  case 401:
96
100
  throw new ReferralExchange.UnauthorizedError(_response.error.body);
97
101
  default:
@@ -8,6 +8,7 @@ import * as ReferralExchange from "../../../../index";
8
8
  * referrerInstitutionId: "referrerInstitutionId",
9
9
  * referrerInstitutionName: "referrerInstitutionName",
10
10
  * referrerId: "referrerId",
11
+ * requesterIdentifier: "requester@example.com",
11
12
  * referrerIdType: "mcr",
12
13
  * referrerName: "referrerName"
13
14
  * }
@@ -20,7 +21,7 @@ export interface CreateLinkReqUpsert {
20
21
  /** Id of the doctor authoring this referral. */
21
22
  referrerId: string;
22
23
  /** Identifier for the individual requesting the link. The individual may or may not be the referrer. Preferred to be an email. */
23
- requesterIdentifier?: string;
24
+ requesterIdentifier: string;
24
25
  referrerIdType: ReferralExchange.ReferrerIdType;
25
26
  /** Name of the doctor authoring this referral. */
26
27
  referrerName: string;
@@ -35,7 +35,9 @@ export declare class Notes {
35
35
  *
36
36
  * @example
37
37
  * await client.notes.create("referralId", {
38
- * authorHciCode: "authorHciCode"
38
+ * authorHciCode: "authorHciCode",
39
+ * institutionIdType: "hci",
40
+ * institutionId: "institutionId"
39
41
  * })
40
42
  */
41
43
  create(referralId: string, request: ReferralExchange.CreateNoteReq, requestOptions?: Notes.RequestOptions): Promise<ReferralExchange.NoteDto>;
@@ -67,7 +67,9 @@ class Notes {
67
67
  *
68
68
  * @example
69
69
  * await client.notes.create("referralId", {
70
- * authorHciCode: "authorHciCode"
70
+ * authorHciCode: "authorHciCode",
71
+ * institutionIdType: "hci",
72
+ * institutionId: "institutionId"
71
73
  * })
72
74
  */
73
75
  create(referralId, request, requestOptions) {
@@ -76,10 +78,10 @@ class Notes {
76
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
77
79
  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
80
  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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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),
81
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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
82
  contentType: "application/json",
81
83
  requestType: "json",
82
- body: request,
84
+ body: Object.assign(Object.assign({}, request), { institutionIdType: "hci" }),
83
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
84
86
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
85
87
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -4,7 +4,9 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * authorHciCode: "authorHciCode"
7
+ * authorHciCode: "authorHciCode",
8
+ * institutionIdType: "hci",
9
+ * institutionId: "institutionId"
8
10
  * }
9
11
  */
10
12
  export interface CreateNoteReq {
@@ -12,4 +14,6 @@ export interface CreateNoteReq {
12
14
  content?: string;
13
15
  /** Author HCI code. Must be already tied to your system. */
14
16
  authorHciCode: string;
17
+ /** The institution ID */
18
+ institutionId: string;
15
19
  }
@@ -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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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",
@@ -35,10 +35,12 @@ export declare class Public {
35
35
  *
36
36
  * @example
37
37
  * await client.public.getReferral("referralId", {
38
- * requesterIdentifier: "requester@example.com"
38
+ * requesterIdentifier: "requester@example.com",
39
+ * institutionIdType: "hci",
40
+ * institutionId: "institutionId"
39
41
  * })
40
42
  */
41
- getReferral(referralId: string, request?: ReferralExchange.PublicGetReferralRequest, requestOptions?: Public.RequestOptions): Promise<ReferralExchange.PublicReferralDto>;
43
+ getReferral(referralId: string, request: ReferralExchange.PublicGetReferralRequest, requestOptions?: Public.RequestOptions): Promise<ReferralExchange.PublicReferralDto>;
42
44
  protected _getCustomAuthorizationHeaders(): Promise<{
43
45
  Authorization: string | undefined;
44
46
  }>;
@@ -67,13 +67,15 @@ class Public {
67
67
  *
68
68
  * @example
69
69
  * await client.public.getReferral("referralId", {
70
- * requesterIdentifier: "requester@example.com"
70
+ * requesterIdentifier: "requester@example.com",
71
+ * institutionIdType: "hci",
72
+ * institutionId: "institutionId"
71
73
  * })
72
74
  */
73
- getReferral(referralId_1) {
74
- return __awaiter(this, arguments, void 0, function* (referralId, request = {}, requestOptions) {
75
+ getReferral(referralId, request, requestOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
75
77
  var _a, _b, _c;
76
- const { additionalField, requesterIdentifier } = request;
78
+ const { additionalField, requesterIdentifier, institutionIdType, institutionId } = request;
77
79
  const _queryParams = {};
78
80
  if (additionalField != null) {
79
81
  if (Array.isArray(additionalField)) {
@@ -83,13 +85,13 @@ class Public {
83
85
  _queryParams["additionalField"] = additionalField;
84
86
  }
85
87
  }
86
- if (requesterIdentifier != null) {
87
- _queryParams["requesterIdentifier"] = requesterIdentifier;
88
- }
88
+ _queryParams["requesterIdentifier"] = requesterIdentifier;
89
+ _queryParams["institutionIdType"] = institutionIdType;
90
+ _queryParams["institutionId"] = institutionId;
89
91
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
90
92
  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)}`),
91
93
  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.59", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.59", "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),
94
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.61", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.61", "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
95
  contentType: "application/json",
94
96
  queryParameters: _queryParams,
95
97
  requestType: "json",
@@ -5,13 +5,23 @@ import * as ReferralExchange from "../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {
8
- * requesterIdentifier: "requester@example.com"
8
+ * requesterIdentifier: "requester@example.com",
9
+ * institutionIdType: "hci",
10
+ * institutionId: "institutionId"
9
11
  * }
10
12
  */
11
13
  export interface PublicGetReferralRequest {
12
14
  additionalField?: ReferralExchange.AdditionalReferralField | ReferralExchange.AdditionalReferralField[];
13
15
  /**
14
- * Identifier for the individual requesting attachments/link/url. Required when requesting attachments/link/url. Preferred to be an email.
16
+ * Identifier for the individual requesting the referral. Preferred to be an email.
15
17
  */
16
- requesterIdentifier?: string;
18
+ requesterIdentifier: string;
19
+ /**
20
+ * The type of institution ID
21
+ */
22
+ institutionIdType: ReferralExchange.InstitutionIdType;
23
+ /**
24
+ * The institution ID
25
+ */
26
+ institutionId: string;
17
27
  }
@@ -92,20 +92,26 @@ export declare class Referrals {
92
92
  *
93
93
  * @example
94
94
  * await client.referrals.get("referralId", {
95
- * requesterIdentifier: "requester@example.com"
95
+ * requesterIdentifier: "requester@example.com",
96
+ * institutionIdType: "hci",
97
+ * institutionId: "institutionId"
96
98
  * })
97
99
  */
98
- get(referralId: string, request?: ReferralExchange.ReferralsGetRequest, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.FullReferralDto>;
100
+ get(referralId: string, request: ReferralExchange.ReferralsGetRequest, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.FullReferralDto>;
99
101
  /**
100
102
  * @param {string} referralId - Referral ID
103
+ * @param {ReferralExchange.ReferralsDeleteRequest} request
101
104
  * @param {Referrals.RequestOptions} requestOptions - Request-specific configuration.
102
105
  *
103
106
  * @throws {@link ReferralExchange.UnauthorizedError}
104
107
  *
105
108
  * @example
106
- * await client.referrals.delete("referralId")
109
+ * await client.referrals.delete("referralId", {
110
+ * institutionIdType: "hci",
111
+ * institutionId: "institutionId"
112
+ * })
107
113
  */
108
- delete(referralId: string, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
114
+ delete(referralId: string, request: ReferralExchange.ReferralsDeleteRequest, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
109
115
  /**
110
116
  * @param {string} referralId - Referral ID
111
117
  * @param {ReferralExchange.CancelReferralReq} request
@@ -114,9 +120,12 @@ export declare class Referrals {
114
120
  * @throws {@link ReferralExchange.UnauthorizedError}
115
121
  *
116
122
  * @example
117
- * await client.referrals.cancel("referralId")
123
+ * await client.referrals.cancel("referralId", {
124
+ * institutionIdType: "hci",
125
+ * institutionId: "institutionId"
126
+ * })
118
127
  */
119
- cancel(referralId: string, request?: ReferralExchange.CancelReferralReq, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
128
+ cancel(referralId: string, request: ReferralExchange.CancelReferralReq, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
120
129
  /**
121
130
  * @param {string} referralId - Referral ID
122
131
  * @param {ReferralExchange.AmendReferralReq} request
@@ -126,7 +135,9 @@ export declare class Referrals {
126
135
  *
127
136
  * @example
128
137
  * await client.referrals.amend("referralId", {
129
- * timeslotStartAt: 1714857600000
138
+ * timeslotStartAt: 1714857600000,
139
+ * institutionIdType: "hci",
140
+ * institutionId: "institutionId"
130
141
  * })
131
142
  */
132
143
  amend(referralId: string, request: ReferralExchange.AmendReferralReq, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
@@ -135,12 +146,16 @@ export declare class Referrals {
135
146
  * @param {ReferralExchange.AcceptReferralBody} request
136
147
  * @param {Referrals.RequestOptions} requestOptions - Request-specific configuration.
137
148
  *
149
+ * @throws {@link ReferralExchange.BadRequestError}
138
150
  * @throws {@link ReferralExchange.UnauthorizedError}
139
151
  *
140
152
  * @example
141
- * await client.referrals.accept("referralId")
153
+ * await client.referrals.accept("referralId", {
154
+ * institutionIdType: "hci",
155
+ * institutionId: "institutionId"
156
+ * })
142
157
  */
143
- accept(referralId: string, request?: ReferralExchange.AcceptReferralBody, requestOptions?: Referrals.RequestOptions): Promise<void>;
158
+ accept(referralId: string, request: ReferralExchange.AcceptReferralBody, requestOptions?: Referrals.RequestOptions): Promise<void>;
144
159
  /**
145
160
  * @param {string} referralId - Referral ID
146
161
  * @param {ReferralExchange.RejectReferralBody} request
@@ -150,20 +165,26 @@ export declare class Referrals {
150
165
  *
151
166
  * @example
152
167
  * await client.referrals.reject("referralId", {
153
- * rejectionMessage: "rejectionMessage"
168
+ * rejectionMessage: "rejectionMessage",
169
+ * institutionIdType: "hci",
170
+ * institutionId: "institutionId"
154
171
  * })
155
172
  */
156
173
  reject(referralId: string, request: ReferralExchange.RejectReferralBody, requestOptions?: Referrals.RequestOptions): Promise<void>;
157
174
  /**
158
175
  * @param {string} referralId - Referral ID
176
+ * @param {ReferralExchange.BackToDraftReferralBody} request
159
177
  * @param {Referrals.RequestOptions} requestOptions - Request-specific configuration.
160
178
  *
161
179
  * @throws {@link ReferralExchange.UnauthorizedError}
162
180
  *
163
181
  * @example
164
- * await client.referrals.backToDraft("referralId")
182
+ * await client.referrals.backToDraft("referralId", {
183
+ * institutionIdType: "hci",
184
+ * institutionId: "institutionId"
185
+ * })
165
186
  */
166
- backToDraft(referralId: string, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
187
+ backToDraft(referralId: string, request: ReferralExchange.BackToDraftReferralBody, requestOptions?: Referrals.RequestOptions): Promise<ReferralExchange.ReferralDto>;
167
188
  protected _getCustomAuthorizationHeaders(): Promise<{
168
189
  Authorization: string | undefined;
169
190
  }>;