@resistdesign/voltra 3.0.0-alpha.4 → 3.0.0-alpha.40

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 (219) hide show
  1. package/README.md +379 -14
  2. package/api/DBX/DBXAsserts.d.ts +95 -0
  3. package/api/DBX/DBXRequest.d.ts +5 -0
  4. package/api/DBX/DBXRuntime.d.ts +5 -0
  5. package/api/DBX/DBXScenarioConfig.d.ts +9 -0
  6. package/api/DBX/DBXSeed.d.ts +124 -0
  7. package/api/DBX/DBXTypes.d.ts +176 -0
  8. package/api/DBX/index.d.ts +8 -0
  9. package/api/DataAccessControl.d.ts +220 -0
  10. package/api/Indexing/API.d.ts +224 -0
  11. package/api/Indexing/Cursor.d.ts +101 -0
  12. package/api/Indexing/Handler/Config.d.ts +39 -0
  13. package/api/Indexing/Handler.d.ts +166 -0
  14. package/api/Indexing/Trace.d.ts +54 -0
  15. package/api/Indexing/Types.d.ts +204 -0
  16. package/api/Indexing/ddb/AwsSdkV3Adapter.d.ts +8 -0
  17. package/api/Indexing/ddb/Types.d.ts +209 -0
  18. package/api/Indexing/docId.d.ts +27 -0
  19. package/api/Indexing/exact/ExactDdb.d.ts +58 -0
  20. package/api/Indexing/exact/ExactIndex.d.ts +90 -0
  21. package/api/Indexing/exact/ExactS3.d.ts +41 -0
  22. package/api/Indexing/fieldQualification.d.ts +12 -0
  23. package/api/Indexing/fulltext/FullTextDdbBackend.d.ts +212 -0
  24. package/api/Indexing/fulltext/FullTextMemoryBackend.d.ts +93 -0
  25. package/api/Indexing/fulltext/Schema.d.ts +164 -0
  26. package/api/Indexing/hashUniversal.d.ts +13 -0
  27. package/api/Indexing/index.d.ts +45 -0
  28. package/api/Indexing/lossy/LossyDdb.d.ts +43 -0
  29. package/api/Indexing/lossy/LossyIndex.d.ts +72 -0
  30. package/api/Indexing/lossy/LossyS3.d.ts +40 -0
  31. package/api/Indexing/rel/Cursor.d.ts +25 -0
  32. package/api/Indexing/rel/Handlers.d.ts +144 -0
  33. package/api/Indexing/rel/RelationalDdb.d.ts +169 -0
  34. package/api/Indexing/rel/RelationalInMemoryBackend.d.ts +38 -0
  35. package/api/Indexing/rel/Types.d.ts +69 -0
  36. package/api/Indexing/structured/Cursor.d.ts +26 -0
  37. package/api/Indexing/structured/Handlers.d.ts +128 -0
  38. package/api/Indexing/structured/SearchStructured.d.ts +44 -0
  39. package/api/Indexing/structured/StructuredDdb.d.ts +184 -0
  40. package/api/Indexing/structured/StructuredDdbBackend.d.ts +112 -0
  41. package/api/Indexing/structured/StructuredInMemoryBackend.d.ts +40 -0
  42. package/api/Indexing/structured/StructuredInMemoryIndex.d.ts +61 -0
  43. package/api/Indexing/structured/StructuredStringLike.d.ts +54 -0
  44. package/api/Indexing/structured/StructuredWriter.d.ts +74 -0
  45. package/api/Indexing/structured/Types.d.ts +126 -0
  46. package/api/Indexing/structured/index.d.ts +9 -0
  47. package/api/Indexing/tokenize.d.ts +31 -0
  48. package/api/ORM/DACUtils.d.ts +270 -0
  49. package/api/ORM/ListItemUtils.d.ts +40 -0
  50. package/api/ORM/ORMRouteMap.d.ts +55 -0
  51. package/api/ORM/TypeInfoORMService.d.ts +740 -0
  52. package/api/ORM/drivers/DynamoDBDataItemDBDriver/ConfigTypes.d.ts +229 -0
  53. package/api/ORM/drivers/DynamoDBDataItemDBDriver.d.ts +89 -0
  54. package/api/ORM/drivers/InMemoryDataItemDBDriver/ConfigTypes.d.ts +4 -0
  55. package/api/ORM/drivers/InMemoryDataItemDBDriver.d.ts +55 -0
  56. package/api/ORM/drivers/InMemoryFileItemDBDriver/ConfigTypes.d.ts +13 -0
  57. package/api/ORM/drivers/InMemoryFileItemDBDriver.d.ts +98 -0
  58. package/api/ORM/drivers/InMemoryItemRelationshipDBDriver.d.ts +16 -0
  59. package/api/ORM/drivers/IndexingRelationshipDriver.d.ts +123 -0
  60. package/api/ORM/drivers/S3FileItemDBDriver/ConfigTypes.d.ts +322 -0
  61. package/api/ORM/drivers/S3FileItemDBDriver/S3FileDriver.d.ts +118 -0
  62. package/api/ORM/drivers/S3FileItemDBDriver.d.ts +71 -0
  63. package/api/ORM/drivers/common/SupportedTypeInfoORMDBDrivers.d.ts +36 -0
  64. package/api/ORM/drivers/common/Types.d.ts +197 -0
  65. package/api/ORM/drivers/common/index.d.ts +2 -0
  66. package/api/ORM/drivers/index.d.ts +8 -0
  67. package/api/ORM/index.d.ts +9 -0
  68. package/api/ORM/indexing/criteriaToStructuredWhere.d.ts +22 -0
  69. package/api/Router/AWS.d.ts +80 -0
  70. package/api/Router/Auth.d.ts +14 -0
  71. package/api/Router/CORS.d.ts +66 -0
  72. package/api/Router/Types.d.ts +138 -0
  73. package/api/Router/index.d.ts +89 -0
  74. package/api/index.d.ts +72 -6
  75. package/api/index.js +3291 -1954
  76. package/app/forms/Engine.d.ts +23 -0
  77. package/app/forms/UI.d.ts +83 -0
  78. package/app/forms/core/createAutoField.d.ts +43 -0
  79. package/app/forms/core/createFormRenderer.d.ts +25 -0
  80. package/app/forms/core/getFieldKind.d.ts +14 -0
  81. package/app/forms/core/index.d.ts +11 -0
  82. package/app/forms/core/mergeSuites.d.ts +23 -0
  83. package/app/forms/core/resolveSuite.d.ts +15 -0
  84. package/app/forms/core/types.d.ts +180 -0
  85. package/app/forms/index.d.ts +9 -0
  86. package/app/forms/types.d.ts +137 -0
  87. package/app/helpers/styled.d.ts +3 -0
  88. package/app/index.d.ts +102 -5
  89. package/app/index.js +98 -327
  90. package/app/utils/ApplicationState.d.ts +167 -0
  91. package/app/utils/ApplicationStateLoader.d.ts +86 -0
  92. package/app/utils/Controller.d.ts +10 -0
  93. package/app/utils/Debug.d.ts +14 -0
  94. package/app/utils/EasyLayout.d.ts +89 -0
  95. package/app/utils/History.d.ts +165 -0
  96. package/app/utils/Route.d.ts +173 -0
  97. package/app/utils/RouteHistory.d.ts +27 -0
  98. package/app/utils/Service.d.ts +45 -0
  99. package/app/utils/TypeInfoORMAPIUtils.d.ts +94 -0
  100. package/app/utils/TypeInfoORMClient.d.ts +103 -0
  101. package/app/utils/UniversalRouteAdapter.d.ts +73 -0
  102. package/app/utils/easy-layout/computeAreaBounds.d.ts +5 -0
  103. package/app/utils/easy-layout/computeTracks.d.ts +16 -0
  104. package/app/utils/easy-layout/index.d.ts +5 -0
  105. package/app/utils/easy-layout/parseTemplate.d.ts +12 -0
  106. package/app/utils/easy-layout/types.d.ts +52 -0
  107. package/app/utils/easy-layout/validateAreas.d.ts +5 -0
  108. package/app/utils/index.d.ts +24 -0
  109. package/build/TypeMapping.d.ts +17 -0
  110. package/build/TypeParsing.d.ts +10 -0
  111. package/build/index.d.ts +15 -0
  112. package/build/index.js +569 -0
  113. package/chunk-2MOLWZMQ.js +71 -0
  114. package/chunk-7AMEFPPP.js +78 -0
  115. package/chunk-ATO2455Q.js +258 -0
  116. package/chunk-DT6WWJUI.js +1185 -0
  117. package/chunk-I2KLQ2HA.js +19 -0
  118. package/chunk-TJFTWPXQ.js +39 -0
  119. package/chunk-WNFRDIBW.js +121 -0
  120. package/chunk-YCTVEW2I.js +546 -0
  121. package/common/CommandLine/collectRequiredEnvironmentVariables.d.ts +9 -0
  122. package/common/CommandLine/index.d.ts +6 -0
  123. package/common/HelperTypes.d.ts +9 -0
  124. package/common/IdGeneration/getSimpleId.d.ts +8 -0
  125. package/common/IdGeneration/index.d.ts +1 -0
  126. package/common/ItemRelationshipInfoTypes.d.ts +64 -0
  127. package/common/ItemRelationships/ItemRelationshipValidation.d.ts +21 -0
  128. package/common/ItemRelationships/index.d.ts +2 -0
  129. package/common/Logging/Utils.d.ts +10 -0
  130. package/common/Logging/index.d.ts +1 -0
  131. package/common/Routing.d.ts +81 -0
  132. package/common/SearchTypes.d.ts +227 -0
  133. package/common/SearchUtils.d.ts +55 -0
  134. package/common/SearchValidation.d.ts +27 -0
  135. package/common/StringTransformers.d.ts +28 -0
  136. package/common/Testing/CLI.d.ts +6 -0
  137. package/common/Testing/Types.d.ts +216 -0
  138. package/common/Testing/Utils.d.ts +112 -0
  139. package/common/Testing/index.d.ts +8 -0
  140. package/common/TypeInfoDataItemUtils.d.ts +39 -0
  141. package/{Types-C7XjUjoF.d.ts → common/TypeInfoORM/Types.d.ts} +117 -15
  142. package/common/TypeInfoORM/index.d.ts +3 -0
  143. package/common/TypeParsing/Constants.d.ts +4 -0
  144. package/common/TypeParsing/ParsingUtils/Constants.d.ts +8 -0
  145. package/common/TypeParsing/ParsingUtils/checkType.d.ts +14 -0
  146. package/common/TypeParsing/ParsingUtils/checkUnionType.d.ts +12 -0
  147. package/common/TypeParsing/ParsingUtils/extractCommentTags.d.ts +8 -0
  148. package/common/TypeParsing/ParsingUtils/extractLiteralValues.d.ts +12 -0
  149. package/common/TypeParsing/ParsingUtils/extractTypeDetails.d.ts +14 -0
  150. package/common/TypeParsing/ParsingUtils/getPrimaryFieldForTypeInfo.d.ts +18 -0
  151. package/common/TypeParsing/ParsingUtils/getTypeInfo.d.ts +9 -0
  152. package/common/TypeParsing/ParsingUtils/getTypeInfoField.d.ts +9 -0
  153. package/common/TypeParsing/ParsingUtils/getTypeInfoFromAliasType.d.ts +11 -0
  154. package/common/TypeParsing/ParsingUtils/getTypeInfoFromFieldFilter.d.ts +12 -0
  155. package/common/TypeParsing/ParsingUtils/getTypeInfoFromTypeAlias.d.ts +11 -0
  156. package/common/TypeParsing/ParsingUtils/getTypeKeyword.d.ts +9 -0
  157. package/common/TypeParsing/ParsingUtils/getUnionOrIntersectionTypeInfo.d.ts +11 -0
  158. package/common/TypeParsing/ParsingUtils/getUnionOrLiteralStringValues.d.ts +8 -0
  159. package/common/TypeParsing/TypeInfo.d.ts +222 -0
  160. package/common/TypeParsing/Utils.d.ts +47 -0
  161. package/common/TypeParsing/Validation.d.ts +327 -0
  162. package/common/TypeParsing/index.d.ts +8 -0
  163. package/common/index.d.ts +40 -4
  164. package/common/index.js +25 -1737
  165. package/{index-BkFZlfit.d.ts → iac/SimpleCFT.d.ts} +5 -25
  166. package/iac/index.d.ts +40 -2
  167. package/iac/index.js +2 -1661
  168. package/iac/packs/auth.d.ts +131 -0
  169. package/iac/packs/build/utils.d.ts +289 -0
  170. package/iac/packs/build.d.ts +92 -0
  171. package/iac/packs/cdn.d.ts +33 -0
  172. package/iac/packs/cloud-function.d.ts +67 -0
  173. package/iac/packs/database.d.ts +32 -0
  174. package/iac/packs/dns.d.ts +34 -0
  175. package/iac/packs/file-storage.d.ts +46 -0
  176. package/iac/packs/gateway.d.ts +82 -0
  177. package/iac/packs/index.d.ts +60 -1
  178. package/iac/packs/index.js +311 -566
  179. package/iac/packs/repo.d.ts +28 -0
  180. package/iac/packs/ssl-certificate.d.ts +28 -0
  181. package/iac/types/Constants.d.ts +24 -0
  182. package/{index-DcvJOZ_c.d.ts → iac/types/IaCTypes.d.ts} +23 -1018
  183. package/iac/types/Renderers.d.ts +96 -0
  184. package/iac/types/Types.d.ts +131 -0
  185. package/iac/types/Utils.d.ts +9 -0
  186. package/iac/types/generate.d.ts +1 -0
  187. package/iac/utils/index.d.ts +87 -0
  188. package/iac/utils/patch-utils.d.ts +66 -0
  189. package/iac-packs/index.d.ts +6 -0
  190. package/native/forms/UI.d.ts +73 -0
  191. package/native/forms/createNativeFormRenderer.d.ts +21 -0
  192. package/native/forms/index.d.ts +25 -0
  193. package/native/forms/primitives/index.d.ts +38 -0
  194. package/native/forms/suite.d.ts +15 -0
  195. package/native/index.d.ts +19 -0
  196. package/native/index.js +748 -0
  197. package/native/testing/react-native.d.ts +46 -0
  198. package/native/utils/EasyLayout.d.ts +88 -0
  199. package/native/utils/History.d.ts +102 -0
  200. package/native/utils/Route.d.ts +80 -0
  201. package/native/utils/index.d.ts +20 -0
  202. package/package.json +54 -21
  203. package/web/forms/UI.d.ts +74 -0
  204. package/web/forms/createWebFormRenderer.d.ts +21 -0
  205. package/web/forms/index.d.ts +9 -0
  206. package/web/forms/primitives/index.d.ts +21 -0
  207. package/web/forms/suite.d.ts +15 -0
  208. package/web/index.d.ts +15 -0
  209. package/web/index.js +668 -0
  210. package/web/utils/EasyLayout.d.ts +47 -0
  211. package/web/utils/Route.d.ts +16 -0
  212. package/web/utils/index.d.ts +7 -0
  213. package/SearchTypes-DjN6YQzE.d.ts +0 -577
  214. package/Validation-CFP59oIP.d.ts +0 -226
  215. package/index-C3-iD9Mh.d.ts +0 -690
  216. package/index-DZ2BB4iX.d.ts +0 -5357
  217. package/index-IokxSNxm.d.ts +0 -745
  218. package/index.d.ts +0 -13
  219. package/index.js +0 -10973
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Helpers for parsing and composing path strings used by the Router utilities.
3
+ */
4
+ /**
5
+ * The delimiter used to separate paths.
6
+ */
7
+ export declare const PATH_DELIMITER = "/";
8
+ /**
9
+ * Parse a string into JSON if possible, otherwise return the raw value.
10
+ *
11
+ * @param value - Input string to parse.
12
+ * @returns Parsed JSON or the original string.
13
+ */
14
+ export declare const getPotentialJSONValue: (value: string) => any;
15
+ /**
16
+ * Get the path segments from a path string.
17
+ *
18
+ * @param path - Path string to split.
19
+ * @param delimiter - Delimiter used to split the path.
20
+ * @param filterEmptyOutput - Whether to remove empty output segments.
21
+ * @param filterEmptyInput - Whether to remove empty input segments.
22
+ * @param useJson - Whether to parse each segment as JSON.
23
+ * @param uriDecodeParts - Whether to URI-decode each segment.
24
+ * @returns Array of path segments.
25
+ * */
26
+ export declare const getPathArray: (path: string, delimiter?: string, filterEmptyOutput?: boolean, filterEmptyInput?: boolean, useJson?: boolean, uriDecodeParts?: boolean) => any[];
27
+ /**
28
+ * Get the path string from path segments.
29
+ *
30
+ * @param parts - Path segments to join.
31
+ * @param delimiter - Delimiter used to join the path.
32
+ * @param filterEmptyInput - Whether to remove empty input segments.
33
+ * @param useJson - Whether to JSON-stringify each segment.
34
+ * @param uriEncodeParts - Whether to URI-encode each segment.
35
+ * @returns Joined path string.
36
+ * */
37
+ export declare const getPathString: (parts?: any[], delimiter?: string, filterEmptyInput?: boolean, useJson?: boolean, uriEncodeParts?: boolean) => string;
38
+ /**
39
+ * Merge two path strings.
40
+ *
41
+ * @param path1 - First path string.
42
+ * @param path2 - Second path string.
43
+ * @param delimiter - Delimiter used to split and join paths.
44
+ * @param filterEmptyOutput - Whether to remove empty output segments.
45
+ * @param filterEmptyInput - Whether to remove empty input segments.
46
+ * @param useJson - Whether to parse/serialize segments as JSON.
47
+ * @param uriEncodeParts - Whether to URI-encode each segment.
48
+ * @returns Merged path string.
49
+ * */
50
+ export declare const mergeStringPaths: (path1: string, path2: string, delimiter?: string, filterEmptyOutput?: boolean, filterEmptyInput?: boolean, useJson?: boolean, uriEncodeParts?: boolean) => string;
51
+ /**
52
+ * Resolve a path string against another path string.
53
+ *
54
+ * @param currentPath - Base path to resolve against.
55
+ * @param newPath - New path to resolve, absolute or relative.
56
+ * @returns Resolved path string.
57
+ * */
58
+ export declare const resolvePath: (currentPath: string, newPath: string) => string;
59
+ /**
60
+ * Resolve RouteAdapter navigation input against the current path.
61
+ *
62
+ * Rules:
63
+ * - `"/x"` resolves from root.
64
+ * - `"x"` and `"./x"` resolve under current path.
65
+ * - `"../x"` resolves one level up per `..`.
66
+ * - `"/"` and `""` both resolve to root (`"/"`).
67
+ *
68
+ * @param currentPath - Current absolute path (query/hash ignored).
69
+ * @param nextPath - Adapter navigation target (absolute or relative).
70
+ * @returns Resolved absolute path string.
71
+ */
72
+ export declare const resolveRouteAdapterPath: (currentPath: string, nextPath: string) => string;
73
+ /**
74
+ * Get the parameter values from a path string and test the `path` against a `testPath`.
75
+ *
76
+ * @param path - Actual path to test.
77
+ * @param testPath - Route pattern to match against.
78
+ * @param exact - Whether to require an exact match.
79
+ * @returns Params object when matched, otherwise false.
80
+ * */
81
+ export declare const getParamsAndTestPath: (path: string, testPath: string, exact?: boolean) => Record<string, any> | false;
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Search-related types used by list/search APIs.
3
+ */
4
+ import { ItemRelationshipInfo, ItemRelationshipOriginItemInfo } from "./ItemRelationshipInfoTypes";
5
+ /**
6
+ * The logical operators for a search criteria.
7
+ * */
8
+ export declare enum LogicalOperators {
9
+ /**
10
+ * Require all criteria to match.
11
+ * */
12
+ AND = "AND",
13
+ /**
14
+ * Require any criteria to match.
15
+ * */
16
+ OR = "OR"
17
+ }
18
+ /**
19
+ * The comparison operators for a field criterion.
20
+ * */
21
+ export declare enum ComparisonOperators {
22
+ /**
23
+ * Field value equals the criterion value.
24
+ * */
25
+ EQUALS = "EQUALS",
26
+ /**
27
+ * Field value does not equal the criterion value.
28
+ * */
29
+ NOT_EQUALS = "NOT_EQUALS",
30
+ /**
31
+ * Field value is greater than the criterion value.
32
+ * */
33
+ GREATER_THAN = "GREATER_THAN",
34
+ /**
35
+ * Field value is greater than or equal to the criterion value.
36
+ * */
37
+ GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL",
38
+ /**
39
+ * Field value is less than the criterion value.
40
+ * */
41
+ LESS_THAN = "LESS_THAN",
42
+ /**
43
+ * Field value is less than or equal to the criterion value.
44
+ * */
45
+ LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL",
46
+ /**
47
+ * Field value is in the provided options.
48
+ * */
49
+ IN = "IN",
50
+ /**
51
+ * Field value is not in the provided options.
52
+ * */
53
+ NOT_IN = "NOT_IN",
54
+ /**
55
+ * Field value contains the criterion value as a substring.
56
+ * */
57
+ LIKE = "LIKE",
58
+ /**
59
+ * Field value does not contain the criterion value as a substring.
60
+ * */
61
+ NOT_LIKE = "NOT_LIKE",
62
+ /**
63
+ * Field value exists and is not null.
64
+ * */
65
+ EXISTS = "EXISTS",
66
+ /**
67
+ * Field value is missing or null.
68
+ * */
69
+ NOT_EXISTS = "NOT_EXISTS",
70
+ /**
71
+ * Field value is not empty.
72
+ * */
73
+ IS_NOT_EMPTY = "IS_NOT_EMPTY",
74
+ /**
75
+ * Field value is empty.
76
+ * */
77
+ IS_EMPTY = "IS_EMPTY",
78
+ /**
79
+ * Field value is within an inclusive range.
80
+ * */
81
+ BETWEEN = "BETWEEN",
82
+ /**
83
+ * Field value is outside an inclusive range.
84
+ * */
85
+ NOT_BETWEEN = "NOT_BETWEEN",
86
+ /**
87
+ * Field value array contains the criterion value.
88
+ * */
89
+ CONTAINS = "CONTAINS",
90
+ /**
91
+ * Field value array does not contain the criterion value.
92
+ * */
93
+ NOT_CONTAINS = "NOT_CONTAINS",
94
+ /**
95
+ * Field value starts with the criterion value.
96
+ * */
97
+ STARTS_WITH = "STARTS_WITH",
98
+ /**
99
+ * Field value ends with the criterion value.
100
+ * */
101
+ ENDS_WITH = "ENDS_WITH",
102
+ /**
103
+ * Field value does not start with the criterion value.
104
+ * */
105
+ DOES_NOT_START_WITH = "DOES_NOT_START_WITH",
106
+ /**
107
+ * Field value does not end with the criterion value.
108
+ * */
109
+ DOES_NOT_END_WITH = "DOES_NOT_END_WITH"
110
+ }
111
+ /**
112
+ * The field criterion for a search criteria.
113
+ * */
114
+ export type FieldCriterion = {
115
+ /**
116
+ * Field name to compare.
117
+ * */
118
+ fieldName: string;
119
+ /**
120
+ * Comparison operator to apply.
121
+ * */
122
+ operator?: ComparisonOperators;
123
+ /**
124
+ * Custom operator label when using backend-specific operators.
125
+ * */
126
+ customOperator?: string;
127
+ /**
128
+ * Primary comparison value.
129
+ * */
130
+ value?: any;
131
+ /**
132
+ * Comparison value options (e.g., IN/BETWEEN).
133
+ * */
134
+ valueOptions?: any[];
135
+ };
136
+ /**
137
+ * The criteria for a search.
138
+ * */
139
+ export type SearchCriteria = {
140
+ /**
141
+ * Logical operator to apply across field criteria.
142
+ * */
143
+ logicalOperator: LogicalOperators;
144
+ /**
145
+ * Field-level criteria to evaluate.
146
+ * */
147
+ fieldCriteria: FieldCriterion[];
148
+ };
149
+ /**
150
+ * The results from a request to list items.
151
+ * */
152
+ export type ListItemsResults<ItemType extends Record<any, any>> = {
153
+ /**
154
+ * Cursor for paging into the next page, when available.
155
+ * */
156
+ cursor?: string;
157
+ /**
158
+ * Items returned by the request.
159
+ * */
160
+ items: ItemType[];
161
+ };
162
+ /**
163
+ * The information used to sort a list of items by a specified field.
164
+ * */
165
+ export type SortField = {
166
+ /**
167
+ * Field name to sort by.
168
+ * */
169
+ field?: string;
170
+ /**
171
+ * Whether to reverse sort order.
172
+ * */
173
+ reverse?: boolean;
174
+ };
175
+ /**
176
+ * The data used to page a specific set of search results that uses full paging.
177
+ * @see SupportedTags.fullPaging
178
+ * */
179
+ export type StandardExpandedPagingCursor = {
180
+ /**
181
+ * Current page number.
182
+ * */
183
+ currentPage?: number;
184
+ /**
185
+ * Total number of pages available.
186
+ * */
187
+ totalPages?: number;
188
+ };
189
+ /**
190
+ * The information for paging through a list of items.
191
+ * */
192
+ export type PagingInfo = {
193
+ /**
194
+ * Items per page to request.
195
+ * */
196
+ itemsPerPage?: number;
197
+ /**
198
+ * Cursor token for paging.
199
+ * */
200
+ cursor?: string;
201
+ };
202
+ /**
203
+ * The configuration for listing and searching for items.
204
+ * */
205
+ export type ListItemsConfig = PagingInfo & {
206
+ /**
207
+ * Structured search criteria.
208
+ * */
209
+ criteria?: SearchCriteria;
210
+ /**
211
+ * Sort fields to apply.
212
+ * */
213
+ sortFields?: SortField[];
214
+ };
215
+ /**
216
+ * A configuration for listing relationships.
217
+ * */
218
+ export type ListRelationshipsConfig = PagingInfo & {
219
+ /**
220
+ * Relationship origin info used to filter related records.
221
+ * */
222
+ relationshipItemOrigin: ItemRelationshipOriginItemInfo;
223
+ };
224
+ /**
225
+ * The results from a request to list relationships.
226
+ * */
227
+ export type ListRelationshipsResults = ListItemsResults<ItemRelationshipInfo>;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Filtering and sorting utilities for search criteria.
3
+ */
4
+ import { TypeInfoDataItem, TypeInfoMap } from "./TypeParsing/TypeInfo";
5
+ import { ComparisonOperators, FieldCriterion, SearchCriteria, SortField } from "./SearchTypes";
6
+ /**
7
+ * Basic comparison operators for filtering data.
8
+ * */
9
+ export declare const COMPARATORS: Record<ComparisonOperators, (
10
+ /**
11
+ * Criterion value to compare against.
12
+ * */
13
+ criterionValue: any,
14
+ /**
15
+ * Criterion options for operators like IN/BETWEEN.
16
+ * */
17
+ criterionValueOptions: any[] | undefined,
18
+ /**
19
+ * Field value from the item.
20
+ * */
21
+ fieldValue: any) => boolean>;
22
+ /**
23
+ * Compare a field criterion to a field value.
24
+ *
25
+ * @param fieldCriterion - Criterion to compare.
26
+ * @param fieldValue - Field value to test.
27
+ * @returns Whether the criterion matches the field value.
28
+ * */
29
+ export declare const compare: (fieldCriterion: FieldCriterion, fieldValue: any) => boolean;
30
+ /**
31
+ * Compare a field criterion to an array of field values.
32
+ *
33
+ * @param fieldCriterion - Criterion to compare.
34
+ * @param fieldValue - Array field value to test.
35
+ * @returns Whether the criterion matches the field value array.
36
+ * */
37
+ export declare const compareArray: (fieldCriterion: FieldCriterion, fieldValue: any[] | undefined) => boolean;
38
+ /**
39
+ * Get the filtered data items based on the search criteria.
40
+ *
41
+ * @param searchCriteria - Criteria to apply.
42
+ * @param items - Items to filter.
43
+ * @param typeInfoName - Optional type name for field metadata.
44
+ * @param typeInfoMap - Optional type info map for field metadata.
45
+ * @returns Filtered items that match the criteria.
46
+ * */
47
+ export declare const getFilterTypeInfoDataItemsBySearchCriteria: (searchCriteria: SearchCriteria, items: TypeInfoDataItem[], typeInfoName?: string, typeInfoMap?: TypeInfoMap) => TypeInfoDataItem[];
48
+ /**
49
+ * Get the sorted data items based on the given sort fields.
50
+ *
51
+ * @param sortFields - Sort field configuration.
52
+ * @param items - Items to sort.
53
+ * @returns Sorted items array.
54
+ * */
55
+ export declare const getSortedItems: (sortFields?: SortField[], items?: TypeInfoDataItem[]) => TypeInfoDataItem[];
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Validation rules for search criteria against TypeInfo definitions.
3
+ */
4
+ import { FieldCriterion } from "./SearchTypes";
5
+ import { CustomTypeInfoFieldValidatorMap, TypeInfoValidationResults } from "./TypeParsing/Validation";
6
+ import { TypeInfoMap } from "./TypeParsing/TypeInfo";
7
+ /**
8
+ * Search validation errors.
9
+ * */
10
+ export declare const SEARCH_VALIDATION_ERRORS: {
11
+ INVALID_TYPE_INFO: string;
12
+ RELATIONAL_FIELDS_NOT_ALLOWED: string;
13
+ INVALID_FIELD: string;
14
+ INVALID_VALUE_OPTION: string;
15
+ INVALID_OPERATOR: string;
16
+ };
17
+ /**
18
+ * Validate search fields against type info fields.
19
+ *
20
+ * @param typeInfoName - Type name to validate against.
21
+ * @param typeInfoMap - Type info map containing field definitions.
22
+ * @param searchFields - Field criteria to validate.
23
+ * @param disallowRelationalFields - Whether to forbid relational fields.
24
+ * @param customValidators - Custom field validators by type name.
25
+ * @returns Validation results with errors and error map.
26
+ * */
27
+ export declare const validateSearchFields: (typeInfoName: string, typeInfoMap: TypeInfoMap, searchFields?: FieldCriterion[], disallowRelationalFields?: boolean, customValidators?: CustomTypeInfoFieldValidatorMap) => TypeInfoValidationResults;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Built-in and custom string transformers for type keywords.
3
+ */
4
+ import { TypeKeyword } from "./TypeParsing/TypeInfo";
5
+ /**
6
+ * A function that transforms a value into a string.
7
+ *
8
+ * @param value - Value to transform.
9
+ * @returns String representation of the value.
10
+ * */
11
+ export type StringTransformer = (value: any) => string;
12
+ /**
13
+ * A map of string transformers for each type keyword.
14
+ * */
15
+ export declare const STRING_TRANSFORMERS: Record<TypeKeyword, StringTransformer>;
16
+ /**
17
+ * A map of custom string transformers for each custom type.
18
+ * */
19
+ export declare const CUSTOM_STRING_TRANSFORMERS: Record<string, StringTransformer>;
20
+ /**
21
+ * Transform a value into a string based on the type keyword or custom type.
22
+ *
23
+ * @param value - Value to transform.
24
+ * @param typeKeyword - Type keyword used to select the transformer.
25
+ * @param customType - Custom type name, if applicable.
26
+ * @returns String representation for the value.
27
+ * */
28
+ export declare const transformValueToString: (value: any, typeKeyword: TypeKeyword, customType?: string) => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * CLI entrypoint for the JSON spec test runner.
3
+ *
4
+ * @returns Resolves when the CLI finishes and exits the process.
5
+ */
6
+ export declare const main: () => Promise<void>;
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Operations used for comparison during tests.
3
+ */
4
+ export declare enum TestComparisonOperation {
5
+ /**
6
+ * Strict equality comparison.
7
+ * */
8
+ EQUALS = "===",
9
+ /**
10
+ * Strict inequality comparison.
11
+ * */
12
+ NOT_EQUALS = "!==",
13
+ /**
14
+ * Value is contained in expectation array.
15
+ * */
16
+ IN = "IN",
17
+ /**
18
+ * Array contains the expectation value.
19
+ * */
20
+ ARRAY_CONTAINS = "ARRAY_CONTAINS",
21
+ /**
22
+ * Numeric value is between two bounds.
23
+ * */
24
+ BETWEEN = "BETWEEN",
25
+ /**
26
+ * String contains another string.
27
+ * */
28
+ CONTAINS = "CONTAINS",
29
+ /**
30
+ * Regex match against a pattern.
31
+ * */
32
+ REGEX = "REGEX",
33
+ /**
34
+ * Extended regex match with explicit pattern elements.
35
+ * */
36
+ EXT_REGEX = "EXT_REGEX",
37
+ /**
38
+ * Deep equality using JSON stringification.
39
+ * */
40
+ DEEP_EQUALS = "DEEP_EQUALS",
41
+ /**
42
+ * Array equality using JSON stringification.
43
+ * */
44
+ ARRAY_EQUALS = "ARRAY_EQUALS"
45
+ }
46
+ /**
47
+ * A pattern definition object for use with extended regex expectations.
48
+ * */
49
+ export type PatternElement = {
50
+ /**
51
+ * Literal pattern segment value.
52
+ * */
53
+ value: string;
54
+ /**
55
+ * Whether to escape regex characters in the value.
56
+ * */
57
+ escaped?: boolean;
58
+ };
59
+ /**
60
+ * An extended regex expectation with a patter structure, optional flags and
61
+ * escaping properties that allow for clear and explicit declaration of regex
62
+ * patterns in JSON.
63
+ *
64
+ * Used when a `TestCondition` `operation` is `TestComparisonOperation.EXT_REGEX`.
65
+ * */
66
+ export type EXTRegexExpectation = {
67
+ /**
68
+ * Pattern elements to build the regex.
69
+ * */
70
+ pattern: PatternElement[];
71
+ /**
72
+ * Regex flags to apply.
73
+ * */
74
+ flags?: string;
75
+ };
76
+ /**
77
+ * A regex expectation with a pattern and optional flags.
78
+ *
79
+ * Used when a `TestCondition` `operation` is `TestComparisonOperation.REGEX`.
80
+ * */
81
+ export type RegexExpectation = {
82
+ /**
83
+ * Regex pattern string.
84
+ * */
85
+ pattern: string;
86
+ /**
87
+ * Regex flags to apply.
88
+ * */
89
+ flags?: string;
90
+ };
91
+ /**
92
+ * A configuration used to acquire conditions from code instead of a JSON array.
93
+ * */
94
+ export type ConditionConfig = {
95
+ /**
96
+ * Relative file path containing the conditions export.
97
+ * */
98
+ file: string;
99
+ /**
100
+ * Export name that contains the conditions array.
101
+ * */
102
+ export: string;
103
+ };
104
+ /**
105
+ * Preparation for a test when some setup is required or a class needs to be instantiated.
106
+ * */
107
+ export type TestSetup = {
108
+ /**
109
+ * Conditions to use for the setup function or constructor.
110
+ * */
111
+ conditions: unknown[] | ConditionConfig;
112
+ /**
113
+ * Export name to call or instantiate for setup.
114
+ * */
115
+ export: string;
116
+ /**
117
+ * Whether to use `new` with the setup export.
118
+ * */
119
+ instantiate?: boolean;
120
+ };
121
+ /**
122
+ * The basis for a test.
123
+ * */
124
+ export type BaseTest = {
125
+ /**
126
+ * Export name for the test function.
127
+ * */
128
+ export: string;
129
+ /**
130
+ * Optional setup configuration.
131
+ * */
132
+ setup?: TestSetup;
133
+ /**
134
+ * Conditions to pass to the test function.
135
+ * */
136
+ conditions: unknown[] | ConditionConfig;
137
+ /**
138
+ * Allow missing expectation and treat undefined as pass.
139
+ * */
140
+ expectUndefined?: boolean;
141
+ };
142
+ /**
143
+ * A singular test with specific types of expectations for a given operation.
144
+ * */
145
+ export type Test = BaseTest & ({
146
+ operation?: TestComparisonOperation.EQUALS | TestComparisonOperation.NOT_EQUALS;
147
+ expectation: string | number | boolean | null | undefined;
148
+ } | {
149
+ operation: TestComparisonOperation.IN | TestComparisonOperation.ARRAY_CONTAINS;
150
+ expectation: unknown[];
151
+ } | {
152
+ operation: TestComparisonOperation.BETWEEN;
153
+ expectation: [number, number];
154
+ } | {
155
+ operation: TestComparisonOperation.CONTAINS;
156
+ expectation: string;
157
+ } | {
158
+ operation: TestComparisonOperation.REGEX;
159
+ expectation: RegexExpectation;
160
+ } | {
161
+ operation: TestComparisonOperation.EXT_REGEX;
162
+ expectation: EXTRegexExpectation;
163
+ } | {
164
+ operation: TestComparisonOperation.DEEP_EQUALS;
165
+ expectation: Record<string, unknown>;
166
+ } | {
167
+ operation: TestComparisonOperation.ARRAY_EQUALS;
168
+ expectation: unknown[];
169
+ });
170
+ /**
171
+ * A configuration for a test. Designed to be used in JSON spec files.
172
+ */
173
+ export type TestConfig = {
174
+ /**
175
+ * Relative module path containing test exports.
176
+ * */
177
+ file: string;
178
+ /**
179
+ * Tests to execute for the module.
180
+ * */
181
+ tests: Test[];
182
+ };
183
+ /**
184
+ * A resolved test configuration with the module and tests.
185
+ * */
186
+ export type ResolvedTestConfig = {
187
+ /**
188
+ * Required module with test exports.
189
+ * */
190
+ targetModule: any;
191
+ } & TestConfig;
192
+ /**
193
+ * The results from running one or more tests.
194
+ * */
195
+ export type TestResults = {
196
+ /**
197
+ * Informational messages.
198
+ * */
199
+ messages?: string[];
200
+ /**
201
+ * Generated expectation messages.
202
+ * */
203
+ generated?: string[];
204
+ /**
205
+ * Passed test messages.
206
+ * */
207
+ passes?: string[];
208
+ /**
209
+ * Failed test messages.
210
+ * */
211
+ failures?: string[];
212
+ /**
213
+ * Error messages.
214
+ * */
215
+ errors?: string[];
216
+ };