@wavemaker-ai/variables 1.0.0-rc.647469

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 (123) hide show
  1. package/index.d.ts +14 -0
  2. package/index.js +15 -0
  3. package/index.js.map +1 -0
  4. package/npm-shrinkwrap.json +1967 -0
  5. package/package-lock.json +1967 -0
  6. package/package.json +48 -0
  7. package/scripts/build.d.ts +1 -0
  8. package/scripts/build.js +183 -0
  9. package/scripts/build.js.map +1 -0
  10. package/src/advanced-options.d.ts +4 -0
  11. package/src/advanced-options.js +2 -0
  12. package/src/advanced-options.js.map +1 -0
  13. package/src/constants/variables.constants.d.ts +307 -0
  14. package/src/constants/variables.constants.js +334 -0
  15. package/src/constants/variables.constants.js.map +1 -0
  16. package/src/factory/variable-manager.factory.d.ts +3 -0
  17. package/src/factory/variable-manager.factory.js +26 -0
  18. package/src/factory/variable-manager.factory.js.map +1 -0
  19. package/src/manager/action/timer-action.manager.d.ts +4 -0
  20. package/src/manager/action/timer-action.manager.js +38 -0
  21. package/src/manager/action/timer-action.manager.js.map +1 -0
  22. package/src/manager/variable/base-variable.manager.d.ts +24 -0
  23. package/src/manager/variable/base-variable.manager.js +79 -0
  24. package/src/manager/variable/base-variable.manager.js.map +1 -0
  25. package/src/manager/variable/crud-variable.manager.d.ts +85 -0
  26. package/src/manager/variable/crud-variable.manager.js +415 -0
  27. package/src/manager/variable/crud-variable.manager.js.map +1 -0
  28. package/src/manager/variable/live-variable.manager.d.ts +154 -0
  29. package/src/manager/variable/live-variable.manager.js +1078 -0
  30. package/src/manager/variable/live-variable.manager.js.map +1 -0
  31. package/src/manager/variable/model-variable.manager.d.ts +4 -0
  32. package/src/manager/variable/model-variable.manager.js +56 -0
  33. package/src/manager/variable/model-variable.manager.js.map +1 -0
  34. package/src/manager/variable/service-variable.manager.d.ts +113 -0
  35. package/src/manager/variable/service-variable.manager.js +713 -0
  36. package/src/manager/variable/service-variable.manager.js.map +1 -0
  37. package/src/model/action/timer-action.d.ts +12 -0
  38. package/src/model/action/timer-action.js +60 -0
  39. package/src/model/action/timer-action.js.map +1 -0
  40. package/src/model/base-action.d.ts +32 -0
  41. package/src/model/base-action.js +89 -0
  42. package/src/model/base-action.js.map +1 -0
  43. package/src/model/base-variable.d.ts +58 -0
  44. package/src/model/base-variable.js +180 -0
  45. package/src/model/base-variable.js.map +1 -0
  46. package/src/model/crud-create.d.ts +8 -0
  47. package/src/model/crud-create.js +17 -0
  48. package/src/model/crud-create.js.map +1 -0
  49. package/src/model/crud-delete.d.ts +8 -0
  50. package/src/model/crud-delete.js +17 -0
  51. package/src/model/crud-delete.js.map +1 -0
  52. package/src/model/crud-list.d.ts +8 -0
  53. package/src/model/crud-list.js +17 -0
  54. package/src/model/crud-list.js.map +1 -0
  55. package/src/model/crud-update.d.ts +8 -0
  56. package/src/model/crud-update.js +17 -0
  57. package/src/model/crud-update.js.map +1 -0
  58. package/src/model/variable/api-aware-variable.d.ts +23 -0
  59. package/src/model/variable/api-aware-variable.js +25 -0
  60. package/src/model/variable/api-aware-variable.js.map +1 -0
  61. package/src/model/variable/crud-variable.d.ts +30 -0
  62. package/src/model/variable/crud-variable.js +181 -0
  63. package/src/model/variable/crud-variable.js.map +1 -0
  64. package/src/model/variable/live-variable.d.ts +40 -0
  65. package/src/model/variable/live-variable.js +262 -0
  66. package/src/model/variable/live-variable.js.map +1 -0
  67. package/src/model/variable/model-variable.d.ts +11 -0
  68. package/src/model/variable/model-variable.js +83 -0
  69. package/src/model/variable/model-variable.js.map +1 -0
  70. package/src/model/variable/service-variable.d.ts +35 -0
  71. package/src/model/variable/service-variable.js +147 -0
  72. package/src/model/variable/service-variable.js.map +1 -0
  73. package/src/types/date-formatter.d.ts +3 -0
  74. package/src/types/date-formatter.js +2 -0
  75. package/src/types/date-formatter.js.map +1 -0
  76. package/src/types/event-notifier.d.ts +9 -0
  77. package/src/types/event-notifier.js +25 -0
  78. package/src/types/event-notifier.js.map +1 -0
  79. package/src/types/http-client.service.d.ts +8 -0
  80. package/src/types/http-client.service.js +2 -0
  81. package/src/types/http-client.service.js.map +1 -0
  82. package/src/types/types.d.ts +50 -0
  83. package/src/types/types.js +54 -0
  84. package/src/types/types.js.map +1 -0
  85. package/src/util/dataset-util.d.ts +27 -0
  86. package/src/util/dataset-util.js +147 -0
  87. package/src/util/dataset-util.js.map +1 -0
  88. package/src/util/file-upload.util.d.ts +11 -0
  89. package/src/util/file-upload.util.js +183 -0
  90. package/src/util/file-upload.util.js.map +1 -0
  91. package/src/util/inflight-queue.d.ts +35 -0
  92. package/src/util/inflight-queue.js +102 -0
  93. package/src/util/inflight-queue.js.map +1 -0
  94. package/src/util/notify-promise.d.ts +3 -0
  95. package/src/util/notify-promise.js +37 -0
  96. package/src/util/notify-promise.js.map +1 -0
  97. package/src/util/oAuth.utils.d.ts +3 -0
  98. package/src/util/oAuth.utils.js +11 -0
  99. package/src/util/oAuth.utils.js.map +1 -0
  100. package/src/util/utils.d.ts +69 -0
  101. package/src/util/utils.js +364 -0
  102. package/src/util/utils.js.map +1 -0
  103. package/src/util/variable/live-variable.http.utils.d.ts +21 -0
  104. package/src/util/variable/live-variable.http.utils.js +212 -0
  105. package/src/util/variable/live-variable.http.utils.js.map +1 -0
  106. package/src/util/variable/live-variable.utils.d.ts +72 -0
  107. package/src/util/variable/live-variable.utils.js +667 -0
  108. package/src/util/variable/live-variable.utils.js.map +1 -0
  109. package/src/util/variable/pagination.utils.d.ts +91 -0
  110. package/src/util/variable/pagination.utils.js +493 -0
  111. package/src/util/variable/pagination.utils.js.map +1 -0
  112. package/src/util/variable/service-variable.utils.d.ts +17 -0
  113. package/src/util/variable/service-variable.utils.js +394 -0
  114. package/src/util/variable/service-variable.utils.js.map +1 -0
  115. package/src/util/variable/variables.utils.d.ts +120 -0
  116. package/src/util/variable/variables.utils.js +544 -0
  117. package/src/util/variable/variables.utils.js.map +1 -0
  118. package/src/wm-namespace.d.ts +11 -0
  119. package/src/wm-namespace.js +13 -0
  120. package/src/wm-namespace.js.map +1 -0
  121. package/webpack.config.d.ts +21 -0
  122. package/webpack.config.js +28 -0
  123. package/webpack.config.js.map +1 -0
