complexqa_frontend_core 1.0.6 → 1.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complexqa_frontend_core",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "core of web ",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,4 +1,5 @@
1
-
1
+ import { Api } from "./api";
2
+ import { serviceTranslate } from "./services/serviceTranslate";
2
3
 
3
4
  /**
4
5
  * Прототип идеи, пока не уверен, что именно так надо
@@ -40,7 +41,11 @@ export class App
40
41
  this.service.translate = new serviceTranslate();
41
42
  }
42
43
  }
43
-
44
+
45
+ import { clone_object, echo, is_array } from "../utils/utils";
46
+ import axios from "axios";
47
+ import * as qs from "query-string/base";
48
+ import { ApiException } from "../exceptions/ApiException";
44
49
 
45
50
  /**
46
51
  * Общие методы для всех типизированных элементов
@@ -462,7 +467,9 @@ export class ApiAbstractElementClass
462
467
 
463
468
  return response;
464
469
  }
465
- }
470
+ }
471
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
472
+ import { typeFunctional } from "../types/family_elements/typeFunctional";
466
473
 
467
474
 
468
475
  /**
@@ -478,7 +485,12 @@ export class FunctionalApi extends ApiAbstractElementClass
478
485
  super(options);
479
486
  this.set_element_class_instance(typeFunctional);
480
487
  }
481
- }
488
+ }
489
+ import { TestPlanApi } from "./test_plan_api";
490
+ import { ProjectApi } from "./project_api";
491
+ import { ServiceApi } from "./service_api";
492
+ import { TestCaseApi } from "./test_case_api";
493
+ import { TestSuiteApi } from "./test_suite_api";
482
494
 
483
495
  /**
484
496
  * Обертка над axios
@@ -585,8 +597,11 @@ export class Api
585
597
  this.project = new ProjectApi(payload);
586
598
  this.service = new ServiceApi(payload);
587
599
  this.test_case = new TestCaseApi(payload);
600
+ this.test_suite = new TestSuiteApi(payload);
588
601
  }
589
- }
602
+ }
603
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
604
+ import { typeProject } from "../types/family_elements/typeProject";
590
605
 
591
606
  /**
592
607
  *
@@ -601,7 +616,7 @@ export class ProjectApi extends ApiAbstractElementClass
601
616
  super(options);
602
617
  this.set_element_class_instance(typeProject);
603
618
  }
604
- }
619
+ }
605
620
 
606
621
  // тут нужен свой класс, не для типов
607
622
  export class ServiceApi
@@ -621,7 +636,9 @@ export class ServiceApi
621
636
  {
622
637
  return [];
623
638
  }
624
- }
639
+ }
640
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
641
+ import { typeTeamMember } from "../types/family_elements/typeTeamMember";
625
642
 
626
643
 
627
644
  /**
@@ -637,7 +654,9 @@ export class TeamMemberApi extends ApiAbstractElementClass
637
654
  super(options);
638
655
  this.set_element_class_instance(typeTeamMember);
639
656
  }
640
- }
657
+ }
658
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
659
+ import { typeTestCase } from "../types/family_elements/typeTestCase";
641
660
 
642
661
 
643
662
  /**
@@ -653,7 +672,9 @@ export class TestCaseApi extends ApiAbstractElementClass
653
672
  super(options);
654
673
  this.set_element_class_instance(typeTestCase);
655
674
  }
656
- }
675
+ }
676
+ import { typeTestCaseStep } from "../types/family_elements/typeTestCaseStep";
677
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
657
678
 
658
679
 
659
680
  /**
@@ -669,7 +690,9 @@ export class TestCaseStepApi extends ApiAbstractElementClass
669
690
  super(options);
670
691
  this.set_element_class_instance(typeTestCaseStep);
671
692
  }
672
- }
693
+ }
694
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
695
+ import { typeTestPlan } from "../types/family_elements/typeTestPlan";
673
696
 
674
697
 
675
698
  /**
@@ -685,7 +708,9 @@ export class TestPlanApi extends ApiAbstractElementClass
685
708
  super(options);
686
709
  this.set_element_class_instance(typeTestPlan);
687
710
  }
688
- }
711
+ }
712
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
713
+ import { typeTestRun } from "../types/family_elements/typeTestRun";
689
714
 
690
715
  export class TestRunApi extends ApiAbstractElementClass
691
716
  {
@@ -696,7 +721,9 @@ export class TestRunApi extends ApiAbstractElementClass
696
721
  super(options);
697
722
  this.set_element_class_instance(typeTestRun);
698
723
  }
699
- }
724
+ }
725
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
726
+ import { typeTestRunResult } from "../types/family_elements/typeTestRunResult";
700
727
 
701
728
 
702
729
  /**
@@ -712,7 +739,9 @@ export class TestRunResultApi extends ApiAbstractElementClass
712
739
  super(options);
713
740
  this.set_element_class_instance(typeTestRunResult);
714
741
  }
715
- }
742
+ }
743
+ import { ApiAbstractElementClass } from "./api_abstract_element_class";
744
+ import { typeTestSuite } from "../types/family_elements/typeTestSuite";
716
745
 
717
746
 
718
747
  /**
@@ -728,7 +757,7 @@ export class TestSuiteApi extends ApiAbstractElementClass
728
757
  super(options);
729
758
  this.set_element_class_instance(typeTestSuite);
730
759
  }
731
- }
760
+ }
732
761
  export class ApiException extends Error
733
762
  {
734
763
  /**
@@ -797,7 +826,7 @@ export class ApiException extends Error
797
826
  return this.#message;
798
827
  }
799
828
  }
800
- }
829
+ }
801
830
  /**
802
831
  *
803
832
  * @version v.0.1 (25/06/2024)
@@ -833,7 +862,10 @@ export class abstractService
833
862
  {
834
863
 
835
864
  }*/
