@strapi/types 0.0.0-experimental-5f65fd6451f1d729b3c96ecb2fadc01878e2f888
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/LICENSE +22 -0
- package/README.md +5 -0
- package/dist/container.d.ts +6 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/index.d.ts +139 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/modules/auth.d.ts +25 -0
- package/dist/modules/auth.d.ts.map +1 -0
- package/dist/modules/content-api.d.ts +30 -0
- package/dist/modules/content-api.d.ts.map +1 -0
- package/dist/modules/core-store.d.ts +28 -0
- package/dist/modules/core-store.d.ts.map +1 -0
- package/dist/modules/cron.d.ts +27 -0
- package/dist/modules/cron.d.ts.map +1 -0
- package/dist/modules/custom-fields.d.ts +25 -0
- package/dist/modules/custom-fields.d.ts.map +1 -0
- package/dist/modules/entity-service/index.d.ts +74 -0
- package/dist/modules/entity-service/index.d.ts.map +1 -0
- package/dist/modules/entity-service/params/attributes.d.ts +75 -0
- package/dist/modules/entity-service/params/attributes.d.ts.map +1 -0
- package/dist/modules/entity-service/params/data.d.ts +4 -0
- package/dist/modules/entity-service/params/data.d.ts.map +1 -0
- package/dist/modules/entity-service/params/fields.d.ts +59 -0
- package/dist/modules/entity-service/params/fields.d.ts.map +1 -0
- package/dist/modules/entity-service/params/filters/index.d.ts +54 -0
- package/dist/modules/entity-service/params/filters/index.d.ts.map +1 -0
- package/dist/modules/entity-service/params/filters/operators.d.ts +9 -0
- package/dist/modules/entity-service/params/filters/operators.d.ts.map +1 -0
- package/dist/modules/entity-service/params/index.d.ts +133 -0
- package/dist/modules/entity-service/params/index.d.ts.map +1 -0
- package/dist/modules/entity-service/params/pagination.d.ts +11 -0
- package/dist/modules/entity-service/params/pagination.d.ts.map +1 -0
- package/dist/modules/entity-service/params/populate.d.ts +69 -0
- package/dist/modules/entity-service/params/populate.d.ts.map +1 -0
- package/dist/modules/entity-service/params/publication-state.d.ts +16 -0
- package/dist/modules/entity-service/params/publication-state.d.ts.map +1 -0
- package/dist/modules/entity-service/params/search.d.ts +2 -0
- package/dist/modules/entity-service/params/search.d.ts.map +1 -0
- package/dist/modules/entity-service/params/sort.d.ts +85 -0
- package/dist/modules/entity-service/params/sort.d.ts.map +1 -0
- package/dist/modules/entity-service/plugin.d.ts +8 -0
- package/dist/modules/entity-service/plugin.d.ts.map +1 -0
- package/dist/modules/entity-service/result.d.ts +89 -0
- package/dist/modules/entity-service/result.d.ts.map +1 -0
- package/dist/modules/entity-validator.d.ts +19 -0
- package/dist/modules/entity-validator.d.ts.map +1 -0
- package/dist/modules/event-hub.d.ts +15 -0
- package/dist/modules/event-hub.d.ts.map +1 -0
- package/dist/modules/fetch.d.ts +7 -0
- package/dist/modules/fetch.d.ts.map +1 -0
- package/dist/modules/metrics.d.ts +8 -0
- package/dist/modules/metrics.d.ts.map +1 -0
- package/dist/modules/request-context.d.ts +6 -0
- package/dist/modules/request-context.d.ts.map +1 -0
- package/dist/modules/sanitizers.d.ts +9 -0
- package/dist/modules/sanitizers.d.ts.map +1 -0
- package/dist/modules/server.d.ts +31 -0
- package/dist/modules/server.d.ts.map +1 -0
- package/dist/modules/validators.d.ts +9 -0
- package/dist/modules/validators.d.ts.map +1 -0
- package/dist/modules/webhook-runner.d.ts +16 -0
- package/dist/modules/webhook-runner.d.ts.map +1 -0
- package/dist/modules/webhook-store.d.ts +21 -0
- package/dist/modules/webhook-store.d.ts.map +1 -0
- package/dist/types/core/attributes/base.d.ts +52 -0
- package/dist/types/core/attributes/base.d.ts.map +1 -0
- package/dist/types/core/attributes/biginteger.d.ts +5 -0
- package/dist/types/core/attributes/biginteger.d.ts.map +1 -0
- package/dist/types/core/attributes/blocks.d.ts +5 -0
- package/dist/types/core/attributes/blocks.d.ts.map +1 -0
- package/dist/types/core/attributes/boolean.d.ts +7 -0
- package/dist/types/core/attributes/boolean.d.ts.map +1 -0
- package/dist/types/core/attributes/common.d.ts +59 -0
- package/dist/types/core/attributes/common.d.ts.map +1 -0
- package/dist/types/core/attributes/component.d.ts +11 -0
- package/dist/types/core/attributes/component.d.ts.map +1 -0
- package/dist/types/core/attributes/date-time.d.ts +5 -0
- package/dist/types/core/attributes/date-time.d.ts.map +1 -0
- package/dist/types/core/attributes/date.d.ts +5 -0
- package/dist/types/core/attributes/date.d.ts.map +1 -0
- package/dist/types/core/attributes/decimal.d.ts +5 -0
- package/dist/types/core/attributes/decimal.d.ts.map +1 -0
- package/dist/types/core/attributes/dynamic-zone.d.ts +13 -0
- package/dist/types/core/attributes/dynamic-zone.d.ts.map +1 -0
- package/dist/types/core/attributes/email.d.ts +5 -0
- package/dist/types/core/attributes/email.d.ts.map +1 -0
- package/dist/types/core/attributes/enumeration.d.ts +9 -0
- package/dist/types/core/attributes/enumeration.d.ts.map +1 -0
- package/dist/types/core/attributes/float.d.ts +5 -0
- package/dist/types/core/attributes/float.d.ts.map +1 -0
- package/dist/types/core/attributes/index.d.ts +26 -0
- package/dist/types/core/attributes/index.d.ts.map +1 -0
- package/dist/types/core/attributes/integer.d.ts +5 -0
- package/dist/types/core/attributes/integer.d.ts.map +1 -0
- package/dist/types/core/attributes/json.d.ts +5 -0
- package/dist/types/core/attributes/json.d.ts.map +1 -0
- package/dist/types/core/attributes/media.d.ts +13 -0
- package/dist/types/core/attributes/media.d.ts.map +1 -0
- package/dist/types/core/attributes/password.d.ts +5 -0
- package/dist/types/core/attributes/password.d.ts.map +1 -0
- package/dist/types/core/attributes/relation.d.ts +76 -0
- package/dist/types/core/attributes/relation.d.ts.map +1 -0
- package/dist/types/core/attributes/richtext.d.ts +5 -0
- package/dist/types/core/attributes/richtext.d.ts.map +1 -0
- package/dist/types/core/attributes/string.d.ts +10 -0
- package/dist/types/core/attributes/string.d.ts.map +1 -0
- package/dist/types/core/attributes/text.d.ts +8 -0
- package/dist/types/core/attributes/text.d.ts.map +1 -0
- package/dist/types/core/attributes/time.d.ts +5 -0
- package/dist/types/core/attributes/time.d.ts.map +1 -0
- package/dist/types/core/attributes/timestamp.d.ts +5 -0
- package/dist/types/core/attributes/timestamp.d.ts.map +1 -0
- package/dist/types/core/attributes/uid.d.ts +16 -0
- package/dist/types/core/attributes/uid.d.ts.map +1 -0
- package/dist/types/core/attributes/utils.d.ts +28 -0
- package/dist/types/core/attributes/utils.d.ts.map +1 -0
- package/dist/types/core/commands/index.d.ts +6 -0
- package/dist/types/core/commands/index.d.ts.map +1 -0
- package/dist/types/core/common/api.d.ts +4 -0
- package/dist/types/core/common/api.d.ts.map +1 -0
- package/dist/types/core/common/controller.d.ts +6 -0
- package/dist/types/core/common/controller.d.ts.map +1 -0
- package/dist/types/core/common/index.d.ts +19 -0
- package/dist/types/core/common/index.d.ts.map +1 -0
- package/dist/types/core/common/middleware.d.ts +8 -0
- package/dist/types/core/common/middleware.d.ts.map +1 -0
- package/dist/types/core/common/module.d.ts +25 -0
- package/dist/types/core/common/module.d.ts.map +1 -0
- package/dist/types/core/common/plugin.d.ts +6 -0
- package/dist/types/core/common/plugin.d.ts.map +1 -0
- package/dist/types/core/common/policy.d.ts +10 -0
- package/dist/types/core/common/policy.d.ts.map +1 -0
- package/dist/types/core/common/router.d.ts +35 -0
- package/dist/types/core/common/router.d.ts.map +1 -0
- package/dist/types/core/common/schema.d.ts +3 -0
- package/dist/types/core/common/schema.d.ts.map +1 -0
- package/dist/types/core/common/service.d.ts +4 -0
- package/dist/types/core/common/service.d.ts.map +1 -0
- package/dist/types/core/common/uid.d.ts +16 -0
- package/dist/types/core/common/uid.d.ts.map +1 -0
- package/dist/types/core/entity/index.d.ts +2 -0
- package/dist/types/core/entity/index.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +19 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/namespace.d.ts +78 -0
- package/dist/types/core/namespace.d.ts.map +1 -0
- package/dist/types/core/plugins/config/index.d.ts +3 -0
- package/dist/types/core/plugins/config/index.d.ts.map +1 -0
- package/dist/types/core/plugins/config/strapi-admin/index.d.ts +8 -0
- package/dist/types/core/plugins/config/strapi-admin/index.d.ts.map +1 -0
- package/dist/types/core/plugins/config/strapi-server/config.d.ts +8 -0
- package/dist/types/core/plugins/config/strapi-server/config.d.ts.map +1 -0
- package/dist/types/core/plugins/config/strapi-server/content-types.d.ts +11 -0
- package/dist/types/core/plugins/config/strapi-server/content-types.d.ts.map +1 -0
- package/dist/types/core/plugins/config/strapi-server/controllers.d.ts +8 -0
- package/dist/types/core/plugins/config/strapi-server/controllers.d.ts.map +1 -0
- package/dist/types/core/plugins/config/strapi-server/index.d.ts +21 -0
- package/dist/types/core/plugins/config/strapi-server/index.d.ts.map +1 -0
- package/dist/types/core/plugins/config/strapi-server/lifecycle.d.ts +8 -0
- package/dist/types/core/plugins/config/strapi-server/lifecycle.d.ts.map +1 -0
- package/dist/types/core/plugins/config/strapi-server/routes.d.ts +11 -0
- package/dist/types/core/plugins/config/strapi-server/routes.d.ts.map +1 -0
- package/dist/types/core/plugins/index.d.ts +33 -0
- package/dist/types/core/plugins/index.d.ts.map +1 -0
- package/dist/types/core/registry.d.ts +58 -0
- package/dist/types/core/registry.d.ts.map +1 -0
- package/dist/types/core/schemas/index.d.ts +125 -0
- package/dist/types/core/schemas/index.d.ts.map +1 -0
- package/dist/types/core/strapi/index.d.ts +26 -0
- package/dist/types/core/strapi/index.d.ts.map +1 -0
- package/dist/types/core/uid.d.ts +109 -0
- package/dist/types/core/uid.d.ts.map +1 -0
- package/dist/types/core-api/controller.d.ts +45 -0
- package/dist/types/core-api/controller.d.ts.map +1 -0
- package/dist/types/core-api/index.d.ts +4 -0
- package/dist/types/core-api/index.d.ts.map +1 -0
- package/dist/types/core-api/router.d.ts +63 -0
- package/dist/types/core-api/router.d.ts.map +1 -0
- package/dist/types/core-api/service.d.ts +66 -0
- package/dist/types/core-api/service.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/shared/index.d.ts +4 -0
- package/dist/types/shared/index.d.ts.map +1 -0
- package/dist/types/shared/registries.d.ts +38 -0
- package/dist/types/shared/registries.d.ts.map +1 -0
- package/dist/types/utils/array.d.ts +16 -0
- package/dist/types/utils/array.d.ts.map +1 -0
- package/dist/types/utils/expression.d.ts +43 -0
- package/dist/types/utils/expression.d.ts.map +1 -0
- package/dist/types/utils/function.d.ts +3 -0
- package/dist/types/utils/function.d.ts.map +1 -0
- package/dist/types/utils/guard.d.ts +20 -0
- package/dist/types/utils/guard.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +26 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/object.d.ts +69 -0
- package/dist/types/utils/object.d.ts.map +1 -0
- package/dist/types/utils/string.d.ts +40 -0
- package/dist/types/utils/string.d.ts.map +1 -0
- package/dist/types/utils/tuple.d.ts +9 -0
- package/dist/types/utils/tuple.d.ts.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Attribute } from '..';
|
|
2
|
+
export interface StringProperties {
|
|
3
|
+
regex?: RegExp;
|
|
4
|
+
}
|
|
5
|
+
type StringAttribute = Attribute.OfType<'string'> & StringProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<StringValue> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption;
|
|
6
|
+
export type StringValue = string;
|
|
7
|
+
export type GetStringValue<T extends Attribute.Attribute> = T extends StringAttribute ? StringValue : never;
|
|
8
|
+
export type String = StringAttribute;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../src/types/core/attributes/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,eAAe,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAE/C,gBAAgB,GAEhB,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,GACpC,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,GACvB,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,aAAa,CAAC;AAE1B,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,eAAe,GACjF,WAAW,GACX,KAAK,CAAC;AAEV,MAAM,MAAM,MAAM,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Attribute } from '..';
|
|
2
|
+
export interface TextProperties {
|
|
3
|
+
regex?: RegExp;
|
|
4
|
+
}
|
|
5
|
+
export type Text = Attribute.OfType<'text'> & TextProperties & Attribute.ConfigurableOption & Attribute.DefaultOption<TextValue> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.UniqueOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption;
|
|
6
|
+
export type TextValue = string;
|
|
7
|
+
export type GetTextValue<T extends Attribute.Attribute> = T extends Text ? TextValue : never;
|
|
8
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/types/core/attributes/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,GAEzC,cAAc,GAEd,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,GAClC,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,GACvB,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,aAAa,CAAC;AAE1B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Attribute } from '..';
|
|
2
|
+
export type Time = Attribute.OfType<'time'> & Attribute.ConfigurableOption & Attribute.DefaultOption<TimeValue> & Attribute.PrivateOption & Attribute.RequiredOption & Attribute.UniqueOption & Attribute.WritableOption & Attribute.VisibleOption;
|
|
3
|
+
export type TimeValue = globalThis.Date | string;
|
|
4
|
+
export type GetTimeValue<T extends Attribute.Attribute> = T extends Time ? TimeValue : never;
|
|
5
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../src/types/core/attributes/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,GAEzC,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,GAClC,SAAS,CAAC,aAAa,GACvB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,aAAa,CAAC;AAE1B,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Attribute } from '..';
|
|
2
|
+
export type Timestamp = Attribute.OfType<'timestamp'> & Attribute.ConfigurableOption & Attribute.DefaultOption<TimestampValue> & Attribute.PrivateOption & Attribute.RequiredOption & Attribute.UniqueOption & Attribute.WritableOption & Attribute.VisibleOption;
|
|
3
|
+
export type TimestampValue = globalThis.Date | number | string;
|
|
4
|
+
export type GetTimestampValue<T extends Attribute.Attribute> = T extends Timestamp ? TimestampValue : never;
|
|
5
|
+
//# sourceMappingURL=timestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../src/types/core/attributes/timestamp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,GAEnD,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,GACvC,SAAS,CAAC,aAAa,GACvB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,aAAa,CAAC;AAE1B,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,SAAS,GAC9E,cAAc,GACd,KAAK,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Attribute, Common } from '..';
|
|
2
|
+
export interface UIDOptions {
|
|
3
|
+
separator?: string;
|
|
4
|
+
lowercase?: boolean;
|
|
5
|
+
decamelize?: boolean;
|
|
6
|
+
customReplacements?: Array<[string, string]>;
|
|
7
|
+
preserveLeadingUnderscore?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UIDProperties<TTargetAttribute extends string = string, TOptions extends UIDOptions = UIDOptions> {
|
|
10
|
+
targetField?: TTargetAttribute;
|
|
11
|
+
options?: UIDOptions & TOptions;
|
|
12
|
+
}
|
|
13
|
+
export type UID<_TOrigin extends Common.UID.Schema = never, TTargetAttribute extends string = string, TOptions extends UIDOptions = UIDOptions> = Attribute.OfType<'uid'> & UIDProperties<TTargetAttribute, TOptions> & Attribute.ConfigurableOption & Attribute.DefaultOption<UIDValue> & Attribute.MinMaxLengthOption & Attribute.PrivateOption & Attribute.RequiredOption & Attribute.WritableOption & Attribute.VisibleOption;
|
|
14
|
+
export type UIDValue = string;
|
|
15
|
+
export type GetUIDValue<TAttribute extends Attribute.Attribute> = TAttribute extends UID ? UIDValue : never;
|
|
16
|
+
//# sourceMappingURL=uid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../../../src/types/core/attributes/uid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,aAAa,CAC5B,gBAAgB,SAAS,MAAM,GAAG,MAAM,EACxC,QAAQ,SAAS,UAAU,GAAG,UAAU;IAExC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;CACjC;AAED,MAAM,MAAM,GAAG,CAKb,QAAQ,SAAS,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,EAC1C,gBAAgB,SAAS,MAAM,GAAG,MAAM,EACxC,QAAQ,SAAS,UAAU,GAAG,UAAU,IACtC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAEzB,aAAa,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAEzC,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC,GACjC,SAAS,CAAC,kBAAkB,GAC5B,SAAS,CAAC,aAAa,GACvB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,aAAa,CAAC;AAE1B,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,WAAW,CAAC,UAAU,SAAS,SAAS,CAAC,SAAS,IAAI,UAAU,SAAS,GAAG,GACpF,QAAQ,GACR,KAAK,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Attribute, Common, Entity } from '..';
|
|
2
|
+
import type { Utils } from '../..';
|
|
3
|
+
export type GetKeysByType<TSchemaUID extends Common.UID.Schema, TKind extends Attribute.Kind, TCondition = never> = Utils.Object.KeysBy<GetAll<TSchemaUID>, Attribute.OfType<TKind> & Utils.Guard.Never<TCondition, unknown>, string>;
|
|
4
|
+
export type GetByType<TSchemaUID extends Common.UID.Schema, TKind extends Attribute.Kind, TCondition = never> = Utils.Object.PickBy<GetAll<TSchemaUID>, Attribute.OfType<TKind> & Utils.Guard.Never<TCondition, unknown>>;
|
|
5
|
+
export type Get<TSchemaUID extends Common.UID.Schema, TKey extends GetKeys<TSchemaUID>> = Utils.Get<GetAll<TSchemaUID>, TKey>;
|
|
6
|
+
export type GetAll<TSchemaUID extends Common.UID.Schema> = Utils.Get<Common.Schemas[TSchemaUID], 'attributes'>;
|
|
7
|
+
export type GetTarget<TSchemaUID extends Common.UID.Schema, TKey extends GetKeys<TSchemaUID>> = Get<TSchemaUID, TKey> extends infer TAttribute extends Attribute.Attribute ? Attribute.GetRelationTarget<TAttribute> | Attribute.GetComponentTarget<TAttribute> | Attribute.GetMediaTarget<TAttribute> : never;
|
|
8
|
+
export type GetMorphTargets<TSchemaUID extends Common.UID.Schema, TKey extends GetKeys<TSchemaUID>> = Get<TSchemaUID, TKey> extends infer TAttribute extends Attribute.Attribute ? Attribute.GetDynamicZoneTargets<TAttribute> : never;
|
|
9
|
+
export type GetKeys<TSchemaUID extends Common.UID.Schema> = keyof GetAll<TSchemaUID> & string;
|
|
10
|
+
export type GetNonPopulatableKeys<TSchemaUID extends Common.UID.Schema> = GetKeysByType<TSchemaUID, Attribute.NonPopulatableKind>;
|
|
11
|
+
export type GetPopulatableKeys<TSchemaUID extends Common.UID.Schema> = GetKeysByType<TSchemaUID, Attribute.PopulatableKind>;
|
|
12
|
+
export type GetKeysWithTarget<TSchemaUID extends Common.UID.Schema> = keyof {
|
|
13
|
+
[key in GetKeys<TSchemaUID> as GetTarget<TSchemaUID, key> extends never ? never : key]: never;
|
|
14
|
+
} extends infer TKey extends GetKeys<TSchemaUID> ? TKey : never;
|
|
15
|
+
export type GetValue<TAttribute extends Attribute.Attribute, TGuard = unknown> = Utils.Guard.Never<Attribute.GetBigIntegerValue<TAttribute> | Attribute.GetBooleanValue<TAttribute> | Attribute.GetBlocksValue<TAttribute> | Attribute.GetComponentValue<TAttribute> | Attribute.GetDecimalValue<TAttribute> | Attribute.GetDynamicZoneValue<TAttribute> | Attribute.GetEnumerationValue<TAttribute> | Attribute.GetEmailValue<TAttribute> | Attribute.GetFloatValue<TAttribute> | Attribute.GetIntegerValue<TAttribute> | Attribute.GetJsonValue<TAttribute> | Attribute.GetMediaValue<TAttribute> | Attribute.GetPasswordValue<TAttribute> | Attribute.GetRelationValue<TAttribute> | Attribute.GetRichTextValue<TAttribute> | Attribute.GetStringValue<TAttribute> | Attribute.GetTextValue<TAttribute> | Attribute.GetUIDValue<TAttribute> | Attribute.GetDateValue<TAttribute> | Attribute.GetDateTimeValue<TAttribute> | Attribute.GetTimeValue<TAttribute> | Attribute.GetTimestampValue<TAttribute>, TGuard>;
|
|
16
|
+
export type GetValueByKey<TSchemaUID extends Common.UID.Schema, TKey extends GetKeys<TSchemaUID>> = Get<TSchemaUID, TKey> extends infer TAttribute extends Attribute.Attribute ? GetValue<TAttribute> : never;
|
|
17
|
+
export type GetValues<TSchemaUID extends Common.UID.Schema, TKey extends GetKeys<TSchemaUID> = GetKeys<TSchemaUID>> = {
|
|
18
|
+
id: Entity.ID;
|
|
19
|
+
} & {
|
|
20
|
+
[key in GetRequiredKeys<TSchemaUID> as key extends TKey ? key : never]-?: GetValueByKey<TSchemaUID, key>;
|
|
21
|
+
} & {
|
|
22
|
+
[key in GetOptionalKeys<TSchemaUID> as key extends TKey ? key : never]?: GetValueByKey<TSchemaUID, key>;
|
|
23
|
+
};
|
|
24
|
+
export type GetRequiredKeys<TSchemaUID extends Common.UID.Schema> = Utils.Object.KeysBy<GetAll<TSchemaUID>, Attribute.Required, string>;
|
|
25
|
+
export type GetOptionalKeys<TSchemaUID extends Common.UID.Schema> = Utils.Object.KeysExcept<GetAll<TSchemaUID>, Attribute.Required, string>;
|
|
26
|
+
export type HasTarget<TSchemaUID extends Common.UID.Schema, TField extends Attribute.GetKeys<TSchemaUID>> = GetTarget<TSchemaUID, TField> extends infer TTarget ? Utils.Expression.And<Utils.Expression.IsNotNever<TTarget>, Utils.Expression.Extends<TTarget, Common.UID.Schema>> : Utils.Expression.False;
|
|
27
|
+
export type HasMorphTargets<TSchemaUID extends Common.UID.Schema, TField extends Attribute.GetKeys<TSchemaUID>> = GetMorphTargets<TSchemaUID, TField> extends infer TMaybeTargets ? Utils.Expression.And<Utils.Expression.IsNotNever<TMaybeTargets>, Utils.Expression.Extends<TMaybeTargets, Common.UID.Schema>> : Utils.Expression.False;
|
|
28
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/types/core/attributes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,MAAM,MAAM,aAAa,CACvB,UAAU,SAAS,MAAM,CAAC,GAAG,CAAC,MAAM,EACpC,KAAK,SAAS,SAAS,CAAC,IAAI,EAC5B,UAAU,GAAG,KAAK,IAChB,KAAK,CAAC,MAAM,CAAC,MAAM,CACrB,MAAM,CAAC,UAAU,CAAC,EAClB,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,EAChE,MAAM,CACP,CAAC;AAEF,MAAM,MAAM,SAAS,CACnB,UAAU,SAAS,MAAM,CAAC,GAAG,CAAC,MAAM,EACpC,KAAK,SAAS,SAAS,CAAC,IAAI,EAC5B,UAAU,GAAG,KAAK,IAChB,KAAK,CAAC,MAAM,CAAC,MAAM,CACrB,MAAM,CAAC,UAAU,CAAC,EAClB,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CACjE,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,UAAU,SAAS,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,SAAS,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,GAAG,CACjG,MAAM,CAAC,UAAU,CAAC,EAClB,IAAI,CACL,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,UAAU,SAAS,MAAM,CAAC,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AAM,CAAC,GAAG,CAAC,MAAM,EACpC,MAAM,SAAS,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,IAC1C,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,MAAM,OAAO,GACnD,KAAK,CAAC,UAAU,CAAC,GAAG,CAClB,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EACpC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CACrD,GACD,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AAE3B,MAAM,MAAM,eAAe,CACzB,UAAU,SAAS,MAAM,CAAC,GAAG,CAAC,MAAM,EACpC,MAAM,SAAS,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,IAC1C,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,MAAM,aAAa,GAC/D,KAAK,CAAC,UAAU,CAAC,GAAG,CAClB,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,EAC1C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAC3D,GACD,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/core/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAEjC,MAAM,WAAW,GAAI,SAAQ,MAAM,CAAC,MAAM;CAAG"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context, Next } from 'koa';
|
|
2
|
+
export interface ControllerHandler<TResponse = unknown> {
|
|
3
|
+
(context: Context, next: Next): Promise<TResponse | void> | TResponse | void;
|
|
4
|
+
}
|
|
5
|
+
export type Controller = Record<string, ControllerHandler>;
|
|
6
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEzC,MAAM,WAAW,iBAAiB,CAAC,SAAS,GAAG,OAAO;IACpD,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CAE9E;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Utils, Attribute, Common } from '../..';
|
|
2
|
+
export * from './controller';
|
|
3
|
+
export * from './middleware';
|
|
4
|
+
export * from './policy';
|
|
5
|
+
export * from './service';
|
|
6
|
+
export * from './router';
|
|
7
|
+
export * from './schema';
|
|
8
|
+
export * as UID from './uid';
|
|
9
|
+
export * from './plugin';
|
|
10
|
+
export * from './module';
|
|
11
|
+
export * from './api';
|
|
12
|
+
/**
|
|
13
|
+
* Determines if the shared registries for components and content types have been extended or if they're still represented as loose mapped types
|
|
14
|
+
*
|
|
15
|
+
* Here we use the fact that once the registries are extended, Attribute.GetKeys<Common.UID.Schema> will resolve to either never or a more
|
|
16
|
+
* deterministic value rather than string | number which represent the keys of the initial mapped type (Component & ContentType's registries)
|
|
17
|
+
*/
|
|
18
|
+
export type AreSchemaRegistriesExtended = Utils.Expression.Not<Utils.Expression.Extends<string | number, Attribute.GetKeys<Common.UID.Schema>>>;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtD,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAC5D,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAChF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type Koa from 'koa';
|
|
2
|
+
import type { Strapi } from '../../..';
|
|
3
|
+
export type MiddlewareFactory<T = any> = (config: T, ctx: {
|
|
4
|
+
strapi: Strapi;
|
|
5
|
+
}) => MiddlewareHandler | void;
|
|
6
|
+
export type MiddlewareHandler = Koa.Middleware;
|
|
7
|
+
export type Middleware = MiddlewareHandler | MiddlewareFactory;
|
|
8
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI,CACvC,MAAM,EAAE,CAAC,EACT,GAAG,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,KACpB,iBAAiB,GAAG,IAAI,CAAC;AAE9B,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,UAAU,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Common, Schema } from '..';
|
|
2
|
+
import type { Strapi } from '../../..';
|
|
3
|
+
export interface Module {
|
|
4
|
+
bootstrap: ({ strapi }: {
|
|
5
|
+
strapi: Strapi;
|
|
6
|
+
}) => void | Promise<void>;
|
|
7
|
+
destroy: ({ strapi }: {
|
|
8
|
+
strapi: Strapi;
|
|
9
|
+
}) => void | Promise<void>;
|
|
10
|
+
register: ({ strapi }: {
|
|
11
|
+
strapi: Strapi;
|
|
12
|
+
}) => void | Promise<void>;
|
|
13
|
+
config<TDefault = unknown, TResult = unknown>(path: string, defaultValue?: TDefault): TResult;
|
|
14
|
+
routes: Record<string, Common.Router>;
|
|
15
|
+
controllers: Record<string, Common.Controller>;
|
|
16
|
+
services: Record<string, Common.Service>;
|
|
17
|
+
policies: Record<string, Common.Policy>;
|
|
18
|
+
middlewares: Record<string, Common.Middleware>;
|
|
19
|
+
contentTypes: Record<string, {
|
|
20
|
+
schema: Schema.ContentType;
|
|
21
|
+
}>;
|
|
22
|
+
controller<T extends Common.Controller>(name: string): T;
|
|
23
|
+
service<T extends Common.Service>(name: string): T;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.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MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC;IACzD,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC;CACpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAEjC,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG;IACnD,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExtendableContext } from 'koa';
|
|
2
|
+
import type { Strapi } from '../../..';
|
|
3
|
+
export type PolicyContext = Omit<ExtendableContext, 'is'> & {
|
|
4
|
+
type: string;
|
|
5
|
+
is(name: string): boolean;
|
|
6
|
+
};
|
|
7
|
+
export type Policy<T = unknown> = (ctx: PolicyContext, cfg: T, { strapi }: {
|
|
8
|
+
strapi: Strapi;
|
|
9
|
+
}) => boolean | undefined;
|
|
10
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,GAAG;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG,OAAO,IAAI,CAChC,GAAG,EAAE,aAAa,EAClB,GAAG,EAAE,CAAC,EACN,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,KAC3B,OAAO,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { MiddlewareHandler } from './middleware';
|
|
2
|
+
export type RouterType = 'admin' | 'content-api';
|
|
3
|
+
export type RouteInfo = {
|
|
4
|
+
apiName?: string;
|
|
5
|
+
pluginName?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
};
|
|
8
|
+
export type RouteConfig = {
|
|
9
|
+
prefix?: string;
|
|
10
|
+
middlewares?: Array<string | MiddlewareHandler>;
|
|
11
|
+
policies?: Array<string | {
|
|
12
|
+
name: string;
|
|
13
|
+
config: unknown;
|
|
14
|
+
}>;
|
|
15
|
+
auth?: false | {
|
|
16
|
+
scope?: string[];
|
|
17
|
+
strategies?: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type Route = {
|
|
21
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
22
|
+
path: string;
|
|
23
|
+
handler: string | MiddlewareHandler;
|
|
24
|
+
info: RouteInfo;
|
|
25
|
+
config?: RouteConfig;
|
|
26
|
+
};
|
|
27
|
+
export type RouteInput = Omit<Route, 'info'> & {
|
|
28
|
+
info?: Partial<RouteInfo>;
|
|
29
|
+
};
|
|
30
|
+
export type Router = {
|
|
31
|
+
type: RouterType;
|
|
32
|
+
prefix?: string;
|
|
33
|
+
routes: Route[];
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/types/core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B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/service.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IAGpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Shared, Schema as SchemaNamespace, Common, Registry, UID, Utils } from '../../..';
|
|
2
|
+
export type Service = Registry.Keys<Shared.Services, UID.Service>;
|
|
3
|
+
export type Controller = Registry.Keys<Shared.Controllers, UID.Controller>;
|
|
4
|
+
export type Policy = Registry.Keys<Shared.Policies, UID.Policy>;
|
|
5
|
+
export type Middleware = Registry.Keys<Shared.Middlewares, UID.Middleware>;
|
|
6
|
+
export type ContentType = Registry.Keys<Shared.ContentTypes, UID.ContentType>;
|
|
7
|
+
export type CollectionType = Utils.Guard.Never<Extract<Utils.Object.KeysBy<Shared.ContentTypes, SchemaNamespace.CollectionType>, ContentType>, ContentType>;
|
|
8
|
+
export type SingleType = Utils.Guard.Never<Extract<Utils.Object.KeysBy<Shared.ContentTypes, SchemaNamespace.SingleType>, ContentType>, ContentType>;
|
|
9
|
+
export type Component = Registry.Keys<Shared.Components, UID.Component>;
|
|
10
|
+
export type ComponentCategory = Component extends UID.Component<infer TCategory> ? TCategory : never;
|
|
11
|
+
export type Schema = Registry.Keys<Common.Schemas, UID.ContentType | UID.Component<ComponentCategory>>;
|
|
12
|
+
export type IsCollectionType<TSchemaUID extends Schema> = TSchemaUID extends CollectionType ? Utils.Expression.Extends<Shared.ContentTypes[TSchemaUID], SchemaNamespace.CollectionType> : Utils.Expression.False;
|
|
13
|
+
export type IsSingleType<TSchemaUID extends Schema> = TSchemaUID extends SingleType ? Utils.Expression.Extends<Shared.ContentTypes[TSchemaUID], SchemaNamespace.SingleType> : Utils.Expression.False;
|
|
14
|
+
export type IsComponent<TSchemaUID extends Schema> = TSchemaUID extends Component ? Utils.Expression.Extends<Shared.Components[TSchemaUID], SchemaNamespace.Component> : Utils.Expression.False;
|
|
15
|
+
export type IsContentType<TSchemaUID extends Schema> = TSchemaUID extends ContentType ? Utils.Expression.Or<IsCollectionType<TSchemaUID>, IsSingleType<TSchemaUID>> : Utils.Expression.False;
|
|
16
|
+
//# sourceMappingURL=uid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../../../src/types/core/common/uid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;AAElE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;AAE3E,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,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ACrF,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AAE3B,MAAM,MAAM,WAAW,CAAC,UAAU,SAAS,MAAM,IAAI,UAAU,SAAS,SAAS,GAC7E,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,GAClF,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AAE3B,MAAM,MAAM,aAAa,CAAC,UAAU,SAAS,MAAM,IAAI,UAAU,SAAS,WAAW,GACjF,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,GAC3E,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/core/entity/index.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note: linting will erroneously raise errors if a namespaced type has the same name as on exported by Strapi
|
|
3
|
+
* To work around it, use a pattern such as:
|
|
4
|
+
*
|
|
5
|
+
* import * as PluginImport from './plugins'
|
|
6
|
+
* export type Plugin = typeof PluginImport
|
|
7
|
+
*
|
|
8
|
+
* which causes linting to see the namespaces correctly.
|
|
9
|
+
*/
|
|
10
|
+
export * as Attribute from './attributes';
|
|
11
|
+
export * as Schema from './schemas';
|
|
12
|
+
export * as Plugin from './plugins';
|
|
13
|
+
export * as Entity from './entity';
|
|
14
|
+
export * from './strapi';
|
|
15
|
+
export * as Common from './common';
|
|
16
|
+
export * as Namespace from './namespace';
|
|
17
|
+
export * as UID from './uid';
|
|
18
|
+
export * as Registry from './registry';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC;AAEzB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type * as Utils from '../utils';
|
|
2
|
+
/**
|
|
3
|
+
* Namespace for admin resources
|
|
4
|
+
*/
|
|
5
|
+
export type Admin = 'admin';
|
|
6
|
+
/**
|
|
7
|
+
* Namespace for strapi internal resources
|
|
8
|
+
*/
|
|
9
|
+
export type Strapi = 'strapi';
|
|
10
|
+
/**
|
|
11
|
+
* Namespace for scoped APIs resources
|
|
12
|
+
*/
|
|
13
|
+
export type API<T extends string = string> = `api${ColonsSeparator}${T}`;
|
|
14
|
+
/**
|
|
15
|
+
* Namespace for scoped plugins resources
|
|
16
|
+
*/
|
|
17
|
+
export type Plugin<T extends string = string> = `plugin${ColonsSeparator}${T}`;
|
|
18
|
+
/**
|
|
19
|
+
* Namespace for global resources
|
|
20
|
+
*/
|
|
21
|
+
export type Global = 'global';
|
|
22
|
+
/**
|
|
23
|
+
* Represents any namespace
|
|
24
|
+
*/
|
|
25
|
+
export type Any = API | Plugin | Admin | Strapi | Global;
|
|
26
|
+
/**
|
|
27
|
+
* Return a {@link Separator} based on the given {@link Any} ({@link DotSeparator} for {@link Scoped} and {@link ColonsSeparator} for regular ones)
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* type S = GetSeparator<Admin>
|
|
31
|
+
* // ^ '::'
|
|
32
|
+
*
|
|
33
|
+
* type S = GetSeparator<API>
|
|
34
|
+
* // ^ '.'
|
|
35
|
+
*
|
|
36
|
+
* type S = GetSeparator<Admin | API>
|
|
37
|
+
* // ^ '.' | '::'
|
|
38
|
+
*/
|
|
39
|
+
export type GetSeparator<TNamespace extends Any = Any> = TNamespace extends Scoped ? DotSeparator : ColonsSeparator;
|
|
40
|
+
/**
|
|
41
|
+
* Adds the corresponding separator (using {@link GetSeparator}) at the end of a namespace
|
|
42
|
+
*
|
|
43
|
+
* Warning: Using WithSeparator with a union type might produce undesired results as it'll distribute every matching suffix to every union member
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* type T = WithSeparator<Admin>
|
|
47
|
+
* // ^ 'admin::'
|
|
48
|
+
*
|
|
49
|
+
* type T = WithSeparator<API>
|
|
50
|
+
* // ^ 'api::{string}.'
|
|
51
|
+
*
|
|
52
|
+
* type T = WithSeparator<Admin | API>
|
|
53
|
+
* // ^ 'admin::' | 'admin.' | 'api::{string}.' | 'api::{string}::'
|
|
54
|
+
*
|
|
55
|
+
* type T = WithSeparator<Admin> | WithSeparator<API>
|
|
56
|
+
* // ^ 'admin::' | 'api::{string}.'
|
|
57
|
+
*/
|
|
58
|
+
export type WithSeparator<TNamespace extends Any> = Utils.String.Suffix<TNamespace, GetSeparator<TNamespace>>;
|
|
59
|
+
/**
|
|
60
|
+
* Represents namespaces composed of an origin and a scope, separated by colons
|
|
61
|
+
*/
|
|
62
|
+
export type Scoped<TOrigin extends string = string, TScope extends string = string> = Any & `${TOrigin}${ColonsSeparator}${TScope}`;
|
|
63
|
+
/**
|
|
64
|
+
* Extract the scope from the given scoped namespace
|
|
65
|
+
*/
|
|
66
|
+
export type ExtractScope<TNamespace> = TNamespace extends `${string}${ColonsSeparator}${infer TScope}` ? TScope : never;
|
|
67
|
+
/**
|
|
68
|
+
* Extract the origin from the given scoped namespace
|
|
69
|
+
*/
|
|
70
|
+
export type ExtractOrigin<TNamespace> = TNamespace extends `${infer TOrigin}${ColonsSeparator}${string}` ? TOrigin : never;
|
|
71
|
+
/**
|
|
72
|
+
* Separators used to join the different parts of a namespace (e.g. building a uid)
|
|
73
|
+
*/
|
|
74
|
+
export type Separator = ColonsSeparator | DotSeparator;
|
|
75
|
+
type ColonsSeparator = '::';
|
|
76
|
+
type DotSeparator = '.';
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/types/core/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,eAAe,GAAG,CAAC,EAAE,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,SAAS,eAAe,GAAG,CAAC,EAAE,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,CAAC,UAAU,SAAS,GAAG,GAAG,GAAG,IAAI,UAAU,SAAS,MAAM,GAE9E,YAAY,GAEZ,eAAe,CAAC;AAEpB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,aAAa,CAAC,UAAU,SAAS,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CACrE,UAAU,EACV,YAAY,CAAC,UAAU,CAAC,CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI,GAAG,GACvF,GAAG,OAAO,GAAG,eAAe,GAAG,MAAM,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,UAAU,IACjC,UAAU,SAAS,GAAG,MAAM,GAAG,eAAe,GAAG,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,UAAU,IAClC,UAAU,SAAS,GAAG,MAAM,OAAO,GAAG,eAAe,GAAG,MAAM,EAAE,GAAG,OAAO,GAAG,KAAK,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,YAAY,CAAC;AAEvD,KAAK,eAAe,GAAG,IAAI,CAAC;AAC5B,KAAK,YAAY,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/core/plugins/config/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/types/core/plugins/config/strapi-admin/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/types/core/plugins/config/strapi-server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACrD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,OAAO,GAAG,CAAA;KAAE,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC7F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ContentType } from '../../../schemas';
|
|
2
|
+
export interface ContentTypes {
|
|
3
|
+
/**
|
|
4
|
+
* Only the schema property is used and available
|
|
5
|
+
* See loader in packages/core/strapi/src/core/loaders/plugins/index.ts
|
|
6
|
+
* */
|
|
7
|
+
[key: string]: {
|
|
8
|
+
schema: ContentType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=content-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../../../src/types/core/plugins/config/strapi-server/content-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;;;UAGM;IACN,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../../../../src/types/core/plugins/config/strapi-server/controllers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGrD,MAAM,MAAM,UAAU,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,CAAC,UAAU,CAAC;AAE/E,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Config } from './config';
|
|
2
|
+
import type { Routes } from './routes';
|
|
3
|
+
import type { ContentTypes } from './content-types';
|
|
4
|
+
import type { Controllers } from './controllers';
|
|
5
|
+
import type { Register, Bootstrap, Destroy } from './lifecycle';
|
|
6
|
+
export interface ServerObject {
|
|
7
|
+
register: Register;
|
|
8
|
+
bootstrap: Bootstrap;
|
|
9
|
+
destroy: Destroy;
|
|
10
|
+
config: Config;
|
|
11
|
+
routes: Routes;
|
|
12
|
+
contentTypes: ContentTypes;
|
|
13
|
+
controllers: Controllers;
|
|
14
|
+
registerTrads: unknown;
|
|
15
|
+
services: unknown;
|
|
16
|
+
policies: unknown;
|
|
17
|
+
middlewares: unknown;
|
|
18
|
+
}
|
|
19
|
+
export type ServerFunction = () => ServerObject;
|
|
20
|
+
export type ServerInput = ServerObject | ServerFunction;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/types/core/plugins/config/strapi-server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGhE,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IAEzB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC;AAGhD,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Strapi } from '../../../../..';
|
|
2
|
+
export type LifecycleMethod = ({ strapi }: {
|
|
3
|
+
strapi: Strapi;
|
|
4
|
+
}) => Promise<unknown> | unknown;
|
|
5
|
+
export type Register = LifecycleMethod;
|
|
6
|
+
export type Bootstrap = LifecycleMethod;
|
|
7
|
+
export type Destroy = LifecycleMethod;
|
|
8
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../../../src/types/core/plugins/config/strapi-server/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAE7F,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC;AACvC,MAAM,MAAM,SAAS,GAAG,eAAe,CAAC;AACxC,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Common } from '../../..';
|
|
2
|
+
export type ArrayNotation = Common.RouteInput[];
|
|
3
|
+
export interface ObjectNotation {
|
|
4
|
+
routes: Common.RouteInput[];
|
|
5
|
+
type?: Common.RouterType;
|
|
6
|
+
}
|
|
7
|
+
export interface NamedRoutes {
|
|
8
|
+
[key: string]: ObjectNotation;
|
|
9
|
+
}
|
|
10
|
+
export type Routes = ArrayNotation | NamedRoutes;
|
|
11
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../../src/types/core/plugins/config/strapi-server/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;AAEhD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC;CAC/B;AAED,MAAM,MAAM,MAAM,GAAG,aAAa,GAAG,WAAW,CAAC"}
|