@ai-matrx/associations 0.14.87 → 0.14.89
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/CHANGELOG.md +19 -2
- package/dist/{CommentThread-DK2qbARj.d.cts → CommentThread-Bn9QUgT1.d.cts} +1 -1
- package/dist/{CommentThread-DK2qbARj.d.ts → CommentThread-Bn9QUgT1.d.ts} +1 -1
- package/dist/{chunk-server-CUPL6XZX.js → chunk-server-CLFZEGHN.js} +5 -1
- package/dist/chunk-server-CLFZEGHN.js.map +1 -0
- package/dist/core/index.cjs +36 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +4 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +33 -2
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.cjs +2 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/lazy/index.d.cts +1 -1
- package/dist/react/lazy/index.d.ts +1 -1
- package/dist/{results-OiVLb2QG.d.cts → results-CwoWRIDS.d.cts} +34 -2
- package/dist/{results-OiVLb2QG.d.ts → results-CwoWRIDS.d.ts} +34 -2
- package/package.json +2 -2
- package/dist/chunk-server-CUPL6XZX.js.map +0 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EntityOverlayMap, a as EntityTypeToken, b as EntityOverlayEntry, c as ErrorSink, A as AssociationsRpcError, d as AssociationsDataSource, e as AssociationsIdentity, f as AssociationTargetType, g as AssociationsRpcResult, h as AssociationEdge, i as AssociationTargetEdge, j as AssociationSourceEdge, C as CategoryDimension, P as PlatformCategory, U as UserStateKind, k as UserEntityState, l as CommentAnchor, m as PlatformComment, n as AssociationsEntry, o as CategoriesEntry, p as CommentsEntry, q as AssociationsConfig } from '../results-
|
|
1
|
+
import { E as EntityOverlayMap, a as EntityTypeToken, b as EntityOverlayEntry, c as ErrorSink, A as AssociationsRpcError, d as AssociationsDataSource, e as AssociationsIdentity, f as AssociationTargetType, g as AssociationsRpcResult, h as AssociationEdge, i as AssociationTargetEdge, j as AssociationSourceEdge, C as CategoryDimension, P as PlatformCategory, U as UserStateKind, k as UserEntityState, l as CommentAnchor, m as PlatformComment, n as AssociationsEntry, o as CategoriesEntry, p as CommentsEntry, q as AssociationsConfig } from '../results-CwoWRIDS.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '@ai-matrx/data/db';
|
|
4
4
|
|
|
@@ -743,4 +743,6 @@ declare function buildCategoryHierarchy(categories: PlatformCategory[]): Categor
|
|
|
743
743
|
*/
|
|
744
744
|
declare function createDefaultErrorSink(): ErrorSink;
|
|
745
745
|
|
|
746
|
-
|
|
746
|
+
declare function pluralizeLabel(label: string): string;
|
|
747
|
+
|
|
748
|
+
export { ASSOC_ADD_MANY_CHUNK, type AddAssociationArgs, type AddCommentArgs, type AssociationGuards, type AssociationHelpersApi, type AssociationWriteResult, type AssociationsServiceApi, type AssociationsStore, type CandidateRecord, type CandidatesResult, type CandidatesServiceApi, type CategoriesServiceApi, type CategoryHierarchy, type CategoryHierarchyItem, type CategoryMutationResult, type CommentMutationResult, type CommentsServiceApi, type ContainerRef, type ContentRole, type ConversationFileLink, type CoreDeps, type CreateEntityRowArgs, DEFAULT_ORG_COLUMN, DEFAULT_OWNER_COLUMN, type EdgeAttrs, type EdgeSpec, type EntityInfo, type EntityRef, type EntityRegistry, type EntityRowResult, type EntityRowsServiceApi, type FavoritesServiceApi, type ListCandidatesArgs, NON_CONTENT_SOURCE_TYPES, type PgErrorMapper, type RpcResultHelpers, type SearchAcrossTokensArgs, type SearchAcrossTokensResult, type TitlesServiceApi, type TokenSearchFailure, type UniversalCandidate, associationsKey, buildCategoryHierarchy, createAssociationGuards, createAssociationHelpers, createAssociationsService, createAssociationsStore, createCandidatesService, createCategoriesService, createCommentsService, createDefaultErrorSink, createEntityRegistry, createEntityRowsService, createFavoritesService, createRpcResultHelpers, createTitlesService, entityTitleCacheKey, err, firstError, isContentRole, isContentSourceEdge, isMembershipMetadata, ok, pluralizeLabel, resolveEntityToken };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EntityOverlayMap, a as EntityTypeToken, b as EntityOverlayEntry, c as ErrorSink, A as AssociationsRpcError, d as AssociationsDataSource, e as AssociationsIdentity, f as AssociationTargetType, g as AssociationsRpcResult, h as AssociationEdge, i as AssociationTargetEdge, j as AssociationSourceEdge, C as CategoryDimension, P as PlatformCategory, U as UserStateKind, k as UserEntityState, l as CommentAnchor, m as PlatformComment, n as AssociationsEntry, o as CategoriesEntry, p as CommentsEntry, q as AssociationsConfig } from '../results-
|
|
1
|
+
import { E as EntityOverlayMap, a as EntityTypeToken, b as EntityOverlayEntry, c as ErrorSink, A as AssociationsRpcError, d as AssociationsDataSource, e as AssociationsIdentity, f as AssociationTargetType, g as AssociationsRpcResult, h as AssociationEdge, i as AssociationTargetEdge, j as AssociationSourceEdge, C as CategoryDimension, P as PlatformCategory, U as UserStateKind, k as UserEntityState, l as CommentAnchor, m as PlatformComment, n as AssociationsEntry, o as CategoriesEntry, p as CommentsEntry, q as AssociationsConfig } from '../results-CwoWRIDS.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '@ai-matrx/data/db';
|
|
4
4
|
|
|
@@ -743,4 +743,6 @@ declare function buildCategoryHierarchy(categories: PlatformCategory[]): Categor
|
|
|
743
743
|
*/
|
|
744
744
|
declare function createDefaultErrorSink(): ErrorSink;
|
|
745
745
|
|
|
746
|
-
|
|
746
|
+
declare function pluralizeLabel(label: string): string;
|
|
747
|
+
|
|
748
|
+
export { ASSOC_ADD_MANY_CHUNK, type AddAssociationArgs, type AddCommentArgs, type AssociationGuards, type AssociationHelpersApi, type AssociationWriteResult, type AssociationsServiceApi, type AssociationsStore, type CandidateRecord, type CandidatesResult, type CandidatesServiceApi, type CategoriesServiceApi, type CategoryHierarchy, type CategoryHierarchyItem, type CategoryMutationResult, type CommentMutationResult, type CommentsServiceApi, type ContainerRef, type ContentRole, type ConversationFileLink, type CoreDeps, type CreateEntityRowArgs, DEFAULT_ORG_COLUMN, DEFAULT_OWNER_COLUMN, type EdgeAttrs, type EdgeSpec, type EntityInfo, type EntityRef, type EntityRegistry, type EntityRowResult, type EntityRowsServiceApi, type FavoritesServiceApi, type ListCandidatesArgs, NON_CONTENT_SOURCE_TYPES, type PgErrorMapper, type RpcResultHelpers, type SearchAcrossTokensArgs, type SearchAcrossTokensResult, type TitlesServiceApi, type TokenSearchFailure, type UniversalCandidate, associationsKey, buildCategoryHierarchy, createAssociationGuards, createAssociationHelpers, createAssociationsService, createAssociationsStore, createCandidatesService, createCategoriesService, createCommentsService, createDefaultErrorSink, createEntityRegistry, createEntityRowsService, createFavoritesService, createRpcResultHelpers, createTitlesService, entityTitleCacheKey, err, firstError, isContentRole, isContentSourceEdge, isMembershipMetadata, ok, pluralizeLabel, resolveEntityToken };
|
package/dist/core/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isRecordStoreNounToken,
|
|
6
6
|
recordStoreNoun,
|
|
7
7
|
registeredEdgeLabel
|
|
8
|
-
} from "../chunk-server-
|
|
8
|
+
} from "../chunk-server-CLFZEGHN.js";
|
|
9
9
|
|
|
10
10
|
// src/ports.ts
|
|
11
11
|
function asAssociationsDataSource(source) {
|
|
@@ -216,6 +216,36 @@ function createRpcResultHelpers(errorSink, sessionAttached) {
|
|
|
216
216
|
return { ok, err, mapPgError, mapPgErrorPair };
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
// src/core/pluralizeLabel.ts
|
|
220
|
+
var UNCOUNTABLE = /* @__PURE__ */ new Set([
|
|
221
|
+
"data",
|
|
222
|
+
"media",
|
|
223
|
+
"research",
|
|
224
|
+
"information",
|
|
225
|
+
"feedback",
|
|
226
|
+
"content",
|
|
227
|
+
"software",
|
|
228
|
+
"evidence",
|
|
229
|
+
"equipment",
|
|
230
|
+
"metadata",
|
|
231
|
+
"knowledge",
|
|
232
|
+
"news",
|
|
233
|
+
"series",
|
|
234
|
+
"species"
|
|
235
|
+
]);
|
|
236
|
+
function pluralizeLabel(label) {
|
|
237
|
+
const m = /^(.*?)([A-Za-z]+)$/.exec(label);
|
|
238
|
+
const head = m?.[1];
|
|
239
|
+
const word = m?.[2];
|
|
240
|
+
if (head === void 0 || word === void 0) return label;
|
|
241
|
+
const lower = word.toLowerCase();
|
|
242
|
+
if (UNCOUNTABLE.has(lower)) return label;
|
|
243
|
+
if (lower.endsWith("sis")) return `${head}${word.slice(0, -2)}es`;
|
|
244
|
+
if (/[^aeiou]y$/.test(lower)) return `${head}${word.slice(0, -1)}ies`;
|
|
245
|
+
if (/(s|x|z|ch|sh)$/.test(lower)) return `${head}${word}es`;
|
|
246
|
+
return `${label}s`;
|
|
247
|
+
}
|
|
248
|
+
|
|
219
249
|
// src/core/registry.ts
|
|
220
250
|
var DEFAULT_OWNER_COLUMN = "created_by";
|
|
221
251
|
var DEFAULT_ORG_COLUMN = "organization_id";
|
|
@@ -308,7 +338,7 @@ function createEntityRegistry(errorSink, initialOverlay) {
|
|
|
308
338
|
function getEntityInfo(token) {
|
|
309
339
|
const meta = ENTITY_TYPE_METADATA[token] ?? recordStoreMeta(token) ?? retiredTokenMeta(token);
|
|
310
340
|
const overlay = overlayByToken[token];
|
|
311
|
-
const labelPlural = overlay?.labelPlural ??
|
|
341
|
+
const labelPlural = overlay?.labelPlural ?? pluralizeLabel(meta.label);
|
|
312
342
|
const titleColumn = meta.titleColumn;
|
|
313
343
|
const contentRole = isContentRole(meta.contentRole) ? meta.contentRole : "destination";
|
|
314
344
|
if (meta.contentRole !== null && !isContentRole(meta.contentRole)) {
|
|
@@ -2228,6 +2258,7 @@ export {
|
|
|
2228
2258
|
isContentSourceEdge,
|
|
2229
2259
|
isMembershipMetadata,
|
|
2230
2260
|
ok,
|
|
2261
|
+
pluralizeLabel,
|
|
2231
2262
|
resolveEntityToken
|
|
2232
2263
|
};
|
|
2233
2264
|
//# sourceMappingURL=index.js.map
|