@opengovsg/refx-ts-sdk 0.0.61 → 0.0.62

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 (90) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +15 -10
  3. package/api/resources/eligibility/client/Client.js +1 -1
  4. package/api/resources/health/client/Client.js +1 -1
  5. package/api/resources/index.d.ts +2 -0
  6. package/api/resources/index.js +3 -1
  7. package/api/resources/links/client/Client.js +1 -1
  8. package/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +2 -1
  9. package/api/resources/links/types/CreateLinkReqUpsertClinicType.js +1 -0
  10. package/api/resources/notes/client/Client.js +1 -1
  11. package/api/resources/offerings/client/Client.js +3 -3
  12. package/api/resources/public/client/Client.js +1 -1
  13. package/api/resources/referrals/client/Client.js +10 -10
  14. package/api/resources/referrers/client/Client.d.ts +44 -0
  15. package/api/resources/referrers/client/Client.js +128 -0
  16. package/api/resources/referrers/client/index.d.ts +1 -0
  17. package/api/resources/referrers/client/index.js +17 -0
  18. package/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.d.ts +17 -0
  19. package/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.js +5 -0
  20. package/api/resources/referrers/client/requests/index.d.ts +1 -0
  21. package/api/resources/referrers/client/requests/index.js +2 -0
  22. package/api/resources/referrers/index.d.ts +1 -0
  23. package/api/resources/referrers/index.js +17 -0
  24. package/api/resources/webhooks/client/Client.js +2 -2
  25. package/api/types/EligibilityReasonDto.d.ts +9 -0
  26. package/api/types/EligibilityReasonDto.js +5 -0
  27. package/api/types/FullReferralDto.d.ts +2 -0
  28. package/api/types/FullReferralDtoClinicType.d.ts +2 -1
  29. package/api/types/FullReferralDtoClinicType.js +1 -0
  30. package/api/types/GetReferrersRes.d.ts +7 -0
  31. package/api/types/GetReferrersRes.js +5 -0
  32. package/api/types/OfferingDto.d.ts +2 -0
  33. package/api/types/OfferingWithAllowedDto.d.ts +3 -1
  34. package/api/types/PublicReferralDtoClinicType.d.ts +2 -1
  35. package/api/types/PublicReferralDtoClinicType.js +1 -0
  36. package/api/types/ReferralDto.d.ts +2 -0
  37. package/api/types/ReferralDtoClinicType.d.ts +2 -1
  38. package/api/types/ReferralDtoClinicType.js +1 -0
  39. package/api/types/ReferrerStatusDto.d.ts +15 -0
  40. package/api/types/ReferrerStatusDto.js +5 -0
  41. package/api/types/index.d.ts +3 -0
  42. package/api/types/index.js +3 -0
  43. package/dist/Client.d.ts +3 -0
  44. package/dist/Client.js +15 -10
  45. package/dist/api/resources/eligibility/client/Client.js +1 -1
  46. package/dist/api/resources/health/client/Client.js +1 -1
  47. package/dist/api/resources/index.d.ts +2 -0
  48. package/dist/api/resources/index.js +3 -1
  49. package/dist/api/resources/links/client/Client.js +1 -1
  50. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +2 -1
  51. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.js +1 -0
  52. package/dist/api/resources/notes/client/Client.js +1 -1
  53. package/dist/api/resources/offerings/client/Client.js +3 -3
  54. package/dist/api/resources/public/client/Client.js +1 -1
  55. package/dist/api/resources/referrals/client/Client.js +10 -10
  56. package/dist/api/resources/referrers/client/Client.d.ts +44 -0
  57. package/dist/api/resources/referrers/client/Client.js +128 -0
  58. package/dist/api/resources/referrers/client/index.d.ts +1 -0
  59. package/dist/api/resources/referrers/client/index.js +17 -0
  60. package/dist/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.d.ts +17 -0
  61. package/dist/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.js +5 -0
  62. package/dist/api/resources/referrers/client/requests/index.d.ts +1 -0
  63. package/dist/api/resources/referrers/client/requests/index.js +2 -0
  64. package/dist/api/resources/referrers/index.d.ts +1 -0
  65. package/dist/api/resources/referrers/index.js +17 -0
  66. package/dist/api/resources/webhooks/client/Client.js +2 -2
  67. package/dist/api/types/EligibilityReasonDto.d.ts +9 -0
  68. package/dist/api/types/EligibilityReasonDto.js +5 -0
  69. package/dist/api/types/FullReferralDto.d.ts +2 -0
  70. package/dist/api/types/FullReferralDtoClinicType.d.ts +2 -1
  71. package/dist/api/types/FullReferralDtoClinicType.js +1 -0
  72. package/dist/api/types/GetReferrersRes.d.ts +7 -0
  73. package/dist/api/types/GetReferrersRes.js +5 -0
  74. package/dist/api/types/OfferingDto.d.ts +2 -0
  75. package/dist/api/types/OfferingWithAllowedDto.d.ts +3 -1
  76. package/dist/api/types/PublicReferralDtoClinicType.d.ts +2 -1
  77. package/dist/api/types/PublicReferralDtoClinicType.js +1 -0
  78. package/dist/api/types/ReferralDto.d.ts +2 -0
  79. package/dist/api/types/ReferralDtoClinicType.d.ts +2 -1
  80. package/dist/api/types/ReferralDtoClinicType.js +1 -0
  81. package/dist/api/types/ReferrerStatusDto.d.ts +15 -0
  82. package/dist/api/types/ReferrerStatusDto.js +5 -0
  83. package/dist/api/types/index.d.ts +3 -0
  84. package/dist/api/types/index.js +3 -0
  85. package/dist/version.d.ts +1 -1
  86. package/dist/version.js +1 -1
  87. package/package.json +1 -1
  88. package/reference.md +52 -0
  89. package/version.d.ts +1 -1
  90. package/version.js +1 -1
