Update manifest structure (#17547)

Move all sync entities in an `entities` key. Rename functions to
logicFunctions

```json
{
  application: {
    ...
  },
  entities: {
    objects: [],
    logicFunctions: [],
    ...
  }
}
```
This commit is contained in:
martmull
2026-01-30 16:26:45 +01:00
committed by GitHub
parent bc022f82cb
commit f46da3eefd
162 changed files with 2555 additions and 3778 deletions
@@ -1,24 +0,0 @@
import {
type PackageJson,
type Application,
type ObjectManifest,
type LogicFunctionManifest,
} from '@/application';
import { type AssetManifest } from '@/application/assetManifestType';
import { type FrontComponentManifest } from '@/application/frontComponentManifestType';
import { type ObjectExtensionManifest } from '@/application/objectExtensionManifestType';
import { type RoleManifest } from '@/application/roleManifestType';
import { type Sources } from '@/types';
export type ApplicationManifest = {
application: Application;
objects: ObjectManifest[];
objectExtensions?: ObjectExtensionManifest[];
functions: LogicFunctionManifest[];
frontComponents: FrontComponentManifest[];
roles?: RoleManifest[];
publicAssets?: AssetManifest[];
sources: Sources;
packageJson: PackageJson;
yarnLock: string;
};
@@ -1,8 +1,8 @@
import { type ApplicationVariables } from '@/application';
import { type ApplicationVariables } from '@/sdk';
import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsType';
export type Application = SyncableEntityOptions & {
functionRoleUniversalIdentifier: string;
export type ApplicationManifest = SyncableEntityOptions & {
defaultRoleUniversalIdentifier: string;
displayName?: string;
description?: string;
icon?: string;
@@ -1,8 +1,7 @@
export enum SyncableEntity {
Object = 'object',
ObjectExtension = 'objectExtension',
Function = 'function',
Field = 'field',
LogicFunction = 'logicFunction',
FrontComponent = 'frontComponent',
Role = 'role',
PublicAsset = 'publicAsset',
}
@@ -5,8 +5,10 @@ import {
type FieldMetadataDefaultValue,
} from '@/types';
import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsType';
import { type RelationOnDeleteAction } from '@/types/RelationOnDeleteAction.type';
import { type RelationType } from '@/types/RelationType';
export type FieldManifest<
export type RegularFieldManifest<
T extends FieldMetadataType = Exclude<
FieldMetadataType,
FieldMetadataType.RELATION
@@ -21,4 +23,21 @@ export type FieldManifest<
options?: FieldMetadataOptions<T>;
settings?: FieldMetadataSettings<T>;
isNullable?: boolean;
objectUniversalIdentifier: string;
};
export type RelationFieldManifest =
RegularFieldManifest<FieldMetadataType.RELATION> & {
relationType: RelationType;
targetObjectUniversalIdentifier: string;
targetFieldLabel: string;
targetFieldIcon?: string;
onDelete?: RelationOnDeleteAction;
};
export type FieldManifest<
T extends FieldMetadataType = Exclude<
FieldMetadataType,
FieldMetadataType.RELATION
>,
> = RegularFieldManifest<T> | RelationFieldManifest;
@@ -7,8 +7,7 @@
* |___/
*/
export type { ApplicationManifest } from './applicationManifestType';
export type { Application } from './applicationType';
export type { ApplicationManifest } from './applicationType';
export type { ApplicationVariables } from './applicationVariablesType';
export type { AssetManifest } from './assetManifestType';
export { ASSETS_DIR } from './constants/AssetDirectory';
@@ -17,7 +16,11 @@ export { DEFAULT_API_URL_NAME } from './constants/DefaultApiUrlName';
export { GENERATED_DIR } from './constants/GeneratedDirectory';
export { OUTPUT_DIR } from './constants/OutputDirectory';
export { SyncableEntity } from './enums/syncable-entities.enum';
export type { FieldManifest } from './fieldManifestType';
export type {
RegularFieldManifest,
RelationFieldManifest,
FieldManifest,
} from './fieldManifestType';
export type { FrontComponentManifest } from './frontComponentManifestType';
export type {
InputJsonSchema,
@@ -27,9 +30,9 @@ export type {
RouteTrigger,
LogicFunctionTriggerManifest,
} from './logicFunctionManifestType';
export type { ObjectExtensionManifest } from './objectExtensionManifestType';
export type { Manifest } from './manifestType';
export type { ObjectFieldManifest } from './objectFieldManifest.type';
export type { ObjectManifest } from './objectManifestType';
export type { PackageJson } from './packageJsonType';
export type { RelationFieldManifest } from './relationFieldManifestType';
export type { RoleManifest } from './roleManifestType';
export type { SyncableEntityOptions } from './syncableEntityOptionsType';
@@ -0,0 +1,24 @@
import {
type PackageJson,
type ApplicationManifest,
type ObjectManifest,
type LogicFunctionManifest,
type AssetManifest,
type FrontComponentManifest,
type RoleManifest,
type FieldManifest,
} from '@/sdk';
import { type Sources } from '@/types';
export type Manifest = {
application: ApplicationManifest;
objects: ObjectManifest[];
fields: FieldManifest[];
logicFunctions: LogicFunctionManifest[];
frontComponents: FrontComponentManifest[];
roles: RoleManifest[];
publicAssets: AssetManifest[];
sources: Sources;
packageJson: PackageJson;
yarnLock: string;
};
@@ -1,17 +0,0 @@
import { type FieldManifest } from '@/application/fieldManifestType';
import { type RelationFieldManifest } from '@/application/relationFieldManifestType';
type TargetObjectByNameSingular = {
nameSingular: string;
universalIdentifier?: never;
};
type TargetObjectByUniversalIdentifier = {
nameSingular?: never;
universalIdentifier: string;
};
export type ObjectExtensionManifest = {
targetObject: TargetObjectByNameSingular | TargetObjectByUniversalIdentifier;
fields: (FieldManifest | RelationFieldManifest)[];
};
@@ -0,0 +1,9 @@
import { type FieldManifest } from '@/application/fieldManifestType';
import type { FieldMetadataType } from '@/types';
export type ObjectFieldManifest<
T extends FieldMetadataType = Exclude<
FieldMetadataType,
FieldMetadataType.RELATION
>,
> = Omit<FieldManifest<T>, 'objectUniversalIdentifier'>;
@@ -1,6 +1,5 @@
import { type FieldManifest } from '@/application';
import { type RelationFieldManifest } from '@/application/relationFieldManifestType';
import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsType';
import { type ObjectFieldManifest } from '@/application/objectFieldManifest.type';
export type ObjectManifest = SyncableEntityOptions & {
nameSingular: string;
@@ -9,5 +8,5 @@ export type ObjectManifest = SyncableEntityOptions & {
labelPlural: string;
description?: string;
icon?: string;
fields: (FieldManifest | RelationFieldManifest)[];
fields: ObjectFieldManifest[];
};
@@ -1,13 +0,0 @@
import { type FieldManifest } from '@/application/fieldManifestType';
import { type FieldMetadataType } from '@/types';
import { type RelationOnDeleteAction } from '@/types/RelationOnDeleteAction.type';
import { type RelationType } from '@/types/RelationType';
export type RelationFieldManifest =
FieldManifest<FieldMetadataType.RELATION> & {
relationType: RelationType;
targetObjectUniversalIdentifier: string;
targetFieldLabel: string;
targetFieldIcon?: string;
onDelete?: RelationOnDeleteAction;
};
@@ -1,48 +1,21 @@
import { type PermissionFlagType } from '@/constants';
import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsType';
type WithObjectIdentifier = {
type ObjectPermission = {
objectUniversalIdentifier: string;
objectNameSingular?: never;
};
type WithObjectName = {
objectNameSingular: string;
objectUniversalIdentifier?: never;
};
type BaseObjectPermission = {
canReadObjectRecords?: boolean;
canUpdateObjectRecords?: boolean;
canSoftDeleteObjectRecords?: boolean;
canDestroyObjectRecords?: boolean;
};
type ObjectPermission =
| (BaseObjectPermission & WithObjectIdentifier)
| (BaseObjectPermission & WithObjectName);
type WithFieldIdentifier = {
type FieldPermission = {
objectUniversalIdentifier: string;
fieldUniversalIdentifier: string;
fieldName?: never;
};
type WithFieldName = {
fieldName: string;
fieldUniversalIdentifier?: never;
};
type BaseFieldPermission = {
canReadFieldValue?: boolean;
canUpdateFieldValue?: boolean;
};
type FieldPermission =
| (BaseFieldPermission & WithObjectIdentifier & WithFieldIdentifier)
| (BaseFieldPermission & WithObjectIdentifier & WithFieldName)
| (BaseFieldPermission & WithObjectName & WithFieldIdentifier)
| (BaseFieldPermission & WithObjectName & WithFieldName);
export type RoleManifest = SyncableEntityOptions & {
label: string;
description?: string;