836
- }
865
+ }
866
+ import { abstractService } from "./abstractService";
867
+ import i18next from 'i18next';
868
+ import { Api } from "../api";
837
869
 
838
870
  /**
839
871
  *
@@ -928,7 +960,9 @@ export class serviceTranslate extends abstractService
928
960
  {
929
961
  return this.#vendor_instance.t(group + '.' + key);
930
962
  }
931
- }
963
+ }
964
+ import { abstractService } from "./abstractService";
965
+ import { MockUserService } from "./mock_data/MockUserService";
932
966
 
933
967
  /**
934
968
  *
@@ -1056,7 +1090,7 @@ export class UserService extends abstractService
1056
1090
  UserService.current_language = current_language;
1057
1091
  }
1058
1092
  }
1059
-
1093
+
1060
1094
  /**
1061
1095
  *
1062
1096
  * @param {object} object
@@ -1246,7 +1280,7 @@ export function in_array(value, array, strict = false)
1246
1280
  export function cls()
1247
1281
  {
1248
1282
  console.clear();
1249
- }
1283
+ }
1250
1284
  export class MockUserService
1251
1285
  {
1252
1286
  static mock_attributes = [ {
@@ -1276,12 +1310,13 @@ export class MockUserService
1276
1310
  },
1277
1311
  ];
1278
1312
 
1279
- }
1313
+ }
1314
+ import { clone_object, echo, in_array, is_array } from "../../utils/utils";
1280
1315
 
1281
1316
  /**
1282
1317
  * Базовый абстрактный класс для всех типов
1283
1318
  *
1284
- * @version v.0.1 (26/05/2024)
1319
+ * @version v.0.2 (12/06/2025)
1285
1320
  */
1286
1321
  export class familyGeneralElement
1287
1322
  {
@@ -1289,6 +1324,7 @@ export class familyGeneralElement
1289
1324
  create_scheme = false;
1290
1325
  structure_scheme = false;
1291
1326
  available_enum_values = false;
1327
+ api_key = false;
1292
1328
 
1293
1329
 
1294
1330
  /***********************************************/
@@ -1502,31 +1538,157 @@ export class familyGeneralElement
1502
1538
  alert('Error #267-001 Not implemented method');
1503
1539
  }
1504
1540
 
1541
+
1505
1542
  /**
1506
1543
  *
1507
- * @version v.0.1 (26/05/2024)
1544
+ * @param {familyGeneralElement|object} payload
1545
+ *
1546
+ * @param {typeFunctionCallback|object|false} callback
1547
+ *
1548
+ * @param {?function} callback.before
1549
+ * @param {?function} callback.success
1550
+ * @param {?function} callback.error
1551
+ * @param {?function} callback.final
1552
+ *
1553
+ * @version v.2.0 (12/06/2025)
1508
1554
  */
1509
- async create()
1510
- {}
1555
+ async create(payload, callback)
1556
+ {
1557
+ if (!this.api_key)
1558
+ {
1559
+ throw new Error('element has not api_key');
1560
+ }
1561
+
1562
+ if (typeof callback?.before === 'function')
1563
+ {
1564
+ callback?.before({ payload });
1565
+ }
1566
+
1567
+ payload = this.normalize_payload(payload);
1568
+
1569
+
1570
+ /**
1571
+ * {Api} ApiService
1572
+ */
1573
+ return ApiService[this.api_key].create(payload).then((response) =>
1574
+ {
1575
+ if (typeof callback?.success === 'function')
1576
+ {
1577
+ callback?.success({ response, payload })
1578
+ }
1579
+ }).catch((error) =>
1580
+ {
1581
+ echo({ error });
1582
+ if (typeof callback?.error === 'function')
1583
+ {
1584
+ callback?.error({ error, payload })
1585
+ }
1586
+ }).finally((response) =>
1587
+ {
1588
+ if (typeof callback?.final === 'function')
1589
+ {
1590
+ callback?.final({ response, payload })
1591
+ }
1592
+ });
1593
+ }
1594
+
1511
1595
 