package/Client.d.ts CHANGED
@@ -6,6 +6,7 @@ import * as core from "./core";
6
6
  import { Eligibility } from "./api/resources/eligibility/client/Client";
7
7
  import { Referrals } from "./api/resources/referrals/client/Client";
8
8
  import { Notes } from "./api/resources/notes/client/Client";
9
+ import { Referrers } from "./api/resources/referrers/client/Client";
9
10
  import { Offerings } from "./api/resources/offerings/client/Client";
10
11
  import { Links } from "./api/resources/links/client/Client";
11
12
  import { Public } from "./api/resources/public/client/Client";
@@ -35,6 +36,7 @@ export declare class ReferralExchangeClient {
35
36
  protected _eligibility: Eligibility | undefined;
36
37
  protected _referrals: Referrals | undefined;
37
38
  protected _notes: Notes | undefined;
39
+ protected _referrers: Referrers | undefined;
38
40
  protected _offerings: Offerings | undefined;
39
41
  protected _links: Links | undefined;
40
42
  protected _public: Public | undefined;
@@ -44,6 +46,7 @@ export declare class ReferralExchangeClient {
44
46
  get eligibility(): Eligibility;
45
47
  get referrals(): Referrals;
46
48
  get notes(): Notes;
49
+ get referrers(): Referrers;
47
50
  get offerings(): Offerings;
48
51
  get links(): Links;
49
52
  get public(): Public;
package/Client.js CHANGED
@@ -7,11 +7,12 @@ exports.ReferralExchangeClient = void 0;
7
7
  const Client_1 = require("./api/resources/eligibility/client/Client");
8
8
  const Client_2 = require("./api/resources/referrals/client/Client");
9
9
  const Client_3 = require("./api/resources/notes/client/Client");
10
- const Client_4 = require("./api/resources/offerings/client/Client");
11
- const Client_5 = require("./api/resources/links/client/Client");
12
- const Client_6 = require("./api/resources/public/client/Client");
13
- const Client_7 = require("./api/resources/webhooks/client/Client");
14
- const Client_8 = require("./api/resources/health/client/Client");
10
+ const Client_4 = require("./api/resources/referrers/client/Client");
11
+ const Client_5 = require("./api/resources/offerings/client/Client");
12
+ const Client_6 = require("./api/resources/links/client/Client");
13
+ const Client_7 = require("./api/resources/public/client/Client");
14
+ const Client_8 = require("./api/resources/webhooks/client/Client");
15
+ const Client_9 = require("./api/resources/health/client/Client");
15
16
  class ReferralExchangeClient {
16
17
  constructor(_options = {}) {
17
18
  this._options = _options;
@@ -28,25 +29,29 @@ class ReferralExchangeClient {
28
29
  var _a;
29
30
  return ((_a = this._notes) !== null && _a !== void 0 ? _a : (this._notes = new Client_3.Notes(this._options)));
30
31
  }
32
+ get referrers() {
33
+ var _a;
34
+ return ((_a = this._referrers) !== null && _a !== void 0 ? _a : (this._referrers = new Client_4.Referrers(this._options)));
35
+ }
31
36
  get offerings() {
32
37
  var _a;
33
- return ((_a = this._offerings) !== null && _a !== void 0 ? _a : (this._offerings = new Client_4.Offerings(this._options)));
38
+ return ((_a = this._offerings) !== null && _a !== void 0 ? _a : (this._offerings = new Client_5.Offerings(this._options)));
34
39
  }
35
40
  get links() {
36
41
  var _a;
37
- return ((_a = this._links) !== null && _a !== void 0 ? _a : (this._links = new Client_5.Links(this._options)));
42
+ return ((_a = this._links) !== null && _a !== void 0 ? _a : (this._links = new Client_6.Links(this._options)));
38
43
  }
39
44
  get public() {
40
45
  var _a;
41
- return ((_a = this._public) !== null && _a !== void 0 ? _a : (this._public = new Client_6.Public(this._options)));
46
+ return ((_a = this._public) !== null && _a !== void 0 ? _a : (this._public = new Client_7.Public(this._options)));
42
47
  }
43
48
  get webhooks() {
44
49
  var _a;
45
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_7.Webhooks(this._options)));
50
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_8.Webhooks(this._options)));
46
51
  }
