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,63 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_Read_RecordRead = (
4
+ {
5
+ ViewIdentifier: 'PRSP-Read-RecordRead',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_RecordRead',
8
+ DefaultDestinationAddress: '#PRSP_RecordRead_Container',
9
+ DefaultTemplateRecordAddress: false,
10
+
11
+ // If this is set to true, when the App initializes this will.
12
+ // While the App initializes, initialize will be called.
13
+ AutoInitialize: false,
14
+ AutoInitializeOrdinal: 0,
15
+
16
+ // If this is set to true, when the App autorenders (on load) this will.
17
+ // After the App initializes, render will be called.
18
+ AutoRender: false,
19
+ AutoRenderOrdinal: 0,
20
+
21
+ AutoSolveWithApp: false,
22
+ AutoSolveOrdinal: 0,
23
+
24
+ CSS: false,
25
+ CSSPriority: 500,
26
+
27
+ Templates:
28
+ [
29
+ {
30
+ Hash: 'PRSP-Read-RecordRead-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-Read-RecordRead-Template] -->
33
+ <!-- DefaultPackage end view template: [PRSP-Read-RecordRead-Template] -->
34
+ `
35
+ }
36
+ ],
37
+
38
+ Renderables:
39
+ [
40
+ {
41
+ RenderableHash: 'PRSP_Renderable_RecordRead',
42
+ TemplateHash: 'PRSP-Read-RecordRead-Template',
43
+ DestinationAddress: '#PRSP_RecordRead_Container',
44
+ RenderMethod: 'replace'
45
+ }
46
+ ],
47
+
48
+ Manifests: {}
49
+ });
50
+
51
+ class viewRecordSetReadRecordRead extends libPictView
52
+ {
53
+ constructor(pFable, pOptions, pServiceHash)
54
+ {
55
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Read_RecordRead, pOptions);
56
+ super(pFable, tmpOptions, pServiceHash);
57
+ }
58
+ }
59
+
60
+ module.exports = viewRecordSetReadRecordRead;
61
+
62
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_Read_RecordRead;
63
+
@@ -0,0 +1,63 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_Read_RecordReadExtra = (
4
+ {
5
+ ViewIdentifier: 'PRSP-Read-RecordReadExtra',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_RecordReadExtra',
8
+ DefaultDestinationAddress: '#PRSP_RecordReadExtra_Container',
9
+ DefaultTemplateRecordAddress: false,
10
+
11
+ // If this is set to true, when the App initializes this will.
12
+ // While the App initializes, initialize will be called.
13
+ AutoInitialize: false,
14
+ AutoInitializeOrdinal: 0,
15
+
16
+ // If this is set to true, when the App autorenders (on load) this will.
17
+ // After the App initializes, render will be called.
18
+ AutoRender: false,
19
+ AutoRenderOrdinal: 0,
20
+
21
+ AutoSolveWithApp: false,
22
+ AutoSolveOrdinal: 0,
23
+
24
+ CSS: false,
25
+ CSSPriority: 500,
26
+
27
+ Templates:
28
+ [
29
+ {
30
+ Hash: 'PRSP-Read-RecordReadExtra-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-Read-RecordReadExtra-Template] -->
33
+ <!-- DefaultPackage end view template: [PRSP-Read-RecordReadExtra-Template] -->
34
+ `
35
+ }
36
+ ],
37
+
38
+ Renderables:
39
+ [
40
+ {
41
+ RenderableHash: 'PRSP_Renderable_RecordReadExtra',
42
+ TemplateHash: 'PRSP-Read-RecordReadExtra-Template',
43
+ DestinationAddress: '#PRSP_RecordReadExtra_Container',
44
+ RenderMethod: 'replace'
45
+ }
46
+ ],
47
+
48
+ Manifests: {}
49
+ });
50
+
51
+ class viewRecordSetReadRecordReadExtra extends libPictView
52
+ {
53
+ constructor(pFable, pOptions, pServiceHash)
54
+ {
55
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Read_RecordReadExtra, pOptions);
56
+ super(pFable, tmpOptions, pServiceHash);
57
+ }
58
+ }
59
+
60
+ module.exports = viewRecordSetReadRecordReadExtra;
61
+
62
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_Read_RecordReadExtra;
63
+
@@ -0,0 +1,63 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_Read_TabBarRead = (
4
+ {
5
+ ViewIdentifier: 'PRSP-Read-TabBarRead',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_TabBarRead',
8
+ DefaultDestinationAddress: '#PRSP_TabBarRead_Container',
9
+ DefaultTemplateRecordAddress: false,
10
+
11
+ // If this is set to true, when the App initializes this will.
12
+ // While the App initializes, initialize will be called.
13
+ AutoInitialize: false,
14
+ AutoInitializeOrdinal: 0,
15
+
16
+ // If this is set to true, when the App autorenders (on load) this will.
17
+ // After the App initializes, render will be called.
18
+ AutoRender: false,
19
+ AutoRenderOrdinal: 0,
20
+
21
+ AutoSolveWithApp: false,
22
+ AutoSolveOrdinal: 0,
23
+
24
+ CSS: false,
25
+ CSSPriority: 500,
26
+
27
+ Templates:
28
+ [
29
+ {
30
+ Hash: 'PRSP-Read-TabBarRead-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-Read-TabBarRead-Template] -->
33
+ <!-- DefaultPackage end view template: [PRSP-Read-TabBarRead-Template] -->
34
+ `
35
+ }
36
+ ],
37
+
38
+ Renderables:
39
+ [
40
+ {
41
+ RenderableHash: 'PRSP_Renderable_TabBarRead',
42
+ TemplateHash: 'PRSP-Read-TabBarRead-Template',
43
+ DestinationAddress: '#PRSP_TabBarRead_Container',
44
+ RenderMethod: 'replace'
45
+ }
46
+ ],
47
+
48
+ Manifests: {}
49
+ });
50
+
51
+ class viewRecordSetReadTabBarRead extends libPictView
52
+ {
53
+ constructor(pFable, pOptions, pServiceHash)
54
+ {
55
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Read_TabBarRead, pOptions);
56
+ super(pFable, tmpOptions, pServiceHash);
57
+ }
58
+ }
59
+
60
+ module.exports = viewRecordSetReadTabBarRead;
61
+
62
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_Read_TabBarRead;
63
+
@@ -0,0 +1,63 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION__Read = (
4
+ {
5
+ ViewIdentifier: 'PRSP-Read',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_Read',
8
+ DefaultDestinationAddress: '#PRSP_Read_Container',
9
+ DefaultTemplateRecordAddress: false,
10
+
11
+ // If this is set to true, when the App initializes this will.
12
+ // While the App initializes, initialize will be called.
13
+ AutoInitialize: false,
14
+ AutoInitializeOrdinal: 0,
15
+
16
+ // If this is set to true, when the App autorenders (on load) this will.
17
+ // After the App initializes, render will be called.
18
+ AutoRender: false,
19
+ AutoRenderOrdinal: 0,
20
+
21
+ AutoSolveWithApp: false,
22
+ AutoSolveOrdinal: 0,
23
+
24
+ CSS: false,
25
+ CSSPriority: 500,
26
+
27
+ Templates:
28
+ [
29
+ {
30
+ Hash: 'PRSP-Read-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-Read-Template] -->
33
+ <!-- DefaultPackage end view template: [PRSP-Read-Template] -->
34
+ `
35
+ }
36
+ ],
37
+
38
+ Renderables:
39
+ [
40
+ {
41
+ RenderableHash: 'PRSP_Renderable_Read',
42
+ TemplateHash: 'PRSP-Read-Template',
43
+ DestinationAddress: '#PRSP_Read_Container',
44
+ RenderMethod: 'replace'
45
+ }
46
+ ],
47
+
48
+ Manifests: {}
49
+ });
50
+
51
+ class viewRecordSetRead extends libPictView
52
+ {
53
+ constructor(pFable, pOptions, pServiceHash)
54
+ {
55
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION__Read, pOptions);
56
+ super(pFable, tmpOptions, pServiceHash);
57
+ }
58
+ }
59
+
60
+ module.exports = viewRecordSetRead;
61
+
62
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION__Read;
63
+
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  // This is temporary, but enables unit tests
7
- const libBrowserEnv = require('browser-env')
7
+ const libBrowserEnv = require('browser-env');
8
8
  libBrowserEnv();
