pict-section-recordset 1.0.0 → 1.0.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.
Files changed (98) hide show
  1. package/.vscode/launch.json +46 -0
  2. package/debug/Harness.js +0 -7
  3. package/example_applications/list_view/index.html +125 -0
  4. package/example_applications/simple_entity/Simple-RecordSet-Application.js +32 -26
  5. package/example_applications/simple_entity/html/index.html +3 -3
  6. package/package.json +9 -6
  7. package/source/Pict-Section-RecordSet.js +6 -2
  8. package/source/application/Pict-Application-RecordSet.js +11 -0
  9. package/source/providers/RecordSet-RecordProvider-Base.js +217 -0
  10. package/source/providers/RecordSet-RecordProvider-MeadowEndpoints.js +339 -0
  11. package/source/services/RecordsSet-MetaController.js +196 -0
  12. package/source/views/RecordSet-Filter.js +91 -0
  13. package/source/views/RecordsSet-MacroView.js +0 -0
  14. package/source/views/dashboard/RecordSet-Dashboard-HeaderDashboard.js +63 -0
  15. package/source/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.js +63 -0
  16. package/source/views/dashboard/RecordSet-Dashboard-TabBarDashboard.js +63 -0
  17. package/source/views/dashboard/RecordSet-Dashboard.js +63 -0
  18. package/source/views/edit/RecordSet-Edit-HeaderEdit.js +63 -0
  19. package/source/views/edit/RecordSet-Edit-RecordEdit.js +63 -0
  20. package/source/views/edit/RecordSet-Edit-RecordEditControls.js +63 -0
  21. package/source/views/edit/RecordSet-Edit-RecordEditExtra.js +63 -0
  22. package/source/views/edit/RecordSet-Edit-TabBarEdit.js +63 -0
  23. package/source/views/edit/RecordSet-Edit.js +63 -0
  24. package/source/views/list/RecordSet-List-HeaderList.js +63 -0
  25. package/source/views/list/RecordSet-List-PaginationBottom.js +67 -0
  26. package/source/views/list/RecordSet-List-PaginationTop.js +115 -0
  27. package/source/views/list/RecordSet-List-RecordList.js +79 -0
  28. package/source/views/list/RecordSet-List-RecordListEntry.js +92 -0
  29. package/source/views/list/RecordSet-List-RecordListHeader.js +87 -0
  30. package/source/views/list/RecordSet-List-Title.js +67 -0
  31. package/source/views/list/RecordSet-List.js +167 -0
  32. package/source/views/read/RecordSet-Read-HeaderRead.js +63 -0
  33. package/source/views/read/RecordSet-Read-RecordRead.js +63 -0
  34. package/source/views/read/RecordSet-Read-RecordReadExtra.js +63 -0
  35. package/source/views/read/RecordSet-Read-TabBarRead.js +63 -0
  36. package/source/views/read/RecordSet-Read.js +63 -0
  37. package/test/PictSectionRecordSet-Basic_tests.js +1 -1
  38. package/test/PictSectionRecordSet-RecordProvider-Meadow_tests.js +203 -0
  39. package/tsconfig.build.json +16 -0
  40. package/tsconfig.json +1 -1
  41. package/types/Pict-Section-RecordSet.d.ts +5 -1
  42. package/types/application/Pict-Application-RecordSet.d.ts.map +1 -1
  43. package/types/providers/RecordSet-RecordProvider-Base.d.ts +207 -0
  44. package/types/providers/RecordSet-RecordProvider-Base.d.ts.map +1 -1
  45. package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts +100 -0
  46. package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts.map +1 -0
  47. package/types/services/RecordsSet-MetaController.d.ts +30 -0
  48. package/types/services/RecordsSet-MetaController.d.ts.map +1 -0
  49. package/types/views/RecordSet-Filter.d.ts +34 -0
  50. package/types/views/RecordSet-Filter.d.ts.map +1 -0
  51. package/types/views/RecordsSet-MacroView.d.ts +1 -0
  52. package/types/views/RecordsSet-MacroView.d.ts.map +1 -0
  53. package/types/views/dashboard/RecordSet-Dashboard-HeaderDashboard.d.ts +34 -0
  54. package/types/views/dashboard/RecordSet-Dashboard-HeaderDashboard.d.ts.map +1 -0
  55. package/types/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.d.ts +34 -0
  56. package/types/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.d.ts.map +1 -0
  57. package/types/views/dashboard/RecordSet-Dashboard-TabBarDashboard.d.ts +34 -0
  58. package/types/views/dashboard/RecordSet-Dashboard-TabBarDashboard.d.ts.map +1 -0
  59. package/types/views/dashboard/RecordSet-Dashboard.d.ts +34 -0
  60. package/types/views/dashboard/RecordSet-Dashboard.d.ts.map +1 -0
  61. package/types/views/edit/RecordSet-Edit-HeaderEdit.d.ts +34 -0
  62. package/types/views/edit/RecordSet-Edit-HeaderEdit.d.ts.map +1 -0
  63. package/types/views/edit/RecordSet-Edit-RecordEdit.d.ts +34 -0
  64. package/types/views/edit/RecordSet-Edit-RecordEdit.d.ts.map +1 -0
  65. package/types/views/edit/RecordSet-Edit-RecordEditControls.d.ts +34 -0
  66. package/types/views/edit/RecordSet-Edit-RecordEditControls.d.ts.map +1 -0
  67. package/types/views/edit/RecordSet-Edit-RecordEditExtra.d.ts +34 -0
  68. package/types/views/edit/RecordSet-Edit-RecordEditExtra.d.ts.map +1 -0
  69. package/types/views/edit/RecordSet-Edit-TabBarEdit.d.ts +34 -0
  70. package/types/views/edit/RecordSet-Edit-TabBarEdit.d.ts.map +1 -0
  71. package/types/views/edit/RecordSet-Edit.d.ts +34 -0
  72. package/types/views/edit/RecordSet-Edit.d.ts.map +1 -0
  73. package/types/views/list/RecordSet-List-HeaderList.d.ts +34 -0
  74. package/types/views/list/RecordSet-List-HeaderList.d.ts.map +1 -0
  75. package/types/views/list/RecordSet-List-PaginationBottom.d.ts +34 -0
  76. package/types/views/list/RecordSet-List-PaginationBottom.d.ts.map +1 -0
  77. package/types/views/list/RecordSet-List-PaginationTop.d.ts +34 -0
  78. package/types/views/list/RecordSet-List-PaginationTop.d.ts.map +1 -0
  79. package/types/views/list/RecordSet-List-RecordList.d.ts +34 -0
  80. package/types/views/list/RecordSet-List-RecordList.d.ts.map +1 -0
  81. package/types/views/list/RecordSet-List-RecordListEntry.d.ts +34 -0
  82. package/types/views/list/RecordSet-List-RecordListEntry.d.ts.map +1 -0
  83. package/types/views/list/RecordSet-List-RecordListHeader.d.ts +34 -0
  84. package/types/views/list/RecordSet-List-RecordListHeader.d.ts.map +1 -0
  85. package/types/views/list/RecordSet-List-Title.d.ts +34 -0
  86. package/types/views/list/RecordSet-List-Title.d.ts.map +1 -0
  87. package/types/views/list/RecordSet-List.d.ts +43 -0
  88. package/types/views/list/RecordSet-List.d.ts.map +1 -0
  89. package/types/views/read/RecordSet-Read-HeaderRead.d.ts +34 -0
  90. package/types/views/read/RecordSet-Read-HeaderRead.d.ts.map +1 -0
  91. package/types/views/read/RecordSet-Read-RecordRead.d.ts +34 -0
  92. package/types/views/read/RecordSet-Read-RecordRead.d.ts.map +1 -0
  93. package/types/views/read/RecordSet-Read-RecordReadExtra.d.ts +34 -0
  94. package/types/views/read/RecordSet-Read-RecordReadExtra.d.ts.map +1 -0
  95. package/types/views/read/RecordSet-Read-TabBarRead.d.ts +34 -0
  96. package/types/views/read/RecordSet-Read-TabBarRead.d.ts.map +1 -0
  97. package/types/views/read/RecordSet-Read.d.ts +34 -0
  98. package/types/views/read/RecordSet-Read.d.ts.map +1 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Launch Debug Harness",
