@airporting/integrations-app 0.4.145 → 0.4.147

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.
@@ -0,0 +1,18 @@
1
+ import { CurrencyOption } from './types.ts';
2
+ /**
3
+ * Devise fonctionnelle par défaut d'un import de fichier.
4
+ * Doit rester alignée avec le défaut appliqué côté API (app-api-v2).
5
+ */
6
+ export declare const DEFAULT_IMPORT_CURRENCY: string;
7
+ /**
8
+ * Codes ISO 4217 utiles aux dossiers Airporting.
9
+ * EUR en tête (cas majoritaire), puis ordre alphabétique.
10
+ * Liste volontairement courte : les dossiers hors zone euro (Afrique
11
+ * centrale/de l'Ouest, Madagascar, Maghreb, etc.) sont couverts ici.
12
+ */
13
+ export declare const IMPORT_CURRENCY_OPTIONS: CurrencyOption[];
14
+ /**
15
+ * Ajoute la devise déjà enregistrée sur un import si elle sort de la liste
16
+ * courte, pour ne jamais afficher un Select vide sur un dossier exotique.
17
+ */
18
+ export declare function currencyOptionsWith(currency: string | null): CurrencyOption[];
@@ -1,8 +1,12 @@
1
1
  import { FecImportDetail, FecImportSummary, FileImportMapping } from './types.ts';
2
- export declare function useFecImportUploadMutation(): import("@tanstack/react-query").UseMutationResult<FecImportDetail, Error, File, unknown>;
2
+ export declare function useFecImportUploadMutation(): import("@tanstack/react-query").UseMutationResult<FecImportDetail, Error, {
3
+ file: File;
4
+ currency: string;
5
+ }, unknown>;
3
6
  export declare function useFecImportMappingMutation(importId: string | null): import("@tanstack/react-query").UseMutationResult<FecImportDetail, Error, {
4
7
  mapping: FileImportMapping;
5
8
  hasHeader: boolean;
9
+ currency?: string;
6
10
  }, unknown>;
7
11
  export declare function useFecImportCommitMutation(): import("@tanstack/react-query").UseMutationResult<FecImportSummary, Error, string, unknown>;
8
12
  export declare function useFecImportDeleteMutation(): import("@tanstack/react-query").UseMutationResult<FecImportSummary, Error, string, unknown>;
@@ -1,6 +1,10 @@
1
1
  export type FecImportStatus = 'mapping_required' | 'validated' | 'failed' | 'committed' | 'deleted';
2
2
  export type FileImportSourceFormat = 'fec' | 'excel' | 'csv';
3
3
  export type FileImportMapping = Partial<Record<'entry_date' | 'journal_code' | 'entry_number' | 'account_number' | 'account_label' | 'label' | 'debit' | 'credit' | 'amount' | 'document_ref' | 'third_party_number' | 'third_party_label' | 'tag_group' | 'tag_label' | 'analytical_code' | 'lettering', string | null>>;