47
52
  get health() {
48
53
  var _a;
49
- return ((_a = this._health) !== null && _a !== void 0 ? _a : (this._health = new Client_8.Health(this._options)));
54
+ return ((_a = this._health) !== null && _a !== void 0 ? _a : (this._health = new Client_9.Health(this._options)));
50
55
  }
51
56
  }
52
57
  exports.ReferralExchangeClient = ReferralExchangeClient;
@@ -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.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),
92
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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.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),
72
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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,
@@ -3,6 +3,7 @@ export * from "./links/types";
3
3
  export * as eligibility from "./eligibility";
4
4
  export * as referrals from "./referrals";
5
5
  export * as notes from "./notes";
6
+ export * as referrers from "./referrers";
6
7
  export * as offerings from "./offerings";
7
8
  export * as public_ from "./public";
8
9
  export * as webhooks from "./webhooks";
@@ -10,6 +11,7 @@ export * as health from "./health";
10
11
  export * from "./eligibility/client/requests";
11
12
  export * from "./referrals/client/requests";
12
13
  export * from "./notes/client/requests";
14
+ export * from "./referrers/client/requests";
13
15
  export * from "./offerings/client/requests";
14
16
  export * from "./links/client/requests";
15
17
  export * from "./public/client/requests";
@@ -36,12 +36,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.notes = exports.referrals = exports.eligibility = exports.links = void 0;
39
+ exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.referrers = exports.notes = exports.referrals = exports.eligibility = exports.links = void 0;
40
40
  exports.links = __importStar(require("./links"));
41
41
  __exportStar(require("./links/types"), exports);
42
42
  exports.eligibility = __importStar(require("./eligibility"));
43
43
  exports.referrals = __importStar(require("./referrals"));
44
44
  exports.notes = __importStar(require("./notes"));
45
+ exports.referrers = __importStar(require("./referrers"));
45
46
  exports.offerings = __importStar(require("./offerings"));
46
47
  exports.public_ = __importStar(require("./public"));
47
48
  exports.webhooks = __importStar(require("./webhooks"));
@@ -49,6 +50,7 @@ exports.health = __importStar(require("./health"));
49
50
  __exportStar(require("./eligibility/client/requests"), exports);
50
51
  __exportStar(require("./referrals/client/requests"), exports);
51
52
  __exportStar(require("./notes/client/requests"), exports);
53
+ __exportStar(require("./referrers/client/requests"), exports);
52
54
  __exportStar(require("./offerings/client/requests"), exports);
53
55
  __exportStar(require("./links/client/requests"), exports);
54
56
  __exportStar(require("./public/client/requests"), exports);
@@ -81,7 +81,7 @@ class Links {
81
81
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
82
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"),
83
83
  method: "POST",
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),
84
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
85
85
  contentType: "application/json",
86
86
  requestType: "json",
87
87
  body: request,
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * Clinic type
6
6
  */
7
- export type CreateLinkReqUpsertClinicType = "CHAS-only" | "CHAS and HSG";
7
+ export type CreateLinkReqUpsertClinicType = "CHAS-only" | "CHAS and HSG" | "CHAS and Healthier SG";
8
8
  export declare const CreateLinkReqUpsertClinicType: {
9
9
  readonly ChasOnly: "CHAS-only";
10
10
  readonly ChasAndHsg: "CHAS and HSG";
11
+ readonly ChasAndHealthierSg: "CHAS and Healthier SG";
11
12
  };