9
+ "type": "pwa-node",
10
+ "request": "launch",
11
+ "outputCapture": "std",
12
+ "skipFiles": [
13
+ "<node_internals>/**"
14
+ ],
15
+ "program": "${workspaceFolder}/debug/Harness.js",
16
+ "presentation": {
17
+ "hidden": false,
18
+ "group": "",
19
+ "order": 1
20
+ }
21
+ },
22
+ {
23
+ "name": "Mocha Tests",
24
+ "args": [
25
+ "-u",
26
+ "tdd",
27
+ "--timeout",
28
+ "999999",
29
+ "--colors",
30
+ "${workspaceFolder}/test"
31
+ ],
32
+ "internalConsoleOptions": "openOnSessionStart",
33
+ "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
34
+ "request": "launch",
35
+ "skipFiles": [
36
+ "<node_internals>/**"
37
+ ],
38
+ "type": "pwa-node",
39
+ "presentation": {
40
+ "hidden": false,
41
+ "group": "",
42
+ "order": 2
43
+ }
44
+ }
45
+ ]
46
+ }
package/debug/Harness.js CHANGED
@@ -1,7 +0,0 @@
1
- const libParseCSV = require('../utility/csvparser/ParseCSV-Program.js');
2
-
3
- // This command takes the `TabularManifestCSV.csv` file and imports it into a JSON file
4
- //libParseCSV.run(['node', 'Harness.js', 'import']);
5
- // This command takes the `data/MathExampleForm.json` file and injects any sidecare files in the `input_data` folder into the JSON file
6
- //libParseCSV.run(['node', 'Harness.js', 'inject']);
7
- libParseCSV.run(['node', 'Harness.js', 'intersect']);
@@ -0,0 +1,125 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Example Pict-Section-Form List View </title>
7
+ </head>
8
+ <body>
9
+ <!-- START Header template -->
10
+ <header id="RSP-Header-Container">
11
+ <!-- START Header-Title template -->
12
+ <h1>Title of Entity</h1>
13
+ <!-- END Header-Title template -->
14
+ <!-- START Header-Subtitle template -->
15
+ <h2>Subtitle of Entity</h2>
16
+ <!-- END Header-Subtitle template -->
17
+ </header>
18
+ <!-- END Header template -->
19
+
20
+ <!-- START Filter template-->
21
+ <section id="RSP-Filter-Container">
22
+ <form id="RSP-Filter-Form">
23
+ <!-- START Filter-Input-Container template -->
24
+ <fieldset>
25
+ <!-- START Filter-Input-Label template -->
26
+ <label for="filter">Filter:</label>
27
+ <!-- END Filter-Input-Label template -->
28
+ <!-- START Filter-Input template -->
29
+ <input type="text" id="filter" name="filter">
30
+ <!-- END Filter-Input template -->
31
+ </fieldset>
32
+ <!-- END Filter-Input-Container template -->
33
+ <!-- START Filter-Button-Container template -->
34
+ <fieldset id="RSP-Filter-Button-Container">
35
+ <!-- START Filter-Button-Reset template -->
36
+ <button type="button" id="RSP-Filter-Button-Reset">Reset</button>
37
+ <!-- END Filter-Button-Reset template -->
38
+
39
+ <!-- START Filter-Button-Apply template -->
40
+ <button type="submit" id="RSP-Filter-Button-Apply">Apply</button>
41
+ <!-- END Filter-Button-Apply template -->
42
+ </fieldset>
43
+ <!-- END Filter-Button-Container template -->
44
+ </form>
45
+ </section>
46
+ <!-- END Filter template-->
47
+
48
+ <!-- START Upper Pagination template -->
49
+ <nav id="RSP-Upper-Pagination-Container">
50
+ <!-- START Upper Pagination-Description template -->
51
+ <p>Showing 1-25 of 100</p>
52
+ <!-- END Upper Pagination-Description template -->
53
+ <!-- START Upper Pagination-Button-Container template -->
54
+ <ul>
55
+ <!-- START Upper Pagination Button Previous template -->
56
+ <li><a href="#">&laquo; Previous</a></li>
57
+ <!-- END Upper Pagination Button Previous template -->
58
+ <!-- START Upper Pagination Button Page template -->
59
+ <li><a href="#">1</a></li>
60
+ <!-- END Upper Pagination Button Page template -->
61
+ <!-- NOTE: more as needed (for examples)-->
62
+ <li><a href="#">2</a></li>
63
+ <li><a href="#">3</a></li>
64
+ <li><a href="#">4</a></li>
65
+ <!-- START Upper Pagination Button Next template -->
66
+ <li><a href="#">Next &raquo;</a></li>
67
+ <!-- END Upper Pagination Button Next template -->
68
+ <!-- START Upper Pagination Button Page template -->
69
+ </ul>
70
+ <!-- END Upper Pagination Button Page template -->
71
+ </nav>
72
+ <!-- END Upper Pagination template -->
73
+
74
+ <!-- START List template -->
75
+ <section id="RSP-List-Container">
76
+ <!-- START List-Table template -->
77
+ <table id="RSP-List-Table">
78
+ <!-- START List-Table-Header template -->
79
+ <thead>
80
+ <tr>
81
+ <!-- START List-Table-Header-Cell -->
82
+ <th>Column 1</th>
83
+ <!-- END List-Table-Header-Cell -->
84
+ <!-- NOTE: more cells as needed -->
85
+ <th>Column 2</th>
86
+ <th>Column 3</th>
87
+ </tr>
88
+ </thead>
89
+ <!-- END List-Table-Header template -->
90
+ <!-- START List-Table-Body template -->
91
+ <tbody>
92
+ <!-- START List-Table-Body-Row -->
93
+ <tr>
94
+ <!-- START List-Table-Body-Cell -->
95
+ <td>Row 1, Cell 1</td>
96
+ <!-- END List-Table-Body-Cell -->
97
+ <!-- NOTE: more cells as needed -->
98
+ <td>Row 1, Cell 2</td>
99
+ <td>Row 1, Cell 3</td>
100
+ <!-- START List-Table-Body-Extra-Cell -->
101
+ <td><!-- NOTE: slot for extra columns--></td>
102
+ <!-- END List-Table-Body-Extra-Cell -->
103
+ </tr>
104
+ <!-- END List-Table-Body-Row -->
105
+ <!-- Note: more rows as needed -->
106
+ </tbody>
107
+ <!-- END List-Table-Body template -->
108
+ </table>
109
+ <!-- END List-Table template -->
110
+ </section>
111
+ <!-- END List template -->
112
+
113
+ <!-- START Lower Pagination template -->
114
+ <nav id="RSP-Lower-Pagination-Container">
115
+ <!-- NOTE: Re-apply "RSP-Upper-Pagination-Container" content here to avoid duplication. -->
116
+ </nav>
117
+ <!-- END Lower Pagination template -->
118
+
119
+ <!-- Footer template -->
120
+ <footer id="RSP-Footer-Container">
121
+ <!-- NOTE: slot for additional set actions -->
122
+ </footer>
123
+ <!-- END Footer template -->
124
+ </body>
125
+ </html>
@@ -4,30 +4,36 @@ const libPictRecordSet = require('../../source/Pict-Section-RecordSet.js');
4
4
  module.exports = libPictRecordSet.PictRecordSetApplication;
