@strapi/strapi 4.13.1 → 4.13.3

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.
@@ -2,9 +2,12 @@ import type { Attribute, Common, Utils } from '@strapi/strapi';
2
2
 
3
3
  import type * as Operator from './operators';
4
4
  import type * as AttributeUtils from '../attributes';
5
+ import type Params from '../index';
5
6
 
6
7
  export { Operator };
7
8
 
9
+ type IDKey = 'id';
10
+
8
11
  /**
9
12
  * Filter representation for nested attributes
10
13
  */
@@ -20,11 +23,17 @@ type NestedAttributeCondition<
20
23
  */
21
24
  type AttributeCondition<
22
25
  TSchemaUID extends Common.UID.Schema,
23
- TAttributeName extends Attribute.GetKeys<TSchemaUID>
24
- > = Utils.Expression.If<
25
- Utils.Expression.IsNotNever<TAttributeName>,
26
- // Get the filter attribute value for the given attribute
27
- AttributeUtils.GetValue<Attribute.Get<TSchemaUID, TAttributeName>>,
26
+ TAttributeName extends IDKey | Attribute.GetKeys<TSchemaUID>
27
+ > = Utils.Expression.MatchFirst<
28
+ [
29
+ // Special catch for manually added ID attributes
30
+ [Utils.Expression.StrictEqual<TAttributeName, IDKey>, Params.Attribute.ID],
31
+ [
32
+ Utils.Expression.IsNotNever<TAttributeName>,
33
+ // Get the filter attribute value for the given attribute
34
+ AttributeUtils.GetValue<Attribute.Get<TSchemaUID, Exclude<TAttributeName, IDKey>>>
35
+ ]
36
+ ],
28
37
  // Fallback to the list of all possible scalar attributes' value if the attribute is not valid (never)
29
38
  AttributeUtils.ScalarValues
30
39
  > extends infer TAttributeValue
@@ -64,11 +73,17 @@ export type ObjectNotation<TSchemaUID extends Common.UID.Schema> = {
64
73
  Utils.Expression.IsNotNever<TNestedKeys>
65
74
  >,
66
75
  // Strongly typed representation of the filter object tree
67
- | { [TIter in TScalarKeys]?: AttributeCondition<TSchemaUID, TIter> }
68
- | { [TIter in TNestedKeys]?: NestedAttributeCondition<TSchemaUID, TIter> },
76
+ {
77
+ [TIter in IDKey | TScalarKeys]?: AttributeCondition<TSchemaUID, TIter>;
78
+ } & {
79
+ [TIter in TNestedKeys]?: NestedAttributeCondition<TSchemaUID, TIter>;
80
+ },
69
81
  // Generic representation of the filter object tree in case we don't have access to the attributes' list
70
- | { [TKey in string]?: AttributeCondition<TSchemaUID, never> }
71
- | { [TKey in string]?: NestedAttributeCondition<TSchemaUID, never> }
82
+ {
83
+ [TKey in string]?:
84
+ | AttributeCondition<TSchemaUID, never>
85
+ | NestedAttributeCondition<TSchemaUID, never>;
86
+ }
72
87
  >
73
88
  : never);
74
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/strapi",
3
- "version": "4.13.1",
3
+ "version": "4.13.3",
4
4
  "description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
5
5
  "keywords": [
6
6
  "strapi",
@@ -81,19 +81,19 @@
81
81
  "dependencies": {
82
82
  "@koa/cors": "3.4.3",
83
83
  "@koa/router": "10.1.1",
84
- "@strapi/admin": "4.13.1",
85
- "@strapi/data-transfer": "4.13.1",
86
- "@strapi/database": "4.13.1",
87
- "@strapi/generate-new": "4.13.1",
88
- "@strapi/generators": "4.13.1",
89
- "@strapi/logger": "4.13.1",
90
- "@strapi/permissions": "4.13.1",
91
- "@strapi/plugin-content-manager": "4.13.1",
92
- "@strapi/plugin-content-type-builder": "4.13.1",
93
- "@strapi/plugin-email": "4.13.1",
94
- "@strapi/plugin-upload": "4.13.1",
95
- "@strapi/typescript-utils": "4.13.1",
96
- "@strapi/utils": "4.13.1",
84
+ "@strapi/admin": "4.13.3",
85
+ "@strapi/data-transfer": "4.13.3",
86
+ "@strapi/database": "4.13.3",
87
+ "@strapi/generate-new": "4.13.3",
88
+ "@strapi/generators": "4.13.3",
89
+ "@strapi/logger": "4.13.3",
90
+ "@strapi/permissions": "4.13.3",
91
+ "@strapi/plugin-content-manager": "4.13.3",
92
+ "@strapi/plugin-content-type-builder": "4.13.3",
93
+ "@strapi/plugin-email": "4.13.3",
94
+ "@strapi/plugin-upload": "4.13.3",
95
+ "@strapi/typescript-utils": "4.13.3",
96
+ "@strapi/utils": "4.13.3",
97
97
  "bcryptjs": "2.4.3",
98
98
  "boxen": "5.1.2",
99
99
  "chalk": "4.1.2",
@@ -143,5 +143,5 @@
143
143
  "node": ">=16.0.0 <=20.x.x",
144
144
  "npm": ">=6.0.0"
145
145
  },
146
- "gitHead": "a9afeb90c525d9b8ab033aa0c87e03a72134e0dd"
146
+ "gitHead": "377efaba51b6499e85f7768049a3246ccb9be57c"
147
147
  }