phenoml 11.5.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +0 -17
  3. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +0 -60
  4. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/index.d.ts +0 -1
  5. package/dist/cjs/api/resources/authtoken/resources/auth/index.d.ts +0 -1
  6. package/dist/cjs/api/resources/authtoken/resources/auth/index.js +0 -1
  7. package/dist/cjs/api/resources/authtoken/resources/index.d.ts +0 -1
  8. package/dist/cjs/api/resources/authtoken/resources/index.js +0 -1
  9. package/dist/cjs/api/resources/authtoken/types/index.d.ts +0 -2
  10. package/dist/cjs/api/resources/authtoken/types/index.js +0 -2
  11. package/dist/cjs/api/resources/fhir/client/Client.d.ts +2 -23
  12. package/dist/cjs/api/resources/fhir/client/Client.js +2 -23
  13. package/dist/cjs/api/resources/fhir/client/requests/FhirCreateRequest.d.ts +1 -11
  14. package/dist/cjs/api/resources/fhir/client/requests/FhirUpsertRequest.d.ts +1 -12
  15. package/dist/cjs/version.d.ts +1 -1
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/esm/BaseClient.mjs +2 -2
  18. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +0 -17
  19. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +0 -60
  20. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/index.d.mts +0 -1
  21. package/dist/esm/api/resources/authtoken/resources/auth/index.d.mts +0 -1
  22. package/dist/esm/api/resources/authtoken/resources/auth/index.mjs +0 -1
  23. package/dist/esm/api/resources/authtoken/resources/index.d.mts +0 -1
  24. package/dist/esm/api/resources/authtoken/resources/index.mjs +0 -1
  25. package/dist/esm/api/resources/authtoken/types/index.d.mts +0 -2
  26. package/dist/esm/api/resources/authtoken/types/index.mjs +0 -2
  27. package/dist/esm/api/resources/fhir/client/Client.d.mts +2 -23
  28. package/dist/esm/api/resources/fhir/client/Client.mjs +2 -23
  29. package/dist/esm/api/resources/fhir/client/requests/FhirCreateRequest.d.mts +1 -11
  30. package/dist/esm/api/resources/fhir/client/requests/FhirUpsertRequest.d.mts +1 -12
  31. package/dist/esm/version.d.mts +1 -1
  32. package/dist/esm/version.mjs +1 -1
  33. package/package.json +1 -1
  34. package/reference.md +2 -89
  35. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/AuthGenerateTokenRequest.d.ts +0 -13
  36. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/AuthGenerateTokenRequest.js +0 -3
  37. package/dist/cjs/api/resources/authtoken/resources/auth/types/AuthGenerateTokenResponse.d.ts +0 -4
  38. package/dist/cjs/api/resources/authtoken/resources/auth/types/AuthGenerateTokenResponse.js +0 -3
  39. package/dist/cjs/api/resources/authtoken/resources/auth/types/index.d.ts +0 -1
  40. package/dist/cjs/api/resources/authtoken/resources/auth/types/index.js +0 -17
  41. package/dist/cjs/api/resources/authtoken/types/BadRequestErrorBody.d.ts +0 -5
  42. package/dist/cjs/api/resources/authtoken/types/BadRequestErrorBody.js +0 -3
  43. package/dist/cjs/api/resources/authtoken/types/UnauthorizedErrorBody.d.ts +0 -5
  44. package/dist/cjs/api/resources/authtoken/types/UnauthorizedErrorBody.js +0 -3
  45. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/AuthGenerateTokenRequest.d.mts +0 -13
  46. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/AuthGenerateTokenRequest.mjs +0 -2
  47. package/dist/esm/api/resources/authtoken/resources/auth/types/AuthGenerateTokenResponse.d.mts +0 -4
  48. package/dist/esm/api/resources/authtoken/resources/auth/types/AuthGenerateTokenResponse.mjs +0 -2
  49. package/dist/esm/api/resources/authtoken/resources/auth/types/index.d.mts +0 -1
  50. package/dist/esm/api/resources/authtoken/resources/auth/types/index.mjs +0 -1
  51. package/dist/esm/api/resources/authtoken/types/BadRequestErrorBody.d.mts +0 -5
  52. package/dist/esm/api/resources/authtoken/types/BadRequestErrorBody.mjs +0 -2
  53. package/dist/esm/api/resources/authtoken/types/UnauthorizedErrorBody.d.mts +0 -5
  54. package/dist/esm/api/resources/authtoken/types/UnauthorizedErrorBody.mjs +0 -2
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "phenoml",
46
- "X-Fern-SDK-Version": "11.5.0",
47
- "User-Agent": "phenoml/11.5.0",
46
+ "X-Fern-SDK-Version": "12.0.0",
47
+ "User-Agent": "phenoml/12.0.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -10,23 +10,6 @@ export declare namespace AuthClient {
10
10
  export declare class AuthClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