5
5
 
6
6
  module.exports.default_configuration.pict_configuration = (
7
- {
8
- "Product": "Simple Record Set",
9
- "DefaultRecordSetConfigurations":
10
- [
11
- {
12
- "RecordSet": "Book",
13
-
14
- "RecordSetType": "MeadowEndpoint", // Could be "Custom" which would require a provider to already be created for the record set.
15
- "RecordSetMeadowEntity": "Book", // This leverages the /Schema endpoint to get the record set columns.
16
-
17
- "RecordSetURLPrefix": "http://datadebase.com:8086/1.0/"
18
- },
19
- {
20
- "RecordSet": "Author",
21
-
22
- "RecordSetType": "MeadowEndpoint",
23
- "RecordSetMeadowEntity": "Author",
24
-
25
- "RecordSetURLPrefix": "http://datadebase.com:8086/1.0/"
26
- },
27
- {
28
- "RecordSet": "RandomizedValues",
29
-
30
- "RecordSetType": "Custom" // This means the `PS-RSP-RandomizedValues` provider will be checked for to get records.
31
- }
32
- ]
7
+ {
8
+ "Product": "Simple Record Set",
9
+
10
+ "PictApplicationConfiguration":
11
+ {
12
+ "AutoRenderMainViewportViewAfterInitialize": false
13
+ },
14
+
15
+ "DefaultRecordSetConfigurations":
16
+ [
17
+ {
18
+ "RecordSet": "Book",
19
+
20
+ "RecordSetType": "MeadowEndpoint", // Could be "Custom" which would require a provider to already be created for the record set.
21
+ "RecordSetMeadowEntity": "Book", // This leverages the /Schema endpoint to get the record set columns.
22
+
23
+ "RecordSetURLPrefix": "http://www.datadebase.com:8086/1.0/"
24
+ },
25
+ {
26
+ "RecordSet": "Author",
27
+
28
+ "RecordSetType": "MeadowEndpoint",
29
+ "RecordSetMeadowEntity": "Author",
30
+
31
+ "RecordSetURLPrefix": "http://www.datadebase.com:8086/1.0/"
32
+ },
33
+ {
34
+ "RecordSet": "RandomizedValues",
35
+
36
+ "RecordSetType": "Custom" // This means the `PS-RSP-RandomizedValues` provider will be checked for to get records.
37
+ }
38
+ ]
33
39
  });
@@ -3,11 +3,11 @@
3
3
  <head>
4
4
  <title>Simple.</title>
5
5
  <style id="PICT-CSS"></style>
6
- <script src="./pict.min.js" type="text/javascript"></script>
6
+ <script src="./pict.js" type="text/javascript"></script>
7
7
  <script type="text/javascript">Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(SimpleApplication, 1)});</script>
