@opengovsg/refx-ts-sdk 2024.10.3 → 2025.2.20
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.
- package/Client.d.ts +6 -2
- package/Client.js +14 -9
- package/README.md +11 -11
- package/api/index.d.ts +1 -1
- package/api/index.js +1 -1
- package/api/resources/eligibility/client/Client.d.ts +3 -2
- package/api/resources/eligibility/client/Client.js +5 -4
- package/api/resources/health/client/Client.d.ts +3 -2
- package/api/resources/health/client/Client.js +5 -4
- package/api/resources/index.d.ts +4 -2
- package/api/resources/index.js +5 -3
- package/api/resources/notes/client/Client.d.ts +41 -0
- package/api/resources/notes/client/Client.js +105 -0
- package/api/resources/notes/client/index.d.ts +1 -0
- package/api/resources/{referrals/types → notes/client}/index.js +1 -2
- package/api/resources/notes/client/requests/CreateNoteReq.d.ts +15 -0
- package/api/resources/notes/client/requests/index.d.ts +1 -0
- package/api/resources/notes/client/requests/index.js +2 -0
- package/api/resources/notes/index.d.ts +1 -0
- package/{dist/api/resources/referrals/types → api/resources/notes}/index.js +1 -2
- package/api/resources/offerings/client/Client.d.ts +6 -12
- package/api/resources/offerings/client/Client.js +11 -55
- package/api/resources/offerings/client/requests/OfferingsListTimeslotsRequest.d.ts +3 -2
- package/api/resources/public/client/Client.d.ts +6 -4
- package/api/resources/public/client/Client.js +14 -6
- package/api/resources/public/client/index.d.ts +1 -1
- package/api/resources/public/client/index.js +15 -0
- package/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +10 -0
- package/api/resources/public/client/requests/index.d.ts +1 -0
- package/api/resources/public/client/requests/index.js +2 -0
- package/api/resources/referrals/client/Client.d.ts +27 -19
- package/api/resources/referrals/client/Client.js +99 -49
- package/api/resources/referrals/client/requests/CreateReferralReq.d.ts +11 -13
- package/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +10 -0
- package/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +9 -9
- package/api/resources/referrals/client/requests/index.d.ts +1 -0
- package/api/resources/referrals/index.d.ts +0 -1
- package/api/resources/referrals/index.js +0 -1
- package/api/resources/webhooks/client/Client.d.ts +7 -6
- package/api/resources/webhooks/client/Client.js +12 -11
- package/api/types/AttachmentDto.d.ts +8 -0
- package/api/types/CreatePatientReq.d.ts +1 -1
- package/api/types/Form.d.ts +11 -0
- package/api/types/FormResponse.d.ts +4 -0
- package/{dist/api/types/CancelledEventMetadata.d.ts → api/types/FormResponseAnswer.d.ts} +1 -3
- package/api/types/FullReferralDto.d.ts +7 -4
- package/api/types/FullReferralDtoStatus.d.ts +3 -1
- package/api/types/FullReferralDtoStatus.js +2 -0
- package/api/types/GetReferralPatientDto.d.ts +1 -1
- package/api/types/InstitutionCoreDto.d.ts +2 -1
- package/api/types/{OfferingFullDto.d.ts → OfferingDto.d.ts} +6 -3
- package/api/types/PaginatedQuery.d.ts +2 -2
- package/api/types/PublicReferralDto.d.ts +7 -2
- package/api/types/ReferralDto.d.ts +7 -4
- package/api/types/ReferralDtoStatus.d.ts +3 -1
- package/api/types/ReferralDtoStatus.js +2 -0
- package/api/types/ReferralEligibility.d.ts +1 -1
- package/api/{resources/referrals/types/ReferralsListRequestRole.d.ts → types/ReferralRole.d.ts} +2 -2
- package/{dist/api/resources/referrals/types/ReferralsListRequestRole.js → api/types/ReferralRole.js} +2 -2
- package/{dist/api/resources/referrals/types/ReferralsListRequestStatusItem.d.ts → api/types/ReferralStatusFilter.d.ts} +2 -2
- package/{dist/api/resources/referrals/types/ReferralsListRequestStatusItem.js → api/types/ReferralStatusFilter.js} +2 -2
- package/api/types/ReferringDoctorDto.d.ts +9 -0
- package/api/types/SubsidyEligibility.d.ts +1 -1
- package/api/types/System.d.ts +11 -0
- package/api/types/System.js +13 -0
- package/api/types/TimelineEventDto.d.ts +4 -2
- package/api/types/TimelineEventDtoSystem.d.ts +5 -1
- package/api/types/TimelineEventDtoSystem.js +1 -0
- package/{dist/api/types/TimelineEventDtoType.d.ts → api/types/TimelineEventType.d.ts} +3 -2
- package/{dist/api/types/TimelineEventDtoType.js → api/types/TimelineEventType.js} +3 -2
- package/api/types/TimeslotPolicy.d.ts +15 -0
- package/api/types/TimeslotPolicy.js +11 -0
- package/api/types/index.d.ts +10 -15
- package/api/types/index.js +10 -15
- package/dist/Client.d.ts +6 -2
- package/dist/Client.js +14 -9
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/resources/eligibility/client/Client.d.ts +3 -2
- package/dist/api/resources/eligibility/client/Client.js +5 -4
- package/dist/api/resources/health/client/Client.d.ts +3 -2
- package/dist/api/resources/health/client/Client.js +5 -4
- package/dist/api/resources/index.d.ts +4 -2
- package/dist/api/resources/index.js +5 -3
- package/dist/api/resources/notes/client/Client.d.ts +41 -0
- package/dist/api/resources/notes/client/Client.js +105 -0
- package/dist/api/resources/notes/client/index.d.ts +1 -0
- package/dist/api/resources/notes/client/index.js +17 -0
- package/dist/api/resources/notes/client/requests/CreateNoteReq.d.ts +15 -0
- package/dist/api/resources/notes/client/requests/index.d.ts +1 -0
- package/dist/api/resources/notes/client/requests/index.js +2 -0
- package/dist/api/resources/notes/index.d.ts +1 -0
- package/dist/api/resources/notes/index.js +17 -0
- package/dist/api/resources/offerings/client/Client.d.ts +6 -12
- package/dist/api/resources/offerings/client/Client.js +11 -55
- package/dist/api/resources/offerings/client/requests/OfferingsListTimeslotsRequest.d.ts +3 -2
- package/dist/api/resources/public/client/Client.d.ts +6 -4
- package/dist/api/resources/public/client/Client.js +14 -6
- package/dist/api/resources/public/client/index.d.ts +1 -1
- package/dist/api/resources/public/client/index.js +15 -0
- package/dist/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +10 -0
- package/dist/api/resources/public/client/requests/index.d.ts +1 -0
- package/dist/api/resources/public/client/requests/index.js +2 -0
- package/dist/api/resources/referrals/client/Client.d.ts +27 -19
- package/dist/api/resources/referrals/client/Client.js +99 -49
- package/dist/api/resources/referrals/client/requests/CreateReferralReq.d.ts +11 -13
- package/dist/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +10 -0
- package/dist/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +9 -9
- package/dist/api/resources/referrals/client/requests/index.d.ts +1 -0
- package/dist/api/resources/referrals/index.d.ts +0 -1
- package/dist/api/resources/referrals/index.js +0 -1
- package/dist/api/resources/webhooks/client/Client.d.ts +7 -6
- package/dist/api/resources/webhooks/client/Client.js +12 -11
- package/dist/api/types/AttachmentDto.d.ts +8 -0
- package/dist/api/types/CreatePatientReq.d.ts +1 -1
- package/dist/api/types/Form.d.ts +11 -0
- package/dist/api/types/FormResponse.d.ts +4 -0
- package/{api/types/CancelledEventMetadata.d.ts → dist/api/types/FormResponseAnswer.d.ts} +1 -3
- package/dist/api/types/FullReferralDto.d.ts +7 -4
- package/dist/api/types/FullReferralDtoStatus.d.ts +3 -1
- package/dist/api/types/FullReferralDtoStatus.js +2 -0
- package/dist/api/types/GetReferralPatientDto.d.ts +1 -1
- package/dist/api/types/InstitutionCoreDto.d.ts +2 -1
- package/dist/api/types/{OfferingFullDto.d.ts → OfferingDto.d.ts} +6 -3
- package/dist/api/types/PaginatedQuery.d.ts +2 -2
- package/dist/api/types/PublicReferralDto.d.ts +7 -2
- package/dist/api/types/ReferralDto.d.ts +7 -4
- package/dist/api/types/ReferralDtoStatus.d.ts +3 -1
- package/dist/api/types/ReferralDtoStatus.js +2 -0
- package/dist/api/types/ReferralEligibility.d.ts +1 -1
- package/dist/api/{resources/referrals/types/ReferralsListRequestRole.d.ts → types/ReferralRole.d.ts} +2 -2
- package/{api/resources/referrals/types/ReferralsListRequestRole.js → dist/api/types/ReferralRole.js} +2 -2
- package/{api/resources/referrals/types/ReferralsListRequestStatusItem.d.ts → dist/api/types/ReferralStatusFilter.d.ts} +2 -2
- package/{api/resources/referrals/types/ReferralsListRequestStatusItem.js → dist/api/types/ReferralStatusFilter.js} +2 -2
- package/dist/api/types/ReferringDoctorDto.d.ts +9 -0
- package/dist/api/types/SubsidyEligibility.d.ts +1 -1
- package/dist/api/types/System.d.ts +11 -0
- package/dist/api/types/System.js +13 -0
- package/dist/api/types/TimelineEventDto.d.ts +4 -2
- package/dist/api/types/TimelineEventDtoSystem.d.ts +5 -1
- package/dist/api/types/TimelineEventDtoSystem.js +1 -0
- package/{api/types/TimelineEventDtoType.d.ts → dist/api/types/TimelineEventType.d.ts} +3 -2
- package/{api/types/TimelineEventDtoType.js → dist/api/types/TimelineEventType.js} +3 -2
- package/dist/api/types/TimeslotPolicy.d.ts +15 -0
- package/dist/api/types/TimeslotPolicy.js +11 -0
- package/dist/api/types/index.d.ts +10 -15
- package/dist/api/types/index.js +10 -15
- package/dist/environments.d.ts +8 -0
- package/dist/environments.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/environments.d.ts +8 -0
- package/environments.js +10 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/package.json +1 -1
- package/reference.md +108 -31
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/referrals/types/index.d.ts +0 -2
- package/api/types/CreatedEventMetadata.d.ts +0 -6
- package/api/types/EaReminderSentMetadata.d.ts +0 -6
- package/api/types/FullReferralDtoReferringDoctor.d.ts +0 -9
- package/api/types/NoteCreatedMetadata.d.ts +0 -8
- package/api/types/OfferingCoreDto.d.ts +0 -15
- package/api/types/PublicReferralDtoReferringDoctor.d.ts +0 -9
- package/api/types/ReferralAmendedMetadata.d.ts +0 -7
- package/api/types/ReferralDtoReferringDoctor.d.ts +0 -9
- package/api/types/RejectedEventMetadata.d.ts +0 -7
- package/api/types/RescheduleEventMetadata.d.ts +0 -8
- package/api/types/SingHealthPatientDetailsMetadata.d.ts +0 -7
- package/api/types/TimelineEventDtoMetadata.d.ts +0 -5
- package/dist/api/resources/referrals/types/index.d.ts +0 -2
- package/dist/api/types/CreatedEventMetadata.d.ts +0 -6
- package/dist/api/types/EaReminderSentMetadata.d.ts +0 -6
- package/dist/api/types/EaReminderSentMetadata.js +0 -5
- package/dist/api/types/FullReferralDtoReferringDoctor.d.ts +0 -9
- package/dist/api/types/FullReferralDtoReferringDoctor.js +0 -5
- package/dist/api/types/NoteCreatedMetadata.d.ts +0 -8
- package/dist/api/types/NoteCreatedMetadata.js +0 -5
- package/dist/api/types/OfferingCoreDto.d.ts +0 -15
- package/dist/api/types/OfferingCoreDto.js +0 -5
- package/dist/api/types/OfferingFullDto.js +0 -5
- package/dist/api/types/PublicReferralDtoReferringDoctor.d.ts +0 -9
- package/dist/api/types/PublicReferralDtoReferringDoctor.js +0 -5
- package/dist/api/types/ReferralAmendedMetadata.d.ts +0 -7
- package/dist/api/types/ReferralAmendedMetadata.js +0 -5
- package/dist/api/types/ReferralDtoReferringDoctor.d.ts +0 -9
- package/dist/api/types/ReferralDtoReferringDoctor.js +0 -5
- package/dist/api/types/RejectedEventMetadata.d.ts +0 -7
- package/dist/api/types/RejectedEventMetadata.js +0 -5
- package/dist/api/types/RescheduleEventMetadata.d.ts +0 -8
- package/dist/api/types/RescheduleEventMetadata.js +0 -5
- package/dist/api/types/SingHealthPatientDetailsMetadata.d.ts +0 -7
- package/dist/api/types/SingHealthPatientDetailsMetadata.js +0 -5
- package/dist/api/types/TimelineEventDtoMetadata.d.ts +0 -5
- package/dist/api/types/TimelineEventDtoMetadata.js +0 -5
- /package/api/{types/CancelledEventMetadata.js → resources/notes/client/requests/CreateNoteReq.js} +0 -0
- /package/api/{types/CreatedEventMetadata.js → resources/public/client/requests/PublicGetReferralRequest.js} +0 -0
- /package/api/{types/EaReminderSentMetadata.js → resources/referrals/client/requests/ReferralsGetRequest.js} +0 -0
- /package/api/types/{FullReferralDtoReferringDoctor.js → AttachmentDto.js} +0 -0
- /package/api/types/{NoteCreatedMetadata.js → Form.js} +0 -0
- /package/api/types/{OfferingCoreDto.js → FormResponseAnswer.js} +0 -0
- /package/api/types/{OfferingFullDto.js → OfferingDto.js} +0 -0
- /package/api/types/{PublicReferralDtoReferringDoctor.js → ReferringDoctorDto.js} +0 -0
- /package/{api/types/ReferralAmendedMetadata.js → dist/api/resources/notes/client/requests/CreateNoteReq.js} +0 -0
- /package/{api/types/ReferralDtoReferringDoctor.js → dist/api/resources/public/client/requests/PublicGetReferralRequest.js} +0 -0
- /package/{api/types/RejectedEventMetadata.js → dist/api/resources/referrals/client/requests/ReferralsGetRequest.js} +0 -0
- /package/{api/types/RescheduleEventMetadata.js → dist/api/types/AttachmentDto.js} +0 -0
- /package/{api/types/SingHealthPatientDetailsMetadata.js → dist/api/types/Form.js} +0 -0
- /package/{api/types/TimelineEventDtoMetadata.js → dist/api/types/FormResponseAnswer.js} +0 -0
- /package/dist/api/types/{CancelledEventMetadata.js → OfferingDto.js} +0 -0
- /package/dist/api/types/{CreatedEventMetadata.js → ReferringDoctorDto.js} +0 -0
|
@@ -39,11 +39,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Health = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../core"));
|
|
43
44
|
const url_join_1 = __importDefault(require("url-join"));
|
|
44
45
|
const errors = __importStar(require("../../../../errors/index"));
|
|
45
46
|
class Health {
|
|
46
|
-
constructor(_options) {
|
|
47
|
+
constructor(_options = {}) {
|
|
47
48
|
this._options = _options;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
@@ -53,12 +54,12 @@ class Health {
|
|
|
53
54
|
* await client.health.check()
|
|
54
55
|
*/
|
|
55
56
|
check(requestOptions) {
|
|
56
|
-
var _a;
|
|
57
|
+
var _a, _b;
|
|
57
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
59
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
59
|
-
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "api/v1/health"),
|
|
60
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ReferralExchangeEnvironment.Production, "api/v1/health"),
|
|
60
61
|
method: "GET",
|
|
61
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "
|
|
62
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "2025.2.20", "User-Agent": "@opengovsg/refx-ts-sdk/2025.2.20", "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),
|
|
62
63
|
contentType: "application/json",
|
|
63
64
|
requestType: "json",
|
|
64
65
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export * as referrals from "./referrals";
|
|
2
|
-
export * from "./referrals/types";
|
|
3
1
|
export * as eligibility from "./eligibility";
|
|
2
|
+
export * as referrals from "./referrals";
|
|
3
|
+
export * as notes from "./notes";
|
|
4
4
|
export * as offerings from "./offerings";
|
|
5
5
|
export * as public_ from "./public";
|
|
6
6
|
export * as webhooks from "./webhooks";
|
|
7
7
|
export * as health from "./health";
|
|
8
8
|
export * from "./eligibility/client/requests";
|
|
9
9
|
export * from "./referrals/client/requests";
|
|
10
|
+
export * from "./notes/client/requests";
|
|
10
11
|
export * from "./offerings/client/requests";
|
|
12
|
+
export * from "./public/client/requests";
|
|
@@ -26,14 +26,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.
|
|
30
|
-
exports.referrals = __importStar(require("./referrals"));
|
|
31
|
-
__exportStar(require("./referrals/types"), exports);
|
|
29
|
+
exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.notes = exports.referrals = exports.eligibility = void 0;
|
|
32
30
|
exports.eligibility = __importStar(require("./eligibility"));
|
|
31
|
+
exports.referrals = __importStar(require("./referrals"));
|
|
32
|
+
exports.notes = __importStar(require("./notes"));
|
|
33
33
|
exports.offerings = __importStar(require("./offerings"));
|
|
34
34
|
exports.public_ = __importStar(require("./public"));
|
|
35
35
|
exports.webhooks = __importStar(require("./webhooks"));
|
|
36
36
|
exports.health = __importStar(require("./health"));
|
|
37
37
|
__exportStar(require("./eligibility/client/requests"), exports);
|
|
38
38
|
__exportStar(require("./referrals/client/requests"), exports);
|
|
39
|
+
__exportStar(require("./notes/client/requests"), exports);
|
|
39
40
|
__exportStar(require("./offerings/client/requests"), exports);
|
|
41
|
+
__exportStar(require("./public/client/requests"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
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 Notes {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
12
|
+
}
|
|
13
|
+
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
15
|
+
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
17
|
+
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
19
|
+
abortSignal?: AbortSignal;
|
|
20
|
+
/** Additional headers to include in the request. */
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export declare class Notes {
|
|
25
|
+
protected readonly _options: Notes.Options;
|
|
26
|
+
constructor(_options?: Notes.Options);
|
|
27
|
+
/**
|
|
28
|
+
* @param {string} referralId - Referral ID
|
|
29
|
+
* @param {ReferralExchange.CreateNoteReq} request
|
|
30
|
+
* @param {Notes.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await client.notes.create("referralId", {
|
|
34
|
+
* authorHciCode: "authorHciCode"
|
|
35
|
+
* })
|
|
36
|
+
*/
|
|
37
|
+
create(referralId: string, request: ReferralExchange.CreateNoteReq, requestOptions?: Notes.RequestOptions): Promise<ReferralExchange.NoteDto>;
|
|
38
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
39
|
+
Authorization: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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 (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.Notes = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
43
|
+
const core = __importStar(require("../../../../core"));
|
|
44
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
45
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
46
|
+
class Notes {
|
|
47
|
+
constructor(_options = {}) {
|
|
48
|
+
this._options = _options;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} referralId - Referral ID
|
|
52
|
+
* @param {ReferralExchange.CreateNoteReq} request
|
|
53
|
+
* @param {Notes.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.notes.create("referralId", {
|
|
57
|
+
* authorHciCode: "authorHciCode"
|
|
58
|
+
* })
|
|
59
|
+
*/
|
|
60
|
+
create(referralId, request, requestOptions) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
64
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ReferralExchangeEnvironment.Production, `api/v1/referrals/${encodeURIComponent(referralId)}/notes`),
|
|
65
|
+
method: "POST",
|
|
66
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "2025.2.20", "User-Agent": "@opengovsg/refx-ts-sdk/2025.2.20", "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),
|
|
67
|
+
contentType: "application/json",
|
|
68
|
+
requestType: "json",
|
|
69
|
+
body: request,
|
|
70
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
71
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
72
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
73
|
+
});
|
|
74
|
+
if (_response.ok) {
|
|
75
|
+
return _response.body;
|
|
76
|
+
}
|
|
77
|
+
if (_response.error.reason === "status-code") {
|
|
78
|
+
throw new errors.ReferralExchangeError({
|
|
79
|
+
statusCode: _response.error.statusCode,
|
|
80
|
+
body: _response.error.body,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
switch (_response.error.reason) {
|
|
84
|
+
case "non-json":
|
|
85
|
+
throw new errors.ReferralExchangeError({
|
|
86
|
+
statusCode: _response.error.statusCode,
|
|
87
|
+
body: _response.error.rawBody,
|
|
88
|
+
});
|
|
89
|
+
case "timeout":
|
|
90
|
+
throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling POST /api/v1/referrals/{referralId}/notes.");
|
|
91
|
+
case "unknown":
|
|
92
|
+
throw new errors.ReferralExchangeError({
|
|
93
|
+
message: _response.error.errorMessage,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
_getCustomAuthorizationHeaders() {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
101
|
+
return { Authorization: apiKeyValue };
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.Notes = Notes;
|
|
@@ -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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* authorHciCode: "authorHciCode"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface CreateNoteReq {
|
|
11
|
+
/** Note content - plaintext. */
|
|
12
|
+
content?: string;
|
|
13
|
+
/** Author HCI code. Must be already tied to your system. */
|
|
14
|
+
authorHciCode: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type CreateNoteReq } from "./CreateNoteReq";
|
|
@@ -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);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
4
5
|
import * as core from "../../../../core";
|
|
5
6
|
import * as ReferralExchange from "../../../index";
|
|
6
7
|
export declare namespace Offerings {
|
|
7
8
|
interface Options {
|
|
8
|
-
environment
|
|
9
|
+
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
9
10
|
apiKey?: core.Supplier<string | undefined>;
|
|
10
11
|
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
@@ -22,22 +23,14 @@ export declare namespace Offerings {
|
|
|
22
23
|
}
|
|
23
24
|
export declare class Offerings {
|
|
24
25
|
protected readonly _options: Offerings.Options;
|
|
25
|
-
constructor(_options
|
|
26
|
+
constructor(_options?: Offerings.Options);
|
|
26
27
|
/**
|
|
27
28
|
* @param {Offerings.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
31
|
* await client.offerings.list()
|
|
31
32
|
*/
|
|
32
|
-
list(requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.
|
|
33
|
-
/**
|
|
34
|
-
* @param {string} offeringId
|
|
35
|
-
* @param {Offerings.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* await client.offerings.get("offeringId")
|
|
39
|
-
*/
|
|
40
|
-
get(offeringId: string, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingFullDto>;
|
|
33
|
+
list(requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingDto[]>;
|
|
41
34
|
/**
|
|
42
35
|
* @param {string} offeringId
|
|
43
36
|
* @param {ReferralExchange.OfferingsListTimeslotsRequest} request
|
|
@@ -45,7 +38,8 @@ export declare class Offerings {
|
|
|
45
38
|
*
|
|
46
39
|
* @example
|
|
47
40
|
* await client.offerings.listTimeslots("offeringId", {
|
|
48
|
-
* from: 1.1
|
|
41
|
+
* from: 1.1,
|
|
42
|
+
* isSubsidised: true
|
|
49
43
|
* })
|
|
50
44
|
*/
|
|
51
45
|
listTimeslots(offeringId: string, request: ReferralExchange.OfferingsListTimeslotsRequest, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.Timeslot[]>;
|
|
@@ -39,11 +39,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Offerings = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../core"));
|
|
43
44
|
const url_join_1 = __importDefault(require("url-join"));
|
|
44
45
|
const errors = __importStar(require("../../../../errors/index"));
|
|
45
46
|
class Offerings {
|
|
46
|
-
constructor(_options) {
|
|
47
|
+
constructor(_options = {}) {
|
|
47
48
|
this._options = _options;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
@@ -53,12 +54,12 @@ class Offerings {
|
|
|
53
54
|
* await client.offerings.list()
|
|
54
55
|
*/
|
|
55
56
|
list(requestOptions) {
|
|
56
|
-
var _a;
|
|
57
|
+
var _a, _b;
|
|
57
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
59
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
59
|
-
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "api/v1/offerings"),
|
|
60
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ReferralExchangeEnvironment.Production, "api/v1/offerings"),
|
|
60
61
|
method: "GET",
|
|
61
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "
|
|
62
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "2025.2.20", "User-Agent": "@opengovsg/refx-ts-sdk/2025.2.20", "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),
|
|
62
63
|
contentType: "application/json",
|
|
63
64
|
requestType: "json",
|
|
64
65
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -89,50 +90,6 @@ class Offerings {
|
|
|
89
90
|
}
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
|
-
/**
|
|
93
|
-
* @param {string} offeringId
|
|
94
|
-
* @param {Offerings.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* await client.offerings.get("offeringId")
|
|
98
|
-
*/
|
|
99
|
-
get(offeringId, requestOptions) {
|
|
100
|
-
var _a;
|
|
101
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
103
|
-
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `api/v1/offerings/${encodeURIComponent(offeringId)}`),
|
|
104
|
-
method: "GET",
|
|
105
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "2024.10.3", "User-Agent": "@opengovsg/refx-ts-sdk/2024.10.3", "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),
|
|
106
|
-
contentType: "application/json",
|
|
107
|
-
requestType: "json",
|
|
108
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
109
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
110
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
111
|
-
});
|
|
112
|
-
if (_response.ok) {
|
|
113
|
-
return _response.body;
|
|
114
|
-
}
|
|
115
|
-
if (_response.error.reason === "status-code") {
|
|
116
|
-
throw new errors.ReferralExchangeError({
|
|
117
|
-
statusCode: _response.error.statusCode,
|
|
118
|
-
body: _response.error.body,
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
switch (_response.error.reason) {
|
|
122
|
-
case "non-json":
|
|
123
|
-
throw new errors.ReferralExchangeError({
|
|
124
|
-
statusCode: _response.error.statusCode,
|
|
125
|
-
body: _response.error.rawBody,
|
|
126
|
-
});
|
|
127
|
-
case "timeout":
|
|
128
|
-
throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling GET /api/v1/offerings/{offeringId}.");
|
|
129
|
-
case "unknown":
|
|
130
|
-
throw new errors.ReferralExchangeError({
|
|
131
|
-
message: _response.error.errorMessage,
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
93
|
/**
|
|
137
94
|
* @param {string} offeringId
|
|
138
95
|
* @param {ReferralExchange.OfferingsListTimeslotsRequest} request
|
|
@@ -140,22 +97,21 @@ class Offerings {
|
|
|
140
97
|
*
|
|
141
98
|
* @example
|
|
142
99
|
* await client.offerings.listTimeslots("offeringId", {
|
|
143
|
-
* from: 1.1
|
|
100
|
+
* from: 1.1,
|
|
101
|
+
* isSubsidised: true
|
|
144
102
|
* })
|
|
145
103
|
*/
|
|
146
104
|
listTimeslots(offeringId, request, requestOptions) {
|
|
147
|
-
var _a;
|
|
105
|
+
var _a, _b;
|
|
148
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
149
107
|
const { from: from_, isSubsidised } = request;
|
|
150
108
|
const _queryParams = {};
|
|
151
109
|
_queryParams["from"] = from_.toString();
|
|
152
|
-
|
|
153
|
-
_queryParams["isSubsidised"] = isSubsidised.toString();
|
|
154
|
-
}
|
|
110
|
+
_queryParams["isSubsidised"] = isSubsidised.toString();
|
|
155
111
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
156
|
-
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `api/v1/offerings/${encodeURIComponent(offeringId)}/timeslots`),
|
|
112
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ReferralExchangeEnvironment.Production, `api/v1/offerings/${encodeURIComponent(offeringId)}/timeslots`),
|
|
157
113
|
method: "GET",
|
|
158
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "
|
|
114
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "2025.2.20", "User-Agent": "@opengovsg/refx-ts-sdk/2025.2.20", "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),
|
|
159
115
|
contentType: "application/json",
|
|
160
116
|
queryParameters: _queryParams,
|
|
161
117
|
requestType: "json",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
4
5
|
import * as core from "../../../../core";
|
|
5
6
|
import * as ReferralExchange from "../../../index";
|
|
6
7
|
export declare namespace Public {
|
|
7
8
|
interface Options {
|
|
8
|
-
environment
|
|
9
|
+
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
9
10
|
apiKey?: core.Supplier<string | undefined>;
|
|
10
11
|
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
@@ -22,9 +23,10 @@ export declare namespace Public {
|
|
|
22
23
|
}
|
|
23
24
|
export declare class Public {
|
|
24
25
|
protected readonly _options: Public.Options;
|
|
25
|
-
constructor(_options
|
|
26
|
+
constructor(_options?: Public.Options);
|
|
26
27
|
/**
|
|
27
|
-
* @param {string} referralId
|
|
28
|
+
* @param {string} referralId - Referral ID
|
|
29
|
+
* @param {ReferralExchange.PublicGetReferralRequest} request
|
|
28
30
|
* @param {Public.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
31
|
*
|
|
30
32
|
* @throws {@link ReferralExchange.NotFoundError}
|
|
@@ -32,7 +34,7 @@ export declare class Public {
|
|
|
32
34
|
* @example
|
|
33
35
|
* await client.public.getReferral("referralId")
|
|
34
36
|
*/
|
|
35
|
-
getReferral(referralId: string, requestOptions?: Public.RequestOptions): Promise<ReferralExchange.PublicReferralDto
|
|
37
|
+
getReferral(referralId: string, request?: ReferralExchange.PublicGetReferralRequest, requestOptions?: Public.RequestOptions): Promise<ReferralExchange.PublicReferralDto>;
|
|
36
38
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
37
39
|
Authorization: string | undefined;
|
|
38
40
|
}>;
|
|
@@ -39,16 +39,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Public = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../core"));
|
|
43
44
|
const ReferralExchange = __importStar(require("../../../index"));
|
|
44
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
45
46
|
const errors = __importStar(require("../../../../errors/index"));
|
|
46
47
|
class Public {
|
|
47
|
-
constructor(_options) {
|
|
48
|
+
constructor(_options = {}) {
|
|
48
49
|
this._options = _options;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
|
-
* @param {string} referralId
|
|
52
|
+
* @param {string} referralId - Referral ID
|
|
53
|
+
* @param {ReferralExchange.PublicGetReferralRequest} request
|
|
52
54
|
* @param {Public.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
55
|
*
|
|
54
56
|
* @throws {@link ReferralExchange.NotFoundError}
|
|
@@ -56,14 +58,20 @@ class Public {
|
|
|
56
58
|
* @example
|
|
57
59
|
* await client.public.getReferral("referralId")
|
|
58
60
|
*/
|
|
59
|
-
getReferral(referralId, requestOptions) {
|
|
60
|
-
var _a;
|
|
61
|
+
getReferral(referralId, request = {}, requestOptions) {
|
|
62
|
+
var _a, _b;
|
|
61
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const { includeAttachments } = request;
|
|
65
|
+
const _queryParams = {};
|
|
66
|
+
if (includeAttachments != null) {
|
|
67
|
+
_queryParams["includeAttachments"] = includeAttachments.toString();
|
|
68
|
+
}
|
|
62
69
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
63
|
-
url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `api/v1/public/referrals/${encodeURIComponent(referralId)}`),
|
|
70
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ReferralExchangeEnvironment.Production, `api/v1/public/referrals/${encodeURIComponent(referralId)}`),
|
|
64
71
|
method: "GET",
|
|
65
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "
|
|
72
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "2025.2.20", "User-Agent": "@opengovsg/refx-ts-sdk/2025.2.20", "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),
|
|
66
73
|
contentType: "application/json",
|
|
74
|
+
queryParameters: _queryParams,
|
|
67
75
|
requestType: "json",
|
|
68
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
69
77
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./requests";
|
|
@@ -1,2 +1,17 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type PublicGetReferralRequest } from "./PublicGetReferralRequest";
|