blanche-client-sdk 0.1.3

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 (70) hide show
  1. package/.openapi-generator/FILES +36 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +127 -0
  5. package/dist/apis/SessionsApi.d.ts +51 -0
  6. package/dist/apis/SessionsApi.js +219 -0
  7. package/dist/apis/UsersApi.d.ts +49 -0
  8. package/dist/apis/UsersApi.js +215 -0
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +20 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.js +21 -0
  13. package/dist/models/ApiV1ProfileGet200Response.d.ts +44 -0
  14. package/dist/models/ApiV1ProfileGet200Response.js +59 -0
  15. package/dist/models/ApiV1ProfileGet401Response.d.ts +32 -0
  16. package/dist/models/ApiV1ProfileGet401Response.js +51 -0
  17. package/dist/models/ApiV1SessionsPost200Response.d.ts +38 -0
  18. package/dist/models/ApiV1SessionsPost200Response.js +55 -0
  19. package/dist/models/ApiV1SessionsPost401Response.d.ts +32 -0
  20. package/dist/models/ApiV1SessionsPost401Response.js +51 -0
  21. package/dist/models/ApiV1SessionsPostRequest.d.ts +38 -0
  22. package/dist/models/ApiV1SessionsPostRequest.js +55 -0
  23. package/dist/models/ApiV1UsersIdPatch200Response.d.ts +44 -0
  24. package/dist/models/ApiV1UsersIdPatch200Response.js +59 -0
  25. package/dist/models/ApiV1UsersIdPatchRequest.d.ts +33 -0
  26. package/dist/models/ApiV1UsersIdPatchRequest.js +52 -0
  27. package/dist/models/ApiV1UsersIdPatchRequestUser.d.ts +44 -0
  28. package/dist/models/ApiV1UsersIdPatchRequestUser.js +53 -0
  29. package/dist/models/ApiV1UsersPost422Response.d.ts +32 -0
  30. package/dist/models/ApiV1UsersPost422Response.js +51 -0
  31. package/dist/models/ApiV1UsersPostRequest.d.ts +33 -0
  32. package/dist/models/ApiV1UsersPostRequest.js +52 -0
  33. package/dist/models/ApiV1UsersPostRequestUser.d.ts +44 -0
  34. package/dist/models/ApiV1UsersPostRequestUser.js +59 -0
  35. package/dist/models/index.d.ts +11 -0
  36. package/dist/models/index.js +29 -0
  37. package/dist/runtime.d.ts +184 -0
  38. package/dist/runtime.js +564 -0
  39. package/docs/ApiV1ProfileGet200Response.md +38 -0
  40. package/docs/ApiV1ProfileGet401Response.md +34 -0
  41. package/docs/ApiV1SessionsPost200Response.md +36 -0
  42. package/docs/ApiV1SessionsPost401Response.md +34 -0
  43. package/docs/ApiV1SessionsPostRequest.md +36 -0
  44. package/docs/ApiV1UsersIdPatch200Response.md +38 -0
  45. package/docs/ApiV1UsersIdPatchRequest.md +34 -0
  46. package/docs/ApiV1UsersIdPatchRequestUser.md +38 -0
  47. package/docs/ApiV1UsersPost422Response.md +34 -0
  48. package/docs/ApiV1UsersPostRequest.md +34 -0
  49. package/docs/ApiV1UsersPostRequestUser.md +38 -0
  50. package/docs/SessionsApi.md +209 -0
  51. package/docs/UsersApi.md +205 -0
  52. package/package.json +19 -0
  53. package/src/apis/SessionsApi.ts +159 -0
  54. package/src/apis/UsersApi.ts +155 -0
  55. package/src/apis/index.ts +4 -0
  56. package/src/index.ts +5 -0
  57. package/src/models/ApiV1ProfileGet200Response.ts +84 -0
  58. package/src/models/ApiV1ProfileGet401Response.ts +66 -0
  59. package/src/models/ApiV1SessionsPost200Response.ts +75 -0
  60. package/src/models/ApiV1SessionsPost401Response.ts +66 -0
  61. package/src/models/ApiV1SessionsPostRequest.ts +75 -0
  62. package/src/models/ApiV1UsersIdPatch200Response.ts +84 -0
  63. package/src/models/ApiV1UsersIdPatchRequest.ts +74 -0
  64. package/src/models/ApiV1UsersIdPatchRequestUser.ts +81 -0
  65. package/src/models/ApiV1UsersPost422Response.ts +66 -0
  66. package/src/models/ApiV1UsersPostRequest.ts +74 -0
  67. package/src/models/ApiV1UsersPostRequestUser.ts +84 -0
  68. package/src/models/index.ts +13 -0
  69. package/src/runtime.ts +432 -0
  70. package/tsconfig.json +20 -0