8
8
  </head>
9
9
  <body>
10
- <div id="Pict-Form-Container"></div>
11
- <script src="./simple_application.min.js" type="text/javascript"></script>
10
+ <div id="PRSP_List_Container"></div>
11
+ <script src="./simple_application.js" type="text/javascript"></script>
12
12
  </body>
13
13
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-recordset",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Pict dynamic record set management views",
5
5
  "main": "source/Pict-Section-RecordSet.js",
6
6
  "directories": {
@@ -21,27 +21,30 @@
21
21
  "build": "npx quack build",
22
22
  "test": "npx mocha -u tdd -R spec",
23
23
  "lint": "eslint source/**",
24
- "types": "tsc -p ."
24
+ "types": "tsc -p tsconfig.build.json"
25
25
  },
26
26
  "types": "types/source/Pict-Section-RecordSet.d.ts",
27
27
  "author": "steven velozo <steven@velozo.com>",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
30
  "@eslint/js": "^9.21.0",
31
+ "@types/mocha": "^10.0.10",
32
+ "@types/node": "^16.18.126",
31
33
  "browser-env": "^3.3.0",
32
34
  "eslint": "^9.21.0",
33
35
  "jquery": "^3.7.1",
34
- "pict": "^1.0.237",
35
- "pict-application": "^1.0.24",
36
+ "pict": "^1.0.239",
37
+ "pict-application": "^1.0.25",
36
38
  "pict-service-commandlineutility": "^1.0.15",
