mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-14 17:03:29 +03:00
feat(strapi): added first draft (#1237)
This commit is contained in:
parent
e6cbbbcd37
commit
f74a1c50c8
16
cms/quivr/.editorconfig
Normal file
16
cms/quivr/.editorconfig
Normal file
@ -0,0 +1,16 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{package.json,*.yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
7
cms/quivr/.env.example
Normal file
7
cms/quivr/.env.example
Normal file
@ -0,0 +1,7 @@
|
||||
HOST=0.0.0.0
|
||||
PORT=1337
|
||||
APP_KEYS="toBeModified1,toBeModified2"
|
||||
API_TOKEN_SALT=tobemodified
|
||||
ADMIN_JWT_SECRET=tobemodified
|
||||
TRANSFER_TOKEN_SALT=tobemodified
|
||||
JWT_SECRET=tobemodified
|
3
cms/quivr/.eslintignore
Normal file
3
cms/quivr/.eslintignore
Normal file
@ -0,0 +1,3 @@
|
||||
.cache
|
||||
build
|
||||
**/node_modules/**
|
27
cms/quivr/.eslintrc
Normal file
27
cms/quivr/.eslintrc
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"extends": "eslint:recommended",
|
||||
"env": {
|
||||
"commonjs": true,
|
||||
"es6": true,
|
||||
"node": true,
|
||||
"browser": false
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true,
|
||||
"jsx": false
|
||||
},
|
||||
"sourceType": "module"
|
||||
},
|
||||
"globals": {
|
||||
"strapi": true
|
||||
},
|
||||
"rules": {
|
||||
"indent": ["error", 2, { "SwitchCase": 1 }],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
"no-console": 0,
|
||||
"quotes": ["error", "single"],
|
||||
"semi": ["error", "always"]
|
||||
}
|
||||
}
|
114
cms/quivr/.gitignore
vendored
Normal file
114
cms/quivr/.gitignore
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
############################
|
||||
# OS X
|
||||
############################
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Icon
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
._*
|
||||
|
||||
|
||||
############################
|
||||
# Linux
|
||||
############################
|
||||
|
||||
*~
|
||||
|
||||
|
||||
############################
|
||||
# Windows
|
||||
############################
|
||||
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
|
||||
############################
|
||||
# Packages
|
||||
############################
|
||||
|
||||
*.7z
|
||||
*.csv
|
||||
*.dat
|
||||
*.dmg
|
||||
*.gz
|
||||
*.iso
|
||||
*.jar
|
||||
*.rar
|
||||
*.tar
|
||||
*.zip
|
||||
*.com
|
||||
*.class
|
||||
*.dll
|
||||
*.exe
|
||||
*.o
|
||||
*.seed
|
||||
*.so
|
||||
*.swo
|
||||
*.swp
|
||||
*.swn
|
||||
*.swm
|
||||
*.out
|
||||
*.pid
|
||||
|
||||
|
||||
############################
|
||||
# Logs and databases
|
||||
############################
|
||||
|
||||
.tmp
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
*.sqlite3
|
||||
|
||||
|
||||
############################
|
||||
# Misc.
|
||||
############################
|
||||
|
||||
*#
|
||||
ssl
|
||||
.idea
|
||||
nbproject
|
||||
public/uploads/*
|
||||
!public/uploads/.gitkeep
|
||||
|
||||
############################
|
||||
# Node.js
|
||||
############################
|
||||
|
||||
lib-cov
|
||||
lcov.info
|
||||
pids
|
||||
logs
|
||||
results
|
||||
node_modules
|
||||
.node_history
|
||||
|
||||
############################
|
||||
# Tests
|
||||
############################
|
||||
|
||||
coverage
|
||||
|
||||
############################
|
||||
# Strapi
|
||||
############################
|
||||
|
||||
.env
|
||||
license.txt
|
||||
exports
|
||||
*.cache
|
||||
dist
|
||||
build
|
||||
.strapi-updater.json
|
31
cms/quivr/Dockerfile
Normal file
31
cms/quivr/Dockerfile
Normal file
@ -0,0 +1,31 @@
|
||||
FROM node:18.13.0-alpine
|
||||
# Install Python and essential build tools
|
||||
RUN apk add --update --no-cache python3 make g++ && ln -sf python3 /usr/bin/python
|
||||
RUN python3 -m ensurepip
|
||||
RUN pip3 install --no-cache --upgrade pip setuptools
|
||||
|
||||
# Create the directory on the node image
|
||||
# where our Next.js app will live
|
||||
RUN mkdir -p /app
|
||||
|
||||
# Set /app as the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and yarn.lock
|
||||
# to the /app working directory
|
||||
COPY package*.json yarn.lock ./
|
||||
|
||||
# Install dependencies in /app
|
||||
RUN yarn install --network-timeout 1000000
|
||||
|
||||
# Copy the rest of our Next.js folder into /app
|
||||
COPY . .
|
||||
|
||||
# Build the Next.js application
|
||||
RUN yarn build
|
||||
|
||||
# Ensure port 3000 is accessible to our system
|
||||
EXPOSE 1337
|
||||
|
||||
# Run yarn start, as we would via the command line
|
||||
CMD ["yarn", "start"]
|
57
cms/quivr/README.md
Normal file
57
cms/quivr/README.md
Normal file
@ -0,0 +1,57 @@
|
||||
# 🚀 Getting started with Strapi
|
||||
|
||||
Strapi comes with a full featured [Command Line Interface](https://docs.strapi.io/dev-docs/cli) (CLI) which lets you scaffold and manage your project in seconds.
|
||||
|
||||
### `develop`
|
||||
|
||||
Start your Strapi application with autoReload enabled. [Learn more](https://docs.strapi.io/dev-docs/cli#strapi-develop)
|
||||
|
||||
```
|
||||
npm run develop
|
||||
# or
|
||||
yarn develop
|
||||
```
|
||||
|
||||
### `start`
|
||||
|
||||
Start your Strapi application with autoReload disabled. [Learn more](https://docs.strapi.io/dev-docs/cli#strapi-start)
|
||||
|
||||
```
|
||||
npm run start
|
||||
# or
|
||||
yarn start
|
||||
```
|
||||
|
||||
### `build`
|
||||
|
||||
Build your admin panel. [Learn more](https://docs.strapi.io/dev-docs/cli#strapi-build)
|
||||
|
||||
```
|
||||
npm run build
|
||||
# or
|
||||
yarn build
|
||||
```
|
||||
|
||||
## ⚙️ Deployment
|
||||
|
||||
Strapi gives you many possible deployment options for your project including [Strapi Cloud](https://cloud.strapi.io). Browse the [deployment section of the documentation](https://docs.strapi.io/dev-docs/deployment) to find the best solution for your use case.
|
||||
|
||||
## 📚 Learn more
|
||||
|
||||
- [Resource center](https://strapi.io/resource-center) - Strapi resource center.
|
||||
- [Strapi documentation](https://docs.strapi.io) - Official Strapi documentation.
|
||||
- [Strapi tutorials](https://strapi.io/tutorials) - List of tutorials made by the core team and the community.
|
||||
- [Strapi blog](https://strapi.io/blog) - Official Strapi blog containing articles made by the Strapi team and the community.
|
||||
- [Changelog](https://strapi.io/changelog) - Find out about the Strapi product updates, new features and general improvements.
|
||||
|
||||
Feel free to check out the [Strapi GitHub repository](https://github.com/strapi/strapi). Your feedback and contributions are welcome!
|
||||
|
||||
## ✨ Community
|
||||
|
||||
- [Discord](https://discord.strapi.io) - Come chat with the Strapi community including the core team.
|
||||
- [Forum](https://forum.strapi.io/) - Place to discuss, ask questions and find answers, show your Strapi project and get feedback or just talk with other Community members.
|
||||
- [Awesome Strapi](https://github.com/strapi/awesome-strapi) - A curated list of awesome things related to Strapi.
|
||||
|
||||
---
|
||||
|
||||
<sub>🤫 Psst! [Strapi is hiring](https://strapi.io/careers).</sub>
|
13
cms/quivr/config/admin.js
Normal file
13
cms/quivr/config/admin.js
Normal file
@ -0,0 +1,13 @@
|
||||
module.exports = ({ env }) => ({
|
||||
auth: {
|
||||
secret: env('ADMIN_JWT_SECRET'),
|
||||
},
|
||||
apiToken: {
|
||||
salt: env('API_TOKEN_SALT'),
|
||||
},
|
||||
transfer: {
|
||||
token: {
|
||||
salt: env('TRANSFER_TOKEN_SALT'),
|
||||
},
|
||||
},
|
||||
});
|
7
cms/quivr/config/api.js
Normal file
7
cms/quivr/config/api.js
Normal file
@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
rest: {
|
||||
defaultLimit: 25,
|
||||
maxLimit: 100,
|
||||
withCount: true,
|
||||
},
|
||||
};
|
92
cms/quivr/config/database.js
Normal file
92
cms/quivr/config/database.js
Normal file
@ -0,0 +1,92 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = ({ env }) => {
|
||||
const client = env('DATABASE_CLIENT', 'sqlite');
|
||||
|
||||
const connections = {
|
||||
mysql: {
|
||||
connection: {
|
||||
connectionString: env('DATABASE_URL'),
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env.int('DATABASE_PORT', 3306),
|
||||
database: env('DATABASE_NAME', 'strapi'),
|
||||
user: env('DATABASE_USERNAME', 'strapi'),
|
||||
password: env('DATABASE_PASSWORD', 'strapi'),
|
||||
ssl: env.bool('DATABASE_SSL', false) && {
|
||||
key: env('DATABASE_SSL_KEY', undefined),
|
||||
cert: env('DATABASE_SSL_CERT', undefined),
|
||||
ca: env('DATABASE_SSL_CA', undefined),
|
||||
capath: env('DATABASE_SSL_CAPATH', undefined),
|
||||
cipher: env('DATABASE_SSL_CIPHER', undefined),
|
||||
rejectUnauthorized: env.bool(
|
||||
'DATABASE_SSL_REJECT_UNAUTHORIZED',
|
||||
true
|
||||
),
|
||||
},
|
||||
},
|
||||
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
|
||||
},
|
||||
mysql2: {
|
||||
connection: {
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env.int('DATABASE_PORT', 3306),
|
||||
database: env('DATABASE_NAME', 'strapi'),
|
||||
user: env('DATABASE_USERNAME', 'strapi'),
|
||||
password: env('DATABASE_PASSWORD', 'strapi'),
|
||||
ssl: env.bool('DATABASE_SSL', false) && {
|
||||
key: env('DATABASE_SSL_KEY', undefined),
|
||||
cert: env('DATABASE_SSL_CERT', undefined),
|
||||
ca: env('DATABASE_SSL_CA', undefined),
|
||||
capath: env('DATABASE_SSL_CAPATH', undefined),
|
||||
cipher: env('DATABASE_SSL_CIPHER', undefined),
|
||||
rejectUnauthorized: env.bool(
|
||||
'DATABASE_SSL_REJECT_UNAUTHORIZED',
|
||||
true
|
||||
),
|
||||
},
|
||||
},
|
||||
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
|
||||
},
|
||||
postgres: {
|
||||
connection: {
|
||||
connectionString: env('DATABASE_URL'),
|
||||
host: env('DATABASE_HOST', 'localhost'),
|
||||
port: env.int('DATABASE_PORT', 5432),
|
||||
database: env('DATABASE_NAME', 'strapi'),
|
||||
user: env('DATABASE_USERNAME', 'strapi'),
|
||||
password: env('DATABASE_PASSWORD', 'strapi'),
|
||||
ssl: env.bool('DATABASE_SSL', false) && {
|
||||
key: env('DATABASE_SSL_KEY', undefined),
|
||||
cert: env('DATABASE_SSL_CERT', undefined),
|
||||
ca: env('DATABASE_SSL_CA', undefined),
|
||||
capath: env('DATABASE_SSL_CAPATH', undefined),
|
||||
cipher: env('DATABASE_SSL_CIPHER', undefined),
|
||||
rejectUnauthorized: env.bool(
|
||||
'DATABASE_SSL_REJECT_UNAUTHORIZED',
|
||||
true
|
||||
),
|
||||
},
|
||||
schema: env('DATABASE_SCHEMA', 'public'),
|
||||
},
|
||||
pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) },
|
||||
},
|
||||
sqlite: {
|
||||
connection: {
|
||||
filename: path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
env('DATABASE_FILENAME', '.tmp/data.db')
|
||||
),
|
||||
},
|
||||
useNullAsDefault: true,
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
connection: {
|
||||
client,
|
||||
...connections[client],
|
||||
acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000),
|
||||
},
|
||||
};
|
||||
};
|
12
cms/quivr/config/middlewares.js
Normal file
12
cms/quivr/config/middlewares.js
Normal file
@ -0,0 +1,12 @@
|
||||
module.exports = [
|
||||
'strapi::errors',
|
||||
'strapi::security',
|
||||
'strapi::cors',
|
||||
'strapi::poweredBy',
|
||||
'strapi::logger',
|
||||
'strapi::query',
|
||||
'strapi::body',
|
||||
'strapi::session',
|
||||
'strapi::favicon',
|
||||
'strapi::public',
|
||||
];
|
10
cms/quivr/config/server.js
Normal file
10
cms/quivr/config/server.js
Normal file
@ -0,0 +1,10 @@
|
||||
module.exports = ({ env }) => ({
|
||||
host: env('HOST', '0.0.0.0'),
|
||||
port: env.int('PORT', 1337),
|
||||
app: {
|
||||
keys: env.array('APP_KEYS'),
|
||||
},
|
||||
webhooks: {
|
||||
populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),
|
||||
},
|
||||
});
|
0
cms/quivr/database/migrations/.gitkeep
Normal file
0
cms/quivr/database/migrations/.gitkeep
Normal file
BIN
cms/quivr/favicon.png
Normal file
BIN
cms/quivr/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 497 B |
8
cms/quivr/jsconfig.json
Normal file
8
cms/quivr/jsconfig.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "nodenext",
|
||||
"target": "ES2021",
|
||||
"checkJs": true,
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
30
cms/quivr/package.json
Normal file
30
cms/quivr/package.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "quivr",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"description": "A Strapi application",
|
||||
"scripts": {
|
||||
"develop": "strapi develop",
|
||||
"start": "strapi start",
|
||||
"build": "strapi build",
|
||||
"strapi": "strapi"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"dependencies": {
|
||||
"@strapi/strapi": "4.13.7",
|
||||
"@strapi/plugin-users-permissions": "4.13.7",
|
||||
"@strapi/plugin-i18n": "4.13.7",
|
||||
"better-sqlite3": "8.6.0"
|
||||
},
|
||||
"author": {
|
||||
"name": "A Strapi developer"
|
||||
},
|
||||
"strapi": {
|
||||
"uuid": "c2cbd510-4048-4ef6-b14c-0e3d74744031"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0 <=20.x.x",
|
||||
"npm": ">=6.0.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
3
cms/quivr/public/robots.txt
Normal file
3
cms/quivr/public/robots.txt
Normal file
@ -0,0 +1,3 @@
|
||||
# To prevent search engines from seeing the site altogether, uncomment the next two lines:
|
||||
# User-Agent: *
|
||||
# Disallow: /
|
0
cms/quivr/public/uploads/.gitkeep
Normal file
0
cms/quivr/public/uploads/.gitkeep
Normal file
39
cms/quivr/src/admin/app.example.js
Normal file
39
cms/quivr/src/admin/app.example.js
Normal file
@ -0,0 +1,39 @@
|
||||
const config = {
|
||||
locales: [
|
||||
// 'ar',
|
||||
// 'fr',
|
||||
// 'cs',
|
||||
// 'de',
|
||||
// 'dk',
|
||||
// 'es',
|
||||
// 'he',
|
||||
// 'id',
|
||||
// 'it',
|
||||
// 'ja',
|
||||
// 'ko',
|
||||
// 'ms',
|
||||
// 'nl',
|
||||
// 'no',
|
||||
// 'pl',
|
||||
// 'pt-BR',
|
||||
// 'pt',
|
||||
// 'ru',
|
||||
// 'sk',
|
||||
// 'sv',
|
||||
// 'th',
|
||||
// 'tr',
|
||||
// 'uk',
|
||||
// 'vi',
|
||||
// 'zh-Hans',
|
||||
// 'zh',
|
||||
],
|
||||
};
|
||||
|
||||
const bootstrap = (app) => {
|
||||
console.log(app);
|
||||
};
|
||||
|
||||
export default {
|
||||
config,
|
||||
bootstrap,
|
||||
};
|
9
cms/quivr/src/admin/webpack.config.example.js
Normal file
9
cms/quivr/src/admin/webpack.config.example.js
Normal file
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
module.exports = (config, webpack) => {
|
||||
// Note: we provide webpack above so you should not `require` it
|
||||
// Perform customizations to webpack config
|
||||
// Important: return the modified config
|
||||
return config;
|
||||
};
|
0
cms/quivr/src/api/.gitkeep
Normal file
0
cms/quivr/src/api/.gitkeep
Normal file
28
cms/quivr/src/api/blog/content-types/blog/schema.json
Normal file
28
cms/quivr/src/api/blog/content-types/blog/schema.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "blogs",
|
||||
"info": {
|
||||
"singularName": "blog",
|
||||
"pluralName": "blogs",
|
||||
"displayName": "Blog"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"draft": {
|
||||
"type": "richtext"
|
||||
},
|
||||
"imageUrl": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
9
cms/quivr/src/api/blog/controllers/blog.js
Normal file
9
cms/quivr/src/api/blog/controllers/blog.js
Normal file
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* blog controller
|
||||
*/
|
||||
|
||||
const { createCoreController } = require('@strapi/strapi').factories;
|
||||
|
||||
module.exports = createCoreController('api::blog.blog');
|
9
cms/quivr/src/api/blog/routes/blog.js
Normal file
9
cms/quivr/src/api/blog/routes/blog.js
Normal file
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* blog router
|
||||
*/
|
||||
|
||||
const { createCoreRouter } = require('@strapi/strapi').factories;
|
||||
|
||||
module.exports = createCoreRouter('api::blog.blog');
|
9
cms/quivr/src/api/blog/services/blog.js
Normal file
9
cms/quivr/src/api/blog/services/blog.js
Normal file
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* blog service
|
||||
*/
|
||||
|
||||
const { createCoreService } = require('@strapi/strapi').factories;
|
||||
|
||||
module.exports = createCoreService('api::blog.blog');
|
0
cms/quivr/src/extensions/.gitkeep
Normal file
0
cms/quivr/src/extensions/.gitkeep
Normal file
20
cms/quivr/src/index.js
Normal file
20
cms/quivr/src/index.js
Normal file
@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* An asynchronous register function that runs before
|
||||
* your application is initialized.
|
||||
*
|
||||
* This gives you an opportunity to extend code.
|
||||
*/
|
||||
register(/*{ strapi }*/) {},
|
||||
|
||||
/**
|
||||
* An asynchronous bootstrap function that runs before
|
||||
* your application gets started.
|
||||
*
|
||||
* This gives you an opportunity to set up your data model,
|
||||
* run jobs, or perform some special logic.
|
||||
*/
|
||||
bootstrap(/*{ strapi }*/) {},
|
||||
};
|
5
cms/quivr/types/generated/components.d.ts
vendored
Normal file
5
cms/quivr/types/generated/components.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import type { Schema, Attribute } from '@strapi/strapi';
|
||||
|
||||
declare module '@strapi/strapi' {
|
||||
export module Shared {}
|
||||
}
|
723
cms/quivr/types/generated/contentTypes.d.ts
vendored
Normal file
723
cms/quivr/types/generated/contentTypes.d.ts
vendored
Normal file
@ -0,0 +1,723 @@
|
||||
import type { Schema, Attribute } from '@strapi/strapi';
|
||||
|
||||
export interface AdminPermission extends Schema.CollectionType {
|
||||
collectionName: 'admin_permissions';
|
||||
info: {
|
||||
name: 'Permission';
|
||||
description: '';
|
||||
singularName: 'permission';
|
||||
pluralName: 'permissions';
|
||||
displayName: 'Permission';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
action: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
subject: Attribute.String &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
properties: Attribute.JSON & Attribute.DefaultTo<{}>;
|
||||
conditions: Attribute.JSON & Attribute.DefaultTo<[]>;
|
||||
role: Attribute.Relation<'admin::permission', 'manyToOne', 'admin::role'>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'admin::permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'admin::permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AdminUser extends Schema.CollectionType {
|
||||
collectionName: 'admin_users';
|
||||
info: {
|
||||
name: 'User';
|
||||
description: '';
|
||||
singularName: 'user';
|
||||
pluralName: 'users';
|
||||
displayName: 'User';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
firstname: Attribute.String &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
lastname: Attribute.String &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
username: Attribute.String;
|
||||
email: Attribute.Email &
|
||||
Attribute.Required &
|
||||
Attribute.Private &
|
||||
Attribute.Unique &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 6;
|
||||
}>;
|
||||
password: Attribute.Password &
|
||||
Attribute.Private &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 6;
|
||||
}>;
|
||||
resetPasswordToken: Attribute.String & Attribute.Private;
|
||||
registrationToken: Attribute.String & Attribute.Private;
|
||||
isActive: Attribute.Boolean &
|
||||
Attribute.Private &
|
||||
Attribute.DefaultTo<false>;
|
||||
roles: Attribute.Relation<'admin::user', 'manyToMany', 'admin::role'> &
|
||||
Attribute.Private;
|
||||
blocked: Attribute.Boolean & Attribute.Private & Attribute.DefaultTo<false>;
|
||||
preferedLanguage: Attribute.String;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<'admin::user', 'oneToOne', 'admin::user'> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<'admin::user', 'oneToOne', 'admin::user'> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AdminRole extends Schema.CollectionType {
|
||||
collectionName: 'admin_roles';
|
||||
info: {
|
||||
name: 'Role';
|
||||
description: '';
|
||||
singularName: 'role';
|
||||
pluralName: 'roles';
|
||||
displayName: 'Role';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.Unique &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
code: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.Unique &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
description: Attribute.String;
|
||||
users: Attribute.Relation<'admin::role', 'manyToMany', 'admin::user'>;
|
||||
permissions: Attribute.Relation<
|
||||
'admin::role',
|
||||
'oneToMany',
|
||||
'admin::permission'
|
||||
>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<'admin::role', 'oneToOne', 'admin::user'> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<'admin::role', 'oneToOne', 'admin::user'> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AdminApiToken extends Schema.CollectionType {
|
||||
collectionName: 'strapi_api_tokens';
|
||||
info: {
|
||||
name: 'Api Token';
|
||||
singularName: 'api-token';
|
||||
pluralName: 'api-tokens';
|
||||
displayName: 'Api Token';
|
||||
description: '';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.Unique &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
description: Attribute.String &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}> &
|
||||
Attribute.DefaultTo<''>;
|
||||
type: Attribute.Enumeration<['read-only', 'full-access', 'custom']> &
|
||||
Attribute.Required &
|
||||
Attribute.DefaultTo<'read-only'>;
|
||||
accessKey: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
lastUsedAt: Attribute.DateTime;
|
||||
permissions: Attribute.Relation<
|
||||
'admin::api-token',
|
||||
'oneToMany',
|
||||
'admin::api-token-permission'
|
||||
>;
|
||||
expiresAt: Attribute.DateTime;
|
||||
lifespan: Attribute.BigInteger;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'admin::api-token',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'admin::api-token',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AdminApiTokenPermission extends Schema.CollectionType {
|
||||
collectionName: 'strapi_api_token_permissions';
|
||||
info: {
|
||||
name: 'API Token Permission';
|
||||
description: '';
|
||||
singularName: 'api-token-permission';
|
||||
pluralName: 'api-token-permissions';
|
||||
displayName: 'API Token Permission';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
action: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
token: Attribute.Relation<
|
||||
'admin::api-token-permission',
|
||||
'manyToOne',
|
||||
'admin::api-token'
|
||||
>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'admin::api-token-permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'admin::api-token-permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AdminTransferToken extends Schema.CollectionType {
|
||||
collectionName: 'strapi_transfer_tokens';
|
||||
info: {
|
||||
name: 'Transfer Token';
|
||||
singularName: 'transfer-token';
|
||||
pluralName: 'transfer-tokens';
|
||||
displayName: 'Transfer Token';
|
||||
description: '';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.Unique &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
description: Attribute.String &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}> &
|
||||
Attribute.DefaultTo<''>;
|
||||
accessKey: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
lastUsedAt: Attribute.DateTime;
|
||||
permissions: Attribute.Relation<
|
||||
'admin::transfer-token',
|
||||
'oneToMany',
|
||||
'admin::transfer-token-permission'
|
||||
>;
|
||||
expiresAt: Attribute.DateTime;
|
||||
lifespan: Attribute.BigInteger;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'admin::transfer-token',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'admin::transfer-token',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AdminTransferTokenPermission extends Schema.CollectionType {
|
||||
collectionName: 'strapi_transfer_token_permissions';
|
||||
info: {
|
||||
name: 'Transfer Token Permission';
|
||||
description: '';
|
||||
singularName: 'transfer-token-permission';
|
||||
pluralName: 'transfer-token-permissions';
|
||||
displayName: 'Transfer Token Permission';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
action: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 1;
|
||||
}>;
|
||||
token: Attribute.Relation<
|
||||
'admin::transfer-token-permission',
|
||||
'manyToOne',
|
||||
'admin::transfer-token'
|
||||
>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'admin::transfer-token-permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'admin::transfer-token-permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiBlogBlog extends Schema.CollectionType {
|
||||
collectionName: 'blogs';
|
||||
info: {
|
||||
singularName: 'blog';
|
||||
pluralName: 'blogs';
|
||||
displayName: 'Blog';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
title: Attribute.String & Attribute.Required;
|
||||
description: Attribute.Text;
|
||||
draft: Attribute.RichText;
|
||||
imageUrl: Attribute.String;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
publishedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<'api::blog.blog', 'oneToOne', 'admin::user'> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<'api::blog.blog', 'oneToOne', 'admin::user'> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginUploadFile extends Schema.CollectionType {
|
||||
collectionName: 'files';
|
||||
info: {
|
||||
singularName: 'file';
|
||||
pluralName: 'files';
|
||||
displayName: 'File';
|
||||
description: '';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required;
|
||||
alternativeText: Attribute.String;
|
||||
caption: Attribute.String;
|
||||
width: Attribute.Integer;
|
||||
height: Attribute.Integer;
|
||||
formats: Attribute.JSON;
|
||||
hash: Attribute.String & Attribute.Required;
|
||||
ext: Attribute.String;
|
||||
mime: Attribute.String & Attribute.Required;
|
||||
size: Attribute.Decimal & Attribute.Required;
|
||||
url: Attribute.String & Attribute.Required;
|
||||
previewUrl: Attribute.String;
|
||||
provider: Attribute.String & Attribute.Required;
|
||||
provider_metadata: Attribute.JSON;
|
||||
related: Attribute.Relation<'plugin::upload.file', 'morphToMany'>;
|
||||
folder: Attribute.Relation<
|
||||
'plugin::upload.file',
|
||||
'manyToOne',
|
||||
'plugin::upload.folder'
|
||||
> &
|
||||
Attribute.Private;
|
||||
folderPath: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.Private &
|
||||
Attribute.SetMinMax<{
|
||||
min: 1;
|
||||
}>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'plugin::upload.file',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'plugin::upload.file',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginUploadFolder extends Schema.CollectionType {
|
||||
collectionName: 'upload_folders';
|
||||
info: {
|
||||
singularName: 'folder';
|
||||
pluralName: 'folders';
|
||||
displayName: 'Folder';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMax<{
|
||||
min: 1;
|
||||
}>;
|
||||
pathId: Attribute.Integer & Attribute.Required & Attribute.Unique;
|
||||
parent: Attribute.Relation<
|
||||
'plugin::upload.folder',
|
||||
'manyToOne',
|
||||
'plugin::upload.folder'
|
||||
>;
|
||||
children: Attribute.Relation<
|
||||
'plugin::upload.folder',
|
||||
'oneToMany',
|
||||
'plugin::upload.folder'
|
||||
>;
|
||||
files: Attribute.Relation<
|
||||
'plugin::upload.folder',
|
||||
'oneToMany',
|
||||
'plugin::upload.file'
|
||||
>;
|
||||
path: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMax<{
|
||||
min: 1;
|
||||
}>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'plugin::upload.folder',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'plugin::upload.folder',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginUsersPermissionsPermission
|
||||
extends Schema.CollectionType {
|
||||
collectionName: 'up_permissions';
|
||||
info: {
|
||||
name: 'permission';
|
||||
description: '';
|
||||
singularName: 'permission';
|
||||
pluralName: 'permissions';
|
||||
displayName: 'Permission';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
action: Attribute.String & Attribute.Required;
|
||||
role: Attribute.Relation<
|
||||
'plugin::users-permissions.permission',
|
||||
'manyToOne',
|
||||
'plugin::users-permissions.role'
|
||||
>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'plugin::users-permissions.permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'plugin::users-permissions.permission',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginUsersPermissionsRole extends Schema.CollectionType {
|
||||
collectionName: 'up_roles';
|
||||
info: {
|
||||
name: 'role';
|
||||
description: '';
|
||||
singularName: 'role';
|
||||
pluralName: 'roles';
|
||||
displayName: 'Role';
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 3;
|
||||
}>;
|
||||
description: Attribute.String;
|
||||
type: Attribute.String & Attribute.Unique;
|
||||
permissions: Attribute.Relation<
|
||||
'plugin::users-permissions.role',
|
||||
'oneToMany',
|
||||
'plugin::users-permissions.permission'
|
||||
>;
|
||||
users: Attribute.Relation<
|
||||
'plugin::users-permissions.role',
|
||||
'oneToMany',
|
||||
'plugin::users-permissions.user'
|
||||
>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'plugin::users-permissions.role',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'plugin::users-permissions.role',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginUsersPermissionsUser extends Schema.CollectionType {
|
||||
collectionName: 'up_users';
|
||||
info: {
|
||||
name: 'user';
|
||||
description: '';
|
||||
singularName: 'user';
|
||||
pluralName: 'users';
|
||||
displayName: 'User';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: false;
|
||||
timestamps: true;
|
||||
};
|
||||
attributes: {
|
||||
username: Attribute.String &
|
||||
Attribute.Required &
|
||||
Attribute.Unique &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 3;
|
||||
}>;
|
||||
email: Attribute.Email &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 6;
|
||||
}>;
|
||||
provider: Attribute.String;
|
||||
password: Attribute.Password &
|
||||
Attribute.Private &
|
||||
Attribute.SetMinMaxLength<{
|
||||
minLength: 6;
|
||||
}>;
|
||||
resetPasswordToken: Attribute.String & Attribute.Private;
|
||||
confirmationToken: Attribute.String & Attribute.Private;
|
||||
confirmed: Attribute.Boolean & Attribute.DefaultTo<false>;
|
||||
blocked: Attribute.Boolean & Attribute.DefaultTo<false>;
|
||||
role: Attribute.Relation<
|
||||
'plugin::users-permissions.user',
|
||||
'manyToOne',
|
||||
'plugin::users-permissions.role'
|
||||
>;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'plugin::users-permissions.user',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'plugin::users-permissions.user',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginI18NLocale extends Schema.CollectionType {
|
||||
collectionName: 'i18n_locale';
|
||||
info: {
|
||||
singularName: 'locale';
|
||||
pluralName: 'locales';
|
||||
collectionName: 'locales';
|
||||
displayName: 'Locale';
|
||||
description: '';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: false;
|
||||
};
|
||||
pluginOptions: {
|
||||
'content-manager': {
|
||||
visible: false;
|
||||
};
|
||||
'content-type-builder': {
|
||||
visible: false;
|
||||
};
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String &
|
||||
Attribute.SetMinMax<{
|
||||
min: 1;
|
||||
max: 50;
|
||||
}>;
|
||||
code: Attribute.String & Attribute.Unique;
|
||||
createdAt: Attribute.DateTime;
|
||||
updatedAt: Attribute.DateTime;
|
||||
createdBy: Attribute.Relation<
|
||||
'plugin::i18n.locale',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
updatedBy: Attribute.Relation<
|
||||
'plugin::i18n.locale',
|
||||
'oneToOne',
|
||||
'admin::user'
|
||||
> &
|
||||
Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
declare module '@strapi/strapi' {
|
||||
export module Shared {
|
||||
export interface ContentTypes {
|
||||
'admin::permission': AdminPermission;
|
||||
'admin::user': AdminUser;
|
||||
'admin::role': AdminRole;
|
||||
'admin::api-token': AdminApiToken;
|
||||
'admin::api-token-permission': AdminApiTokenPermission;
|
||||
'admin::transfer-token': AdminTransferToken;
|
||||
'admin::transfer-token-permission': AdminTransferTokenPermission;
|
||||
'api::blog.blog': ApiBlogBlog;
|
||||
'plugin::upload.file': PluginUploadFile;
|
||||
'plugin::upload.folder': PluginUploadFolder;
|
||||
'plugin::users-permissions.permission': PluginUsersPermissionsPermission;
|
||||
'plugin::users-permissions.role': PluginUsersPermissionsRole;
|
||||
'plugin::users-permissions.user': PluginUsersPermissionsUser;
|
||||
'plugin::i18n.locale': PluginI18NLocale;
|
||||
}
|
||||
}
|
||||
}
|
9003
cms/quivr/yarn.lock
Normal file
9003
cms/quivr/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@ -40,7 +40,45 @@ a {
|
||||
}
|
||||
|
||||
.custom-prose {
|
||||
max-height: 60vh; /* Adjust this value based on the desired maximum height */
|
||||
overflow-y: auto; /* Enable vertical scroll if the content exceeds the maximum height */
|
||||
padding-right: 1rem; /* Optional: Add some padding if the scrollbar appears, so the text is not squished */
|
||||
max-height: 60vh;
|
||||
/* Adjust this value based on the desired maximum height */
|
||||
overflow-y: auto;
|
||||
/* Enable vertical scroll if the content exceeds the maximum height */
|
||||
padding-right: 1rem;
|
||||
/* Optional: Add some padding if the scrollbar appears, so the text is not squished */
|
||||
}
|
||||
|
||||
|
||||
.container,
|
||||
.post {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
margin: 0 auto;
|
||||
padding: 40px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container h1,
|
||||
.post h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
padding: 40px 0;
|
||||
}
|
||||
|
||||
.flexing {
|
||||
width: 30%;
|
||||
box-sizing: content-box;
|
||||
background: #f8f6f8;
|
||||
margin: 1%;
|
||||
padding: 30px;
|
||||
border-radius: 8px;
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
const nextConfig = {
|
||||
images: {
|
||||
domains: ["www.quivr.app"]
|
||||
},
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
async headers() {
|
||||
if (process.env.NEXT_PUBLIC_ENV === "prod") {
|
||||
|
@ -57,9 +57,11 @@
|
||||
"eslint-config-next": "13.4.2",
|
||||
"eslint-plugin-prefer-arrow": "^1.2.3",
|
||||
"framer-motion": "^10.15.0",
|
||||
"front-matter": "^4.0.2",
|
||||
"i18next": "^23.4.1",
|
||||
"i18next-http-backend": "^2.2.1",
|
||||
"lodash": "^4.17.21",
|
||||
"marked": "^9.0.3",
|
||||
"next": "13.4.19",
|
||||
"nock": "^13.3.1",
|
||||
"postcss": "8.4.23",
|
||||
@ -91,4 +93,4 @@
|
||||
"react-icons": "^4.8.0",
|
||||
"vitest": "^0.32.2"
|
||||
}
|
||||
}
|
||||
}
|
88
frontend/pages/blog/[id]/index.tsx
Normal file
88
frontend/pages/blog/[id]/index.tsx
Normal file
@ -0,0 +1,88 @@
|
||||
/* eslint-disable */
|
||||
import type { GetStaticPaths, InferGetStaticPropsType } from 'next';
|
||||
import Head from "next/head";
|
||||
import Image from "next/image";
|
||||
|
||||
type BlogPostAttributes = {
|
||||
imageUrl: string;
|
||||
title: string;
|
||||
description: string;
|
||||
draft: string;
|
||||
};
|
||||
|
||||
type BlogPost = {
|
||||
id: string;
|
||||
attributes: BlogPostAttributes;
|
||||
};
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = async () => {
|
||||
try {
|
||||
const response = await fetch("http://localhost:1337/api/blogs");
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok'); // Handle non-200 responses
|
||||
}
|
||||
const data: { data: BlogPost[] } = await response.json();
|
||||
const paths = data.data.map(post => ({ params: { id: post.id.toString() } }));
|
||||
|
||||
return {
|
||||
paths,
|
||||
fallback: false, // Use "true" to enable ISR (Incremental Static Regeneration) or "blocking" for server-side rendering fallback
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error fetching blog paths:", error);
|
||||
return {
|
||||
paths: [], // Return empty array if there's an error
|
||||
fallback: false, // Use "true" to enable ISR or "blocking" for server-side rendering fallback
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export const getStaticProps = async (context: { params: { id: string } }) => {
|
||||
try {
|
||||
const response = await fetch(`http://localhost:1337/api/blogs/${context.params.id}`);
|
||||
console.log(response)
|
||||
const data: { data: BlogPost } = await response.json();
|
||||
|
||||
|
||||
return {
|
||||
props: {
|
||||
post: data.data,
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error fetching blog post:", error);
|
||||
|
||||
return {
|
||||
notFound: true,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const BlogPostDetail = ({ post }: InferGetStaticPropsType<typeof getStaticProps>) => {
|
||||
return (
|
||||
<main className="bg-gray-100 min-h-screen p-8">
|
||||
<Head>
|
||||
<title>{post.attributes.title}</title>
|
||||
<meta name="description" content={post.attributes.description} />
|
||||
</Head>
|
||||
<div className="max-w-screen-xl mx-auto">
|
||||
<div className="bg-white p-8 rounded-lg shadow-md">
|
||||
<Image
|
||||
src={post.attributes.imageUrl}
|
||||
alt="blog-post-detail"
|
||||
className="w-full rounded-t-lg object-cover h-56"
|
||||
width={1000}
|
||||
height={500}
|
||||
/>
|
||||
<h1 className="text-4xl font-bold my-6">{post.attributes.title}</h1>
|
||||
<p className="text-gray-700 whitespace-pre-line">{post.attributes.draft}</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default BlogPostDetail;
|
76
frontend/pages/blog/index.tsx
Normal file
76
frontend/pages/blog/index.tsx
Normal file
@ -0,0 +1,76 @@
|
||||
'use client';
|
||||
/* https://strapi.io/blog/how-to-create-an-ssg-static-site-generation-application-with-strapi-webhooks-and-nextjs */
|
||||
import type { InferGetStaticPropsType } from 'next';
|
||||
import Head from "next/head";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
|
||||
type BlogPostAttributes = {
|
||||
imageUrl: string;
|
||||
title: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
type BlogPost = {
|
||||
id: string;
|
||||
attributes: BlogPostAttributes;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export const getStaticProps = async () => {
|
||||
try {
|
||||
const resulting = await fetch("http://localhost:1337/api/blogs");
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const data: { data: BlogPost[] } = await resulting.json();
|
||||
|
||||
return {
|
||||
props: {
|
||||
result: data.data,
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error fetching blogs:", error);
|
||||
|
||||
return {
|
||||
notFound: true, // this will return a 404 page
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
const Blog = ({ result }: InferGetStaticPropsType<typeof getStaticProps>) => {
|
||||
return (
|
||||
<main className="bg-gray-100 min-h-screen p-8">
|
||||
<Head>
|
||||
<title>thisBlog</title>
|
||||
<meta name="description" content="This is an example of our blog" />
|
||||
</Head>
|
||||
<div className="max-w-screen-xl mx-auto">
|
||||
<h1 className="text-4xl font-bold mb-12 text-center">Blog Posts</h1>
|
||||
<div className="grid gap-12 grid-cols-1 md:grid-cols-2">
|
||||
{result.map(post => (
|
||||
<Link href={`/blog/${post.id}`} key={post.id}>
|
||||
<div className="block p-8 bg-white rounded-lg shadow-md hover:shadow-xl transform hover:scale-105 transition-transform duration-200">
|
||||
<div className="mb-6">
|
||||
<Image
|
||||
src={`${post.attributes.imageUrl}`}
|
||||
alt="blog-post"
|
||||
priority={true}
|
||||
className="w-full rounded-lg object-cover h-56"
|
||||
width={600}
|
||||
height={300}
|
||||
/>
|
||||
</div>
|
||||
<h2 className="text-2xl font-semibold mb-4">{post.attributes.title}</h2>
|
||||
<p className="text-gray-600">{post.attributes.description}</p>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default Blog;
|
33
frontend/styles/blog.module.css
Normal file
33
frontend/styles/blog.module.css
Normal file
@ -0,0 +1,33 @@
|
||||
.container,
|
||||
.post {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
margin: 0 auto;
|
||||
padding: 40px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container h1,
|
||||
.post h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
padding: 40px 0;
|
||||
}
|
||||
|
||||
.flexing {
|
||||
width: 30%;
|
||||
box-sizing: content-box;
|
||||
background: #f8f6f8;
|
||||
margin: 1%;
|
||||
padding: 30px;
|
||||
border-radius: 8px;
|
||||
}
|
@ -2763,6 +2763,13 @@ arg@^5.0.2:
|
||||
resolved "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz"
|
||||
integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
||||
dependencies:
|
||||
sprintf-js "~1.0.2"
|
||||
|
||||
argparse@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz"
|
||||
@ -4038,6 +4045,11 @@ espree@^9.6.0, espree@^9.6.1:
|
||||
acorn-jsx "^5.3.2"
|
||||
eslint-visitor-keys "^3.4.1"
|
||||
|
||||
esprima@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
|
||||
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||
|
||||
esquery@^1.4.2:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz"
|
||||
@ -4285,6 +4297,13 @@ framer-motion@^10.15.0:
|
||||
optionalDependencies:
|
||||
"@emotion/is-prop-valid" "^0.8.2"
|
||||
|
||||
front-matter@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/front-matter/-/front-matter-4.0.2.tgz#b14e54dc745cfd7293484f3210d15ea4edd7f4d5"
|
||||
integrity sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==
|
||||
dependencies:
|
||||
js-yaml "^3.13.1"
|
||||
|
||||
fs-constants@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz"
|
||||
@ -4997,6 +5016,14 @@ js-cookie@^2.2.1:
|
||||
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
|
||||
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
|
||||
|
||||
js-yaml@^3.13.1:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
|
||||
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
|
||||
dependencies:
|
||||
argparse "^1.0.7"
|
||||
esprima "^4.0.0"
|
||||
|
||||
js-yaml@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz"
|
||||
@ -5232,6 +5259,11 @@ magic-string@^0.30.0:
|
||||
dependencies:
|
||||
"@jridgewell/sourcemap-codec" "^1.4.15"
|
||||
|
||||
marked@^9.0.3:
|
||||
version "9.0.3"
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-9.0.3.tgz#95be5e8cba93f2c2ca1d6503794c4f02d81c97d9"
|
||||
integrity sha512-pI/k4nzBG1PEq1J3XFEHxVvjicfjl8rgaMaqclouGSMPhk7Q3Ejb2ZRxx/ZQOcQ1909HzVoWCFYq6oLgtL4BpQ==
|
||||
|
||||
mdast-util-definitions@^5.0.0:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz#9910abb60ac5d7115d6819b57ae0bcef07a3f7a7"
|
||||
@ -6699,6 +6731,11 @@ spark-md5@^3.0.1:
|
||||
resolved "https://registry.npmjs.org/spark-md5/-/spark-md5-3.0.2.tgz"
|
||||
integrity sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw==
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==
|
||||
|
||||
stack-generator@^2.0.5:
|
||||
version "2.0.10"
|
||||
resolved "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz"
|
||||
|
Loading…
Reference in New Issue
Block a user