@researchdatabox/redbox-core-types 1.2.1 → 1.4.0

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 (88) hide show
  1. package/dist/Attachment.d.ts +16 -15
  2. package/dist/Attachment.d.ts.map +1 -0
  3. package/dist/Attachment.js +38 -32
  4. package/dist/CoreController.d.ts +108 -106
  5. package/dist/CoreController.d.ts.map +1 -0
  6. package/dist/CoreController.js +288 -278
  7. package/dist/CoreService.d.ts +58 -41
  8. package/dist/CoreService.d.ts.map +1 -0
  9. package/dist/CoreService.js +165 -112
  10. package/dist/Datastream.d.ts +11 -10
  11. package/dist/Datastream.d.ts.map +1 -0
  12. package/dist/Datastream.js +37 -35
  13. package/dist/DatastreamService.d.ts +12 -11
  14. package/dist/DatastreamService.d.ts.map +1 -0
  15. package/dist/DatastreamService.js +2 -2
  16. package/dist/DatastreamServiceResponse.d.ts +12 -11
  17. package/dist/DatastreamServiceResponse.d.ts.map +1 -0
  18. package/dist/DatastreamServiceResponse.js +36 -34
  19. package/dist/QueueService.d.ts +9 -8
  20. package/dist/QueueService.d.ts.map +1 -0
  21. package/dist/QueueService.js +20 -20
  22. package/dist/RecordAuditParams.d.ts +6 -5
  23. package/dist/RecordAuditParams.d.ts.map +1 -0
  24. package/dist/RecordAuditParams.js +9 -6
  25. package/dist/RecordsService.d.ts +14 -13
  26. package/dist/RecordsService.d.ts.map +1 -0
  27. package/dist/RecordsService.js +2 -2
  28. package/dist/SearchService.d.ts +7 -6
  29. package/dist/SearchService.d.ts.map +1 -0
  30. package/dist/SearchService.js +2 -2
  31. package/dist/StorageService.d.ts +18 -17
  32. package/dist/StorageService.d.ts.map +1 -0
  33. package/dist/StorageService.js +2 -2
  34. package/dist/StorageServiceResponse.d.ts +15 -14
  35. package/dist/StorageServiceResponse.d.ts.map +1 -0
  36. package/dist/StorageServiceResponse.js +39 -33
  37. package/dist/index.d.ts +14 -13
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +32 -28
  40. package/dist/model/APIActionResponse.d.ts +6 -5
  41. package/dist/model/APIActionResponse.d.ts.map +1 -0
  42. package/dist/model/APIActionResponse.js +12 -10
  43. package/dist/model/APIErrorResponse.d.ts +6 -5
  44. package/dist/model/APIErrorResponse.d.ts.map +1 -0
  45. package/dist/model/APIErrorResponse.js +12 -10
  46. package/dist/model/APIHarvestResponse.d.ts +9 -8
  47. package/dist/model/APIHarvestResponse.d.ts.map +1 -0
  48. package/dist/model/APIHarvestResponse.js +18 -13
  49. package/dist/model/APIObjectActionResponse.d.ts +7 -6
  50. package/dist/model/APIObjectActionResponse.d.ts.map +1 -0
  51. package/dist/model/APIObjectActionResponse.js +14 -11
  52. package/dist/model/DashboardTypeResponseModel.d.ts +6 -5
  53. package/dist/model/DashboardTypeResponseModel.d.ts.map +1 -0
  54. package/dist/model/DashboardTypeResponseModel.js +12 -10
  55. package/dist/model/ListAPIResponse.d.ts +7 -6
  56. package/dist/model/ListAPIResponse.d.ts.map +1 -0
  57. package/dist/model/ListAPIResponse.js +11 -10
  58. package/dist/model/ListAPISummary.d.ts +7 -6
  59. package/dist/model/ListAPISummary.d.ts.map +1 -0
  60. package/dist/model/ListAPISummary.js +11 -11
  61. package/dist/model/RBValidationError.d.ts +4 -3
  62. package/dist/model/RBValidationError.d.ts.map +1 -0
  63. package/dist/model/RBValidationError.js +10 -10
  64. package/dist/model/RecordAuditModel.d.ts +7 -6
  65. package/dist/model/RecordAuditModel.d.ts.map +1 -0
  66. package/dist/model/RecordAuditModel.js +17 -14
  67. package/dist/model/RecordTypeResponseModel.d.ts +6 -4
  68. package/dist/model/RecordTypeResponseModel.d.ts.map +1 -0
  69. package/dist/model/RecordTypeResponseModel.js +12 -9
  70. package/dist/model/RequestDetails.d.ts +26 -25
  71. package/dist/model/RequestDetails.d.ts.map +1 -0
  72. package/dist/model/RequestDetails.js +52 -30
  73. package/dist/model/User.d.ts +12 -11
  74. package/dist/model/User.d.ts.map +1 -0
  75. package/dist/model/User.js +15 -6
  76. package/dist/model/api/CreateUserAPIResponse.d.ts +9 -8
  77. package/dist/model/api/CreateUserAPIResponse.d.ts.map +1 -0
  78. package/dist/model/api/CreateUserAPIResponse.js +12 -6
  79. package/dist/model/api/UserAPITokenAPIResponse.d.ts +6 -5
  80. package/dist/model/api/UserAPITokenAPIResponse.d.ts.map +1 -0
  81. package/dist/model/api/UserAPITokenAPIResponse.js +9 -6
  82. package/dist/model/api/index.d.ts +3 -2
  83. package/dist/model/api/index.d.ts.map +1 -0
  84. package/dist/model/api/index.js +7 -7
  85. package/dist/model/index.d.ts +14 -13
  86. package/dist/model/index.d.ts.map +1 -0
  87. package/dist/model/index.js +42 -38
  88. package/package.json +24 -24