@@ -7,4 +7,5 @@ exports.CreateLinkReqUpsertClinicType = void 0;
7
7
  exports.CreateLinkReqUpsertClinicType = {
8
8
  ChasOnly: "CHAS-only",
9
9
  ChasAndHsg: "CHAS and HSG",
10
+ ChasAndHealthierSg: "CHAS and Healthier SG",
10
11
  };
@@ -78,7 +78,7 @@ class Notes {
78
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
79
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`),
80
80
  method: "POST",
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),
81
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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
82
  contentType: "application/json",
83
83
  requestType: "json",
84
84
  body: Object.assign(Object.assign({}, request), { institutionIdType: "hci" }),
@@ -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.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),
88
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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.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),
147
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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.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),
210
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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",
@@ -91,7 +91,7 @@ class Public {
91
91
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
92
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)}`),
93
93
  method: "GET",
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),
94
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
95
95
  contentType: "application/json",
96
96
  queryParameters: _queryParams,
97
97
  requestType: "json",
@@ -107,7 +107,7 @@ class Referrals {
107
107
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
108
108
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/referrals"),
109
109
  method: "GET",
110
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.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),
110
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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.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),
186
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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,
@@ -267,7 +267,7 @@ class Referrals {
267
267
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
268
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
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.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),
270
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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
271
  contentType: "application/json",
272
272
  queryParameters: _queryParams,
273
273
  requestType: "json",
@@ -338,7 +338,7 @@ class Referrals {
338
338
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
339
339
  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)}`),
340
340
  method: "GET",
341
- 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),
341
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
342
342
  contentType: "application/json",
343
343
  queryParameters: _queryParams,
344
344
  requestType: "json",
@@ -400,7 +400,7 @@ class Referrals {
400
400
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
401
401
  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)}`),
402
402
  method: "DELETE",
403
- 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),
403
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
404
404
  contentType: "application/json",
405
405
  queryParameters: _queryParams,
406
406
  requestType: "json",
@@ -456,7 +456,7 @@ class Referrals {
456
456
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
457
457
  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`),
458
458
  method: "POST",
459
- 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),
459
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
460
460
  contentType: "application/json",
461
461
  requestType: "json",
462
462
  body: Object.assign(Object.assign({}, request), { institutionIdType: "hci" }),
@@ -513,7 +513,7 @@ class Referrals {
513
513
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
514
514
  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`),
515
515
  method: "POST",
516
- 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),
516
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
517
517
  contentType: "application/json",
518
518
  requestType: "json",
519
519
  body: Object.assign(Object.assign({}, request), { institutionIdType: "hci" }),
@@ -570,7 +570,7 @@ class Referrals {
570
570
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
571
571
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/accept`),
572
572
  method: "POST",
573
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.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),
573
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
574
574
  contentType: "application/json",
575
575
  requestType: "json",
576
576
  body: Object.assign(Object.assign({}, request), { institutionIdType: "hci" }),
@@ -629,7 +629,7 @@ class Referrals {
629
629
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
630
630
  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`),
631
631
  method: "POST",
632
- 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),
632
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
633
633
  contentType: "application/json",
634
634
  requestType: "json",
635
635
  body: Object.assign(Object.assign({}, request), { institutionIdType: "hci" }),
