firefly-api
Version:
OpenAPI Autogenerated firefly-iii TypeScript API
1,054 lines • 1.07 MB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Firefly III API v2.0.0
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2023-03-05T14:16:31+00:00
*
* The version of the OpenAPI document: 2.0.0
* Contact: james@firefly-iii.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AvailableBudgetsApi = exports.AvailableBudgetsApiFactory = exports.AvailableBudgetsApiFp = exports.AvailableBudgetsApiAxiosParamCreator = exports.AutocompleteApi = exports.AutocompleteApiFactory = exports.AutocompleteApiFp = exports.AutocompleteApiAxiosParamCreator = exports.AttachmentsApi = exports.AttachmentsApiFactory = exports.AttachmentsApiFp = exports.AttachmentsApiAxiosParamCreator = exports.AccountsApi = exports.AccountsApiFactory = exports.AccountsApiFp = exports.AccountsApiAxiosParamCreator = exports.AboutApi = exports.AboutApiFactory = exports.AboutApiFp = exports.AboutApiAxiosParamCreator = exports.WebhookTrigger = exports.WebhookResponse = exports.WebhookDelivery = exports.UserRoleProperty = exports.UserBlockedCodeProperty = exports.TransactionTypeProperty = exports.TransactionTypeFilter = exports.ShortAccountTypeProperty = exports.RuleTriggerType = exports.RuleTriggerKeyword = exports.RuleActionKeyword = exports.RecurrenceTransactionType = exports.RecurrenceRepetitionType = exports.LiabilityType = exports.LiabilityDirection = exports.InterestPeriod = exports.ExportFileFilter = exports.DataDestroyObject = exports.CurrencyUpdateDefaultEnum = exports.CreditCardType = exports.ConfigValueUpdateFilter = exports.ConfigValueFilter = exports.BillRepeatFrequency = exports.AutoBudgetType = exports.AutoBudgetPeriod = exports.AttachableType = exports.AccountTypeProperty = exports.AccountTypeFilter = exports.AccountSearchFieldFilter = exports.AccountRoleProperty = void 0;
exports.RecurrencesApiFp = exports.RecurrencesApiAxiosParamCreator = exports.PreferencesApi = exports.PreferencesApiFactory = exports.PreferencesApiFp = exports.PreferencesApiAxiosParamCreator = exports.PiggyBanksApi = exports.PiggyBanksApiFactory = exports.PiggyBanksApiFp = exports.PiggyBanksApiAxiosParamCreator = exports.ObjectGroupsApi = exports.ObjectGroupsApiFactory = exports.ObjectGroupsApiFp = exports.ObjectGroupsApiAxiosParamCreator = exports.LinksApi = exports.LinksApiFactory = exports.LinksApiFp = exports.LinksApiAxiosParamCreator = exports.InsightApi = exports.InsightApiFactory = exports.InsightApiFp = exports.InsightApiAxiosParamCreator = exports.DataApi = exports.DataApiFactory = exports.DataApiFp = exports.DataApiAxiosParamCreator = exports.CurrenciesApi = exports.CurrenciesApiFactory = exports.CurrenciesApiFp = exports.CurrenciesApiAxiosParamCreator = exports.ConfigurationApi = exports.ConfigurationApiFactory = exports.ConfigurationApiFp = exports.ConfigurationApiAxiosParamCreator = exports.ChartsApi = exports.ChartsApiFactory = exports.ChartsApiFp = exports.ChartsApiAxiosParamCreator = exports.CategoriesApi = exports.CategoriesApiFactory = exports.CategoriesApiFp = exports.CategoriesApiAxiosParamCreator = exports.BudgetsApi = exports.BudgetsApiFactory = exports.BudgetsApiFp = exports.BudgetsApiAxiosParamCreator = exports.BillsApi = exports.BillsApiFactory = exports.BillsApiFp = exports.BillsApiAxiosParamCreator = void 0;
exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = exports.UsersApi = exports.UsersApiFactory = exports.UsersApiFp = exports.UsersApiAxiosParamCreator = exports.TransactionsApi = exports.TransactionsApiFactory = exports.TransactionsApiFp = exports.TransactionsApiAxiosParamCreator = exports.TagsApi = exports.TagsApiFactory = exports.TagsApiFp = exports.TagsApiAxiosParamCreator = exports.SummaryApi = exports.SummaryApiFactory = exports.SummaryApiFp = exports.SummaryApiAxiosParamCreator = exports.SearchApi = exports.SearchApiFactory = exports.SearchApiFp = exports.SearchApiAxiosParamCreator = exports.RulesApi = exports.RulesApiFactory = exports.RulesApiFp = exports.RulesApiAxiosParamCreator = exports.RuleGroupsApi = exports.RuleGroupsApiFactory = exports.RuleGroupsApiFp = exports.RuleGroupsApiAxiosParamCreator = exports.RecurrencesApi = exports.RecurrencesApiFactory = void 0;
const axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("./common");
// @ts-ignore
const base_1 = require("./base");
/**
* Is only mandatory when the type is asset.
* @export
* @enum {string}
*/
exports.AccountRoleProperty = {
DefaultAsset: 'defaultAsset',
SharedAsset: 'sharedAsset',
SavingAsset: 'savingAsset',
CcAsset: 'ccAsset',
CashWalletAsset: 'cashWalletAsset',
Null: 'null'
};
/**
*
* @export
* @enum {string}
*/
exports.AccountSearchFieldFilter = {
All: 'all',
Iban: 'iban',
Name: 'name',
Number: 'number',
Id: 'id'
};
/**
*
* @export
* @enum {string}
*/
exports.AccountTypeFilter = {
All: 'all',
Asset: 'asset',
Cash: 'cash',
Expense: 'expense',
Revenue: 'revenue',
Special: 'special',
Hidden: 'hidden',
Liability: 'liability',
Liabilities: 'liabilities',
DefaultAccount: 'Default account',
CashAccount: 'Cash account',
AssetAccount: 'Asset account',
ExpenseAccount: 'Expense account',
RevenueAccount: 'Revenue account',
InitialBalanceAccount: 'Initial balance account',
BeneficiaryAccount: 'Beneficiary account',
ImportAccount: 'Import account',
ReconciliationAccount: 'Reconciliation account',
Loan: 'Loan',
Debt: 'Debt',
Mortgage: 'Mortgage'
};
/**
*
* @export
* @enum {string}
*/
exports.AccountTypeProperty = {
DefaultAccount: 'Default account',
CashAccount: 'Cash account',
AssetAccount: 'Asset account',
ExpenseAccount: 'Expense account',
RevenueAccount: 'Revenue account',
InitialBalanceAccount: 'Initial balance account',
BeneficiaryAccount: 'Beneficiary account',
ImportAccount: 'Import account',
ReconciliationAccount: 'Reconciliation account',
Loan: 'Loan',
Debt: 'Debt',
Mortgage: 'Mortgage'
};
/**
* The object class to which the attachment must be linked.
* @export
* @enum {string}
*/
exports.AttachableType = {
Account: 'Account',
Budget: 'Budget',
Bill: 'Bill',
TransactionJournal: 'TransactionJournal',
PiggyBank: 'PiggyBank',
Tag: 'Tag'
};
/**
* Period for the auto budget
* @export
* @enum {string}
*/
exports.AutoBudgetPeriod = {
Daily: 'daily',
Weekly: 'weekly',
Monthly: 'monthly',
Quarterly: 'quarterly',
HalfYear: 'half-year',
Yearly: 'yearly',
Null: 'null'
};
/**
* The type of auto-budget that Firefly III must create.
* @export
* @enum {string}
*/
exports.AutoBudgetType = {
Reset: 'reset',
Rollover: 'rollover',
None: 'none',
Null: 'null'
};
/**
* How often the bill must be paid.
* @export
* @enum {string}
*/
exports.BillRepeatFrequency = {
Weekly: 'weekly',
Monthly: 'monthly',
Quarterly: 'quarterly',
HalfYear: 'half-year',
Yearly: 'yearly'
};
/**
*
* @export
* @enum {string}
*/
exports.ConfigValueFilter = {
ConfigurationIsDemoSite: 'configuration.is_demo_site',
ConfigurationPermissionUpdateCheck: 'configuration.permission_update_check',
ConfigurationLastUpdateCheck: 'configuration.last_update_check',
ConfigurationSingleUserMode: 'configuration.single_user_mode',
FireflyVersion: 'firefly.version',
FireflyApiVersion: 'firefly.api_version',
FireflyDefaultLocation: 'firefly.default_location',
FireflyAccountToTransaction: 'firefly.account_to_transaction',
FireflyAllowedOpposingTypes: 'firefly.allowed_opposing_types',
FireflyAccountRoles: 'firefly.accountRoles',
FireflyValidLiabilities: 'firefly.valid_liabilities',
FireflyInterestPeriods: 'firefly.interest_periods',
FireflyEnableExternalMap: 'firefly.enable_external_map',
FireflyExpectedSourceTypes: 'firefly.expected_source_types',
AppTimezone: 'app.timezone',
FireflyBillPeriods: 'firefly.bill_periods',
FireflyCreditCardTypes: 'firefly.credit_card_types',
FireflyLanguages: 'firefly.languages',
FireflyValidViewRanges: 'firefly.valid_view_ranges'
};
/**
*
* @export
* @enum {string}
*/
exports.ConfigValueUpdateFilter = {
IsDemoSite: 'configuration.is_demo_site',
PermissionUpdateCheck: 'configuration.permission_update_check',
LastUpdateCheck: 'configuration.last_update_check',
SingleUserMode: 'configuration.single_user_mode'
};
/**
* Mandatory when the account_role is ccAsset. Can only be monthlyFull or null.
* @export
* @enum {string}
*/
exports.CreditCardType = {
MonthlyFull: 'monthlyFull',
Null: 'null'
};
exports.CurrencyUpdateDefaultEnum = {
True: true
};
/**
*
* @export
* @enum {string}
*/
exports.DataDestroyObject = {
Budgets: 'budgets',
Bills: 'bills',
PiggyBanks: 'piggy_banks',
Rules: 'rules',
Recurring: 'recurring',
Categories: 'categories',
Tags: 'tags',
ObjectGroups: 'object_groups',
Accounts: 'accounts',
AssetAccounts: 'asset_accounts',
ExpenseAccounts: 'expense_accounts',
RevenueAccounts: 'revenue_accounts',
Liabilities: 'liabilities',
Transactions: 'transactions',
Withdrawals: 'withdrawals',
Deposits: 'deposits',
Transfers: 'transfers'
};
/**
*
* @export
* @enum {string}
*/
exports.ExportFileFilter = {
Csv: 'csv'
};
/**
* Mandatory when type is liability. Period over which the interest is calculated.
* @export
* @enum {string}
*/
exports.InterestPeriod = {
Weekly: 'weekly',
Monthly: 'monthly',
Quarterly: 'quarterly',
HalfYear: 'half-year',
Yearly: 'yearly',
Null: 'null'
};
/**
* \'credit\' indicates somebody owes you the liability. \'debit\' Indicates you owe this debt yourself. Works only for liabiltiies.
* @export
* @enum {string}
*/
exports.LiabilityDirection = {
Credit: 'credit',
Debit: 'debit',
Null: 'null'
};
/**
* Mandatory when type is liability. Specifies the exact type.
* @export
* @enum {string}
*/
exports.LiabilityType = {
Loan: 'loan',
Debt: 'debt',
Mortgage: 'mortgage',
Null: 'null'
};
/**
* The type of the repetition. ndom means: the n-th weekday of the month, where you can also specify which day of the week.
* @export
* @enum {string}
*/
exports.RecurrenceRepetitionType = {
Daily: 'daily',
Weekly: 'weekly',
Ndom: 'ndom',
Monthly: 'monthly',
Yearly: 'yearly'
};
/**
*
* @export
* @enum {string}
*/
exports.RecurrenceTransactionType = {
Withdrawal: 'withdrawal',
Transfer: 'transfer',
Deposit: 'deposit'
};
/**
* The type of thing this action will do. A limited set is possible.
* @export
* @enum {string}
*/
exports.RuleActionKeyword = {
UserAction: 'user_action',
SetCategory: 'set_category',
ClearCategory: 'clear_category',
SetBudget: 'set_budget',
ClearBudget: 'clear_budget',
AddTag: 'add_tag',
RemoveTag: 'remove_tag',
RemoveAllTags: 'remove_all_tags',
SetDescription: 'set_description',
AppendDescription: 'append_description',
PrependDescription: 'prepend_description',
SetSourceAccount: 'set_source_account',
SetDestinationAccount: 'set_destination_account',
SetNotes: 'set_notes',
AppendNotes: 'append_notes',
PrependNotes: 'prepend_notes',
ClearNotes: 'clear_notes',
LinkToBill: 'link_to_bill',
ConvertWithdrawal: 'convert_withdrawal',
ConvertDeposit: 'convert_deposit',
ConvertTransfer: 'convert_transfer',
DeleteTransaction: 'delete_transaction'
};
/**
* The type of thing this trigger responds to. A limited set is possible
* @export
* @enum {string}
*/
exports.RuleTriggerKeyword = {
FromAccountStarts: 'from_account_starts',
FromAccountEnds: 'from_account_ends',
FromAccountIs: 'from_account_is',
FromAccountContains: 'from_account_contains',
ToAccountStarts: 'to_account_starts',
ToAccountEnds: 'to_account_ends',
ToAccountIs: 'to_account_is',
ToAccountContains: 'to_account_contains',
AmountLess: 'amount_less',
AmountExactly: 'amount_exactly',
AmountMore: 'amount_more',
DescriptionStarts: 'description_starts',
DescriptionEnds: 'description_ends',
DescriptionContains: 'description_contains',
DescriptionIs: 'description_is',
TransactionType: 'transaction_type',
CategoryIs: 'category_is',
BudgetIs: 'budget_is',
TagIs: 'tag_is',
CurrencyIs: 'currency_is',
HasAttachments: 'has_attachments',
HasNoCategory: 'has_no_category',
HasAnyCategory: 'has_any_category',
HasNoBudget: 'has_no_budget',
HasAnyBudget: 'has_any_budget',
HasNoTag: 'has_no_tag',
HasAnyTag: 'has_any_tag',
NotesContains: 'notes_contains',
NotesStart: 'notes_start',
NotesEnd: 'notes_end',
NotesAre: 'notes_are',
NoNotes: 'no_notes',
AnyNotes: 'any_notes',
SourceAccountIs: 'source_account_is',
DestinationAccountIs: 'destination_account_is',
SourceAccountStarts: 'source_account_starts'
};
/**
* Which action is necessary for the rule to fire? Use either store-journal or update-journal.
* @export
* @enum {string}
*/
exports.RuleTriggerType = {
StoreJournal: 'store-journal',
UpdateJournal: 'update-journal'
};
/**
* Can only be one one these account types. import, initial-balance and reconciliation cannot be set manually.
* @export
* @enum {string}
*/
exports.ShortAccountTypeProperty = {
Asset: 'asset',
Expense: 'expense',
Import: 'import',
Revenue: 'revenue',
Cash: 'cash',
Liability: 'liability',
Liabilities: 'liabilities',
InitialBalance: 'initial-balance',
Reconciliation: 'reconciliation'
};
/**
*
* @export
* @enum {string}
*/
exports.TransactionTypeFilter = {
All: 'all',
Withdrawal: 'withdrawal',
Withdrawals: 'withdrawals',
Expense: 'expense',
Deposit: 'deposit',
Deposits: 'deposits',
Income: 'income',
Transfer: 'transfer',
Transfers: 'transfers',
OpeningBalance: 'opening_balance',
Reconciliation: 'reconciliation',
Special: 'special',
Specials: 'specials',
Default: 'default'
};
/**
*
* @export
* @enum {string}
*/
exports.TransactionTypeProperty = {
Withdrawal: 'withdrawal',
Deposit: 'deposit',
Transfer: 'transfer',
Reconciliation: 'reconciliation',
OpeningBalance: 'opening balance'
};
/**
* If you say the user must be blocked, this will be the reason code.
* @export
* @enum {string}
*/
exports.UserBlockedCodeProperty = {
EmailChanged: 'email_changed',
Null: 'null'
};
/**
* Role for the user. Can be empty or omitted.
* @export
* @enum {string}
*/
exports.UserRoleProperty = {
Owner: 'owner',
Demo: 'demo',
Null: 'null'
};
/**
* Format of the delivered response.
* @export
* @enum {string}
*/
exports.WebhookDelivery = {
Json: 'JSON'
};
/**
* Indicator for what Firefly III will deliver to the webhook URL.
* @export
* @enum {string}
*/
exports.WebhookResponse = {
Transactions: 'TRANSACTIONS',
Accounts: 'ACCOUNTS',
None: 'NONE'
};
/**
* The trigger for the webhook.
* @export
* @enum {string}
*/
exports.WebhookTrigger = {
StoreTransaction: 'STORE_TRANSACTION',
UpdateTransaction: 'UPDATE_TRANSACTION',
DestroyTransaction: 'DESTROY_TRANSACTION'
};
/**
* AboutApi - axios parameter creator
* @export
*/
const AboutApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns general system information and versions of the (supporting) software.
* @summary System information end point.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAbout: (xTraceId, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/v1/about`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users.
* @summary Cron job endpoint
* @param {string} cliToken The CLI token of any user in Firefly III, required to run the cron job.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {string} [date] A date formatted YYYY-MM-DD. This can be used to make the cron job pretend it\'s running on another day.
* @param {boolean} [force] Forces the cron job to fire, regardless of whether it has fired before. This may result in double transactions or weird budgets, so be careful.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCron: (cliToken, xTraceId, date, force, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'cliToken' is not null or undefined
(0, common_1.assertParamExists)('getCron', 'cliToken', cliToken);
const localVarPath = `/v1/cron/{cliToken}`
.replace(`{${"cliToken"}}`, encodeURIComponent(String(cliToken)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (date !== undefined) {
localVarQueryParameter['date'] = (date instanceof Date) ?
date.toISOString().substr(0, 10) :
date;
}
if (force !== undefined) {
localVarQueryParameter['force'] = force;
}
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Returns the currently authenticated user.
* @summary Currently authenticated user endpoint.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCurrentUser: (xTraceId, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/v1/about/user`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.AboutApiAxiosParamCreator = AboutApiAxiosParamCreator;
/**
* AboutApi - functional programming interface
* @export
*/
const AboutApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.AboutApiAxiosParamCreator)(configuration);
return {
/**
* Returns general system information and versions of the (supporting) software.
* @summary System information end point.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAbout(xTraceId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getAbout(xTraceId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users.
* @summary Cron job endpoint
* @param {string} cliToken The CLI token of any user in Firefly III, required to run the cron job.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {string} [date] A date formatted YYYY-MM-DD. This can be used to make the cron job pretend it\'s running on another day.
* @param {boolean} [force] Forces the cron job to fire, regardless of whether it has fired before. This may result in double transactions or weird budgets, so be careful.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCron(cliToken, xTraceId, date, force, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getCron(cliToken, xTraceId, date, force, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Returns the currently authenticated user.
* @summary Currently authenticated user endpoint.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCurrentUser(xTraceId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getCurrentUser(xTraceId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
};
};
exports.AboutApiFp = AboutApiFp;
/**
* AboutApi - factory interface
* @export
*/
const AboutApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.AboutApiFp)(configuration);
return {
/**
* Returns general system information and versions of the (supporting) software.
* @summary System information end point.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAbout(xTraceId, options) {
return localVarFp.getAbout(xTraceId, options).then((request) => request(axios, basePath));
},
/**
* Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users.
* @summary Cron job endpoint
* @param {string} cliToken The CLI token of any user in Firefly III, required to run the cron job.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {string} [date] A date formatted YYYY-MM-DD. This can be used to make the cron job pretend it\'s running on another day.
* @param {boolean} [force] Forces the cron job to fire, regardless of whether it has fired before. This may result in double transactions or weird budgets, so be careful.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCron(cliToken, xTraceId, date, force, options) {
return localVarFp.getCron(cliToken, xTraceId, date, force, options).then((request) => request(axios, basePath));
},
/**
* Returns the currently authenticated user.
* @summary Currently authenticated user endpoint.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCurrentUser(xTraceId, options) {
return localVarFp.getCurrentUser(xTraceId, options).then((request) => request(axios, basePath));
},
};
};
exports.AboutApiFactory = AboutApiFactory;
/**
* AboutApi - object-oriented interface
* @export
* @class AboutApi
* @extends {BaseAPI}
*/
class AboutApi extends base_1.BaseAPI {
/**
* Returns general system information and versions of the (supporting) software.
* @summary System information end point.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AboutApi
*/
getAbout(xTraceId, options) {
return (0, exports.AboutApiFp)(this.configuration).getAbout(xTraceId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users.
* @summary Cron job endpoint
* @param {string} cliToken The CLI token of any user in Firefly III, required to run the cron job.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {string} [date] A date formatted YYYY-MM-DD. This can be used to make the cron job pretend it\'s running on another day.
* @param {boolean} [force] Forces the cron job to fire, regardless of whether it has fired before. This may result in double transactions or weird budgets, so be careful.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AboutApi
*/
getCron(cliToken, xTraceId, date, force, options) {
return (0, exports.AboutApiFp)(this.configuration).getCron(cliToken, xTraceId, date, force, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns the currently authenticated user.
* @summary Currently authenticated user endpoint.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AboutApi
*/
getCurrentUser(xTraceId, options) {
return (0, exports.AboutApiFp)(this.configuration).getCurrentUser(xTraceId, options).then((request) => request(this.axios, this.basePath));
}
}
exports.AboutApi = AboutApi;
/**
* AccountsApi - axios parameter creator
* @export
*/
const AccountsApiAxiosParamCreator = function (configuration) {
return {
/**
* Will permanently delete an account. Any associated transactions and piggy banks are ALSO deleted. Cannot be recovered from.
* @summary Permanently delete account.
* @param {string} id The ID of the account.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAccount: (id, xTraceId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('deleteAccount', 'id', id);
const localVarPath = `/v1/accounts/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Returns a single account by its ID.
* @summary Get single account.
* @param {string} id The ID of the account.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {string} [date] A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account\'s balance on that day.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccount: (id, xTraceId, date, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('getAccount', 'id', id);
const localVarPath = `/v1/accounts/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (date !== undefined) {
localVarQueryParameter['date'] = (date instanceof Date) ?
date.toISOString().substr(0, 10) :
date;
}
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* This endpoint returns a list of all the accounts owned by the authenticated user.
* @summary List all accounts.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {number} [page] Page number. The default pagination is per 50 items.
* @param {string} [date] A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account\'s balance on that day.
* @param {AccountTypeFilter} [type] Optional filter on the account type(s) returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAccount: (xTraceId, page, date, type, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/v1/accounts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (date !== undefined) {
localVarQueryParameter['date'] = (date instanceof Date) ?
date.toISOString().substr(0, 10) :
date;
}
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Lists all attachments.
* @summary Lists all attachments.
* @param {string} id The ID of the account.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {number} [page] Page number. The default pagination is 50.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAttachmentByAccount: (id, xTraceId, page, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('listAttachmentByAccount', 'id', id);
const localVarPath = `/v1/accounts/{id}/attachments`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* This endpoint returns a list of all the piggy banks connected to the account.
* @summary List all piggy banks related to the account.
* @param {string} id The ID of the account.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {number} [page] Page number. The default pagination is per 50 items.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listPiggyBankByAccount: (id, xTraceId, page, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('listPiggyBankByAccount', 'id', id);
const localVarPath = `/v1/accounts/{id}/piggy-banks`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* This endpoint returns a list of all the transactions connected to the account.
* @summary List all transactions related to the account.
* @param {string} id The ID of the account.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {number} [page] Page number. The default pagination is per 50 items.
* @param {number} [limit] Limits the number of results on one page.
* @param {string} [start] A date formatted YYYY-MM-DD.
* @param {string} [end] A date formatted YYYY-MM-DD.
* @param {TransactionTypeFilter} [type] Optional filter on the transaction type(s) returned.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listTransactionByAccount: (id, xTraceId, page, limit, start, end, type, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('listTransactionByAccount', 'id', id);
const localVarPath = `/v1/accounts/{id}/transactions`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (start !== undefined) {
localVarQueryParameter['start'] = (start instanceof Date) ?
start.toISOString().substr(0, 10) :
start;
}
if (end !== undefined) {
localVarQueryParameter['end'] = (end instanceof Date) ?
end.toISOString().substr(0, 10) :
end;
}
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Creates a new account. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform).
* @summary Create new account.
* @param {AccountStore} accountStore JSON array with the necessary account information or key=value pairs. See the model for the exact specifications.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
storeAccount: (accountStore, xTraceId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'accountStore' is not null or undefined
(0, common_1.assertParamExists)('storeAccount', 'accountStore', accountStore);
const localVarPath = `/v1/accounts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication firefly_iii_auth required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "firefly_iii_auth", [], configuration);
if (xTraceId != null) {
localVarHeaderParameter['X-Trace-Id'] = String(xTraceId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(accountStore, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Used to update a single account. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory.
* @summary Update existing account.
* @param {string} id The ID of the account.
* @param {AccountUpdate} accountUpdate JSON array or formdata with updated account information. See the model for the exact specifications.
* @param {string} [xTraceId] Unique identifier associated with this request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateAccount: (id, accountUpdate, xTraceId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
(0, common_1.assertParamExists)('updateAccount', 'id', id);
// verify required parameter 'accountUpdate' is not null or undefined
(0, common_1.assertParamExists)('updateAccount', 'accountUpdate', accountUpdate);
const localVarPath = `/v1/accounts/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let b