1512
1596
 
1513
1597
  /**
1514
1598
  *
1515
- * @version v.0.1 (26/05/2024)
1599
+ * @version v.2.0 (12/06/2025)
1516
1600
  */
1517
- async update()
1601
+ async update(payload, callback)
1518
1602
  {
1519
- alert('Error #272-001 Not implemented method');
1603
+ if (!this.api_key)
1604
+ {
1605
+ throw new Error('element has not api_key');
1606
+ }
1607
+
1608
+ if (typeof callback?.before === 'function')
1609
+ {
1610
+ callback?.before({ payload });
1611
+ }
1612
+
1613
+ payload = this.normalize_payload(payload);
1614
+
1615
+
1616
+ /**
1617
+ * {Api} ApiService
1618
+ */
1619
+ return ApiService[this.api_key].update(payload).then((response) =>
1620
+ {
1621
+ if (typeof callback?.success === 'function')
1622
+ {
1623
+ callback?.success({ response, payload })
1624
+ }
1625
+ }).catch((error) =>
1626
+ {
1627
+ echo({ error });
1628
+ if (typeof callback?.error === 'function')
1629
+ {
1630
+ callback?.error({ error, payload })
1631
+ }
1632
+ }).finally((response) =>
1633
+ {
1634
+ if (typeof callback?.final === 'function')
1635
+ {
1636
+ callback?.final({ response, payload })
1637
+ }
1638
+ });
1520
1639
  }
1521
1640
 
1522
1641
 
1642
+
1523
1643
  /**
1524
1644
  *
1525
- * @version v.0.1 (26/05/2024)
1645
+ * @version v.2.0 (12/06/2025)
1646
+ * @param key
1647
+ * @param value
1648
+ * @param callback
1649
+ * @returns {Promise<>}
1526
1650
  */
1527
1651
  async update_property(key, value, callback)
1528
1652
  {
1529
- alert('Error #272-001 Not implemented method');
1653
+ if (!this.api_key)
1654
+ {
1655
+ throw new Error('element has not api_key');
1656
+ }
1657
+
1658
+ let payload = {
1659
+ key : key,
1660
+ value : value,
1661
+ };
1662
+ payload[this.get_primary_key()] = this[this.get_primary_key()];
1663
+
1664
+ if (typeof callback?.before === 'function')
1665
+ {
1666
+ callback?.before({ payload });
1667
+ }
1668
+
1669
+ /**
1670
+ * {Api} ApiService
1671
+ */
1672
+ return ApiService[this.api_key].update_property(payload).then((response) =>
1673
+ {
1674
+ if (typeof callback?.success === 'function')
1675
+ {
1676
+ callback?.success({ response, payload })
1677
+ }
1678
+ }).catch((error) =>
1679
+ {
1680
+ echo({ error });
1681
+ if (typeof callback?.error === 'function')
1682
+ {
1683
+ callback?.error({ error, payload })
1684
+ }
1685
+ }).finally((response) =>
1686
+ {
1687
+ if (typeof callback?.final === 'function')
1688
+ {
1689
+ callback?.final({ response, payload })
1690
+ }
1691
+ });
1530
1692
  }
1531
1693
 
1532
1694
 
@@ -1540,19 +1702,54 @@ export class familyGeneralElement
1540
1702
  }
1541
1703
 
1542
1704
 
1705
+
1543
1706
  /**
1544
1707
  *
1545
- * @version v.0.1 (26/05/2024)
1546
- * @param element
1547
- * @param callback
1548
- * @returns {Promise<boolean>}
1708
+ * @version v.2.0 (12/06/2025)
1549
1709
  */
1550
- async delete(element, callback)
1710
+ async delete(element = false, callback = {})
1551
1711
  {
1552
- alert('Error #267-001 Not implemented method');
1553
- return false;
1712
+ if (!this.api_key)
1713
+ {
1714
+ throw new Error('element has not api_key');
1715
+ }
1716
+
1717
+ if (!element)
1718
+ {
1719
+ element = this;
1720
+ }
1721
+
1722
+ let payload = {};
1723
+
1724
+ payload[this.get_primary_key()] = element[this.get_primary_key()];
1725
+
1726
+ if (typeof callback?.before === 'function')
1727
+ {
1728
+ callback?.before({ payload });
1729
+ }
1730
+
1731
+ return ApiService[this.api_key].delete(payload).then((response) =>
1732
+ {
1733
+ if (typeof callback?.success === 'function')
1734
+ {
1735
+ callback?.success({ response, payload })
1736
+ }
1737
+ }).catch((error) =>
1738
+ {
1739
+ echo({ error });
1740
+ if (typeof callback?.error === 'function')
1741
+ {
1742
+ callback?.error({ error, payload })
1743
+ }
1744
+ }).finally((response) =>
1745
+ {
1746
+ if (typeof callback?.final === 'function')
1747
+ {
1748
+ callback?.final({ response, payload })
1749
+ }
1750
+ });
1554
1751
  }
