rimecms 0.23.23 → 0.23.26

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.
@@ -105,6 +105,34 @@ export const buildWhereParam = ({ query, slug, db, locale, tables, configCtx })
105
105
  const [to, localized] = [fieldConfig.relationTo, fieldConfig.localized];
106
106
  const relationTableName = `${slug}Rels`;
107
107
  const relationTable = getTable(relationTableName);
108
+ // Handle multi-valued relations specially when operator is `equals` to provide
109
+ // strict equality semantics (the relation set must equal the provided value(s)).
110
+ if (fieldConfig.many && operator === 'equals') {
111
+ // Accept array inputs, repeated params, or CSV values for equality checks
112
+ let values = Array.isArray(rawValue)
113
+ ? rawValue
114
+ : typeof rawValue === 'string' && rawValue.includes(',')
115
+ ? rawValue.split(',')
116
+ : [value];
117
+ // Ensure values are unique
118
+ values = Array.from(new Set(values));
119
+ // Owners with total relation count equal to values.length
120
+ const ownersWithTotalCount = db
121
+ .select({ id: relationTable.ownerId })
122
+ .from(relationTable)
123
+ .where(and(...(localized ? [eq(relationTable.locale, locale)] : [])))
124
+ .groupBy(relationTable.ownerId)
125
+ .having(drizzleORM.eq(drizzleORM.count(relationTable.id), values.length));
126
+ // Owners with matching relations count equal to values.length
127
+ const ownersWithMatchingCount = db
128
+ .select({ id: relationTable.ownerId })
129
+ .from(relationTable)
130
+ .where(and(drizzleORM.inArray(relationTable[`${to}Id`], values), ...(localized ? [eq(relationTable.locale, locale)] : [])))
131
+ .groupBy(relationTable.ownerId)
132
+ .having(drizzleORM.eq(drizzleORM.count(relationTable.id), values.length));
133
+ return and(inArray(table.id, ownersWithTotalCount), inArray(table.id, ownersWithMatchingCount));
134
+ }
135
+ // Default behavior (membership checks with in_array etc.)
108
136
  const conditions = [fn(relationTable[`${to}Id`], value)];
109
137
  if (localized) {
110
138
  conditions.push(eq(relationTable.locale, locale));
@@ -1,2 +1,3 @@
1
+ export declare const mimeTypesMap: Record<string, string[]>;
1
2
  export declare function getExtensionFromMimeType(mimeType: string): string | null;
2
3
  export declare function getMimeTypeFromExtension(extension: string): string | null;
@@ -1,4 +1,4 @@
1
- const mimeTypesMap = {
1
+ export const mimeTypesMap = {
2
2
  // Images
3
3
  'image/jpeg': ['jpg', 'jpeg'],
4
4
  'image/png': ['png'],
@@ -1,4 +1,3 @@
1
- // /Users/ai/Dev/rime/src/lib/fields/rich-text/core/features/bold.ts
2
1
  import { Text } from '@lucide/svelte';
3
2
  import Paragraph from '@tiptap/extension-paragraph';
4
3
  const paragraphFeatureNode = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimecms",
3
- "version": "0.23.23",
3
+ "version": "0.23.26",
4
4
  "homepage": "https://github.com/bienbiendev/rime",
5
5
  "scripts": {
6
6
  "dev": "vite dev",