12
12
  constructor(options?: AuthClient.Options);
13
- /**
14
- * Obtain an access token using client credentials
15
- *
16
- * @param {phenoml.authtoken.AuthGenerateTokenRequest} request
17
- * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
18
- *
19
- * @throws {@link phenoml.authtoken.BadRequestError}
20
- * @throws {@link phenoml.authtoken.UnauthorizedError}
21
- *
22
- * @example
23
- * await client.authtoken.auth.generateToken({
24
- * username: "username",
25
- * password: "password"
26
- * })
27
- */
28
- generateToken(request: phenoml.authtoken.AuthGenerateTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<phenoml.authtoken.AuthGenerateTokenResponse>;
29
- private __generateToken;
30
13
  /**
31
14
  * OAuth 2.0 client credentials token endpoint (RFC 6749 §4.4).
32
15
  * Accepts client_id and client_secret in the request body (JSON or
@@ -55,66 +55,6 @@ class AuthClient {
55
55
  constructor(options = {}) {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
- /**
59
- * Obtain an access token using client credentials
60
- *
61
- * @param {phenoml.authtoken.AuthGenerateTokenRequest} request
62
- * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
63
- *
64
- * @throws {@link phenoml.authtoken.BadRequestError}
65
- * @throws {@link phenoml.authtoken.UnauthorizedError}
66
- *
67
- * @example
68
- * await client.authtoken.auth.generateToken({
69
- * username: "username",
70
- * password: "password"
71
- * })
72
- */
73
- generateToken(request, requestOptions) {
74
- return core.HttpResponsePromise.fromPromise(this.__generateToken(request, requestOptions));
75
- }
76
- __generateToken(request, requestOptions) {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
79
- const _authRequest = yield this._options.authProvider.getAuthRequest();
80
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
82
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "auth/token"),
83
- method: "POST",
84
- headers: _headers,
85
- contentType: "application/json",
86
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
87
- requestType: "json",
88
- body: request,
89
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
90
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
91
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
92
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
93
- logging: this._options.logging,
94
- });
95
- if (_response.ok) {
96
- return {
97
- data: _response.body,
98
- rawResponse: _response.rawResponse,
99
- };
100
- }
101
- if (_response.error.reason === "status-code") {
102
- switch (_response.error.statusCode) {
103
- case 400:
104
- throw new phenoml.authtoken.BadRequestError(_response.error.body, _response.rawResponse);
105
- case 401:
106
- throw new phenoml.authtoken.UnauthorizedError(_response.error.body, _response.rawResponse);
107
- default:
108
- throw new errors.phenomlError({
109
- statusCode: _response.error.statusCode,
110
- body: _response.error.body,
111
- rawResponse: _response.rawResponse,
112
- });
113
- }
114
- }
115
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/auth/token");
116
- });
117
- }
118
58
  /**
119
59
  * OAuth 2.0 client credentials token endpoint (RFC 6749 §4.4).
120
60
  * Accepts client_id and client_secret in the request body (JSON or
@@ -1,2 +1 @@
1
- export type { AuthGenerateTokenRequest } from "./AuthGenerateTokenRequest.js";
2
1
  export type { ClientCredentialsRequest } from "./ClientCredentialsRequest.js";
@@ -1,2 +1 @@
1
1
  export * from "./client/index.js";
2
- export * from "./types/index.js";
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client/index.js"), exports);
18
- __exportStar(require("./types/index.js"), exports);
@@ -1,3 +1,2 @@
1
1
  export * from "./auth/client/requests/index.js";
2
2
  export * as auth from "./auth/index.js";
3
- export * from "./auth/types/index.js";
@@ -39,4 +39,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.auth = void 0;
40
40
  __exportStar(require("./auth/client/requests/index.js"), exports);
41
41
  exports.auth = __importStar(require("./auth/index.js"));
42
- __exportStar(require("./auth/types/index.js"), exports);
@@ -1,4 +1,2 @@
1
- export * from "./BadRequestErrorBody.js";
2
1
  export * from "./OAuthError.js";
3
2
  export * from "./TokenResponse.js";
4
- export * from "./UnauthorizedErrorBody.js";
@@ -14,7 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./BadRequestErrorBody.js"), exports);
18
17
  __exportStar(require("./OAuthError.js"), exports);
19
18
  __exportStar(require("./TokenResponse.js"), exports);
20
- __exportStar(require("./UnauthorizedErrorBody.js"), exports);
@@ -70,17 +70,7 @@ export declare class FhirClient {
70
70
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
71
71
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
72
72
  * body: {
73
- * resourceType: "Patient",
74
- * name: [
75
- * {
76
- * "family": "Doe",
77
- * "given": [
78
- * "Jane"
79
- * ]
80
- * }
81
- * ],
82
- * gender: "female",
83
- * birthDate: "1990-01-01"
73
+ * resourceType: "Patient"
84
74
  * }
85
75
  * })
86
76
  */