1555
- }
1752
+ }
1556
1753
  /**
1557
1754
  * Заготовка - логи действий
1558
1755
  *
@@ -1561,7 +1758,9 @@ export class familyGeneralElement
1561
1758
  export class typeActionLog
1562
1759
  {
1563
1760
 
1564
- }
1761
+ }
1762
+ import { familyGeneralElement } from "./0_familyGeneralElement";
1763
+ import { is_object } from "../../utils/utils";
1565
1764
 
1566
1765
 
1567
1766
  /**
@@ -1655,7 +1854,9 @@ export class typeFunctional extends familyGeneralElement
1655
1854
  }
1656
1855
 
1657
1856
 
1658
- }
1857
+ }
1858
+ import { familyGeneralElement } from "./0_familyGeneralElement";
1859
+ import { is_object } from "../../utils/utils";
1659
1860
 
1660
1861
 
1661
1862
  /**
@@ -1748,7 +1949,9 @@ export class typeFunctionalGroup extends familyGeneralElement
1748
1949
  }
1749
1950
 
1750
1951
 
1751
- }
1952
+ }
1953
+ import { familyGeneralElement } from "./0_familyGeneralElement";
1954
+ import { is_object } from "../../utils/utils";
1752
1955
 
1753
1956
  /**
1754
1957
  *
@@ -1839,7 +2042,10 @@ export class typeMilestone extends familyGeneralElement
1839
2042
  }
1840
2043
 
1841
2044
 
1842
- }
2045
+ }
2046
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2047
+ import { echo, is_object } from "../../utils/utils";
2048
+ import { MockDataTypeProject } from "./mock_data/mock_data_typeProject";
1843
2049
 
1844
2050
 
1845
2051
  /**
@@ -1857,6 +2063,7 @@ export class typeProject extends familyGeneralElement
1857
2063
  // хосты/домены будут отдельно храниться, их может быть множество
1858
2064
 
1859
2065
  primary_key = 'project_id';
2066
+ api_key = 'project';
1860
2067
 
1861
2068
  structure_scheme = {
1862
2069
  project_id : 'integer | require',
@@ -1916,6 +2123,9 @@ export class typeProject extends familyGeneralElement
1916
2123
  }
1917
2124
 
1918
2125
 
2126
+ /******************************************************************************************/
2127
+ /******************************************************************************************/
2128
+
1919
2129
  /******************************************************************************************/
1920
2130
 
1921
2131
 
@@ -1930,94 +2140,25 @@ export class typeProject extends familyGeneralElement
1930
2140
  return this.project_name;
1931
2141
  }
1932
2142
 
2143
+
1933
2144
  /******************************************************************************************/
1934
- /*********************************** general **********************************************/
2145
+ /**************************** работа с участниками проекта ********************************/
1935
2146
  /******************************************************************************************/
1936
2147
 
1937
- /**
1938
- *
1939
- * @param {familyGeneralElement|object} payload
1940
- * @param {typeFunctionCallback|object|false} callback
1941
- *
1942
- * @param {?function} callback.before
1943
- * @param {?function} callback.success
1944
- * @param {?function} callback.error
1945
- * @param {?function} callback.final
1946
- *
1947
- * @version v.0.1 (26/01/2025)
1948
- */
1949
- async create(payload, callback)
1950
- {
1951
- if (typeof callback?.before === 'function')
1952
- {
1953
- callback?.before({ payload });
1954
- }
1955
-
1956
- payload = this.normalize_payload(payload);
2148
+ // member = user + role
1957
2149
 
2150
+ member_add() {}
1958
2151
 
1959
- /**
1960
- * {Api} ApiService
1961
- */
1962
- ApiService.project.create(payload).then((response) =>
1963
- {
1964
- if (typeof callback?.success === 'function')
1965
- {
1966
- callback?.success({ response, payload })
1967
- }
1968
- }).catch((error) =>
1969
- {
1970
- echo({ error });
1971
- if (typeof callback?.error === 'function')
1972
- {
1973
- callback?.error({ error, payload })
1974
- }
1975
- }).finally((response) =>
1976
- {
1977
- if (typeof callback?.final === 'function')
1978
- {
1979
- callback?.final({ response, payload })
1980
- }
1981
- });
1982
- }
2152
+ member_update() {}
1983
2153
 
2154
+ member_delete() {}
1984
2155
 
1985
- /**
1986
- *
1987
- * @version v.0.1 (07/07/2024)
1988
- */
1989
- async update()
1990
- {
2156
+ member_get() {}
1991
2157
 
1992
- }
1993
2158
 
