@firecms/core 3.0.0-alpha.30 → 3.0.0-alpha.31

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.
@@ -98,7 +98,7 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
98
98
  * Permissions the logged-in user can perform on this collection.
99
99
  * If not specified everything defaults to `true`.
100
100
  */
101
- permissions?: Permissions | PermissionsBuilder<any, UserType, M>;
101
+ permissions?: Permissions | PermissionsBuilder<EntityCollection, UserType, M>;
102
102
  /**
103
103
  * Are the entities in this collection selectable. Defaults to `true`
104
104
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
- "version": "3.0.0-alpha.30",
3
+ "version": "3.0.0-alpha.31",
4
4
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
5
5
  "funding": {
6
6
  "url": "https://github.com/sponsors/firecmsco"
@@ -133,7 +133,7 @@
133
133
  "dist",
134
134
  "src"
135
135
  ],
136
- "gitHead": "89854d00f9088e09134623a84be752990c6cbc32",
136
+ "gitHead": "50f21001373521c63e1eea47f551037eb9e4d0c9",
137
137
  "publishConfig": {
138
138
  "access": "public"
139
139
  }
@@ -11,7 +11,6 @@ export * from "./NavigationRoutes";
11
11
 
12
12
  export * from "./components";
13
13
 
14
- export * from "./builders";
15
14
  export * from "./util";
16
15
 
17
16
  export * from "./form_field_configs";
@@ -112,7 +112,7 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
112
112
  * Permissions the logged-in user can perform on this collection.
113
113
  * If not specified everything defaults to `true`.
114
114
  */
115
- permissions?: Permissions | PermissionsBuilder<any, UserType, M>;
115
+ permissions?: Permissions | PermissionsBuilder<EntityCollection, UserType, M>;
116
116
 
