@directus/api 13.1.1 → 14.0.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/__utils__/snapshots.js +9 -0
- package/dist/app.js +6 -4
- package/dist/auth/drivers/ldap.js +3 -2
- package/dist/auth/drivers/local.js +1 -1
- package/dist/auth/drivers/oauth2.js +1 -1
- package/dist/auth/drivers/openid.js +1 -1
- package/dist/auth/drivers/saml.js +1 -1
- package/dist/auth.js +1 -1
- package/dist/cli/index.js +7 -4
- package/dist/controllers/activity.js +1 -1
- package/dist/controllers/assets.js +2 -2
- package/dist/controllers/auth.js +1 -1
- package/dist/controllers/collections.js +1 -1
- package/dist/controllers/dashboards.js +1 -1
- package/dist/controllers/extensions.js +29 -16
- package/dist/controllers/fields.js +1 -1
- package/dist/controllers/files.js +1 -1
- package/dist/controllers/flows.js +1 -1
- package/dist/controllers/folders.js +1 -1
- package/dist/controllers/items.js +1 -1
- package/dist/controllers/not-found.js +1 -1
- package/dist/controllers/notifications.js +1 -1
- package/dist/controllers/operations.js +1 -1
- package/dist/controllers/panels.js +1 -1
- package/dist/controllers/permissions.js +1 -1
- package/dist/controllers/presets.js +1 -1
- package/dist/controllers/relations.js +1 -1
- package/dist/controllers/roles.js +1 -1
- package/dist/controllers/schema.js +1 -1
- package/dist/controllers/server.js +1 -1
- package/dist/controllers/settings.js +1 -1
- package/dist/controllers/shares.js +1 -1
- package/dist/controllers/translations.js +1 -1
- package/dist/controllers/users.js +1 -1
- package/dist/controllers/utils.js +37 -18
- package/dist/controllers/versions.d.ts +2 -0
- package/dist/controllers/versions.js +188 -0
- package/dist/controllers/webhooks.js +1 -1
- package/dist/database/errors/dialects/mssql.js +1 -1
- package/dist/database/errors/dialects/mysql.js +1 -1
- package/dist/database/errors/dialects/oracle.js +1 -1
- package/dist/database/errors/dialects/postgres.js +1 -1
- package/dist/database/errors/dialects/sqlite.js +1 -1
- package/dist/database/helpers/schema/dialects/mysql.js +1 -1
- package/dist/database/helpers/sequence/dialects/postgres.d.ts +5 -2
- package/dist/database/helpers/sequence/dialects/postgres.js +6 -3
- package/dist/database/migrations/20230823A-add-content-versioning.d.ts +3 -0
- package/dist/database/migrations/20230823A-add-content-versioning.js +36 -0
- package/dist/database/migrations/20230927A-themes.d.ts +3 -0
- package/dist/database/migrations/20230927A-themes.js +49 -0
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.d.ts +3 -0
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +44 -0
- package/dist/database/migrations/20231009B-update-panel-options.d.ts +3 -0
- package/dist/database/migrations/20231009B-update-panel-options.js +77 -0
- package/dist/database/migrations/20231010A-add-extensions.d.ts +3 -0
- package/dist/database/migrations/20231010A-add-extensions.js +9 -0
- package/dist/database/run-ast.js +2 -2
- package/dist/database/seeds/run.js +1 -1
- package/dist/database/system-data/collections/collections.yaml +6 -0
- package/dist/database/system-data/fields/activity.yaml +4 -4
- package/dist/database/system-data/fields/collections.yaml +19 -0
- package/dist/database/system-data/fields/extensions.yaml +10 -0
- package/dist/database/system-data/fields/revisions.yaml +3 -0
- package/dist/database/system-data/fields/settings.yaml +73 -17
- package/dist/database/system-data/fields/users.yaml +48 -12
- package/dist/database/system-data/fields/versions.yaml +38 -0
- package/dist/database/system-data/fields/webhooks.yaml +9 -9
- package/dist/database/system-data/relations/relations.yaml +88 -20
- package/dist/env.js +4 -0
- package/dist/extensions/index.d.ts +2 -0
- package/dist/extensions/index.js +9 -0
- package/dist/extensions/lib/get-extensions-settings.d.ts +7 -0
- package/dist/extensions/lib/get-extensions-settings.js +39 -0
- package/dist/extensions/lib/get-extensions.d.ts +1 -0
- package/dist/extensions/lib/get-extensions.js +11 -0
- package/dist/extensions/lib/get-shared-deps-mapping.d.ts +1 -0
- package/dist/extensions/lib/get-shared-deps-mapping.js +26 -0
- package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.d.ts +31 -0
- package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.js +80 -0
- package/dist/extensions/lib/sandbox/generate-host-function-reference.d.ts +11 -0
- package/dist/extensions/lib/sandbox/generate-host-function-reference.js +28 -0
- package/dist/extensions/lib/sandbox/register/action.d.ts +6 -0
- package/dist/extensions/lib/sandbox/register/action.js +18 -0
- package/dist/extensions/lib/sandbox/register/call-reference.d.ts +5 -0
- package/dist/extensions/lib/sandbox/register/call-reference.js +20 -0
- package/dist/extensions/lib/sandbox/register/filter.d.ts +6 -0
- package/dist/extensions/lib/sandbox/register/filter.js +21 -0
- package/dist/extensions/lib/sandbox/register/index.d.ts +5 -0
- package/dist/extensions/lib/sandbox/register/index.js +5 -0
- package/dist/extensions/lib/sandbox/register/operation.d.ts +6 -0
- package/dist/extensions/lib/sandbox/register/operation.js +19 -0
- package/dist/extensions/lib/sandbox/register/route.d.ts +17 -0
- package/dist/extensions/lib/sandbox/register/route.js +44 -0
- package/dist/extensions/lib/sandbox/sdk/generators/index.d.ts +3 -0
- package/dist/extensions/lib/sandbox/sdk/generators/index.js +3 -0
- package/dist/extensions/lib/sandbox/sdk/generators/log.d.ts +3 -0
- package/dist/extensions/lib/sandbox/sdk/generators/log.js +11 -0
- package/dist/extensions/lib/sandbox/sdk/generators/request.d.ts +12 -0
- package/dist/extensions/lib/sandbox/sdk/generators/request.js +49 -0
- package/dist/extensions/lib/sandbox/sdk/generators/sleep.d.ts +3 -0
- package/dist/extensions/lib/sandbox/sdk/generators/sleep.js +11 -0
- package/dist/extensions/lib/sandbox/sdk/index.d.ts +2 -0
- package/dist/extensions/lib/sandbox/sdk/index.js +2 -0
- package/dist/extensions/lib/sandbox/sdk/instantiate.d.ts +11 -0
- package/dist/extensions/lib/sandbox/sdk/instantiate.js +28 -0
- package/dist/extensions/lib/sandbox/sdk/sdk.d.ts +20 -0
- package/dist/extensions/lib/sandbox/sdk/sdk.js +11 -0
- package/dist/extensions/lib/sandbox/sdk/utils/index.d.ts +1 -0
- package/dist/extensions/lib/sandbox/sdk/utils/index.js +1 -0
- package/dist/extensions/lib/sandbox/sdk/utils/wrap.d.ts +11 -0
- package/dist/extensions/lib/sandbox/sdk/utils/wrap.js +17 -0
- package/dist/extensions/lib/wrap-embeds.d.ts +4 -0
- package/dist/extensions/lib/wrap-embeds.js +8 -0
- package/dist/extensions/manager.d.ts +158 -0
- package/dist/extensions/manager.js +604 -0
- package/dist/extensions/types.d.ts +19 -0
- package/dist/flows.d.ts +2 -2
- package/dist/flows.js +7 -7
- package/dist/middleware/check-ip.js +1 -1
- package/dist/middleware/collection-exists.js +1 -1
- package/dist/middleware/error-handler.js +1 -1
- package/dist/middleware/graphql.js +1 -1
- package/dist/middleware/rate-limiter-global.js +1 -1
- package/dist/middleware/rate-limiter-ip.js +1 -1
- package/dist/middleware/respond.js +13 -1
- package/dist/middleware/validate-batch.js +1 -1
- package/dist/operations/condition/index.d.ts +1 -1
- package/dist/operations/condition/index.js +2 -1
- package/dist/operations/exec/index.d.ts +1 -1
- package/dist/operations/exec/index.js +1 -1
- package/dist/operations/item-create/index.d.ts +1 -1
- package/dist/operations/item-create/index.js +2 -1
- package/dist/operations/item-delete/index.d.ts +1 -1
- package/dist/operations/item-delete/index.js +2 -1
- package/dist/operations/item-read/index.d.ts +1 -1
- package/dist/operations/item-read/index.js +2 -1
- package/dist/operations/item-update/index.d.ts +1 -1
- package/dist/operations/item-update/index.js +2 -1
- package/dist/operations/json-web-token/index.d.ts +1 -1
- package/dist/operations/json-web-token/index.js +2 -1
- package/dist/operations/log/index.d.ts +1 -1
- package/dist/operations/log/index.js +2 -1
- package/dist/operations/mail/index.d.ts +1 -1
- package/dist/operations/mail/index.js +1 -1
- package/dist/operations/notification/index.d.ts +1 -1
- package/dist/operations/notification/index.js +2 -1
- package/dist/operations/request/index.d.ts +1 -1
- package/dist/operations/request/index.js +3 -2
- package/dist/operations/sleep/index.d.ts +1 -1
- package/dist/operations/sleep/index.js +1 -1
- package/dist/operations/transform/index.d.ts +1 -1
- package/dist/operations/transform/index.js +2 -1
- package/dist/operations/trigger/index.d.ts +1 -1
- package/dist/operations/trigger/index.js +2 -1
- package/dist/services/activity.js +1 -1
- package/dist/services/assets.d.ts +1 -1
- package/dist/services/assets.js +3 -3
- package/dist/services/authentication.js +2 -2
- package/dist/services/authorization.js +1 -1
- package/dist/services/collections.js +3 -3
- package/dist/services/extensions.d.ts +31 -0
- package/dist/services/extensions.js +121 -0
- package/dist/services/fields.d.ts +2 -2
- package/dist/services/fields.js +4 -4
- package/dist/services/files.d.ts +4 -1
- package/dist/services/files.js +5 -5
- package/dist/services/graphql/index.d.ts +1 -1
- package/dist/services/graphql/index.js +87 -24
- package/dist/services/graphql/subscription.js +3 -3
- package/dist/services/import-export/import-worker.d.ts +9 -0
- package/dist/services/import-export/import-worker.js +9 -0
- package/dist/services/{import-export.d.ts → import-export/index.d.ts} +2 -2
- package/dist/services/{import-export.js → import-export/index.js} +51 -42
- package/dist/services/index.d.ts +3 -1
- package/dist/services/index.js +3 -1
- package/dist/services/items.js +2 -2
- package/dist/services/mail/index.js +1 -1
- package/dist/services/meta.js +1 -1
- package/dist/services/payload.js +1 -1
- package/dist/services/permissions.d.ts +2 -2
- package/dist/services/permissions.js +1 -1
- package/dist/services/relations.js +1 -1
- package/dist/services/revisions.js +1 -1
- package/dist/services/roles.js +1 -1
- package/dist/services/schema.js +1 -1
- package/dist/services/server.js +3 -1
- package/dist/services/shares.js +1 -1
- package/dist/services/tfa.js +1 -1
- package/dist/services/translations.js +1 -1
- package/dist/services/users.js +4 -2
- package/dist/services/utils.d.ts +1 -0
- package/dist/services/utils.js +8 -2
- package/dist/services/versions.d.ts +21 -0
- package/dist/services/versions.js +232 -0
- package/dist/services/websocket.js +11 -1
- package/dist/types/collection.d.ts +1 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/utils/apply-query.d.ts +1 -1
- package/dist/utils/apply-query.js +31 -3
- package/dist/utils/delete-from-require-cache.d.ts +1 -0
- package/dist/utils/delete-from-require-cache.js +5 -0
- package/dist/utils/get-accountability-for-token.js +1 -1
- package/dist/utils/get-ast-from-query.js +1 -1
- package/dist/utils/get-column-path.js +1 -1
- package/dist/utils/get-column.js +1 -1
- package/dist/utils/get-default-value.d.ts +1 -2
- package/dist/utils/get-permissions.js +1 -1
- package/dist/utils/get-service.js +3 -1
- package/dist/utils/import-file-url.d.ts +5 -0
- package/dist/utils/import-file-url.js +6 -0
- package/dist/utils/job-queue.d.ts +2 -3
- package/dist/utils/jwt.js +1 -1
- package/dist/utils/redact-object.js +9 -3
- package/dist/utils/sanitize-query.js +3 -0
- package/dist/utils/transformations.d.ts +2 -1
- package/dist/utils/validate-diff.js +1 -1
- package/dist/utils/validate-keys.js +1 -1
- package/dist/utils/validate-query.js +2 -1
- package/dist/utils/validate-snapshot.js +1 -1
- package/dist/websocket/controllers/base.js +1 -1
- package/dist/websocket/controllers/index.d.ts +1 -1
- package/dist/websocket/controllers/index.js +0 -7
- package/dist/websocket/handlers/heartbeat.js +6 -1
- package/dist/websocket/handlers/subscribe.js +11 -16
- package/dist/websocket/utils/items.d.ts +4 -14
- package/dist/websocket/utils/items.js +59 -64
- package/dist/worker-pool.d.ts +2 -0
- package/dist/worker-pool.js +11 -0
- package/package.json +34 -31
- package/dist/errors/codes.d.ts +0 -29
- package/dist/errors/codes.js +0 -30
- package/dist/errors/contains-null-values.d.ts +0 -7
- package/dist/errors/contains-null-values.js +0 -4
- package/dist/errors/content-too-large.d.ts +0 -1
- package/dist/errors/content-too-large.js +0 -3
- package/dist/errors/forbidden.d.ts +0 -1
- package/dist/errors/forbidden.js +0 -3
- package/dist/errors/hit-rate-limit.d.ts +0 -6
- package/dist/errors/hit-rate-limit.js +0 -8
- package/dist/errors/illegal-asset-transformation.d.ts +0 -4
- package/dist/errors/illegal-asset-transformation.js +0 -3
- package/dist/errors/index.d.ts +0 -28
- package/dist/errors/index.js +0 -28
- package/dist/errors/invalid-credentials.d.ts +0 -1
- package/dist/errors/invalid-credentials.js +0 -3
- package/dist/errors/invalid-foreign-key.d.ts +0 -6
- package/dist/errors/invalid-foreign-key.js +0 -14
- package/dist/errors/invalid-ip.d.ts +0 -1
- package/dist/errors/invalid-ip.js +0 -3
- package/dist/errors/invalid-otp.d.ts +0 -1
- package/dist/errors/invalid-otp.js +0 -3
- package/dist/errors/invalid-payload.d.ts +0 -5
- package/dist/errors/invalid-payload.js +0 -4
- package/dist/errors/invalid-provider-config.d.ts +0 -5
- package/dist/errors/invalid-provider-config.js +0 -3
- package/dist/errors/invalid-provider.d.ts +0 -1
- package/dist/errors/invalid-provider.js +0 -3
- package/dist/errors/invalid-query.d.ts +0 -5
- package/dist/errors/invalid-query.js +0 -4
- package/dist/errors/invalid-token.d.ts +0 -1
- package/dist/errors/invalid-token.js +0 -3
- package/dist/errors/method-not-allowed.d.ts +0 -6
- package/dist/errors/method-not-allowed.js +0 -6
- package/dist/errors/not-null-violation.d.ts +0 -6
- package/dist/errors/not-null-violation.js +0 -14
- package/dist/errors/range-not-satisfiable.d.ts +0 -7
- package/dist/errors/range-not-satisfiable.js +0 -7
- package/dist/errors/record-not-unique.d.ts +0 -6
- package/dist/errors/record-not-unique.js +0 -14
- package/dist/errors/route-not-found.d.ts +0 -5
- package/dist/errors/route-not-found.js +0 -4
- package/dist/errors/service-unavailable.d.ts +0 -7
- package/dist/errors/service-unavailable.js +0 -4
- package/dist/errors/token-expired.d.ts +0 -1
- package/dist/errors/token-expired.js +0 -3
- package/dist/errors/unexpected-response.d.ts +0 -1
- package/dist/errors/unexpected-response.js +0 -3
- package/dist/errors/unprocessable-content.d.ts +0 -5
- package/dist/errors/unprocessable-content.js +0 -4
- package/dist/errors/unsupported-media-type.d.ts +0 -6
- package/dist/errors/unsupported-media-type.js +0 -4
- package/dist/errors/user-suspended.d.ts +0 -1
- package/dist/errors/user-suspended.js +0 -3
- package/dist/errors/value-out-of-range.d.ts +0 -6
- package/dist/errors/value-out-of-range.js +0 -14
- package/dist/errors/value-too-long.d.ts +0 -6
- package/dist/errors/value-too-long.js +0 -14
- package/dist/extensions.d.ts +0 -51
- package/dist/extensions.js +0 -487
- package/dist/types/files.d.ts +0 -29
- /package/dist/{types/files.js → extensions/types.js} +0 -0
|
@@ -32,6 +32,13 @@ fields:
|
|
|
32
32
|
placeholder: en-US
|
|
33
33
|
width: half
|
|
34
34
|
|
|
35
|
+
- field: theming_group
|
|
36
|
+
interface: group-raw
|
|
37
|
+
special:
|
|
38
|
+
- alias
|
|
39
|
+
- no-data
|
|
40
|
+
- group
|
|
41
|
+
|
|
35
42
|
- field: branding_divider
|
|
36
43
|
interface: presentation-divider
|
|
37
44
|
options:
|
|
@@ -41,32 +48,96 @@ fields:
|
|
|
41
48
|
- alias
|
|
42
49
|
- no-data
|
|
43
50
|
width: full
|
|
51
|
+
group: theming_group
|
|
44
52
|
|
|
45
53
|
- field: project_color
|
|
46
54
|
interface: select-color
|
|
47
55
|
note: $t:field_options.directus_settings.project_color_note
|
|
48
56
|
width: half
|
|
57
|
+
group: theming_group
|
|
49
58
|
|
|
50
59
|
- field: project_logo
|
|
51
60
|
interface: file
|
|
52
61
|
note: $t:field_options.directus_settings.project_logo_note
|
|
53
62
|
width: half
|
|
63
|
+
group: theming_group
|
|
54
64
|
|
|
55
65
|
- field: public_foreground
|
|
56
66
|
interface: file
|
|
57
67
|
width: half
|
|
68
|
+
group: theming_group
|
|
58
69
|
|
|
59
70
|
- field: public_background
|
|
60
71
|
interface: file
|
|
61
|
-
translations:
|
|
62
72
|
width: half
|
|
73
|
+
group: theming_group
|
|
74
|
+
|
|
75
|
+
- field: public_favicon
|
|
76
|
+
interface: file
|
|
77
|
+
note: $t:field_options.directus_settings.project_favicon_note
|
|
78
|
+
width: half
|
|
79
|
+
group: theming_group
|
|
63
80
|
|
|
64
81
|
- field: public_note
|
|
65
82
|
interface: input
|
|
66
83
|
options:
|
|
67
84
|
placeholder: $t:field_options.directus_settings.public_note_placeholder
|
|
68
85
|
iconRight: info
|
|
86
|
+
width: half
|
|
87
|
+
group: theming_group
|
|
88
|
+
|
|
89
|
+
- field: default_appearance
|
|
90
|
+
interface: select-dropdown
|
|
91
|
+
options:
|
|
92
|
+
choices:
|
|
93
|
+
- value: auto
|
|
94
|
+
text: $t:appearance_auto
|
|
95
|
+
- value: light
|
|
96
|
+
text: $t:appearance_light
|
|
97
|
+
- value: dark
|
|
98
|
+
text: $t:appearance_dark
|
|
99
|
+
group: theming_group
|
|
100
|
+
|
|
101
|
+
- field: theming_divider
|
|
102
|
+
interface: presentation-divider
|
|
103
|
+
options:
|
|
104
|
+
icon: palette
|
|
105
|
+
title: $t:fields.directus_settings.theming
|
|
106
|
+
special:
|
|
107
|
+
- alias
|
|
108
|
+
- no-data
|
|
69
109
|
width: full
|
|
110
|
+
group: theming_group
|
|
111
|
+
|
|
112
|
+
- field: default_theme_light
|
|
113
|
+
width: full
|
|
114
|
+
interface: system-theme
|
|
115
|
+
options:
|
|
116
|
+
appearance: light
|
|
117
|
+
group: theming_group
|
|
118
|
+
hidden: true
|
|
119
|
+
|
|
120
|
+
- field: theme_light_overrides
|
|
121
|
+
width: full
|
|
122
|
+
interface: system-theme-overrides
|
|
123
|
+
group: theming_group
|
|
124
|
+
special:
|
|
125
|
+
- cast-json
|
|
126
|
+
|
|
127
|
+
- field: default_theme_dark
|
|
128
|
+
width: full
|
|
129
|
+
interface: system-theme
|
|
130
|
+
options:
|
|
131
|
+
appearance: dark
|
|
132
|
+
group: theming_group
|
|
133
|
+
hidden: true
|
|
134
|
+
|
|
135
|
+
- field: theme_dark_overrides
|
|
136
|
+
width: full
|
|
137
|
+
interface: system-theme-overrides
|
|
138
|
+
group: theming_group
|
|
139
|
+
special:
|
|
140
|
+
- cast-json
|
|
70
141
|
|
|
71
142
|
- field: custom_css
|
|
72
143
|
interface: input-code
|
|
@@ -75,26 +146,11 @@ fields:
|
|
|
75
146
|
lineNumber: true
|
|
76
147
|
template: |
|
|
77
148
|
#app, #main-content, body {
|
|
78
|
-
--primary-alt: #F0ECFF !important;
|
|
79
|
-
--primary-10: #F0ECFF !important;
|
|
80
|
-
--primary-25: #D9D0FF !important;
|
|
81
|
-
--primary-50: #B3A1FF !important;
|
|
82
|
-
--primary-75: #8C73FF !important;
|
|
83
|
-
--primary-90: #7557FF !important;
|
|
84
|
-
|
|
85
|
-
--primary: #6644FF !important;
|
|
86
|
-
|
|
87
|
-
--primary-110: #5E41EC !important;
|
|
88
|
-
--primary-125: #523DCF !important;
|
|
89
|
-
--primary-150: #3E369F !important;
|
|
90
|
-
--primary-175: #2B3070 !important;
|
|
91
|
-
--primary-190: #1F2C53 !important;
|
|
92
|
-
|
|
93
149
|
--v-button-background-color: #6644FF !important;
|
|
94
150
|
--v-button-background-color-hover: #5E41EC !important;
|
|
95
|
-
--sidebar-detail-color-active: #5E41EC !important;
|
|
96
151
|
}
|
|
97
152
|
width: full
|
|
153
|
+
group: theming_group
|
|
98
154
|
|
|
99
155
|
- field: modules_divider
|
|
100
156
|
interface: presentation-divider
|
|
@@ -78,36 +78,72 @@ fields:
|
|
|
78
78
|
options:
|
|
79
79
|
includeProjectDefault: true
|
|
80
80
|
|
|
81
|
-
- field:
|
|
81
|
+
- field: tfa_secret
|
|
82
|
+
interface: system-mfa-setup
|
|
83
|
+
special:
|
|
84
|
+
- conceal
|
|
85
|
+
width: half
|
|
86
|
+
|
|
87
|
+
- field: email_notifications
|
|
88
|
+
interface: boolean
|
|
89
|
+
width: half
|
|
90
|
+
special:
|
|
91
|
+
- cast-boolean
|
|
92
|
+
|
|
93
|
+
- field: theming_divider
|
|
94
|
+
interface: presentation-divider
|
|
95
|
+
options:
|
|
96
|
+
icon: palette
|
|
97
|
+
title: $t:theme
|
|
98
|
+
special:
|
|
99
|
+
- alias
|
|
100
|
+
- no-data
|
|
101
|
+
width: full
|
|
102
|
+
|
|
103
|
+
- field: appearance
|
|
82
104
|
interface: select-dropdown
|
|
83
105
|
options:
|
|
84
106
|
choices:
|
|
85
107
|
- value: auto
|
|
86
|
-
text: $t:
|
|
108
|
+
text: $t:appearance_auto
|
|
87
109
|
- value: light
|
|
88
|
-
text: $t:
|
|
110
|
+
text: $t:appearance_light
|
|
89
111
|
- value: dark
|
|
90
|
-
text: $t:
|
|
112
|
+
text: $t:appearance_dark
|
|
91
113
|
width: half
|
|
92
114
|
|
|
93
|
-
- field:
|
|
94
|
-
interface: system-mfa-setup
|
|
95
|
-
special:
|
|
96
|
-
- conceal
|
|
115
|
+
- field: theme_light
|
|
97
116
|
width: half
|
|
117
|
+
interface: system-theme
|
|
118
|
+
options:
|
|
119
|
+
appearance: light
|
|
120
|
+
hidden: true
|
|
98
121
|
|
|
99
|
-
- field:
|
|
100
|
-
interface: boolean
|
|
122
|
+
- field: theme_dark
|
|
101
123
|
width: half
|
|
124
|
+
interface: system-theme
|
|
125
|
+
options:
|
|
126
|
+
appearance: dark
|
|
127
|
+
hidden: true
|
|
128
|
+
|
|
129
|
+
- field: theme_light_overrides
|
|
130
|
+
width: full
|
|
131
|
+
interface: system-theme-overrides
|
|
102
132
|
special:
|
|
103
|
-
- cast-
|
|
133
|
+
- cast-json
|
|
134
|
+
|
|
135
|
+
- field: theme_dark_overrides
|
|
136
|
+
width: full
|
|
137
|
+
interface: system-theme-overrides
|
|
138
|
+
special:
|
|
139
|
+
- cast-json
|
|
104
140
|
|
|
105
141
|
- field: admin_divider
|
|
106
142
|
interface: presentation-divider
|
|
107
143
|
options:
|
|
108
144
|
icon: verified_user
|
|
109
145
|
title: $t:fields.directus_users.admin_options
|
|
110
|
-
color: 'var(--danger)'
|
|
146
|
+
color: 'var(--theme--danger)'
|
|
111
147
|
special:
|
|
112
148
|
- alias
|
|
113
149
|
- no-data
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
table: directus_versions
|
|
2
|
+
|
|
3
|
+
fields:
|
|
4
|
+
- field: id
|
|
5
|
+
special:
|
|
6
|
+
- uuid
|
|
7
|
+
readonly: true
|
|
8
|
+
hidden: true
|
|
9
|
+
|
|
10
|
+
- field: key
|
|
11
|
+
|
|
12
|
+
- field: name
|
|
13
|
+
|
|
14
|
+
- field: collection
|
|
15
|
+
|
|
16
|
+
- field: item
|
|
17
|
+
|
|
18
|
+
- field: hash
|
|
19
|
+
readonly: true
|
|
20
|
+
hidden: true
|
|
21
|
+
|
|
22
|
+
- field: date_created
|
|
23
|
+
special:
|
|
24
|
+
- date-created
|
|
25
|
+
- cast-timestamp
|
|
26
|
+
|
|
27
|
+
- field: date_updated
|
|
28
|
+
special:
|
|
29
|
+
- date-updated
|
|
30
|
+
- cast-timestamp
|
|
31
|
+
|
|
32
|
+
- field: user_created
|
|
33
|
+
special:
|
|
34
|
+
- user-created
|
|
35
|
+
|
|
36
|
+
- field: user_updated
|
|
37
|
+
special:
|
|
38
|
+
- user-updated
|
|
@@ -16,10 +16,10 @@ fields:
|
|
|
16
16
|
display_options:
|
|
17
17
|
choices:
|
|
18
18
|
- value: POST
|
|
19
|
-
foreground: 'var(--primary)'
|
|
20
|
-
background: 'var(--primary-
|
|
19
|
+
foreground: 'var(--theme--primary)'
|
|
20
|
+
background: 'var(--theme--primary-subdued)'
|
|
21
21
|
- value: GET
|
|
22
|
-
foreground: 'var(--secondary)'
|
|
22
|
+
foreground: 'var(--theme--secondary)'
|
|
23
23
|
background: 'var(--secondary-25)'
|
|
24
24
|
format: false
|
|
25
25
|
options:
|
|
@@ -42,11 +42,11 @@ fields:
|
|
|
42
42
|
choices:
|
|
43
43
|
- text: $t:field_options.directus_webhooks.status_options_active
|
|
44
44
|
value: active
|
|
45
|
-
foreground: 'var(--primary-
|
|
46
|
-
background: 'var(--primary)'
|
|
45
|
+
foreground: 'var(--theme--primary-background)'
|
|
46
|
+
background: 'var(--theme--primary)'
|
|
47
47
|
- text: $t:field_options.directus_webhooks.status_options_inactive
|
|
48
48
|
value: inactive
|
|
49
|
-
foreground: 'var(--foreground
|
|
49
|
+
foreground: 'var(--theme--foreground)'
|
|
50
50
|
background: 'var(--background-normal-alt)'
|
|
51
51
|
options:
|
|
52
52
|
choices:
|
|
@@ -115,15 +115,15 @@ fields:
|
|
|
115
115
|
choices:
|
|
116
116
|
- text: $t:create
|
|
117
117
|
value: create
|
|
118
|
-
foreground: 'var(--primary)'
|
|
119
|
-
background: 'var(--primary-
|
|
118
|
+
foreground: 'var(--theme--primary)'
|
|
119
|
+
background: 'var(--theme--primary-subdued)'
|
|
120
120
|
- text: $t:update
|
|
121
121
|
value: update
|
|
122
122
|
foreground: 'var(--blue)'
|
|
123
123
|
background: 'var(--blue-25)'
|
|
124
124
|
- text: $t:delete_label
|
|
125
125
|
value: delete
|
|
126
|
-
foreground: 'var(--danger)'
|
|
126
|
+
foreground: 'var(--theme--danger)'
|
|
127
127
|
background: 'var(--danger-25)'
|
|
128
128
|
- text: $t:login
|
|
129
129
|
value: login
|
|
@@ -12,114 +12,182 @@ defaults:
|
|
|
12
12
|
sort_field: null
|
|
13
13
|
|
|
14
14
|
data:
|
|
15
|
+
### Collections
|
|
15
16
|
- many_collection: directus_collections
|
|
16
17
|
many_field: group
|
|
17
18
|
one_collection: directus_collections
|
|
19
|
+
|
|
20
|
+
### Users
|
|
18
21
|
- many_collection: directus_users
|
|
19
22
|
many_field: role
|
|
20
23
|
one_collection: directus_roles
|
|
21
24
|
one_field: users
|
|
25
|
+
|
|
22
26
|
- many_collection: directus_users
|
|
23
27
|
many_field: avatar
|
|
24
28
|
one_collection: directus_files
|
|
29
|
+
|
|
30
|
+
### Revisions
|
|
25
31
|
- many_collection: directus_revisions
|
|
26
32
|
many_field: activity
|
|
27
33
|
one_collection: directus_activity
|
|
28
34
|
one_field: revisions
|
|
35
|
+
|
|
36
|
+
- many_collection: directus_revisions
|
|
37
|
+
many_field: parent
|
|
38
|
+
one_collection: directus_revisions
|
|
39
|
+
|
|
40
|
+
- many_collection: directus_revisions
|
|
41
|
+
many_field: version
|
|
42
|
+
one_collection: directus_versions
|
|
43
|
+
|
|
44
|
+
### Presets
|
|
29
45
|
- many_collection: directus_presets
|
|
30
46
|
many_field: user
|
|
31
47
|
one_collection: directus_users
|
|
48
|
+
|
|
32
49
|
- many_collection: directus_presets
|
|
33
50
|
many_field: role
|
|
34
51
|
one_collection: directus_roles
|
|
52
|
+
|
|
53
|
+
### Folders
|
|
35
54
|
- many_collection: directus_folders
|
|
36
55
|
many_field: parent
|
|
37
56
|
one_collection: directus_folders
|
|
57
|
+
|
|
58
|
+
### Files
|
|
38
59
|
- many_collection: directus_files
|
|
39
60
|
many_field: folder
|
|
40
61
|
one_collection: directus_folders
|
|
62
|
+
|
|
41
63
|
- many_collection: directus_files
|
|
42
64
|
many_field: uploaded_by
|
|
43
65
|
one_collection: directus_users
|
|
66
|
+
|
|
67
|
+
- many_collection: directus_files
|
|
68
|
+
many_field: modified_by
|
|
69
|
+
one_collection: directus_users
|
|
70
|
+
|
|
71
|
+
### Fields
|
|
44
72
|
- many_collection: directus_fields
|
|
45
73
|
many_field: collection
|
|
46
74
|
one_collection: directus_collections
|
|
47
75
|
one_field: fields
|
|
76
|
+
|
|
77
|
+
- many_collection: directus_fields
|
|
78
|
+
many_field: group
|
|
79
|
+
one_collection: directus_fields
|
|
80
|
+
|
|
81
|
+
### Activity
|
|
48
82
|
- many_collection: directus_activity
|
|
49
83
|
many_field: user
|
|
50
84
|
one_collection: directus_users
|
|
85
|
+
|
|
86
|
+
### Settings
|
|
51
87
|
- many_collection: directus_settings
|
|
52
88
|
many_field: project_logo
|
|
53
89
|
one_collection: directus_files
|
|
90
|
+
|
|
54
91
|
- many_collection: directus_settings
|
|
55
92
|
many_field: public_foreground
|
|
56
93
|
one_collection: directus_files
|
|
94
|
+
|
|
57
95
|
- many_collection: directus_settings
|
|
58
96
|
many_field: public_background
|
|
59
97
|
one_collection: directus_files
|
|
98
|
+
|
|
99
|
+
- many_collection: directus_settings
|
|
100
|
+
many_field: storage_default_folder
|
|
101
|
+
one_collection: directus_folders
|
|
102
|
+
|
|
103
|
+
### Panels
|
|
60
104
|
- many_collection: directus_panels
|
|
61
105
|
many_field: dashboard
|
|
62
106
|
one_collection: directus_dashboards
|
|
63
107
|
one_field: panels
|
|
108
|
+
|
|
109
|
+
- many_collection: directus_panels
|
|
110
|
+
many_field: user_created
|
|
111
|
+
one_collection: directus_users
|
|
112
|
+
|
|
113
|
+
### Flows
|
|
64
114
|
- many_collection: directus_flows
|
|
65
115
|
many_field: operation
|
|
66
116
|
one_collection: directus_operations
|
|
117
|
+
|
|
118
|
+
- many_collection: directus_flows
|
|
119
|
+
many_field: user_created
|
|
120
|
+
one_collection: directus_users
|
|
121
|
+
|
|
122
|
+
### Operations
|
|
67
123
|
- many_collection: directus_operations
|
|
68
124
|
many_field: flow
|
|
69
125
|
one_collection: directus_flows
|
|
70
126
|
one_field: operations
|
|
71
127
|
one_deselect_action: delete
|
|
128
|
+
|
|
72
129
|
- many_collection: directus_operations
|
|
73
130
|
many_field: resolve
|
|
74
131
|
one_collection: directus_operations
|
|
132
|
+
|
|
75
133
|
- many_collection: directus_operations
|
|
76
134
|
many_field: reject
|
|
77
135
|
one_collection: directus_operations
|
|
78
|
-
|
|
79
|
-
|
|
136
|
+
|
|
137
|
+
- many_collection: directus_operations
|
|
138
|
+
many_field: user_created
|
|
80
139
|
one_collection: directus_users
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
one_collection: directus_fields
|
|
140
|
+
|
|
141
|
+
### Permissions
|
|
84
142
|
- many_collection: directus_permissions
|
|
85
143
|
many_field: role
|
|
86
144
|
one_collection: directus_roles
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
one_collection: directus_revisions
|
|
145
|
+
|
|
146
|
+
### Sessions
|
|
90
147
|
- many_collection: directus_sessions
|
|
91
148
|
many_field: user
|
|
92
149
|
one_collection: directus_users
|
|
150
|
+
|
|
93
151
|
- many_collection: directus_sessions
|
|
94
152
|
many_field: share
|
|
95
153
|
one_collection: directus_shares
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
one_collection: directus_folders
|
|
154
|
+
|
|
155
|
+
### Dashboards
|
|
99
156
|
- many_collection: directus_dashboards
|
|
100
157
|
many_field: user_created
|
|
101
158
|
one_collection: directus_users
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
one_collection: directus_users
|
|
105
|
-
- many_collection: directus_flows
|
|
106
|
-
many_field: user_created
|
|
107
|
-
one_collection: directus_users
|
|
108
|
-
- many_collection: directus_operations
|
|
109
|
-
many_field: user_created
|
|
110
|
-
one_collection: directus_users
|
|
159
|
+
|
|
160
|
+
### Notifications
|
|
111
161
|
- many_collection: directus_notifications
|
|
112
162
|
many_field: recipient
|
|
113
163
|
one_collection: directus_users
|
|
164
|
+
|
|
114
165
|
- many_collection: directus_notifications
|
|
115
166
|
many_field: sender
|
|
116
167
|
one_collection: directus_users
|
|
168
|
+
|
|
169
|
+
### Shares
|
|
117
170
|
- many_collection: directus_shares
|
|
118
171
|
many_field: role
|
|
119
172
|
one_collection: directus_roles
|
|
173
|
+
|
|
120
174
|
- many_collection: directus_shares
|
|
121
175
|
many_field: collection
|
|
122
176
|
one_collection: directus_collections
|
|
177
|
+
|
|
123
178
|
- many_collection: directus_shares
|
|
124
179
|
many_field: user_created
|
|
125
180
|
one_collection: directus_users
|
|
181
|
+
|
|
182
|
+
### Versions
|
|
183
|
+
- many_collection: directus_versions
|
|
184
|
+
many_field: collection
|
|
185
|
+
one_collection: directus_collections
|
|
186
|
+
|
|
187
|
+
- many_collection: directus_versions
|
|
188
|
+
many_field: user_created
|
|
189
|
+
one_collection: directus_users
|
|
190
|
+
|
|
191
|
+
- many_collection: directus_versions
|
|
192
|
+
many_field: user_updated
|
|
193
|
+
one_collection: directus_users
|
package/dist/env.js
CHANGED
|
@@ -159,6 +159,8 @@ const allowedEnvironmentVars = [
|
|
|
159
159
|
'EXTENSIONS_PATH',
|
|
160
160
|
'EXTENSIONS_AUTO_RELOAD',
|
|
161
161
|
'EXTENSIONS_CACHE_TTL',
|
|
162
|
+
'EXTENSIONS_SANDBOX_MEMORY',
|
|
163
|
+
'EXTENSIONS_SANDBOX_TIMEOUT',
|
|
162
164
|
// messenger
|
|
163
165
|
'MESSENGER_STORE',
|
|
164
166
|
'MESSENGER_NAMESPACE',
|
|
@@ -255,6 +257,8 @@ const defaults = {
|
|
|
255
257
|
PACKAGE_FILE_LOCATION: '.',
|
|
256
258
|
EXTENSIONS_PATH: './extensions',
|
|
257
259
|
EXTENSIONS_AUTO_RELOAD: false,
|
|
260
|
+
EXTENSIONS_SANDBOX_MEMORY: 100,
|
|
261
|
+
EXTENSIONS_SANDBOX_TIMEOUT: 1000,
|
|
258
262
|
EMAIL_FROM: 'no-reply@example.com',
|
|
259
263
|
EMAIL_VERIFY_SETUP: true,
|
|
260
264
|
EMAIL_TRANSPORT: 'sendmail',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Extension } from '@directus/extensions';
|
|
2
|
+
/**
|
|
3
|
+
* Loads stored settings for all extensions. Creates empty new rows in extensions tables for
|
|
4
|
+
* extensions that don't have settings yet, and remove any settings for extensions that are no
|
|
5
|
+
* longer installed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getExtensionsSettings: (extensions: Extension[]) => Promise<import("@directus/extensions").ExtensionSettings[]>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { difference } from 'lodash-es';
|
|
2
|
+
import getDatabase from '../../database/index.js';
|
|
3
|
+
import { ExtensionsService } from '../../services/extensions.js';
|
|
4
|
+
import { getSchema } from '../../utils/get-schema.js';
|
|
5
|
+
/**
|
|
6
|
+
* Loads stored settings for all extensions. Creates empty new rows in extensions tables for
|
|
7
|
+
* extensions that don't have settings yet, and remove any settings for extensions that are no
|
|
8
|
+
* longer installed.
|
|
9
|
+
*/
|
|
10
|
+
export const getExtensionsSettings = async (extensions) => {
|
|
11
|
+
const database = getDatabase();
|
|
12
|
+
const service = new ExtensionsService({
|
|
13
|
+
knex: database,
|
|
14
|
+
schema: await getSchema(),
|
|
15
|
+
});
|
|
16
|
+
const settings = await service.extensionsItemService.readByQuery({ limit: -1 });
|
|
17
|
+
const extensionNames = extensions
|
|
18
|
+
.map((extension) => {
|
|
19
|
+
if (extension.type === 'bundle') {
|
|
20
|
+
return [extension.name, ...extension.entries.map((entry) => `${extension.name}/${entry.name}`)];
|
|
21
|
+
}
|
|
22
|
+
return extension.name;
|
|
23
|
+
})
|
|
24
|
+
.flat();
|
|
25
|
+
const extensionSettingNames = settings.map(({ name }) => name);
|
|
26
|
+
const missing = difference(extensionNames, extensionSettingNames);
|
|
27
|
+
if (missing.length > 0) {
|
|
28
|
+
const missingRows = missing.map((name) => ({ name, enabled: true }));
|
|
29
|
+
await database.insert(missingRows).into('directus_extensions');
|
|
30
|
+
settings.push(...missingRows);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Silently ignore settings for extensions that have been manually removed from the extensions
|
|
34
|
+
* folder. Having them automatically synced feels dangerous, as it's a destructive action. In the
|
|
35
|
+
* edge case you'd deploy / start with the extensions folder misconfigured, it would remove all
|
|
36
|
+
* previous options on startup, without an option to undo.
|
|
37
|
+
*/
|
|
38
|
+
return settings.filter(({ name }) => extensionNames.includes(name));
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getExtensions: () => Promise<import("@directus/extensions/node").Extension[]>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getLocalExtensions, getPackageExtensions, resolvePackageExtensions } from '@directus/extensions/node';
|
|
2
|
+
import env from '../../env.js';
|
|
3
|
+
export const getExtensions = async () => {
|
|
4
|
+
const localExtensions = await getLocalExtensions(env['EXTENSIONS_PATH']);
|
|
5
|
+
const loadedNames = localExtensions.map(({ name }) => name);
|
|
6
|
+
const filterDuplicates = ({ name }) => loadedNames.includes(name) === false;
|
|
7
|
+
const localPackageExtensions = (await resolvePackageExtensions(env['EXTENSIONS_PATH'])).filter((extension) => filterDuplicates(extension));
|
|
8
|
+
loadedNames.push(...localPackageExtensions.map(({ name }) => name));
|
|
9
|
+
const packageExtensions = (await getPackageExtensions(env['PACKAGE_FILE_LOCATION'])).filter((extension) => filterDuplicates(extension));
|
|
10
|
+
return [...packageExtensions, ...localPackageExtensions, ...localExtensions];
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSharedDepsMapping: (deps: string[]) => Promise<Record<string, string>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { resolvePackage } from '@directus/utils/node';
|
|
2
|
+
import { escapeRegExp } from 'lodash-es';
|
|
3
|
+
import { readdir } from 'node:fs/promises';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import env from '../../env.js';
|
|
6
|
+
import logger from '../../logger.js';
|
|
7
|
+
import { Url } from '../../utils/url.js';
|
|
8
|
+
import { dirname } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
export const getSharedDepsMapping = async (deps) => {
|
|
12
|
+
const appDir = await readdir(path.join(resolvePackage('@directus/app', __dirname), 'dist', 'assets'));
|
|
13
|
+
const depsMapping = {};
|
|
14
|
+
for (const dep of deps) {
|
|
15
|
+
const depRegex = new RegExp(`${escapeRegExp(dep.replace(/\//g, '_'))}\\.[0-9a-f]{8}\\.entry\\.js`);
|
|
16
|
+
const depName = appDir.find((file) => depRegex.test(file));
|
|
17
|
+
if (depName) {
|
|
18
|
+
const depUrl = new Url(env['PUBLIC_URL']).addPath('admin', 'assets', depName);
|
|
19
|
+
depsMapping[dep] = depUrl.toString({ rootRelative: true });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
logger.warn(`Couldn't find shared extension dependency "${dep}"`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return depsMapping;
|
|
26
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node/http.js" />
|
|
3
|
+
/// <reference types="pino-http" />
|
|
4
|
+
import type { ApiExtensionType, HybridExtensionType } from '@directus/extensions';
|
|
5
|
+
import type { Router } from 'express';
|
|
6
|
+
/**
|
|
7
|
+
* Generate the JS to run in the isolate to create the extension's entrypoint to the host
|
|
8
|
+
*
|
|
9
|
+
* @param type - Extension type to generate the entrypoint for
|
|
10
|
+
* @param name - Unique name of the extension
|
|
11
|
+
* @param endpointRouter - Scoped express router to register endpoint extension in
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateApiExtensionsSandboxEntrypoint(type: ApiExtensionType | HybridExtensionType, name: string, endpointRouter: Router): {
|
|
14
|
+
code: string;
|
|
15
|
+
hostFunctions: ((event: import("isolated-vm").Reference<string>, cb: import("isolated-vm").Reference<(payload: unknown) => void | Promise<void>>) => void)[];
|
|
16
|
+
unregisterFunction: () => Promise<void>;
|
|
17
|
+
} | {
|
|
18
|
+
code: string;
|
|
19
|
+
hostFunctions: ((path: import("isolated-vm").Reference<string>, method: import("isolated-vm").Reference<"GET" | "POST" | "DELETE" | "PUT" | "PATCH">, cb: import("isolated-vm").Reference<(req: {
|
|
20
|
+
url: string;
|
|
21
|
+
headers: import("http").IncomingHttpHeaders;
|
|
22
|
+
body: string;
|
|
23
|
+
}) => {
|
|
24
|
+
status: number;
|
|
25
|
+
body: string;
|
|
26
|
+
} | Promise<{
|
|
27
|
+
status: number;
|
|
28
|
+
body: string;
|
|
29
|
+
}>>) => void)[];
|
|
30
|
+
unregisterFunction: () => void;
|
|
31
|
+
};
|