import { TimeSpan } from '@elaraai/core/east'; import { Cache } from '@elaraai/core/datasource'; import { ELARASchema } from '@elaraai/core/schema'; /** * The scope to be applied to to the {@link XeroPlugin}. * * @category DataSource */ export declare type XeroScope = 'offline_access' | 'accounting_settings' | 'accounting_transactions_read' | 'accounting_reports_read' | 'accounting_journals_read' | 'accounting_settings_read' | 'accounting_contacts_read' | 'accounting_attachments_read' | 'files_read' | 'assets_read' | 'projects_read' | 'payroll_employees_read' | 'payroll_payruns_read' | 'payroll_payslip_read' | 'payroll_timesheets_read' | 'payroll_settings_read'; /** * The environment variables to define an {@link XeroPlugin}. * * @category DataSource */ export declare type XeroEnv = { XERO_CLIENT_ID?: string; XERO_CLIENT_SECRET?: string; XERO_TENANT?: string; }; /** * A {@link XeroPluginDefinition} to configure the {@link XeroPlugin}. * * @category DataSource */ export declare type XeroPluginDefinition = { /** the set of {@link MyobEnv}'s to apply to the API */ scope?: Set; /** the {@link TimeSpan} indicating the total history to query */ history?: TimeSpan; /** the {@link TimeSpan} indicating the history to query on updates */ update_history?: TimeSpan; /** the configuration of the {@link Cache} for the DataSource. */ cache?: Cache; /** the configuration of the DataSource {@link Poll} */ poll?: TimeSpan; /** the environment variables to apply to the {@link XeroPluginDefinition} */ env?: XeroEnv; }; /** * Create a streaming {@link DataSourceDefinition} for the Xero API with supporting diagnostic pages: {@link https://developer.xero.com/documentation/getting-started-guide/}. * * @param definition: the desired {@link XeroPluginDefinition}. * @return a {@link ELARASchema} containing a {@link XeroPluginDefinition} contents * * @category DataSource * * @example * ```typescript * //Create a XeroPlugin poll an initial four weeks of data, and then the last hour (and next week) of data from the API every `hour` for `Accounting` with default environment names. * const xero = XeroPlugin({ * history: TimeSpan(4, 'week'), * update_history: TimeSpan(1), * future: TimeSpan(2, 'week'), * poll: TimeSpan(1), * scope: new Set([accounting_transactions_read', 'accounting_reports_read', 'accounting_journals_read']), * }) * ``` */ export declare function XeroPlugin(args?: XeroPluginDefinition): ELARASchema; //# sourceMappingURL=xero.d.ts.map