117
117
  /**
118
118
  * Are the entities in this collection selectable. Defaults to `true`
@@ -1,64 +0,0 @@
1
- import { AdditionalFieldDelegate, ArrayProperty, BooleanProperty, CMSType, DateProperty, EntityCallbacks, EntityCollection, EnumValueConfig, EnumValues, PropertyConfig, GeopointProperty, MapProperty, NumberProperty, PropertiesOrBuilders, PropertyBuilder, PropertyOrBuilder, ReferenceProperty, StringProperty, User } from "../types";
2
- /**
3
- * Identity function we use to defeat the type system of Typescript and build
4
- * collection views with all its properties
5
- * @param collection
6
- * @category Builder
7
- */
8
- export declare function buildCollection<M extends Record<string, any> = any, UserType extends User = User>(collection: EntityCollection<M, UserType>): EntityCollection<M, UserType>;
9
- /**
10
- * Identity function we use to defeat the type system of Typescript and preserve
11
- * the property keys.
12
- * @param property
13
- * @category Builder
14
- */
15
- export declare function buildProperty<T extends CMSType = CMSType, P extends PropertyOrBuilder<T> = PropertyOrBuilder<T>, M extends Record<string, any> = Record<string, any>>(property: P): P extends StringProperty ? StringProperty : P extends NumberProperty ? NumberProperty : P extends BooleanProperty ? BooleanProperty : P extends DateProperty ? DateProperty : P extends GeopointProperty ? GeopointProperty : P extends ReferenceProperty ? ReferenceProperty : P extends ArrayProperty ? ArrayProperty : P extends MapProperty ? MapProperty : P extends PropertyBuilder<T, M> ? PropertyBuilder<T, M> : never;
16
- /**
17
- * Identity function we use to defeat the type system of Typescript and preserve
18
- * the properties keys.
19
- * @param properties
20
- * @category Builder
21
- */
22
- export declare function buildProperties<M extends Record<string, any>>(properties: PropertiesOrBuilders<M>): PropertiesOrBuilders<M>;
23
- /**
24
- * Identity function we use to defeat the type system of Typescript and preserve
25
- * the properties keys.
26
- * @param propertiesOrBuilder
27
- * @category Builder
28
- */
29
- export declare function buildPropertiesOrBuilder<M extends Record<string, any>>(propertiesOrBuilder: PropertiesOrBuilders<M>): PropertiesOrBuilders<M>;
30
- /**
31
- * Identity function we use to defeat the type system of Typescript and preserve
32
- * the properties keys.
33
- * @param enumValues
34
- * @category Builder
35
- */
36
- export declare function buildEnumValues(enumValues: EnumValues): EnumValues;
37
- /**
38
- * Identity function we use to defeat the type system of Typescript and preserve
39
- * the properties keys.
40
- * @param enumValueConfig
41
- * @category Builder
42
- */
43
- export declare function buildEnumValueConfig(enumValueConfig: EnumValueConfig): EnumValueConfig;
44
- /**
45
- * Identity function we use to defeat the type system of Typescript and preserve
46
- * the properties keys.
47
- * @param callbacks
48
- * @category Builder
49
- */
50
- export declare function buildEntityCallbacks<M extends Record<string, any> = any>(callbacks: EntityCallbacks<M>): EntityCallbacks<M>;
51
- /**
52
- * Identity function we use to defeat the type system of Typescript and build
53
- * additional field delegates views with all its properties
54
- * @param additionalFieldDelegate
55
- * @category Builder
56
- */
57
- export declare function buildAdditionalFieldDelegate<M extends Record<string, any>, UserType extends User = User>(additionalFieldDelegate: AdditionalFieldDelegate<M, UserType>): AdditionalFieldDelegate<M, UserType>;
58
- /**
59
- * Identity function we use to defeat the type system of Typescript and build
60
- * additional field delegates views with all its properties
61
- * @param propertyConfig
62
- * @category Builder
63
- */
64
- export declare function buildFieldConfig<T extends CMSType = CMSType>(propertyConfig: PropertyConfig<T>): PropertyConfig<T>;
@@ -1,140 +0,0 @@
1
- import {
2
- AdditionalFieldDelegate,
3
- ArrayProperty,
4
- BooleanProperty,
5
- CMSType,
6
- DateProperty,
7
- EntityCallbacks,
8
- EntityCollection,
9
- EnumValueConfig,
10
- EnumValues,
11
- PropertyConfig,
12
- GeopointProperty,
13
- MapProperty,
14
- NumberProperty,
15
- PropertiesOrBuilders,
16
- PropertyBuilder,
17
- PropertyOrBuilder,
18
- ReferenceProperty,
19
- StringProperty,
20
- User
21
- } from "../types";
22
-
23
- /**
24
- * Identity function we use to defeat the type system of Typescript and build
25
- * collection views with all its properties
26
- * @param collection
27
- * @category Builder
28
- */
29
- export function buildCollection<M extends Record<string, any> = any,
30
-
31
- UserType extends User = User>(
32
- collection: EntityCollection<M, UserType>
33
- ): EntityCollection<M, UserType> {
34
- return collection;
35
- }
36
-
37
- /**
38
- * Identity function we use to defeat the type system of Typescript and preserve
39
- * the property keys.
40
- * @param property
41
- * @category Builder
42
- */
43
- export function buildProperty<T extends CMSType = CMSType, P extends PropertyOrBuilder<T> = PropertyOrBuilder<T>, M extends Record<string, any> = Record<string, any>>(
44
- property: P
45
- ):
46
- P extends StringProperty ? StringProperty :
47
- P extends NumberProperty ? NumberProperty :
48
- P extends BooleanProperty ? BooleanProperty :
49
- P extends DateProperty ? DateProperty :
50
- P extends GeopointProperty ? GeopointProperty :
51
- P extends ReferenceProperty ? ReferenceProperty :
52
- P extends ArrayProperty ? ArrayProperty :
53
- P extends MapProperty ? MapProperty :
54
- P extends PropertyBuilder<T, M> ? PropertyBuilder<T, M> : never {
55
- return property as any;
56
- }
57
-
58
- /**
59
- * Identity function we use to defeat the type system of Typescript and preserve
60
- * the properties keys.
61
- * @param properties
62
- * @category Builder
63
- */
64
- export function buildProperties<M extends Record<string, any>>(
65
- properties: PropertiesOrBuilders<M>
66
- ): PropertiesOrBuilders<M> {
67
- return properties;
68
- }
69
-
70
- /**
71
- * Identity function we use to defeat the type system of Typescript and preserve
72
- * the properties keys.
73
- * @param propertiesOrBuilder
74
- * @category Builder
75
- */
76
- export function buildPropertiesOrBuilder<M extends Record<string, any>>(
77
- propertiesOrBuilder: PropertiesOrBuilders<M>
78
- ): PropertiesOrBuilders<M> {
79
- return propertiesOrBuilder;
80
- }
81
-
82
- /**
83
- * Identity function we use to defeat the type system of Typescript and preserve
84
- * the properties keys.
85
- * @param enumValues
86
- * @category Builder
87
- */
88
- export function buildEnumValues(
89
- enumValues: EnumValues
90
- ): EnumValues {
91
- return enumValues;
92
- }
93
-
94
- /**
95
- * Identity function we use to defeat the type system of Typescript and preserve
96
- * the properties keys.
97
- * @param enumValueConfig
98
- * @category Builder
99
- */
100
- export function buildEnumValueConfig(
101
- enumValueConfig: EnumValueConfig
102
- ): EnumValueConfig {
103
- return enumValueConfig;
104
- }
105
-
106
- /**
107
- * Identity function we use to defeat the type system of Typescript and preserve
108
- * the properties keys.
109
- * @param callbacks
110
- * @category Builder
111
- */
112
- export function buildEntityCallbacks<M extends Record<string, any> = any>(
113
- callbacks: EntityCallbacks<M>
114
- ): EntityCallbacks<M> {
115
- return callbacks;
116
- }
117
-
118
- /**
119
- * Identity function we use to defeat the type system of Typescript and build
120
- * additional field delegates views with all its properties
121
- * @param additionalFieldDelegate
122
- * @category Builder
123
- */
124
- export function buildAdditionalFieldDelegate<M extends Record<string, any>, UserType extends User = User>(
125
- additionalFieldDelegate: AdditionalFieldDelegate<M, UserType>
126
- ): AdditionalFieldDelegate<M, UserType> {
127
- return additionalFieldDelegate;
128
- }
129
-
130
- /**
131
- * Identity function we use to defeat the type system of Typescript and build
132
- * additional field delegates views with all its properties
133
- * @param propertyConfig
134
- * @category Builder
135
- */
136
- export function buildFieldConfig<T extends CMSType = CMSType>(
137
- propertyConfig: PropertyConfig<T>
138
- ): PropertyConfig<T> {
139
- return propertyConfig;
140
- }