meta-enc 1.4.0 → 1.4.1
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/LICENSE +21 -21
- package/README.md +18 -18
- package/install/{casilleros.tab → example-casilleros.tab-ejemplo} +26 -26
- package/install/prepare.sql +59 -59
- package/package.json +4 -4
- package/dist/client/meta-enc.d.ts +0 -1
- package/dist/client/meta-enc.d.ts.map +0 -1
- package/dist/client/meta-enc.js +0 -443
- package/dist/client/meta-enc.ts +0 -334
- package/dist/server/app-meta-enc.d.ts +0 -1113
- package/dist/server/app-meta-enc.d.ts.map +0 -1
- package/dist/server/app-meta-enc.js +0 -111
- package/dist/server/app-meta-enc.ts +0 -96
- package/dist/server/def-config.d.ts +0 -1
- package/dist/server/def-config.d.ts.map +0 -1
- package/dist/server/def-config.js +0 -75
- package/dist/server/def-config.ts +0 -59
- package/dist/server/procedures-meta-enc.d.ts +0 -15
- package/dist/server/procedures-meta-enc.d.ts.map +0 -1
- package/dist/server/procedures-meta-enc.js +0 -449
- package/dist/server/procedures-meta-enc.ts +0 -398
- package/dist/server/server-meta-enc.d.ts +0 -1
- package/dist/server/server-meta-enc.d.ts.map +0 -1
- package/dist/server/server-meta-enc.js +0 -17
- package/dist/server/server-meta-enc.ts +0 -7
- package/dist/server/table-casilleros.d.ts +0 -0
- package/dist/server/table-casilleros.d.ts.map +0 -1
- package/dist/server/table-casilleros.js +0 -96
- package/dist/server/table-casilleros.ts +0 -88
- package/dist/server/table-casilleros_principales.d.ts +0 -1
- package/dist/server/table-casilleros_principales.d.ts.map +0 -1
- package/dist/server/table-casilleros_principales.js +0 -9
- package/dist/server/table-casilleros_principales.ts +0 -10
- package/dist/server/table-formularios_json.d.ts +0 -0
- package/dist/server/table-formularios_json.d.ts.map +0 -1
- package/dist/server/table-formularios_json.js +0 -15
- package/dist/server/table-formularios_json.ts +0 -15
- package/dist/server/table-tipoc.d.ts +0 -0
- package/dist/server/table-tipoc.d.ts.map +0 -1
- package/dist/server/table-tipoc.js +0 -25
- package/dist/server/table-tipoc.ts +0 -25
- package/dist/server/table-tipoc_tipoc.d.ts +0 -0
- package/dist/server/table-tipoc_tipoc.d.ts.map +0 -1
- package/dist/server/table-tipoc_tipoc.js +0 -20
- package/dist/server/table-tipoc_tipoc.ts +0 -20
- package/dist/server/table-unidad_analisis.d.ts +0 -0
- package/dist/server/table-unidad_analisis.d.ts.map +0 -1
- package/dist/server/table-unidad_analisis.js +0 -31
- package/dist/server/table-unidad_analisis.ts +0 -29
- package/dist/server/types-meta-enc.d.ts +0 -1
- package/dist/server/types-meta-enc.d.ts.map +0 -1
- package/dist/server/types-meta-enc.js +0 -24
- package/dist/server/types-meta-enc.ts +0 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 Codenautas
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Codenautas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
# meta-enc
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
language: 
|
|
6
|
-
also available in:
|
|
7
|
-
[](LEEME.md)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
see spanish
|
|
11
|
-
|
|
12
|
-
## License
|
|
13
|
-
|
|
14
|
-
[MIT](LICENSE)
|
|
15
|
-
|
|
16
|
-
----------------
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
|
|
2
|
+
# meta-enc
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
language: 
|
|
6
|
+
also available in:
|
|
7
|
+
[](LEEME.md)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
see spanish
|
|
11
|
+
|
|
12
|
+
## License
|
|
13
|
+
|
|
14
|
+
[MIT](LICENSE)
|
|
15
|
+
|
|
16
|
+
----------------
|
|
17
|
+
|
|
18
|
+
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
operativo|id_casillero|padre|tipoc|casillero|orden|nombre|tipovar|longitud|tipoe|aclaracion|salto|unidad_analisis|cantidad_resumen|irrepetible|despliegue|ver_id|optativo|formulario_principal|var_name|var_name_especial
|
|
2
|
-
EJEMPLO|F:F1||F|F1|10|||||||vivienda||||||true||
|
|
3
|
-
EJEMPLO|DV|F:F1|B|DV|5|Datos vivienda||||||||true||||||
|
|
4
|
-
EJEMPLO|V33|DV|P|V33|||numero|||||||true|||||n4dk|n4dk
|
|
5
|
-
EJEMPLO|V1|DV|P|V1|10|pregunta 1 vivienda|texto|medio||||||true|||||v1|
|
|
6
|
-
EJEMPLO|V2|DV|P|V2|20|pregunta 2 vivienda|numero|2||||||true|||||v2|
|
|
7
|
-
EJEMPLO|F2|F:F1|BF|F2|10|Hogares||||||hogares|4|true||||||
|
|
8
|
-
EJEMPLO|F:F2||F|F2|20|||||||hogares||||||||
|
|
9
|
-
EJEMPLO|DH|F:F2|B|DH|10|Datos hogar||||||||true||||||
|
|
10
|
-
EJEMPLO|h1|DH|P|h1|1|Pregunta 1 del hogar|opciones|||||||true|||||h1|
|
|
11
|
-
EJEMPLO|h1/1|h1|O|1|1|opción 1 h||||||||||||||
|
|
12
|
-
EJEMPLO|h1/2|h1|O|2|2|opción 2 h||||||||||||||
|
|
13
|
-
EJEMPLO|h1/3|h1|O|3|3|opción 3 h||||||||||||||
|
|
14
|
-
EJEMPLO|h2|DH|P|h2|2|Pregunta 2 del hogar|texto|||||||true|||||h2|
|
|
15
|
-
EJEMPLO|h3|DH|P|h3|3|Pregunta 3 del hogar|||O-M|||||true||||||
|
|
16
|
-
EJEMPLO|h3/omh31|h3|OM|omh31|1|opción multiple 1|si_no||||||||||||h3_omh31|
|
|
17
|
-
EJEMPLO|h3/omh31/1|h3/omh31|O|1|1|Sí||||||||||||||
|
|
18
|
-
EJEMPLO|h3/omh31/2|h3/omh31|O|2|2|No||||||||||||||
|
|
19
|
-
EJEMPLO|h3/omh32|h3|OM|omh32|2|opcion multiple 2|si_no||||||||||||h3_omh32|
|
|
20
|
-
EJEMPLO|h3/omh32/1|h3/omh32|O|1|1|Sí||||||||||||||
|
|
21
|
-
EJEMPLO|h3/omh32/2|h3/omh32|O|2|2|No||||||||||||||
|
|
22
|
-
EJEMPLO|F3|F:F2|BF|F3|20|Personas||||||personas||true||||||
|
|
23
|
-
EJEMPLO|F:F3||F|F3|30|||||||personas||||||||
|
|
24
|
-
EJEMPLO|DP|F:F3|B|DP|5|Datos persona||||||||true||||||
|
|
25
|
-
EJEMPLO|P1|F:F3|P|P1|10|nombre|texto|||||||true|||||p1|
|
|
26
|
-
EJEMPLO|P2|F:F3|P|P2|20|edad|numero|||||||true|||||p2|
|
|
1
|
+
operativo|id_casillero|padre|tipoc|casillero|orden|nombre|tipovar|longitud|tipoe|aclaracion|salto|unidad_analisis|cantidad_resumen|irrepetible|despliegue|ver_id|optativo|formulario_principal|var_name|var_name_especial
|
|
2
|
+
EJEMPLO|F:F1||F|F1|10|||||||vivienda||||||true||
|
|
3
|
+
EJEMPLO|DV|F:F1|B|DV|5|Datos vivienda||||||||true||||||
|
|
4
|
+
EJEMPLO|V33|DV|P|V33|||numero|||||||true|||||n4dk|n4dk
|
|
5
|
+
EJEMPLO|V1|DV|P|V1|10|pregunta 1 vivienda|texto|medio||||||true|||||v1|
|
|
6
|
+
EJEMPLO|V2|DV|P|V2|20|pregunta 2 vivienda|numero|2||||||true|||||v2|
|
|
7
|
+
EJEMPLO|F2|F:F1|BF|F2|10|Hogares||||||hogares|4|true||||||
|
|
8
|
+
EJEMPLO|F:F2||F|F2|20|||||||hogares||||||||
|
|
9
|
+
EJEMPLO|DH|F:F2|B|DH|10|Datos hogar||||||||true||||||
|
|
10
|
+
EJEMPLO|h1|DH|P|h1|1|Pregunta 1 del hogar|opciones|||||||true|||||h1|
|
|
11
|
+
EJEMPLO|h1/1|h1|O|1|1|opción 1 h||||||||||||||
|
|
12
|
+
EJEMPLO|h1/2|h1|O|2|2|opción 2 h||||||||||||||
|
|
13
|
+
EJEMPLO|h1/3|h1|O|3|3|opción 3 h||||||||||||||
|
|
14
|
+
EJEMPLO|h2|DH|P|h2|2|Pregunta 2 del hogar|texto|||||||true|||||h2|
|
|
15
|
+
EJEMPLO|h3|DH|P|h3|3|Pregunta 3 del hogar|||O-M|||||true||||||
|
|
16
|
+
EJEMPLO|h3/omh31|h3|OM|omh31|1|opción multiple 1|si_no||||||||||||h3_omh31|
|
|
17
|
+
EJEMPLO|h3/omh31/1|h3/omh31|O|1|1|Sí||||||||||||||
|
|
18
|
+
EJEMPLO|h3/omh31/2|h3/omh31|O|2|2|No||||||||||||||
|
|
19
|
+
EJEMPLO|h3/omh32|h3|OM|omh32|2|opcion multiple 2|si_no||||||||||||h3_omh32|
|
|
20
|
+
EJEMPLO|h3/omh32/1|h3/omh32|O|1|1|Sí||||||||||||||
|
|
21
|
+
EJEMPLO|h3/omh32/2|h3/omh32|O|2|2|No||||||||||||||
|
|
22
|
+
EJEMPLO|F3|F:F2|BF|F3|20|Personas||||||personas||true||||||
|
|
23
|
+
EJEMPLO|F:F3||F|F3|30|||||||personas||||||||
|
|
24
|
+
EJEMPLO|DP|F:F3|B|DP|5|Datos persona||||||||true||||||
|
|
25
|
+
EJEMPLO|P1|F:F3|P|P1|10|nombre|texto|||||||true|||||p1|
|
|
26
|
+
EJEMPLO|P2|F:F3|P|P2|20|edad|numero|||||||true|||||p2|
|
package/install/prepare.sql
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
-- pg-parents
|
|
2
|
-
|
|
3
|
-
create or replace function with_parent_id_trg() returns trigger
|
|
4
|
-
language plpgsql as
|
|
5
|
-
$body$
|
|
6
|
-
declare
|
|
7
|
-
v_separador_id text:='/';
|
|
8
|
-
begin
|
|
9
|
-
if new.casillero ~ (E'\\'||v_separador_id) then
|
|
10
|
-
raise 'código de casillero no debe tener "%"', v_separador_id;
|
|
11
|
-
end if;
|
|
12
|
-
new.id_casillero:=coalesce(new.id_padre||v_separador_id,'')||new.casillero;
|
|
13
|
-
return new;
|
|
14
|
-
end;
|
|
15
|
-
$body$;
|
|
16
|
-
|
|
17
|
-
create or replace function irrepetible_trg() returns trigger
|
|
18
|
-
language plpgsql as
|
|
19
|
-
$body$
|
|
20
|
-
declare
|
|
21
|
-
v_separador_id text:='/';
|
|
22
|
-
v_separador_tipoc text:=':';
|
|
23
|
-
v_var_name_comun text;
|
|
24
|
-
v_irrepetible boolean;
|
|
25
|
-
v_puede_ser_var boolean;
|
|
26
|
-
begin
|
|
27
|
-
if tg_op = 'INSERT'
|
|
28
|
-
or new.id_casillero is distinct from old.id_casillero
|
|
29
|
-
or new.casillero is distinct from old.casillero
|
|
30
|
-
or new.padre is distinct from old.padre
|
|
31
|
-
or new.tipoc is distinct from old.tipoc
|
|
32
|
-
or new.tipovar is distinct from old.tipovar
|
|
33
|
-
or new.var_name_especial is distinct from old.var_name_especial
|
|
34
|
-
then
|
|
35
|
-
if new.casillero ~ (E'\\'||v_separador_id) then
|
|
36
|
-
raise 'código de casillero no debe tener "%"', v_separador_id;
|
|
37
|
-
end if;
|
|
38
|
-
select irrepetible, puede_ser_var
|
|
39
|
-
into v_irrepetible, v_puede_ser_var
|
|
40
|
-
from tipoc
|
|
41
|
-
where tipoc = new.tipoc;
|
|
42
|
-
if v_puede_ser_var is true and new.tipovar is null then
|
|
43
|
-
raise 'tiene que tener tipo de variable % de % en %',new.id_casillero,new.padre,new.operativo;
|
|
44
|
-
elsif v_puede_ser_var is false and new.tipovar is not null then
|
|
45
|
-
raise 'no puede tener tipo de variable % de % en %',new.id_casillero,new.padre,new.operativo;
|
|
46
|
-
end if;
|
|
47
|
-
new.irrepetible := (select irrepetible from tipoc where tipoc = new.tipoc);
|
|
48
|
-
new.id_casillero := case when new.irrepetible then new.casillero else coalesce(new.padre||v_separador_id,new.tipoc||v_separador_tipoc)||new.casillero end;
|
|
49
|
-
if new.tipovar is null then
|
|
50
|
-
new.var_name := null;
|
|
51
|
-
v_var_name_comun := null;
|
|
52
|
-
else
|
|
53
|
-
v_var_name_comun := regexp_replace(regexp_replace(replace(translate(lower(new.id_casillero),'áéíóúàèìòùÁÉÍÓÚÀÈÌÒÙÜü','aeiouaeiouaeiouuu'),'ñ','nni'),'[^0-9a-z]','_'),'^([0-9])',
|
|
54
|
-
regexp_replace(lower(new.operativo),'[^a-z]','','g')||'\1');
|
|
55
|
-
new.var_name := coalesce(new.var_name_especial, v_var_name_comun);
|
|
56
|
-
end if;
|
|
57
|
-
end if;
|
|
58
|
-
return new;
|
|
59
|
-
end;
|
|
1
|
+
-- pg-parents
|
|
2
|
+
|
|
3
|
+
create or replace function with_parent_id_trg() returns trigger
|
|
4
|
+
language plpgsql as
|
|
5
|
+
$body$
|
|
6
|
+
declare
|
|
7
|
+
v_separador_id text:='/';
|
|
8
|
+
begin
|
|
9
|
+
if new.casillero ~ (E'\\'||v_separador_id) then
|
|
10
|
+
raise 'código de casillero no debe tener "%"', v_separador_id;
|
|
11
|
+
end if;
|
|
12
|
+
new.id_casillero:=coalesce(new.id_padre||v_separador_id,'')||new.casillero;
|
|
13
|
+
return new;
|
|
14
|
+
end;
|
|
15
|
+
$body$;
|
|
16
|
+
|
|
17
|
+
create or replace function irrepetible_trg() returns trigger
|
|
18
|
+
language plpgsql as
|
|
19
|
+
$body$
|
|
20
|
+
declare
|
|
21
|
+
v_separador_id text:='/';
|
|
22
|
+
v_separador_tipoc text:=':';
|
|
23
|
+
v_var_name_comun text;
|
|
24
|
+
v_irrepetible boolean;
|
|
25
|
+
v_puede_ser_var boolean;
|
|
26
|
+
begin
|
|
27
|
+
if tg_op = 'INSERT'
|
|
28
|
+
or new.id_casillero is distinct from old.id_casillero
|
|
29
|
+
or new.casillero is distinct from old.casillero
|
|
30
|
+
or new.padre is distinct from old.padre
|
|
31
|
+
or new.tipoc is distinct from old.tipoc
|
|
32
|
+
or new.tipovar is distinct from old.tipovar
|
|
33
|
+
or new.var_name_especial is distinct from old.var_name_especial
|
|
34
|
+
then
|
|
35
|
+
if new.casillero ~ (E'\\'||v_separador_id) then
|
|
36
|
+
raise 'código de casillero no debe tener "%"', v_separador_id;
|
|
37
|
+
end if;
|
|
38
|
+
select irrepetible, puede_ser_var
|
|
39
|
+
into v_irrepetible, v_puede_ser_var
|
|
40
|
+
from tipoc
|
|
41
|
+
where tipoc = new.tipoc;
|
|
42
|
+
if v_puede_ser_var is true and new.tipovar is null then
|
|
43
|
+
raise 'tiene que tener tipo de variable % de % en %',new.id_casillero,new.padre,new.operativo;
|
|
44
|
+
elsif v_puede_ser_var is false and new.tipovar is not null then
|
|
45
|
+
raise 'no puede tener tipo de variable % de % en %',new.id_casillero,new.padre,new.operativo;
|
|
46
|
+
end if;
|
|
47
|
+
new.irrepetible := (select irrepetible from tipoc where tipoc = new.tipoc);
|
|
48
|
+
new.id_casillero := case when new.irrepetible then new.casillero else coalesce(new.padre||v_separador_id,new.tipoc||v_separador_tipoc)||new.casillero end;
|
|
49
|
+
if new.tipovar is null then
|
|
50
|
+
new.var_name := null;
|
|
51
|
+
v_var_name_comun := null;
|
|
52
|
+
else
|
|
53
|
+
v_var_name_comun := regexp_replace(regexp_replace(replace(translate(lower(new.id_casillero),'áéíóúàèìòùÁÉÍÓÚÀÈÌÒÙÜü','aeiouaeiouaeiouuu'),'ñ','nni'),'[^0-9a-z]','_'),'^([0-9])',
|
|
54
|
+
regexp_replace(lower(new.operativo),'[^a-z]','','g')||'\1');
|
|
55
|
+
new.var_name := coalesce(new.var_name_especial, v_var_name_comun);
|
|
56
|
+
end if;
|
|
57
|
+
end if;
|
|
58
|
+
return new;
|
|
59
|
+
end;
|
|
60
60
|
$body$;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meta-enc",
|
|
3
3
|
"description": "Metadatos de encuestas",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.1",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/meta-enc",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"unlogged"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"rel-enc": "^1.3.
|
|
16
|
+
"rel-enc": "^1.3.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"types.d.ts": "~0.6.
|
|
20
|
-
"mixin-patch": "~0.
|
|
19
|
+
"types.d.ts": "~0.6.4",
|
|
20
|
+
"mixin-patch": "~0.4.0"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">= 10.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta-enc.d.ts","sourceRoot":"","sources":["../../src/client/meta-enc.ts"],"names":[],"mappings":""}
|