1994
-
1995
- /**
1996
- *
1997
- * @version v.0.1 (07/07/2024)
1998
- */
1999
- async delete()
2000
- {
2001
-
2002
- }
2003
-
2004
-
2005
- /******************************************************************************************/
2006
- /**************************** работа с участниками проекта ********************************/
2007
- /******************************************************************************************/
2008
-
2009
- // member = user + role
2010
-
2011
- member_add() {}
2012
-
2013
- member_update() {}
2014
-
2015
- member_delete() {}
2016
-
2017
- member_get() {}
2018
-
2019
-
2020
- }
2159
+ }
2160
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2161
+ import { is_object } from "../../utils/utils";
2021
2162
 
2022
2163
  /**
2023
2164
  * (идея) - у проекта должна быть тестовая документация
@@ -2095,7 +2236,9 @@ export class typeProjectDocument extends familyGeneralElement
2095
2236
  {
2096
2237
 
2097
2238
  }
2098
- }
2239
+ }
2240
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2241
+ import { is_object } from "../../utils/utils";
2099
2242
 
2100
2243
  /**
2101
2244
  * Тестовые аккаунты
@@ -2152,7 +2295,9 @@ export class typeProjectTestAccount extends familyGeneralElement
2152
2295
 
2153
2296
  return this;
2154
2297
  }
2155
- }
2298
+ }
2299
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2300
+ import { is_object } from "../../utils/utils";
2156
2301
 
2157
2302
  /**
2158
2303
  * Тестовые данные
@@ -2193,7 +2338,9 @@ export class typeProjectTestData extends familyGeneralElement
2193
2338
 
2194
2339
  return this;
2195
2340
  }
2196
- }
2341
+ }
2342
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2343
+ import { is_object } from "../../utils/utils";
2197
2344
 
2198
2345
  /**
2199
2346
  * Роли в проекте
@@ -2246,7 +2393,9 @@ export class typeProjectUserRole extends familyGeneralElement
2246
2393
 
2247
2394
  return this;
2248
2395
  }
2249
- }
2396
+ }
2397
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2398
+ import { is_object } from "../../utils/utils";
2250
2399
 
2251
2400
 
2252
2401
  /**
@@ -2322,7 +2471,9 @@ export class typeTask extends familyGeneralElement
2322
2471
 
2323
2472
  return this;
2324
2473
  }
2325
- }
2474
+ }
2475
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2476
+ import { is_object } from "../../utils/utils";
2326
2477
 
2327
2478
 
2328
2479
  /**
@@ -2425,7 +2576,9 @@ export class typeTeam extends familyGeneralElement
2425
2576
  user_delete() {}
2426
2577
 
2427
2578
  users_get() {}
2428
- }
2579
+ }
2580
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2581
+ import { is_object } from "../../utils/utils";
2429
2582
 
2430
2583
 
2431
2584
  /**
@@ -2481,7 +2634,9 @@ export class typeTeamMember extends familyGeneralElement
2481
2634
 
2482
2635
  return this;
2483
2636
  }
2484
- }
2637
+ }
2638
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2639
+ import { is_object } from "../../utils/utils";
2485
2640
 
2486
2641
  /**
2487
2642
  * Роль пользователя в команде
@@ -2535,7 +2690,9 @@ export class typeTeamUserRole extends familyGeneralElement
2535
2690
 
2536
2691
  return this;
2537
2692
  }
2538
- }
2693
+ }
2694
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2695
+ import { echo, is_object } from "../../utils/utils";
2539
2696
 
2540
2697
 
2541
2698
  /**
@@ -2567,6 +2724,7 @@ export class typeTestCase extends familyGeneralElement
2567
2724
 
2568
2725
 
2569
2726
  primary_key = 'test_case_id';
2727
+ api_key = 'test_case';
2570
2728
 
2571
2729
  // @todo - довнести
2572
2730
  structure_scheme = {
@@ -2630,205 +2788,96 @@ export class typeTestCase extends familyGeneralElement
2630
2788
  }
2631
2789
 
2632
2790
 
2633
- /**
2634
- *
2635
- * @param {familyGeneralElement|object} payload
2636
- *
2637
- * @param {typeFunctionCallback|object|false} callback
2638
- *
2639
- * @param {?function} callback.before
2640
- * @param {?function} callback.success
2641
- * @param {?function} callback.error
2642
- * @param {?function} callback.final
2643
- *
2644
- * @version v.0.1 (17/05/2025)
2645
- */
2646
- async create(payload, callback)
2647
- {
2648
- if (typeof callback?.before === 'function')
2649
- {
2650
- callback?.before({ payload });
2651
- }
2791
+ }
2792
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2793
+ import { is_object } from "../../utils/utils";
2652
2794
 
2653
- payload = this.normalize_payload(payload);
2654
2795
 