4
+ export type CurrencyOption = {
5
+ value: string;
6
+ label: string;
7
+ };
4
8
  export type FecIssue = {
5
9
  severity: 'error' | 'warning';
6
10
  code: string;
@@ -24,6 +28,7 @@ export type FecImportSummary = {
24
28
  file_size_bytes: number;
25
29
  has_raw_file: boolean;
26
30
  encoding: string | null;
31
+ currency: string | null;
27
32
  period_start: string | null;
28
33
  period_end: string | null;
29
34
  line_count: number;
@@ -0,0 +1,2 @@
1
+ import type { FecImportMappingFormProps } from './fecImportUi.types.ts';
2
+ export declare function FecImportMappingForm({ detail }: FecImportMappingFormProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import type { FecImportRowsPreviewProps } from './fecImportUi.types.ts';
2
+ export declare function FecImportRowsPreview({ importId }: FecImportRowsPreviewProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,25 @@
1
+ import type { FecImportDetail, FecImportSummary, FecImportStagingLine, FecImportStatus, FileImportMapping } from '@/src/api/fec-imports/types.ts';
2
+ import type { AmountMappingMode, FecImportStatusItem, FecImportStatusOption, MappingField } from './fecImportUi.types.ts';
3
+ export declare const RAW_EXAMPLE_ROW_LIMIT = 5;
4
+ export declare const PROCESSED_PREVIEW_ROW_LIMIT = 50;
5
+ export declare const DEFAULT_VISIBLE_IMPORT_STATUSES: FecImportStatus[];
6
+ export declare const IMPORT_STATUS_OPTIONS: FecImportStatusOption[];
7
+ export declare const REQUIRED_MAPPING_FIELDS: MappingField[];
8
+ export declare const OPTIONAL_MAPPING_FIELDS: MappingField[];
9
+ export declare function filterImportsByStatuses<T extends FecImportStatusItem>(imports: T[], statuses?: FecImportStatus[]): T[];
10
+ export declare function isFecImportStatus(value: string): value is FecImportStatus;
11
+ export declare function getInitialAmountMappingMode(mapping: FileImportMapping): AmountMappingMode;
12
+ export declare function isAmountMappingMode(value: string): value is AmountMappingMode;
13
+ export declare function mappingForAmountMode(mapping: FileImportMapping, mode: AmountMappingMode): FileImportMapping;
14
+ export declare function missingMappingLabels(mapping: FileImportMapping, amountMode: AmountMappingMode, sectionAccounts?: boolean): string[];
15
+ export declare function getRawExampleRows(rows: FecImportStagingLine[]): FecImportStagingLine[];
16
+ export declare function getProcessedPreviewRows(rows: FecImportStagingLine[], showErrorsOnly: boolean): FecImportStagingLine[];
17
+ export declare function mappingLabelsForColumn(mapping: FileImportMapping, column: string, amountMode: AmountMappingMode): string[];
18
+ export declare function formatDate(value: string | null, withTime?: boolean): string;
19
+ export declare function formatAmount(value: number | null | undefined): string;
20
+ export declare function firstIssue(row: FecImportSummary | FecImportStagingLine): string | null;
21
+ export declare function normalizeColumnName(value: string): string;
22
+ export declare function guessMapping(sourceColumns: string[], headerNames: string[]): FileImportMapping;
23
+ export declare function mergeMappingWithGuesses(sourceColumns: string[], headerNames: string[], mapping: FileImportMapping | null): FileImportMapping;
24
+ export declare function initHeaderNames(detail: FecImportDetail, hasHeader: boolean): string[];
25
+ export declare function replaceAt(values: string[], index: number, value: string): string[];
@@ -0,0 +1,33 @@
1
+ import type { FecImportDetail, FecImportSummary, FecImportStatus, FileImportMapping } from '@/src/api/fec-imports/types.ts';
2
+ import type { useFecImportCommitMutation, useFecImportDeleteMutation } from '@/src/api/fec-imports/fecImportMutations.ts';
3
+ export type AmountMappingMode = 'debit_credit' | 'signed_amount';
4
+ export type FecImportStatusItem = {
5
+ status: FecImportStatus;
6
+ };
7
+ export type FecImportStatusOption = {
8
+ value: FecImportStatus;
9
+ label: string;
10
+ };
11
+ export type MappingField = {
12
+ key: keyof FileImportMapping;
13
+ label: string;
14
+ };
15
+ export type FecImportMappingFormProps = {
16
+ detail: FecImportDetail;
17
+ };
18
+ export type FecImportRowsPreviewProps = {
19
+ importId: string;
20
+ };
21
+ export type RawRowsExampleProps = {
22
+ detail: FecImportDetail;
23
+ headerNames: string[];
24
+ mapping: FileImportMapping;
25
+ amountMode: AmountMappingMode;
26
+ };
27
+ export type FecImportActionsProps = {
28
+ row: FecImportSummary;
29
+ selected: boolean;
30
+ onSelect: () => void;
31
+ commit: ReturnType<typeof useFecImportCommitMutation>;
32
+ deleteImport: ReturnType<typeof useFecImportDeleteMutation>;
33
+ };
@@ -91,6 +91,7 @@ export interface ConnectorSingleResponse {
91
91
  name: string;
92
92
  requiresMicrosoftConsent: boolean;
93
93
  status: object;
94
+ supportsAccountDiscovery: boolean;
94
95
  }
95
96
  export interface ConnectorsListResponse {
96
97
  list: ConnectorItem[];
Binary file
@@ -7,4 +7,4 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},466:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>SingleConnector});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(8556);var single_connector_app=__webpack_require__(1094);var dist_index_js_=__webpack_require__(4259);var index_mjs_=__webpack_require__(2773);var esm_index_mjs_=__webpack_require__(4931);var modern_index_js_=__webpack_require__(7714);var dist_esm_index_mjs_=__webpack_require__(4449);var useAppConfigConnectorSingle=__webpack_require__(4613);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function ProvidersSingleConnector(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(useAppConfigConnectorSingle.a,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:tanstack?.queryClient??new modern_index_js_.QueryClient,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.Notifications,{}),/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.RevealTokenProvider,{children:children})]})})})}function SingleConnector(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ProvidersSingleConnector,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(single_connector_app.d,{})})})}},4613:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{C:()=>useAppConfigConnectorSingle,a:()=>AppConfigConnectorSingleProvider});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(8556);const AppConfigCtx=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);const AppConfigConnectorSingleProvider=AppConfigCtx.Provider;function useAppConfigConnectorSingle(){const config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigConnectorSingleProvider />`");return config}}}]);
10
+ */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},466:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>SingleConnector});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(8556);var single_connector_app=__webpack_require__(5322);var dist_index_js_=__webpack_require__(4259);var index_mjs_=__webpack_require__(2773);var esm_index_mjs_=__webpack_require__(4931);var modern_index_js_=__webpack_require__(7714);var dist_esm_index_mjs_=__webpack_require__(4449);var useAppConfigConnectorSingle=__webpack_require__(4613);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function ProvidersSingleConnector(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(useAppConfigConnectorSingle.a,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:tanstack?.queryClient??new modern_index_js_.QueryClient,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.Notifications,{}),/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.RevealTokenProvider,{children:children})]})})})}function SingleConnector(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ProvidersSingleConnector,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(single_connector_app.d,{})})})}},4613:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{C:()=>useAppConfigConnectorSingle,a:()=>AppConfigConnectorSingleProvider});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(8556);const AppConfigCtx=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);const AppConfigConnectorSingleProvider=AppConfigCtx.Provider;function useAppConfigConnectorSingle(){const config=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigConnectorSingleProvider />`");return config}}}]);