@@ -685,7 +685,7 @@ class Referrals {
685
685
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
686
686
  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`),
687
687
  method: "POST",
688
- 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),
688
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
689
689
  contentType: "application/json",
690
690
  requestType: "json",
691
691
  body: Object.assign(Object.assign({}, request), { institutionIdType: "hci" }),
@@ -0,0 +1,44 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ import * as ReferralExchange from "../../../index";
7
+ export declare namespace Referrers {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ apiKey?: core.Supplier<string | undefined>;
13
+ fetcher?: core.FetchFunction;
14
+ }
15
+ interface RequestOptions {
16
+ /** The maximum time to wait for a response in seconds. */
17
+ timeoutInSeconds?: number;
18
+ /** The number of times to retry the request. Defaults to 2. */
19
+ maxRetries?: number;
20
+ /** A hook to abort the request. */
21
+ abortSignal?: AbortSignal;
22
+ /** Additional headers to include in the request. */
23
+ headers?: Record<string, string>;
24
+ }
25
+ }
26
+ export declare class Referrers {
27
+ protected readonly _options: Referrers.Options;
28
+ constructor(_options?: Referrers.Options);
29
+ /**
30
+ * @param {ReferralExchange.ApiHoldingControllerGetReferrersRequest} request
31
+ * @param {Referrers.RequestOptions} requestOptions - Request-specific configuration.
32
+ *
33
+ * @throws {@link ReferralExchange.UnauthorizedError}
34
+ *
35
+ * @example
36
+ * await client.referrers.apiHoldingControllerGetReferrers({
37
+ * idType: "mcr"
38
+ * })
39
+ */
40
+ apiHoldingControllerGetReferrers(request: ReferralExchange.ApiHoldingControllerGetReferrersRequest, requestOptions?: Referrers.RequestOptions): Promise<ReferralExchange.GetReferrersRes>;
41
+ protected _getCustomAuthorizationHeaders(): Promise<{
42
+ Authorization: string | undefined;
43
+ }>;
44
+ }
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Referrers = void 0;
52
+ const environments = __importStar(require("../../../../environments"));
53
+ const core = __importStar(require("../../../../core"));
54
+ const ReferralExchange = __importStar(require("../../../index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const errors = __importStar(require("../../../../errors/index"));
57
+ class Referrers {
58
+ constructor(_options = {}) {
59
+ this._options = _options;
60
+ }
61
+ /**
62
+ * @param {ReferralExchange.ApiHoldingControllerGetReferrersRequest} request
63
+ * @param {Referrers.RequestOptions} requestOptions - Request-specific configuration.
64
+ *
65
+ * @throws {@link ReferralExchange.UnauthorizedError}
66
+ *
67
+ * @example
68
+ * await client.referrers.apiHoldingControllerGetReferrers({
69
+ * idType: "mcr"
70
+ * })
71
+ */
72
+ apiHoldingControllerGetReferrers(request, requestOptions) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ var _a, _b, _c;
75
+ const { idType, whitelisted } = request;
76
+ const _queryParams = {};
77
+ _queryParams["idType"] = idType;
78
+ if (whitelisted != null) {
79
+ _queryParams["whitelisted"] = whitelisted.toString();
80
+ }
81
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
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/referrers"),
83
+ method: "GET",
84
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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),
85
+ contentType: "application/json",
86
+ queryParameters: _queryParams,
87
+ requestType: "json",
88
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
89
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
90
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
91
+ });
92
+ if (_response.ok) {
93
+ return _response.body;
94
+ }
95
+ if (_response.error.reason === "status-code") {
96
+ switch (_response.error.statusCode) {
97
+ case 401:
98
+ throw new ReferralExchange.UnauthorizedError(_response.error.body);
99
+ default:
100
+ throw new errors.ReferralExchangeError({
101
+ statusCode: _response.error.statusCode,
102
+ body: _response.error.body,
103
+ });
104
+ }
105
+ }
106
+ switch (_response.error.reason) {
107
+ case "non-json":
108
+ throw new errors.ReferralExchangeError({
109
+ statusCode: _response.error.statusCode,
110
+ body: _response.error.rawBody,
111
+ });
112
+ case "timeout":
113
+ throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling GET /api/v1/referrers.");
114
+ case "unknown":
115
+ throw new errors.ReferralExchangeError({
116
+ message: _response.error.errorMessage,
117
+ });
118
+ }
119
+ });
120
+ }
121
+ _getCustomAuthorizationHeaders() {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
124
+ return { Authorization: apiKeyValue };
125
+ });
126
+ }
127
+ }
128
+ exports.Referrers = Referrers;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -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("./requests"), exports);
@@ -0,0 +1,17 @@
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
+ * idType: "mcr"
9
+ * }
10
+ */
11
+ export interface ApiHoldingControllerGetReferrersRequest {
12
+ idType: ReferralExchange.ReferrerIdType;
13
+ /**
14
+ * Filter by whitelisting status. true = whitelisted only, false = unwhitelisted only, omit = all.
15
+ */
16
+ whitelisted?: boolean;
17
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { type ApiHoldingControllerGetReferrersRequest } from "./ApiHoldingControllerGetReferrersRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -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("./client"), exports);
@@ -69,7 +69,7 @@ class Webhooks {
69
69
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
70
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/webhooks/formsg/singhealth-profile"),
71
71
  method: "POST",
72
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.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),
72
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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.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),
116
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.62", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.62", "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,