mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Fixes
This commit is contained in:
parent
3a17647de9
commit
1a917d4eca
154
examples/getstarted/types/generated/components.d.ts
vendored
Normal file
154
examples/getstarted/types/generated/components.d.ts
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
import type { Schema, Attribute } from '@strapi/strapi';
|
||||
|
||||
export interface BasicRelation extends Schema.Component {
|
||||
collectionName: 'components_basic_relations';
|
||||
info: {
|
||||
displayName: 'Relation';
|
||||
};
|
||||
attributes: {
|
||||
categories: Attribute.Relation<'basic.relation', 'oneToMany', 'api::category.category'>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface BasicSimple extends Schema.Component {
|
||||
collectionName: 'components_basic_simples';
|
||||
info: {
|
||||
displayName: 'simple';
|
||||
icon: 'ambulance';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required;
|
||||
test: Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
export interface BlogTestComo extends Schema.Component {
|
||||
collectionName: 'components_blog_test_comos';
|
||||
info: {
|
||||
displayName: 'test comp';
|
||||
icon: 'air-freshener';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.DefaultTo<'toto'>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultApple extends Schema.Component {
|
||||
collectionName: 'components_default_apples';
|
||||
info: {
|
||||
displayName: 'apple';
|
||||
icon: 'apple-alt';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultCar extends Schema.Component {
|
||||
collectionName: 'components_default_cars';
|
||||
info: {
|
||||
displayName: 'car';
|
||||
icon: 'align-right';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultClosingperiod extends Schema.Component {
|
||||
collectionName: 'components_closingperiods';
|
||||
info: {
|
||||
displayName: 'closingperiod';
|
||||
description: '';
|
||||
icon: 'angry';
|
||||
};
|
||||
attributes: {
|
||||
label: Attribute.String & Attribute.DefaultTo<'toto'>;
|
||||
start_date: Attribute.Date & Attribute.Required;
|
||||
end_date: Attribute.Date & Attribute.Required;
|
||||
media: Attribute.Media;
|
||||
dish: Attribute.Component<'default.dish', true> &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMax<{
|
||||
min: 2;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultDish extends Schema.Component {
|
||||
collectionName: 'components_dishes';
|
||||
info: {
|
||||
displayName: 'dish';
|
||||
description: '';
|
||||
icon: 'address-book';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.DefaultTo<'My super dish'>;
|
||||
description: Attribute.Text;
|
||||
price: Attribute.Float;
|
||||
picture: Attribute.Media;
|
||||
very_long_description: Attribute.RichText;
|
||||
categories: Attribute.Relation<'default.dish', 'oneToOne', 'api::category.category'>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultOpeningtimes extends Schema.Component {
|
||||
collectionName: 'components_openingtimes';
|
||||
info: {
|
||||
displayName: 'openingtimes';
|
||||
description: '';
|
||||
icon: 'calendar';
|
||||
};
|
||||
attributes: {
|
||||
label: Attribute.String & Attribute.Required & Attribute.DefaultTo<'something'>;
|
||||
time: Attribute.String;
|
||||
dishrep: Attribute.Component<'default.dish', true>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultRestaurantservice extends Schema.Component {
|
||||
collectionName: 'components_restaurantservices';
|
||||
info: {
|
||||
displayName: 'restaurantservice';
|
||||
description: '';
|
||||
icon: 'cannabis';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required & Attribute.DefaultTo<'something'>;
|
||||
media: Attribute.Media;
|
||||
is_available: Attribute.Boolean & Attribute.Required & Attribute.DefaultTo<true>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultTemp extends Schema.Component {
|
||||
collectionName: 'components_default_temps';
|
||||
info: {
|
||||
displayName: 'temp';
|
||||
icon: 'adjust';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required;
|
||||
url: Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
declare module '@strapi/types' {
|
||||
export module Shared {
|
||||
export interface Components {
|
||||
'basic.relation': BasicRelation;
|
||||
'basic.simple': BasicSimple;
|
||||
'blog.test-como': BlogTestComo;
|
||||
'default.apple': DefaultApple;
|
||||
'default.car': DefaultCar;
|
||||
'default.closingperiod': DefaultClosingperiod;
|
||||
'default.dish': DefaultDish;
|
||||
'default.openingtimes': DefaultOpeningtimes;
|
||||
'default.restaurantservice': DefaultRestaurantservice;
|
||||
'default.temp': DefaultTemp;
|
||||
}
|
||||
}
|
||||
}
|
||||
1311
examples/getstarted/types/generated/contentTypes.d.ts
vendored
Normal file
1311
examples/getstarted/types/generated/contentTypes.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,14 @@ const withDefaultPagination = (params: Params) => {
|
||||
};
|
||||
};
|
||||
|
||||
const withOffsetLimit = (params: Params) => {
|
||||
type ParamsWithLimits = Omit<Params, 'page' | 'pageSize'> & {
|
||||
limit: number;
|
||||
offset: number;
|
||||
};
|
||||
|
||||
const withOffsetLimit = (
|
||||
params: Params
|
||||
): [ParamsWithLimits, { page: number; pageSize: number }] => {
|
||||
const { page, pageSize, ...rest } = withDefaultPagination(params);
|
||||
|
||||
const offset = Math.max(page - 1, 0) * pageSize;
|
||||
@ -31,7 +38,7 @@ const withOffsetLimit = (params: Params) => {
|
||||
offset,
|
||||
};
|
||||
|
||||
return [query, { page, pageSize }] as const;
|
||||
return [query, { page, pageSize }];
|
||||
};
|
||||
|
||||
export const createRepository = (uid: string, db: Database) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import dateFns from 'date-fns';
|
||||
import * as dateFns from 'date-fns';
|
||||
|
||||
import { parseDateTimeOrTimestamp } from './shared/parsers';
|
||||
import Field from './field';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import dateFns from 'date-fns';
|
||||
import * as dateFns from 'date-fns';
|
||||
|
||||
import { parseDateTimeOrTimestamp } from './shared/parsers';
|
||||
import Field from './field';
|
||||
|
||||
@ -99,7 +99,7 @@ export const createMetadata = (models: Model[] = []): Metadata => {
|
||||
return Object.assign(acc, { [attribute.columnName || key]: key });
|
||||
}
|
||||
|
||||
return acc;
|
||||
return Object.assign(acc, { [key]: key });
|
||||
}, {});
|
||||
|
||||
meta.columnToAttribute = columnToAttribute;
|
||||
|
||||
1
packages/core/database/src/old.index.d.ts
vendored
1
packages/core/database/src/old.index.d.ts
vendored
@ -2,6 +2,7 @@ import { Knex } from 'knex';
|
||||
import { LifecycleProvider } from './lifecycles';
|
||||
import { MigrationProvider } from './migrations';
|
||||
import { SchemaProvider } from './schema';
|
||||
|
||||
export * as errors from './errors';
|
||||
|
||||
type ID = number | string;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user