@opengovsg/refx-ts-sdk 0.0.60 → 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 (142) 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.d.ts +2 -1
  8. package/api/resources/links/client/Client.js +2 -1
  9. package/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +2 -1
  10. package/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +2 -1
  11. package/api/resources/links/types/CreateLinkReqUpsertClinicType.js +1 -0
  12. package/api/resources/notes/client/Client.d.ts +3 -1
  13. package/api/resources/notes/client/Client.js +5 -3
  14. package/api/resources/notes/client/requests/CreateNoteReq.d.ts +5 -1
  15. package/api/resources/offerings/client/Client.js +3 -3
  16. package/api/resources/public/client/Client.d.ts +4 -2
  17. package/api/resources/public/client/Client.js +10 -8
  18. package/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +13 -3
  19. package/api/resources/referrals/client/Client.d.ts +32 -12
  20. package/api/resources/referrals/client/Client.js +59 -33
  21. package/api/resources/referrals/client/requests/AcceptReferralBody.d.ts +6 -1
  22. package/api/resources/referrals/client/requests/AmendReferralReq.d.ts +5 -1
  23. package/api/resources/referrals/client/requests/BackToDraftReferralBody.d.ts +14 -0
  24. package/api/resources/referrals/client/requests/CancelReferralReq.d.ts +6 -1
  25. package/api/resources/referrals/client/requests/ReferralsDeleteRequest.d.ts +21 -0
  26. package/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +13 -3
  27. package/api/resources/referrals/client/requests/RejectReferralBody.d.ts +5 -1
  28. package/api/resources/referrals/client/requests/index.d.ts +2 -0
  29. package/api/resources/referrers/client/Client.d.ts +44 -0
  30. package/api/resources/referrers/client/Client.js +128 -0
  31. package/api/resources/referrers/client/index.d.ts +1 -0
  32. package/api/resources/referrers/client/index.js +17 -0
  33. package/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.d.ts +17 -0
  34. package/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.js +5 -0
  35. package/api/resources/referrers/client/requests/index.d.ts +1 -0
  36. package/api/resources/referrers/client/requests/index.js +2 -0
  37. package/api/resources/referrers/index.d.ts +1 -0
  38. package/api/resources/referrers/index.js +17 -0
  39. package/api/resources/webhooks/client/Client.js +2 -2
  40. package/api/types/EligibilityReasonDto.d.ts +9 -0
  41. package/api/types/EligibilityReasonDto.js +5 -0
  42. package/api/types/FullReferralDto.d.ts +3 -1
  43. package/api/types/FullReferralDtoClinicType.d.ts +2 -1
  44. package/api/types/FullReferralDtoClinicType.js +1 -0
  45. package/api/types/GetReferrersRes.d.ts +7 -0
  46. package/api/types/GetReferrersRes.js +5 -0
  47. package/api/types/InstitutionIdType.d.ts +3 -0
  48. package/api/types/OfferingDto.d.ts +2 -0
  49. package/api/types/OfferingWithAllowedDto.d.ts +3 -1
  50. package/api/types/PublicReferralDtoClinicType.d.ts +2 -1
  51. package/api/types/PublicReferralDtoClinicType.js +1 -0
  52. package/api/types/{ReferralLinkDto.d.ts → ReferralActionLinkDto.d.ts} +2 -2
  53. package/api/types/ReferralActionLinkDto.js +5 -0
  54. package/{dist/api/types/ReferralLinkType.d.ts → api/types/ReferralActionLinkType.d.ts} +2 -3
  55. package/{dist/api/types/ReferralLinkType.js → api/types/ReferralActionLinkType.js} +2 -3
  56. package/api/types/ReferralDto.d.ts +2 -0
  57. package/api/types/ReferralDtoClinicType.d.ts +2 -1
  58. package/api/types/ReferralDtoClinicType.js +1 -0
  59. package/{dist/api/types/ReferralLinkDto.d.ts → api/types/ReferralUpsertLinkDto.d.ts} +2 -2
  60. package/api/types/ReferralUpsertLinkDto.js +5 -0
  61. package/api/types/ReferralUpsertLinkType.d.ts +7 -0
  62. package/api/types/ReferralUpsertLinkType.js +5 -0
  63. package/api/types/ReferrerStatusDto.d.ts +15 -0
  64. package/api/types/ReferrerStatusDto.js +5 -0
  65. package/api/types/index.d.ts +7 -2
  66. package/api/types/index.js +7 -2
  67. package/dist/Client.d.ts +3 -0
  68. package/dist/Client.js +15 -10
  69. package/dist/api/resources/eligibility/client/Client.js +1 -1
  70. package/dist/api/resources/health/client/Client.js +1 -1
  71. package/dist/api/resources/index.d.ts +2 -0
  72. package/dist/api/resources/index.js +3 -1
  73. package/dist/api/resources/links/client/Client.d.ts +2 -1
  74. package/dist/api/resources/links/client/Client.js +2 -1
  75. package/dist/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +2 -1
  76. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +2 -1
  77. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.js +1 -0
  78. package/dist/api/resources/notes/client/Client.d.ts +3 -1
  79. package/dist/api/resources/notes/client/Client.js +5 -3
  80. package/dist/api/resources/notes/client/requests/CreateNoteReq.d.ts +5 -1
  81. package/dist/api/resources/offerings/client/Client.js +3 -3
  82. package/dist/api/resources/public/client/Client.d.ts +4 -2
  83. package/dist/api/resources/public/client/Client.js +10 -8
  84. package/dist/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +13 -3
  85. package/dist/api/resources/referrals/client/Client.d.ts +32 -12
  86. package/dist/api/resources/referrals/client/Client.js +59 -33
  87. package/dist/api/resources/referrals/client/requests/AcceptReferralBody.d.ts +6 -1
  88. package/dist/api/resources/referrals/client/requests/AmendReferralReq.d.ts +5 -1
  89. package/dist/api/resources/referrals/client/requests/BackToDraftReferralBody.d.ts +14 -0
  90. package/dist/api/resources/referrals/client/requests/BackToDraftReferralBody.js +5 -0
  91. package/dist/api/resources/referrals/client/requests/CancelReferralReq.d.ts +6 -1
  92. package/dist/api/resources/referrals/client/requests/ReferralsDeleteRequest.d.ts +21 -0
  93. package/dist/api/resources/referrals/client/requests/ReferralsDeleteRequest.js +5 -0
  94. package/dist/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +13 -3
  95. package/dist/api/resources/referrals/client/requests/RejectReferralBody.d.ts +5 -1
  96. package/dist/api/resources/referrals/client/requests/index.d.ts +2 -0
  97. package/dist/api/resources/referrers/client/Client.d.ts +44 -0
  98. package/dist/api/resources/referrers/client/Client.js +128 -0
  99. package/dist/api/resources/referrers/client/index.d.ts +1 -0
  100. package/dist/api/resources/referrers/client/index.js +17 -0
  101. package/dist/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.d.ts +17 -0
  102. package/dist/api/resources/referrers/client/requests/ApiHoldingControllerGetReferrersRequest.js +5 -0
  103. package/dist/api/resources/referrers/client/requests/index.d.ts +1 -0
  104. package/dist/api/resources/referrers/client/requests/index.js +2 -0
  105. package/dist/api/resources/referrers/index.d.ts +1 -0
  106. package/dist/api/resources/referrers/index.js +17 -0
  107. package/dist/api/resources/webhooks/client/Client.js +2 -2
  108. package/dist/api/types/EligibilityReasonDto.d.ts +9 -0
  109. package/dist/api/types/EligibilityReasonDto.js +5 -0
  110. package/dist/api/types/FullReferralDto.d.ts +3 -1
  111. package/dist/api/types/FullReferralDtoClinicType.d.ts +2 -1
  112. package/dist/api/types/FullReferralDtoClinicType.js +1 -0
  113. package/dist/api/types/GetReferrersRes.d.ts +7 -0
  114. package/dist/api/types/GetReferrersRes.js +5 -0
  115. package/dist/api/types/InstitutionIdType.d.ts +3 -0
  116. package/dist/api/types/OfferingDto.d.ts +2 -0
  117. package/dist/api/types/OfferingWithAllowedDto.d.ts +3 -1
  118. package/dist/api/types/PublicReferralDtoClinicType.d.ts +2 -1
  119. package/dist/api/types/PublicReferralDtoClinicType.js +1 -0
  120. package/dist/api/types/ReferralActionLinkDto.d.ts +11 -0
  121. package/dist/api/types/ReferralActionLinkDto.js +5 -0
  122. package/{api/types/ReferralLinkType.d.ts → dist/api/types/ReferralActionLinkType.d.ts} +2 -3
  123. package/{api/types/ReferralLinkType.js → dist/api/types/ReferralActionLinkType.js} +2 -3
  124. package/dist/api/types/ReferralDto.d.ts +2 -0
  125. package/dist/api/types/ReferralDtoClinicType.d.ts +2 -1
  126. package/dist/api/types/ReferralDtoClinicType.js +1 -0
  127. package/dist/api/types/ReferralUpsertLinkDto.d.ts +11 -0
  128. package/dist/api/types/ReferralUpsertLinkDto.js +5 -0
  129. package/dist/api/types/ReferralUpsertLinkType.d.ts +7 -0
  130. package/dist/api/types/ReferralUpsertLinkType.js +5 -0
  131. package/dist/api/types/ReferrerStatusDto.d.ts +15 -0
  132. package/dist/api/types/ReferrerStatusDto.js +5 -0
  133. package/dist/api/types/index.d.ts +7 -2
  134. package/dist/api/types/index.js +7 -2
  135. package/dist/version.d.ts +1 -1
  136. package/dist/version.js +1 -1
  137. package/package.json +1 -1
  138. package/reference.md +98 -7
  139. package/version.d.ts +1 -1
  140. package/version.js +1 -1
  141. /package/api/{types/ReferralLinkDto.js → resources/referrals/client/requests/BackToDraftReferralBody.js} +0 -0
  142. /package/{dist/api/types/ReferralLinkDto.js → api/resources/referrals/client/requests/ReferralsDeleteRequest.js} +0 -0