37
- "quackage": "^1.0.40",
39
+ "quackage": "^1.0.41",
38
40
  "typescript": "^5.7.3"
39
41
  },
40
42
  "dependencies": {
41
43
  "fable-serviceproviderbase": "^3.0.15",
42
44
  "pict-provider": "^1.0.3",
45
+ "pict-router": "^1.0.3",
43
46
  "pict-template": "^1.0.10",
44
- "pict-view": "^1.0.59"
47
+ "pict-view": "^1.0.60"
45
48
  },
46
49
  "mocha": {
47
50
  "diff": true,
@@ -1,8 +1,12 @@
1
1
  // The container for all the Pict-Section-Form related code.
2
2
 
3
3
  // The main dynamic view class
4
- module.exports = require('./Pict-Section-RecordSet.js');
4
+ module.exports = require('./services/RecordsSet-MetaController.js');
5
5
  //module.exports.default_configuration = require('./views/Pict-View-DynamicForm-DefaultConfiguration.json');
6
6
 
7
7
  // The application container
8
- module.exports.PictRecordSetApplication = require('./application/Pict-Application-RecordSet.js');
8
+ module.exports.PictRecordSetApplication = require('./application/Pict-Application-RecordSet.js');
9
+
10
+ // Export the providers
11
+ module.exports.RecordSetProviderBase = require('./providers/RecordSet-RecordProvider-Base.js');
12
+ module.exports.RecordSetProviderMeadowEndpoints = require('./providers/RecordSet-RecordProvider-MeadowEndpoints.js');
@@ -21,6 +21,17 @@ class PictSectionFormApplication extends libPictApplication
21
21
  // Add the pict recordset meta controller service
22
22
  this.pict.addServiceType('PictSectionRecordSet', libPictSectionRecordSet);
23
23
  }
24
+
25
+ onInitialize()
26
+ {
27
+ // Add the PictSectionRecordSet service
28
+ this.pict.instantiateServiceProvider('PictSectionRecordSet', this.options);
29
+ // Initialize the views for the foundation metacontroller service
30
+ this.pict.PictSectionRecordSet.initialize();
31
+
32
+ // Initialize the parent class
33
+ return super.onInitialize();
34
+ }
24
35
  };