@@ -115,18 +105,7 @@ export declare class FhirClient {
115
105
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
116
106
  * body: {
117
107
  * resourceType: "Patient",
118
- * id: "123",
119
- * name: [
120
- * {
121
- * "family": "Doe",
122
- * "given": [
123
- * "John",
124
- * "Updated"
125
- * ]
126
- * }
127
- * ],
128
- * gender: "male",
129
- * birthDate: "1985-05-15"
108
+ * id: "123"
130
109
  * }
131
110
  * })
132
111
  */
@@ -170,17 +170,7 @@ class FhirClient {
170
170
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
171
171
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
172
172
  * body: {
173
- * resourceType: "Patient",
174
- * name: [
175
- * {
176
- * "family": "Doe",
177
- * "given": [
178
- * "Jane"
179
- * ]
180
- * }
181
- * ],
182
- * gender: "female",
183
- * birthDate: "1990-01-01"
173
+ * resourceType: "Patient"
184
174
  * }
185
175
  * })
186
176
  */
@@ -267,18 +257,7 @@ class FhirClient {
267
257
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
268
258
  * body: {
269
259
  * resourceType: "Patient",
270
- * id: "123",
271
- * name: [
272
- * {
273
- * "family": "Doe",
274
- * "given": [
275
- * "John",
276
- * "Updated"
277
- * ]
278
- * }
279
- * ],
280
- * gender: "male",
281
- * birthDate: "1985-05-15"
260
+ * id: "123"
282
261
  * }
283
262
  * })
284
263
  */
@@ -5,17 +5,7 @@ import type * as phenoml from "../../../../index.js";
5
5
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
6
6
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
7
7
  * body: {
8
- * resourceType: "Patient",
9
- * name: [
10
- * {
11
- * "family": "Doe",
12
- * "given": [
13
- * "Jane"
14
- * ]
15
- * }
16
- * ],
17
- * gender: "female",
18
- * birthDate: "1990-01-01"
8
+ * resourceType: "Patient"
19
9
  * }
20
10
  * }
21
11
  */
@@ -6,18 +6,7 @@ import type * as phenoml from "../../../../index.js";
6
6
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
7
7
  * body: {
8
8
  * resourceType: "Patient",
9
- * id: "123",
10
- * name: [
11
- * {
12
- * "family": "Doe",
13
- * "given": [
14
- * "John",
15
- * "Updated"
16
- * ]
17
- * }
18
- * ],
19
- * gender: "male",
20
- * birthDate: "1985-05-15"
9
+ * id: "123"
21
10
  * }
22
11
  * }
23
12
  */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "11.5.0";
1
+ export declare const SDK_VERSION = "12.0.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "11.5.0";
4
+ exports.SDK_VERSION = "12.0.0";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "phenoml",
9
- "X-Fern-SDK-Version": "11.5.0",
10
- "User-Agent": "phenoml/11.5.0",
9
+ "X-Fern-SDK-Version": "12.0.0",
10
+ "User-Agent": "phenoml/12.0.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -10,23 +10,6 @@ export declare namespace AuthClient {
10
10
  export declare class AuthClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
12
12
  constructor(options?: AuthClient.Options);