@@ -0,0 +1,154 @@
1
+ import { BaseVariableManager } from './base-variable.manager';
2
+ export declare class LiveVariableManager extends BaseVariableManager {
3
+ initFilterExpressionBinding(variable: any): void;
4
+ private updateDataset;
5
+ private setVariableOptions;
6
+ private handleError;
7
+ /**
8
+ * Traverses recursively the filterExpressions object and if there is any required field present with no value,
9
+ * then we will return without proceeding further. Its upto the developer to provide the mandatory value,
10
+ * if he wants to assign it in teh onbefore<delete/insert/update>function then make that field in
11
+ * the filter query section as optional
12
+ * @param filterExpressions - recursive rule Object
13
+ * @returns {Object} object or boolean. Object if everything gets validated or else just boolean indicating failure in the validations
14
+ */
15
+ private getFilterExprFields;
16
+ /**
17
+ * Allows the user to get the criteria of filtering and the filter fields, based on the method called
18
+ */
19
+ private getDataFilterObj;
20
+ private makeCall;
21
+ private getEntityData;
22
+ private performCUD;
23
+ private doCUD;
24
+ private aggregateData;
25
+ /**
26
+ * Makes http call for a Live Variable against the configured DB Entity.
27
+ * Gets the paginated records against the entity
28
+ * @param variable
29
+ * @param options
30
+ * @param success
31
+ * @param error
32
+ * @returns {Promise<any>}: will be resolved on successful data fetch
33
+ */
34
+ listRecords(variable: any, options: any, success: any, error: any): Promise<unknown>;
35
+ /**
36
+ * Makes a POST http call for a Live Variable against the configured DB Entity.
37
+ * Sends a Table record object with the request body
38
+ * the record is inserted into the entity at the backend
39
+ * @param variable
40
+ * @param options
41
+ * @param success
42
+ * @param error
43
+ * @returns {Promise<any>}: will be resolved on successful data fetch
44
+ */
45
+ insertRecord(variable: any, options: any, success: any, error: any): Promise<unknown>;
46
+ /**
47
+ * Makes a PUT http call for a Live Variable against the configured DB Entity.
48
+ * Sends a Table record object with the request body against the primary key of an existing record
49
+ * the record is updated into the entity at the backend
50
+ * @param variable
51
+ * @param options
52
+ * @param success
53
+ * @param error
54
+ * @returns {Promise<any>}: will be resolved on successful data fetch
55
+ */
56
+ updateRecord(variable: any, options: any, success: any, error: any): Promise<unknown>;
57
+ /**
58
+ * Makes a DELETE http call for a Live Variable against the configured DB Entity.
59
+ * Sends the primary key of an existing record
60
+ * the record is deleted from the entity at the backend
61
+ * @param variable
62
+ * @param options
63
+ * @param success
64
+ * @param error
65
+ * @returns {Promise<any>}: will be resolved on successful data fetch
66
+ */
67
+ deleteRecord(variable: any, options: any, success: any, error: any): Promise<unknown>;
68
+ /**
69
+ * sets the value against passed key on the "inputFields" object in the variable
70
+ * @param variable
71
+ * @param key: can be:
72
+ * - a string e.g. "username"
73
+ * - an object, e.g. {"username": "john", "ssn": "11111"}
74
+ * @param val
75
+ * - if key is string, the value against it (for that data type)
76
+ * - if key is object, not required
77
+ * @param options
78
+ * @returns {any}
79
+ */
80
+ setInput(variable: any, key: any, val: any, options: any): any;
81
+ /**
82
+ * sets the value against passed key on the "filterFields" object in the variable
83
+ * @param variable
84
+ * @param key: can be:
85
+ * - a string e.g. "username"
86
+ * - an object, e.g. {"username": "john", "ssn": "11111"}
87
+ * @param val
88
+ * - if key is string, the value against it (for that data type)
89
+ * - if key is object, not required
90
+ * @param options
91
+ * @returns {any}
92
+ */
93
+ setFilter(variable: any, key: any, val: any): any;
94
+ /**
95
+ * Makes a file download call for a table
96
+ * @param variable
97
+ * @param options
98
+ */
99
+ download(variable: any, options: any, successHandler: any, errorHandler: any): Promise<unknown>;
100
+ /**
101
+ * gets primary keys against the passed related Table
102
+ * @param variable
103
+ * @param relatedField
104
+ * @returns {any}
105
+ */
106
+ getRelatedTablePrimaryKeys(variable: any, relatedField: any): any;
107
+ /**
108
+ * Makes HTTP call to get the data for related entity of a field in an entity
109
+ * @param variable
110
+ * @param columnName
111
+ * @param options
112
+ * @param success
113
+ * @param error
114
+ */
115
+ getRelatedTableData(variable: any, columnName: any, options: any, success: any, error: any): Promise<unknown>;
116
+ /**
117
+ * Gets the distinct records for an entity
118
+ * @param variable
119
+ * @param options
120
+ * @param success
121
+ * @param error
122
+ */
123
+ getDistinctDataByFields(variable: any, options: any, success: any, error: any): Promise<unknown>;
124
+ getAggregatedData(variable: any, options: any, success: any, error: any): Promise<unknown>;
125
+ defineFirstLastRecord(variable: any): void;
126
+ getPrimaryKey(variable: any): any;
127
+ prepareRequestParams(options: any): any;
128
+ /**
129
+ * Gets the filtered records based on searchKey
130
+ * @param variable
131
+ * @param options contains the searchKey and queryText
132
+ * @param success
133
+ * @param error
134
+ * @returns {Promise<any>}
135
+ */
136
+ searchRecords(variable: any, options: any, success: any, error: any): Promise<unknown>;
137
+ /**
138
+ * used in onBeforeUpdate call - called last in the function - used in old Variables using dataBinding.
139
+ * This function migrates the old data dataBinding to filterExpressions equivalent format
140
+ * @param variable
141
+ * @param inputData
142
+ * @private
143
+ */
144
+ upgradeInputDataToFilterExpressions(variable: any, response: any, inputData: any): any;
145
+ /**
146
+ * used in onBeforeUpdate call - called first in the function - used in old Variables using dataBinding.
147
+ * This function migrates the filterExpressions object to flat map structure
148
+ * @param variable
149
+ * @param inputData
150
+ * @private
151
+ */
152
+ downgradeFilterExpressionsToInputData(variable: any, inputData: any): any;
153
+ cancel(variable: any, options: any): void;
154
+ }