@@ -2,7 +2,9 @@ export { type ReferralsListRequest } from "./ReferralsListRequest";
2
2
  export { type CreateReferralReq } from "./CreateReferralReq";
3
3
  export { type ReferralsListByInstitutionRequest } from "./ReferralsListByInstitutionRequest";
4
4
  export { type ReferralsGetRequest } from "./ReferralsGetRequest";
5
+ export { type ReferralsDeleteRequest } from "./ReferralsDeleteRequest";
5
6
  export { type CancelReferralReq } from "./CancelReferralReq";
6
7
  export { type AmendReferralReq } from "./AmendReferralReq";
7
8
  export { type AcceptReferralBody } from "./AcceptReferralBody";
8
9
  export { type RejectReferralBody } from "./RejectReferralBody";
10
+ export { type BackToDraftReferralBody } from "./BackToDraftReferralBody";
@@ -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.60", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.60", "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.60", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.60", "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,
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EligibilityReasonDto {
5
+ /** Human-readable message explaining the eligibility failure */
6
+ message?: string;
7
+ /** Actionable information for the user, e.g. who to contact for access */
8
+ action?: string;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -28,12 +28,14 @@ export interface FullReferralDto {
28
28
  /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
29
29
  clinicalInfo?: string;
30
30
  status: ReferralExchange.FullReferralDtoStatus;
31
+ /** Whether this referral can be cancelled */
32
+ isCancellable: boolean;
31
33
  /** Timeslot start time (ISO datetime) */
32
34
  timeslotStartAt?: string;
33
35
  /** Appointment location */
34
36
  appointmentLocation?: string;
35
37
  notes: ReferralExchange.NoteDto[];
36
38
  timelineEvents: ReferralExchange.TimelineEventDto[];
37
- links: ReferralExchange.ReferralLinkDto[];
39
+ links: ReferralExchange.ReferralActionLinkDto[];
38
40
  appointments: ReferralExchange.AppointmentDto[];
39
41
  }
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * Clinic type
6
6
  */
7
- export type FullReferralDtoClinicType = "CHAS-only" | "CHAS and HSG";
7
+ export type FullReferralDtoClinicType = "CHAS-only" | "CHAS and HSG" | "CHAS and Healthier SG";
8
8
  export declare const FullReferralDtoClinicType: {
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.FullReferralDtoClinicType = void 0;
7
7
  exports.FullReferralDtoClinicType = {
8
8
  ChasOnly: "CHAS-only",
9
9
  ChasAndHsg: "CHAS and HSG",
10
+ ChasAndHealthierSg: "CHAS and Healthier SG",
10
11
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as ReferralExchange from "../index";
5
+ export interface GetReferrersRes {
6
+ referrers: ReferralExchange.ReferrerStatusDto[];
7
+ }
@@ -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,4 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ /**
5
+ * The type of institution ID
6
+ */
4
7
  export type InstitutionIdType = "hci";
@@ -18,4 +18,6 @@ export interface OfferingDto {
18
18
  timeslotPolicy: ReferralExchange.TimeslotPolicy;
19
19
  /** Category of the offering. Used to group offerings together. */
20
20
  category?: "aac";
21
+ /** NEHR code for the offering */
22
+ nehrCode?: string;
21
23
  }
@@ -18,8 +18,10 @@ export interface OfferingWithAllowedDto {
18
18
  timeslotPolicy: ReferralExchange.TimeslotPolicy;
19
19
  /** Category of the offering. Used to group offerings together. */
20
20
  category?: "aac";
21
+ /** NEHR code for the offering */
22
+ nehrCode?: string;
21
23
  /** Whether the offering is allowed based on the provided query parameters */
22
24
  isAllowed: boolean;
23
25
  /** Reason the offering is not allowed, if applicable */
24
- reason?: string;
26
+ reason?: ReferralExchange.EligibilityReasonDto[];
25
27
  }
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * Clinic type
6
6
  */
7
- export type PublicReferralDtoClinicType = "CHAS-only" | "CHAS and HSG";
7
+ export type PublicReferralDtoClinicType = "CHAS-only" | "CHAS and HSG" | "CHAS and Healthier SG";
8
8
  export declare const PublicReferralDtoClinicType: {
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.PublicReferralDtoClinicType = void 0;
7
7
  exports.PublicReferralDtoClinicType = {
8
8
  ChasOnly: "CHAS-only",
9
9
  ChasAndHsg: "CHAS and HSG",
10
+ ChasAndHealthierSg: "CHAS and Healthier SG",
10
11
  };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as ReferralExchange from "../index";
5
+ export interface ReferralActionLinkDto {
6
+ /** The ID of the referral */
7
+ referralId: string;
8
+ /** The URL of the link */
9
+ url: string;
10
+ type: ReferralExchange.ReferralActionLinkType;
11
+ }
@@ -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 });
@@ -4,9 +4,8 @@
4
4
  /**
5
5
  * type of referral link
6
6
  */
7
- export type ReferralLinkType = "upsert" | "amend" | "select-timeslot" | "fill-singhealth-formsg";
8
- export declare const ReferralLinkType: {
9
- readonly Upsert: "upsert";
7
+ export type ReferralActionLinkType = "amend" | "select-timeslot" | "fill-singhealth-formsg";
8
+ export declare const ReferralActionLinkType: {
10
9
  readonly Amend: "amend";
11
10
  readonly SelectTimeslot: "select-timeslot";
12
11
  readonly FillSinghealthFormsg: "fill-singhealth-formsg";
@@ -3,9 +3,8 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ReferralLinkType = void 0;
7
- exports.ReferralLinkType = {
8
- Upsert: "upsert",
6
+ exports.ReferralActionLinkType = void 0;
7
+ exports.ReferralActionLinkType = {
9
8
  Amend: "amend",
10
9
  SelectTimeslot: "select-timeslot",
11
10
  FillSinghealthFormsg: "fill-singhealth-formsg",
@@ -28,6 +28,8 @@ export interface ReferralDto {
28
28
  /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
29
29
  clinicalInfo?: string;
30
30
  status: ReferralExchange.ReferralDtoStatus;
31
+ /** Whether this referral can be cancelled */
32
+ isCancellable: boolean;
31
33
  /** Timeslot start time (ISO datetime) */
32
34
  timeslotStartAt?: string;
33
35
  /** Appointment location */
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * Clinic type
6
6
  */
7
- export type ReferralDtoClinicType = "CHAS-only" | "CHAS and HSG";
7
+ export type ReferralDtoClinicType = "CHAS-only" | "CHAS and HSG" | "CHAS and Healthier SG";
8
8
  export declare const ReferralDtoClinicType: {
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.ReferralDtoClinicType = void 0;
7
7
  exports.ReferralDtoClinicType = {
8
8
  ChasOnly: "CHAS-only",
9
9
  ChasAndHsg: "CHAS and HSG",
10
+ ChasAndHealthierSg: "CHAS and Healthier SG",
10
11
  };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as ReferralExchange from "../index";
5
+ export interface ReferralUpsertLinkDto {
6
+ /** The ID of the referral */
7
+ referralId: string;
8
+ /** The URL of the link */
9
+ url: string;
10
+ type: ReferralExchange.ReferralUpsertLinkType;
11
+ }
@@ -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,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * type of referral link
6
+ */
7
+ export type ReferralUpsertLinkType = "upsert";
@@ -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,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as ReferralExchange from "../index";
5
+ export interface ReferrerStatusDto {
6
+ /** Referrer ID (e.g. MCR number). */
7
+ id: string;
8
+ idType: ReferralExchange.ReferrerIdType;
9
+ /** Institution HCI code. */
10
+ institutionId: string;
11
+ /** Timestamp when SingHealth whitelisted, or null. */
12
+ singhealthWhitelistedAt?: number;
13
+ /** Latest doctor email from referrals, or null. */
14
+ latestDoctorEmail?: string;
15
+ }
@@ -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 });
@@ -33,8 +33,8 @@ export * from "./AdditionalReferralField";
33
33
  export * from "./TimelineEventType";
34
34
  export * from "./TimelineEventDtoSystem";
35
35
  export * from "./TimelineEventDto";
36
- export * from "./ReferralLinkType";
37
- export * from "./ReferralLinkDto";
36
+ export * from "./ReferralActionLinkType";
37
+ export * from "./ReferralActionLinkDto";
38
38
  export * from "./AppointmentDtoStatus";
39
39
  export * from "./AppointmentDto";
40
40
  export * from "./FullReferralDtoClinicType";
@@ -44,12 +44,17 @@ export * from "./CreatePatientReqGender";
44
44
  export * from "./CreatePatientReqResidentialStatus";
45
45
  export * from "./CreatePatientReq";
46
46
  export * from "./CreateReferrerReq";
47
+ export * from "./ReferrerStatusDto";
48
+ export * from "./GetReferrersRes";
49
+ export * from "./EligibilityReasonDto";
47
50
  export * from "./OfferingWithAllowedDto";
48
51
  export * from "./Timeslot";
49
52
  export * from "./UpdateEmailAckOfferingReq";
50
53
  export * from "./TriggerEmailReminderBody";
51
54
  export * from "./FormMetadata";
52
55
  export * from "./CreateReferralFormReq";
56
+ export * from "./ReferralUpsertLinkType";
57
+ export * from "./ReferralUpsertLinkDto";
53
58
  export * from "./PublicReferralDtoClinicType";
54
59
  export * from "./PublicReferralDto";
55
60
  export * from "./UpdateAacReq";
@@ -49,8 +49,8 @@ __exportStar(require("./AdditionalReferralField"), exports);
49
49
  __exportStar(require("./TimelineEventType"), exports);
50
50
  __exportStar(require("./TimelineEventDtoSystem"), exports);
51
51
  __exportStar(require("./TimelineEventDto"), exports);
52
- __exportStar(require("./ReferralLinkType"), exports);
53
- __exportStar(require("./ReferralLinkDto"), exports);
52
+ __exportStar(require("./ReferralActionLinkType"), exports);
53
+ __exportStar(require("./ReferralActionLinkDto"), exports);
54
54
  __exportStar(require("./AppointmentDtoStatus"), exports);
55
55
  __exportStar(require("./AppointmentDto"), exports);
56
56
  __exportStar(require("./FullReferralDtoClinicType"), exports);
@@ -60,12 +60,17 @@ __exportStar(require("./CreatePatientReqGender"), exports);
60
60
  __exportStar(require("./CreatePatientReqResidentialStatus"), exports);
61
61
  __exportStar(require("./CreatePatientReq"), exports);
62
62
  __exportStar(require("./CreateReferrerReq"), exports);
63
+ __exportStar(require("./ReferrerStatusDto"), exports);
64
+ __exportStar(require("./GetReferrersRes"), exports);
65
+ __exportStar(require("./EligibilityReasonDto"), exports);
63
66
  __exportStar(require("./OfferingWithAllowedDto"), exports);
64
67
  __exportStar(require("./Timeslot"), exports);
65
68
  __exportStar(require("./UpdateEmailAckOfferingReq"), exports);
66
69
  __exportStar(require("./TriggerEmailReminderBody"), exports);
67
70
  __exportStar(require("./FormMetadata"), exports);
68
71
  __exportStar(require("./CreateReferralFormReq"), exports);
72
+ __exportStar(require("./ReferralUpsertLinkType"), exports);
73
+ __exportStar(require("./ReferralUpsertLinkDto"), exports);
69
74
  __exportStar(require("./PublicReferralDtoClinicType"), exports);
70
75
  __exportStar(require("./PublicReferralDto"), exports);
71
76
  __exportStar(require("./UpdateAacReq"), exports);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.60";
1
+ export declare const SDK_VERSION = "0.0.62";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.60";
4
+ exports.SDK_VERSION = "0.0.62";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengovsg/refx-ts-sdk",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "private": false,
5
5
  "repository": "https://github.com/opengovsg/refer-ts-sdk",
6
6
  "main": "./index.js",