13
- /**
14
- * Obtain an access token using client credentials
15
- *
16
- * @param {phenoml.authtoken.AuthGenerateTokenRequest} request
17
- * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
18
- *
19
- * @throws {@link phenoml.authtoken.BadRequestError}
20
- * @throws {@link phenoml.authtoken.UnauthorizedError}
21
- *
22
- * @example
23
- * await client.authtoken.auth.generateToken({
24
- * username: "username",
25
- * password: "password"
26
- * })
27
- */
28
- generateToken(request: phenoml.authtoken.AuthGenerateTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<phenoml.authtoken.AuthGenerateTokenResponse>;
29
- private __generateToken;
30
13
  /**
31
14
  * OAuth 2.0 client credentials token endpoint (RFC 6749 §4.4).
32
15
  * Accepts client_id and client_secret in the request body (JSON or
@@ -19,66 +19,6 @@ export class AuthClient {
19
19
  constructor(options = {}) {
20
20
  this._options = normalizeClientOptionsWithAuth(options);
21
21
  }
22
- /**
23
- * Obtain an access token using client credentials
24
- *
25
- * @param {phenoml.authtoken.AuthGenerateTokenRequest} request
26
- * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
27
- *
28
- * @throws {@link phenoml.authtoken.BadRequestError}
29
- * @throws {@link phenoml.authtoken.UnauthorizedError}
30
- *
31
- * @example
32
- * await client.authtoken.auth.generateToken({
33
- * username: "username",
34
- * password: "password"
35
- * })
36
- */
37
- generateToken(request, requestOptions) {
38
- return core.HttpResponsePromise.fromPromise(this.__generateToken(request, requestOptions));
39
- }
40
- __generateToken(request, requestOptions) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
43
- const _authRequest = yield this._options.authProvider.getAuthRequest();
44
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
46
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "auth/token"),
47
- method: "POST",
48
- headers: _headers,
49
- contentType: "application/json",
50
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
51
- requestType: "json",
52
- body: request,
53
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
54
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
55
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
56
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
57
- logging: this._options.logging,
58
- });
59
- if (_response.ok) {
60
- return {
61
- data: _response.body,
62
- rawResponse: _response.rawResponse,
63
- };
64
- }
65
- if (_response.error.reason === "status-code") {
66
- switch (_response.error.statusCode) {
67
- case 400:
68
- throw new phenoml.authtoken.BadRequestError(_response.error.body, _response.rawResponse);
69
- case 401:
70
- throw new phenoml.authtoken.UnauthorizedError(_response.error.body, _response.rawResponse);
71
- default:
72
- throw new errors.phenomlError({
73
- statusCode: _response.error.statusCode,
74
- body: _response.error.body,
75
- rawResponse: _response.rawResponse,
76
- });
77
- }
78
- }
79
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/auth/token");
80
- });
81
- }
82
22
  /**
83
23
  * OAuth 2.0 client credentials token endpoint (RFC 6749 §4.4).
84
24
  * Accepts client_id and client_secret in the request body (JSON or
@@ -1,2 +1 @@
1
- export type { AuthGenerateTokenRequest } from "./AuthGenerateTokenRequest.mjs";
2
1
  export type { ClientCredentialsRequest } from "./ClientCredentialsRequest.mjs";
@@ -1,2 +1 @@
1
1
  export * from "./client/index.mjs";
2
- export * from "./types/index.mjs";
@@ -1,2 +1 @@
1
1
  export * from "./client/index.mjs";
2
- export * from "./types/index.mjs";
@@ -1,3 +1,2 @@
1
1
  export * from "./auth/client/requests/index.mjs";
2
2
  export * as auth from "./auth/index.mjs";
3
- export * from "./auth/types/index.mjs";
@@ -1,3 +1,2 @@
1
1
  export * from "./auth/client/requests/index.mjs";
2
2
  export * as auth from "./auth/index.mjs";
3
- export * from "./auth/types/index.mjs";
@@ -1,4 +1,2 @@
1
- export * from "./BadRequestErrorBody.mjs";
2
1
  export * from "./OAuthError.mjs";
3
2
  export * from "./TokenResponse.mjs";
4
- export * from "./UnauthorizedErrorBody.mjs";
@@ -1,4 +1,2 @@
1
- export * from "./BadRequestErrorBody.mjs";
2
1
  export * from "./OAuthError.mjs";
3
2
  export * from "./TokenResponse.mjs";
4
- export * from "./UnauthorizedErrorBody.mjs";
@@ -70,17 +70,7 @@ export declare class FhirClient {
70
70
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
71
71
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
72
72
  * body: {
73
- * resourceType: "Patient",
74
- * name: [
75
- * {
76
- * "family": "Doe",
77
- * "given": [
78
- * "Jane"
79
- * ]
80
- * }
81
- * ],
82
- * gender: "female",
83
- * birthDate: "1990-01-01"
73
+ * resourceType: "Patient"
84
74
  * }
85
75
  * })
86
76
  */