@@ -0,0 +1,36 @@
1
+ .gitignore
2
+ .npmignore
3
+ .openapi-generator-ignore
4
+ README.md
5
+ docs/ApiV1ProfileGet200Response.md
6
+ docs/ApiV1ProfileGet401Response.md
7
+ docs/ApiV1SessionsPost200Response.md
8
+ docs/ApiV1SessionsPost401Response.md
9
+ docs/ApiV1SessionsPostRequest.md
10
+ docs/ApiV1UsersIdPatch200Response.md
11
+ docs/ApiV1UsersIdPatchRequest.md
12
+ docs/ApiV1UsersIdPatchRequestUser.md
13
+ docs/ApiV1UsersPost422Response.md
14
+ docs/ApiV1UsersPostRequest.md
15
+ docs/ApiV1UsersPostRequestUser.md
16
+ docs/SessionsApi.md
17
+ docs/UsersApi.md
18
+ package.json
19
+ src/apis/SessionsApi.ts
20
+ src/apis/UsersApi.ts
21
+ src/apis/index.ts
22
+ src/index.ts
23
+ src/models/ApiV1ProfileGet200Response.ts
24
+ src/models/ApiV1ProfileGet401Response.ts
25
+ src/models/ApiV1SessionsPost200Response.ts
26
+ src/models/ApiV1SessionsPost401Response.ts
27
+ src/models/ApiV1SessionsPostRequest.ts
28
+ src/models/ApiV1UsersIdPatch200Response.ts
29
+ src/models/ApiV1UsersIdPatchRequest.ts
30
+ src/models/ApiV1UsersIdPatchRequestUser.ts
31
+ src/models/ApiV1UsersPost422Response.ts
32
+ src/models/ApiV1UsersPostRequest.ts
33
+ src/models/ApiV1UsersPostRequestUser.ts
34
+ src/models/index.ts
35
+ src/runtime.ts
36
+ tsconfig.json
@@ -0,0 +1 @@
1
+ 7.19.0
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # blanche-client-sdk@0.0.0
2
+
3
+ A TypeScript SDK client for the localhost API.
4
+
5
+ ## Usage
6
+
7
+ First, install the SDK from npm.
8
+
9
+ ```bash
10
+ npm install blanche-client-sdk --save
11
+ ```
12
+
13
+ Next, try it out.
14
+
15
+
16
+ ```ts
17
+ import {
18
+ Configuration,
19
+ SessionsApi,
20
+ } from 'blanche-client-sdk';
21
+ import type { ApiV1SessionsDeleteRequest } from 'blanche-client-sdk';
22
+
23
+ async function example() {
24
+ console.log("🚀 Testing blanche-client-sdk SDK...");
25
+ const api = new SessionsApi();
26
+
27
+ const body = {
28
+ // string | JWT refresh token
29
+ xRefreshToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...,
30
+ } satisfies ApiV1SessionsDeleteRequest;
31
+
32
+ try {
33
+ const data = await api.apiV1SessionsDelete(body);
34
+ console.log(data);
35
+ } catch (error) {
36
+ console.error(error);
37
+ }
38
+ }
39
+
40
+ // Run the test
41
+ example().catch(console.error);
42
+ ```
43
+
44
+
45
+ ## Documentation
46
+
47
+ ### API Endpoints
48
+
49
+ All URIs are relative to *http://localhost:3000*
50
+
51
+ | Class | Method | HTTP request | Description
52
+ | ----- | ------ | ------------ | -------------
53
+ *SessionsApi* | [**apiV1SessionsDelete**](docs/SessionsApi.md#apiv1sessionsdelete) | **DELETE** /api/v1/sessions | Logout user and invalidate refresh token
54
+ *SessionsApi* | [**apiV1SessionsPost**](docs/SessionsApi.md#apiv1sessionspostoperation) | **POST** /api/v1/sessions | Authenticate user and return tokens
55
+ *SessionsApi* | [**apiV1SessionsRefreshPost**](docs/SessionsApi.md#apiv1sessionsrefreshpost) | **POST** /api/v1/sessions/refresh | Refresh tokens using a valid refresh token
56
+ *UsersApi* | [**apiV1ProfileGet**](docs/UsersApi.md#apiv1profileget) | **GET** /api/v1/profile | Get current user profile
57
+ *UsersApi* | [**apiV1UsersIdPatch**](docs/UsersApi.md#apiv1usersidpatchoperation) | **PATCH** /api/v1/users/{id} | Updates a user
58
+ *UsersApi* | [**apiV1UsersPost**](docs/UsersApi.md#apiv1userspostoperation) | **POST** /api/v1/users | Creates a user
59
+
60
+
61
+ ### Models
62
+
63
+ - [ApiV1ProfileGet200Response](docs/ApiV1ProfileGet200Response.md)
64
+ - [ApiV1ProfileGet401Response](docs/ApiV1ProfileGet401Response.md)
65
+ - [ApiV1SessionsPost200Response](docs/ApiV1SessionsPost200Response.md)
66
+ - [ApiV1SessionsPost401Response](docs/ApiV1SessionsPost401Response.md)
67
+ - [ApiV1SessionsPostRequest](docs/ApiV1SessionsPostRequest.md)
68
+ - [ApiV1UsersIdPatch200Response](docs/ApiV1UsersIdPatch200Response.md)
69
+ - [ApiV1UsersIdPatchRequest](docs/ApiV1UsersIdPatchRequest.md)
70
+ - [ApiV1UsersIdPatchRequestUser](docs/ApiV1UsersIdPatchRequestUser.md)
71
+ - [ApiV1UsersPost422Response](docs/ApiV1UsersPost422Response.md)
72
+ - [ApiV1UsersPostRequest](docs/ApiV1UsersPostRequest.md)
73
+ - [ApiV1UsersPostRequestUser](docs/ApiV1UsersPostRequestUser.md)
74
+
75
+ ### Authorization
76
+
77
+ Endpoints do not require authorization.
78
+
79
+
80
+ ## About
81
+
82
+ This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
83
+ and is automatically generated by the
84
+ [OpenAPI Generator](https://openapi-generator.tech) project:
85
+
86
+ - API version: `v1`
87
+ - Package version: `0.0.0`
88
+ - Generator version: `7.19.0`
89
+ - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
90
+
91
+ The generated npm module supports the following:
92
+
93
+ - Environments
94
+ * Node.js
95
+ * Webpack
96
+ * Browserify
97
+ - Language levels
98
+ * ES5 - you must have a Promises/A+ library installed
99
+ * ES6
100
+ - Module systems
101
+ * CommonJS
102
+ * ES6 module system
103
+
104
+
105
+ ## Development
106
+
107
+ ### Building
108
+
109
+ To build the TypeScript source code, you need to have Node.js and npm installed.
110
+ After cloning the repository, navigate to the project directory and run:
111
+
112
+ ```bash
113
+ npm install
114
+ npm run build
115
+ ```
116
+
117
+ ### Publishing
118
+
119
+ Once you've built the package, you can publish it to npm:
120
+
121
+ ```bash
122
+ npm publish
123
+ ```
124
+
125
+ ## License
126
+
127
+ []()
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Blanche API
3
+ * AI-powered life tracking system API
4
+ *
5
+ * The version of the OpenAPI document: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { ApiV1SessionsPost200Response, ApiV1SessionsPostRequest } from '../models/index';
14
+ export interface ApiV1SessionsDeleteRequest {
15
+ xRefreshToken: string;
16
+ }
17
+ export interface ApiV1SessionsPostOperationRequest {
18
+ apiV1SessionsPostRequest?: ApiV1SessionsPostRequest;
19
+ }
20
+ export interface ApiV1SessionsRefreshPostRequest {
21
+ xRefreshToken: string;
22
+ }
23
+ /**
24
+ *
25
+ */
26
+ export declare class SessionsApi extends runtime.BaseAPI {
27
+ /**
28
+ * Logout user and invalidate refresh token
29
+ */
30
+ apiV1SessionsDeleteRaw(requestParameters: ApiV1SessionsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
31
+ /**
32
+ * Logout user and invalidate refresh token
33
+ */
34
+ apiV1SessionsDelete(requestParameters: ApiV1SessionsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
35
+ /**
36
+ * Authenticate user and return tokens
37
+ */
38
+ apiV1SessionsPostRaw(requestParameters: ApiV1SessionsPostOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiV1SessionsPost200Response>>;
39
+ /**
40
+ * Authenticate user and return tokens
41
+ */
42
+ apiV1SessionsPost(requestParameters?: ApiV1SessionsPostOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiV1SessionsPost200Response>;
43
+ /**
44
+ * Refresh tokens using a valid refresh token
45
+ */
46
+ apiV1SessionsRefreshPostRaw(requestParameters: ApiV1SessionsRefreshPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiV1SessionsPost200Response>>;
47
+ /**
48
+ * Refresh tokens using a valid refresh token
49
+ */
50
+ apiV1SessionsRefreshPost(requestParameters: ApiV1SessionsRefreshPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiV1SessionsPost200Response>;
51
+ }
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Blanche API
6
+ * AI-powered life tracking system API
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
41
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.SessionsApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var SessionsApi = /** @class */ (function (_super) {
74
+ __extends(SessionsApi, _super);
75
+ function SessionsApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Logout user and invalidate refresh token
80
+ */
81
+ SessionsApi.prototype.apiV1SessionsDeleteRaw = function (requestParameters, initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var queryParameters, headerParameters, urlPath, response;
84
+ return __generator(this, function (_a) {
85
+ switch (_a.label) {
86
+ case 0:
87
+ if (requestParameters['xRefreshToken'] == null) {
88
+ throw new runtime.RequiredError('xRefreshToken', 'Required parameter "xRefreshToken" was null or undefined when calling apiV1SessionsDelete().');
89
+ }
90
+ queryParameters = {};
91
+ headerParameters = {};
92
+ if (requestParameters['xRefreshToken'] != null) {
93
+ headerParameters['X-Refresh-Token'] = String(requestParameters['xRefreshToken']);
94
+ }
95
+ urlPath = "/api/v1/sessions";
96
+ return [4 /*yield*/, this.request({
97
+ path: urlPath,
98
+ method: 'DELETE',
99
+ headers: headerParameters,
100
+ query: queryParameters,
101
+ }, initOverrides)];
102
+ case 1:
103
+ response = _a.sent();
104
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
105
+ }
106
+ });
107
+ });
108
+ };
109
+ /**
110
+ * Logout user and invalidate refresh token
111
+ */
112
+ SessionsApi.prototype.apiV1SessionsDelete = function (requestParameters, initOverrides) {
113
+ return __awaiter(this, void 0, void 0, function () {
114
+ return __generator(this, function (_a) {
115
+ switch (_a.label) {
116
+ case 0: return [4 /*yield*/, this.apiV1SessionsDeleteRaw(requestParameters, initOverrides)];
117
+ case 1:
118
+ _a.sent();
119
+ return [2 /*return*/];
120
+ }
121
+ });
122
+ });
123
+ };
124
+ /**
125
+ * Authenticate user and return tokens
126
+ */
127
+ SessionsApi.prototype.apiV1SessionsPostRaw = function (requestParameters, initOverrides) {
128
+ return __awaiter(this, void 0, void 0, function () {
129
+ var queryParameters, headerParameters, urlPath, response;
130
+ return __generator(this, function (_a) {
131
+ switch (_a.label) {
132
+ case 0:
133
+ queryParameters = {};
134
+ headerParameters = {};
135
+ headerParameters['Content-Type'] = 'application/json';
136
+ urlPath = "/api/v1/sessions";
137
+ return [4 /*yield*/, this.request({
138
+ path: urlPath,
139
+ method: 'POST',
140
+ headers: headerParameters,
141
+ query: queryParameters,
142
+ body: (0, index_1.ApiV1SessionsPostRequestToJSON)(requestParameters['apiV1SessionsPostRequest']),
143
+ }, initOverrides)];
144
+ case 1:
145
+ response = _a.sent();
146
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ApiV1SessionsPost200ResponseFromJSON)(jsonValue); })];
147
+ }
148
+ });
149
+ });
150
+ };
151
+ /**
152
+ * Authenticate user and return tokens
153
+ */
154
+ SessionsApi.prototype.apiV1SessionsPost = function () {
155
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
156
+ var response;
157
+ if (requestParameters === void 0) { requestParameters = {}; }
158
+ return __generator(this, function (_a) {
159
+ switch (_a.label) {
160
+ case 0: return [4 /*yield*/, this.apiV1SessionsPostRaw(requestParameters, initOverrides)];
161
+ case 1:
162
+ response = _a.sent();
163
+ return [4 /*yield*/, response.value()];
164
+ case 2: return [2 /*return*/, _a.sent()];
165
+ }
166
+ });
167
+ });
168
+ };
169
+ /**
170
+ * Refresh tokens using a valid refresh token
171
+ */
172
+ SessionsApi.prototype.apiV1SessionsRefreshPostRaw = function (requestParameters, initOverrides) {
173
+ return __awaiter(this, void 0, void 0, function () {
174
+ var queryParameters, headerParameters, urlPath, response;
175
+ return __generator(this, function (_a) {
176
+ switch (_a.label) {
177
+ case 0:
178
+ if (requestParameters['xRefreshToken'] == null) {
179
+ throw new runtime.RequiredError('xRefreshToken', 'Required parameter "xRefreshToken" was null or undefined when calling apiV1SessionsRefreshPost().');
180
+ }
181
+ queryParameters = {};
182
+ headerParameters = {};
183
+ if (requestParameters['xRefreshToken'] != null) {
184
+ headerParameters['X-Refresh-Token'] = String(requestParameters['xRefreshToken']);
185
+ }
186
+ urlPath = "/api/v1/sessions/refresh";
187
+ return [4 /*yield*/, this.request({
188
+ path: urlPath,
189
+ method: 'POST',
190
+ headers: headerParameters,
191
+ query: queryParameters,
192
+ }, initOverrides)];
193
+ case 1:
194
+ response = _a.sent();
195
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ApiV1SessionsPost200ResponseFromJSON)(jsonValue); })];
196
+ }
197
+ });
198
+ });
199
+ };
200
+ /**
201
+ * Refresh tokens using a valid refresh token
202
+ */
203
+ SessionsApi.prototype.apiV1SessionsRefreshPost = function (requestParameters, initOverrides) {
204
+ return __awaiter(this, void 0, void 0, function () {
205
+ var response;
206
+ return __generator(this, function (_a) {
207
+ switch (_a.label) {
208
+ case 0: return [4 /*yield*/, this.apiV1SessionsRefreshPostRaw(requestParameters, initOverrides)];
209
+ case 1:
210
+ response = _a.sent();
211
+ return [4 /*yield*/, response.value()];
212
+ case 2: return [2 /*return*/, _a.sent()];
213
+ }
214
+ });
215
+ });
216
+ };
217
+ return SessionsApi;
218
+ }(runtime.BaseAPI));
219
+ exports.SessionsApi = SessionsApi;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Blanche API
3
+ * AI-powered life tracking system API
4
+ *
5
+ * The version of the OpenAPI document: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { ApiV1ProfileGet200Response, ApiV1UsersIdPatch200Response, ApiV1UsersIdPatchRequest, ApiV1UsersPostRequest } from '../models/index';
14
+ export interface ApiV1UsersIdPatchOperationRequest {
15
+ id: string;
16
+ apiV1UsersIdPatchRequest?: ApiV1UsersIdPatchRequest;
17
+ }
18
+ export interface ApiV1UsersPostOperationRequest {
19
+ apiV1UsersPostRequest?: ApiV1UsersPostRequest;
20
+ }
21
+ /**
22
+ *
23
+ */
24
+ export declare class UsersApi extends runtime.BaseAPI {
25
+ /**
26
+ * Get current user profile
27
+ */
28
+ apiV1ProfileGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiV1ProfileGet200Response>>;
29
+ /**
30
+ * Get current user profile
31
+ */
32
+ apiV1ProfileGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiV1ProfileGet200Response>;
33
+ /**
34
+ * Updates a user
35
+ */
36
+ apiV1UsersIdPatchRaw(requestParameters: ApiV1UsersIdPatchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiV1UsersIdPatch200Response>>;
37
+ /**
38
+ * Updates a user
39
+ */
40
+ apiV1UsersIdPatch(requestParameters: ApiV1UsersIdPatchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiV1UsersIdPatch200Response>;
41
+ /**
42
+ * Creates a user
43
+ */
44
+ apiV1UsersPostRaw(requestParameters: ApiV1UsersPostOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiV1ProfileGet200Response>>;
45
+ /**
46
+ * Creates a user
47
+ */
48
+ apiV1UsersPost(requestParameters?: ApiV1UsersPostOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiV1ProfileGet200Response>;
49
+ }