@dremio/js-sdk 0.14.1 → 0.15.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.
- package/dist/cloud/interfaces.d.ts +1 -0
- package/dist/cloud/interfaces.js +1 -0
- package/dist/cloud/interfaces.js.map +1 -1
- package/dist/enterprise/catalog/EnterpriseCatalogResource.d.ts +2 -436
- package/dist/enterprise/catalog/catalogSearch/CatalogSearchParams.d.ts +1 -2
- package/dist/enterprise/catalog/catalogSearch/CatalogSearchParams.js.map +1 -1
- package/dist/enterprise/catalog/catalogSearch/CatalogSearchResult.d.ts +147 -0
- package/dist/enterprise/catalog/catalogSearch/CatalogSearchResult.js +151 -0
- package/dist/enterprise/catalog/catalogSearch/CatalogSearchResult.js.map +1 -0
- package/dist/enterprise/catalog/catalogSearch/createCatalogSearch.d.ts +1 -218
- package/dist/enterprise/catalog/catalogSearch/mapSearchResult.d.ts +3 -221
- package/dist/enterprise/catalog/catalogSearch/mapSearchResult.js +19 -28
- package/dist/enterprise/catalog/catalogSearch/mapSearchResult.js.map +1 -1
- package/dist/enterprise/interfaces.d.ts +1 -0
- package/dist/enterprise/interfaces.js +1 -0
- package/dist/enterprise/interfaces.js.map +1 -1
- package/package.json +1 -1
- package/dist/enterprise/catalog/catalogSearch/SearchResult.d.ts +0 -123
- package/dist/enterprise/catalog/catalogSearch/SearchResult.js +0 -27
- package/dist/enterprise/catalog/catalogSearch/SearchResult.js.map +0 -1
|
@@ -14,58 +14,53 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Query } from "../../../common/Query.js";
|
|
17
|
-
import {
|
|
17
|
+
import { FolderSearchResult, FunctionSearchResult, JobSearchResult, ReflectionSearchResult, ScriptSearchResult, SourceSearchResult, SpaceSearchResult, TableSearchResult, ViewSearchResult, } from "./CatalogSearchResult.js";
|
|
18
18
|
export const mapSearchResult = (_catalogReferenceFromEntity) => (searchResult) => {
|
|
19
19
|
switch (searchResult.category) {
|
|
20
20
|
case "FOLDER":
|
|
21
|
-
return {
|
|
21
|
+
return new FolderSearchResult({
|
|
22
22
|
catalogReference: _catalogReferenceFromEntity({
|
|
23
23
|
path: searchResult.catalogObject.path,
|
|
24
24
|
type: transformSearchTypeToCatalog(searchResult.catalogObject.type),
|
|
25
25
|
}),
|
|
26
|
-
category: SearchCategory.FOLDER,
|
|
27
26
|
owner: searchResult.catalogObject?.owner,
|
|
28
27
|
wiki: searchResult.catalogObject.wiki || null,
|
|
29
|
-
};
|
|
28
|
+
});
|
|
30
29
|
case "SCRIPT":
|
|
31
|
-
return {
|
|
32
|
-
category: SearchCategory.SCRIPT,
|
|
30
|
+
return new ScriptSearchResult({
|
|
33
31
|
content: searchResult.scriptObject.content,
|
|
34
32
|
createdAt: new Date(searchResult.scriptObject.createdAt),
|
|
35
33
|
id: searchResult.scriptObject.id,
|
|
36
34
|
lastModifiedAt: new Date(searchResult.scriptObject.modifiedAt),
|
|
37
35
|
name: searchResult.scriptObject.name,
|
|
38
36
|
owner: searchResult.scriptObject.owner,
|
|
39
|
-
};
|
|
37
|
+
});
|
|
40
38
|
case "REFLECTION":
|
|
41
|
-
return {
|
|
39
|
+
return new ReflectionSearchResult({
|
|
42
40
|
catalogReference: _catalogReferenceFromEntity({
|
|
43
41
|
path: searchResult.reflectionObject.datasetPath,
|
|
44
42
|
type: transformSearchTypeToCatalog(searchResult.reflectionObject.datasetType.toUpperCase()),
|
|
45
43
|
}),
|
|
46
|
-
category: SearchCategory.REFLECTION,
|
|
47
44
|
createdAt: new Date(searchResult.reflectionObject.createdAt),
|
|
48
45
|
id: searchResult.reflectionObject.id,
|
|
49
46
|
lastModifiedAt: new Date(searchResult.reflectionObject.modifiedAt),
|
|
50
47
|
name: searchResult.reflectionObject.name,
|
|
51
|
-
};
|
|
48
|
+
});
|
|
52
49
|
case "SOURCE":
|
|
53
|
-
return {
|
|
50
|
+
return new SourceSearchResult({
|
|
54
51
|
catalogReference: _catalogReferenceFromEntity({
|
|
55
52
|
path: searchResult.catalogObject.path,
|
|
56
53
|
type: transformSearchTypeToCatalog(searchResult.catalogObject.type),
|
|
57
54
|
}),
|
|
58
|
-
category: SearchCategory.SOURCE,
|
|
59
55
|
createdAt: new Date(searchResult.catalogObject.createdAt),
|
|
60
56
|
owner: searchResult.catalogObject.owner,
|
|
61
|
-
};
|
|
57
|
+
});
|
|
62
58
|
case "SPACE":
|
|
63
|
-
return {
|
|
59
|
+
return new SpaceSearchResult({
|
|
64
60
|
catalogReference: _catalogReferenceFromEntity({
|
|
65
61
|
path: searchResult.catalogObject.path,
|
|
66
62
|
type: transformSearchTypeToCatalog(searchResult.catalogObject.type),
|
|
67
63
|
}),
|
|
68
|
-
category: SearchCategory.SPACE,
|
|
69
64
|
createdAt: searchResult.catalogObject.createdAt
|
|
70
65
|
? new Date(searchResult.catalogObject.createdAt)
|
|
71
66
|
: null,
|
|
@@ -74,14 +69,13 @@ export const mapSearchResult = (_catalogReferenceFromEntity) => (searchResult) =
|
|
|
74
69
|
: null,
|
|
75
70
|
owner: searchResult.catalogObject.owner,
|
|
76
71
|
wiki: searchResult.catalogObject.wiki || null,
|
|
77
|
-
};
|
|
72
|
+
});
|
|
78
73
|
case "TABLE":
|
|
79
|
-
return {
|
|
74
|
+
return new TableSearchResult({
|
|
80
75
|
catalogReference: _catalogReferenceFromEntity({
|
|
81
76
|
path: searchResult.catalogObject.path,
|
|
82
77
|
type: transformSearchTypeToCatalog(searchResult.catalogObject.type),
|
|
83
78
|
}),
|
|
84
|
-
category: SearchCategory.TABLE,
|
|
85
79
|
columns: searchResult.catalogObject.columns,
|
|
86
80
|
createdAt: searchResult.catalogObject.createdAt
|
|
87
81
|
? new Date(searchResult.catalogObject.createdAt)
|
|
@@ -92,26 +86,24 @@ export const mapSearchResult = (_catalogReferenceFromEntity) => (searchResult) =
|
|
|
92
86
|
: null,
|
|
93
87
|
owner: searchResult.catalogObject.owner,
|
|
94
88
|
wiki: searchResult.catalogObject.wiki || null,
|
|
95
|
-
};
|
|
89
|
+
});
|
|
96
90
|
case "UDF":
|
|
97
|
-
return {
|
|
91
|
+
return new FunctionSearchResult({
|
|
98
92
|
catalogReference: _catalogReferenceFromEntity({
|
|
99
93
|
path: searchResult.catalogObject.path,
|
|
100
94
|
type: transformSearchTypeToCatalog(searchResult.catalogObject.type),
|
|
101
95
|
}),
|
|
102
|
-
category: SearchCategory.FUNCTION,
|
|
103
96
|
createdAt: new Date(searchResult.catalogObject.createdAt),
|
|
104
97
|
functionSql: searchResult.catalogObject.functionSql,
|
|
105
98
|
lastModifiedAt: new Date(searchResult.catalogObject.modifiedAt),
|
|
106
99
|
owner: searchResult.catalogObject.owner,
|
|
107
|
-
};
|
|
100
|
+
});
|
|
108
101
|
case "VIEW":
|
|
109
|
-
return {
|
|
102
|
+
return new ViewSearchResult({
|
|
110
103
|
catalogReference: _catalogReferenceFromEntity({
|
|
111
104
|
path: searchResult.catalogObject.path,
|
|
112
105
|
type: transformSearchTypeToCatalog(searchResult.catalogObject.type),
|
|
113
106
|
}),
|
|
114
|
-
category: SearchCategory.VIEW,
|
|
115
107
|
columns: searchResult.catalogObject.columns,
|
|
116
108
|
createdAt: searchResult.catalogObject.createdAt
|
|
117
109
|
? new Date(searchResult.catalogObject.createdAt)
|
|
@@ -122,10 +114,9 @@ export const mapSearchResult = (_catalogReferenceFromEntity) => (searchResult) =
|
|
|
122
114
|
: null,
|
|
123
115
|
owner: searchResult.catalogObject.owner,
|
|
124
116
|
wiki: searchResult.catalogObject.wiki || null,
|
|
125
|
-
};
|
|
117
|
+
});
|
|
126
118
|
case "JOB":
|
|
127
|
-
return {
|
|
128
|
-
category: SearchCategory.JOB,
|
|
119
|
+
return new JobSearchResult({
|
|
129
120
|
error: searchResult.jobObject.error,
|
|
130
121
|
finishTime: new Date(searchResult.jobObject.finishTime),
|
|
131
122
|
id: searchResult.jobObject.id,
|
|
@@ -138,7 +129,7 @@ export const mapSearchResult = (_catalogReferenceFromEntity) => (searchResult) =
|
|
|
138
129
|
startTime: new Date(searchResult.jobObject.startTime),
|
|
139
130
|
state: searchResult.jobObject.jobState,
|
|
140
131
|
user: searchResult.jobObject.user,
|
|
141
|
-
};
|
|
132
|
+
});
|
|
142
133
|
}
|
|
143
134
|
};
|
|
144
135
|
const transformSearchTypeToCatalog = (type) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapSearchResult.js","sourceRoot":"","sources":["../../../../src/enterprise/catalog/catalogSearch/mapSearchResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAWjD,OAAO,EACL,cAAc,GAUf,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,2BAA4E,EAAE,EAAE,CACjF,CAAC,YAAkD,EAAE,EAAE;IACrD,QAAQ,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC9B,KAAK,QAAQ;YACX,OAAO;gBACL,gBAAgB,EAAE,2BAA2B,CAAC;oBAC5C,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,IAAI;oBACrC,IAAI,EAAE,4BAA4B,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC;iBACpE,CAAqC;gBACtC,QAAQ,EAAE,cAAc,CAAC,MAAM;gBAC/B,KAAK,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK;gBACxC,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI;aACR,CAAC;QAC1C,KAAK,QAAQ;YACX,OAAO;gBACL,QAAQ,EAAE,cAAc,CAAC,MAAM;gBAC/B,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,OAAO;gBAC1C,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC;gBACxD,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC,EAAE;gBAChC,cAAc,EAAE,IAAI,IA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cesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Query } from \"../../../common/Query.ts\";\nimport type { Job } from \"../../interfaces.ts\";\nimport type {\n EnterpriseCatalogReference,\n EnterpriseDatasetCatalogReference,\n EnterpriseFolderCatalogReference,\n EnterpriseFunctionCatalogReference,\n EnterpriseSourceCatalogReference,\n EnterpriseSpaceCatalogReference,\n} from \"../CatalogReferences/index.ts\";\nimport type { SearchApiResponse } from \"./SearchApiResponse.ts\";\nimport {\n SearchCategory,\n type FolderSearchResult,\n type FunctionSearchResult,\n type JobSearchResult,\n type ReflectionSearchResult,\n type ScriptSearchResult,\n type SourceSearchResult,\n type SpaceSearchResult,\n type TableSearchResult,\n type ViewSearchResult,\n} from \"./SearchResult.ts\";\n\nexport const mapSearchResult =\n (_catalogReferenceFromEntity: (entity: unknown) => EnterpriseCatalogReference) =>\n (searchResult: SearchApiResponse[\"results\"][number]) => {\n switch (searchResult.category) {\n case \"FOLDER\":\n return {\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseFolderCatalogReference,\n category: SearchCategory.FOLDER,\n owner: searchResult.catalogObject?.owner,\n wiki: searchResult.catalogObject.wiki || null,\n } as const satisfies FolderSearchResult;\n case \"SCRIPT\":\n return {\n category: SearchCategory.SCRIPT,\n content: searchResult.scriptObject.content,\n createdAt: new Date(searchResult.scriptObject.createdAt),\n id: searchResult.scriptObject.id,\n lastModifiedAt: new Date(searchResult.scriptObject.modifiedAt),\n name: searchResult.scriptObject.name,\n owner: searchResult.scriptObject.owner,\n } as const satisfies ScriptSearchResult;\n case \"REFLECTION\":\n return {\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.reflectionObject.datasetPath,\n type: transformSearchTypeToCatalog(\n searchResult.reflectionObject.datasetType.toUpperCase(),\n ),\n }) as EnterpriseDatasetCatalogReference,\n category: SearchCategory.REFLECTION,\n createdAt: new Date(searchResult.reflectionObject.createdAt),\n id: searchResult.reflectionObject.id,\n lastModifiedAt: new Date(searchResult.reflectionObject.modifiedAt),\n name: searchResult.reflectionObject.name,\n } as const satisfies ReflectionSearchResult;\n case \"SOURCE\":\n return {\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseSourceCatalogReference,\n category: SearchCategory.SOURCE,\n createdAt: new Date(searchResult.catalogObject.createdAt),\n owner: searchResult.catalogObject.owner,\n } as const satisfies SourceSearchResult;\n case \"SPACE\":\n return {\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseSpaceCatalogReference,\n category: SearchCategory.SPACE,\n createdAt: searchResult.catalogObject.createdAt\n ? new Date(searchResult.catalogObject.createdAt)\n : null,\n lastModifiedAt: searchResult.catalogObject.modifiedAt\n ? new Date(searchResult.catalogObject.modifiedAt)\n : null,\n owner: searchResult.catalogObject.owner,\n wiki: searchResult.catalogObject.wiki || null,\n } as const satisfies SpaceSearchResult;\n case \"TABLE\":\n return {\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseDatasetCatalogReference,\n category: SearchCategory.TABLE,\n columns: searchResult.catalogObject.columns,\n createdAt: searchResult.catalogObject.createdAt\n ? new Date(searchResult.catalogObject.createdAt)\n : null,\n labels: searchResult.catalogObject.labels,\n lastModifiedAt: searchResult.catalogObject.modifiedAt\n ? new Date(searchResult.catalogObject.modifiedAt)\n : null,\n owner: searchResult.catalogObject.owner,\n wiki: searchResult.catalogObject.wiki || null,\n } as const satisfies TableSearchResult;\n case \"UDF\":\n return {\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseFunctionCatalogReference,\n category: SearchCategory.FUNCTION,\n createdAt: new Date(searchResult.catalogObject.createdAt),\n functionSql: searchResult.catalogObject.functionSql,\n lastModifiedAt: new Date(searchResult.catalogObject.modifiedAt),\n owner: searchResult.catalogObject.owner,\n } as const satisfies FunctionSearchResult;\n case \"VIEW\":\n return {\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseDatasetCatalogReference,\n category: SearchCategory.VIEW,\n columns: searchResult.catalogObject.columns,\n createdAt: searchResult.catalogObject.createdAt\n ? new Date(searchResult.catalogObject.createdAt)\n : null,\n labels: searchResult.catalogObject.labels,\n lastModifiedAt: searchResult.catalogObject.modifiedAt\n ? new Date(searchResult.catalogObject.modifiedAt)\n : null,\n owner: searchResult.catalogObject.owner,\n wiki: searchResult.catalogObject.wiki || null,\n } as const satisfies ViewSearchResult;\n case \"JOB\":\n return {\n category: SearchCategory.JOB,\n error: searchResult.jobObject.error,\n finishTime: new Date(searchResult.jobObject.finishTime),\n id: searchResult.jobObject.id,\n queriedDatasets: searchResult.jobObject.queriedDatasets.map(\n (dataset) =>\n _catalogReferenceFromEntity({\n path: dataset.datasetPath,\n type: transformSearchTypeToCatalog(dataset.datasetType),\n }) as EnterpriseDatasetCatalogReference,\n ),\n queryType: searchResult.jobObject.jobType as Job[\"queryType\"],\n sql: new Query(searchResult.jobObject.sql),\n startTime: new Date(searchResult.jobObject.startTime),\n state: searchResult.jobObject.jobState as Job[\"state\"],\n user: searchResult.jobObject.user as any,\n } as const satisfies JobSearchResult;\n }\n };\n\nconst transformSearchTypeToCatalog = (type: string): EnterpriseCatalogReference[\"type\"] => {\n switch (type) {\n case \"TABLE\":\n return \"DATASET_DIRECT\";\n case \"VIEW\":\n return \"DATASET_VIRTUAL\";\n case \"FOLDER\":\n return \"FOLDER\";\n case \"FUNCTION\":\n return \"FUNCTION\";\n case \"SPACE\":\n return \"SPACE\";\n case \"SOURCE\":\n return \"SOURCE\";\n default:\n return \"FILE\";\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"mapSearchResult.js","sourceRoot":"","sources":["../../../../src/enterprise/catalog/catalogSearch/mapSearchResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAWjD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,2BAA4E,EAAE,EAAE,CACjF,CAAC,YAAkD,EAAE,EAAE;IACrD,QAAQ,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC9B,KAAK,QAAQ;YACX,OAAO,IAAI,kBAAkB,CAAC;gBAC5B,gBAAgB,EAAE,2BAA2B,CAAC;oBAC5C,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,IAAI;oBACrC,IAAI,EAAE,4BAA4B,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC;iBACpE,CAAqC;gBACtC,KAAK,EAAE,YAAY,CAAC,aAAa,EAAE,KAAK;gBACxC,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI;aAC9C,CAAC,CAAC;QACL,KAAK,QAAQ;YACX,OAAO,IAAI,kBAAkB,CAAC;gBAC5B,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,OAA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OAAO,QAAQ,CAAC;QAClB;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Query } from \"../../../common/Query.ts\";\nimport type { Job } from \"../../interfaces.ts\";\nimport type {\n EnterpriseCatalogReference,\n EnterpriseDatasetCatalogReference,\n EnterpriseFolderCatalogReference,\n EnterpriseFunctionCatalogReference,\n EnterpriseSourceCatalogReference,\n EnterpriseSpaceCatalogReference,\n} from \"../CatalogReferences/index.ts\";\nimport type { SearchApiResponse } from \"./SearchApiResponse.ts\";\nimport {\n FolderSearchResult,\n FunctionSearchResult,\n JobSearchResult,\n ReflectionSearchResult,\n ScriptSearchResult,\n SourceSearchResult,\n SpaceSearchResult,\n TableSearchResult,\n ViewSearchResult,\n} from \"./CatalogSearchResult.ts\";\n\nexport const mapSearchResult =\n (_catalogReferenceFromEntity: (entity: unknown) => EnterpriseCatalogReference) =>\n (searchResult: SearchApiResponse[\"results\"][number]) => {\n switch (searchResult.category) {\n case \"FOLDER\":\n return new FolderSearchResult({\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseFolderCatalogReference,\n owner: searchResult.catalogObject?.owner,\n wiki: searchResult.catalogObject.wiki || null,\n });\n case \"SCRIPT\":\n return new ScriptSearchResult({\n content: searchResult.scriptObject.content,\n createdAt: new Date(searchResult.scriptObject.createdAt),\n id: searchResult.scriptObject.id,\n lastModifiedAt: new Date(searchResult.scriptObject.modifiedAt),\n name: searchResult.scriptObject.name,\n owner: searchResult.scriptObject.owner,\n });\n case \"REFLECTION\":\n return new ReflectionSearchResult({\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.reflectionObject.datasetPath,\n type: transformSearchTypeToCatalog(\n searchResult.reflectionObject.datasetType.toUpperCase(),\n ),\n }) as EnterpriseDatasetCatalogReference,\n createdAt: new Date(searchResult.reflectionObject.createdAt),\n id: searchResult.reflectionObject.id,\n lastModifiedAt: new Date(searchResult.reflectionObject.modifiedAt),\n name: searchResult.reflectionObject.name,\n });\n case \"SOURCE\":\n return new SourceSearchResult({\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseSourceCatalogReference,\n createdAt: new Date(searchResult.catalogObject.createdAt),\n owner: searchResult.catalogObject.owner,\n });\n case \"SPACE\":\n return new SpaceSearchResult({\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseSpaceCatalogReference,\n createdAt: searchResult.catalogObject.createdAt\n ? new Date(searchResult.catalogObject.createdAt)\n : null,\n lastModifiedAt: searchResult.catalogObject.modifiedAt\n ? new Date(searchResult.catalogObject.modifiedAt)\n : null,\n owner: searchResult.catalogObject.owner,\n wiki: searchResult.catalogObject.wiki || null,\n });\n case \"TABLE\":\n return new TableSearchResult({\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseDatasetCatalogReference,\n columns: searchResult.catalogObject.columns,\n createdAt: searchResult.catalogObject.createdAt\n ? new Date(searchResult.catalogObject.createdAt)\n : null,\n labels: searchResult.catalogObject.labels,\n lastModifiedAt: searchResult.catalogObject.modifiedAt\n ? new Date(searchResult.catalogObject.modifiedAt)\n : null,\n owner: searchResult.catalogObject.owner,\n wiki: searchResult.catalogObject.wiki || null,\n });\n case \"UDF\":\n return new FunctionSearchResult({\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseFunctionCatalogReference,\n createdAt: new Date(searchResult.catalogObject.createdAt),\n functionSql: searchResult.catalogObject.functionSql,\n lastModifiedAt: new Date(searchResult.catalogObject.modifiedAt),\n owner: searchResult.catalogObject.owner,\n });\n case \"VIEW\":\n return new ViewSearchResult({\n catalogReference: _catalogReferenceFromEntity({\n path: searchResult.catalogObject.path,\n type: transformSearchTypeToCatalog(searchResult.catalogObject.type),\n }) as EnterpriseDatasetCatalogReference,\n columns: searchResult.catalogObject.columns,\n createdAt: searchResult.catalogObject.createdAt\n ? new Date(searchResult.catalogObject.createdAt)\n : null,\n labels: searchResult.catalogObject.labels,\n lastModifiedAt: searchResult.catalogObject.modifiedAt\n ? new Date(searchResult.catalogObject.modifiedAt)\n : null,\n owner: searchResult.catalogObject.owner,\n wiki: searchResult.catalogObject.wiki || null,\n });\n case \"JOB\":\n return new JobSearchResult({\n error: searchResult.jobObject.error,\n finishTime: new Date(searchResult.jobObject.finishTime),\n id: searchResult.jobObject.id,\n queriedDatasets: searchResult.jobObject.queriedDatasets.map(\n (dataset) =>\n _catalogReferenceFromEntity({\n path: dataset.datasetPath,\n type: transformSearchTypeToCatalog(dataset.datasetType),\n }) as EnterpriseDatasetCatalogReference,\n ),\n queryType: searchResult.jobObject.jobType as Job[\"queryType\"],\n sql: new Query(searchResult.jobObject.sql),\n startTime: new Date(searchResult.jobObject.startTime),\n state: searchResult.jobObject.jobState as Job[\"state\"],\n user: searchResult.jobObject.user,\n });\n }\n };\n\nconst transformSearchTypeToCatalog = (type: string): EnterpriseCatalogReference[\"type\"] => {\n switch (type) {\n case \"TABLE\":\n return \"DATASET_DIRECT\";\n case \"VIEW\":\n return \"DATASET_VIRTUAL\";\n case \"FOLDER\":\n return \"FOLDER\";\n case \"FUNCTION\":\n return \"FUNCTION\";\n case \"SPACE\":\n return \"SPACE\";\n case \"SOURCE\":\n return \"SOURCE\";\n default:\n return \"FILE\";\n }\n};\n"]}
|
|
@@ -13,3 +13,4 @@ export * from "./catalog/CatalogReferences/index.ts";
|
|
|
13
13
|
export * from "./Ownable.ts";
|
|
14
14
|
export * from "./Grantee.ts";
|
|
15
15
|
export type { Engine, EnterpriseCatalogObject, EnterpriseCatalogReference, EnterpriseScript, EnterpriseUser, Job, JobResultsSchema, Reflection, ReflectionSummary, Role, BranchHeadVersionReference, BareCommitVersionReference, TagVersionReference, VersionReference, };
|
|
16
|
+
export * from "./catalog/catalogSearch/CatalogSearchResult.ts";
|
|
@@ -17,4 +17,5 @@ export * from "./catalog/CatalogObjects/index.js";
|
|
|
17
17
|
export * from "./catalog/CatalogReferences/index.js";
|
|
18
18
|
export * from "./Ownable.js";
|
|
19
19
|
export * from "./Grantee.js";
|
|
20
|
+
export * from "./catalog/catalogSearch/CatalogSearchResult.js";
|
|
20
21
|
//# sourceMappingURL=interfaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/enterprise/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Engine } from \"./engines/Engine.ts\";\nimport type { Job, Reflection } from \"../oss/interfaces.ts\";\nimport type { EnterpriseCatalogObject } from \"./catalog/CatalogObjects/index.ts\";\nimport type { EnterpriseCatalogReference } from \"./catalog/CatalogReferences/index.ts\";\nimport type { EnterpriseScript } from \"./scripts/EnterpriseScript.ts\";\nimport type { EnterpriseUser } from \"./users/EnterpriseUser.ts\";\nimport type { ReflectionSummary } from \"./reflections/ReflectionSummary.ts\";\nimport type { Role } from \"./roles/Role.ts\";\nimport type {\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n} from \"../oss/catalog/VersionReference.ts\";\nimport type { JobResultsSchema } from \"../oss/jobs/utils/JobResultsResponse.ts\";\nexport * from \"./catalog/CatalogObjects/index.ts\";\nexport * from \"./catalog/CatalogReferences/index.ts\";\nexport * from \"./Ownable.ts\";\nexport * from \"./Grantee.ts\";\nexport type {\n Engine,\n EnterpriseCatalogObject,\n EnterpriseCatalogReference,\n EnterpriseScript,\n EnterpriseUser,\n Job,\n JobResultsSchema,\n Reflection,\n ReflectionSummary,\n Role,\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/enterprise/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAiB7B,cAAc,gDAAgD,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Engine } from \"./engines/Engine.ts\";\nimport type { Job, Reflection } from \"../oss/interfaces.ts\";\nimport type { EnterpriseCatalogObject } from \"./catalog/CatalogObjects/index.ts\";\nimport type { EnterpriseCatalogReference } from \"./catalog/CatalogReferences/index.ts\";\nimport type { EnterpriseScript } from \"./scripts/EnterpriseScript.ts\";\nimport type { EnterpriseUser } from \"./users/EnterpriseUser.ts\";\nimport type { ReflectionSummary } from \"./reflections/ReflectionSummary.ts\";\nimport type { Role } from \"./roles/Role.ts\";\nimport type {\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n} from \"../oss/catalog/VersionReference.ts\";\nimport type { JobResultsSchema } from \"../oss/jobs/utils/JobResultsResponse.ts\";\nexport * from \"./catalog/CatalogObjects/index.ts\";\nexport * from \"./catalog/CatalogReferences/index.ts\";\nexport * from \"./Ownable.ts\";\nexport * from \"./Grantee.ts\";\nexport type {\n Engine,\n EnterpriseCatalogObject,\n EnterpriseCatalogReference,\n EnterpriseScript,\n EnterpriseUser,\n Job,\n JobResultsSchema,\n Reflection,\n ReflectionSummary,\n Role,\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n};\nexport * from \"./catalog/catalogSearch/CatalogSearchResult.ts\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type { Query } from "../../../common/Query.ts";
|
|
2
|
-
import type { EnterpriseDatasetCatalogReference, EnterpriseFolderCatalogReference, EnterpriseFunctionCatalogReference, EnterpriseSourceCatalogReference, EnterpriseSpaceCatalogReference, Job } from "../../interfaces.ts";
|
|
3
|
-
export type FolderSearchResult = {
|
|
4
|
-
category: typeof SearchCategory.FOLDER;
|
|
5
|
-
catalogReference: EnterpriseFolderCatalogReference;
|
|
6
|
-
owner?: {
|
|
7
|
-
id: string;
|
|
8
|
-
type: "USER" | "ROLE";
|
|
9
|
-
username: string;
|
|
10
|
-
};
|
|
11
|
-
wiki: string | null;
|
|
12
|
-
};
|
|
13
|
-
export type ReflectionSearchResult = {
|
|
14
|
-
category: typeof SearchCategory.REFLECTION;
|
|
15
|
-
createdAt: Date;
|
|
16
|
-
id: string;
|
|
17
|
-
lastModifiedAt: Date;
|
|
18
|
-
name: string;
|
|
19
|
-
catalogReference: EnterpriseDatasetCatalogReference;
|
|
20
|
-
};
|
|
21
|
-
export type SourceSearchResult = {
|
|
22
|
-
category: typeof SearchCategory.SOURCE;
|
|
23
|
-
catalogReference: EnterpriseSourceCatalogReference;
|
|
24
|
-
createdAt: Date;
|
|
25
|
-
owner?: {
|
|
26
|
-
id: string;
|
|
27
|
-
type: "USER" | "ROLE";
|
|
28
|
-
username: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export type SpaceSearchResult = {
|
|
32
|
-
category: typeof SearchCategory.SPACE;
|
|
33
|
-
catalogReference: EnterpriseSpaceCatalogReference;
|
|
34
|
-
createdAt: Date | null;
|
|
35
|
-
lastModifiedAt: Date | null;
|
|
36
|
-
owner: {
|
|
37
|
-
id: string;
|
|
38
|
-
type: "USER" | "ROLE";
|
|
39
|
-
username: string;
|
|
40
|
-
};
|
|
41
|
-
wiki: string | null;
|
|
42
|
-
};
|
|
43
|
-
export type TableSearchResult = {
|
|
44
|
-
columns: string[];
|
|
45
|
-
category: typeof SearchCategory.TABLE;
|
|
46
|
-
catalogReference: EnterpriseDatasetCatalogReference;
|
|
47
|
-
createdAt: Date | null;
|
|
48
|
-
labels: string[];
|
|
49
|
-
lastModifiedAt: Date | null;
|
|
50
|
-
owner?: {
|
|
51
|
-
id: string;
|
|
52
|
-
type: "USER" | "ROLE";
|
|
53
|
-
username: string;
|
|
54
|
-
};
|
|
55
|
-
wiki: string | null;
|
|
56
|
-
};
|
|
57
|
-
export type ViewSearchResult = {
|
|
58
|
-
columns: string[];
|
|
59
|
-
category: typeof SearchCategory.VIEW;
|
|
60
|
-
catalogReference: EnterpriseDatasetCatalogReference;
|
|
61
|
-
createdAt: Date | null;
|
|
62
|
-
labels: string[];
|
|
63
|
-
lastModifiedAt: Date | null;
|
|
64
|
-
owner: {
|
|
65
|
-
id: string;
|
|
66
|
-
type: "USER" | "ROLE";
|
|
67
|
-
username: string;
|
|
68
|
-
};
|
|
69
|
-
wiki: string | null;
|
|
70
|
-
};
|
|
71
|
-
export type FunctionSearchResult = {
|
|
72
|
-
category: typeof SearchCategory.FUNCTION;
|
|
73
|
-
catalogReference: EnterpriseFunctionCatalogReference;
|
|
74
|
-
createdAt: Date;
|
|
75
|
-
lastModifiedAt: Date;
|
|
76
|
-
owner: {
|
|
77
|
-
id: string;
|
|
78
|
-
type: "USER" | "ROLE";
|
|
79
|
-
username: string;
|
|
80
|
-
};
|
|
81
|
-
functionSql: string;
|
|
82
|
-
};
|
|
83
|
-
export type ScriptSearchResult = {
|
|
84
|
-
category: typeof SearchCategory.SCRIPT;
|
|
85
|
-
content: string;
|
|
86
|
-
createdAt: Date;
|
|
87
|
-
id: string;
|
|
88
|
-
lastModifiedAt: Date;
|
|
89
|
-
name: string;
|
|
90
|
-
owner: {
|
|
91
|
-
id: string;
|
|
92
|
-
type: "USER" | "ROLE";
|
|
93
|
-
username: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
export type JobSearchResult = {
|
|
97
|
-
category: typeof SearchCategory.JOB;
|
|
98
|
-
id: string;
|
|
99
|
-
queriedDatasets: EnterpriseDatasetCatalogReference[];
|
|
100
|
-
sql: Query;
|
|
101
|
-
queryType: Job["queryType"];
|
|
102
|
-
user: {
|
|
103
|
-
id: string;
|
|
104
|
-
type: "USER";
|
|
105
|
-
username: string;
|
|
106
|
-
};
|
|
107
|
-
startTime: Date;
|
|
108
|
-
finishTime: Date;
|
|
109
|
-
state: Job["state"];
|
|
110
|
-
error?: string;
|
|
111
|
-
};
|
|
112
|
-
export declare const SearchCategory: {
|
|
113
|
-
readonly FOLDER: "FOLDER";
|
|
114
|
-
readonly FUNCTION: "FUNCTION";
|
|
115
|
-
readonly JOB: "JOB";
|
|
116
|
-
readonly REFLECTION: "REFLECTION";
|
|
117
|
-
readonly SCRIPT: "SCRIPT";
|
|
118
|
-
readonly SOURCE: "SOURCE";
|
|
119
|
-
readonly SPACE: "SPACE";
|
|
120
|
-
readonly TABLE: "TABLE";
|
|
121
|
-
readonly VIEW: "VIEW";
|
|
122
|
-
};
|
|
123
|
-
export type SearchCategoryType = (typeof SearchCategory)[keyof typeof SearchCategory];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2024-2025 Dremio Corporation
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export const SearchCategory = {
|
|
17
|
-
FOLDER: "FOLDER",
|
|
18
|
-
FUNCTION: "FUNCTION",
|
|
19
|
-
JOB: "JOB",
|
|
20
|
-
REFLECTION: "REFLECTION",
|
|
21
|
-
SCRIPT: "SCRIPT",
|
|
22
|
-
SOURCE: "SOURCE",
|
|
23
|
-
SPACE: "SPACE",
|
|
24
|
-
TABLE: "TABLE",
|
|
25
|
-
VIEW: "VIEW",
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=SearchResult.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResult.js","sourceRoot":"","sources":["../../../../src/enterprise/catalog/catalogSearch/SearchResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkGH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Query } from \"../../../common/Query.ts\";\nimport type {\n EnterpriseDatasetCatalogReference,\n EnterpriseFolderCatalogReference,\n EnterpriseFunctionCatalogReference,\n EnterpriseSourceCatalogReference,\n EnterpriseSpaceCatalogReference,\n Job,\n} from \"../../interfaces.ts\";\n\nexport type FolderSearchResult = {\n category: typeof SearchCategory.FOLDER;\n catalogReference: EnterpriseFolderCatalogReference;\n owner?: { id: string; type: \"USER\" | \"ROLE\"; username: string };\n wiki: string | null;\n};\n\nexport type ReflectionSearchResult = {\n category: typeof SearchCategory.REFLECTION;\n createdAt: Date;\n id: string;\n lastModifiedAt: Date;\n name: string;\n catalogReference: EnterpriseDatasetCatalogReference;\n};\n\nexport type SourceSearchResult = {\n category: typeof SearchCategory.SOURCE;\n catalogReference: EnterpriseSourceCatalogReference;\n createdAt: Date;\n owner?: { id: string; type: \"USER\" | \"ROLE\"; username: string };\n};\n\nexport type SpaceSearchResult = {\n category: typeof SearchCategory.SPACE;\n catalogReference: EnterpriseSpaceCatalogReference;\n createdAt: Date | null;\n lastModifiedAt: Date | null;\n owner: { id: string; type: \"USER\" | \"ROLE\"; username: string };\n wiki: string | null;\n};\n\nexport type TableSearchResult = {\n columns: string[];\n category: typeof SearchCategory.TABLE;\n catalogReference: EnterpriseDatasetCatalogReference;\n createdAt: Date | null;\n labels: string[];\n lastModifiedAt: Date | null;\n owner?: { id: string; type: \"USER\" | \"ROLE\"; username: string };\n wiki: string | null;\n};\n\nexport type ViewSearchResult = {\n columns: string[];\n category: typeof SearchCategory.VIEW;\n catalogReference: EnterpriseDatasetCatalogReference;\n createdAt: Date | null;\n labels: string[];\n lastModifiedAt: Date | null;\n owner: { id: string; type: \"USER\" | \"ROLE\"; username: string };\n wiki: string | null;\n};\n\nexport type FunctionSearchResult = {\n category: typeof SearchCategory.FUNCTION;\n catalogReference: EnterpriseFunctionCatalogReference;\n createdAt: Date;\n lastModifiedAt: Date;\n owner: { id: string; type: \"USER\" | \"ROLE\"; username: string };\n functionSql: string;\n};\n\nexport type ScriptSearchResult = {\n category: typeof SearchCategory.SCRIPT;\n content: string;\n createdAt: Date;\n id: string;\n lastModifiedAt: Date;\n name: string;\n owner: { id: string; type: \"USER\" | \"ROLE\"; username: string };\n};\n\nexport type JobSearchResult = {\n category: typeof SearchCategory.JOB;\n id: string;\n queriedDatasets: EnterpriseDatasetCatalogReference[];\n sql: Query;\n queryType: Job[\"queryType\"];\n user: { id: string; type: \"USER\"; username: string };\n startTime: Date;\n finishTime: Date;\n state: Job[\"state\"];\n error?: string;\n};\n\nexport const SearchCategory = {\n FOLDER: \"FOLDER\",\n FUNCTION: \"FUNCTION\",\n JOB: \"JOB\",\n REFLECTION: \"REFLECTION\",\n SCRIPT: \"SCRIPT\",\n SOURCE: \"SOURCE\",\n SPACE: \"SPACE\",\n TABLE: \"TABLE\",\n VIEW: \"VIEW\",\n} as const;\n\nexport type SearchCategoryType = (typeof SearchCategory)[keyof typeof SearchCategory];\n"]}
|