@@ -115,18 +105,7 @@ export declare class FhirClient {
115
105
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
116
106
  * body: {
117
107
  * resourceType: "Patient",
118
- * id: "123",
119
- * name: [
120
- * {
121
- * "family": "Doe",
122
- * "given": [
123
- * "John",
124
- * "Updated"
125
- * ]
126
- * }
127
- * ],
128
- * gender: "male",
129
- * birthDate: "1985-05-15"
108
+ * id: "123"
130
109
  * }
131
110
  * })
132
111
  */
@@ -134,17 +134,7 @@ export class FhirClient {
134
134
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
135
135
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
136
136
  * body: {
137
- * resourceType: "Patient",
138
- * name: [
139
- * {
140
- * "family": "Doe",
141
- * "given": [
142
- * "Jane"
143
- * ]
144
- * }
145
- * ],
146
- * gender: "female",
147
- * birthDate: "1990-01-01"
137
+ * resourceType: "Patient"
148
138
  * }
149
139
  * })
150
140
  */
@@ -231,18 +221,7 @@ export class FhirClient {
231
221
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
232
222
  * body: {
233
223
  * resourceType: "Patient",
234
- * id: "123",
235
- * name: [
236
- * {
237
- * "family": "Doe",
238
- * "given": [
239
- * "John",
240
- * "Updated"
241
- * ]
242
- * }
243
- * ],
244
- * gender: "male",
245
- * birthDate: "1985-05-15"
224
+ * id: "123"
246
225
  * }
247
226
  * })
248
227
  */
@@ -5,17 +5,7 @@ import type * as phenoml from "../../../../index.mjs";
5
5
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
6
6
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
7
7
  * body: {
8
- * resourceType: "Patient",
9
- * name: [
10
- * {
11
- * "family": "Doe",
12
- * "given": [
13
- * "Jane"
14
- * ]
15
- * }
16
- * ],
17
- * gender: "female",
18
- * birthDate: "1990-01-01"
8
+ * resourceType: "Patient"
19
9
  * }
20
10
  * }
21
11
  */
@@ -6,18 +6,7 @@ import type * as phenoml from "../../../../index.mjs";
6
6
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
7
7
  * body: {
8
8
  * resourceType: "Patient",
9
- * id: "123",
10
- * name: [
11
- * {
12
- * "family": "Doe",
13
- * "given": [
14
- * "John",
15
- * "Updated"
16
- * ]
17
- * }
18
- * ],
19
- * gender: "male",
20
- * birthDate: "1985-05-15"
9
+ * id: "123"
21
10
  * }
22
11
  * }
23
12
  */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "11.5.0";
1
+ export declare const SDK_VERSION = "12.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "11.5.0";
1
+ export const SDK_VERSION = "12.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "11.5.0",
3
+ "version": "12.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -1081,72 +1081,6 @@ await client.agent.prompts.loadDefaults();
1081
1081
  </details>
1082
1082
 
1083
1083
  ## Authtoken Auth
