@strapi/types 5.0.0-beta.1 → 5.0.0-beta.11
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/strapi.d.ts +10 -23
- package/dist/core/strapi.d.ts.map +1 -1
- package/dist/data/component.d.ts +9 -0
- package/dist/data/component.d.ts.map +1 -1
- package/dist/data/constants.d.ts +3 -0
- package/dist/data/constants.d.ts.map +1 -1
- package/dist/data/content-type.d.ts +9 -0
- package/dist/data/content-type.d.ts.map +1 -1
- package/dist/data/entity.d.ts +6 -0
- package/dist/data/entity.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/uid.d.ts.map +1 -1
- package/dist/modules/documents/component-extension.d.ts +22 -0
- package/dist/modules/documents/component-extension.d.ts.map +1 -0
- package/dist/modules/documents/document-engine.d.ts +0 -1
- package/dist/modules/documents/index.d.ts +9 -3
- package/dist/modules/documents/index.d.ts.map +1 -1
- package/dist/modules/documents/middleware.d.ts +13 -8
- package/dist/modules/documents/middleware.d.ts.map +1 -1
- package/dist/modules/documents/params/document-engine.d.ts +24 -11
- package/dist/modules/documents/params/document-engine.d.ts.map +1 -1
- package/dist/modules/documents/params/filters/index.d.ts.map +1 -1
- package/dist/modules/documents/params/index.d.ts +16 -4
- package/dist/modules/documents/params/index.d.ts.map +1 -1
- package/dist/modules/documents/params/locale.d.ts +4 -0
- package/dist/modules/documents/params/locale.d.ts.map +1 -0
- package/dist/modules/documents/params/populate.d.ts +3 -5
- package/dist/modules/documents/params/populate.d.ts.map +1 -1
- package/dist/modules/documents/result/document-engine.d.ts +12 -8
- package/dist/modules/documents/result/document-engine.d.ts.map +1 -1
- package/dist/modules/documents/result/index.d.ts.map +1 -1
- package/dist/modules/documents/service-instance.d.ts +40 -15
- package/dist/modules/documents/service-instance.d.ts.map +1 -1
- package/dist/modules/entity-service/params/attributes/relation.d.ts +1 -1
- package/dist/modules/entity-service/params/attributes/relation.d.ts.map +1 -1
- package/dist/modules/entity-service/params/filters/index.d.ts.map +1 -1
- package/dist/modules/entity-service/params/populate.d.ts +4 -6
- package/dist/modules/entity-service/params/populate.d.ts.map +1 -1
- package/dist/modules/entity-service/params/sort.d.ts.map +1 -1
- package/dist/modules/entity-service/result.d.ts.map +1 -1
- package/dist/modules/event-hub.d.ts +1 -0
- package/dist/modules/event-hub.d.ts.map +1 -1
- package/dist/modules/features.d.ts +0 -1
- package/dist/modules/features.d.ts.map +1 -1
- package/dist/public/registries.d.ts +38 -0
- package/dist/public/registries.d.ts.map +1 -1
- package/dist/public/shared.d.ts +53 -0
- package/dist/public/shared.d.ts.map +1 -1
- package/dist/schema/attribute/base.d.ts +43 -4
- package/dist/schema/attribute/base.d.ts.map +1 -1
- package/dist/schema/attribute/common.d.ts +9 -0
- package/dist/schema/attribute/common.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/biginteger.d.ts +3 -0
- package/dist/schema/attribute/definitions/biginteger.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/blocks.d.ts +4 -0
- package/dist/schema/attribute/definitions/blocks.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/boolean.d.ts +3 -0
- package/dist/schema/attribute/definitions/boolean.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/component.d.ts +3 -0
- package/dist/schema/attribute/definitions/component.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/date-time.d.ts +3 -0
- package/dist/schema/attribute/definitions/date-time.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/date.d.ts +3 -0
- package/dist/schema/attribute/definitions/date.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/decimal.d.ts +3 -0
- package/dist/schema/attribute/definitions/decimal.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/dynamic-zone.d.ts +3 -0
- package/dist/schema/attribute/definitions/dynamic-zone.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/email.d.ts +3 -0
- package/dist/schema/attribute/definitions/email.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/enumeration.d.ts +3 -0
- package/dist/schema/attribute/definitions/enumeration.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/float.d.ts +3 -0
- package/dist/schema/attribute/definitions/float.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/integer.d.ts +3 -0
- package/dist/schema/attribute/definitions/integer.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/json.d.ts +3 -0
- package/dist/schema/attribute/definitions/json.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/media.d.ts +3 -0
- package/dist/schema/attribute/definitions/media.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/password.d.ts +3 -0
- package/dist/schema/attribute/definitions/password.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/relation.d.ts +3 -0
- package/dist/schema/attribute/definitions/relation.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/richtext.d.ts +3 -0
- package/dist/schema/attribute/definitions/richtext.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/string.d.ts +6 -0
- package/dist/schema/attribute/definitions/string.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/text.d.ts +3 -0
- package/dist/schema/attribute/definitions/text.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/time.d.ts +3 -0
- package/dist/schema/attribute/definitions/time.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/timestamp.d.ts +3 -0
- package/dist/schema/attribute/definitions/timestamp.d.ts.map +1 -1
- package/dist/schema/attribute/definitions/uid.d.ts +3 -0
- package/dist/schema/attribute/definitions/uid.d.ts.map +1 -1
- package/dist/schema/attribute/options.d.ts +140 -0
- package/dist/schema/attribute/options.d.ts.map +1 -1
- package/dist/schema/attribute/utils.d.ts +41 -0
- package/dist/schema/attribute/utils.d.ts.map +1 -1
- package/dist/schema/index.d.ts +75 -2
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/struct/schema.d.ts +135 -31
- package/dist/struct/schema.d.ts.map +1 -1
- package/dist/uid/index.d.ts +134 -9
- package/dist/uid/index.d.ts.map +1 -1
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/index.d.ts +26 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/string.d.ts.map +1 -1
- package/package.json +16 -14
package/dist/uid/index.d.ts
CHANGED
|
@@ -3,41 +3,166 @@ import type * as Struct from '../struct';
|
|
|
3
3
|
import type { Constants, Guard, Object, Extends, Or } from '../utils';
|
|
4
4
|
import type * as Public from '../public';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Combines ContentType and Component UID types in a single union type.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* `UID.Schema` provides the ability to deal with both content types and components through one streamlined type.
|
|
9
|
+
*
|
|
10
|
+
* It hinges on underlying schema registries, which aggregates and maps unique identifiers to their respective schemas.
|
|
11
|
+
*
|
|
12
|
+
* This type would typically be used where the context is not particular about dealing with content types or components exclusively but rather any kind of schema.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* Let's assume we need a function that processes schema irrespective of whether it's ContenType or Component.
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import type { UID } from '@strapi/types';
|
|
19
|
+
*
|
|
20
|
+
* function processSchema(schemaID: UID.Schema) {
|
|
21
|
+
* // Implementation goes here...
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* // Now, calling processSchema() with uid of content type
|
|
25
|
+
* processSchema('api::foo.foo');
|
|
26
|
+
*
|
|
27
|
+
* // And calling processSchema() with uid of component
|
|
28
|
+
* processSchema('default.foo');
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link ContentType} Identifier for content types based on the public registry.
|
|
32
|
+
* @see {@link Component} Identifier for components based on the public registry.
|
|
9
33
|
*/
|
|
10
34
|
export type Schema = ContentType | Component;
|
|
11
35
|
/**
|
|
12
|
-
*
|
|
36
|
+
* Unique identifiers for any content-type defined in the public content-type registry.
|
|
37
|
+
*
|
|
38
|
+
* Useful when it's required to work with data structures that can only be identified by the underlying content-type UID.
|
|
39
|
+
*
|
|
40
|
+
* When no content-types are declared in the registry, it uses the generic {@link Internal.UID.ContentType} instead.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* Here's an example of how to use the `UID.ContentType` type:
|
|
44
|
+
*
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import type { UID } from '@strapi/types';
|
|
47
|
+
*
|
|
48
|
+
* // Assume we have a function that requires a ContentType UID
|
|
49
|
+
* function fetchSchema(uid: UID.ContentType) {
|
|
50
|
+
* // Implementation goes here...
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // Now you can pass the unique identifier for a content type to fetch its schema
|
|
54
|
+
* fetchSchema('api::foo.foo');
|
|
55
|
+
* ```
|
|
56
|
+
* @see {@link Public.ContentTypeSchemas} Content-type public registry.
|
|
57
|
+
* @see {@link UID.ContentType} ContentType UID format definition.
|
|
13
58
|
*/
|
|
14
59
|
export type ContentType = Internal.Registry.Keys<Public.ContentTypeSchemas, Internal.UID.ContentType>;
|
|
15
60
|
/**
|
|
16
|
-
*
|
|
61
|
+
* Unique identifiers for any component defined in the public component registry.
|
|
62
|
+
*
|
|
63
|
+
* Useful when it's required to work with data structures that can only be identified by the underlying component UID.
|
|
64
|
+
*
|
|
65
|
+
* When no component are declared in the registry, it uses the generic {@link Internal.UID.Component} instead.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* Here's an example of how to use the `UID.Component` type:
|
|
69
|
+
*
|
|
70
|
+
* ```typescript
|
|
71
|
+
* import type { UID } from '@strapi/types';
|
|
72
|
+
*
|
|
73
|
+
* // Assume we have a function that requires a Component UID
|
|
74
|
+
* function fetchSchema(uid: UID.Component) {
|
|
75
|
+
* // Implementation goes here...
|
|
76
|
+
* }
|
|
77
|
+
*
|
|
78
|
+
* // Now you can pass the unique identifier for a component to fetch its schema
|
|
79
|
+
* fetchSchema('default.foo');
|
|
80
|
+
* ```
|
|
81
|
+
* @see {@link Public.ComponentSchemas} Component public registry.
|
|
82
|
+
* @see {@link UID.Component} Component UID format definition.
|
|
17
83
|
*/
|
|
18
84
|
export type Component = Internal.Registry.Keys<Public.ComponentSchemas, Internal.UID.Component>;
|
|
19
85
|
/**
|
|
20
|
-
*
|
|
86
|
+
* Obtains a union of every component's category from the public component registry.
|
|
87
|
+
*
|
|
88
|
+
* It utilizes [conditional types inference](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#inferring-within-conditional-types) to extract the category name from the components' UID.
|
|
89
|
+
*
|
|
90
|
+
* The component UID format is a string that follows a specific pattern defined by {@link Internal.UID.Component}.
|
|
91
|
+
* If a type extends `Internal.UID.Component`, it implies that it has a structure with `TCategory` string as the category name of the component.
|
|
92
|
+
*
|
|
93
|
+
* @see {@link Internal.UID.Component} for more details on how the component's unique identifier is structured.
|
|
21
94
|
*/
|
|
22
95
|
export type ComponentCategory = Component extends Internal.UID.Component<infer TCategory> ? TCategory : never;
|
|
23
96
|
/**
|
|
24
|
-
* Collection-
|
|
97
|
+
* Collection-Type UID based on the public content-type registry
|
|
25
98
|
*
|
|
26
|
-
* If no collection type is found,
|
|
99
|
+
* If no collection type is found, it fallbacks to a generic content-type UID.
|
|
27
100
|
*/
|
|
28
101
|
export type CollectionType = Guard.Never<Extract<Object.KeysBy<Public.ContentTypeSchemas, Struct.CollectionTypeSchema>, ContentType>, Internal.UID.ContentType>;
|
|
29
102
|
/**
|
|
30
|
-
* Single-Type
|
|
103
|
+
* Single-Type UID based on the public content-type registry
|
|
31
104
|
*
|
|
32
|
-
* If no
|
|
105
|
+
* If no single type is found, it falls back to a generic content-type UID.
|
|
33
106
|
*/
|
|
34
107
|
export type SingleType = Guard.Never<Extract<Object.KeysBy<Public.ContentTypeSchemas, Struct.SingleTypeSchema>, ContentType>, Internal.UID.ContentType>;
|
|
108
|
+
/**
|
|
109
|
+
* Service UID based on the public service registry
|
|
110
|
+
*
|
|
111
|
+
* @see {Public.Services}
|
|
112
|
+
*/
|
|
35
113
|
export type Service = Internal.Registry.Keys<Public.Services, Internal.UID.Service>;
|
|
114
|
+
/**
|
|
115
|
+
* Controller UID based on the public service registry
|
|
116
|
+
*
|
|
117
|
+
* @see {Public.Controllers}
|
|
118
|
+
*/
|
|
36
119
|
export type Controller = Internal.Registry.Keys<Public.Controllers, Internal.UID.Controller>;
|
|
120
|
+
/**
|
|
121
|
+
* Policy UID based on the public service registry
|
|
122
|
+
*
|
|
123
|
+
* @see {Public.Policies}
|
|
124
|
+
*/
|
|
37
125
|
export type Policy = Internal.Registry.Keys<Public.Policies, Internal.UID.Policy>;
|
|
126
|
+
/**
|
|
127
|
+
* Middleware UID based on the public service registry
|
|
128
|
+
*
|
|
129
|
+
* @see {Public.Middlewares}
|
|
130
|
+
*/
|
|
38
131
|
export type Middleware = Internal.Registry.Keys<Public.Middlewares, Internal.UID.Middleware>;
|
|
132
|
+
/**
|
|
133
|
+
* Verifies if a certain schema UIDs correspond to a collection type.
|
|
134
|
+
*
|
|
135
|
+
* Given a schema UID, it checks if it matches the {@link CollectionType} UID type. Since {@link CollectionType}
|
|
136
|
+
* can resolve to the more generic {@link ContentType} type, we also need to check that the associated
|
|
137
|
+
* schema extends the {@link Struct.CollectionTypeSchema} data structure.
|
|
138
|
+
*
|
|
139
|
+
* @template TSchemaUID - The UID of the schema
|
|
140
|
+
*/
|
|
39
141
|
export type IsCollectionType<TSchemaUID extends Schema> = TSchemaUID extends CollectionType ? Extends<Public.ContentTypeSchemas[TSchemaUID], Struct.CollectionTypeSchema> : Constants.False;
|
|
142
|
+
/**
|
|
143
|
+
* Verifies if a certain schema UIDs correspond to a single type.
|
|
144
|
+
*
|
|
145
|
+
* Given a schema UID, it checks if it matches the {@link SingleType} UID type. Since {@link SingleType}
|
|
146
|
+
* can resolve to the more generic {@link ContentType} type, we also need to check that the associated
|
|
147
|
+
* schema extends the {@link Struct.CollectionTypeSchema} data structure.
|
|
148
|
+
*
|
|
149
|
+
* @template TSchemaUID - The UID of the schema
|
|
150
|
+
*/
|
|
40
151
|
export type IsSingleType<TSchemaUID extends Schema> = TSchemaUID extends SingleType ? Extends<Public.ContentTypeSchemas[TSchemaUID], Struct.SingleTypeSchema> : Constants.False;
|
|
152
|
+
/**
|
|
153
|
+
* Verifies if a certain schema UIDs correspond to a component.
|
|
154
|
+
*
|
|
155
|
+
* Given a schema UID, it checks if it matches the {@link Component} UID type.
|
|
156
|
+
*
|
|
157
|
+
* @template TSchemaUID - The UID of the schema
|
|
158
|
+
*/
|
|
41
159
|
export type IsComponent<TSchemaUID extends Schema> = TSchemaUID extends Component ? Extends<Public.ComponentSchemas[TSchemaUID], Struct.ComponentSchema> : Constants.False;
|
|
160
|
+
/**
|
|
161
|
+
* Verifies if a certain schema UIDs correspond to a content-type.
|
|
162
|
+
*
|
|
163
|
+
* Given a schema UID, it checks if it matches the {@link ContentType} UID type.
|
|
164
|
+
*
|
|
165
|
+
* @template TSchemaUID - The UID of the schema
|
|
166
|
+
*/
|
|
42
167
|
export type IsContentType<TSchemaUID extends Schema> = TSchemaUID extends ContentType ? Or<IsCollectionType<TSchemaUID>, IsSingleType<TSchemaUID>> : Constants.False;
|
|
43
168
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/uid/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,MAAM,WAAW,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAA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CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,GACpE,SAAS,CAAC,KAAK,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,CAAC,UAAU,SAAS,MAAM,IAAI,UAAU,SAAS,WAAW,GACjF,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,GAC1D,SAAS,CAAC,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,MAAM,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,MAAM,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IACnD,WAAW,SAAS,KAAK,CAAC,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,OAAO,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,UAAU,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -177,4 +177,30 @@ export type Cast<TValue, TType> = TValue extends TType ? TValue : never;
|
|
|
177
177
|
* This type can be useful when working with partial data and object methods that contain a pseudo `this` context.
|
|
178
178
|
*/
|
|
179
179
|
export type PartialWithThis<T> = Partial<T> & ThisType<T>;
|
|
180
|
+
/**
|
|
181
|
+
* Enforce mutually exclusive properties.
|
|
182
|
+
*
|
|
183
|
+
* The `OneOf<T, U>` type ensures that either properties of type {@link T} or properties of type {@link U} are present,
|
|
184
|
+
* but never both at the same time. It is useful for defining states where you want to
|
|
185
|
+
* have exactly one of two possible sets of properties.
|
|
186
|
+
*
|
|
187
|
+
* @template T - The first set of properties.
|
|
188
|
+
* @template U - The second set of properties.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* // Define a type where you either have data or an error, but not both:
|
|
192
|
+
* type Response = OneOf<
|
|
193
|
+
* { data: Data },
|
|
194
|
+
* { error: ApplicationError | ValidationError }
|
|
195
|
+
* >;
|
|
196
|
+
*
|
|
197
|
+
* // Is equivalent to:
|
|
198
|
+
* type Response = { data: Data, error: never } | { data: never, error: ApplicationError | ValidationError };
|
|
199
|
+
*
|
|
200
|
+
*/
|
|
201
|
+
export type OneOf<T, U> = (T & {
|
|
202
|
+
[K in keyof U]?: never;
|
|
203
|
+
}) | (U & {
|
|
204
|
+
[K in keyof T]?: never;
|
|
205
|
+
});
|
|
180
206
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,QAAQ,MAA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,SAAS,OAAO,IAAI,OAAO,CAC5E,MAAM,EACN,GAAG,MAAM,GAAG,OAAO,EAAE,CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,UAAU,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,SAAS,OAAO,IAAI,OAAO,CAC9E,MAAM,EACN,GAAG,OAAO,GAAG,MAAM,EAAE,CACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/types",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.11",
|
|
4
4
|
"description": "Shared typescript types for Strapi internal use",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi"
|
|
@@ -44,33 +44,35 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@casl/ability": "6.5.0",
|
|
47
|
-
"@koa/cors": "
|
|
48
|
-
"@koa/router": "
|
|
49
|
-
"@strapi/database": "5.0.0-beta.
|
|
50
|
-
"@strapi/logger": "5.0.0-beta.
|
|
51
|
-
"@strapi/permissions": "5.0.0-beta.
|
|
52
|
-
"@strapi/utils": "5.0.0-beta.
|
|
47
|
+
"@koa/cors": "5.0.0",
|
|
48
|
+
"@koa/router": "12.0.1",
|
|
49
|
+
"@strapi/database": "5.0.0-beta.11",
|
|
50
|
+
"@strapi/logger": "5.0.0-beta.11",
|
|
51
|
+
"@strapi/permissions": "5.0.0-beta.11",
|
|
52
|
+
"@strapi/utils": "5.0.0-beta.11",
|
|
53
53
|
"commander": "8.3.0",
|
|
54
|
-
"koa": "2.
|
|
54
|
+
"koa": "2.15.2",
|
|
55
55
|
"node-schedule": "2.1.0",
|
|
56
|
-
"typedoc": "0.25.10"
|
|
56
|
+
"typedoc": "0.25.10",
|
|
57
|
+
"typedoc-github-wiki-theme": "1.1.0",
|
|
58
|
+
"typedoc-plugin-markdown": "3.17.1"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
59
|
-
"@strapi/pack-up": "5.0.0
|
|
61
|
+
"@strapi/pack-up": "5.0.0",
|
|
60
62
|
"@strapi/ts-zen": "^0.2.0",
|
|
61
63
|
"@types/jest": "29.5.2",
|
|
62
64
|
"@types/koa": "2.13.4",
|
|
63
65
|
"@types/koa__router": "12.0.0",
|
|
64
66
|
"@types/node-schedule": "2.1.0",
|
|
65
|
-
"eslint-config-custom": "5.0.0-beta.
|
|
67
|
+
"eslint-config-custom": "5.0.0-beta.11",
|
|
66
68
|
"lodash": "4.17.21",
|
|
67
|
-
"tsconfig": "5.0.0-beta.
|
|
69
|
+
"tsconfig": "5.0.0-beta.11",
|
|
68
70
|
"typescript": "5.3.2",
|
|
69
|
-
"undici": "
|
|
71
|
+
"undici": "6.18.2"
|
|
70
72
|
},
|
|
71
73
|
"engines": {
|
|
72
74
|
"node": ">=18.0.0 <=20.x.x",
|
|
73
75
|
"npm": ">=6.0.0"
|
|
74
76
|
},
|
|
75
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "0991f0ac0f739e43e6a5f9ac79acb8c774c359bf"
|
|
76
78
|
}
|