@galadrim/galadmin 0.1.139 → 0.1.140

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.
@@ -216,7 +216,7 @@ export type TablePanel = {
216
216
  canCreate?: boolean;
217
217
  canImport?: boolean;
218
218
  importFileTypes?: string[];
219
- parseImportFile?: (file: FormDataFile) => Promise<any[]>;
219
+ parseImportFile?: (file: FormDataFile, id?: number) => Promise<any[]>;
220
220
  createConfig?: CreateConfig;
221
221
  tableName?: string;
222
222
  primaryId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galadrim/galadmin",
3
- "version": "0.1.139",
3
+ "version": "0.1.140",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/src/api.ts CHANGED
@@ -465,7 +465,7 @@ export default (db, config, user) => {
465
465
  return res.status(500).send("\"createConfig\" doit être défini dans la configuration du panneau.");
466
466
  }
467
467
 
468
- const records = await panel.parseImportFile(files.data[0]);
468
+ const records = await panel.parseImportFile(files.data[0], fields.recordId[0]);
469
469
  const columns = [];
470
470
  if (records.length === 0) {
471
471
  return res.send({
@@ -251,8 +251,8 @@ export type TablePanel = {
251
251
  * @example [".xlsx", ".xls", ".csv"]
252
252
  */
253
253
  importFileTypes?: string[],
254
- /** Obligatoire si `canImport` est `true`. Prend le fichier d'import en paramètre et renvoie une liste d'entités. **Ne pas inclure l'identifiant de l'entité parente.** */
255
- parseImportFile?: (file: FormDataFile) => Promise<any[]>,
254
+ /** Obligatoire si `canImport` est `true`. Prend le fichier d'import en paramètre et renvoie une liste d'entités. id correspond a l'identité du parent */
255
+ parseImportFile?: (file: FormDataFile, id?: number) => Promise<any[]>,
256
256
  /** Obligatoire si `canImport` est `true`. */
257
257
  createConfig?: CreateConfig,
258
258
  tableName?: string,
@@ -1,12 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6
- esac
7
-
8
- if [ -x "$basedir/node" ]; then
9
- exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
10
- else
11
- exec node "$basedir/../semver/bin/semver.js" "$@"
12
- fi
@@ -1,17 +0,0 @@
1
- @ECHO off
2
- GOTO start
3
- :find_dp0
4
- SET dp0=%~dp0
5
- EXIT /b
6
- :start
7
- SETLOCAL
8
- CALL :find_dp0
9
-
10
- IF EXIST "%dp0%\node.exe" (
11
- SET "_prog=%dp0%\node.exe"
12
- ) ELSE (
13
- SET "_prog=node"
14
- SET PATHEXT=%PATHEXT:;.JS;=;%
15
- )
16
-
17
- endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %*
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env pwsh
2
- $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
-
4
- $exe=""
5
- if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6
- # Fix case when both the Windows and Linux builds of Node
7
- # are installed in the same directory
8
- $exe=".exe"
9
- }
10
- $ret=0
11
- if (Test-Path "$basedir/node$exe") {
12
- # Support pipeline input
13
- if ($MyInvocation.ExpectingInput) {
14
- $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
15
- } else {
16
- & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
17
- }
18
- $ret=$LASTEXITCODE
19
- } else {
20
- # Support pipeline input
21
- if ($MyInvocation.ExpectingInput) {
22
- $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args
23
- } else {
24
- & "node$exe" "$basedir/../semver/bin/semver.js" $args
25
- }
26
- $ret=$LASTEXITCODE
27
- }
28
- exit $ret