2796
+ /**
2797
+ *
2798
+ * @version v.1.1 (26/05/2024)
2799
+ */
2800
+ export class typeTestCaseStep extends familyGeneralElement
2801
+ {
2802
+ test_case_step_id;
2803
+ test_case_step_type;
2804
+ team_id; // foreign key
2805
+ test_case_id; // relations
2806
+ sort_order;
2807
+ step_text;
2808
+ step_element;
2809
+ step_element_action;
2810
+ step_excepted_result;
2655
2811
 
2656
- /**
2657
- * {Api} ApiService
2658
- */
2659
- return ApiService.test_case.create(payload).then((response) =>
2660
- {
2661
- if (typeof callback?.success === 'function')
2662
- {
2663
- callback?.success({ response, payload })
2664
- }
2665
- }).catch((error) =>
2666
- {
2667
- echo({ error });
2668
- if (typeof callback?.error === 'function')
2669
- {
2670
- callback?.error({ error, payload })
2671
- }
2672
- }).finally((response) =>
2673
- {
2674
- if (typeof callback?.final === 'function')
2675
- {
2676
- callback?.final({ response, payload })
2677
- }
2678
- });
2679
- }
2812
+ primary_key = 'test_case_step_id';
2813
+ api_key = 'test_case_step';
2680
2814
 
2815
+ structure_scheme = {
2816
+ test_case_step_id : 'integer | require',
2817
+ test_case_step_type : 'string | enum | optional',
2818
+ team_id : 'integer | require',
2819
+ test_case_id : 'integer | require',
2820
+ sort_order : 'integer | optional',
2821
+ step_text : 'string | optional',
2822
+ step_element : 'string | optional',
2823
+ step_element_action : 'string | optional',
2824
+ step_excepted_result: 'string | optional',
2825
+ };
2681
2826
 
2682
- /**
2683
- *
2684
- * @version v.0.1 (07/07/2024)
2685
- */
2686
- async update(payload, callback)
2687
- {
2688
- if (typeof callback?.before === 'function')
2689
- {
2690
- callback?.before({ payload });
2691
- }
2692
2827
 
2693
- payload = this.normalize_payload(payload);
2828
+ available_enum_values = {
2829
+ test_case_step_type: [ 'TEST_CASE_STEP', 'TEST_CASE_PRESTEP' ],
2830
+ };
2694
2831
 
2695
2832
 
2696
- /**
2697
- * {Api} ApiService
2698
- */
2699
- return ApiService.test_case.update(payload).then((response) =>
2700
- {
2701
- if (typeof callback?.success === 'function')
2702
- {
2703
- callback?.success({ response, payload })
2704
- }
2705
- }).catch((error) =>
2706
- {
2707
- echo({ error });
2708
- if (typeof callback?.error === 'function')
2709
- {
2710
- callback?.error({ error, payload })
2711
- }
2712
- }).finally((response) =>
2713
- {
2714
- if (typeof callback?.final === 'function')
2715
- {
2716
- callback?.final({ response, payload })
2717
- }
2718
- });
2719
- }
2833
+ /******************************************************************************************/
2834
+ /******************************************************************************************/
2835
+ /******************************************************************************************/
2720
2836
 
2721
2837
 
2722
2838
  /**
2723
2839
  *
2724
- * @param key
2725
- * @param value
2726
- * @param callback
2727
- * @returns {Promise<>}
2840
+ * @param {object|false|undefined} data
2728
2841
  */
2729
- async update_property(key, value, callback)
2842
+ constructor(data = false)
2730
2843
  {
2731
- let payload = {
2732
- key : key,
2733
- value : value,
2734
- test_case_id: this.test_case_id
2735
- };
2736
-
2737
- if (typeof callback?.before === 'function')
2738
- {
2739
- callback?.before({ payload });
2740
- }
2844
+ super();
2741
2845
 
2742
- /**
2743
- * {Api} ApiService
2744
- */
2745
- return ApiService.test_case.update_property(payload).then((response) =>
2746
- {
2747
- if (typeof callback?.success === 'function')
2748
- {
2749
- callback?.success({ response, payload })
2750
- }
2751
- }).catch((error) =>
2752
- {
2753
- echo({ error });
2754
- if (typeof callback?.error === 'function')
2755
- {
2756
- callback?.error({ error, payload })
2757
- }
2758
- }).finally((response) =>
2846
+ if (data && is_object(data))
2759
2847
  {
2760
- if (typeof callback?.final === 'function')
2848
+ _.mapObject(data, (value, key) =>
2761
2849
  {
2762
- callback?.final({ response, payload })
2763
- }
2764
- });
2765
- }
2766
-
2767
-
2768
- /**
2769
- *
2770
- * @version v.0.1 (17/05/2025)
2771
- */
2772
- async delete(element = false, callback = {})
2773
- {
2774
- if (!element)
2775
- {
2776
- element = this;
2777
- }
2778
-
2779
- let payload = {
2780
- test_case_id: element.test_case_id
2781
- };
2782
-
2783
- if (typeof callback?.before === 'function')
2784
- {
2785
- callback?.before({ payload });
2850
+ if (this.hasOwnProperty(key))
2851
+ {
2852
+ this [ key ] = value;
2853
+ }
2854
+ });
2786
2855
  }