@@ -1,15 +1,16 @@
1
- /**
2
- * Base class for information regarding an attachment, also includes payload
3
- *
4
- * @author <a target='_' href='https://github.com/shilob'>Shilo Banihit</a>
5
- */
6
- export declare class Attachment {
7
- dateUpdated: any;
8
- label: string;
9
- contentType: string;
10
- dateCreated: any;
11
- body: any;
12
- readstream: any;
13
- constructor();
14
- }
15
- export default Attachment;
1
+ /**
2
+ * Base class for information regarding an attachment, also includes payload
3
+ *
4
+ * @author <a target='_' href='https://github.com/shilob'>Shilo Banihit</a>
5
+ */
6
+ export declare class Attachment {
7
+ dateUpdated: any;
8
+ label: string;
9
+ contentType: string;
10
+ dateCreated: any;
11
+ body: any;
12
+ readstream: any;
13
+ constructor();
14
+ }
15
+ export default Attachment;
16
+ //# sourceMappingURL=Attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../src/Attachment.ts"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,qBAAa,UAAU;IACrB,WAAW,EAAE,GAAG,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC;IACjB,IAAI,EAAE,GAAG,CAAC;IACV,UAAU,EAAE,GAAG,CAAC;;CAIjB;AACD,eAAe,UAAU,CAAA"}
@@ -1,32 +1,38 @@
1
- "use strict";
2
- // Copyright (c) 2020 Queensland Cyber Infrastructure Foundation (http://www.qcif.edu.au/)
3
- //
4
- // GNU GENERAL PUBLIC LICENSE
5
- // Version 2, June 1991
6
- //
7
- // This program is free software; you can redistribute it and/or modify
8
- // it under the terms of the GNU General Public License as published by
9
- // the Free Software Foundation; either version 2 of the License, or
10
- // (at your option) any later version.
11
- //
12
- // This program is distributed in the hope that it will be useful,
13
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- // GNU General Public License for more details.
16
- //
17
- // You should have received a copy of the GNU General Public License along
18
- // with this program; if not, write to the Free Software Foundation, Inc.,
19
- // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.Attachment = void 0;
22
- /**
23
- * Base class for information regarding an attachment, also includes payload
24
- *
25
- * @author <a target='_' href='https://github.com/shilob'>Shilo Banihit</a>
26
- */
27
- class Attachment {
28
- constructor() {
29
- }
30
- }
31
- exports.Attachment = Attachment;
32
- exports.default = Attachment;
1
+ "use strict";
2
+ // Copyright (c) 2020 Queensland Cyber Infrastructure Foundation (http://www.qcif.edu.au/)
3
+ //
4
+ // GNU GENERAL PUBLIC LICENSE
5
+ // Version 2, June 1991
6
+ //
7
+ // This program is free software; you can redistribute it and/or modify
8
+ // it under the terms of the GNU General Public License as published by
9
+ // the Free Software Foundation; either version 2 of the License, or
10
+ // (at your option) any later version.
11
+ //
12
+ // This program is distributed in the hope that it will be useful,
13
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ // GNU General Public License for more details.
16
+ //
17
+ // You should have received a copy of the GNU General Public License along
18
+ // with this program; if not, write to the Free Software Foundation, Inc.,
19
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.Attachment = void 0;
22
+ /**
23
+ * Base class for information regarding an attachment, also includes payload
24
+ *
25
+ * @author <a target='_' href='https://github.com/shilob'>Shilo Banihit</a>
26
+ */
27
+ class Attachment {
28
+ dateUpdated;
29
+ label;
30
+ contentType;
31
+ dateCreated;
32
+ body; // bad idea to load everything in-memory
33
+ readstream; // strongly suggest services stream rather than load everything in-mem
34
+ constructor() {
35
+ }
36
+ }
37
+ exports.Attachment = Attachment;
38
+ exports.default = Attachment;
@@ -1,106 +1,108 @@
1
- import { APIErrorResponse } from './model/APIErrorResponse';
2
- export declare module Controllers.Core {
3
- /**
4
- * Core controller which defines common logic between controllers.
5
- *
6
- * Workflow details:
7
- * - First, the "_handleRequest" method must be called. It ensures common stuff happens, and bind some data into the option object.
8
- * - It calls a magic method such as "__beforeIndex" if the request was coming from an "index" method.
9
- * - If it doesn't find any specific magic method to call, it calls directly the "__beforeEach" method.
10
- * - If it does find a custom magic method, then the "__beforeIndex" will automatically call the "__beforeEach" once it is done.
11
- * - Once all the "__before" magic methods have been called, the caller's callback function is called.
12
- *
13
- * The options object contains specific stuff that belongs to the controllers logic, I could have use the req but I prefer not.
14
- *
15
- * The public methods such as index/show/etc. are defined but send by default a 404 response if they are not overridden in the child class.
16
- * They exists just to bind by default all these methods without take care if they exists or not in order to speed up development.
17
- */
18
- class Controller {
19
- /**
20
- * Overrides for the settings in `config/controllers.js`
21
- * (specific to the controller where it's defined)
22
- * Specific to sails. Don't rename.
23
- */
24
- protected _config: any;
25
- /**
26
- * Exported methods. Must be overridden by the child to add custom methods.
27
- */
28
- protected _exportedMethods: string[];
29
- /**
30
- * Theme used by the controller by default.
31
- * Could be overridden by the user theme. (One day, when the feature will be done...)
32
- */
33
- protected _theme: string;
34
- /**
35
- * Layout used by the controller by default.
36
- */
37
- protected _layout: string;
38
- /**
39
- * Relative path to a layout from a view.
40
- */
41
- protected _layoutRelativePath: string;
42
- /**
43
- * Default exported methods.
44
- * These methods will be accessible.
45
- */
46
- private _defaultExportedMethods;
47
- /**
48
- **************************************************************************************************
49
- **************************************** Public methods ******************************************
50
- **************************************************************************************************
51
- */
52
- /**
53
- * Returns an object that contains all exported methods of the controller.
54
- * These methods must be defined in either the "_defaultExportedMethods" or "_exportedMethods" arrays.
55
- *
56
- * @returns {*}
57
- */
58
- exports(): any;
59
- /**
60
- **************************************************************************************************
61
- **************************************** Protected methods ******************************************
62
- **************************************************************************************************
63
- */
64
- /**
65
- * Acts as a requests workflow handler to automatically call magic methods such as "__before".
66
- * Used to call magic methods before the targeted methods is called.
67
- * Bind some data as well, like the current controller and action name.
68
- *
69
- * @param req Request.
70
- * @param res Response.
71
- * @param callback Function to execute.
72
- * @param options Object that contains options.
73
- * controller Controller Child controller class. (static)
74
- *
75
- */
76
- protected _handleRequest(req: any, res: any, callback: any, options?: any): void;
77
- /**
78
- **************************************************************************************************
79
- **************************************** Controller basic methods ********************************
80
- **************************************************************************************************
81
- */
82
- /**
83
- * Displays the global content, displays several resources.
84
- * This method is just to return a 404 error and explain the role.
85
- *
86
- * @param req Request.
87
- * @param res Response.
88
- * @param callback Function to execute.
89
- * @param options Object that contains options.
90
- */
91
- index(req: any, res: any, callback: any, options?: any): void;
92
- _getResolvedView(branding: string, portal: string, view: string): string;
93
- _getResolvedLayout(branding: string, portal: string): string;
94
- sendView(req: any, res: any, view: string, locals?: any): void;
95
- respond(req: any, res: any, ajaxCb: any, normalCb: any, forceAjax?: boolean): any;
96
- protected isAjax(req: any): boolean;
97
- protected ajaxOk(req: any, res: any, msg?: string, data?: any, forceAjax?: boolean): void;
98
- protected ajaxFail(req: any, res: any, msg?: string, data?: any, forceAjax?: boolean): void;
99
- protected apiFail(req: any, res: any, statusCode?: number, errorResponse?: APIErrorResponse): any;
100
- protected apiRespond(req: any, res: any, jsonObj?: any, statusCode?: number): void;
101
- protected ajaxRespond(req: any, res: any, jsonObj: any, forceAjax: any): void;
102
- protected getNg2Apps(viewPath: any): {
103
- ng2_apps: any;
104
- };
105
- }
106
- }
1
+ import { APIErrorResponse } from './model/APIErrorResponse';
2
+ export declare module Controllers.Core {
3
+ /**
4
+ * Core controller which defines common logic between controllers.
5
+ *
6
+ * Workflow details:
7
+ * - First, the "_handleRequest" method must be called. It ensures common stuff happens, and bind some data into the option object.
8
+ * - It calls a magic method such as "__beforeIndex" if the request was coming from an "index" method.
9
+ * - If it doesn't find any specific magic method to call, it calls directly the "__beforeEach" method.
10
+ * - If it does find a custom magic method, then the "__beforeIndex" will automatically call the "__beforeEach" once it is done.
11
+ * - Once all the "__before" magic methods have been called, the caller's callback function is called.
12
+ *
13
+ * The options object contains specific stuff that belongs to the controllers logic, I could have use the req but I prefer not.
14
+ *
15
+ * The public methods such as index/show/etc. are defined but send by default a 404 response if they are not overridden in the child class.
16
+ * They exists just to bind by default all these methods without take care if they exists or not in order to speed up development.
17
+ */
18
+ class Controller {
19
+ /**
20
+ * Overrides for the settings in `config/controllers.js`
21
+ * (specific to the controller where it's defined)
22
+ * Specific to sails. Don't rename.
23
+ */
24
+ protected _config: any;
25
+ /**
26
+ * Exported methods. Must be overridden by the child to add custom methods.
27
+ */
28
+ protected _exportedMethods: string[];
29
+ /**
30
+ * Theme used by the controller by default.
31
+ * Could be overridden by the user theme. (One day, when the feature will be done...)
32
+ */
33
+ protected _theme: string;
34
+ /**
35
+ * Layout used by the controller by default.
36
+ */
37
+ protected _layout: string;
38
+ /**
39
+ * Relative path to a layout from a view.
40
+ */
41
+ protected _layoutRelativePath: string;
42
+ /**
43
+ * Default exported methods.
44
+ * These methods will be accessible.
45
+ */
46
+ private _defaultExportedMethods;
47
+ /**
48
+ **************************************************************************************************
49
+ **************************************** Public methods ******************************************
50
+ **************************************************************************************************
51
+ */
52
+ /**
53
+ * Returns an object that contains all exported methods of the controller.
54
+ * These methods must be defined in either the "_defaultExportedMethods" or "_exportedMethods" arrays.
55
+ *
56
+ * @returns {*}
57
+ */
58
+ exports(): any;
59
+ /**
60
+ **************************************************************************************************
61
+ **************************************** Protected methods ******************************************
62
+ **************************************************************************************************
63
+ */
64
+ /**
65
+ * Acts as a requests workflow handler to automatically call magic methods such as "__before".
66
+ * Used to call magic methods before the targeted methods is called.
67
+ * Bind some data as well, like the current controller and action name.
68
+ *
69
+ * @param req Request.
70
+ * @param res Response.
71
+ * @param callback Function to execute.
72
+ * @param options Object that contains options.
73
+ * controller Controller Child controller class. (static)
74
+ *
75
+ */
76
+ protected _handleRequest(req: any, res: any, callback: any, options?: any): void;
77
+ /**
78
+ **************************************************************************************************
79
+ **************************************** Controller basic methods ********************************
80
+ **************************************************************************************************
81
+ */
82
+ /**
83
+ * Displays the global content, displays several resources.
84
+ * This method is just to return a 404 error and explain the role.
85
+ *
86
+ * @param req Request.
87
+ * @param res Response.
88
+ * @param callback Function to execute.
89
+ * @param options Object that contains options.
90
+ */
91
+ index(req: any, res: any, callback: any, options?: any): void;
92
+ _getResolvedView(branding: string, portal: string, view: string): string;
93
+ _getResolvedLayout(branding: string, portal: string): string;
94
+ sendView(req: any, res: any, view: string, locals?: any): void;
95
+ respond(req: any, res: any, ajaxCb: any, normalCb: any, forceAjax?: boolean): any;
96
+ protected isAjax(req: any): boolean;
97
+ protected ajaxOk(req: any, res: any, msg?: string, data?: any, forceAjax?: boolean): void;
98
+ protected ajaxFail(req: any, res: any, msg?: string, data?: any, forceAjax?: boolean): void;
99
+ protected apiFail(req: any, res: any, statusCode?: number, errorResponse?: APIErrorResponse): any;
100
+ protected apiRespond(req: any, res: any, jsonObj?: any, statusCode?: number): void;
101
+ protected ajaxRespond(req: any, res: any, jsonObj: any, forceAjax: any): void;
102
+ protected getNg2Apps(viewPath: any): {
103
+ ng2_apps: any;
104
+ };
105
+ protected pathExistsSync(path: any): boolean;
106
+ }
107
+ }
108
+ //# sourceMappingURL=CoreController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreController.d.ts","sourceRoot":"","sources":["../src/Co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