@okf/ootils 1.27.0 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.mts +106 -8
- package/dist/browser.d.ts +106 -8
- package/dist/browser.js +294 -11
- package/dist/browser.mjs +291 -10
- package/dist/node.d.mts +106 -8
- package/dist/node.d.ts +106 -8
- package/dist/node.js +294 -11
- package/dist/node.mjs +291 -10
- package/dist/universal.d.mts +106 -8
- package/dist/universal.d.ts +106 -8
- package/dist/universal.js +294 -11
- package/dist/universal.mjs +291 -10
- package/package.json +1 -1
package/dist/browser.d.mts
CHANGED
|
@@ -1020,6 +1020,51 @@ declare const _self_managed_buildAnnoHierarchyConfig: ({ annotationTagsCount, }:
|
|
|
1020
1020
|
};
|
|
1021
1021
|
} | null;
|
|
1022
1022
|
|
|
1023
|
+
/**
|
|
1024
|
+
* Builds a consolidated docHierarchyType config for self-managed tenants.
|
|
1025
|
+
*
|
|
1026
|
+
* Produces a single filter config that contains:
|
|
1027
|
+
* - commonFilters: filters present in ALL selected templates
|
|
1028
|
+
* - sharedAcrossMultiple: groups of filters shared by 2+ (but not all) templates
|
|
1029
|
+
* - perDataset: each template's complete filter list + rollup configs
|
|
1030
|
+
* - commonDocumentFilters: Author, Published Date, etc.
|
|
1031
|
+
*
|
|
1032
|
+
* This is consumed by DocHierarchyFilter on the frontend to render the
|
|
1033
|
+
* drilldown-based document filter UI.
|
|
1034
|
+
*/
|
|
1035
|
+
declare const _self_managed_buildDocHierarchyConfig: ({ combinedDocumentBlocks, docRollupBlocks, selectedTpls, allTpls, commonDocumentFilters, flatDocFilters, }: {
|
|
1036
|
+
combinedDocumentBlocks: any[];
|
|
1037
|
+
docRollupBlocks: any[];
|
|
1038
|
+
selectedTpls: any[];
|
|
1039
|
+
allTpls: any[];
|
|
1040
|
+
commonDocumentFilters: any[];
|
|
1041
|
+
flatDocFilters?: boolean;
|
|
1042
|
+
}) => {
|
|
1043
|
+
filterId: string;
|
|
1044
|
+
display: string;
|
|
1045
|
+
filterKey: string;
|
|
1046
|
+
source: {
|
|
1047
|
+
filterType: string;
|
|
1048
|
+
flatDocFilters: boolean;
|
|
1049
|
+
commonFilters: any[];
|
|
1050
|
+
sharedAcrossMultiple: {
|
|
1051
|
+
contentTypes: any;
|
|
1052
|
+
display: any;
|
|
1053
|
+
filters: any[];
|
|
1054
|
+
}[];
|
|
1055
|
+
commonDocumentFilters: any[];
|
|
1056
|
+
perDataset: {
|
|
1057
|
+
contentType: any;
|
|
1058
|
+
display: any;
|
|
1059
|
+
filters: any[];
|
|
1060
|
+
rollups: any[];
|
|
1061
|
+
}[];
|
|
1062
|
+
};
|
|
1063
|
+
target: {
|
|
1064
|
+
filterType: string;
|
|
1065
|
+
};
|
|
1066
|
+
} | null;
|
|
1067
|
+
|
|
1023
1068
|
/**
|
|
1024
1069
|
* TEMP_removeDuplicateFilters - Removes duplicate rollup and tag-type filters
|
|
1025
1070
|
*
|
|
@@ -1114,6 +1159,37 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
|
|
|
1114
1159
|
sectionId: string;
|
|
1115
1160
|
configs: any[];
|
|
1116
1161
|
}[];
|
|
1162
|
+
} | {
|
|
1163
|
+
sectionId: string;
|
|
1164
|
+
configs: {
|
|
1165
|
+
sectionId: string;
|
|
1166
|
+
configs: {
|
|
1167
|
+
filterId: string;
|
|
1168
|
+
display: string;
|
|
1169
|
+
filterKey: string;
|
|
1170
|
+
source: {
|
|
1171
|
+
filterType: string;
|
|
1172
|
+
flatDocFilters: boolean;
|
|
1173
|
+
commonFilters: any[];
|
|
1174
|
+
sharedAcrossMultiple: {
|
|
1175
|
+
contentTypes: any;
|
|
1176
|
+
display: any;
|
|
1177
|
+
filters: any[];
|
|
1178
|
+
}[];
|
|
1179
|
+
commonDocumentFilters: any[];
|
|
1180
|
+
perDataset: {
|
|
1181
|
+
contentType: any;
|
|
1182
|
+
display: any;
|
|
1183
|
+
filters: any[];
|
|
1184
|
+
rollups: any[];
|
|
1185
|
+
}[];
|
|
1186
|
+
};
|
|
1187
|
+
target: {
|
|
1188
|
+
filterType: string;
|
|
1189
|
+
};
|
|
1190
|
+
}[];
|
|
1191
|
+
}[];
|
|
1192
|
+
sectionTitle?: undefined;
|
|
1117
1193
|
} | {
|
|
1118
1194
|
sectionId: string;
|
|
1119
1195
|
sectionTitle: string;
|
|
@@ -1184,11 +1260,30 @@ declare const UI_CONTENT: {
|
|
|
1184
1260
|
};
|
|
1185
1261
|
};
|
|
1186
1262
|
|
|
1187
|
-
|
|
1263
|
+
interface GenCleanCamelCaseIdOptions {
|
|
1264
|
+
/** Strip all non-alphanumeric chars (A-Z, a-z, 0-9 only). Default: false */
|
|
1265
|
+
stripNonAlphanumeric?: boolean;
|
|
1266
|
+
/** Truncate result to this max length. Default: no limit */
|
|
1267
|
+
maxLength?: number;
|
|
1268
|
+
}
|
|
1269
|
+
declare const genCleanCamelCaseId: (id: string, options?: GenCleanCamelCaseIdOptions) => string;
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Generates a clean, deterministic contentType ID from text.
|
|
1273
|
+
* Wraps genCleanCamelCaseId with stripNonAlphanumeric + maxLength 40.
|
|
1274
|
+
*
|
|
1275
|
+
* Idempotent: running twice produces the same output.
|
|
1276
|
+
*
|
|
1277
|
+
* @example
|
|
1278
|
+
* genCleanContentTypeId("My Articles!") => "myArticles"
|
|
1279
|
+
* genCleanContentTypeId("myArticles") => "myArticles" (idempotent)
|
|
1280
|
+
* genCleanContentTypeId("123 Test") => "a123Test"
|
|
1281
|
+
*/
|
|
1282
|
+
declare const genCleanContentTypeId: (text: string) => string;
|
|
1188
1283
|
|
|
1189
1284
|
/**
|
|
1190
1285
|
* Generates a clean, short, unique ID from text input.
|
|
1191
|
-
* Used for
|
|
1286
|
+
* Used for block valuePaths in templates.
|
|
1192
1287
|
*
|
|
1193
1288
|
* 1. Strips all characters except A-Z, a-z, 0-9
|
|
1194
1289
|
* 2. Lowercases the result
|
|
@@ -1196,15 +1291,18 @@ declare const genCleanCamelCaseId: (id: string) => string;
|
|
|
1196
1291
|
* 4. Truncates to maxLength (default 10)
|
|
1197
1292
|
* 5. Appends _{random id} (default 4 chars)
|
|
1198
1293
|
*
|
|
1294
|
+
* Idempotent: if input already matches the output pattern
|
|
1295
|
+
* (lowercase alphanumeric + _hash suffix), returns as-is.
|
|
1296
|
+
*
|
|
1199
1297
|
* @param text - The input text to convert
|
|
1200
|
-
* @param maxLength - Max characters before the random suffix (default 10
|
|
1298
|
+
* @param maxLength - Max characters before the random suffix (default 10)
|
|
1201
1299
|
* @param shortIdLength - Length of the random suffix (default 4)
|
|
1202
1300
|
*
|
|
1203
1301
|
* @example
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1206
|
-
*
|
|
1302
|
+
* genCleanValuePath("Author Name") => "authorname_x7k2"
|
|
1303
|
+
* genCleanValuePath("authorname_x7k2") => "authorname_x7k2" (idempotent)
|
|
1304
|
+
* genCleanValuePath("123 Test") => "a123test_ab4d"
|
|
1207
1305
|
*/
|
|
1208
|
-
declare const
|
|
1306
|
+
declare const genCleanValuePath: (text: string) => string;
|
|
1209
1307
|
|
|
1210
|
-
export { BASE_BULLMQ_CONFIG, FILTER_IDS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId,
|
|
1308
|
+
export { BASE_BULLMQ_CONFIG, FILTER_IDS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genCleanContentTypeId, genCleanValuePath, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToPublishedContent, getVal, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1020,6 +1020,51 @@ declare const _self_managed_buildAnnoHierarchyConfig: ({ annotationTagsCount, }:
|
|
|
1020
1020
|
};
|
|
1021
1021
|
} | null;
|
|
1022
1022
|
|
|
1023
|
+
/**
|
|
1024
|
+
* Builds a consolidated docHierarchyType config for self-managed tenants.
|
|
1025
|
+
*
|
|
1026
|
+
* Produces a single filter config that contains:
|
|
1027
|
+
* - commonFilters: filters present in ALL selected templates
|
|
1028
|
+
* - sharedAcrossMultiple: groups of filters shared by 2+ (but not all) templates
|
|
1029
|
+
* - perDataset: each template's complete filter list + rollup configs
|
|
1030
|
+
* - commonDocumentFilters: Author, Published Date, etc.
|
|
1031
|
+
*
|
|
1032
|
+
* This is consumed by DocHierarchyFilter on the frontend to render the
|
|
1033
|
+
* drilldown-based document filter UI.
|
|
1034
|
+
*/
|
|
1035
|
+
declare const _self_managed_buildDocHierarchyConfig: ({ combinedDocumentBlocks, docRollupBlocks, selectedTpls, allTpls, commonDocumentFilters, flatDocFilters, }: {
|
|
1036
|
+
combinedDocumentBlocks: any[];
|
|
1037
|
+
docRollupBlocks: any[];
|
|
1038
|
+
selectedTpls: any[];
|
|
1039
|
+
allTpls: any[];
|
|
1040
|
+
commonDocumentFilters: any[];
|
|
1041
|
+
flatDocFilters?: boolean;
|
|
1042
|
+
}) => {
|
|
1043
|
+
filterId: string;
|
|
1044
|
+
display: string;
|
|
1045
|
+
filterKey: string;
|
|
1046
|
+
source: {
|
|
1047
|
+
filterType: string;
|
|
1048
|
+
flatDocFilters: boolean;
|
|
1049
|
+
commonFilters: any[];
|
|
1050
|
+
sharedAcrossMultiple: {
|
|
1051
|
+
contentTypes: any;
|
|
1052
|
+
display: any;
|
|
1053
|
+
filters: any[];
|
|
1054
|
+
}[];
|
|
1055
|
+
commonDocumentFilters: any[];
|
|
1056
|
+
perDataset: {
|
|
1057
|
+
contentType: any;
|
|
1058
|
+
display: any;
|
|
1059
|
+
filters: any[];
|
|
1060
|
+
rollups: any[];
|
|
1061
|
+
}[];
|
|
1062
|
+
};
|
|
1063
|
+
target: {
|
|
1064
|
+
filterType: string;
|
|
1065
|
+
};
|
|
1066
|
+
} | null;
|
|
1067
|
+
|
|
1023
1068
|
/**
|
|
1024
1069
|
* TEMP_removeDuplicateFilters - Removes duplicate rollup and tag-type filters
|
|
1025
1070
|
*
|
|
@@ -1114,6 +1159,37 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
|
|
|
1114
1159
|
sectionId: string;
|
|
1115
1160
|
configs: any[];
|
|
1116
1161
|
}[];
|
|
1162
|
+
} | {
|
|
1163
|
+
sectionId: string;
|
|
1164
|
+
configs: {
|
|
1165
|
+
sectionId: string;
|
|
1166
|
+
configs: {
|
|
1167
|
+
filterId: string;
|
|
1168
|
+
display: string;
|
|
1169
|
+
filterKey: string;
|
|
1170
|
+
source: {
|
|
1171
|
+
filterType: string;
|
|
1172
|
+
flatDocFilters: boolean;
|
|
1173
|
+
commonFilters: any[];
|
|
1174
|
+
sharedAcrossMultiple: {
|
|
1175
|
+
contentTypes: any;
|
|
1176
|
+
display: any;
|
|
1177
|
+
filters: any[];
|
|
1178
|
+
}[];
|
|
1179
|
+
commonDocumentFilters: any[];
|
|
1180
|
+
perDataset: {
|
|
1181
|
+
contentType: any;
|
|
1182
|
+
display: any;
|
|
1183
|
+
filters: any[];
|
|
1184
|
+
rollups: any[];
|
|
1185
|
+
}[];
|
|
1186
|
+
};
|
|
1187
|
+
target: {
|
|
1188
|
+
filterType: string;
|
|
1189
|
+
};
|
|
1190
|
+
}[];
|
|
1191
|
+
}[];
|
|
1192
|
+
sectionTitle?: undefined;
|
|
1117
1193
|
} | {
|
|
1118
1194
|
sectionId: string;
|
|
1119
1195
|
sectionTitle: string;
|
|
@@ -1184,11 +1260,30 @@ declare const UI_CONTENT: {
|
|
|
1184
1260
|
};
|
|
1185
1261
|
};
|
|
1186
1262
|
|
|
1187
|
-
|
|
1263
|
+
interface GenCleanCamelCaseIdOptions {
|
|
1264
|
+
/** Strip all non-alphanumeric chars (A-Z, a-z, 0-9 only). Default: false */
|
|
1265
|
+
stripNonAlphanumeric?: boolean;
|
|
1266
|
+
/** Truncate result to this max length. Default: no limit */
|
|
1267
|
+
maxLength?: number;
|
|
1268
|
+
}
|
|
1269
|
+
declare const genCleanCamelCaseId: (id: string, options?: GenCleanCamelCaseIdOptions) => string;
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Generates a clean, deterministic contentType ID from text.
|
|
1273
|
+
* Wraps genCleanCamelCaseId with stripNonAlphanumeric + maxLength 40.
|
|
1274
|
+
*
|
|
1275
|
+
* Idempotent: running twice produces the same output.
|
|
1276
|
+
*
|
|
1277
|
+
* @example
|
|
1278
|
+
* genCleanContentTypeId("My Articles!") => "myArticles"
|
|
1279
|
+
* genCleanContentTypeId("myArticles") => "myArticles" (idempotent)
|
|
1280
|
+
* genCleanContentTypeId("123 Test") => "a123Test"
|
|
1281
|
+
*/
|
|
1282
|
+
declare const genCleanContentTypeId: (text: string) => string;
|
|
1188
1283
|
|
|
1189
1284
|
/**
|
|
1190
1285
|
* Generates a clean, short, unique ID from text input.
|
|
1191
|
-
* Used for
|
|
1286
|
+
* Used for block valuePaths in templates.
|
|
1192
1287
|
*
|
|
1193
1288
|
* 1. Strips all characters except A-Z, a-z, 0-9
|
|
1194
1289
|
* 2. Lowercases the result
|
|
@@ -1196,15 +1291,18 @@ declare const genCleanCamelCaseId: (id: string) => string;
|
|
|
1196
1291
|
* 4. Truncates to maxLength (default 10)
|
|
1197
1292
|
* 5. Appends _{random id} (default 4 chars)
|
|
1198
1293
|
*
|
|
1294
|
+
* Idempotent: if input already matches the output pattern
|
|
1295
|
+
* (lowercase alphanumeric + _hash suffix), returns as-is.
|
|
1296
|
+
*
|
|
1199
1297
|
* @param text - The input text to convert
|
|
1200
|
-
* @param maxLength - Max characters before the random suffix (default 10
|
|
1298
|
+
* @param maxLength - Max characters before the random suffix (default 10)
|
|
1201
1299
|
* @param shortIdLength - Length of the random suffix (default 4)
|
|
1202
1300
|
*
|
|
1203
1301
|
* @example
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1206
|
-
*
|
|
1302
|
+
* genCleanValuePath("Author Name") => "authorname_x7k2"
|
|
1303
|
+
* genCleanValuePath("authorname_x7k2") => "authorname_x7k2" (idempotent)
|
|
1304
|
+
* genCleanValuePath("123 Test") => "a123test_ab4d"
|
|
1207
1305
|
*/
|
|
1208
|
-
declare const
|
|
1306
|
+
declare const genCleanValuePath: (text: string) => string;
|
|
1209
1307
|
|
|
1210
|
-
export { BASE_BULLMQ_CONFIG, FILTER_IDS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId,
|
|
1308
|
+
export { BASE_BULLMQ_CONFIG, FILTER_IDS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genCleanContentTypeId, genCleanValuePath, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToPublishedContent, getVal, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|