@strapi/types 5.62.0 → 5.63.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/core/config/database.d.ts +8 -0
- package/dist/core/config/database.d.ts.map +1 -1
- package/dist/modules/documents/params/filters/index.d.ts +78 -6
- package/dist/modules/documents/params/filters/index.d.ts.map +1 -1
- package/dist/modules/fetch.d.ts +18 -1
- package/dist/modules/fetch.d.ts.map +1 -1
- package/package.json +22 -11
|
@@ -68,6 +68,14 @@ export interface Database<TClient extends Database.ClientKind = Database.ClientK
|
|
|
68
68
|
* example `env.bool('DATABASE_POOL_TIMEOUT_DIAGNOSTICS', true)`): a string is not read as false.
|
|
69
69
|
*/
|
|
70
70
|
poolTimeoutDiagnostics?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Maximum time in milliseconds a query run through the query builder's `execute()` may run
|
|
73
|
+
* before the database cancels it. Unset by default (no limit). Only applied on clients that
|
|
74
|
+
* can cancel queries (postgres, mysql); ignored on sqlite. Streams, direct `db.connection`
|
|
75
|
+
* queries, schema sync, and migrations are not covered. Must be a positive number (for
|
|
76
|
+
* example `env.int('DATABASE_QUERY_TIMEOUT')`).
|
|
77
|
+
*/
|
|
78
|
+
queryTimeout?: number;
|
|
71
79
|
};
|
|
72
80
|
}
|
|
73
81
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/core/config/database.ts"],"names":[],"mappings":"AACA,yBAAiB,QAAQ,CAAC;IACxB,KAAY,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC1D;AAED,KAAK,SAAS,GAAG;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAA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C,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as Schema from '../../../../schema';
|
|
2
2
|
import type * as UID from '../../../../uid';
|
|
3
|
-
import type { Guard, If, And, MatchFirst, StrictEqual, IsNotNever } from '../../../../utils';
|
|
3
|
+
import type { Guard, If, And, MatchFirst, StrictEqual, IsNotNever, DoesNotExtends } from '../../../../utils';
|
|
4
4
|
import type * as Operator from './operators';
|
|
5
5
|
import type * as AttributeUtils from '../attributes';
|
|
6
6
|
import type * as Params from '..';
|
|
@@ -13,9 +13,50 @@ type DocumentIDKey = 'documentId';
|
|
|
13
13
|
* The target UID is resolved through `infer` before recursing. When `TSchemaUID` is a type
|
|
14
14
|
* parameter, the conditional type stays deferred, so TypeScript does not build an endless chain of
|
|
15
15
|
* new `ObjectNotation<Target<...>>` instantiations, which would exhaust the heap on nested filters.
|
|
16
|
-
* When
|
|
16
|
+
* When the target's attributes are known, the type is the target's filter object, or one operator on
|
|
17
|
+
* the target's id ({@link IdOperatorCondition}). Otherwise it is the target's loose filter object.
|
|
17
18
|
*/
|
|
18
|
-
type NestedAttributeCondition<TSchemaUID extends UID.Schema, TAttributeName extends Schema.AttributeNames<TSchemaUID>> = Guard.Never<Schema.Attribute.Target<Schema.AttributeByName<TSchemaUID, TAttributeName>>, UID.Schema> extends infer TTargetUID extends UID.Schema ? ObjectNotation<TTargetUID> : never;
|
|
19
|
+
type NestedAttributeCondition<TSchemaUID extends UID.Schema, TAttributeName extends Schema.AttributeNames<TSchemaUID>> = Guard.Never<Schema.Attribute.Target<Schema.AttributeByName<TSchemaUID, TAttributeName>>, UID.Schema> extends infer TTargetUID extends UID.Schema ? If<HasKnownAttributeNames<TTargetUID>, ObjectNotation<TTargetUID> | IdOperatorCondition<TTargetUID>, ObjectNotation<TTargetUID>> : never;
|
|
20
|
+
/**
|
|
21
|
+
* Filter on the id of a nested attribute's target: an object with exactly one comparison, list or
|
|
22
|
+
* null operator (e.g. `{ $in: [1, 2] }`, `{ $null: true }`).
|
|
23
|
+
*
|
|
24
|
+
* The database applies it to the target's numeric id, not to its documentId: a documentId operand
|
|
25
|
+
* type-checks (`ID` is `string | number`) but matches nothing, or fails on Postgres. `$ne` and
|
|
26
|
+
* `$notIn` do not match entries without a related entry (their id is null).
|
|
27
|
+
*
|
|
28
|
+
* The database throws for an object with several operators, or with an operator next to other keys.
|
|
29
|
+
* So each operator object forbids the other operators and the target's filter keys. A literal that
|
|
30
|
+
* mixes an operator with other keys matches no member. With `strictNullChecks` off, a forbidden key
|
|
31
|
+
* set to `null` is accepted (`{ $null: true, name: null }`), see {@link Forbidden}.
|
|
32
|
+
*
|
|
33
|
+
* The filter object member does not forbid the operators, so spreading a filter read back from it
|
|
34
|
+
* and adding a key (`{ ...filters.article, title: 'a' }`) compiles. The spread compiles even when the
|
|
35
|
+
* value holds an operator object, and the database then throws. For the same reason, an operator next
|
|
36
|
+
* to other keys is rejected only in a literal: through a variable (`{ $in: ids, title }` with
|
|
37
|
+
* `title?: string`), a conditional or a spread it compiles, and the database throws. Write
|
|
38
|
+
* `{ id: { $in: ids }, title }` instead.
|
|
39
|
+
*
|
|
40
|
+
* The forbidden keys are optional {@link Forbidden} properties, so the type stays assignable to
|
|
41
|
+
* `ObjectNotation<Target>` and reading a filter back keeps the target's keys. A bare id would break
|
|
42
|
+
* that, so it is not accepted: write `{ id: 5 }` or `{ $eq: 5 }`.
|
|
43
|
+
*/
|
|
44
|
+
type IdOperatorCondition<TTargetUID extends UID.Schema> = {
|
|
45
|
+
[TOperator in IdOperator]: {
|
|
46
|
+
[TIter in TOperator]: IdOperatorValue<TOperator>;
|
|
47
|
+
} & {
|
|
48
|
+
[TIter in Exclude<Operator.Where, TOperator> | FilterKeys<TTargetUID>]?: Forbidden;
|
|
49
|
+
};
|
|
50
|
+
}[IdOperator];
|
|
51
|
+
/**
|
|
52
|
+
* Operators that make sense on an id. Text operators (e.g. `$contains`) are left out.
|
|
53
|
+
*/
|
|
54
|
+
type IdOperator = '$eq' | '$ne' | '$lt' | '$lte' | '$gt' | '$gte' | '$in' | '$notIn' | '$between' | Operator.BooleanValue;
|
|
55
|
+
type IdOperatorValue<TOperator extends IdOperator> = TOperator extends Operator.BooleanValue ? boolean : TOperator extends Operator.DynamicArrayValue ? Params.Attribute.ID[] : TOperator extends Operator.DynamicBoundValue ? [Params.Attribute.ID, Params.Attribute.ID] : Params.Attribute.ID;
|
|
56
|
+
/**
|
|
57
|
+
* Non-operator keys of the filter object of {@link TSchemaUID}, plus its groups and `$not`
|
|
58
|
+
*/
|
|
59
|
+
type FilterKeys<TSchemaUID extends UID.Schema> = Operator.Group | Operator.Logical | IDKey | DocumentIDKey | If<HasKnownAttributeNames<TSchemaUID>, Schema.AttributeNames<TSchemaUID>, never>;
|
|
19
60
|
/**
|
|
20
61
|
* Filter representation for scalar attributes
|
|
21
62
|
*/
|
|
@@ -45,6 +86,35 @@ type AttributeCondition<TSchemaUID extends UID.Schema, TAttributeName extends ID
|
|
|
45
86
|
} & {
|
|
46
87
|
[TIter in Operator.Group]?: AttributeCondition<TSchemaUID, TAttributeName>[];
|
|
47
88
|
}) : never;
|
|
89
|
+
/**
|
|
90
|
+
* Whether the attribute names of {@link TSchemaUID} are a finite list of names.
|
|
91
|
+
*
|
|
92
|
+
* Checks the attribute names rather than the scalar and nested keys: a schema can have only scalar
|
|
93
|
+
* or only nested attributes, so either list can be empty for a known schema.
|
|
94
|
+
*
|
|
95
|
+
* The names are unknown (`string`) when the schema registries are not extended (no generated types)
|
|
96
|
+
* or when the UID is not in the registries. They are `never` for a union of UIDs whose schemas share
|
|
97
|
+
* no attribute.
|
|
98
|
+
*/
|
|
99
|
+
type HasKnownAttributeNames<TSchemaUID extends UID.Schema> = And<IsNotNever<Schema.AttributeNames<TSchemaUID>>, DoesNotExtends<string, Schema.AttributeNames<TSchemaUID>>>;
|
|
100
|
+
type IsComponent<TSchemaUID extends UID.Schema> = StrictEqual<Schema.ModelType<TSchemaUID>, 'component'>;
|
|
101
|
+
/**
|
|
102
|
+
* Value type of a key that a filter object forbids: `undefined` without `strictNullChecks`, `never`
|
|
103
|
+
* with it.
|
|
104
|
+
*
|
|
105
|
+
* - Without `strictNullChecks`, TypeScript narrows the id operator union on the `$null` key and
|
|
106
|
+
* compares a missing key (`undefined`) with each member. With `never`, it discards every member and
|
|
107
|
+
* `{ $between: [1, 5] }` loses its tuple type. A component filter (`documentId`) and the id operator
|
|
108
|
+
* object must also forbid keys the same way, or the operator object is not assignable to the
|
|
109
|
+
* component filter and reading a nested component filter back fails.
|
|
110
|
+
* - With `exactOptionalPropertyTypes`, `?: undefined` is a key that can be present, so a filter
|
|
111
|
+
* object member with `$in?: undefined` is not assignable to the target's filter and reading a
|
|
112
|
+
* nested filter back fails. `?: never` keeps it assignable.
|
|
113
|
+
*
|
|
114
|
+
* With `strictNullChecks` off, `null` is assignable to `undefined`, so a forbidden key set to `null`
|
|
115
|
+
* is accepted. No type rejects it in that mode.
|
|
116
|
+
*/
|
|
117
|
+
type Forbidden = null extends string ? undefined : never;
|
|
48
118
|
/**
|
|
49
119
|
* Tree representation of a Strapi filter for a given schema UID
|
|
50
120
|
*/
|
|
@@ -55,10 +125,12 @@ export type ObjectNotation<TSchemaUID extends UID.Schema> = {
|
|
|
55
125
|
} & ([AttributeUtils.GetScalarKeys<TSchemaUID>, AttributeUtils.GetNestedKeys<TSchemaUID>] extends [
|
|
56
126
|
infer TScalarKeys extends AttributeUtils.GetScalarKeys<TSchemaUID>,
|
|
57
127
|
infer TNestedKeys extends AttributeUtils.GetNestedKeys<TSchemaUID>
|
|
58
|
-
] ? If<
|
|
128
|
+
] ? If<HasKnownAttributeNames<TSchemaUID>, {
|
|
59
129
|
[TIter in IDKey | DocumentIDKey | TScalarKeys]?: AttributeCondition<TSchemaUID, TIter>;
|
|
60
|
-
} & {
|
|
61
|
-
[TIter in
|
|
130
|
+
} & If<IsComponent<TSchemaUID>, {
|
|
131
|
+
[TIter in DocumentIDKey]?: Forbidden;
|
|
132
|
+
}, unknown> & {
|
|
133
|
+
[TIter in IDKey | TNestedKeys]?: TIter extends TNestedKeys ? NestedAttributeCondition<TSchemaUID, TIter> : unknown;
|
|
62
134
|
}, {
|
|
63
135
|
[TKey in string]?: AttributeCondition<TSchemaUID, never> | NestedAttributeCondition<TSchemaUID, never>;
|
|
64
136
|
}> : never);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/documents/params/filters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,KAAK,GAAG,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/documents/params/filters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,KAAK,GAAG,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EACV,KAAK,EACL,EAAE,EACF,GAAG,EACH,UAAU,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,QAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,KAAK,cAAc,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,MAAM,IAAI,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,KAAK,KAAK,GAAG,IAAI,CAAC;AAClB,KAAK,aAAa,GAAG,YAAY,CAAC;AAElC;;;;;;;;GAQG;AACH,KAAK,wBAAwB,CAC3B,UAAU,SAAS,GAAG,CAAC,MAAM,EAC7B,cAAc,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,IAExD,KAAK,CAAC,KAAK,CACT,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,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G,EAAE,CACJ,WAAW,CAAC,UAAU,CAAC,EAGvB;KAAG,KAAK,IAAI,aAAa,CAAC,CAAC,EAAE,SAAS;CAAE,EACxC,OAAO,CACR,GAAG;KAMC,KAAK,IAAI,KAAK,GAAG,WAAW,CAAC,CAAC,EAAE,KAAK,SAAS,WAAW,GACtD,wBAAwB,CAAC,UAAU,EAAE,KAAK,CAAC,GAC3C,OAAO;CACZ,EAEH;KACG,IAAI,IAAI,MAAM,CAAC,CAAC,EACf,kBAAkB,CAAC,UAAU,EAAE,KAAK,CAAC,GAAG,wBAAwB,CAAC,UAAU,EAAE,KAAK,CAAC;CACtF,CACF,GACD,KAAK,CAAC,CAAC;AAEb,MAAM,MAAM,GAAG,CAAC,UAAU,SAAS,GAAG,CAAC,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC"}
|
package/dist/modules/fetch.d.ts
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The part of an undici dispatcher that `strapi.fetch` and its callers rely on: `dispatch` for
|
|
3
|
+
* Node's fetch, `close` and `destroy` to shut it down.
|
|
4
|
+
*
|
|
5
|
+
* Typed structurally rather than from one undici version, because an app can hold undici 6, 7
|
|
6
|
+
* or 8 (undici 6 is already at the root of a default app). The type accepts all three, but at
|
|
7
|
+
* runtime Node 22 and 24's fetch only works with undici 6 and 7 agents directly: an undici 8
|
|
8
|
+
* dispatcher must be wrapped in undici's `Dispatcher1Wrapper`, as @strapi/core does for the proxy.
|
|
9
|
+
*
|
|
10
|
+
* Typed for assigning: the value read back can be closed and destroyed, but handing it to a
|
|
11
|
+
* specific undici (`request(url, { dispatcher })`, `setGlobalDispatcher`) needs a cast to that
|
|
12
|
+
* undici's `Dispatcher`.
|
|
13
|
+
*/
|
|
14
|
+
export interface Dispatcher {
|
|
15
|
+
dispatch(options: unknown, handler: unknown): boolean;
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
destroy(): Promise<void>;
|
|
18
|
+
}
|
|
2
19
|
/**
|
|
3
20
|
* strapi.fetch interface is currently an identical wrapper for Node fetch()
|
|
4
21
|
* See createStrapiFetch in strapi/utils
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/modules/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/modules/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IACtD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;;;KAIK;AAEL,MAAM,WAAW,KAAK;IACpB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnF,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/types",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.63.0",
|
|
4
4
|
"description": "Shared typescript types for Strapi internal use",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi"
|
|
@@ -65,19 +65,17 @@
|
|
|
65
65
|
"@casl/ability": "6.7.5",
|
|
66
66
|
"@koa/cors": "5.0.0",
|
|
67
67
|
"@koa/router": "12.0.2",
|
|
68
|
-
"@strapi/database": "5.
|
|
69
|
-
"@strapi/logger": "5.
|
|
70
|
-
"@strapi/permissions": "5.
|
|
71
|
-
"@strapi/utils": "5.
|
|
68
|
+
"@strapi/database": "5.63.0",
|
|
69
|
+
"@strapi/logger": "5.63.0",
|
|
70
|
+
"@strapi/permissions": "5.63.0",
|
|
71
|
+
"@strapi/utils": "5.63.0",
|
|
72
72
|
"@types/json-logic-js": "2.0.8",
|
|
73
|
+
"@types/lodash": "^4.14.191",
|
|
73
74
|
"commander": "8.3.0",
|
|
74
75
|
"croner": "10.0.1",
|
|
75
76
|
"json-logic-js": "2.0.5",
|
|
76
77
|
"koa": "2.16.4",
|
|
77
78
|
"koa-body": "6.0.1",
|
|
78
|
-
"typedoc": "0.28.19",
|
|
79
|
-
"typedoc-github-wiki-theme": "2.1.0",
|
|
80
|
-
"typedoc-plugin-markdown": "4.11.0",
|
|
81
79
|
"zod": "4.4.3"
|
|
82
80
|
},
|
|
83
81
|
"devDependencies": {
|
|
@@ -85,13 +83,26 @@
|
|
|
85
83
|
"@types/koa": "2.15.2",
|
|
86
84
|
"@types/koa__router": "12.0.0",
|
|
87
85
|
"@types/node": "22.20.0",
|
|
88
|
-
"
|
|
86
|
+
"@types/semver": "7.5.0",
|
|
87
|
+
"eslint-config-custom": "5.63.0",
|
|
89
88
|
"lodash": "4.18.1",
|
|
90
|
-
"
|
|
89
|
+
"semver": "7.7.4",
|
|
90
|
+
"tsconfig": "5.63.0",
|
|
91
|
+
"typedoc": "0.28.19",
|
|
92
|
+
"typedoc-github-wiki-theme": "2.1.0",
|
|
93
|
+
"typedoc-plugin-markdown": "4.11.0",
|
|
91
94
|
"typescript": "5.9.3",
|
|
92
95
|
"undici": "8.12.4",
|
|
93
96
|
"vitest": "catalog:",
|
|
94
|
-
"vitest-config": "5.
|
|
97
|
+
"vitest-config": "5.63.0"
|
|
98
|
+
},
|
|
99
|
+
"peerDependencies": {
|
|
100
|
+
"@types/koa": "^2.13.5 || ^3"
|
|
101
|
+
},
|
|
102
|
+
"peerDependenciesMeta": {
|
|
103
|
+
"@types/koa": {
|
|
104
|
+
"optional": true
|
|
105
|
+
}
|
|
95
106
|
},
|
|
96
107
|
"engines": {
|
|
97
108
|
"node": ">=22.0.0 <=26.x.x",
|