ynab 2.0.0 → 2.2.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.
- package/README.md +2 -2
- package/dist/apis/CategoriesApi.d.ts +16 -1
- package/dist/apis/CategoriesApi.js +42 -0
- package/dist/apis/CustomTransactionsApi.d.ts +1 -1
- package/dist/apis/TransactionsApi.d.ts +4 -4
- package/dist/apis/index.d.ts +0 -1
- package/dist/apis/index.js +5 -2
- package/dist/browser/ynab.js +1 -1
- package/dist/esm/apis/CategoriesApi.d.ts +16 -1
- package/dist/esm/apis/CategoriesApi.js +65 -1
- package/dist/esm/apis/CustomTransactionsApi.d.ts +1 -1
- package/dist/esm/apis/index.d.ts +0 -1
- package/dist/esm/apis/index.js +0 -1
- package/dist/esm/models/Category.d.ts +0 -1
- package/dist/esm/models/Category.js +0 -1
- package/dist/esm/models/CategoryGoalType.d.ts +25 -0
- package/dist/esm/models/CategoryGoalType.js +29 -0
- package/dist/esm/models/HybridTransaction.d.ts +9 -30
- package/dist/esm/models/HybridTransaction.js +7 -26
- package/dist/esm/models/PatchCategoryWrapper.d.ts +32 -0
- package/dist/esm/models/PatchCategoryWrapper.js +44 -0
- package/dist/esm/models/SaveCategory.d.ts +43 -0
- package/dist/esm/models/SaveCategory.js +47 -0
- package/dist/esm/models/SaveTransaction.d.ts +8 -28
- package/dist/esm/models/SaveTransaction.js +6 -24
- package/dist/esm/models/SaveTransactionWithId.d.ts +8 -28
- package/dist/esm/models/SaveTransactionWithId.js +6 -24
- package/dist/esm/models/SaveTransactionWithOptionalFields.d.ts +8 -28
- package/dist/esm/models/SaveTransactionWithOptionalFields.js +6 -24
- package/dist/esm/models/SaveTransactionWithOptionalFieldsFlagColor.d.ts +25 -0
- package/dist/esm/models/SaveTransactionWithOptionalFieldsFlagColor.js +29 -0
- package/dist/esm/models/ScheduledTransactionDetail.d.ts +4 -16
- package/dist/esm/models/ScheduledTransactionDetail.js +3 -14
- package/dist/esm/models/ScheduledTransactionSummary.d.ts +4 -16
- package/dist/esm/models/ScheduledTransactionSummary.js +3 -14
- package/dist/esm/models/ScheduledTransactionSummaryFlagColor.d.ts +25 -0
- package/dist/esm/models/ScheduledTransactionSummaryFlagColor.js +29 -0
- package/dist/esm/models/TransactionClearedStatus.d.ts +24 -0
- package/dist/esm/models/TransactionClearedStatus.js +31 -0
- package/dist/esm/models/TransactionDetail.d.ts +9 -30
- package/dist/esm/models/TransactionDetail.js +7 -26
- package/dist/esm/models/TransactionFlagColor.d.ts +27 -0
- package/dist/esm/models/TransactionFlagColor.js +34 -0
- package/dist/esm/models/TransactionSummary.d.ts +9 -30
- package/dist/esm/models/TransactionSummary.js +7 -26
- package/dist/esm/models/TransactionSummaryDebtTransactionType.d.ts +25 -0
- package/dist/esm/models/TransactionSummaryDebtTransactionType.js +29 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/index.js +5 -1
- package/dist/models/AccountType.d.ts +1 -1
- package/dist/models/Category.d.ts +1 -2
- package/dist/models/Category.js +0 -1
- package/dist/models/CategoryGoalType.d.ts +25 -0
- package/dist/models/CategoryGoalType.js +36 -0
- package/dist/models/HybridTransaction.d.ts +11 -32
- package/dist/models/HybridTransaction.js +8 -27
- package/dist/models/HybridTransactionAllOf.d.ts +1 -1
- package/dist/models/PatchCategoryWrapper.d.ts +32 -0
- package/dist/models/PatchCategoryWrapper.js +51 -0
- package/dist/models/SaveCategory.d.ts +43 -0
- package/dist/models/SaveCategory.js +54 -0
- package/dist/models/SaveTransaction.d.ts +8 -28
- package/dist/models/SaveTransaction.js +7 -25
- package/dist/models/SaveTransactionWithId.d.ts +8 -28
- package/dist/models/SaveTransactionWithId.js +7 -25
- package/dist/models/SaveTransactionWithOptionalFields.d.ts +8 -28
- package/dist/models/SaveTransactionWithOptionalFields.js +7 -25
- package/dist/models/SaveTransactionWithOptionalFieldsFlagColor.d.ts +25 -0
- package/dist/models/SaveTransactionWithOptionalFieldsFlagColor.js +36 -0
- package/dist/models/ScheduledTransactionDetail.d.ts +5 -17
- package/dist/models/ScheduledTransactionDetail.js +4 -15
- package/dist/models/ScheduledTransactionSummary.d.ts +5 -17
- package/dist/models/ScheduledTransactionSummary.js +4 -15
- package/dist/models/ScheduledTransactionSummaryFlagColor.d.ts +25 -0
- package/dist/models/ScheduledTransactionSummaryFlagColor.js +36 -0
- package/dist/models/TransactionClearedStatus.d.ts +24 -0
- package/dist/models/TransactionClearedStatus.js +37 -0
- package/dist/models/TransactionDetail.d.ts +10 -31
- package/dist/models/TransactionDetail.js +8 -27
- package/dist/models/TransactionFlagColor.d.ts +27 -0
- package/dist/models/TransactionFlagColor.js +40 -0
- package/dist/models/TransactionSummary.d.ts +10 -31
- package/dist/models/TransactionSummary.js +8 -27
- package/dist/models/TransactionSummaryDebtTransactionType.d.ts +25 -0
- package/dist/models/TransactionSummaryDebtTransactionType.js +36 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +9 -1
- package/dist/runtime.d.ts +9 -9
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ This client is generated using the [OpenAPI Generator](https://openapi-generator
|
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
|
-
First, install the module with npm
|
|
12
|
+
First, install the module with npm:
|
|
13
13
|
|
|
14
14
|
```shell
|
|
15
15
|
npm install ynab
|
|
@@ -118,7 +118,7 @@ folder for example usage scenarios.
|
|
|
118
118
|
|
|
119
119
|
## Methods
|
|
120
120
|
|
|
121
|
-
The following methods are available in this library.
|
|
121
|
+
The following methods are available in this library.
|
|
122
122
|
|
|
123
123
|
| | Method | Description |
|
|
124
124
|
|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { CategoriesResponse, CategoryResponse, PatchMonthCategoryWrapper, SaveCategoryResponse } from '../models/index';
|
|
13
|
+
import type { CategoriesResponse, CategoryResponse, PatchCategoryWrapper, PatchMonthCategoryWrapper, SaveCategoryResponse } from '../models/index';
|
|
14
14
|
export interface GetCategoriesRequest {
|
|
15
15
|
budgetId: string;
|
|
16
16
|
lastKnowledgeOfServer?: number;
|
|
@@ -24,6 +24,11 @@ export interface GetMonthCategoryByIdRequest {
|
|
|
24
24
|
month: string;
|
|
25
25
|
categoryId: string;
|
|
26
26
|
}
|
|
27
|
+
export interface UpdateCategoryRequest {
|
|
28
|
+
budgetId: string;
|
|
29
|
+
categoryId: string;
|
|
30
|
+
data: PatchCategoryWrapper;
|
|
31
|
+
}
|
|
27
32
|
export interface UpdateMonthCategoryRequest {
|
|
28
33
|
budgetId: string;
|
|
29
34
|
month: string;
|
|
@@ -64,6 +69,16 @@ export declare class CategoriesApi extends runtime.BaseAPI {
|
|
|
64
69
|
* Single category for a specific budget month
|
|
65
70
|
*/
|
|
66
71
|
getMonthCategoryById(budgetId: string, month: string, categoryId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CategoryResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Update a category
|
|
74
|
+
* Update a category
|
|
75
|
+
*/
|
|
76
|
+
updateCategoryRaw(requestParameters: UpdateCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SaveCategoryResponse>>;
|
|
77
|
+
/**
|
|
78
|
+
* Update a category
|
|
79
|
+
* Update a category
|
|
80
|
+
*/
|
|
81
|
+
updateCategory(budgetId: string, categoryId: string, data: PatchCategoryWrapper, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SaveCategoryResponse>;
|
|
67
82
|
/**
|
|
68
83
|
* Update a category for a specific month. Only `budgeted` amount can be updated.
|
|
69
84
|
* Update a category for a specific month
|
|
@@ -134,6 +134,48 @@ class CategoriesApi extends runtime.BaseAPI {
|
|
|
134
134
|
const response = await this.getMonthCategoryByIdRaw({ budgetId: budgetId, month: month, categoryId: categoryId }, initOverrides);
|
|
135
135
|
return await response.value();
|
|
136
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Update a category
|
|
139
|
+
* Update a category
|
|
140
|
+
*/
|
|
141
|
+
async updateCategoryRaw(requestParameters, initOverrides) {
|
|
142
|
+
if (requestParameters.budgetId === null || requestParameters.budgetId === undefined) {
|
|
143
|
+
throw new runtime.RequiredError('budgetId', 'Required parameter requestParameters.budgetId was null or undefined when calling updateCategory.');
|
|
144
|
+
}
|
|
145
|
+
if (requestParameters.categoryId === null || requestParameters.categoryId === undefined) {
|
|
146
|
+
throw new runtime.RequiredError('categoryId', 'Required parameter requestParameters.categoryId was null or undefined when calling updateCategory.');
|
|
147
|
+
}
|
|
148
|
+
if (requestParameters.data === null || requestParameters.data === undefined) {
|
|
149
|
+
throw new runtime.RequiredError('data', 'Required parameter requestParameters.data was null or undefined when calling updateCategory.');
|
|
150
|
+
}
|
|
151
|
+
const queryParameters = {};
|
|
152
|
+
const headerParameters = {};
|
|
153
|
+
headerParameters['Accept'] = 'application/json';
|
|
154
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
155
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
156
|
+
const token = this.configuration.accessToken;
|
|
157
|
+
const tokenString = await token("bearer", []);
|
|
158
|
+
if (tokenString) {
|
|
159
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const response = await this.request({
|
|
163
|
+
path: `/budgets/{budget_id}/categories/{category_id}`.replace(`{${"budget_id"}}`, encodeURIComponent(String(requestParameters.budgetId))).replace(`{${"category_id"}}`, encodeURIComponent(String(requestParameters.categoryId))),
|
|
164
|
+
method: 'PATCH',
|
|
165
|
+
headers: headerParameters,
|
|
166
|
+
query: queryParameters,
|
|
167
|
+
body: (0, index_1.PatchCategoryWrapperToJSON)(requestParameters.data),
|
|
168
|
+
}, initOverrides);
|
|
169
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SaveCategoryResponseFromJSON)(jsonValue));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Update a category
|
|
173
|
+
* Update a category
|
|
174
|
+
*/
|
|
175
|
+
async updateCategory(budgetId, categoryId, data, initOverrides) {
|
|
176
|
+
const response = await this.updateCategoryRaw({ budgetId: budgetId, categoryId: categoryId, data: data }, initOverrides);
|
|
177
|
+
return await response.value();
|
|
178
|
+
}
|
|
137
179
|
/**
|
|
138
180
|
* Update a category for a specific month. Only `budgeted` amount can be updated.
|
|
139
181
|
* Update a category for a specific month
|
|
@@ -25,7 +25,7 @@ export declare class CustomTransactionsApi extends TransactionsApi {
|
|
|
25
25
|
* @throws {RequiredError}
|
|
26
26
|
* @memberof TransactionsApi
|
|
27
27
|
*/
|
|
28
|
-
getTransactionsByType(budgetId: string, type: "uncategorized" | "unapproved", lastKnowledgeOfServer?: number, options?: any): Promise<import("..").TransactionsResponse>;
|
|
28
|
+
getTransactionsByType(budgetId: string, type: "uncategorized" | "unapproved" | undefined, lastKnowledgeOfServer?: number, options?: any): Promise<import("..").TransactionsResponse>;
|
|
29
29
|
/**
|
|
30
30
|
* Creates multiple transactions. Provide a body containing a 'transactions' array, multiple transactions will be created.
|
|
31
31
|
* @summary Create a single transaction or multiple transactions
|
|
@@ -174,7 +174,7 @@ export declare const GetTransactionsTypeEnum: {
|
|
|
174
174
|
readonly Uncategorized: "uncategorized";
|
|
175
175
|
readonly Unapproved: "unapproved";
|
|
176
176
|
};
|
|
177
|
-
export
|
|
177
|
+
export type GetTransactionsTypeEnum = typeof GetTransactionsTypeEnum[keyof typeof GetTransactionsTypeEnum];
|
|
178
178
|
/**
|
|
179
179
|
* @export
|
|
180
180
|
*/
|
|
@@ -182,7 +182,7 @@ export declare const GetTransactionsByAccountTypeEnum: {
|
|
|
182
182
|
readonly Uncategorized: "uncategorized";
|
|
183
183
|
readonly Unapproved: "unapproved";
|
|
184
184
|
};
|
|
185
|
-
export
|
|
185
|
+
export type GetTransactionsByAccountTypeEnum = typeof GetTransactionsByAccountTypeEnum[keyof typeof GetTransactionsByAccountTypeEnum];
|
|
186
186
|
/**
|
|
187
187
|
* @export
|
|
188
188
|
*/
|
|
@@ -190,7 +190,7 @@ export declare const GetTransactionsByCategoryTypeEnum: {
|
|
|
190
190
|
readonly Uncategorized: "uncategorized";
|
|
191
191
|
readonly Unapproved: "unapproved";
|
|
192
192
|
};
|
|
193
|
-
export
|
|
193
|
+
export type GetTransactionsByCategoryTypeEnum = typeof GetTransactionsByCategoryTypeEnum[keyof typeof GetTransactionsByCategoryTypeEnum];
|
|
194
194
|
/**
|
|
195
195
|
* @export
|
|
196
196
|
*/
|
|
@@ -198,4 +198,4 @@ export declare const GetTransactionsByPayeeTypeEnum: {
|
|
|
198
198
|
readonly Uncategorized: "uncategorized";
|
|
199
199
|
readonly Unapproved: "unapproved";
|
|
200
200
|
};
|
|
201
|
-
export
|
|
201
|
+
export type GetTransactionsByPayeeTypeEnum = typeof GetTransactionsByPayeeTypeEnum[keyof typeof GetTransactionsByPayeeTypeEnum];
|
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -15,7 +19,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
19
|
__exportStar(require("./AccountsApi"), exports);
|
|
16
20
|
__exportStar(require("./BudgetsApi"), exports);
|
|
17
21
|
__exportStar(require("./CategoriesApi"), exports);
|
|
18
|
-
__exportStar(require("./DeprecatedApi"), exports);
|
|
19
22
|
__exportStar(require("./MonthsApi"), exports);
|
|
20
23
|
__exportStar(require("./PayeeLocationsApi"), exports);
|
|
21
24
|
__exportStar(require("./PayeesApi"), exports);
|