@opengovsg/refx-ts-sdk 0.0.0-develop-1753420242 → 0.0.0-develop-1754962921
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 +0 -3
- package/Client.js +4 -9
- package/api/resources/eligibility/client/Client.js +1 -1
- package/api/resources/health/client/Client.js +1 -1
- package/api/resources/index.d.ts +0 -2
- package/api/resources/index.js +1 -3
- package/api/resources/links/client/Client.js +1 -1
- package/api/resources/notes/client/Client.js +1 -1
- package/api/resources/offerings/client/Client.js +3 -3
- package/api/resources/public/client/Client.js +1 -1
- package/api/resources/referrals/client/Client.js +9 -9
- package/api/resources/webhooks/client/Client.js +2 -2
- package/api/types/CreatePatientReq.d.ts +2 -0
- package/api/types/CreatePatientReqResidentialStatus.d.ts +12 -0
- package/api/types/CreatePatientReqResidentialStatus.js +11 -0
- package/api/types/GetReferralPatientDto.d.ts +2 -0
- package/api/types/GetReferralPatientDtoResidentialStatus.d.ts +12 -0
- package/api/types/GetReferralPatientDtoResidentialStatus.js +11 -0
- package/api/types/ReferrerIdType.d.ts +2 -1
- package/api/types/ReferrerIdType.js +1 -0
- package/api/{resources/aac/client/requests → types}/UpdateAacBoundaryReq.d.ts +0 -4
- package/api/{resources/aac/client/requests → types}/UpdateAacReq.d.ts +0 -4
- package/api/types/index.d.ts +4 -0
- package/api/types/index.js +4 -0
- package/dist/Client.d.ts +0 -3
- package/dist/Client.js +4 -9
- package/dist/api/resources/eligibility/client/Client.js +1 -1
- package/dist/api/resources/health/client/Client.js +1 -1
- package/dist/api/resources/index.d.ts +0 -2
- package/dist/api/resources/index.js +1 -3
- package/dist/api/resources/links/client/Client.js +1 -1
- package/dist/api/resources/notes/client/Client.js +1 -1
- package/dist/api/resources/offerings/client/Client.js +3 -3
- package/dist/api/resources/public/client/Client.js +1 -1
- package/dist/api/resources/referrals/client/Client.js +9 -9
- package/dist/api/resources/webhooks/client/Client.js +2 -2
- package/dist/api/types/CreatePatientReq.d.ts +2 -0
- package/dist/api/types/CreatePatientReqResidentialStatus.d.ts +12 -0
- package/dist/api/types/CreatePatientReqResidentialStatus.js +11 -0
- package/dist/api/types/GetReferralPatientDto.d.ts +2 -0
- package/dist/api/types/GetReferralPatientDtoResidentialStatus.d.ts +12 -0
- package/dist/api/types/GetReferralPatientDtoResidentialStatus.js +11 -0
- package/dist/api/types/ReferrerIdType.d.ts +2 -1
- package/dist/api/types/ReferrerIdType.js +1 -0
- package/dist/api/{resources/aac/client/requests → types}/UpdateAacBoundaryReq.d.ts +0 -4
- package/dist/api/{resources/aac/client/requests → types}/UpdateAacReq.d.ts +0 -4
- package/dist/api/types/index.d.ts +4 -0
- package/dist/api/types/index.js +4 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +0 -98
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/aac/client/Client.d.ts +0 -52
- package/api/resources/aac/client/Client.js +0 -172
- package/api/resources/aac/client/index.d.ts +0 -1
- package/api/resources/aac/client/index.js +0 -17
- package/api/resources/aac/client/requests/index.d.ts +0 -2
- package/api/resources/aac/client/requests/index.js +0 -2
- package/api/resources/aac/index.d.ts +0 -1
- package/api/resources/aac/index.js +0 -17
- package/dist/api/resources/aac/client/Client.d.ts +0 -52
- package/dist/api/resources/aac/client/Client.js +0 -172
- package/dist/api/resources/aac/client/index.d.ts +0 -1
- package/dist/api/resources/aac/client/index.js +0 -17
- package/dist/api/resources/aac/client/requests/index.d.ts +0 -2
- package/dist/api/resources/aac/client/requests/index.js +0 -2
- package/dist/api/resources/aac/index.d.ts +0 -1
- package/dist/api/resources/aac/index.js +0 -17
- /package/api/{resources/aac/client/requests → types}/UpdateAacBoundaryReq.js +0 -0
- /package/api/{resources/aac/client/requests → types}/UpdateAacReq.js +0 -0
- /package/dist/api/{resources/aac/client/requests → types}/UpdateAacBoundaryReq.js +0 -0
- /package/dist/api/{resources/aac/client/requests → types}/UpdateAacReq.js +0 -0
|
@@ -1,172 +0,0 @@
|
|
|
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.Aac = 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 Aac {
|
|
58
|
-
constructor(_options = {}) {
|
|
59
|
-
this._options = _options;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @param {ReferralExchange.UpdateAacReq} request
|
|
63
|
-
* @param {Aac.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
-
*
|
|
65
|
-
* @throws {@link ReferralExchange.UnauthorizedError}
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* await client.aac.aacControllerUpsertAac()
|
|
69
|
-
*/
|
|
70
|
-
aacControllerUpsertAac() {
|
|
71
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
72
|
-
var _a, _b, _c;
|
|
73
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
74
|
-
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/aac/notify-asg-aac"),
|
|
75
|
-
method: "POST",
|
|
76
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1753420242", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1753420242", "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),
|
|
77
|
-
contentType: "application/json",
|
|
78
|
-
requestType: "json",
|
|
79
|
-
body: request,
|
|
80
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
81
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
82
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
83
|
-
});
|
|
84
|
-
if (_response.ok) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (_response.error.reason === "status-code") {
|
|
88
|
-
switch (_response.error.statusCode) {
|
|
89
|
-
case 401:
|
|
90
|
-
throw new ReferralExchange.UnauthorizedError(_response.error.body);
|
|
91
|
-
default:
|
|
92
|
-
throw new errors.ReferralExchangeError({
|
|
93
|
-
statusCode: _response.error.statusCode,
|
|
94
|
-
body: _response.error.body,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
switch (_response.error.reason) {
|
|
99
|
-
case "non-json":
|
|
100
|
-
throw new errors.ReferralExchangeError({
|
|
101
|
-
statusCode: _response.error.statusCode,
|
|
102
|
-
body: _response.error.rawBody,
|
|
103
|
-
});
|
|
104
|
-
case "timeout":
|
|
105
|
-
throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling POST /api/v1/aac/notify-asg-aac.");
|
|
106
|
-
case "unknown":
|
|
107
|
-
throw new errors.ReferralExchangeError({
|
|
108
|
-
message: _response.error.errorMessage,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* @param {ReferralExchange.UpdateAacBoundaryReq} request
|
|
115
|
-
* @param {Aac.RequestOptions} requestOptions - Request-specific configuration.
|
|
116
|
-
*
|
|
117
|
-
* @throws {@link ReferralExchange.UnauthorizedError}
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* await client.aac.aacControllerUpsertAacBoundary()
|
|
121
|
-
*/
|
|
122
|
-
aacControllerUpsertAacBoundary() {
|
|
123
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
124
|
-
var _a, _b, _c;
|
|
125
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
126
|
-
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/aac/notify-asg-aac-service-boundary"),
|
|
127
|
-
method: "POST",
|
|
128
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1753420242", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1753420242", "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),
|
|
129
|
-
contentType: "application/json",
|
|
130
|
-
requestType: "json",
|
|
131
|
-
body: request,
|
|
132
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
133
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
134
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
135
|
-
});
|
|
136
|
-
if (_response.ok) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (_response.error.reason === "status-code") {
|
|
140
|
-
switch (_response.error.statusCode) {
|
|
141
|
-
case 401:
|
|
142
|
-
throw new ReferralExchange.UnauthorizedError(_response.error.body);
|
|
143
|
-
default:
|
|
144
|
-
throw new errors.ReferralExchangeError({
|
|
145
|
-
statusCode: _response.error.statusCode,
|
|
146
|
-
body: _response.error.body,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
switch (_response.error.reason) {
|
|
151
|
-
case "non-json":
|
|
152
|
-
throw new errors.ReferralExchangeError({
|
|
153
|
-
statusCode: _response.error.statusCode,
|
|
154
|
-
body: _response.error.rawBody,
|
|
155
|
-
});
|
|
156
|
-
case "timeout":
|
|
157
|
-
throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling POST /api/v1/aac/notify-asg-aac-service-boundary.");
|
|
158
|
-
case "unknown":
|
|
159
|
-
throw new errors.ReferralExchangeError({
|
|
160
|
-
message: _response.error.errorMessage,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
_getCustomAuthorizationHeaders() {
|
|
166
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
168
|
-
return { Authorization: apiKeyValue };
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
exports.Aac = Aac;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests";
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client";
|
|
@@ -1,17 +0,0 @@
|
|
|
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,52 +0,0 @@
|
|
|
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 Aac {
|
|
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 Aac {
|
|
27
|
-
protected readonly _options: Aac.Options;
|
|
28
|
-
constructor(_options?: Aac.Options);
|
|
29
|
-
/**
|
|
30
|
-
* @param {ReferralExchange.UpdateAacReq} request
|
|
31
|
-
* @param {Aac.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
-
*
|
|
33
|
-
* @throws {@link ReferralExchange.UnauthorizedError}
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* await client.aac.aacControllerUpsertAac()
|
|
37
|
-
*/
|
|
38
|
-
aacControllerUpsertAac(request?: ReferralExchange.UpdateAacReq, requestOptions?: Aac.RequestOptions): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* @param {ReferralExchange.UpdateAacBoundaryReq} request
|
|
41
|
-
* @param {Aac.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
|
-
*
|
|
43
|
-
* @throws {@link ReferralExchange.UnauthorizedError}
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* await client.aac.aacControllerUpsertAacBoundary()
|
|
47
|
-
*/
|
|
48
|
-
aacControllerUpsertAacBoundary(request?: ReferralExchange.UpdateAacBoundaryReq, requestOptions?: Aac.RequestOptions): Promise<void>;
|
|
49
|
-
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
50
|
-
Authorization: string | undefined;
|
|
51
|
-
}>;
|
|
52
|
-
}
|
|
@@ -1,172 +0,0 @@
|
|
|
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.Aac = 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 Aac {
|
|
58
|
-
constructor(_options = {}) {
|
|
59
|
-
this._options = _options;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @param {ReferralExchange.UpdateAacReq} request
|
|
63
|
-
* @param {Aac.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
-
*
|
|
65
|
-
* @throws {@link ReferralExchange.UnauthorizedError}
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* await client.aac.aacControllerUpsertAac()
|
|
69
|
-
*/
|
|
70
|
-
aacControllerUpsertAac() {
|
|
71
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
72
|
-
var _a, _b, _c;
|
|
73
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
74
|
-
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/aac/notify-asg-aac"),
|
|
75
|
-
method: "POST",
|
|
76
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1753420242", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1753420242", "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),
|
|
77
|
-
contentType: "application/json",
|
|
78
|
-
requestType: "json",
|
|
79
|
-
body: request,
|
|
80
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
81
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
82
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
83
|
-
});
|
|
84
|
-
if (_response.ok) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (_response.error.reason === "status-code") {
|
|
88
|
-
switch (_response.error.statusCode) {
|
|
89
|
-
case 401:
|
|
90
|
-
throw new ReferralExchange.UnauthorizedError(_response.error.body);
|
|
91
|
-
default:
|
|
92
|
-
throw new errors.ReferralExchangeError({
|
|
93
|
-
statusCode: _response.error.statusCode,
|
|
94
|
-
body: _response.error.body,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
switch (_response.error.reason) {
|
|
99
|
-
case "non-json":
|
|
100
|
-
throw new errors.ReferralExchangeError({
|
|
101
|
-
statusCode: _response.error.statusCode,
|
|
102
|
-
body: _response.error.rawBody,
|
|
103
|
-
});
|
|
104
|
-
case "timeout":
|
|
105
|
-
throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling POST /api/v1/aac/notify-asg-aac.");
|
|
106
|
-
case "unknown":
|
|
107
|
-
throw new errors.ReferralExchangeError({
|
|
108
|
-
message: _response.error.errorMessage,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* @param {ReferralExchange.UpdateAacBoundaryReq} request
|
|
115
|
-
* @param {Aac.RequestOptions} requestOptions - Request-specific configuration.
|
|
116
|
-
*
|
|
117
|
-
* @throws {@link ReferralExchange.UnauthorizedError}
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* await client.aac.aacControllerUpsertAacBoundary()
|
|
121
|
-
*/
|
|
122
|
-
aacControllerUpsertAacBoundary() {
|
|
123
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
124
|
-
var _a, _b, _c;
|
|
125
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
126
|
-
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/aac/notify-asg-aac-service-boundary"),
|
|
127
|
-
method: "POST",
|
|
128
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1753420242", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1753420242", "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),
|
|
129
|
-
contentType: "application/json",
|
|
130
|
-
requestType: "json",
|
|
131
|
-
body: request,
|
|
132
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
133
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
134
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
135
|
-
});
|
|
136
|
-
if (_response.ok) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (_response.error.reason === "status-code") {
|
|
140
|
-
switch (_response.error.statusCode) {
|
|
141
|
-
case 401:
|
|
142
|
-
throw new ReferralExchange.UnauthorizedError(_response.error.body);
|
|
143
|
-
default:
|
|
144
|
-
throw new errors.ReferralExchangeError({
|
|
145
|
-
statusCode: _response.error.statusCode,
|
|
146
|
-
body: _response.error.body,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
switch (_response.error.reason) {
|
|
151
|
-
case "non-json":
|
|
152
|
-
throw new errors.ReferralExchangeError({
|
|
153
|
-
statusCode: _response.error.statusCode,
|
|
154
|
-
body: _response.error.rawBody,
|
|
155
|
-
});
|
|
156
|
-
case "timeout":
|
|
157
|
-
throw new errors.ReferralExchangeTimeoutError("Timeout exceeded when calling POST /api/v1/aac/notify-asg-aac-service-boundary.");
|
|
158
|
-
case "unknown":
|
|
159
|
-
throw new errors.ReferralExchangeError({
|
|
160
|
-
message: _response.error.errorMessage,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
_getCustomAuthorizationHeaders() {
|
|
166
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
168
|
-
return { Authorization: apiKeyValue };
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
exports.Aac = Aac;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests";
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client";
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|