@opengovsg/refx-ts-sdk 0.0.30 → 0.0.32-prerelease-1743933274
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 +2 -0
- package/README.md +11 -11
- package/api/errors/BadRequestError.js +17 -7
- package/api/errors/NotFoundError.js +17 -7
- package/api/errors/UnauthorizedError.js +17 -7
- package/api/resources/eligibility/client/Client.d.ts +2 -0
- package/api/resources/eligibility/client/Client.js +20 -10
- package/api/resources/health/client/Client.d.ts +2 -0
- package/api/resources/health/client/Client.js +20 -10
- package/api/resources/index.js +17 -7
- package/api/resources/notes/client/Client.d.ts +2 -0
- package/api/resources/notes/client/Client.js +20 -10
- package/api/resources/offerings/client/Client.d.ts +2 -0
- package/api/resources/offerings/client/Client.js +23 -13
- package/api/resources/public/client/Client.d.ts +2 -0
- package/api/resources/public/client/Client.js +22 -12
- package/api/resources/referrals/client/Client.d.ts +2 -0
- package/api/resources/referrals/client/Client.js +50 -40
- package/api/resources/webhooks/client/Client.d.ts +2 -0
- package/api/resources/webhooks/client/Client.js +23 -13
- package/api/types/CreatePatientReqGender.d.ts +1 -1
- package/api/types/CreateReferralFormReq.d.ts +9 -0
- package/api/types/CreateReferralFormReq.js +5 -0
- package/api/types/FormMetadata.d.ts +17 -0
- package/api/types/FormMetadata.js +5 -0
- package/api/types/FormResponseAnswer.d.ts +1 -1
- package/api/types/FullReferralDtoStatus.d.ts +1 -1
- package/api/types/GetReferralPatientDtoGender.d.ts +1 -1
- package/api/types/ReferralDtoStatus.d.ts +1 -1
- package/api/types/ReferralRole.d.ts +1 -1
- package/api/types/ReferralStatusFilter.d.ts +1 -1
- package/api/types/System.d.ts +1 -1
- package/api/types/TimelineEventDtoSystem.d.ts +1 -1
- package/api/types/TimelineEventType.d.ts +1 -1
- package/api/types/TimeslotPolicy.d.ts +1 -1
- package/api/types/index.d.ts +2 -0
- package/api/types/index.js +2 -0
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +2 -2
- package/core/fetcher/Fetcher.js +6 -5
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.js +1 -2
- package/core/fetcher/getFetchFn.js +18 -9
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.js +5 -5
- package/core/fetcher/getResponseBody.js +1 -2
- package/core/fetcher/makeRequest.d.ts +1 -1
- package/core/fetcher/requestWithRetries.js +4 -5
- package/core/fetcher/signals.d.ts +0 -1
- package/core/fetcher/signals.js +2 -3
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/runtime.d.ts +1 -1
- package/core/runtime/runtime.js +51 -41
- package/dist/Client.d.ts +2 -0
- package/dist/api/errors/BadRequestError.js +17 -7
- package/dist/api/errors/NotFoundError.js +17 -7
- package/dist/api/errors/UnauthorizedError.js +17 -7
- package/dist/api/resources/eligibility/client/Client.d.ts +2 -0
- package/dist/api/resources/eligibility/client/Client.js +20 -10
- package/dist/api/resources/health/client/Client.d.ts +2 -0
- package/dist/api/resources/health/client/Client.js +20 -10
- package/dist/api/resources/index.js +17 -7
- package/dist/api/resources/notes/client/Client.d.ts +2 -0
- package/dist/api/resources/notes/client/Client.js +20 -10
- package/dist/api/resources/offerings/client/Client.d.ts +2 -0
- package/dist/api/resources/offerings/client/Client.js +23 -13
- package/dist/api/resources/public/client/Client.d.ts +2 -0
- package/dist/api/resources/public/client/Client.js +22 -12
- package/dist/api/resources/referrals/client/Client.d.ts +2 -0
- package/dist/api/resources/referrals/client/Client.js +50 -40
- package/dist/api/resources/webhooks/client/Client.d.ts +2 -0
- package/dist/api/resources/webhooks/client/Client.js +23 -13
- package/dist/api/types/CreatePatientReqGender.d.ts +1 -1
- package/dist/api/types/CreateReferralFormReq.d.ts +9 -0
- package/dist/api/types/CreateReferralFormReq.js +5 -0
- package/dist/api/types/FormMetadata.d.ts +17 -0
- package/dist/api/types/FormMetadata.js +5 -0
- package/dist/api/types/FormResponseAnswer.d.ts +1 -1
- package/dist/api/types/FullReferralDtoStatus.d.ts +1 -1
- package/dist/api/types/GetReferralPatientDtoGender.d.ts +1 -1
- package/dist/api/types/ReferralDtoStatus.d.ts +1 -1
- package/dist/api/types/ReferralRole.d.ts +1 -1
- package/dist/api/types/ReferralStatusFilter.d.ts +1 -1
- package/dist/api/types/System.d.ts +1 -1
- package/dist/api/types/TimelineEventDtoSystem.d.ts +1 -1
- package/dist/api/types/TimelineEventType.d.ts +1 -1
- package/dist/api/types/TimeslotPolicy.d.ts +1 -1
- package/dist/api/types/index.d.ts +2 -0
- package/dist/api/types/index.js +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/core/fetcher/Fetcher.js +6 -5
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.js +1 -2
- package/dist/core/fetcher/getFetchFn.js +18 -9
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.js +5 -5
- package/dist/core/fetcher/getResponseBody.js +1 -2
- package/dist/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/core/fetcher/requestWithRetries.js +4 -5
- package/dist/core/fetcher/signals.d.ts +0 -1
- package/dist/core/fetcher/signals.js +2 -3
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/runtime.d.ts +1 -1
- package/dist/core/runtime/runtime.js +51 -41
- package/dist/environments.d.ts +2 -1
- package/dist/environments.js +1 -0
- package/dist/errors/ReferralExchangeError.js +2 -1
- package/dist/index.js +17 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/environments.d.ts +2 -1
- package/environments.js +1 -0
- package/errors/ReferralExchangeError.js +2 -1
- package/index.js +17 -7
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +15 -15
- package/scripts/rename-to-esm-files.js +115 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/Client.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import { Health } from "./api/resources/health/client/Client";
|
|
|
13
13
|
export declare namespace ReferralExchangeClient {
|
|
14
14
|
interface Options {
|
|
15
15
|
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
16
|
+
/** Specify a custom URL to connect the client to. */
|
|
17
|
+
baseUrl?: core.Supplier<string>;
|
|
16
18
|
apiKey?: core.Supplier<string | undefined>;
|
|
17
19
|
fetcher?: core.FetchFunction;
|
|
18
20
|
}
|
package/README.md
CHANGED
|
@@ -100,14 +100,14 @@ const response = await client.referrals.upsert(..., {
|
|
|
100
100
|
### Retries
|
|
101
101
|
|
|
102
102
|
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
103
|
-
as the request is deemed
|
|
103
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
104
104
|
retry limit (default: 2).
|
|
105
105
|
|
|
106
|
-
A request is deemed
|
|
106
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
107
107
|
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
108
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
109
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
110
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
111
111
|
|
|
112
112
|
Use the `maxRetries` request option to configure this behavior.
|
|
113
113
|
|
|
@@ -144,12 +144,12 @@ controller.abort(); // aborts the request
|
|
|
144
144
|
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
145
145
|
runtimes:
|
|
146
146
|
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
147
|
+
- Node.js 18+
|
|
148
|
+
- Vercel
|
|
149
|
+
- Cloudflare Workers
|
|
150
|
+
- Deno v1.25+
|
|
151
|
+
- Bun 1.0+
|
|
152
|
+
- React Native
|
|
153
153
|
|
|
154
154
|
### Customizing Fetch Client
|
|
155
155
|
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.BadRequestError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.NotFoundError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.UnauthorizedError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -7,6 +7,8 @@ import * as ReferralExchange from "../../../index";
|
|
|
7
7
|
export declare namespace Eligibility {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -61,16 +71,16 @@ class Eligibility {
|
|
|
61
71
|
* })
|
|
62
72
|
*/
|
|
63
73
|
get(request, requestOptions) {
|
|
64
|
-
var _a, _b;
|
|
65
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
var _a, _b, _c;
|
|
66
76
|
const { uin, offeringId } = request;
|
|
67
77
|
const _queryParams = {};
|
|
68
78
|
_queryParams["uin"] = uin;
|
|
69
79
|
_queryParams["offeringId"] = offeringId;
|
|
70
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
81
|
+
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"),
|
|
72
82
|
method: "GET",
|
|
73
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.
|
|
83
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.32-prerelease-1743933274", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.32-prerelease-1743933274", "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),
|
|
74
84
|
contentType: "application/json",
|
|
75
85
|
queryParameters: _queryParams,
|
|
76
86
|
requestType: "json",
|
|
@@ -7,6 +7,8 @@ import * as ReferralExchange from "../../../index";
|
|
|
7
7
|
export declare namespace Health {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -54,12 +64,12 @@ class Health {
|
|
|
54
64
|
* await client.health.check()
|
|
55
65
|
*/
|
|
56
66
|
check(requestOptions) {
|
|
57
|
-
var _a, _b;
|
|
58
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
var _a, _b, _c;
|
|
59
69
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
60
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
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"),
|
|
61
71
|
method: "GET",
|
|
62
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.
|
|
72
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.32-prerelease-1743933274", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.32-prerelease-1743933274", "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),
|
|
63
73
|
contentType: "application/json",
|
|
64
74
|
requestType: "json",
|
|
65
75
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
package/api/resources/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
@@ -7,6 +7,8 @@ import * as ReferralExchange from "../../../index";
|
|
|
7
7
|
export declare namespace Notes {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -61,12 +71,12 @@ class Notes {
|
|
|
61
71
|
* })
|
|
62
72
|
*/
|
|
63
73
|
create(referralId, request, requestOptions) {
|
|
64
|
-
var _a, _b;
|
|
65
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
var _a, _b, _c;
|
|
66
76
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
67
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
77
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/notes`),
|
|
68
78
|
method: "POST",
|
|
69
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.
|
|
79
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.32-prerelease-1743933274", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.32-prerelease-1743933274", "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),
|
|
70
80
|
contentType: "application/json",
|
|
71
81
|
requestType: "json",
|
|
72
82
|
body: request,
|
|
@@ -7,6 +7,8 @@ import * as ReferralExchange from "../../../index";
|
|
|
7
7
|
export declare namespace Offerings {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -57,12 +67,12 @@ class Offerings {
|
|
|
57
67
|
* await client.offerings.list()
|
|
58
68
|
*/
|
|
59
69
|
list(requestOptions) {
|
|
60
|
-
var _a, _b;
|
|
61
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
var _a, _b, _c;
|
|
62
72
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
63
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
73
|
+
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"),
|
|
64
74
|
method: "GET",
|
|
65
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.
|
|
75
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.32-prerelease-1743933274", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.32-prerelease-1743933274", "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
76
|
contentType: "application/json",
|
|
67
77
|
requestType: "json",
|
|
68
78
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -112,16 +122,16 @@ class Offerings {
|
|
|
112
122
|
* })
|
|
113
123
|
*/
|
|
114
124
|
listTimeslots(offeringId, request, requestOptions) {
|
|
115
|
-
var _a, _b;
|
|
116
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
var _a, _b, _c;
|
|
117
127
|
const { from: from_, isSubsidised } = request;
|
|
118
128
|
const _queryParams = {};
|
|
119
129
|
_queryParams["from"] = from_.toString();
|
|
120
130
|
_queryParams["isSubsidised"] = isSubsidised.toString();
|
|
121
131
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
122
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
132
|
+
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`),
|
|
123
133
|
method: "GET",
|
|
124
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.
|
|
134
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.32-prerelease-1743933274", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.32-prerelease-1743933274", "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),
|
|
125
135
|
contentType: "application/json",
|
|
126
136
|
queryParameters: _queryParams,
|
|
127
137
|
requestType: "json",
|
|
@@ -7,6 +7,8 @@ import * as ReferralExchange from "../../../index";
|
|
|
7
7
|
export declare namespace Public {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
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
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -58,18 +68,18 @@ class Public {
|
|
|
58
68
|
* @example
|
|
59
69
|
* await client.public.getReferral("referralId")
|
|
60
70
|
*/
|
|
61
|
-
getReferral(
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
getReferral(referralId_1) {
|
|
72
|
+
return __awaiter(this, arguments, void 0, function* (referralId, request = {}, requestOptions) {
|
|
73
|
+
var _a, _b, _c;
|
|
64
74
|
const { includeAttachments } = request;
|
|
65
75
|
const _queryParams = {};
|
|
66
76
|
if (includeAttachments != null) {
|
|
67
77
|
_queryParams["includeAttachments"] = includeAttachments.toString();
|
|
68
78
|
}
|
|
69
79
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
70
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
80
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/public/referrals/${encodeURIComponent(referralId)}`),
|
|
71
81
|
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.
|
|
82
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.32-prerelease-1743933274", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.32-prerelease-1743933274", "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
83
|
contentType: "application/json",
|
|
74
84
|
queryParameters: _queryParams,
|
|
75
85
|
requestType: "json",
|
|
@@ -7,6 +7,8 @@ import * as ReferralExchange from "../../../index";
|
|
|
7
7
|
export declare namespace Referrals {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|