@strapi/core 5.50.1 → 5.51.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/compile.d.ts +1 -1
- package/dist/core-api/routes/validation/common.d.ts +3 -3
- package/dist/core-api/routes/validation/common.d.ts.map +1 -1
- package/dist/core-api/service/collection-type.d.ts +2 -2
- package/dist/core-api/service/single-type.d.ts +2 -2
- package/dist/domain/content-type/index.d.ts +1 -1
- package/dist/domain/content-type/index.d.ts.map +1 -1
- package/dist/domain/content-type/index.js +9 -0
- package/dist/domain/content-type/index.js.map +1 -1
- package/dist/domain/content-type/index.mjs +9 -0
- package/dist/domain/content-type/index.mjs.map +1 -1
- package/dist/domain/content-type/validator.d.ts.map +1 -1
- package/dist/domain/content-type/validator.js.map +1 -1
- package/dist/domain/content-type/validator.mjs.map +1 -1
- package/dist/ee/index.js.map +1 -1
- package/dist/ee/index.mjs.map +1 -1
- package/dist/ee/license.d.ts +1 -1
- package/dist/ee/license.d.ts.map +1 -1
- package/dist/ee/license.js +51 -8
- package/dist/ee/license.js.map +1 -1
- package/dist/ee/license.mjs +32 -8
- package/dist/ee/license.mjs.map +1 -1
- package/dist/migrations/database/5.0.0-discard-drafts.d.ts.map +1 -1
- package/dist/migrations/database/5.0.0-discard-drafts.js +77 -7
- package/dist/migrations/database/5.0.0-discard-drafts.js.map +1 -1
- package/dist/migrations/database/5.0.0-discard-drafts.mjs +77 -7
- package/dist/migrations/database/5.0.0-discard-drafts.mjs.map +1 -1
- package/dist/package.json.js +18 -16
- package/dist/package.json.js.map +1 -1
- package/dist/package.json.mjs +18 -16
- package/dist/package.json.mjs.map +1 -1
- package/dist/services/document-service/attributes/index.d.ts +1 -1
- package/dist/services/document-service/attributes/index.d.ts.map +1 -1
- package/dist/services/document-service/components.d.ts +2 -2
- package/dist/services/document-service/components.d.ts.map +1 -1
- package/dist/services/document-service/first-published-at.d.ts.map +1 -1
- package/dist/services/document-service/first-published-at.js +9 -2
- package/dist/services/document-service/first-published-at.js.map +1 -1
- package/dist/services/document-service/first-published-at.mjs +9 -2
- package/dist/services/document-service/first-published-at.mjs.map +1 -1
- package/dist/services/document-service/repository.d.ts.map +1 -1
- package/dist/services/document-service/repository.js +31 -11
- package/dist/services/document-service/repository.js.map +1 -1
- package/dist/services/document-service/repository.mjs +30 -10
- package/dist/services/document-service/repository.mjs.map +1 -1
- package/dist/services/document-service/utils/clone-relations.d.ts +7 -0
- package/dist/services/document-service/utils/clone-relations.d.ts.map +1 -0
- package/dist/services/document-service/utils/clone-relations.js +124 -0
- package/dist/services/document-service/utils/clone-relations.js.map +1 -0
- package/dist/services/document-service/utils/clone-relations.mjs +121 -0
- package/dist/services/document-service/utils/clone-relations.mjs.map +1 -0
- package/dist/services/entity-validator/validators.d.ts.map +1 -1
- package/dist/services/entity-validator/validators.js +6 -0
- package/dist/services/entity-validator/validators.js.map +1 -1
- package/dist/services/entity-validator/validators.mjs +6 -0
- package/dist/services/entity-validator/validators.mjs.map +1 -1
- package/dist/services/mcp/tools/log.d.ts +2 -2
- package/dist/services/mcp/tools/log.d.ts.map +1 -1
- package/dist/utils/fetch.d.ts +1 -1
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +2 -2
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/fetch.mjs +2 -2
- package/dist/utils/fetch.mjs.map +1 -1
- package/dist/utils/startup-logger.d.ts.map +1 -1
- package/dist/utils/startup-logger.js +8 -2
- package/dist/utils/startup-logger.js.map +1 -1
- package/dist/utils/startup-logger.mjs +8 -2
- package/dist/utils/startup-logger.mjs.map +1 -1
- package/dist/utils/transform-content-types-to-models.d.ts +9 -9
- package/package.json +18 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.mjs","sources":["../../../src/services/entity-validator/validators.ts"],"sourcesContent":["/**\n * Validators check if the entry data meets specific criteria before saving or publishing.\n * (e.g., length, range, format).\n *\n * Drafts have limited validations (mainly max constraints),\n * while published content undergoes full validation.\n *\n * The system also takes locales into account when validating data.\n * E.g, unique fields must be unique within the same locale.\n */\nimport _ from 'lodash';\nimport { yup } from '@strapi/utils';\nimport type { Schema, Struct, Modules } from '@strapi/types';\nimport { blocksValidator } from './blocks-validator';\n\nimport type { ComponentContext } from '.';\n\nexport interface ValidatorMetas<\n TAttribute extends Schema.Attribute.AnyAttribute = Schema.Attribute.AnyAttribute,\n TValue extends Schema.Attribute.Value<TAttribute> = Schema.Attribute.Value<TAttribute>,\n> {\n attr: TAttribute;\n model: Struct.Schema;\n updatedAttribute: {\n name: string;\n value: TValue;\n };\n data: Record<string, unknown>;\n componentContext?: ComponentContext;\n entity?: Modules.EntityValidator.Entity;\n}\n\ninterface ValidatorOptions {\n isDraft: boolean;\n locale?: string;\n}\n\n/* Validator utils */\n\nconst toNumberSafe = (value: unknown): number | undefined => {\n if (value === undefined || value === null) return undefined;\n const num = Number(value);\n return Number.isFinite(num) ? num : undefined;\n};\n\nconst BIG_INTEGER_REGEX = /^[+-]?\\d+$/;\n\nconst toBigIntegerString = (value: unknown): string | undefined => {\n if (value == null) {\n return undefined;\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (typeof value === 'number') {\n if (!Number.isFinite(value) || !Number.isInteger(value)) {\n return undefined;\n }\n\n return value.toString();\n }\n\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n if (!BIG_INTEGER_REGEX.test(trimmedValue)) {\n return undefined;\n }\n\n return BigInt(trimmedValue).toString();\n }\n\n return undefined;\n};\n\nconst isValidBigInteger = (value: unknown): boolean => toBigIntegerString(value) != null;\n\nconst isValidFiniteNumber = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value);\n\nconst isValidInteger = (value: unknown): value is number =>\n isValidFiniteNumber(value) && Number.isInteger(value);\n\nconst shouldSkipUniqueValidation = (\n attrType: Schema.Attribute.AnyAttribute['type'],\n value: unknown\n): boolean => {\n switch (attrType) {\n case 'integer':\n return !isValidInteger(value);\n case 'float':\n case 'decimal':\n return !isValidFiniteNumber(value);\n case 'biginteger':\n return !isValidBigInteger(value);\n default:\n return false;\n }\n};\n\n/**\n * Adds minLength validator\n */\nconst addMinLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return attr.minLength && _.isInteger(attr.minLength) && !isDraft\n ? validator.min(attr.minLength)\n : validator;\n};\n\n/**\n * Adds maxLength validator\n * @returns {StringSchema}\n */\nconst addMaxLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n }\n) => {\n return attr.maxLength && _.isInteger(attr.maxLength) ? validator.max(attr.maxLength) : validator;\n};\n\n/**\n * Adds min integer validator\n * @returns {NumberSchema}\n */\nconst addMinIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(_.toInteger(min)) : validator;\n};\n\n/**\n * Adds max integer validator\n */\nconst addMaxIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(_.toInteger(max)) : validator;\n};\n\n/**\n * Adds min float/decimal validator\n */\nconst addMinFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(min) : validator;\n};\n\n/**\n * Adds max float/decimal validator\n */\nconst addMaxFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(max) : validator;\n};\n\n/**\n * Adds regex validator\n */\nconst addStringRegexValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return 'regex' in attr && !_.isUndefined(attr.regex) && !isDraft\n ? validator.matches(new RegExp(attr.regex), { excludeEmptyString: !attr.required })\n : validator;\n};\n\nconst addUniqueValidator = <T extends yup.AnySchema>(\n validator: T,\n {\n attr,\n model,\n updatedAttribute,\n entity,\n componentContext,\n }: ValidatorMetas<Schema.Attribute.AnyAttribute & Schema.Attribute.UniqueOption>,\n options: ValidatorOptions\n): T => {\n if (attr.type !== 'uid' && !attr.unique) {\n return validator;\n }\n\n const validateUniqueFieldWithinComponent = async (value: any): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n // If we are validating a unique field within a repeatable component,\n // we first need to ensure that the repeatable in the current entity is\n // valid against itself.\n const hasRepeatableData = componentContext.repeatableData.length > 0;\n if (hasRepeatableData) {\n const { name: updatedName, value: updatedValue } = updatedAttribute;\n // Construct the full path to the unique field within the component.\n const pathToCheck = [...componentContext.pathToComponent.slice(1), updatedName].join('.');\n\n // Extract the values from the repeatable data using the constructed path\n const values = componentContext.repeatableData.map((item) => {\n return pathToCheck.split('.').reduce((acc, key) => acc[key], item as any);\n });\n\n // Check if the value is repeated in the current entity\n const isUpdatedAttributeRepeatedInThisEntity =\n values.filter((value) => value === updatedValue).length > 1;\n\n if (isUpdatedAttributeRepeatedInThisEntity) {\n return false;\n }\n }\n\n /**\n * When `componentContext` is present it means we are dealing with a unique\n * field within a component.\n *\n * The unique validation must consider the specific context of the\n * component, which will always be contained within a parent content type\n * and may also be nested within another component.\n *\n * We construct a query that takes into account the parent's model UID,\n * dimensions (such as draft and publish state/locale) and excludes the current\n * content type entity by its ID if provided.\n */\n const {\n model: parentModel,\n options: parentOptions,\n id: excludeId,\n } = componentContext.parentContent;\n\n const whereConditions: Record<string, any> = {};\n const isParentDraft = parentOptions && parentOptions.isDraft;\n\n whereConditions.publishedAt = isParentDraft ? null : { $notNull: true };\n\n if (parentOptions?.locale) {\n whereConditions.locale = parentOptions.locale;\n }\n\n if (excludeId && !Number.isNaN(excludeId)) {\n whereConditions.id = { $ne: excludeId };\n }\n\n const queryUid = parentModel.uid;\n const queryWhere = {\n ...componentContext.pathToComponent.reduceRight((acc, key) => ({ [key]: acc }), {\n [updatedAttribute.name]: value,\n }),\n\n ...whereConditions,\n };\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db.query(queryUid).findOne({ where: queryWhere }));\n };\n\n const validateUniqueFieldWithinDynamicZoneComponent = async (\n startOfPath: string\n ): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n const targetComponentUID = model.uid;\n // Ensure that the value is unique within the dynamic zone in this entity.\n const countOfValueInThisEntity = (componentContext?.fullDynamicZoneContent ?? []).reduce(\n (acc, component) => {\n if (component.__component !== targetComponentUID) {\n return acc;\n }\n\n const updatedValue = component[updatedAttribute.name];\n return updatedValue === updatedAttribute.value ? acc + 1 : acc;\n },\n 0\n );\n\n if (countOfValueInThisEntity > 1) {\n // If the value is repeated in the current entity, the validation fails.\n return false;\n }\n\n // Build a query for the parent content type to find all entities in the\n // same locale and publication state\n type QueryType = {\n select: string[];\n where: {\n published_at?: { $eq: null } | { $ne: null };\n id?: { $ne: number };\n locale?: string;\n };\n populate: {\n [key: string]: {\n on: {\n [key: string]: {\n select: string[];\n where: { [key: string]: string | number | boolean };\n };\n };\n };\n };\n };\n\n // Populate the dynamic zone for any components that share the same value\n // as the updated attribute.\n const query: QueryType = {\n select: ['id'],\n where: {},\n populate: {\n [startOfPath]: {\n on: {\n [targetComponentUID]: {\n select: ['id'],\n where: { [updatedAttribute.name]: updatedAttribute.value },\n },\n },\n },\n },\n };\n\n const { options, id } = componentContext.parentContent;\n\n if (options?.isDraft !== undefined) {\n query.where.published_at = options.isDraft ? { $eq: null } : { $ne: null };\n }\n\n if (id) {\n query.where.id = { $ne: id };\n }\n\n if (options?.locale) {\n query.where.locale = options.locale;\n }\n\n const parentModelQueryResult = await strapi.db\n .query(componentContext.parentContent.model.uid)\n .findMany(query);\n\n // Filter the results to only include results that have components in the\n // dynamic zone that match the target component type.\n const filteredResults = parentModelQueryResult\n .filter((result) => Array.isArray(result[startOfPath]) && result[startOfPath].length)\n .flatMap((result) => result[startOfPath])\n .filter((dynamicZoneComponent) => dynamicZoneComponent.__component === targetComponentUID);\n\n if (filteredResults.length >= 1) {\n return false;\n }\n\n return true;\n };\n\n return validator.test('unique', 'This attribute must be unique', async (value) => {\n /**\n * If the attribute value is `null` or an empty string we want to skip the unique validation.\n * Otherwise it'll only accept a single entry with that value in the database.\n */\n if (_.isNil(value) || value === '') {\n return true;\n }\n\n // Skip unique checks for invalid scalar numeric values and let the type validator fail.\n // This prevents malformed values from reaching the DB query layer when abortEarly=false.\n if (shouldSkipUniqueValidation(attr.type, value)) {\n return true;\n }\n\n /**\n * We don't validate any unique constraint for draft entries.\n */\n if (options.isDraft) {\n return true;\n }\n\n const hasPathToComponent = componentContext && componentContext.pathToComponent.length > 0;\n if (hasPathToComponent) {\n // Detect if we are validating within a dynamiczone by checking if the first\n // path is a dynamiczone attribute in the parent content type.\n const startOfPath = componentContext.pathToComponent[0];\n const testingDZ =\n componentContext.parentContent.model.attributes[startOfPath].type === 'dynamiczone';\n\n if (testingDZ) {\n return validateUniqueFieldWithinDynamicZoneComponent(startOfPath);\n }\n\n return validateUniqueFieldWithinComponent(value);\n }\n\n /**\n * Here we are validating a scalar unique field from the content type's schema.\n * We construct a query to check if the value is unique\n * considering dimensions (e.g. locale, publication state) and excluding the current entity by its ID if available.\n */\n const scalarAttributeWhere: Record<string, any> = {\n [updatedAttribute.name]: value,\n publishedAt: { $notNull: true },\n };\n\n if (options?.locale) {\n scalarAttributeWhere.locale = options.locale;\n }\n\n if (entity?.id) {\n scalarAttributeWhere.id = { $ne: entity.id };\n }\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db\n .query(model.uid)\n .findOne({ where: scalarAttributeWhere, select: ['id'] }));\n });\n};\n\n/* Type validators */\n\nconst stringValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID\n >,\n options: ValidatorOptions\n) => {\n let schema = yup.string().transform((val, originalVal) => originalVal);\n\n schema = addMinLengthValidator(schema, metas, options);\n schema = addMaxLengthValidator(schema, metas);\n schema = addStringRegexValidator(schema, metas, options);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const emailValidator = (\n metas: ValidatorMetas<Schema.Attribute.Email>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n return schema.email().min(\n 1,\n // eslint-disable-next-line no-template-curly-in-string\n '${path} cannot be empty'\n );\n};\n\nexport const uidValidator = (\n metas: ValidatorMetas<Schema.Attribute.UID>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n if (metas.attr.regex) {\n return schema.matches(new RegExp(metas.attr.regex));\n }\n\n return schema.matches(/^[A-Za-z0-9-_.~]*$/);\n};\n\nexport const enumerationValidator = ({ attr }: { attr: Schema.Attribute.Enumeration }) => {\n return yup\n .string()\n .oneOf((Array.isArray(attr.enum) ? attr.enum : [attr.enum]).concat(null as any));\n};\n\nexport const integerValidator = (\n metas: ValidatorMetas<Schema.Attribute.Integer | Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n let schema = yup.number().integer();\n\n schema = addMinIntegerValidator(schema, metas, options);\n schema = addMaxIntegerValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const floatValidator = (\n metas: ValidatorMetas<Schema.Attribute.Decimal | Schema.Attribute.Float>,\n options: ValidatorOptions\n) => {\n let schema = yup.number().test(\n 'is-finite-number',\n // eslint-disable-next-line no-template-curly-in-string -- Yup interpolates validation path placeholders.\n '${path} must be a finite number',\n (value) => value == null || isValidFiniteNumber(value)\n );\n\n schema = addMinFloatValidator(schema, metas, options);\n schema = addMaxFloatValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const bigintegerValidator = (\n metas: ValidatorMetas<Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n const schema = yup\n .mixed()\n .transform((value, originalValue) => toBigIntegerString(originalValue) ?? value)\n // eslint-disable-next-line no-template-curly-in-string -- Yup interpolates validation path placeholders.\n .test('is-biginteger', '${path} must be a valid integer', (value) => {\n if (value == null) {\n return true;\n }\n\n return isValidBigInteger(value);\n });\n\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const datesValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.Date\n | Schema.Attribute.DateTime\n | Schema.Attribute.Time\n | Schema.Attribute.Timestamp\n >,\n options: ValidatorOptions\n) => {\n const schema = yup.mixed();\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const Validators = {\n string: stringValidator,\n text: stringValidator,\n richtext: stringValidator,\n password: stringValidator,\n email: emailValidator,\n enumeration: enumerationValidator,\n boolean: () => yup.boolean().nullable(),\n uid: uidValidator,\n json: () => yup.mixed(),\n integer: integerValidator,\n biginteger: bigintegerValidator,\n float: floatValidator,\n decimal: floatValidator,\n date: datesValidator,\n time: datesValidator,\n datetime: datesValidator,\n timestamp: datesValidator,\n blocks: blocksValidator,\n};\n"],"names":["toNumberSafe","value","undefined","num","Number","isFinite","BIG_INTEGER_REGEX","toBigIntegerString","toString","isInteger","trimmedValue","trim","test","BigInt","isValidBigInteger","isValidFiniteNumber","isValidInteger","shouldSkipUniqueValidation","attrType","addMinLengthValidator","validator","attr","isDraft","minLength","_","min","addMaxLengthValidator","maxLength","max","addMinIntegerValidator","toInteger","addMaxIntegerValidator","addMinFloatValidator","addMaxFloatValidator","addStringRegexValidator","isUndefined","regex","matches","RegExp","excludeEmptyString","required","addUniqueValidator","model","updatedAttribute","entity","componentContext","options","type","unique","validateUniqueFieldWithinComponent","hasRepeatableData","repeatableData","length","name","updatedName","updatedValue","pathToCheck","pathToComponent","slice","join","values","map","item","split","reduce","acc","key","isUpdatedAttributeRepeatedInThisEntity","filter","parentModel","parentOptions","id","excludeId","parentContent","whereConditions","isParentDraft","publishedAt","$notNull","locale","isNaN","$ne","queryUid","uid","queryWhere","reduceRight","strapi","db","query","findOne","where","validateUniqueFieldWithinDynamicZoneComponent","startOfPath","targetComponentUID","countOfValueInThisEntity","fullDynamicZoneContent","component","__component","select","populate","on","published_at","$eq","parentModelQueryResult","findMany","filteredResults","result","Array","isArray","flatMap","dynamicZoneComponent","isNil","hasPathToComponent","testingDZ","attributes","scalarAttributeWhere","stringValidator","metas","schema","yup","string","transform","val","originalVal","emailValidator","email","uidValidator","enumerationValidator","oneOf","enum","concat","integerValidator","number","integer","floatValidator","bigintegerValidator","mixed","originalValue","datesValidator","Validators","text","richtext","password","enumeration","boolean","nullable","json","biginteger","float","decimal","date","time","datetime","timestamp","blocks","blocksValidator"],"mappings":";;;;AAqCA,sBAEA,MAAMA,YAAAA,GAAe,CAACC,KAAAA,GAAAA;AACpB,IAAA,IAAIA,KAAAA,KAAUC,SAAAA,IAAaD,KAAAA,KAAU,IAAA,EAAM,OAAOC,SAAAA;AAClD,IAAA,MAAMC,MAAMC,MAAAA,CAAOH,KAAAA,CAAAA;AACnB,IAAA,OAAOG,MAAAA,CAAOC,QAAQ,CAACF,GAAAA,CAAA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,QAAAA,EAAUd,cAAAA;IACVe,SAAAA,EAAWf,cAAAA;IACXgB,MAAAA,EAAQC;AACV;;;;"}
|
|
1
|
+
{"version":3,"file":"validators.mjs","sources":["../../../src/services/entity-validator/validators.ts"],"sourcesContent":["/**\n * Validators check if the entry data meets specific criteria before saving or publishing.\n * (e.g., length, range, format).\n *\n * Drafts have limited validations (mainly max constraints),\n * while published content undergoes full validation.\n *\n * The system also takes locales into account when validating data.\n * E.g, unique fields must be unique within the same locale.\n */\nimport _ from 'lodash';\nimport { yup } from '@strapi/utils';\nimport type { Schema, Struct, Modules } from '@strapi/types';\nimport { blocksValidator } from './blocks-validator';\n\nimport type { ComponentContext } from '.';\n\nexport interface ValidatorMetas<\n TAttribute extends Schema.Attribute.AnyAttribute = Schema.Attribute.AnyAttribute,\n TValue extends Schema.Attribute.Value<TAttribute> = Schema.Attribute.Value<TAttribute>,\n> {\n attr: TAttribute;\n model: Struct.Schema;\n updatedAttribute: {\n name: string;\n value: TValue;\n };\n data: Record<string, unknown>;\n componentContext?: ComponentContext;\n entity?: Modules.EntityValidator.Entity;\n}\n\ninterface ValidatorOptions {\n isDraft: boolean;\n locale?: string;\n}\n\n/* Validator utils */\n\nconst toNumberSafe = (value: unknown): number | undefined => {\n if (value === undefined || value === null) return undefined;\n const num = Number(value);\n return Number.isFinite(num) ? num : undefined;\n};\n\nconst BIG_INTEGER_REGEX = /^[+-]?\\d+$/;\n\nconst toBigIntegerString = (value: unknown): string | undefined => {\n if (value == null) {\n return undefined;\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (typeof value === 'number') {\n if (!Number.isFinite(value) || !Number.isInteger(value)) {\n return undefined;\n }\n\n return value.toString();\n }\n\n if (typeof value === 'string') {\n const trimmedValue = value.trim();\n\n if (!BIG_INTEGER_REGEX.test(trimmedValue)) {\n return undefined;\n }\n\n return BigInt(trimmedValue).toString();\n }\n\n return undefined;\n};\n\nconst isValidBigInteger = (value: unknown): boolean => toBigIntegerString(value) != null;\n\nconst isValidFiniteNumber = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value);\n\nconst isValidInteger = (value: unknown): value is number =>\n isValidFiniteNumber(value) && Number.isInteger(value);\n\nconst shouldSkipUniqueValidation = (\n attrType: Schema.Attribute.AnyAttribute['type'],\n value: unknown\n): boolean => {\n switch (attrType) {\n case 'integer':\n return !isValidInteger(value);\n case 'float':\n case 'decimal':\n return !isValidFiniteNumber(value);\n case 'biginteger':\n return !isValidBigInteger(value);\n default:\n return false;\n }\n};\n\n/**\n * Adds minLength validator\n */\nconst addMinLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return attr.minLength && _.isInteger(attr.minLength) && !isDraft\n ? validator.min(attr.minLength)\n : validator;\n};\n\n/**\n * Adds maxLength validator\n * @returns {StringSchema}\n */\nconst addMaxLengthValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n }\n) => {\n // apply default max length for short text (string)\n if (attr.type === 'string') {\n const max: number = _.isInteger(attr.maxLength) ? attr.maxLength! : 255;\n return validator.max(max);\n }\n\n // keep existing behavior for other types\n return attr.maxLength && _.isInteger(attr.maxLength) ? validator.max(attr.maxLength) : validator;\n};\n\n/**\n * Adds min integer validator\n * @returns {NumberSchema}\n */\nconst addMinIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(_.toInteger(min)) : validator;\n};\n\n/**\n * Adds max integer validator\n */\nconst addMaxIntegerValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Integer | Schema.Attribute.BigInteger;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(_.toInteger(max)) : validator;\n};\n\n/**\n * Adds min float/decimal validator\n */\nconst addMinFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n },\n { isDraft }: ValidatorOptions\n) => {\n const min = toNumberSafe(attr.min);\n return min !== undefined && !isDraft ? validator.min(min) : validator;\n};\n\n/**\n * Adds max float/decimal validator\n */\nconst addMaxFloatValidator = (\n validator: yup.NumberSchema,\n {\n attr,\n }: {\n attr: Schema.Attribute.Decimal | Schema.Attribute.Float;\n }\n) => {\n const max = toNumberSafe(attr.max);\n return max !== undefined ? validator.max(max) : validator;\n};\n\n/**\n * Adds regex validator\n */\nconst addStringRegexValidator = (\n validator: yup.StringSchema,\n {\n attr,\n }: {\n attr:\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID;\n },\n { isDraft }: ValidatorOptions\n) => {\n return 'regex' in attr && !_.isUndefined(attr.regex) && !isDraft\n ? validator.matches(new RegExp(attr.regex), { excludeEmptyString: !attr.required })\n : validator;\n};\n\nconst addUniqueValidator = <T extends yup.AnySchema>(\n validator: T,\n {\n attr,\n model,\n updatedAttribute,\n entity,\n componentContext,\n }: ValidatorMetas<Schema.Attribute.AnyAttribute & Schema.Attribute.UniqueOption>,\n options: ValidatorOptions\n): T => {\n if (attr.type !== 'uid' && !attr.unique) {\n return validator;\n }\n\n const validateUniqueFieldWithinComponent = async (value: any): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n // If we are validating a unique field within a repeatable component,\n // we first need to ensure that the repeatable in the current entity is\n // valid against itself.\n const hasRepeatableData = componentContext.repeatableData.length > 0;\n if (hasRepeatableData) {\n const { name: updatedName, value: updatedValue } = updatedAttribute;\n // Construct the full path to the unique field within the component.\n const pathToCheck = [...componentContext.pathToComponent.slice(1), updatedName].join('.');\n\n // Extract the values from the repeatable data using the constructed path\n const values = componentContext.repeatableData.map((item) => {\n return pathToCheck.split('.').reduce((acc, key) => acc[key], item as any);\n });\n\n // Check if the value is repeated in the current entity\n const isUpdatedAttributeRepeatedInThisEntity =\n values.filter((value) => value === updatedValue).length > 1;\n\n if (isUpdatedAttributeRepeatedInThisEntity) {\n return false;\n }\n }\n\n /**\n * When `componentContext` is present it means we are dealing with a unique\n * field within a component.\n *\n * The unique validation must consider the specific context of the\n * component, which will always be contained within a parent content type\n * and may also be nested within another component.\n *\n * We construct a query that takes into account the parent's model UID,\n * dimensions (such as draft and publish state/locale) and excludes the current\n * content type entity by its ID if provided.\n */\n const {\n model: parentModel,\n options: parentOptions,\n id: excludeId,\n } = componentContext.parentContent;\n\n const whereConditions: Record<string, any> = {};\n const isParentDraft = parentOptions && parentOptions.isDraft;\n\n whereConditions.publishedAt = isParentDraft ? null : { $notNull: true };\n\n if (parentOptions?.locale) {\n whereConditions.locale = parentOptions.locale;\n }\n\n if (excludeId && !Number.isNaN(excludeId)) {\n whereConditions.id = { $ne: excludeId };\n }\n\n const queryUid = parentModel.uid;\n const queryWhere = {\n ...componentContext.pathToComponent.reduceRight((acc, key) => ({ [key]: acc }), {\n [updatedAttribute.name]: value,\n }),\n\n ...whereConditions,\n };\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db.query(queryUid).findOne({ where: queryWhere }));\n };\n\n const validateUniqueFieldWithinDynamicZoneComponent = async (\n startOfPath: string\n ): Promise<boolean> => {\n if (!componentContext) {\n return false;\n }\n\n const targetComponentUID = model.uid;\n // Ensure that the value is unique within the dynamic zone in this entity.\n const countOfValueInThisEntity = (componentContext?.fullDynamicZoneContent ?? []).reduce(\n (acc, component) => {\n if (component.__component !== targetComponentUID) {\n return acc;\n }\n\n const updatedValue = component[updatedAttribute.name];\n return updatedValue === updatedAttribute.value ? acc + 1 : acc;\n },\n 0\n );\n\n if (countOfValueInThisEntity > 1) {\n // If the value is repeated in the current entity, the validation fails.\n return false;\n }\n\n // Build a query for the parent content type to find all entities in the\n // same locale and publication state\n type QueryType = {\n select: string[];\n where: {\n published_at?: { $eq: null } | { $ne: null };\n id?: { $ne: number };\n locale?: string;\n };\n populate: {\n [key: string]: {\n on: {\n [key: string]: {\n select: string[];\n where: { [key: string]: string | number | boolean };\n };\n };\n };\n };\n };\n\n // Populate the dynamic zone for any components that share the same value\n // as the updated attribute.\n const query: QueryType = {\n select: ['id'],\n where: {},\n populate: {\n [startOfPath]: {\n on: {\n [targetComponentUID]: {\n select: ['id'],\n where: { [updatedAttribute.name]: updatedAttribute.value },\n },\n },\n },\n },\n };\n\n const { options, id } = componentContext.parentContent;\n\n if (options?.isDraft !== undefined) {\n query.where.published_at = options.isDraft ? { $eq: null } : { $ne: null };\n }\n\n if (id) {\n query.where.id = { $ne: id };\n }\n\n if (options?.locale) {\n query.where.locale = options.locale;\n }\n\n const parentModelQueryResult = await strapi.db\n .query(componentContext.parentContent.model.uid)\n .findMany(query);\n\n // Filter the results to only include results that have components in the\n // dynamic zone that match the target component type.\n const filteredResults = parentModelQueryResult\n .filter((result) => Array.isArray(result[startOfPath]) && result[startOfPath].length)\n .flatMap((result) => result[startOfPath])\n .filter((dynamicZoneComponent) => dynamicZoneComponent.__component === targetComponentUID);\n\n if (filteredResults.length >= 1) {\n return false;\n }\n\n return true;\n };\n\n return validator.test('unique', 'This attribute must be unique', async (value) => {\n /**\n * If the attribute value is `null` or an empty string we want to skip the unique validation.\n * Otherwise it'll only accept a single entry with that value in the database.\n */\n if (_.isNil(value) || value === '') {\n return true;\n }\n\n // Skip unique checks for invalid scalar numeric values and let the type validator fail.\n // This prevents malformed values from reaching the DB query layer when abortEarly=false.\n if (shouldSkipUniqueValidation(attr.type, value)) {\n return true;\n }\n\n /**\n * We don't validate any unique constraint for draft entries.\n */\n if (options.isDraft) {\n return true;\n }\n\n const hasPathToComponent = componentContext && componentContext.pathToComponent.length > 0;\n if (hasPathToComponent) {\n // Detect if we are validating within a dynamiczone by checking if the first\n // path is a dynamiczone attribute in the parent content type.\n const startOfPath = componentContext.pathToComponent[0];\n const testingDZ =\n componentContext.parentContent.model.attributes[startOfPath].type === 'dynamiczone';\n\n if (testingDZ) {\n return validateUniqueFieldWithinDynamicZoneComponent(startOfPath);\n }\n\n return validateUniqueFieldWithinComponent(value);\n }\n\n /**\n * Here we are validating a scalar unique field from the content type's schema.\n * We construct a query to check if the value is unique\n * considering dimensions (e.g. locale, publication state) and excluding the current entity by its ID if available.\n */\n const scalarAttributeWhere: Record<string, any> = {\n [updatedAttribute.name]: value,\n publishedAt: { $notNull: true },\n };\n\n if (options?.locale) {\n scalarAttributeWhere.locale = options.locale;\n }\n\n if (entity?.id) {\n scalarAttributeWhere.id = { $ne: entity.id };\n }\n\n // The validation should pass if there is no other record found from the query\n return !(await strapi.db\n .query(model.uid)\n .findOne({ where: scalarAttributeWhere, select: ['id'] }));\n });\n};\n\n/* Type validators */\n\nconst stringValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.String\n | Schema.Attribute.Text\n | Schema.Attribute.RichText\n | Schema.Attribute.Password\n | Schema.Attribute.Email\n | Schema.Attribute.UID\n >,\n options: ValidatorOptions\n) => {\n let schema = yup.string().transform((val, originalVal) => originalVal);\n\n schema = addMinLengthValidator(schema, metas, options);\n schema = addMaxLengthValidator(schema, metas);\n schema = addStringRegexValidator(schema, metas, options);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const emailValidator = (\n metas: ValidatorMetas<Schema.Attribute.Email>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n return schema.email().min(\n 1,\n // eslint-disable-next-line no-template-curly-in-string\n '${path} cannot be empty'\n );\n};\n\nexport const uidValidator = (\n metas: ValidatorMetas<Schema.Attribute.UID>,\n options: ValidatorOptions\n) => {\n const schema = stringValidator(metas, options);\n\n if (options.isDraft) {\n return schema;\n }\n\n if (metas.attr.regex) {\n return schema.matches(new RegExp(metas.attr.regex));\n }\n\n return schema.matches(/^[A-Za-z0-9-_.~]*$/);\n};\n\nexport const enumerationValidator = ({ attr }: { attr: Schema.Attribute.Enumeration }) => {\n return yup\n .string()\n .oneOf((Array.isArray(attr.enum) ? attr.enum : [attr.enum]).concat(null as any));\n};\n\nexport const integerValidator = (\n metas: ValidatorMetas<Schema.Attribute.Integer | Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n let schema = yup.number().integer();\n\n schema = addMinIntegerValidator(schema, metas, options);\n schema = addMaxIntegerValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const floatValidator = (\n metas: ValidatorMetas<Schema.Attribute.Decimal | Schema.Attribute.Float>,\n options: ValidatorOptions\n) => {\n let schema = yup.number().test(\n 'is-finite-number',\n // eslint-disable-next-line no-template-curly-in-string -- Yup interpolates validation path placeholders.\n '${path} must be a finite number',\n (value) => value == null || isValidFiniteNumber(value)\n );\n\n schema = addMinFloatValidator(schema, metas, options);\n schema = addMaxFloatValidator(schema, metas);\n schema = addUniqueValidator(schema, metas, options);\n\n return schema;\n};\n\nexport const bigintegerValidator = (\n metas: ValidatorMetas<Schema.Attribute.BigInteger>,\n options: ValidatorOptions\n) => {\n const schema = yup\n .mixed()\n .transform((value, originalValue) => toBigIntegerString(originalValue) ?? value)\n // eslint-disable-next-line no-template-curly-in-string -- Yup interpolates validation path placeholders.\n .test('is-biginteger', '${path} must be a valid integer', (value) => {\n if (value == null) {\n return true;\n }\n\n return isValidBigInteger(value);\n });\n\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const datesValidator = (\n metas: ValidatorMetas<\n | Schema.Attribute.Date\n | Schema.Attribute.DateTime\n | Schema.Attribute.Time\n | Schema.Attribute.Timestamp\n >,\n options: ValidatorOptions\n) => {\n const schema = yup.mixed();\n return addUniqueValidator(schema, metas, options);\n};\n\nexport const Validators = {\n string: stringValidator,\n text: stringValidator,\n richtext: stringValidator,\n password: stringValidator,\n email: emailValidator,\n enumeration: enumerationValidator,\n boolean: () => yup.boolean().nullable(),\n uid: uidValidator,\n json: () => yup.mixed(),\n integer: integerValidator,\n biginteger: bigintegerValidator,\n float: floatValidator,\n decimal: floatValidator,\n date: datesValidator,\n time: datesValidator,\n datetime: datesValidator,\n timestamp: datesValidator,\n blocks: blocksValidator,\n};\n"],"names":["toNumberSafe","value","undefined","num","Number","isFinite","BIG_INTEGER_REGEX","toBigIntegerString","toString","isInteger","trimmedValue","trim","test","BigInt","isValidBigInteger","isValidFiniteNumber","isValidInteger","shouldSkipUniqueValidation","attrType","addMinLengthValidator","validator","attr","isDraft","minLength","_","min","addMaxLengthValidator","type","max","maxLength","addMinIntegerValidator","toInteger","addMaxIntegerValidator","addMinFloatValidator","addMaxFloatValidator","addStringRegexValidator","isUndefined","regex","matches","RegExp","excludeEmptyString","required","addUniqueValidator","model","updatedAttribute","entity","componentContext","options","unique","validateUniqueFieldWithinComponent","hasRepeatableData","repeatableData","length","name","updatedName","updatedValue","pathToCheck","pathToComponent","slice","join","values","map","item","split","reduce","acc","key","isUpdatedAttributeRepeatedInThisEntity","filter","parentModel","parentOptions","id","excludeId","parentContent","whereConditions","isParentDraft","publishedAt","$notNull","locale","isNaN","$ne","queryUid","uid","queryWhere","reduceRight","strapi","db","query","findOne","where","validateUniqueFieldWithinDynamicZoneComponent","startOfPath","targetComponentUID","countOfValueInThisEntity","fullDynamicZoneContent","component","__component","select","populate","on","published_at","$eq","parentModelQueryResult","findMany","filteredResults","result","Array","isArray","flatMap","dynamicZoneComponent","isNil","hasPathToComponent","testingDZ","attributes","scalarAttributeWhere","stringValidator","metas","schema","yup","string","transform","val","originalVal","emailValidator","email","uidValidator","enumerationValidator","oneOf","enum","concat","integerValidator","number","integer","floatValidator","bigintegerValidator","mixed","originalValue","datesValidator","Validators","text","richtext","password","enumeration","boolean","nullable","json","biginteger","float","decimal","date","time","datetime","timestamp","blocks","blocksValidator"],"mappings":";;;;AAqCA,sBAEA,MAAMA,YAAAA,GAAe,CAACC,KAAAA,GAAAA;AACpB,IAAA,IAAIA,KAAAA,KAAUC,SAAAA,IAAaD,KAAAA,KAAU,IAAA,EAAM,OAAOC,SAAAA;AAClD,IAAA,MAAMC,MAAMC,MAAAA,CAAOH,KAAAA,CAAAA;AACnB,IAAA,OAAOG,MAAAA,CAAOC,QAAQ,CAACF,GAAAA,CAAAA,GAAOA,GAAAA,GAAMD,SAAAA;AACtC,CAAA;AAEA,MAAMI,iBAAAA,GAAoB,YAAA;AAE1B,MAAMC,qBAAqB,CAACN,KAAAA,GAAAA;AAC1B,IAAA,IAAIA,SAAS,IAAA,EAAM;QACjB,OAAOC,SAAAA;AACT,IAAA;IAEA,IAAI,OAAOD,UAAU,QAAA,EAAU;AAC7B,QAAA,OAAOA,MAAMO,QAAQ,EAAA;AACvB,IAAA;IAEA,IAAI,OAAOP,UAAU,QAAA,EAAU;QAC7B,IAAI,CAACG,OAAOC,QAAQ,CAACJ,UAAU,CAACG,MAAAA,CAAOK,SAAS,CAACR,KAAAA,CAAAA,EAAQ;YACvD,OAAOC,SAAAA;AACT,QAAA;AAEA,QAAA,OAAOD,MAAMO,QAAQ,EAAA;AACvB,IAAA;IAEA,IAAI,OAAOP,UAAU,QAAA,EAAU;QAC7B,MAAMS,YAAAA,GAAeT,MAAMU,IAAI,EAAA;AAE/B,QAAA,IAAI,CAACL,iBAAAA,CAAkBM,IAAI,CAACF,YAAAA,CAAAA,EAAe;YACzC,OAAOR,SAAAA;AACT,QAAA;QAEA,OAAOW,MAAAA,CAAOH,cAAcF,QAAQ,EAAA;AACtC,IAAA;IAEA,OAAON,SAAAA;AACT,CAAA;AAEA,MAAMY,iBAAAA,GAAoB,CAACb,KAAAA,GAA4BM,kBAAAA,CAAmBN,KAAAA,CAAAA,IAAU,IAAA;AAEpF,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AAAA,EAAOrE,OAAAA,CAAAA;AAC3C;MAEa2F,UAAAA,GAAa;IACxBnB,MAAAA,EAAQJ,eAAAA;IACRwB,IAAAA,EAAMxB,eAAAA;IACNyB,QAAAA,EAAUzB,eAAAA;IACV0B,QAAAA,EAAU1B,eAAAA;IACVS,KAAAA,EAAOD,cAAAA;IACPmB,WAAAA,EAAahB,oBAAAA;AACbiB,IAAAA,OAAAA,EAAS,IAAMzB,GAAAA,CAAIyB,OAAO,EAAA,CAAGC,QAAQ,EAAA;IACrC9D,GAAAA,EAAK2C,YAAAA;IACLoB,IAAAA,EAAM,IAAM3B,IAAIiB,KAAK,EAAA;IACrBH,OAAAA,EAASF,gBAAAA;IACTgB,UAAAA,EAAYZ,mBAAAA;IACZa,KAAAA,EAAOd,cAAAA;IACPe,OAAAA,EAASf,cAAAA;IACTgB,IAAAA,EAAMZ,cAAAA;IACNa,IAAAA,EAAMb,cAAAA;IACNc,QAAAA,EAAUd,cAAAA;IACVe,SAAAA,EAAWf,cAAAA;IACXgB,MAAAA,EAAQC;AACV;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from '@strapi/utils';
|
|
2
|
-
export declare const logToolDefinition: import("@strapi/types/dist/modules/mcp").McpToolDefinitionFields<"log", z.ZodObject<{
|
|
2
|
+
export declare const logToolDefinition: import("@strapi/types/dist/modules/mcp.js").McpToolDefinitionFields<"log", z.ZodObject<{
|
|
3
3
|
message: z.ZodString;
|
|
4
4
|
level: z.ZodDefault<z.ZodEnum<{
|
|
5
5
|
http: "http";
|
|
@@ -13,5 +13,5 @@ export declare const logToolDefinition: import("@strapi/types/dist/modules/mcp")
|
|
|
13
13
|
message: z.ZodString;
|
|
14
14
|
level: z.ZodString;
|
|
15
15
|
timestamp: z.ZodString;
|
|
16
|
-
}, z.core.$strip>, "Strapi Log", "Logs a message to the Strapi logger with specified level"> & import("@strapi/types/dist/modules/mcp").McpDevModeAccess;
|
|
16
|
+
}, z.core.$strip>, "Strapi Log", "Logs a message to the Strapi logger with specified level"> & import("@strapi/types/dist/modules/mcp.js").McpDevModeAccess;
|
|
17
17
|
//# sourceMappingURL=log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/tools/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAmBlC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../src/services/mcp/tools/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAmBlC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;2JAwE5B,CAAC"}
|
package/dist/utils/fetch.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Core, Modules } from '@strapi/types';
|
|
|
2
2
|
interface StrapiFetchOptions {
|
|
3
3
|
logs?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare const createStrapiFetch: (strapi: Core.Strapi, options?: StrapiFetchOptions) =>
|
|
5
|
+
export declare const createStrapiFetch: (strapi: Core.Strapi, options?: StrapiFetchOptions) => Fetch;
|
|
6
6
|
export type Fetch = Modules.Fetch.Fetch;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKnD,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAGD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKnD,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAGD,eAAO,MAAM,iBAAiB,GAAI,QAAQ,IAAI,CAAC,MAAM,EAAE,UAAU,kBAAkB,KAAG,KA4BrF,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC"}
|
package/dist/utils/fetch.js
CHANGED
|
@@ -5,7 +5,7 @@ var undici = require('undici');
|
|
|
5
5
|
// Create a wrapper for Node's Fetch API that applies a global proxy
|
|
6
6
|
const createStrapiFetch = (strapi, options)=>{
|
|
7
7
|
const { logs = true } = options ?? {};
|
|
8
|
-
|
|
8
|
+
const strapiFetch = (url, options)=>{
|
|
9
9
|
const fetchOptions = {
|
|
10
10
|
...strapiFetch.dispatcher ? {
|
|
11
11
|
dispatcher: strapiFetch.dispatcher
|
|
@@ -16,7 +16,7 @@ const createStrapiFetch = (strapi, options)=>{
|
|
|
16
16
|
strapi.log.debug(`Making request for ${url}`);
|
|
17
17
|
}
|
|
18
18
|
return fetch(url, fetchOptions);
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
const proxy = strapi.config.get('server.proxy.fetch') || strapi.config.get('server.proxy.global');
|
|
21
21
|
if (proxy) {
|
|
22
22
|
if (logs) {
|
package/dist/utils/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\ninterface StrapiFetchOptions {\n logs?: boolean;\n}\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (
|
|
1
|
+
{"version":3,"file":"fetch.js","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\ninterface StrapiFetchOptions {\n logs?: boolean;\n}\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (strapi: Core.Strapi, options?: StrapiFetchOptions): Fetch => {\n const { logs = true } = options ?? {};\n\n const strapiFetch: Fetch = (url, options) => {\n const fetchOptions: RequestInit = {\n ...(strapiFetch.dispatcher ? { dispatcher: strapiFetch.dispatcher } : {}),\n ...options,\n };\n\n if (logs) {\n strapi.log.debug(`Making request for ${url}`);\n }\n\n return fetch(url, fetchOptions);\n };\n\n const proxy =\n strapi.config.get<ConstructorParameters<typeof ProxyAgent>[0]>('server.proxy.fetch') ||\n strapi.config.get<string>('server.proxy.global');\n\n if (proxy) {\n if (logs) {\n strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);\n }\n strapiFetch.dispatcher = new ProxyAgent(proxy);\n }\n\n return strapiFetch;\n};\n\nexport type Fetch = Modules.Fetch.Fetch;\n"],"names":["createStrapiFetch","strapi","options","logs","strapiFetch","url","fetchOptions","dispatcher","log","debug","fetch","proxy","config","get","info","ProxyAgent"],"mappings":";;;;AASA;AACO,MAAMA,iBAAAA,GAAoB,CAACC,MAAAA,EAAqBC,OAAAA,GAAAA;AACrD,IAAA,MAAM,EAAEC,IAAAA,GAAO,IAAI,EAAE,GAAGD,WAAW,EAAC;IAEpC,MAAME,WAAAA,GAAqB,CAACC,GAAAA,EAAKH,OAAAA,GAAAA;AAC/B,QAAA,MAAMI,YAAAA,GAA4B;YAChC,GAAIF,WAAAA,CAAYG,UAAU,GAAG;AAAEA,gBAAAA,UAAAA,EAAYH,YAAYG;AAAW,aAAA,GAAI,EAAE;AACxE,YAAA,GAAGL;AACL,SAAA;AAEA,QAAA,IAAIC,IAAAA,EAAM;AACRF,YAAAA,MAAAA,CAAOO,GAAG,CAACC,KAAK,CAAC,CAAC,mBAAmB,EAAEJ,GAAAA,CAAAA,CAAK,CAAA;AAC9C,QAAA;AAEA,QAAA,OAAOK,MAAML,GAAAA,EAAKC,YAAAA,CAAAA;AACpB,IAAA,CAAA;IAEA,MAAMK,KAAAA,GACJV,MAAAA,CAAOW,MAAM,CAACC,GAAG,CAA8C,oBAAA,CAAA,IAC/DZ,MAAAA,CAAOW,MAAM,CAACC,GAAG,CAAS,qBAAA,CAAA;AAE5B,IAAA,IAAIF,KAAAA,EAAO;AACT,QAAA,IAAIR,IAAAA,EAAM;AACRF,YAAAA,MAAAA,CAAOO,GAAG,CAACM,IAAI,CAAC,CAAC,gCAAgC,EAAEH,KAAAA,CAAAA,CAAO,CAAA;AAC5D,QAAA;QACAP,WAAAA,CAAYG,UAAU,GAAG,IAAIQ,iBAAAA,CAAWJ,KAAAA,CAAAA;AAC1C,IAAA;IAEA,OAAOP,WAAAA;AACT;;;;"}
|
package/dist/utils/fetch.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { ProxyAgent } from 'undici';
|
|
|
3
3
|
// Create a wrapper for Node's Fetch API that applies a global proxy
|
|
4
4
|
const createStrapiFetch = (strapi, options)=>{
|
|
5
5
|
const { logs = true } = options ?? {};
|
|
6
|
-
|
|
6
|
+
const strapiFetch = (url, options)=>{
|
|
7
7
|
const fetchOptions = {
|
|
8
8
|
...strapiFetch.dispatcher ? {
|
|
9
9
|
dispatcher: strapiFetch.dispatcher
|
|
@@ -14,7 +14,7 @@ const createStrapiFetch = (strapi, options)=>{
|
|
|
14
14
|
strapi.log.debug(`Making request for ${url}`);
|
|
15
15
|
}
|
|
16
16
|
return fetch(url, fetchOptions);
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
const proxy = strapi.config.get('server.proxy.fetch') || strapi.config.get('server.proxy.global');
|
|
19
19
|
if (proxy) {
|
|
20
20
|
if (logs) {
|
package/dist/utils/fetch.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.mjs","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\ninterface StrapiFetchOptions {\n logs?: boolean;\n}\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (
|
|
1
|
+
{"version":3,"file":"fetch.mjs","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\ninterface StrapiFetchOptions {\n logs?: boolean;\n}\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (strapi: Core.Strapi, options?: StrapiFetchOptions): Fetch => {\n const { logs = true } = options ?? {};\n\n const strapiFetch: Fetch = (url, options) => {\n const fetchOptions: RequestInit = {\n ...(strapiFetch.dispatcher ? { dispatcher: strapiFetch.dispatcher } : {}),\n ...options,\n };\n\n if (logs) {\n strapi.log.debug(`Making request for ${url}`);\n }\n\n return fetch(url, fetchOptions);\n };\n\n const proxy =\n strapi.config.get<ConstructorParameters<typeof ProxyAgent>[0]>('server.proxy.fetch') ||\n strapi.config.get<string>('server.proxy.global');\n\n if (proxy) {\n if (logs) {\n strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);\n }\n strapiFetch.dispatcher = new ProxyAgent(proxy);\n }\n\n return strapiFetch;\n};\n\nexport type Fetch = Modules.Fetch.Fetch;\n"],"names":["createStrapiFetch","strapi","options","logs","strapiFetch","url","fetchOptions","dispatcher","log","debug","fetch","proxy","config","get","info","ProxyAgent"],"mappings":";;AASA;AACO,MAAMA,iBAAAA,GAAoB,CAACC,MAAAA,EAAqBC,OAAAA,GAAAA;AACrD,IAAA,MAAM,EAAEC,IAAAA,GAAO,IAAI,EAAE,GAAGD,WAAW,EAAC;IAEpC,MAAME,WAAAA,GAAqB,CAACC,GAAAA,EAAKH,OAAAA,GAAAA;AAC/B,QAAA,MAAMI,YAAAA,GAA4B;YAChC,GAAIF,WAAAA,CAAYG,UAAU,GAAG;AAAEA,gBAAAA,UAAAA,EAAYH,YAAYG;AAAW,aAAA,GAAI,EAAE;AACxE,YAAA,GAAGL;AACL,SAAA;AAEA,QAAA,IAAIC,IAAAA,EAAM;AACRF,YAAAA,MAAAA,CAAOO,GAAG,CAACC,KAAK,CAAC,CAAC,mBAAmB,EAAEJ,GAAAA,CAAAA,CAAK,CAAA;AAC9C,QAAA;AAEA,QAAA,OAAOK,MAAML,GAAAA,EAAKC,YAAAA,CAAAA;AACpB,IAAA,CAAA;IAEA,MAAMK,KAAAA,GACJV,MAAAA,CAAOW,MAAM,CAACC,GAAG,CAA8C,oBAAA,CAAA,IAC/DZ,MAAAA,CAAOW,MAAM,CAACC,GAAG,CAAS,qBAAA,CAAA;AAE5B,IAAA,IAAIF,KAAAA,EAAO;AACT,QAAA,IAAIR,IAAAA,EAAM;AACRF,YAAAA,MAAAA,CAAOO,GAAG,CAACM,IAAI,CAAC,CAAC,gCAAgC,EAAEH,KAAAA,CAAAA,CAAO,CAAA;AAC5D,QAAA;QACAP,WAAAA,CAAYG,UAAU,GAAG,IAAIQ,UAAAA,CAAWJ,KAAAA,CAAAA;AAC1C,IAAA;IAEA,OAAOP,WAAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-logger.d.ts","sourceRoot":"","sources":["../../src/utils/startup-logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAoB1C,eAAO,MAAM,mBAAmB,GAAI,KAAK,IAAI,CAAC,MAAM;;;;
|
|
1
|
+
{"version":3,"file":"startup-logger.d.ts","sourceRoot":"","sources":["../../src/utils/startup-logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAoB1C,eAAO,MAAM,mBAAmB,GAAI,KAAK,IAAI,CAAC,MAAM;;;;yCAuFX;QAAE,aAAa,EAAE,OAAO,CAAA;KAAE;CAWlE,CAAC"}
|
|
@@ -42,6 +42,12 @@ const createStartupLogger = (app)=>{
|
|
|
42
42
|
chars: ROUNDED_CHARS
|
|
43
43
|
});
|
|
44
44
|
const dbInfo = app.db?.getInfo();
|
|
45
|
+
const getPlan = ()=>{
|
|
46
|
+
if (!app.EE) {
|
|
47
|
+
return 'Community';
|
|
48
|
+
}
|
|
49
|
+
return app.ee.planPriceId?.toLowerCase().includes('growth') ? 'Growth' : 'Enterprise';
|
|
50
|
+
};
|
|
45
51
|
infoTable.push([
|
|
46
52
|
chalk__default.default.blue('Time'),
|
|
47
53
|
`${new Date()}`
|
|
@@ -58,8 +64,8 @@ const createStartupLogger = (app)=>{
|
|
|
58
64
|
chalk__default.default.blue('Version'),
|
|
59
65
|
`${app.config.info.strapi} (node ${process.version})`
|
|
60
66
|
], [
|
|
61
|
-
chalk__default.default.blue('
|
|
62
|
-
|
|
67
|
+
chalk__default.default.blue('Plan'),
|
|
68
|
+
getPlan()
|
|
63
69
|
], [
|
|
64
70
|
chalk__default.default.blue('Database'),
|
|
65
71
|
dbInfo?.client
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-logger.js","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type { Core } from '@strapi/types';\n\nconst ROUNDED_CHARS = {\n top: '─',\n 'top-mid': '┬',\n 'top-left': '╭',\n 'top-right': '╮',\n bottom: '─',\n 'bottom-mid': '┴',\n 'bottom-left': '╰',\n 'bottom-right': '╯',\n left: '│',\n right: '│',\n middle: '│',\n mid: '',\n 'left-mid': '',\n 'mid-mid': '',\n 'right-mid': '',\n};\n\nexport const createStartupLogger = (app: Core.Strapi) => {\n return {\n logStats() {\n const columns = Math.min(process.stderr.columns, 80) - 2;\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Project information')));\n console.log();\n\n const infoTable = new CLITable({\n colWidths: [20, 50],\n chars: ROUNDED_CHARS,\n });\n\n const dbInfo = app.db?.getInfo();\n\n infoTable.push(\n [chalk.blue('Time'), `${new Date()}`],\n [chalk.blue('Launched in'), `${Date.now() - app.config.launchedAt} ms`],\n [chalk.blue('Environment'), app.config.environment],\n [chalk.blue('Process PID'), process.pid],\n [chalk.blue('Version'), `${app.config.info.strapi} (node ${process.version})`],\n [chalk.blue('
|
|
1
|
+
{"version":3,"file":"startup-logger.js","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type { Core } from '@strapi/types';\n\nconst ROUNDED_CHARS = {\n top: '─',\n 'top-mid': '┬',\n 'top-left': '╭',\n 'top-right': '╮',\n bottom: '─',\n 'bottom-mid': '┴',\n 'bottom-left': '╰',\n 'bottom-right': '╯',\n left: '│',\n right: '│',\n middle: '│',\n mid: '',\n 'left-mid': '',\n 'mid-mid': '',\n 'right-mid': '',\n};\n\nexport const createStartupLogger = (app: Core.Strapi) => {\n return {\n logStats() {\n const columns = Math.min(process.stderr.columns, 80) - 2;\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Project information')));\n console.log();\n\n const infoTable = new CLITable({\n colWidths: [20, 50],\n chars: ROUNDED_CHARS,\n });\n\n const dbInfo = app.db?.getInfo();\n\n const getPlan = () => {\n if (!app.EE) {\n return 'Community';\n }\n\n return app.ee.planPriceId?.toLowerCase().includes('growth') ? 'Growth' : 'Enterprise';\n };\n\n infoTable.push(\n [chalk.blue('Time'), `${new Date()}`],\n [chalk.blue('Launched in'), `${Date.now() - app.config.launchedAt} ms`],\n [chalk.blue('Environment'), app.config.environment],\n [chalk.blue('Process PID'), process.pid],\n [chalk.blue('Version'), `${app.config.info.strapi} (node ${process.version})`],\n [chalk.blue('Plan'), getPlan()],\n [chalk.blue('Database'), dbInfo?.client],\n [chalk.blue('Database name'), dbInfo?.displayName]\n );\n\n if (dbInfo?.schema) {\n infoTable.push([chalk.blue('Database schema'), dbInfo.schema]);\n }\n\n console.log(infoTable.toString());\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Actions available')));\n console.log();\n },\n\n logFirstStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n\n this.logStats();\n\n console.log(chalk.bold('One more thing...'));\n console.log(\n chalk.grey('Create your first administrator 💻 by going to the administration panel at:')\n );\n console.log();\n\n const addressTable = new CLITable();\n\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n addressTable.push([chalk.bold(adminUrl)]);\n\n console.log(`${addressTable.toString()}`);\n console.log();\n },\n\n logDefaultStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n this.logStats();\n\n console.log(chalk.bold('Welcome back!'));\n\n if (app.config.get('admin.serveAdminPanel') === true) {\n console.log(chalk.grey('To manage your project 🚀, go to the administration panel at:'));\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n console.log(chalk.bold(adminUrl));\n console.log();\n }\n\n console.log(chalk.grey('To access the server ⚡️, go to:'));\n const serverUrl = strapi.config.get('server.absoluteUrl');\n console.log(chalk.bold(serverUrl));\n console.log();\n },\n\n logStartupMessage({ isInitialized }: { isInitialized: boolean }) {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n if (!isInitialized) {\n this.logFirstStartupMessage();\n } else {\n this.logDefaultStartupMessage();\n }\n },\n };\n};\n"],"names":["ROUNDED_CHARS","top","bottom","left","right","middle","mid","createStartupLogger","app","logStats","columns","Math","min","process","stderr","console","log","chalk","black","bgWhite","_","padEnd","infoTable","CLITable","colWidths","chars","dbInfo","db","getInfo","getPlan","EE","ee","planPriceId","toLowerCase","includes","push","blue","Date","now","config","launchedAt","environment","pid","info","strapi","version","client","displayName","schema","toString","logFirstStartupMessage","get","bold","grey","addressTable","adminUrl","logDefaultStartupMessage","serverUrl","logStartup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YAC7B,CAAA,MAAO;AACL,gBAAA,IAAI,CAACM,wBAAwB,EAAA;AAC/B,YAAA;AACF,QAAA;AACF,KAAA;AACF;;;;"}
|
|
@@ -34,6 +34,12 @@ const createStartupLogger = (app)=>{
|
|
|
34
34
|
chars: ROUNDED_CHARS
|
|
35
35
|
});
|
|
36
36
|
const dbInfo = app.db?.getInfo();
|
|
37
|
+
const getPlan = ()=>{
|
|
38
|
+
if (!app.EE) {
|
|
39
|
+
return 'Community';
|
|
40
|
+
}
|
|
41
|
+
return app.ee.planPriceId?.toLowerCase().includes('growth') ? 'Growth' : 'Enterprise';
|
|
42
|
+
};
|
|
37
43
|
infoTable.push([
|
|
38
44
|
chalk.blue('Time'),
|
|
39
45
|
`${new Date()}`
|
|
@@ -50,8 +56,8 @@ const createStartupLogger = (app)=>{
|
|
|
50
56
|
chalk.blue('Version'),
|
|
51
57
|
`${app.config.info.strapi} (node ${process.version})`
|
|
52
58
|
], [
|
|
53
|
-
chalk.blue('
|
|
54
|
-
|
|
59
|
+
chalk.blue('Plan'),
|
|
60
|
+
getPlan()
|
|
55
61
|
], [
|
|
56
62
|
chalk.blue('Database'),
|
|
57
63
|
dbInfo?.client
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-logger.mjs","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type { Core } from '@strapi/types';\n\nconst ROUNDED_CHARS = {\n top: '─',\n 'top-mid': '┬',\n 'top-left': '╭',\n 'top-right': '╮',\n bottom: '─',\n 'bottom-mid': '┴',\n 'bottom-left': '╰',\n 'bottom-right': '╯',\n left: '│',\n right: '│',\n middle: '│',\n mid: '',\n 'left-mid': '',\n 'mid-mid': '',\n 'right-mid': '',\n};\n\nexport const createStartupLogger = (app: Core.Strapi) => {\n return {\n logStats() {\n const columns = Math.min(process.stderr.columns, 80) - 2;\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Project information')));\n console.log();\n\n const infoTable = new CLITable({\n colWidths: [20, 50],\n chars: ROUNDED_CHARS,\n });\n\n const dbInfo = app.db?.getInfo();\n\n infoTable.push(\n [chalk.blue('Time'), `${new Date()}`],\n [chalk.blue('Launched in'), `${Date.now() - app.config.launchedAt} ms`],\n [chalk.blue('Environment'), app.config.environment],\n [chalk.blue('Process PID'), process.pid],\n [chalk.blue('Version'), `${app.config.info.strapi} (node ${process.version})`],\n [chalk.blue('
|
|
1
|
+
{"version":3,"file":"startup-logger.mjs","sources":["../../src/utils/startup-logger.ts"],"sourcesContent":["import chalk from 'chalk';\nimport CLITable from 'cli-table3';\nimport _ from 'lodash/fp';\n\nimport type { Core } from '@strapi/types';\n\nconst ROUNDED_CHARS = {\n top: '─',\n 'top-mid': '┬',\n 'top-left': '╭',\n 'top-right': '╮',\n bottom: '─',\n 'bottom-mid': '┴',\n 'bottom-left': '╰',\n 'bottom-right': '╯',\n left: '│',\n right: '│',\n middle: '│',\n mid: '',\n 'left-mid': '',\n 'mid-mid': '',\n 'right-mid': '',\n};\n\nexport const createStartupLogger = (app: Core.Strapi) => {\n return {\n logStats() {\n const columns = Math.min(process.stderr.columns, 80) - 2;\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Project information')));\n console.log();\n\n const infoTable = new CLITable({\n colWidths: [20, 50],\n chars: ROUNDED_CHARS,\n });\n\n const dbInfo = app.db?.getInfo();\n\n const getPlan = () => {\n if (!app.EE) {\n return 'Community';\n }\n\n return app.ee.planPriceId?.toLowerCase().includes('growth') ? 'Growth' : 'Enterprise';\n };\n\n infoTable.push(\n [chalk.blue('Time'), `${new Date()}`],\n [chalk.blue('Launched in'), `${Date.now() - app.config.launchedAt} ms`],\n [chalk.blue('Environment'), app.config.environment],\n [chalk.blue('Process PID'), process.pid],\n [chalk.blue('Version'), `${app.config.info.strapi} (node ${process.version})`],\n [chalk.blue('Plan'), getPlan()],\n [chalk.blue('Database'), dbInfo?.client],\n [chalk.blue('Database name'), dbInfo?.displayName]\n );\n\n if (dbInfo?.schema) {\n infoTable.push([chalk.blue('Database schema'), dbInfo.schema]);\n }\n\n console.log(infoTable.toString());\n console.log();\n console.log(chalk.black.bgWhite(_.padEnd(columns, ' Actions available')));\n console.log();\n },\n\n logFirstStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n\n this.logStats();\n\n console.log(chalk.bold('One more thing...'));\n console.log(\n chalk.grey('Create your first administrator 💻 by going to the administration panel at:')\n );\n console.log();\n\n const addressTable = new CLITable();\n\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n addressTable.push([chalk.bold(adminUrl)]);\n\n console.log(`${addressTable.toString()}`);\n console.log();\n },\n\n logDefaultStartupMessage() {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n this.logStats();\n\n console.log(chalk.bold('Welcome back!'));\n\n if (app.config.get('admin.serveAdminPanel') === true) {\n console.log(chalk.grey('To manage your project 🚀, go to the administration panel at:'));\n const adminUrl = strapi.config.get('admin.absoluteUrl');\n console.log(chalk.bold(adminUrl));\n console.log();\n }\n\n console.log(chalk.grey('To access the server ⚡️, go to:'));\n const serverUrl = strapi.config.get('server.absoluteUrl');\n console.log(chalk.bold(serverUrl));\n console.log();\n },\n\n logStartupMessage({ isInitialized }: { isInitialized: boolean }) {\n if (!strapi.config.get('server.logger.startup.enabled')) {\n return;\n }\n if (!isInitialized) {\n this.logFirstStartupMessage();\n } else {\n this.logDefaultStartupMessage();\n }\n },\n };\n};\n"],"names":["ROUNDED_CHARS","top","bottom","left","right","middle","mid","createStartupLogger","app","logStats","columns","Math","min","process","stderr","console","log","chalk","black","bgWhite","_","padEnd","infoTable","CLITable","colWidths","chars","dbInfo","db","getInfo","getPlan","EE","ee","planPriceId","toLowerCase","includes","push","blue","Date","now","config","launchedAt","environment","pid","info","strapi","version","client","displayName","schema","toString","logFirstStartupMessage","get","bold","grey","addressTable","adminUrl","logDefaultStartupMessage","serverUrl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IAAI,CAACM,wBAAwB,EAAA;AAC/B,YAAA;AACF,QAAA;AACF,KAAA;AACF;;;;"}
|
|
@@ -235,7 +235,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
235
235
|
private?: boolean | undefined;
|
|
236
236
|
writable?: boolean | undefined;
|
|
237
237
|
visible?: boolean | undefined;
|
|
238
|
-
default?: import("@strapi/types/dist/utils").JSONPrimitive | (() => import("@strapi/types/dist/utils").JSONPrimitive) | undefined;
|
|
238
|
+
default?: import("@strapi/types/dist/utils/json.js").JSONPrimitive | (() => import("@strapi/types/dist/utils/json.js").JSONPrimitive) | undefined;
|
|
239
239
|
} | {
|
|
240
240
|
type: "password";
|
|
241
241
|
pluginOptions?: object | undefined;
|
|
@@ -306,7 +306,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
306
306
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
307
307
|
} | undefined;
|
|
308
308
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
309
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
309
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
310
310
|
inversedBy?: string | undefined;
|
|
311
311
|
mappedBy?: string | undefined;
|
|
312
312
|
configurable?: boolean | undefined;
|
|
@@ -328,7 +328,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
328
328
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
329
329
|
} | undefined;
|
|
330
330
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
331
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
331
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
332
332
|
inversedBy?: string | undefined;
|
|
333
333
|
mappedBy?: string | undefined;
|
|
334
334
|
configurable?: boolean | undefined;
|
|
@@ -350,7 +350,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
350
350
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
351
351
|
} | undefined;
|
|
352
352
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
353
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
353
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
354
354
|
inversedBy?: string | undefined;
|
|
355
355
|
mappedBy?: string | undefined;
|
|
356
356
|
configurable?: boolean | undefined;
|
|
@@ -372,7 +372,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
372
372
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
373
373
|
} | undefined;
|
|
374
374
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
375
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
375
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
376
376
|
inversedBy?: string | undefined;
|
|
377
377
|
mappedBy?: string | undefined;
|
|
378
378
|
configurable?: boolean | undefined;
|
|
@@ -394,7 +394,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
394
394
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
395
395
|
} | undefined;
|
|
396
396
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
397
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
397
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
398
398
|
configurable?: boolean | undefined;
|
|
399
399
|
private?: boolean | undefined;
|
|
400
400
|
writable?: boolean | undefined;
|
|
@@ -414,7 +414,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
414
414
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
415
415
|
} | undefined;
|
|
416
416
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
417
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
417
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
418
418
|
configurable?: boolean | undefined;
|
|
419
419
|
private?: boolean | undefined;
|
|
420
420
|
writable?: boolean | undefined;
|
|
@@ -434,7 +434,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
434
434
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
435
435
|
} | undefined;
|
|
436
436
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
437
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
437
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
438
438
|
morphBy?: string | undefined;
|
|
439
439
|
configurable?: boolean | undefined;
|
|
440
440
|
private?: boolean | undefined;
|
|
@@ -455,7 +455,7 @@ export declare const transformAttribute: (name: string, attribute: Schema.Attrib
|
|
|
455
455
|
} | import("json-logic-js").JsonLogicCat<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicSubstr<import("json-logic-js").AdditionalOperation> | import("json-logic-js").JsonLogicLog<import("json-logic-js").AdditionalOperation> | null;
|
|
456
456
|
} | undefined;
|
|
457
457
|
column?: Partial<Schema.Attribute.Column> | undefined;
|
|
458
|
-
target: import("@strapi/types/dist/uid").ContentType;
|
|
458
|
+
target: import("@strapi/types/dist/uid/index.js").ContentType;
|
|
459
459
|
morphBy?: string | undefined;
|
|
460
460
|
configurable?: boolean | undefined;
|
|
461
461
|
private?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.51.0",
|
|
4
4
|
"description": "Core of Strapi",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -48,8 +48,9 @@
|
|
|
48
48
|
"build:types": "run -T tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
49
49
|
"watch": "run -T rollup -c -w",
|
|
50
50
|
"clean": "run -T rimraf ./dist",
|
|
51
|
-
"lint": "run -T eslint .",
|
|
51
|
+
"lint": "run -T eslint . --max-warnings=0",
|
|
52
52
|
"prepublishOnly": "yarn clean && yarn build",
|
|
53
|
+
"test:ts": "run -T tsc -p tsconfig.json",
|
|
53
54
|
"test:unit": "run -T jest",
|
|
54
55
|
"test:unit:watch": "run -T jest --watch",
|
|
55
56
|
"test:unit:vitest": "vitest run",
|
|
@@ -61,15 +62,15 @@
|
|
|
61
62
|
"@koa/router": "12.0.2",
|
|
62
63
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
63
64
|
"@paralleldrive/cuid2": "2.2.2",
|
|
64
|
-
"@strapi/admin": "5.
|
|
65
|
-
"@strapi/database": "5.
|
|
66
|
-
"@strapi/generators": "5.
|
|
67
|
-
"@strapi/logger": "5.
|
|
68
|
-
"@strapi/openapi": "5.
|
|
69
|
-
"@strapi/permissions": "5.
|
|
70
|
-
"@strapi/types": "5.
|
|
71
|
-
"@strapi/typescript-utils": "5.
|
|
72
|
-
"@strapi/utils": "5.
|
|
65
|
+
"@strapi/admin": "5.51.0",
|
|
66
|
+
"@strapi/database": "5.51.0",
|
|
67
|
+
"@strapi/generators": "5.51.0",
|
|
68
|
+
"@strapi/logger": "5.51.0",
|
|
69
|
+
"@strapi/openapi": "5.51.0",
|
|
70
|
+
"@strapi/permissions": "5.51.0",
|
|
71
|
+
"@strapi/types": "5.51.0",
|
|
72
|
+
"@strapi/typescript-utils": "5.51.0",
|
|
73
|
+
"@strapi/utils": "5.51.0",
|
|
73
74
|
"@vercel/stega": "0.1.2",
|
|
74
75
|
"bcryptjs": "2.4.3",
|
|
75
76
|
"boxen": "5.1.2",
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
"inquirer": "9.3.8",
|
|
91
92
|
"is-docker": "2.2.1",
|
|
92
93
|
"json-logic-js": "2.0.5",
|
|
93
|
-
"jsonwebtoken": "9.0.
|
|
94
|
+
"jsonwebtoken": "9.0.3",
|
|
94
95
|
"koa": "2.16.4",
|
|
95
96
|
"koa-body": "6.0.1",
|
|
96
97
|
"koa-compose": "4.1.0",
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
"typescript": "5.9.3",
|
|
114
115
|
"undici": "6.27.0",
|
|
115
116
|
"yup": "0.32.9",
|
|
116
|
-
"zod": "3.25.
|
|
117
|
+
"zod": "3.25.76"
|
|
117
118
|
},
|
|
118
119
|
"devDependencies": {
|
|
119
120
|
"@swc/core": "1.13.5",
|
|
@@ -133,11 +134,12 @@
|
|
|
133
134
|
"@types/mime-types": "2.1.1",
|
|
134
135
|
"@types/node": "20.19.41",
|
|
135
136
|
"@types/node-schedule": "2.1.7",
|
|
136
|
-
"eslint-config-custom": "5.
|
|
137
|
+
"eslint-config-custom": "5.51.0",
|
|
138
|
+
"jest": "29.6.0",
|
|
137
139
|
"supertest": "7.2.2",
|
|
138
|
-
"tsconfig": "5.
|
|
140
|
+
"tsconfig": "5.51.0",
|
|
139
141
|
"vitest": "catalog:",
|
|
140
|
-
"vitest-config": "5.
|
|
142
|
+
"vitest-config": "5.51.0"
|
|
141
143
|
},
|
|
142
144
|
"engines": {
|
|
143
145
|
"node": ">=20.0.0 <=26.x.x",
|