1084
- <details><summary><code>client.authtoken.auth.<a href="/src/api/resources/authtoken/resources/auth/client/Client.ts">generateToken</a>({ ...params }) -> phenoml.AuthGenerateTokenResponse</code></summary>
1085
- <dl>
1086
- <dd>
1087
-
1088
- #### 📝 Description
1089
-
1090
- <dl>
1091
- <dd>
1092
-
1093
- <dl>
1094
- <dd>
1095
-
1096
- Obtain an access token using client credentials
1097
- </dd>
1098
- </dl>
1099
- </dd>
1100
- </dl>
1101
-
1102
- #### 🔌 Usage
1103
-
1104
- <dl>
1105
- <dd>
1106
-
1107
- <dl>
1108
- <dd>
1109
-
1110
- ```typescript
1111
- await client.authtoken.auth.generateToken({
1112
- username: "username",
1113
- password: "password"
1114
- });
1115
-
1116
- ```
1117
- </dd>
1118
- </dl>
1119
- </dd>
1120
- </dl>
1121
-
1122
- #### ⚙️ Parameters
1123
-
1124
- <dl>
1125
- <dd>
1126
-
1127
- <dl>
1128
- <dd>
1129
-
1130
- **request:** `phenoml.authtoken.AuthGenerateTokenRequest`
1131
-
1132
- </dd>
1133
- </dl>
1134
-
1135
- <dl>
1136
- <dd>
1137
-
1138
- **requestOptions:** `AuthClient.RequestOptions`
1139
-
1140
- </dd>
1141
- </dl>
1142
- </dd>
1143
- </dl>
1144
-
1145
-
1146
- </dd>
1147
- </dl>
1148
- </details>
1149
-
1150
1084
  <details><summary><code>client.authtoken.auth.<a href="/src/api/resources/authtoken/resources/auth/client/Client.ts">getToken</a>({ ...params }) -> phenoml.TokenResponse</code></summary>
1151
1085
  <dl>
1152
1086
  <dd>
@@ -2255,17 +2189,7 @@ await client.fhir.create("550e8400-e29b-41d4-a716-446655440000", "Patient", {
2255
2189
  "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
2256
2190
  "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
2257
2191
  body: {
2258
- resourceType: "Patient",
2259
- name: [
2260
- {
2261
- "family": "Doe",
2262
- "given": [
2263
- "Jane"
2264
- ]
2265
- }
2266
- ],
2267
- gender: "female",
2268
- birthDate: "1990-01-01"
2192
+ resourceType: "Patient"
2269
2193
  }
2270
2194
  });
2271
2195
 
@@ -2363,18 +2287,7 @@ await client.fhir.upsert("550e8400-e29b-41d4-a716-446655440000", "Patient", {
2363
2287
  "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
2364
2288
  body: {
2365
2289
  resourceType: "Patient",
2366
- id: "123",
2367
- name: [
2368
- {
2369
- "family": "Doe",
2370
- "given": [
2371
- "John",
2372
- "Updated"
2373
- ]
2374
- }
2375
- ],
2376
- gender: "male",
2377
- birthDate: "1985-05-15"
2290
+ id: "123"
2378
2291
  }
2379
2292
  });
2380
2293
 
@@ -1,13 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * username: "username",
5
- * password: "password"
6
- * }
7
- */
8
- export interface AuthGenerateTokenRequest {
9
- /** The API credential client ID */
10
- username: string;
11
- /** The API credential client secret */
12
- password: string;
13
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- export interface AuthGenerateTokenResponse {
2
- /** JWT token to be used for subsequent authenticated requests */
3
- token: string;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from "./AuthGenerateTokenResponse.js";
@@ -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("./AuthGenerateTokenResponse.js"), exports);
@@ -1,5 +0,0 @@
1
- export interface BadRequestErrorBody {
2
- code?: number | undefined;
3
- message?: string | undefined;
4
- data?: Record<string, unknown> | undefined;
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- export interface UnauthorizedErrorBody {
2
- code?: number | undefined;
3
- message?: string | undefined;
4
- data?: Record<string, unknown> | undefined;
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * username: "username",
5
- * password: "password"
6
- * }
7
- */
8
- export interface AuthGenerateTokenRequest {
9
- /** The API credential client ID */
10
- username: string;
11
- /** The API credential client secret */
12
- password: string;
13
- }
@@ -1,2 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- export {};
@@ -1,4 +0,0 @@
1
- export interface AuthGenerateTokenResponse {
2
- /** JWT token to be used for subsequent authenticated requests */
3
- token: string;
4
- }
@@ -1,2 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- export {};
@@ -1 +0,0 @@
1
- export * from "./AuthGenerateTokenResponse.mjs";
@@ -1 +0,0 @@
1
- export * from "./AuthGenerateTokenResponse.mjs";
@@ -1,5 +0,0 @@
1
- export interface BadRequestErrorBody {
2
- code?: number | undefined;
3
- message?: string | undefined;
4
- data?: Record<string, unknown> | undefined;
5
- }
@@ -1,2 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- export {};
@@ -1,5 +0,0 @@
1
- export interface UnauthorizedErrorBody {
2
- code?: number | undefined;
3
- message?: string | undefined;
4
- data?: Record<string, unknown> | undefined;
5
- }
@@ -1,2 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- export {};