25
36
 
26
37
  module.exports = PictSectionFormApplication
@@ -0,0 +1,217 @@
1
+
2
+ const libPictProvider = require('pict-provider');
3
+
4
+ /**
5
+ * Default configuration for the RecordSetProvider provider.
6
+ * @type {Record<string, any>}
7
+ */
8
+ const _DefaultProviderConfiguration = {
9
+ ProviderIdentifier: 'Pict-RecordSetProvider',
10
+ AutoInitialize: true,
11
+ AutoInitializeOrdinal: 0,
12
+ AutoSolveWithApp: false,
13
+ };
14
+
15
+ /**
16
+ * @typedef {Object} RecordSetSearchRangeFacet
17
+ * @property {string} Field - The field to facet on. Only indexed fields can be faceted.
18
+ * @property {any} Start - The start of the range. (ex. 1900)
19
+ * @property {any} End - The end of the range. (ex. 2025)
20
+ * @property {any} Gap - The gap between range values. (ex. 25)
21
+ * TODO: Support auto-generating ranges based on the data at rest?
22
+ */
23
+
24
+ /**
25
+ * @typedef {Object} RecordSetSearchFacetPayload
26
+ * @property {boolean} [ReturnRecords] - If false, search will return facets only, not records.
27
+ * @property {Array<string>} Fields - Requests to facet on all unique values of the given fields.
28
+ * @property {Array<RecordSetSearchRangeFacet>} Ranges - Requests to facet on given ranges of field values.
29
+ * TODO: support facet on custom query?
30
+ */
31
+
32
+ /**
33
+ * @typedef {Object} RecordSetResult
34
+ * @property {Array<Record<string, any>>} Records - The records returned from the provider.
35
+ * @property {Record<string, Record<string, number>> & { ByRange?: Record<string, number> }} Facets - The facets returned from the provider.
36
+ */
37
+
38
+ /**
39
+ * @typedef {Object} RecordSetFilter
40
+ * @property {string} [Entity] - The entity name. Can be used as an override to achieve LiteExtended, etc.
41
+ * @property {string} [FilterString] - A meadow endpoint style filter to apply.
42
+ * @property {number} [Offset] - The starting record number for pagination.
43
+ * @property {number} [PageSize] - The starting record number for pagination.
44
+ * @property {RecordSetSearchFacetPayload} [Facets] - The faceting config for the search.
45
+ */
46
+
47
+ /**
48
+ * Base record set provider.
49
+ * @extends libPictProvider
50
+ */
51
+ class RecordSetProviderBase extends libPictProvider
52
+ {
53
+ /**
54
+ * Creates an instance of RecordSetProvider.
55
+ * @param {import('fable')} pFable - The Fable object.
56
+ * @param {Record<string, any>} [pOptions] - Custom options for the provider.
57
+ * @param {string} [pServiceHash] - The service hash.
58
+ */
59
+ constructor(pFable, pOptions, pServiceHash)
60
+ {
61
+ const tmpOptions = Object.assign({}, JSON.parse(JSON.stringify(_DefaultProviderConfiguration)), pOptions);
62
+
63
+ super(pFable, tmpOptions, pServiceHash);
64
+
65
+ /** @type {Record<string, any>} */
66
+ this.options;
67
+ /** @type {import('fable')} */
68
+ this.fable;
69
+ /** @type {import('pict')} */
70
+ this.pict;
71
+ }
72
+
73
+ /**
74
+ * Get a record by its ID or GUID.
75
+ *
76
+ * @param {string|number} pIDOrGuid - The ID or GUID of the record.
77
+ */
78
+ async getRecord(pIDOrGuid)
79
+ {
80
+ this.pict.log.info(`RecordSetProviderBase.getRecord(${pIDOrGuid})`);
81
+ return { };
82
+ }
83
+
84
+ /**
85
+ * Get a record by its ID or GUID.
86
+ *
87
+ * @param {string|number} pGuid - The ID or GUID of the record.
88
+ */
89
+ async getRecordByGUID(pGuid)
90
+ {
91
+ this.pict.log.info(`RecordSetProviderBase.getRecordByGUID(${pGuid})`);
92
+ return { };
93
+ }
94
+
95
+ /**
96
+ * Read records from the provider.
97
+ *
98
+ * @param {RecordSetFilter} pOptions - Options for the read operation.
99
+ * @return {Promise<RecordSetResult>} - The result of the read operation.
100
+ */
101
+ async getRecords(pOptions)
102
+ {
103
+ this.pict.log.info(`RecordSetProviderBase.getRecords(${JSON.stringify(pOptions)})`);
104
+ return { Records: [], Facets: { } };
105
+ }
106
+
107
+ /**
108
+ * Read records from the provider.
109
+ *
110
+ * @param {string} [pFilterString] - The filter string to apply.
111
+ * @param {number} [pOffset] - The starting record number for pagination.
112
+ * @param {number} [pPageSize] - The number of records to return.
113
+ * @return {Promise<RecordSetResult>} - The result of the read operation.
114
+ */
115
+ async getRecordsInline(pFilterString = '', pOffset = 0, pPageSize = 250)
116
+ {
117
+ this.pict.log.info(`RecordSetProviderBase.getRecordsInline(${pFilterString}, ${pOffset}, ${pPageSize})`);
118
+ return { Records: [], Facets: { } };
119
+ }
120
+
121
+ /**
122
+ * Read records from the provider.
123
+ *
124
+ * @param {RecordSetFilter} pOptions - Options for the read operation.
125
+ */
126
+ async getRecordSetCount(pOptions)
127
+ {
128
+ this.pict.log.info(`RecordSetProviderBase.getRecordSetCount(${JSON.stringify(pOptions)})`);
129
+ return { Count: 0 };
130
+ }
131
+
132
+ /**
133
+ * Create a new record.
134
+ *
135
+ * @param {Record<string, any>} pRecord - The record to create.
136
+ */
137
+ async createRecord(pRecord)
138
+ {
139
+ this.pict.log.info(`RecordSetProviderBase.createRecord(${JSON.stringify(pRecord)})`);
140
+ return pRecord;
141
+ }
142
+
143
+ /**
144
+ * Update a record.
145
+ *
146
+ * @param {Record<string, any>} pRecord - The record to update.
147
+ */
148
+ async updateRecord(pRecord)
149
+ {
150
+ this.pict.log.info(`RecordSetProviderBase.updateRecord(${JSON.stringify(pRecord)})`);
151
+ return pRecord;
152
+ }
153
+
154
+ /**
155
+ * Delete a record.
156
+ *
157
+ * @param {Record<string, any>} pRecord - The record to delete.
158
+ */
159
+ async deleteRecord(pRecord)
160
+ {
161
+ this.pict.log.info(`RecordSetProviderBase.deleteRecord(${JSON.stringify(pRecord)})`);
162
+ }
163
+
164
+ /**
165
+ * Read a record.
166
+ *
167
+ * @param {string|number} pIDOrGuid - The ID or GUID of the record.
168
+ */
169
+ async readRecord(pIDOrGuid)
170
+ {
171
+ this.pict.log.info(`RecordSetProviderBase.readRecord(${pIDOrGuid})`);
172
+ return { };
173
+ }
174
+
175
+ /**
176
+ * Read records from the provider.
177
+ *
178
+ * @param {RecordSetFilter} pOptions - Options for the read operation.
179
+ * @return {Promise<RecordSetResult>} - The result of the read operation.
180
+ */
181
+ async readRecords(pOptions)
182
+ {
183
+ this.pict.log.info(`RecordSetProviderBase.readRecords(${JSON.stringify(pOptions)})`);
184
+ return { Records: [], Facets: { } };
185
+ }
186
+
187
+ /**
188
+ * Clone a record.
189
+ *
190
+ * @param {Record<string, any>} pRecord - The record to clone.
191
+ */
192
+ async cloneRecord(pRecord)
193
+ {
194
+ return this.createRecord(this.cleanRecord(pRecord));
195
+ }
196
+
197
+ /**
198
+ * Remove any intrinsic identifiers from a record.
199
+ *
200
+ * @param {Record<string, any>} pRecord - The record to clean.
201
+ */
202
+ cleanRecord(pRecord)
203
+ {
204
+ return pRecord;
205
+ }
206
+
207
+ /**
208
+ * @return {Record<string, any>} The schema of the record.
209
+ */
210
+ get recordSchema()
211
+ {
212
+ return { };
213
+ }
214
+ }
215
+
216
+ module.exports = RecordSetProviderBase;
217
+ module.exports.default_configuration = _DefaultProviderConfiguration;