@strapi/types 5.53.0 → 5.54.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/features.d.ts +9 -1
- package/dist/core/config/features.d.ts.map +1 -1
- package/dist/modules/audit-logs.d.ts +14 -4
- package/dist/modules/audit-logs.d.ts.map +1 -1
- package/dist/modules/cron.d.ts +49 -10
- package/dist/modules/cron.d.ts.map +1 -1
- package/dist/modules/features.d.ts +6 -0
- package/dist/modules/features.d.ts.map +1 -1
- package/package.json +8 -9
|
@@ -4,11 +4,19 @@
|
|
|
4
4
|
* @see docs/docs/docs/06-future-flags.md
|
|
5
5
|
*/
|
|
6
6
|
export interface FeaturesFutureFlags {
|
|
7
|
-
betaMediaLibrary?: boolean;
|
|
8
7
|
experimental_firstPublishedAt?: boolean;
|
|
9
8
|
[futureFlagName: string]: boolean | undefined;
|
|
10
9
|
}
|
|
11
10
|
export interface Features {
|
|
12
11
|
future?: FeaturesFutureFlags;
|
|
12
|
+
/**
|
|
13
|
+
* Restores the previous Media Library.
|
|
14
|
+
*
|
|
15
|
+
* Flat rather than under `future`, which means "unstable, may be removed": this flag
|
|
16
|
+
* is a supported opt-out that outlives the feature's release. It reads as an opt-out
|
|
17
|
+
* because the new Media Library is the default from 5.53 — see the removal version in
|
|
18
|
+
* the Media Library documentation.
|
|
19
|
+
*/
|
|
20
|
+
useLegacyMediaLibrary?: boolean;
|
|
13
21
|
}
|
|
14
22
|
//# sourceMappingURL=features.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../src/core/config/features.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../src/core/config/features.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC"}
|
|
@@ -26,6 +26,9 @@ export type Actor = {
|
|
|
26
26
|
/**
|
|
27
27
|
* The resource the action was performed on.
|
|
28
28
|
* `type` is the audit-log name for the resource (e.g. 'release').
|
|
29
|
+
*
|
|
30
|
+
* A resource with its own stable identifier extends this in the package that owns it,
|
|
31
|
+
* rather than adding a field here that only one resource fills in.
|
|
29
32
|
*/
|
|
30
33
|
export interface Resource {
|
|
31
34
|
type: string;
|
|
@@ -33,12 +36,19 @@ export interface Resource {
|
|
|
33
36
|
name?: string;
|
|
34
37
|
}
|
|
35
38
|
export type Outcome = 'success' | 'failure';
|
|
39
|
+
/**
|
|
40
|
+
* A field's value on either side of a change, as recorded under `details.changes`.
|
|
41
|
+
*/
|
|
42
|
+
export interface FieldChange<T = string | number | boolean | null> {
|
|
43
|
+
before: T;
|
|
44
|
+
after: T;
|
|
45
|
+
}
|
|
36
46
|
/**
|
|
37
47
|
* The shape returned by an event transformer.
|
|
38
48
|
* The subscriber adds action, date, actor and origin.
|
|
39
49
|
*/
|
|
40
|
-
export interface EventShape<TDetails = unknown> {
|
|
41
|
-
resource:
|
|
50
|
+
export interface EventShape<TDetails = unknown, TResource extends Resource = Resource> {
|
|
51
|
+
resource: TResource;
|
|
42
52
|
details?: TDetails;
|
|
43
53
|
outcome?: Outcome;
|
|
44
54
|
}
|
|
@@ -47,7 +57,7 @@ export interface EventShape<TDetails = unknown> {
|
|
|
47
57
|
* action and date are also stored as table columns, but are repeated here so
|
|
48
58
|
* the payload can be used on its own when exported or forwarded to another system.
|
|
49
59
|
*/
|
|
50
|
-
export interface StoredPayload<TDetails = unknown> extends EventShape<TDetails> {
|
|
60
|
+
export interface StoredPayload<TDetails = unknown, TResource extends Resource = Resource> extends EventShape<TDetails, TResource> {
|
|
51
61
|
action: string;
|
|
52
62
|
date: string;
|
|
53
63
|
actor: Actor;
|
|
@@ -60,5 +70,5 @@ export interface StoredPayload<TDetails = unknown> extends EventShape<TDetails>
|
|
|
60
70
|
* May be async when the resource needs to be fetched. Deleted rows and previous
|
|
61
71
|
* values must be included in the emitted event instead.
|
|
62
72
|
*/
|
|
63
|
-
export type EventTransformer<TDetails = unknown> = (...args: any[]) => EventShape<TDetails> | Promise<EventShape<TDetails>>;
|
|
73
|
+
export type EventTransformer<TDetails = unknown, TResource extends Resource = Resource> = (...args: any[]) => EventShape<TDetails, TResource> | Promise<EventShape<TDetails, TResource>>;
|
|
64
74
|
//# sourceMappingURL=audit-logs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-logs.d.ts","sourceRoot":"","sources":["../../src/modules/audit-logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,KAAK,GAAG,WAAW,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,KAAK,GACb;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAClF;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB
|
|
1
|
+
{"version":3,"file":"audit-logs.d.ts","sourceRoot":"","sources":["../../src/modules/audit-logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,KAAK,GAAG,WAAW,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,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AQ,IAAI,CACxF,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC"}
|
package/dist/modules/cron.d.ts
CHANGED
|
@@ -1,16 +1,56 @@
|
|
|
1
|
-
import type { Job, Spec } from 'node-schedule';
|
|
2
1
|
import type { Strapi } from '../core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* node-schedule RecurrenceSpecObjLit / RecurrenceRule-shaped objects
|
|
4
|
+
* (`month` is 0–11).
|
|
5
|
+
*/
|
|
6
|
+
export interface RecurrenceRange {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
}
|
|
11
|
+
export type RecurrenceSegment = number | string | RecurrenceRange | Array<number | string | RecurrenceRange>;
|
|
12
|
+
export type CronDate = Date | number | string;
|
|
13
|
+
export interface RecurrenceSpecObjLit {
|
|
14
|
+
date?: RecurrenceSegment | null;
|
|
15
|
+
dayOfWeek?: RecurrenceSegment | null;
|
|
16
|
+
hour?: RecurrenceSegment | null;
|
|
17
|
+
minute?: RecurrenceSegment | null;
|
|
18
|
+
month?: RecurrenceSegment | null;
|
|
19
|
+
second?: RecurrenceSegment | null;
|
|
20
|
+
year?: RecurrenceSegment | null;
|
|
21
|
+
tz?: string;
|
|
22
|
+
start?: CronDate;
|
|
23
|
+
end?: CronDate;
|
|
24
|
+
recurs?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Object schedule previously accepted via node-schedule `Spec`
|
|
28
|
+
* (`rule` + optional `tz` / `start` / `end`).
|
|
29
|
+
*/
|
|
30
|
+
export interface CronRuleOptions {
|
|
31
|
+
rule: CronDate | RecurrenceSpecObjLit;
|
|
32
|
+
tz?: string;
|
|
33
|
+
start?: CronDate;
|
|
34
|
+
end?: CronDate;
|
|
35
|
+
}
|
|
36
|
+
export type CronSchedule = string | number | Date | CronRuleOptions | RecurrenceSpecObjLit;
|
|
37
|
+
export type CronJob = import('croner').Cron & {
|
|
38
|
+
invoke: () => Promise<unknown>;
|
|
39
|
+
cancel: () => boolean;
|
|
40
|
+
nextInvocation: () => Date | null;
|
|
41
|
+
reschedule: (spec: CronSchedule) => boolean;
|
|
42
|
+
};
|
|
43
|
+
export interface JobSpec {
|
|
44
|
+
job: CronJob;
|
|
45
|
+
options: CronSchedule;
|
|
6
46
|
name: string | null;
|
|
7
47
|
}
|
|
8
|
-
type
|
|
48
|
+
export type CronTaskFn = ({ strapi }: {
|
|
9
49
|
strapi: Strapi;
|
|
10
50
|
}, ...args: unknown[]) => Promise<unknown>;
|
|
11
|
-
export type CronTask =
|
|
12
|
-
task:
|
|
13
|
-
options:
|
|
51
|
+
export type CronTask = CronTaskFn | {
|
|
52
|
+
task: CronTaskFn;
|
|
53
|
+
options: CronSchedule;
|
|
14
54
|
};
|
|
15
55
|
export interface CronTasks {
|
|
16
56
|
[key: string]: CronTask;
|
|
@@ -21,7 +61,6 @@ export interface CronService {
|
|
|
21
61
|
start(): CronService;
|
|
22
62
|
stop(): CronService;
|
|
23
63
|
destroy(): CronService;
|
|
24
|
-
jobs: JobSpec[];
|
|
64
|
+
readonly jobs: JobSpec[];
|
|
25
65
|
}
|
|
26
|
-
export {};
|
|
27
66
|
//# sourceMappingURL=cron.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../src/modules/cron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../src/modules/cron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,eAAe;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C/B,MAAM,EAAE,MAAM,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;CAC7C,CAAC;AAEF,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAElG,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEN,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW,CAAC;IACnC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAClC,KAAK,IAAI,WAAW,CAAC;IACrB,IAAI,IAAI,WAAW,CAAC;IACpB,OAAO,IAAI,WAAW,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC;CAC1B"}
|
|
@@ -8,5 +8,11 @@ export interface FeaturesService {
|
|
|
8
8
|
future: {
|
|
9
9
|
isEnabled: (futureFlagName: string) => boolean;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Permanent flags, read straight off `features`. Unlike `future.*` these are supported
|
|
13
|
+
* configuration rather than opt-in previews, so they are named for what they do rather
|
|
14
|
+
* than gathered under a bucket that promises removal.
|
|
15
|
+
*/
|
|
16
|
+
isEnabled: (flagName: keyof Omit<FeaturesConfig, 'future'>) => boolean;
|
|
11
17
|
}
|
|
12
18
|
//# sourceMappingURL=features.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/modules/features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC;KAChD,CAAC;
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/modules/features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC;KAChD,CAAC;IACF;;;;OAIG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,KAAK,OAAO,CAAC;CACxE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/types",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.54.0",
|
|
4
4
|
"description": "Shared typescript types for Strapi internal use",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi"
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"@casl/ability": "6.7.5",
|
|
60
60
|
"@koa/cors": "5.0.0",
|
|
61
61
|
"@koa/router": "12.0.2",
|
|
62
|
-
"@strapi/database": "5.
|
|
63
|
-
"@strapi/logger": "5.
|
|
64
|
-
"@strapi/permissions": "5.
|
|
65
|
-
"@strapi/utils": "5.
|
|
62
|
+
"@strapi/database": "5.54.0",
|
|
63
|
+
"@strapi/logger": "5.54.0",
|
|
64
|
+
"@strapi/permissions": "5.54.0",
|
|
65
|
+
"@strapi/utils": "5.54.0",
|
|
66
66
|
"commander": "8.3.0",
|
|
67
|
+
"croner": "10.0.1",
|
|
67
68
|
"json-logic-js": "2.0.5",
|
|
68
69
|
"koa": "2.16.4",
|
|
69
70
|
"koa-body": "6.0.1",
|
|
70
|
-
"node-schedule": "2.1.1",
|
|
71
71
|
"typedoc": "0.28.19",
|
|
72
72
|
"typedoc-github-wiki-theme": "2.1.0",
|
|
73
73
|
"typedoc-plugin-markdown": "4.11.0",
|
|
@@ -79,10 +79,9 @@
|
|
|
79
79
|
"@types/koa": "2.15.2",
|
|
80
80
|
"@types/koa__router": "12.0.0",
|
|
81
81
|
"@types/node": "20.19.41",
|
|
82
|
-
"
|
|
83
|
-
"eslint-config-custom": "5.53.0",
|
|
82
|
+
"eslint-config-custom": "5.54.0",
|
|
84
83
|
"lodash": "4.18.1",
|
|
85
|
-
"tsconfig": "5.
|
|
84
|
+
"tsconfig": "5.54.0",
|
|
86
85
|
"typescript": "5.9.3",
|
|
87
86
|
"undici": "6.28.1"
|
|
88
87
|
},
|