2787
2856
 
2788
- return ApiService.test_case.delete(payload).then((response) =>
2789
- {
2790
- if (typeof callback?.success === 'function')
2791
- {
2792
- callback?.success({ response, payload })
2793
- }
2794
- }).catch((error) =>
2795
- {
2796
- echo({ error });
2797
- if (typeof callback?.error === 'function')
2798
- {
2799
- callback?.error({ error, payload })
2800
- }
2801
- }).finally((response) =>
2802
- {
2803
- if (typeof callback?.final === 'function')
2804
- {
2805
- callback?.final({ response, payload })
2806
- }
2807
- });
2857
+ return this;
2808
2858
  }
2809
2859
 
2810
2860
 
2811
- }
2812
2861
 
2862
+ /******************************************************************************************/
2863
+ /******************************************************************************************/
2864
+ /******************************************************************************************/
2813
2865
 
2814
- /**
2815
- *
2816
- * @version v.0.1 (26/05/2024)
2817
- */
2818
- export class typeTestCaseStep extends familyGeneralElement
2819
- {
2820
- test_case_step_id;
2821
- test_case_step_type;
2822
- team_id; // foreign key
2823
- test_case_id; // relations
2824
- step_text;
2825
2866
 
2826
- primary_key = 'test_case_step_id';
2827
2867
 
2828
- available_enum_values = {
2829
- test_case_step_type: [ 'TEST_CASE_STEP', 'TEST_CASE_PRESTEP' ],
2830
- };
2831
- }
2868
+ /**
2869
+ *
2870
+ * @version v.0.1 (05/06/2025)
2871
+ *
2872
+ * @returns {string}
2873
+ */
2874
+ get_element_name()
2875
+ {
2876
+ return this.test_suite_name;
2877
+ }
2878
+ }
2879
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2880
+ import { is_object } from "../../utils/utils";
2832
2881
 
2833
2882
 
2834
2883
  /**
@@ -2861,7 +2910,9 @@ export class typeTestPlan extends familyGeneralElement
2861
2910
 
2862
2911
  return this;
2863
2912
  }
2864
- }
2913
+ }
2914
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2915
+ import { is_object } from "../../utils/utils";
2865
2916
 
2866
2917
  /**
2867
2918
  * Коллекция тестов для работы, она же parent для typeTestRunResult
@@ -2915,7 +2966,9 @@ export class typeTestRun extends familyGeneralElement
2915
2966
 
2916
2967
  return this;
2917
2968
  }
2918
- }
2969
+ }
2970
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2971
+ import { is_object } from "../../utils/utils";
2919
2972
 
2920
2973
  /**
2921
2974
  * 1 результат по каждому тест кейсу
@@ -2985,31 +3038,38 @@ export class typeTestRunResult extends familyGeneralElement
2985
3038
 
2986
3039
  return this;
2987
3040
  }
2988
- }
3041
+ }
3042
+ import { familyGeneralElement } from "./0_familyGeneralElement";
3043
+ import { echo, is_object } from "../../utils/utils";
2989
3044
 
2990
3045
  /**
2991
3046
  * Структурная коллекция тестов
2992
3047
  *
2993
- * @version v.0.1 (23/06/2024)
3048
+ * @version v.1.1 (23/06/2024)
2994
3049
  */
2995
3050
  export class typeTestSuite extends familyGeneralElement
2996
3051
  {
2997
3052
  test_suite_id;
2998
3053
  project_id;
2999
- functional_id;
3054
+ //functional_id; // пока убрал, думаю, что можно без этого всё сделать
3000
3055
  test_suite_name;
3001
3056
  test_suite_description;
3002
3057
  team_id;
3058
+ created_at;
3059
+ updated_at;
3003
3060
 
3004
3061
  primary_key = 'test_suite_id';
3062
+ api_key = 'test_suite';
3005
3063
 
3006
3064
  structure_scheme = {
3007
- test_suite_id : 'integer | require',
3008
- project_id : 'integer | require',
3009
- functional_id : 'integer | optional',
3065
+ test_suite_id: 'integer | require',
3066
+ project_id : 'integer | require',
3067
+ //functional_id : 'integer | optional',
3010
3068
  test_suite_name : 'string | protected | require',
3011
3069
  test_suite_description: 'string | require',
3012
3070
  team_id : 'integer | require',
3071
+ created_at : 'timestamp | require',
3072
+ updated_at : 'timestamp | optional',
3013
3073
  };
3014
3074
 
3015
3075
 
@@ -3037,39 +3097,25 @@ export class typeTestSuite extends familyGeneralElement
3037
3097
 
3038
3098
 
3039
3099
  /******************************************************************************************/
3040
- /*********************************** general **********************************************/
3041
-
3042
3100
  /******************************************************************************************/
3043
3101
 
3044
- /**
3045
- *
3046
- * @version v.0.1 (07/07/2024)
3047
- */
3048
- async create()
3049
- {}
3102
+ /******************************************************************************************/
3050
3103
 
3051
3104
 
3052
3105
  /**
3053
3106
  *
3054
- * @version v.0.1 (07/07/2024)
3055
- */
3056
- async update()
3057
- {
3058
-
3059
- }
3060
-
3061
-
3062
- /**
3107
+ * @version v.0.1 (05/06/2025)
3063
3108
  *
3064
- * @version v.0.1 (07/07/2024)
3109
+ * @returns {string}
3065
3110
  */
3066
- async delete()
3111
+ get_element_name()
3067
3112
  {
3068
-
3113
+ return this.test_suite_name;
3069
3114
  }
3070
3115
 
3071
-
3072
- }
3116
+ }
3117
+ import { familyGeneralElement } from "./0_familyGeneralElement";
3118
+ import { is_object } from "../../utils/utils";
3073
3119
 