9
9
 
10
10
  const libPictView = require('pict-view');
@@ -0,0 +1,203 @@
1
+ /*
2
+ Unit tests for PictSectionRecordSet Basic
3
+
4
+ */
5
+
6
+ // This is temporary, but enables unit tests
7
+ const libBrowserEnv = require('browser-env');
8
+ libBrowserEnv();
9
+
10
+ const libPictApplication = require('pict-application');
11
+ const libPictView = require('pict-view');
12
+
13
+ const Chai = require('chai');
14
+ const Expect = Chai.expect;
15
+
16
+ const libPict = require('pict');
17
+
18
+ const libPictSectionRecordSet = require('../source/Pict-Section-RecordSet.js');
19
+
20
+ class DoNothingApplication extends libPictApplication
21
+ {
22
+ constructor(pFable, pOptions, pServiceHash)
23
+ {
24
+ pOptions.AutoRenderMainViewportViewAfterInitialize = false;
25
+ pOptions.AutoRenderViewsAfterInitialize = false;
26
+ super(pFable, pOptions, pServiceHash);
27
+
28
+ let resolveFunc;
29
+ /** @type {Promise & { resolve?: () => void }} */
30
+ this._initialized = new Promise(function (resolve)
31
+ {
32
+ resolveFunc = resolve;
33
+ });
34
+ this._initialized.resolve = resolveFunc;
35
+ }
36
+
37
+ get iniitalized()
38
+ {
39
+ return this._initialized;
40
+ }
41
+
42
+ onAfterInitialize()
43
+ {
44
+ this._initialized.resolve();
45
+ return super.onAfterInitialize();
46
+ }
47
+ }
48
+
49
+ class DoNothingView extends libPictView
50
+ {
51
+ constructor(pPict, pOptions)
52
+ {
53
+ super(pPict, pOptions);
54
+ }
55
+ }
56
+
57
+ suite
58
+ (
59
+ 'PictSectionRecordSet RecordProvider MeadowEndpoints Tests',
60
+ () =>
61
+ {
62
+ setup(() => { });
63
+
64
+ suite
65
+ (
66
+ 'Basic Basic Tests',
67
+ () =>
68
+ {
69
+ let _Pict;
70
+ setup(async () =>
71
+ {
72
+ _Pict = new libPict();
73
+ _Pict.LogNoisiness = 2;
74
+ let _PictEnvironment = new libPict.EnvironmentObject(_Pict);
75
+
76
+ let _Application = new DoNothingApplication(_Pict, {});
77
+ _Pict.addProvider('BooksProvider', { Entity: 'Book', URLPrefix: 'http://www.datadebase.com:8086/1.0/' }, require('../source/providers/RecordSet-RecordProvider-MeadowEndpoints.js'));
78
+ await new Promise((resolve, reject) => _Application.initializeAsync((error) =>
79
+ {
80
+ if (error)
81
+ {
82
+ return reject(error);
83
+ }
84
+ resolve();
85
+ }));
86
+ });
87
+
88
+ test('getRecord by ID', async () =>
89
+ {
90
+ const book = await _Pict.providers.BooksProvider.getRecord(1);
91
+ Expect(book).to.be.an('object', 'Book should be an object.');
92
+ Expect(book).to.have.property('IDBook', 1, 'Book should have an id of 1.');
93
+ Expect(book).to.have.property('GUIDBook', 'ca811611-59c9-4b4a-9864-df5145f7785d', 'Book should have a guid of "ca811611-59c9-4b4a-9864-df5145f7785d".');
94
+ Expect(book.Title).to.equal('Angels & Demons', 'Book should have a title of "Angels & Demons".');
95
+ }); // ca811611-59c9-4b4a-9864-df5145f7785d
96
+
97
+ test('getRecord by GUID', async () =>
98
+ {
99
+ const book = await _Pict.providers.BooksProvider.getRecord('ca811611-59c9-4b4a-9864-df5145f7785d');
100
+ Expect(book).to.be.an('object', 'Book should be an object.');
101
+ Expect(book).to.have.property('IDBook', 1, 'Book should have an id of 1.');
102
+ Expect(book).to.have.property('GUIDBook', 'ca811611-59c9-4b4a-9864-df5145f7785d', 'Book should have a guid of "ca811611-59c9-4b4a-9864-df5145f7785d".');
103
+ Expect(book.Title).to.equal('Angels & Demons', 'Book should have a title of "Angels & Demons".');
104
+ });
105
+
106
+ test('getRecords with no options', async () =>
107
+ {
108
+ const { Records: books } = await _Pict.providers.BooksProvider.getRecords({ });
109
+ Expect(books).to.be.an('array', 'Books should be an array.');
110
+ Expect(books.length).to.equal(250, 'Books should have one record.');
111
+ });
112
+
113
+ test('getRecords with pagination', async () =>
114
+ {
115
+ const { Records: books } = await _Pict.providers.BooksProvider.getRecords({ Offset: 1, PageSize: 1 });
116
+ Expect(books).to.be.an('array', 'Books should be an array.');
117
+ Expect(books.length).to.equal(1, 'Books should have one record.');
118
+ const book = books[0];
119
+ Expect(book).to.be.an('object', 'Book should be an object.');
120
+ Expect(book).to.have.property('IDBook', 2, 'Book should have an id of 2.');
121
+ Expect(book).to.have.property('GUIDBook', 'c854b3f1-539a-47fa-acca-c1b90629c220', 'Book should have a guid of "c854b3f1-539a-47fa-acca-c1b90629c220".');
122
+ Expect(book.Title).to.equal(`Harry Potter and the Philosopher's Stone`, `Book should have a title of "Harry Potter and the Philosopher's Stone".`);
123
+ });
124
+
125
+ test('getRecords with filter', async () =>
126
+ {
127
+ const { Records: books } = await _Pict.providers.BooksProvider.getRecords({ FilterString: 'FBV~ISBN~GE~804139024~FSF~ISBN~ASC~0' });
128
+ Expect(books).to.be.an('array', 'Books should be an array.');
129
+ const book = books[0];
130
+ Expect(book).to.be.an('object', 'Book should be an object.');
131
+ Expect(book.ISBN).to.equal('804139024', 'Book should have an ISBN of "804139024".');
132
+ });
133
+
134
+ test('getRecordSetCount', async () =>
135
+ {
136
+ const { Count: count } = await _Pict.providers.BooksProvider.getRecordSetCount({ });
137
+ Expect(count).to.be.greaterThan(0, 'Count should be greater than 0.');
138
+ });
139
+
140
+ test('getRecordSetCount with filter', async () =>
141
+ {
142
+ const { Count: count } = await _Pict.providers.BooksProvider.getRecordSetCount({ FilterString: 'FBV~ISBN~GE~804139024~FSF~ISBN~ASC~0' });
143
+ Expect(count).to.be.greaterThan(0, 'Count should be greater than 0.');
144
+ });
145
+
146
+ test('getRecordSetCount with filter to one record', async () =>
147
+ {
148
+ const { Count: count } = await _Pict.providers.BooksProvider.getRecordSetCount({ FilterString: 'FBV~ISBN~EQ~804139024' });
149
+ Expect(count).to.equal(1, 'Count should be equal to 1.');
150
+ });
151
+
152
+ test('getRecordsInline with no options', async () =>
153
+ {
154
+ const { Records: books } = await _Pict.providers.BooksProvider.getRecordsInline();
155
+ Expect(books).to.be.an('array', 'Books should be an array.');
156
+ Expect(books.length).to.equal(250, 'Books should have one record.');
157
+ });
158
+
159
+ test('getRecordsInline with pagination', async () =>
160
+ {
161
+ const { Records: books } = await _Pict.providers.BooksProvider.getRecordsInline('', 1, 1);
162
+ Expect(books).to.be.an('array', 'Books should be an array.');
163
+ Expect(books.length).to.equal(1, 'Books should have one record.');
164
+ const book = books[0];
165
+ Expect(book).to.be.an('object', 'Book should be an object.');
166
+ Expect(book).to.have.property('IDBook', 2, 'Book should have an id of 2.');
167
+ Expect(book).to.have.property('GUIDBook', 'c854b3f1-539a-47fa-acca-c1b90629c220', 'Book should have a guid of "c854b3f1-539a-47fa-acca-c1b90629c220".');
168
+ Expect(book.Title).to.equal(`Harry Potter and the Philosopher's Stone`, `Book should have a title of "Harry Potter and the Philosopher's Stone".`);
169
+ });
170
+
171
+ test('getRecordsInline with filter', async () =>
172
+ {
173
+ const { Records: books } = await _Pict.providers.BooksProvider.getRecordsInline('FBV~ISBN~GE~804139024~FSF~ISBN~ASC~0');
174
+ Expect(books).to.be.an('array', 'Books should be an array.');
175
+ const book = books[0];
176
+ Expect(book).to.be.an('object', 'Book should be an object.');
177
+ Expect(book.ISBN).to.equal('804139024', 'Book should have an ISBN of "804139024".');
178
+ });
179
+
180
+ test('createRecord and deleteRecord', async () =>
181
+ {
182
+ const book = await _Pict.providers.BooksProvider.createRecord({ Title: 'Test Book', ISBN: '1234567890' });
183
+ Expect(book).to.be.an('object', 'Book should be an object.');
184
+ Expect(book.IDBook).to.be.greaterThan(0, 'Book should have an id greater than 0.');
185
+ book.Title = 'Test Book 2';
186
+ const updartedBook = await _Pict.providers.BooksProvider.updateRecord(book);
187
+ Expect(updartedBook).to.be.an('object', 'Book should be an object.');
188
+ Expect(updartedBook.IDBook).to.equal(book.IDBook, 'Book should have the same id.');
189
+ Expect(updartedBook.Title).to.equal('Test Book 2', 'Book should have a title of "Test Book 2".');
190
+ await _Pict.providers.BooksProvider.deleteRecord(book);
191
+ const existenceCheck = await _Pict.providers.BooksProvider.getRecord(book.IDBook);
192
+ Expect(existenceCheck.Error).to.equal('Record not Found');
193
+ });
194
+
195
+ test('recordSchema', async () =>
196
+ {
197
+ const schema = await _Pict.providers.BooksProvider.recordSchema;
198
+ Expect(schema).to.be.an('object', 'Schema should be an object.');
199
+ Expect(Object.keys(schema).length).to.be.greaterThan(0, 'Schema should have properties.');
200
+ });
201
+ });
202
+ }
203
+ );
@@ -0,0 +1,16 @@
1
+ {
2
+ "include": ["source"],
3
+ "compilerOptions":
4
+ {
5
+ "target": "es2019",
6
+ "esModuleInterop": true,
7
+ "allowJs": true,
8
+ "checkJs": true,
9
+ "declaration": true,
10
+ "emitDeclarationOnly": true,
11
+ "outDir": "types",
12
+ "declarationMap": true,
13
+ "module": "commonjs",
14
+ "resolveJsonModule": true
15
+ }
16
+ }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "include": ["source"],
2
+ "include": ["source", "test"],
3
3
  "compilerOptions":
4
4
  {
5
5
  "target": "es2019",
@@ -1,3 +1,7 @@
1
- declare const _exports: any;
1
+ declare const _exports: {
2
+ new (pFable: any, pOptions: any, pServiceHash: any): import("./services/RecordsSet-MetaController.js");
3
+ default_configuration: {};
4
+ PictRecordSetApplication: typeof import("./application/Pict-Application-RecordSet.js");
5
+ };
2
6
  export = _exports;
3
7
  //# sourceMappingURL=Pict-Section-RecordSet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pict-Application-RecordSet.d.ts","sourceRoot":"","sources":["../../source/application/Pict-Application-RecordSet.js"],"names":[],"mappings":";AAIA;;;;;;;GAOG;AACH;IAEC,2DAQC;CACD"}
1
+ {"version":3,"file":"Pict-Application-RecordSet.d.ts","sourceRoot":"","sources":["../../source/application/Pict-Application-RecordSet.js"],"names":[],"mappings":";AAIA;;;;;;;GAOG;AACH;IAEC,2DAQC;CAYD"}