@seshuk/payload-plugin-openapi 0.2.1 → 1.0.0-beta.1
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/README.md +67 -25
- package/dist/_tooling/telemetry.js +168 -0
- package/dist/_tooling/telemetry.js.map +1 -0
- package/dist/cli/generateSpec.d.ts +2 -0
- package/dist/cli/generateSpec.js +40 -0
- package/dist/cli/generateSpec.js.map +1 -0
- package/dist/index.d.ts +8 -9
- package/dist/index.js +76 -65
- package/dist/index.js.map +1 -0
- package/dist/{endpoints → server/endpoints}/interactiveAuth.d.ts +2 -2
- package/dist/server/endpoints/interactiveAuth.js +25 -0
- package/dist/server/endpoints/interactiveAuth.js.map +1 -0
- package/dist/server/endpoints/spec.d.ts +5 -0
- package/dist/server/endpoints/spec.js +39 -0
- package/dist/server/endpoints/spec.js.map +1 -0
- package/dist/server/options/resolveOptions.d.ts +4 -0
- package/dist/server/options/resolveOptions.js +65 -0
- package/dist/server/options/resolveOptions.js.map +1 -0
- package/dist/server/spec/build.d.ts +14 -0
- package/dist/server/spec/build.js +40 -0
- package/dist/server/spec/build.js.map +1 -0
- package/dist/server/spec/buildDocument.d.ts +16 -0
- package/dist/server/spec/buildDocument.js +287 -0
- package/dist/server/spec/buildDocument.js.map +1 -0
- package/dist/server/spec/components.d.ts +61 -0
- package/dist/server/spec/components.js +265 -0
- package/dist/server/spec/components.js.map +1 -0
- package/dist/{spec → server/spec}/downconvert.d.ts +2 -1
- package/dist/server/spec/downconvert.js +69 -0
- package/dist/server/spec/downconvert.js.map +1 -0
- package/dist/server/spec/entitySchemas.d.ts +16 -0
- package/dist/server/spec/entitySchemas.js +207 -0
- package/dist/server/spec/entitySchemas.js.map +1 -0
- package/dist/{spec → server/spec}/fields.d.ts +2 -1
- package/dist/server/spec/fields.js +47 -0
- package/dist/server/spec/fields.js.map +1 -0
- package/dist/server/spec/filters.d.ts +12 -0
- package/dist/server/spec/filters.js +91 -0
- package/dist/server/spec/filters.js.map +1 -0
- package/dist/server/spec/hierarchy.d.ts +11 -0
- package/dist/server/spec/hierarchy.js +38 -0
- package/dist/server/spec/hierarchy.js.map +1 -0
- package/dist/{spec → server/spec}/names.d.ts +2 -2
- package/dist/server/spec/names.js +43 -0
- package/dist/server/spec/names.js.map +1 -0
- package/dist/server/spec/params.d.ts +57 -0
- package/dist/server/spec/params.js +394 -0
- package/dist/server/spec/params.js.map +1 -0
- package/dist/server/spec/paths/auth.d.ts +10 -0
- package/dist/server/spec/paths/auth.js +190 -0
- package/dist/server/spec/paths/auth.js.map +1 -0
- package/dist/server/spec/paths/collections.d.ts +11 -0
- package/dist/server/spec/paths/collections.js +314 -0
- package/dist/server/spec/paths/collections.js.map +1 -0
- package/dist/server/spec/paths/custom.d.ts +10 -0
- package/dist/server/spec/paths/custom.js +42 -0
- package/dist/server/spec/paths/custom.js.map +1 -0
- package/dist/server/spec/paths/globals.d.ts +11 -0
- package/dist/server/spec/paths/globals.js +87 -0
- package/dist/server/spec/paths/globals.js.map +1 -0
- package/dist/server/spec/paths/jobs.d.ts +9 -0
- package/dist/server/spec/paths/jobs.js +98 -0
- package/dist/server/spec/paths/jobs.js.map +1 -0
- package/dist/server/spec/paths/system.d.ts +8 -0
- package/dist/server/spec/paths/system.js +137 -0
- package/dist/server/spec/paths/system.js.map +1 -0
- package/dist/server/spec/paths/versions.d.ts +22 -0
- package/dist/server/spec/paths/versions.js +185 -0
- package/dist/server/spec/paths/versions.js.map +1 -0
- package/dist/server/spec/security.d.ts +33 -0
- package/dist/server/spec/security.js +97 -0
- package/dist/server/spec/security.js.map +1 -0
- package/dist/server/spec/tags.d.ts +34 -0
- package/dist/server/spec/tags.js +83 -0
- package/dist/server/spec/tags.js.map +1 -0
- package/dist/server/telemetry.d.ts +31 -0
- package/dist/server/telemetry.js +33 -0
- package/dist/server/telemetry.js.map +1 -0
- package/dist/server/ui/createUiPlugin.d.ts +16 -0
- package/dist/server/ui/createUiPlugin.js +33 -0
- package/dist/server/ui/createUiPlugin.js.map +1 -0
- package/dist/{ui → server/ui}/html.d.ts +5 -3
- package/dist/server/ui/html.js +11 -0
- package/dist/server/ui/html.js.map +1 -0
- package/dist/server/ui/scalar.d.ts +4 -0
- package/dist/server/ui/scalar.js +17 -0
- package/dist/server/ui/scalar.js.map +1 -0
- package/dist/server/ui/swagger.d.ts +4 -0
- package/dist/server/ui/swagger.js +18 -0
- package/dist/server/ui/swagger.js.map +1 -0
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +6 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/translations/index.d.ts +5 -0
- package/dist/{translations → shared/translations}/index.js +49 -47
- package/dist/shared/translations/index.js.map +1 -0
- package/dist/shared/translations/locales/ar.d.ts +3 -0
- package/dist/shared/translations/locales/ar.js +99 -0
- package/dist/shared/translations/locales/ar.js.map +1 -0
- package/dist/shared/translations/locales/az.d.ts +3 -0
- package/dist/shared/translations/locales/az.js +99 -0
- package/dist/shared/translations/locales/az.js.map +1 -0
- package/dist/shared/translations/locales/bg.d.ts +3 -0
- package/dist/shared/translations/locales/bg.js +99 -0
- package/dist/shared/translations/locales/bg.js.map +1 -0
- package/dist/shared/translations/locales/bnBd.d.ts +3 -0
- package/dist/shared/translations/locales/bnBd.js +99 -0
- package/dist/shared/translations/locales/bnBd.js.map +1 -0
- package/dist/shared/translations/locales/bnIn.d.ts +3 -0
- package/dist/shared/translations/locales/bnIn.js +99 -0
- package/dist/shared/translations/locales/bnIn.js.map +1 -0
- package/dist/shared/translations/locales/ca.d.ts +3 -0
- package/dist/shared/translations/locales/ca.js +99 -0
- package/dist/shared/translations/locales/ca.js.map +1 -0
- package/dist/shared/translations/locales/cs.d.ts +3 -0
- package/dist/shared/translations/locales/cs.js +99 -0
- package/dist/shared/translations/locales/cs.js.map +1 -0
- package/dist/shared/translations/locales/da.d.ts +3 -0
- package/dist/shared/translations/locales/da.js +99 -0
- package/dist/shared/translations/locales/da.js.map +1 -0
- package/dist/shared/translations/locales/de.d.ts +3 -0
- package/dist/shared/translations/locales/de.js +99 -0
- package/dist/shared/translations/locales/de.js.map +1 -0
- package/dist/shared/translations/locales/en.d.ts +3 -0
- package/dist/shared/translations/locales/en.js +99 -0
- package/dist/shared/translations/locales/en.js.map +1 -0
- package/dist/shared/translations/locales/es.d.ts +3 -0
- package/dist/shared/translations/locales/es.js +99 -0
- package/dist/shared/translations/locales/es.js.map +1 -0
- package/dist/shared/translations/locales/et.d.ts +3 -0
- package/dist/shared/translations/locales/et.js +99 -0
- package/dist/shared/translations/locales/et.js.map +1 -0
- package/dist/shared/translations/locales/fa.d.ts +3 -0
- package/dist/shared/translations/locales/fa.js +99 -0
- package/dist/shared/translations/locales/fa.js.map +1 -0
- package/dist/shared/translations/locales/fr.d.ts +3 -0
- package/dist/shared/translations/locales/fr.js +99 -0
- package/dist/shared/translations/locales/fr.js.map +1 -0
- package/dist/shared/translations/locales/he.d.ts +3 -0
- package/dist/shared/translations/locales/he.js +99 -0
- package/dist/shared/translations/locales/he.js.map +1 -0
- package/dist/shared/translations/locales/hr.d.ts +3 -0
- package/dist/shared/translations/locales/hr.js +99 -0
- package/dist/shared/translations/locales/hr.js.map +1 -0
- package/dist/shared/translations/locales/hu.d.ts +3 -0
- package/dist/shared/translations/locales/hu.js +99 -0
- package/dist/shared/translations/locales/hu.js.map +1 -0
- package/dist/shared/translations/locales/hy.d.ts +3 -0
- package/dist/shared/translations/locales/hy.js +99 -0
- package/dist/shared/translations/locales/hy.js.map +1 -0
- package/dist/shared/translations/locales/id.d.ts +3 -0
- package/dist/shared/translations/locales/id.js +99 -0
- package/dist/shared/translations/locales/id.js.map +1 -0
- package/dist/shared/translations/locales/is.d.ts +3 -0
- package/dist/shared/translations/locales/is.js +99 -0
- package/dist/shared/translations/locales/is.js.map +1 -0
- package/dist/shared/translations/locales/it.d.ts +3 -0
- package/dist/shared/translations/locales/it.js +99 -0
- package/dist/shared/translations/locales/it.js.map +1 -0
- package/dist/shared/translations/locales/ja.d.ts +3 -0
- package/dist/shared/translations/locales/ja.js +99 -0
- package/dist/shared/translations/locales/ja.js.map +1 -0
- package/dist/shared/translations/locales/ko.d.ts +3 -0
- package/dist/shared/translations/locales/ko.js +99 -0
- package/dist/shared/translations/locales/ko.js.map +1 -0
- package/dist/shared/translations/locales/lt.d.ts +3 -0
- package/dist/shared/translations/locales/lt.js +99 -0
- package/dist/shared/translations/locales/lt.js.map +1 -0
- package/dist/shared/translations/locales/lv.d.ts +3 -0
- package/dist/shared/translations/locales/lv.js +99 -0
- package/dist/shared/translations/locales/lv.js.map +1 -0
- package/dist/shared/translations/locales/my.d.ts +3 -0
- package/dist/shared/translations/locales/my.js +99 -0
- package/dist/shared/translations/locales/my.js.map +1 -0
- package/dist/shared/translations/locales/nb.d.ts +3 -0
- package/dist/shared/translations/locales/nb.js +99 -0
- package/dist/shared/translations/locales/nb.js.map +1 -0
- package/dist/shared/translations/locales/nl.d.ts +3 -0
- package/dist/shared/translations/locales/nl.js +99 -0
- package/dist/shared/translations/locales/nl.js.map +1 -0
- package/dist/shared/translations/locales/pl.d.ts +3 -0
- package/dist/shared/translations/locales/pl.js +99 -0
- package/dist/shared/translations/locales/pl.js.map +1 -0
- package/dist/shared/translations/locales/pt.d.ts +3 -0
- package/dist/shared/translations/locales/pt.js +99 -0
- package/dist/shared/translations/locales/pt.js.map +1 -0
- package/dist/shared/translations/locales/ro.d.ts +3 -0
- package/dist/shared/translations/locales/ro.js +99 -0
- package/dist/shared/translations/locales/ro.js.map +1 -0
- package/dist/shared/translations/locales/rs.d.ts +3 -0
- package/dist/shared/translations/locales/rs.js +99 -0
- package/dist/shared/translations/locales/rs.js.map +1 -0
- package/dist/shared/translations/locales/rsLatin.d.ts +3 -0
- package/dist/shared/translations/locales/rsLatin.js +99 -0
- package/dist/shared/translations/locales/rsLatin.js.map +1 -0
- package/dist/shared/translations/locales/ru.d.ts +3 -0
- package/dist/shared/translations/locales/ru.js +99 -0
- package/dist/shared/translations/locales/ru.js.map +1 -0
- package/dist/shared/translations/locales/sk.d.ts +3 -0
- package/dist/shared/translations/locales/sk.js +99 -0
- package/dist/shared/translations/locales/sk.js.map +1 -0
- package/dist/shared/translations/locales/sl.d.ts +3 -0
- package/dist/shared/translations/locales/sl.js +99 -0
- package/dist/shared/translations/locales/sl.js.map +1 -0
- package/dist/shared/translations/locales/sv.d.ts +3 -0
- package/dist/shared/translations/locales/sv.js +99 -0
- package/dist/shared/translations/locales/sv.js.map +1 -0
- package/dist/shared/translations/locales/ta.d.ts +3 -0
- package/dist/shared/translations/locales/ta.js +99 -0
- package/dist/shared/translations/locales/ta.js.map +1 -0
- package/dist/shared/translations/locales/th.d.ts +3 -0
- package/dist/shared/translations/locales/th.js +99 -0
- package/dist/shared/translations/locales/th.js.map +1 -0
- package/dist/shared/translations/locales/tr.d.ts +3 -0
- package/dist/shared/translations/locales/tr.js +99 -0
- package/dist/shared/translations/locales/tr.js.map +1 -0
- package/dist/shared/translations/locales/uk.d.ts +3 -0
- package/dist/shared/translations/locales/uk.js +99 -0
- package/dist/shared/translations/locales/uk.js.map +1 -0
- package/dist/shared/translations/locales/vi.d.ts +3 -0
- package/dist/shared/translations/locales/vi.js +99 -0
- package/dist/shared/translations/locales/vi.js.map +1 -0
- package/dist/shared/translations/locales/zh.d.ts +3 -0
- package/dist/shared/translations/locales/zh.js +99 -0
- package/dist/shared/translations/locales/zh.js.map +1 -0
- package/dist/shared/translations/locales/zhTw.d.ts +3 -0
- package/dist/shared/translations/locales/zhTw.js +99 -0
- package/dist/shared/translations/locales/zhTw.js.map +1 -0
- package/dist/shared/translations/types.d.ts +106 -0
- package/dist/shared/translations/types.js +1 -0
- package/dist/shared/types/index.d.ts +397 -0
- package/dist/shared/types/index.js +1 -0
- package/dist/{utils.d.ts → shared/utils.d.ts} +1 -0
- package/dist/shared/utils.js +13 -0
- package/dist/shared/utils.js.map +1 -0
- package/package.json +67 -56
- package/dist/bin/generateSpec.d.ts +0 -25
- package/dist/bin/generateSpec.js +0 -61
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -2
- package/dist/endpoints/interactiveAuth.js +0 -27
- package/dist/endpoints/spec.d.ts +0 -5
- package/dist/endpoints/spec.js +0 -39
- package/dist/options.d.ts +0 -2
- package/dist/options.js +0 -45
- package/dist/spec/build.d.ts +0 -14
- package/dist/spec/build.js +0 -36
- package/dist/spec/buildDocument.d.ts +0 -15
- package/dist/spec/buildDocument.js +0 -268
- package/dist/spec/components.d.ts +0 -44
- package/dist/spec/components.js +0 -265
- package/dist/spec/downconvert.js +0 -74
- package/dist/spec/entitySchemas.d.ts +0 -15
- package/dist/spec/entitySchemas.js +0 -250
- package/dist/spec/fields.js +0 -44
- package/dist/spec/filters.d.ts +0 -11
- package/dist/spec/filters.js +0 -83
- package/dist/spec/names.js +0 -37
- package/dist/spec/params.d.ts +0 -55
- package/dist/spec/params.js +0 -436
- package/dist/spec/paths/auth.d.ts +0 -9
- package/dist/spec/paths/auth.js +0 -274
- package/dist/spec/paths/collections.d.ts +0 -9
- package/dist/spec/paths/collections.js +0 -278
- package/dist/spec/paths/custom.d.ts +0 -9
- package/dist/spec/paths/custom.js +0 -41
- package/dist/spec/paths/globals.d.ts +0 -9
- package/dist/spec/paths/globals.js +0 -78
- package/dist/spec/paths/jobs.d.ts +0 -7
- package/dist/spec/paths/jobs.js +0 -130
- package/dist/spec/paths/versions.d.ts +0 -19
- package/dist/spec/paths/versions.js +0 -252
- package/dist/spec/security.d.ts +0 -19
- package/dist/spec/security.js +0 -96
- package/dist/spec/tags.d.ts +0 -27
- package/dist/spec/tags.js +0 -79
- package/dist/translations/index.d.ts +0 -6
- package/dist/translations/locales/ar.d.ts +0 -2
- package/dist/translations/locales/ar.js +0 -81
- package/dist/translations/locales/az.d.ts +0 -2
- package/dist/translations/locales/az.js +0 -81
- package/dist/translations/locales/bg.d.ts +0 -2
- package/dist/translations/locales/bg.js +0 -81
- package/dist/translations/locales/bnBd.d.ts +0 -2
- package/dist/translations/locales/bnBd.js +0 -81
- package/dist/translations/locales/bnIn.d.ts +0 -2
- package/dist/translations/locales/bnIn.js +0 -81
- package/dist/translations/locales/ca.d.ts +0 -2
- package/dist/translations/locales/ca.js +0 -81
- package/dist/translations/locales/cs.d.ts +0 -2
- package/dist/translations/locales/cs.js +0 -81
- package/dist/translations/locales/da.d.ts +0 -2
- package/dist/translations/locales/da.js +0 -81
- package/dist/translations/locales/de.d.ts +0 -2
- package/dist/translations/locales/de.js +0 -81
- package/dist/translations/locales/en.d.ts +0 -2
- package/dist/translations/locales/en.js +0 -81
- package/dist/translations/locales/es.d.ts +0 -2
- package/dist/translations/locales/es.js +0 -81
- package/dist/translations/locales/et.d.ts +0 -2
- package/dist/translations/locales/et.js +0 -81
- package/dist/translations/locales/fa.d.ts +0 -2
- package/dist/translations/locales/fa.js +0 -81
- package/dist/translations/locales/fr.d.ts +0 -2
- package/dist/translations/locales/fr.js +0 -81
- package/dist/translations/locales/he.d.ts +0 -2
- package/dist/translations/locales/he.js +0 -81
- package/dist/translations/locales/hr.d.ts +0 -2
- package/dist/translations/locales/hr.js +0 -81
- package/dist/translations/locales/hu.d.ts +0 -2
- package/dist/translations/locales/hu.js +0 -81
- package/dist/translations/locales/hy.d.ts +0 -2
- package/dist/translations/locales/hy.js +0 -81
- package/dist/translations/locales/id.d.ts +0 -2
- package/dist/translations/locales/id.js +0 -81
- package/dist/translations/locales/is.d.ts +0 -2
- package/dist/translations/locales/is.js +0 -81
- package/dist/translations/locales/it.d.ts +0 -2
- package/dist/translations/locales/it.js +0 -81
- package/dist/translations/locales/ja.d.ts +0 -2
- package/dist/translations/locales/ja.js +0 -81
- package/dist/translations/locales/ko.d.ts +0 -2
- package/dist/translations/locales/ko.js +0 -81
- package/dist/translations/locales/lt.d.ts +0 -2
- package/dist/translations/locales/lt.js +0 -81
- package/dist/translations/locales/lv.d.ts +0 -2
- package/dist/translations/locales/lv.js +0 -81
- package/dist/translations/locales/my.d.ts +0 -2
- package/dist/translations/locales/my.js +0 -81
- package/dist/translations/locales/nb.d.ts +0 -2
- package/dist/translations/locales/nb.js +0 -81
- package/dist/translations/locales/nl.d.ts +0 -2
- package/dist/translations/locales/nl.js +0 -81
- package/dist/translations/locales/pl.d.ts +0 -2
- package/dist/translations/locales/pl.js +0 -81
- package/dist/translations/locales/pt.d.ts +0 -2
- package/dist/translations/locales/pt.js +0 -81
- package/dist/translations/locales/ro.d.ts +0 -2
- package/dist/translations/locales/ro.js +0 -81
- package/dist/translations/locales/rs.d.ts +0 -2
- package/dist/translations/locales/rs.js +0 -81
- package/dist/translations/locales/rsLatin.d.ts +0 -2
- package/dist/translations/locales/rsLatin.js +0 -81
- package/dist/translations/locales/ru.d.ts +0 -2
- package/dist/translations/locales/ru.js +0 -81
- package/dist/translations/locales/sk.d.ts +0 -2
- package/dist/translations/locales/sk.js +0 -81
- package/dist/translations/locales/sl.d.ts +0 -2
- package/dist/translations/locales/sl.js +0 -81
- package/dist/translations/locales/sv.d.ts +0 -2
- package/dist/translations/locales/sv.js +0 -81
- package/dist/translations/locales/ta.d.ts +0 -2
- package/dist/translations/locales/ta.js +0 -81
- package/dist/translations/locales/th.d.ts +0 -2
- package/dist/translations/locales/th.js +0 -81
- package/dist/translations/locales/tr.d.ts +0 -2
- package/dist/translations/locales/tr.js +0 -81
- package/dist/translations/locales/uk.d.ts +0 -2
- package/dist/translations/locales/uk.js +0 -81
- package/dist/translations/locales/vi.d.ts +0 -2
- package/dist/translations/locales/vi.js +0 -81
- package/dist/translations/locales/zh.d.ts +0 -2
- package/dist/translations/locales/zh.js +0 -81
- package/dist/translations/locales/zhTw.d.ts +0 -2
- package/dist/translations/locales/zhTw.js +0 -81
- package/dist/translations/types.d.ts +0 -87
- package/dist/translations/types.js +0 -1
- package/dist/types.d.ts +0 -192
- package/dist/types.js +0 -1
- package/dist/ui/createUiPlugin.d.ts +0 -14
- package/dist/ui/createUiPlugin.js +0 -28
- package/dist/ui/html.js +0 -8
- package/dist/ui/scalar.d.ts +0 -1
- package/dist/ui/scalar.js +0 -12
- package/dist/ui/swagger.d.ts +0 -1
- package/dist/ui/swagger.js +0 -12
- package/dist/utils.js +0 -13
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SanitizedConfig } from 'payload';
|
|
2
|
-
import type { PathsObject } from '@scalar/openapi-types/3.2';
|
|
3
|
-
import type { BuildContext } from '../../types.js';
|
|
4
|
-
export declare const buildJobsPaths: ({ config, ctx }: {
|
|
5
|
-
config: SanitizedConfig;
|
|
6
|
-
ctx: BuildContext;
|
|
7
|
-
}) => PathsObject;
|
package/dist/spec/paths/jobs.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { makeT } from "../../translations/index.js";
|
|
2
|
-
import { errorResponses, jsonResponse } from "../components.js";
|
|
3
|
-
const boolParam = (name, description)=>({
|
|
4
|
-
name,
|
|
5
|
-
in: 'query',
|
|
6
|
-
description,
|
|
7
|
-
schema: {
|
|
8
|
-
type: 'boolean'
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const collectQueues = (jobs)=>{
|
|
12
|
-
const queues = new Set([
|
|
13
|
-
'default'
|
|
14
|
-
]);
|
|
15
|
-
const add = (q)=>{
|
|
16
|
-
if ('string' == typeof q && q) queues.add(q);
|
|
17
|
-
};
|
|
18
|
-
const fromSchedules = (items)=>{
|
|
19
|
-
if (!Array.isArray(items)) return;
|
|
20
|
-
for (const item of items)for (const s of item.schedule ?? [])add(s.queue);
|
|
21
|
-
};
|
|
22
|
-
fromSchedules(jobs?.tasks);
|
|
23
|
-
fromSchedules(jobs?.workflows);
|
|
24
|
-
const autoRun = jobs?.autoRun;
|
|
25
|
-
if (Array.isArray(autoRun)) for (const cron of autoRun)add(cron.queue);
|
|
26
|
-
const processingOrder = jobs?.processingOrder;
|
|
27
|
-
if (processingOrder?.queues) for (const name of Object.keys(processingOrder.queues))add(name);
|
|
28
|
-
return [
|
|
29
|
-
...queues
|
|
30
|
-
].toSorted();
|
|
31
|
-
};
|
|
32
|
-
const queueParam = (queues, ctx)=>({
|
|
33
|
-
name: 'queue',
|
|
34
|
-
in: 'query',
|
|
35
|
-
description: makeT(ctx.i18n)('jobsQueue', {
|
|
36
|
-
queues: queues.map((q)=>`\`${q}\``).join(', ')
|
|
37
|
-
}),
|
|
38
|
-
schema: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
enum: queues
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
const buildJobsPaths = ({ config, ctx })=>{
|
|
44
|
-
const jobs = config.jobs;
|
|
45
|
-
const hasJobs = Boolean(jobs?.tasks?.length || jobs?.workflows?.length);
|
|
46
|
-
if (!hasJobs) return {};
|
|
47
|
-
const t = makeT(ctx.i18n);
|
|
48
|
-
const queue = queueParam(collectQueues(jobs), ctx);
|
|
49
|
-
const errors = errorResponses([
|
|
50
|
-
'401',
|
|
51
|
-
'403',
|
|
52
|
-
'500'
|
|
53
|
-
], t);
|
|
54
|
-
return {
|
|
55
|
-
[`${ctx.apiRoute}/payload-jobs/run`]: {
|
|
56
|
-
get: {
|
|
57
|
-
tags: [
|
|
58
|
-
'Jobs'
|
|
59
|
-
],
|
|
60
|
-
operationId: 'runJobs',
|
|
61
|
-
summary: t('jobsRunSummary'),
|
|
62
|
-
parameters: [
|
|
63
|
-
queue,
|
|
64
|
-
boolParam('allQueues', t('jobsRunAllQueues')),
|
|
65
|
-
{
|
|
66
|
-
name: 'limit',
|
|
67
|
-
in: 'query',
|
|
68
|
-
description: t('jobsLimit'),
|
|
69
|
-
schema: {
|
|
70
|
-
type: 'integer'
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
boolParam('disableScheduling', t('jobsDisableScheduling')),
|
|
74
|
-
boolParam('silent', t('jobsSilent'))
|
|
75
|
-
],
|
|
76
|
-
responses: {
|
|
77
|
-
200: jsonResponse(t('jobsRunResult'), {
|
|
78
|
-
type: 'object',
|
|
79
|
-
properties: {
|
|
80
|
-
message: {
|
|
81
|
-
type: 'string'
|
|
82
|
-
},
|
|
83
|
-
noJobsRemaining: {
|
|
84
|
-
type: 'boolean'
|
|
85
|
-
},
|
|
86
|
-
remainingJobsFromQueried: {
|
|
87
|
-
type: 'integer'
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}),
|
|
91
|
-
...errors
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
[`${ctx.apiRoute}/payload-jobs/handle-schedules`]: {
|
|
96
|
-
get: {
|
|
97
|
-
tags: [
|
|
98
|
-
'Jobs'
|
|
99
|
-
],
|
|
100
|
-
operationId: 'handleJobSchedules',
|
|
101
|
-
summary: t('jobsSchedulesSummary'),
|
|
102
|
-
parameters: [
|
|
103
|
-
queue,
|
|
104
|
-
boolParam('allQueues', t('jobsSchedulesAllQueues'))
|
|
105
|
-
],
|
|
106
|
-
responses: {
|
|
107
|
-
200: jsonResponse(t('jobsSchedulesResult'), {
|
|
108
|
-
type: 'object',
|
|
109
|
-
properties: {
|
|
110
|
-
message: {
|
|
111
|
-
type: 'string'
|
|
112
|
-
},
|
|
113
|
-
queued: {
|
|
114
|
-
type: 'integer'
|
|
115
|
-
},
|
|
116
|
-
errored: {
|
|
117
|
-
type: 'integer'
|
|
118
|
-
},
|
|
119
|
-
skipped: {
|
|
120
|
-
type: 'integer'
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
124
|
-
...errors
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
export { buildJobsPaths };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { PathsObject, SchemaObject } from '@scalar/openapi-types/3.2';
|
|
2
|
-
import type { BuildContext, Entity, IDType } from '../../types.js';
|
|
3
|
-
export interface VersionSchemas {
|
|
4
|
-
version: SchemaObject;
|
|
5
|
-
versionList: SchemaObject;
|
|
6
|
-
}
|
|
7
|
-
export declare const versionComponentSchemas: ({ docBase, base, idType, }: {
|
|
8
|
-
docBase: string;
|
|
9
|
-
base: string;
|
|
10
|
-
idType: IDType;
|
|
11
|
-
}) => VersionSchemas;
|
|
12
|
-
export declare const buildVersionPaths: ({ entity, pathBase, ctx, schemaBase, nestedTags, global, }: {
|
|
13
|
-
entity: Entity;
|
|
14
|
-
pathBase: string;
|
|
15
|
-
ctx: BuildContext;
|
|
16
|
-
schemaBase?: string;
|
|
17
|
-
nestedTags: boolean;
|
|
18
|
-
global?: boolean;
|
|
19
|
-
}) => PathsObject;
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { makeT } from "../../translations/index.js";
|
|
2
|
-
import { ERRORS, errorResponses, jsonResponse, nullableType } from "../components.js";
|
|
3
|
-
import { refTo, schemaName } from "../names.js";
|
|
4
|
-
import { buildParamSchemas, commonReadParams } from "../params.js";
|
|
5
|
-
import { versionsTagName } from "../tags.js";
|
|
6
|
-
const buildVersionSchema = (base, idType)=>{
|
|
7
|
-
const id = {
|
|
8
|
-
type: 'number' === idType ? 'integer' : 'string'
|
|
9
|
-
};
|
|
10
|
-
return {
|
|
11
|
-
type: 'object',
|
|
12
|
-
properties: {
|
|
13
|
-
id,
|
|
14
|
-
parent: id,
|
|
15
|
-
version: {
|
|
16
|
-
$ref: refTo(base)
|
|
17
|
-
},
|
|
18
|
-
createdAt: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
format: 'date-time'
|
|
21
|
-
},
|
|
22
|
-
updatedAt: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
format: 'date-time'
|
|
25
|
-
},
|
|
26
|
-
latest: {
|
|
27
|
-
type: 'boolean'
|
|
28
|
-
},
|
|
29
|
-
autosave: {
|
|
30
|
-
type: 'boolean'
|
|
31
|
-
},
|
|
32
|
-
snapshot: {
|
|
33
|
-
type: 'boolean'
|
|
34
|
-
},
|
|
35
|
-
publishedLocale: {
|
|
36
|
-
type: 'string'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
required: [
|
|
40
|
-
'id',
|
|
41
|
-
'parent',
|
|
42
|
-
'version',
|
|
43
|
-
'createdAt',
|
|
44
|
-
'updatedAt'
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
const buildVersionListSchema = (base)=>({
|
|
49
|
-
type: 'object',
|
|
50
|
-
properties: {
|
|
51
|
-
docs: {
|
|
52
|
-
type: 'array',
|
|
53
|
-
items: {
|
|
54
|
-
$ref: refTo(`${base}Version`)
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
totalDocs: {
|
|
58
|
-
type: 'integer'
|
|
59
|
-
},
|
|
60
|
-
limit: {
|
|
61
|
-
type: 'integer'
|
|
62
|
-
},
|
|
63
|
-
totalPages: {
|
|
64
|
-
type: 'integer'
|
|
65
|
-
},
|
|
66
|
-
page: {
|
|
67
|
-
type: 'integer'
|
|
68
|
-
},
|
|
69
|
-
pagingCounter: {
|
|
70
|
-
type: 'integer'
|
|
71
|
-
},
|
|
72
|
-
hasPrevPage: {
|
|
73
|
-
type: 'boolean'
|
|
74
|
-
},
|
|
75
|
-
hasNextPage: {
|
|
76
|
-
type: 'boolean'
|
|
77
|
-
},
|
|
78
|
-
prevPage: nullableType('integer'),
|
|
79
|
-
nextPage: nullableType('integer')
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
const versionComponentSchemas = ({ docBase, base, idType })=>({
|
|
83
|
-
version: buildVersionSchema(docBase, idType),
|
|
84
|
-
versionList: buildVersionListSchema(base)
|
|
85
|
-
});
|
|
86
|
-
const versionRef = (base)=>({
|
|
87
|
-
$ref: refTo(`${base}Version`)
|
|
88
|
-
});
|
|
89
|
-
const versionListRef = (base)=>({
|
|
90
|
-
$ref: refTo(`${base}VersionList`)
|
|
91
|
-
});
|
|
92
|
-
const listVersionParams = ({ base, ctx, refs })=>{
|
|
93
|
-
const t = makeT(ctx.i18n);
|
|
94
|
-
return [
|
|
95
|
-
{
|
|
96
|
-
name: 'page',
|
|
97
|
-
in: 'query',
|
|
98
|
-
schema: {
|
|
99
|
-
type: 'integer'
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'limit',
|
|
104
|
-
in: 'query',
|
|
105
|
-
schema: {
|
|
106
|
-
type: 'integer'
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'pagination',
|
|
111
|
-
in: 'query',
|
|
112
|
-
schema: {
|
|
113
|
-
type: 'boolean'
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'sort',
|
|
118
|
-
in: 'query',
|
|
119
|
-
description: t('paramSortShort'),
|
|
120
|
-
schema: {
|
|
121
|
-
type: 'string'
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
...commonReadParams({
|
|
125
|
-
base,
|
|
126
|
-
ctx,
|
|
127
|
-
refs
|
|
128
|
-
}),
|
|
129
|
-
{
|
|
130
|
-
name: 'where',
|
|
131
|
-
in: 'query',
|
|
132
|
-
description: t('versionWhere'),
|
|
133
|
-
content: {
|
|
134
|
-
'application/json': {
|
|
135
|
-
schema: {
|
|
136
|
-
type: 'object',
|
|
137
|
-
additionalProperties: true
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
];
|
|
143
|
-
};
|
|
144
|
-
const buildVersionPaths = ({ entity, pathBase, ctx, schemaBase, nestedTags, global = false })=>{
|
|
145
|
-
if (!entity.versions) return {};
|
|
146
|
-
const t = makeT(ctx.i18n);
|
|
147
|
-
const name = schemaBase ?? schemaName(entity.slug);
|
|
148
|
-
const versionsTag = [
|
|
149
|
-
nestedTags ? versionsTagName(name) : name
|
|
150
|
-
];
|
|
151
|
-
const paramSchemas = buildParamSchemas({
|
|
152
|
-
fields: entity.fields,
|
|
153
|
-
ctx
|
|
154
|
-
});
|
|
155
|
-
const refs = {
|
|
156
|
-
select: true,
|
|
157
|
-
populate: Boolean(paramSchemas.populate),
|
|
158
|
-
joins: Boolean(paramSchemas.joins)
|
|
159
|
-
};
|
|
160
|
-
const idParam = {
|
|
161
|
-
name: 'id',
|
|
162
|
-
in: 'path',
|
|
163
|
-
required: true,
|
|
164
|
-
schema: {
|
|
165
|
-
type: 'number' === ctx.defaultIDType ? 'integer' : 'string'
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const message = {
|
|
169
|
-
type: 'string'
|
|
170
|
-
};
|
|
171
|
-
const restoreResponse = global ? {
|
|
172
|
-
type: 'object',
|
|
173
|
-
properties: {
|
|
174
|
-
message,
|
|
175
|
-
doc: {
|
|
176
|
-
$ref: refTo(name)
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
} : {
|
|
180
|
-
allOf: [
|
|
181
|
-
{
|
|
182
|
-
$ref: refTo(name)
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: 'object',
|
|
186
|
-
properties: {
|
|
187
|
-
message
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
};
|
|
192
|
-
return {
|
|
193
|
-
[`${pathBase}/versions`]: {
|
|
194
|
-
get: {
|
|
195
|
-
tags: versionsTag,
|
|
196
|
-
operationId: `find${name}Versions`,
|
|
197
|
-
parameters: listVersionParams({
|
|
198
|
-
base: name,
|
|
199
|
-
ctx,
|
|
200
|
-
refs
|
|
201
|
-
}),
|
|
202
|
-
responses: {
|
|
203
|
-
200: jsonResponse(t('versionList'), versionListRef(name)),
|
|
204
|
-
...errorResponses(ERRORS.versionList, t)
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
[`${pathBase}/versions/{id}`]: {
|
|
209
|
-
parameters: [
|
|
210
|
-
idParam
|
|
211
|
-
],
|
|
212
|
-
get: {
|
|
213
|
-
tags: versionsTag,
|
|
214
|
-
operationId: `find${name}VersionById`,
|
|
215
|
-
parameters: commonReadParams({
|
|
216
|
-
base: name,
|
|
217
|
-
ctx,
|
|
218
|
-
refs
|
|
219
|
-
}),
|
|
220
|
-
responses: {
|
|
221
|
-
200: jsonResponse(t('versionSingle'), versionRef(name)),
|
|
222
|
-
...errorResponses(ERRORS.versionRead, t)
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
post: {
|
|
226
|
-
tags: versionsTag,
|
|
227
|
-
operationId: `restore${name}Version`,
|
|
228
|
-
parameters: [
|
|
229
|
-
{
|
|
230
|
-
name: 'depth',
|
|
231
|
-
in: 'query',
|
|
232
|
-
schema: {
|
|
233
|
-
type: 'integer'
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
name: 'draft',
|
|
238
|
-
in: 'query',
|
|
239
|
-
schema: {
|
|
240
|
-
type: 'boolean'
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
],
|
|
244
|
-
responses: {
|
|
245
|
-
200: jsonResponse(t('versionRestored'), restoreResponse),
|
|
246
|
-
...errorResponses(ERRORS.versionRestore, t)
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
};
|
|
252
|
-
export { buildVersionPaths, versionComponentSchemas };
|
package/dist/spec/security.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Access } from 'payload';
|
|
2
|
-
import type { PathsObject, SecurityRequirementObject } from '@scalar/openapi-types/3.2';
|
|
3
|
-
import type { Entity, EntityKind, EntityOperation, OperationContext } from '../types.js';
|
|
4
|
-
export type EntitySecurity = Partial<Record<EntityOperation, SecurityRequirementObject[] | undefined>>;
|
|
5
|
-
export declare const evaluateAccess: (access: Access | undefined, opts?: {
|
|
6
|
-
locale?: string;
|
|
7
|
-
timeoutMs?: number;
|
|
8
|
-
}) => Promise<boolean>;
|
|
9
|
-
export declare const resolveEntitySecurity: ({ entity, operations, locale, }: {
|
|
10
|
-
entity: Entity;
|
|
11
|
-
operations: EntityOperation[];
|
|
12
|
-
locale?: string;
|
|
13
|
-
}) => Promise<EntitySecurity>;
|
|
14
|
-
export declare const applySecurityWhen: ({ paths, slug, kind, securityWhen, }: {
|
|
15
|
-
paths: PathsObject;
|
|
16
|
-
slug: string;
|
|
17
|
-
kind: EntityKind;
|
|
18
|
-
securityWhen?: (ctx: OperationContext) => boolean | undefined;
|
|
19
|
-
}) => PathsObject;
|
package/dist/spec/security.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { SECURITY_SCHEME_NAME } from "./components.js";
|
|
2
|
-
const HTTP_METHODS = [
|
|
3
|
-
'get',
|
|
4
|
-
'post',
|
|
5
|
-
'patch',
|
|
6
|
-
'put',
|
|
7
|
-
'delete'
|
|
8
|
-
];
|
|
9
|
-
const securedRequirement = ()=>[
|
|
10
|
-
{
|
|
11
|
-
[SECURITY_SCHEME_NAME]: []
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
const withTimeout = async (promise, timeoutMs)=>{
|
|
15
|
-
let timer;
|
|
16
|
-
const guard = new Promise((resolve)=>{
|
|
17
|
-
timer = setTimeout(()=>resolve(false), timeoutMs);
|
|
18
|
-
});
|
|
19
|
-
try {
|
|
20
|
-
return await Promise.race([
|
|
21
|
-
promise.then((value)=>true === value, ()=>false),
|
|
22
|
-
guard
|
|
23
|
-
]);
|
|
24
|
-
} finally{
|
|
25
|
-
if (timer) clearTimeout(timer);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const evaluateAccess = async (access, opts = {})=>{
|
|
29
|
-
if (!access) return false;
|
|
30
|
-
const { locale, timeoutMs = 250 } = opts;
|
|
31
|
-
const payloadTrap = new Proxy({}, {
|
|
32
|
-
get () {
|
|
33
|
-
throw new Error('req.payload accessed during build');
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
const req = {
|
|
37
|
-
user: null,
|
|
38
|
-
headers: new Headers(),
|
|
39
|
-
context: {},
|
|
40
|
-
locale,
|
|
41
|
-
payload: payloadTrap
|
|
42
|
-
};
|
|
43
|
-
try {
|
|
44
|
-
const result = access({
|
|
45
|
-
req
|
|
46
|
-
});
|
|
47
|
-
if (result && 'function' == typeof result.then) return await withTimeout(result, timeoutMs);
|
|
48
|
-
return true === result;
|
|
49
|
-
} catch {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const readSecurityOverride = (entity)=>{
|
|
54
|
-
const meta = entity.custom?.openapi?.security;
|
|
55
|
-
if ('boolean' == typeof meta) return meta;
|
|
56
|
-
if (meta && 'object' == typeof meta) return meta;
|
|
57
|
-
};
|
|
58
|
-
const overrideFor = (override, op)=>{
|
|
59
|
-
if (void 0 === override) return;
|
|
60
|
-
if ('boolean' == typeof override) return override;
|
|
61
|
-
return override[op];
|
|
62
|
-
};
|
|
63
|
-
const resolveEntitySecurity = async ({ entity, operations, locale })=>{
|
|
64
|
-
const override = readSecurityOverride(entity);
|
|
65
|
-
const access = entity.access;
|
|
66
|
-
const out = {};
|
|
67
|
-
for (const op of operations){
|
|
68
|
-
const declared = overrideFor(override, op);
|
|
69
|
-
const isPublic = declared ?? await evaluateAccess(access?.[op], {
|
|
70
|
-
locale
|
|
71
|
-
});
|
|
72
|
-
out[op] = isPublic ? void 0 : securedRequirement();
|
|
73
|
-
}
|
|
74
|
-
return out;
|
|
75
|
-
};
|
|
76
|
-
const applySecurityWhen = ({ paths, slug, kind, securityWhen })=>{
|
|
77
|
-
if (!securityWhen) return paths;
|
|
78
|
-
for (const [path, item] of Object.entries(paths)){
|
|
79
|
-
if (!item) continue;
|
|
80
|
-
const ops = item;
|
|
81
|
-
for (const method of HTTP_METHODS){
|
|
82
|
-
const op = ops[method];
|
|
83
|
-
if (!op) continue;
|
|
84
|
-
const decision = securityWhen({
|
|
85
|
-
method,
|
|
86
|
-
path,
|
|
87
|
-
slug,
|
|
88
|
-
kind
|
|
89
|
-
});
|
|
90
|
-
if (true === decision) delete op.security;
|
|
91
|
-
else if (false === decision) op.security = securedRequirement();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return paths;
|
|
95
|
-
};
|
|
96
|
-
export { applySecurityWhen, evaluateAccess, resolveEntitySecurity };
|
package/dist/spec/tags.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { TagObject } from '@scalar/openapi-types/3.2';
|
|
2
|
-
import type { Translate } from '../translations/types.js';
|
|
3
|
-
export declare const NAV_COLLECTIONS = "Collections";
|
|
4
|
-
export declare const NAV_GLOBALS = "Globals";
|
|
5
|
-
export declare const NAV_SYSTEM = "System";
|
|
6
|
-
export declare const entityTagName: (base: string) => string;
|
|
7
|
-
export declare const authTagName: (base: string) => string;
|
|
8
|
-
export declare const versionsTagName: (base: string) => string;
|
|
9
|
-
export interface CollectionTagInfo {
|
|
10
|
-
base: string;
|
|
11
|
-
hasAuth: boolean;
|
|
12
|
-
hasVersions: boolean;
|
|
13
|
-
description?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface GlobalTagInfo {
|
|
16
|
-
base: string;
|
|
17
|
-
hasVersions: boolean;
|
|
18
|
-
description?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface TagHierarchyInput {
|
|
21
|
-
collections: CollectionTagInfo[];
|
|
22
|
-
globals: GlobalTagInfo[];
|
|
23
|
-
hasJobs: boolean;
|
|
24
|
-
t: Translate;
|
|
25
|
-
nested: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare const buildTagHierarchy: ({ collections, globals, hasJobs, t, nested }: TagHierarchyInput) => TagObject[];
|
package/dist/spec/tags.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
const NAV_COLLECTIONS = 'Collections';
|
|
2
|
-
const NAV_GLOBALS = 'Globals';
|
|
3
|
-
const NAV_SYSTEM = 'System';
|
|
4
|
-
const entityTagName = (base)=>base;
|
|
5
|
-
const authTagName = (base)=>`${base} Auth`;
|
|
6
|
-
const versionsTagName = (base)=>`${base} Versions`;
|
|
7
|
-
const buildTagHierarchy = ({ collections, globals, hasJobs, t, nested })=>{
|
|
8
|
-
if (!nested) return [
|
|
9
|
-
...collections.map((c)=>({
|
|
10
|
-
name: entityTagName(c.base),
|
|
11
|
-
description: c.description
|
|
12
|
-
})),
|
|
13
|
-
...globals.map((g)=>({
|
|
14
|
-
name: entityTagName(g.base),
|
|
15
|
-
description: g.description
|
|
16
|
-
}))
|
|
17
|
-
];
|
|
18
|
-
const tags = [];
|
|
19
|
-
if (collections.length > 0) {
|
|
20
|
-
tags.push({
|
|
21
|
-
name: NAV_COLLECTIONS,
|
|
22
|
-
summary: t('tagCollections'),
|
|
23
|
-
description: t('tagCollectionsDesc'),
|
|
24
|
-
kind: 'nav'
|
|
25
|
-
});
|
|
26
|
-
for (const c of collections){
|
|
27
|
-
tags.push({
|
|
28
|
-
name: entityTagName(c.base),
|
|
29
|
-
parent: NAV_COLLECTIONS,
|
|
30
|
-
description: c.description
|
|
31
|
-
});
|
|
32
|
-
if (c.hasAuth) tags.push({
|
|
33
|
-
name: authTagName(c.base),
|
|
34
|
-
parent: c.base,
|
|
35
|
-
summary: t('tagAuth')
|
|
36
|
-
});
|
|
37
|
-
if (c.hasVersions) tags.push({
|
|
38
|
-
name: versionsTagName(c.base),
|
|
39
|
-
parent: c.base,
|
|
40
|
-
summary: t('tagVersions')
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (globals.length > 0) {
|
|
45
|
-
tags.push({
|
|
46
|
-
name: NAV_GLOBALS,
|
|
47
|
-
summary: t('tagGlobals'),
|
|
48
|
-
description: t('tagGlobalsDesc'),
|
|
49
|
-
kind: 'nav'
|
|
50
|
-
});
|
|
51
|
-
for (const g of globals){
|
|
52
|
-
tags.push({
|
|
53
|
-
name: entityTagName(g.base),
|
|
54
|
-
parent: NAV_GLOBALS,
|
|
55
|
-
description: g.description
|
|
56
|
-
});
|
|
57
|
-
if (g.hasVersions) tags.push({
|
|
58
|
-
name: versionsTagName(g.base),
|
|
59
|
-
parent: g.base,
|
|
60
|
-
summary: t('tagVersions')
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (hasJobs) {
|
|
65
|
-
tags.push({
|
|
66
|
-
name: NAV_SYSTEM,
|
|
67
|
-
summary: t('tagSystem'),
|
|
68
|
-
description: t('tagSystemDesc'),
|
|
69
|
-
kind: 'nav'
|
|
70
|
-
});
|
|
71
|
-
tags.push({
|
|
72
|
-
name: 'Jobs',
|
|
73
|
-
parent: NAV_SYSTEM,
|
|
74
|
-
summary: t('tagJobs')
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
return tags;
|
|
78
|
-
};
|
|
79
|
-
export { NAV_COLLECTIONS, NAV_GLOBALS, NAV_SYSTEM, authTagName, buildTagHierarchy, entityTagName, versionsTagName };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AcceptedLanguages, I18n } from '@payloadcms/translations';
|
|
2
|
-
import type { PluginDefaultTranslationsObject, Translate } from './types.js';
|
|
3
|
-
export declare const makeT: (i18n: Pick<I18n, "t">) => Translate;
|
|
4
|
-
export declare const translations: {
|
|
5
|
-
[key in AcceptedLanguages]?: PluginDefaultTranslationsObject;
|
|
6
|
-
};
|