3074
3120
 
3075
3121
  /**
@@ -3123,7 +3169,7 @@ export class typeUser extends familyGeneralElement
3123
3169
 
3124
3170
  return this;
3125
3171
  }
3126
- }
3172
+ }
3127
3173
  /**
3128
3174
  * базовый тип для всех служебных типов
3129
3175
  * @version v.0.1 (26/05/2024)
@@ -3131,7 +3177,8 @@ export class typeUser extends familyGeneralElement
3131
3177
  export class familyService
3132
3178
  {
3133
3179
  //
3134
- }
3180
+ }
3181
+ import { familyService } from "./familyService";
3135
3182
 
3136
3183
  /**
3137
3184
  * Общее конфигурирование приложений
@@ -3169,7 +3216,8 @@ export class typeAppConfiguration extends familyService
3169
3216
 
3170
3217
  return this;
3171
3218
  }
3172
- }
3219
+ }
3220
+ import { familyService } from "./familyService";
3173
3221
 
3174
3222
  /**
3175
3223
  *
@@ -3206,7 +3254,8 @@ export class typeFilter extends familyService
3206
3254
 
3207
3255
  return this;
3208
3256
  }
3209
- }
3257
+ }
3258
+ import { familyService } from "./familyService";
3210
3259
 
3211
3260
  /**
3212
3261
  *
@@ -3215,7 +3264,7 @@ export class typeFilter extends familyService
3215
3264
  export class typeFOR extends familyService
3216
3265
  {
3217
3266
  filters;
3218
- object;
3267
+ options;
3219
3268
  response;
3220
3269
 
3221
3270
  /**
@@ -3241,7 +3290,8 @@ export class typeFOR extends familyService
3241
3290
 
3242
3291
  return this;
3243
3292
  }
3244
- }
3293
+ }
3294
+ import { familyService } from "./familyService";
3245
3295
 
3246
3296
  /**
3247
3297
  * Описание стандартного колбека типового для методов
@@ -3280,7 +3330,9 @@ export class typeFunctionCallback extends familyService
3280
3330
 
3281
3331
  return this;
3282
3332
  }
3283
- }
3333
+ }
3334
+ import { familyService } from "./familyService";
3335
+ import { is_object } from "../../utils/utils";
3284
3336
 
3285
3337
  /**
3286
3338
  * Уведомления
@@ -3314,7 +3366,8 @@ export class typeNotification extends familyService
3314
3366
 
3315
3367
  return this;
3316
3368
  }
3317
- }
3369
+ }
3370
+ import { familyService } from "./familyService";
3318
3371
 
3319
3372
  /**
3320
3373
  *
@@ -3350,7 +3403,8 @@ export class typeTableColumn extends familyService
3350
3403
 
3351
3404
  return this;
3352
3405
  }
3353
- }
3406
+ }
3407
+ import { typeAppConfiguration } from "./typeAppConfiguration";
3354
3408
 
3355
3409
  /**
3356
3410
  * Настройки таблиц (aggrid)
@@ -3405,7 +3459,7 @@ export class typeTableConfiguration extends typeAppConfiguration
3405
3459
 
3406
3460
  return this;
3407
3461
  }
3408
- }
3462
+ }
3409
3463
  /**
3410
3464
  *
3411
3465
  * @version v.0.1 (02/07/2024)
@@ -3418,7 +3472,9 @@ export class abstractMockData
3418
3472
  {
3419
3473
  this.mock_data_type = mock_data_type;
3420
3474
  }
3421
- }
3475
+ }
3476
+ import { abstractMockData } from "./abstract_mock_data";
3477
+ import { count, is_object } from "../../../utils/utils";
3422
3478
 
3423
3479
 
3424
3480
  /**