@simtlix/simfinity-js 2.4.1 → 2.4.4
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/.cursor/rules/simfinity-architecture.mdc +71 -0
- package/.cursor/rules/simfinity-auth-module.mdc +100 -0
- package/.cursor/rules/simfinity-coding-standards.mdc +62 -0
- package/.cursor/rules/simfinity-core-functions.mdc +82 -0
- package/.cursor/rules/simfinity-documentation.mdc +59 -0
- package/.cursor/rules/simfinity-extensions.mdc +121 -0
- package/.cursor/rules/simfinity-testing.mdc +90 -0
- package/README.md +1428 -1446
- package/package.json +1 -1
- package/src/auth/index.js +6 -6
- package/src/index.js +5 -1
package/package.json
CHANGED
package/src/auth/index.js
CHANGED
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
*
|
|
17
17
|
* const permissions = {
|
|
18
18
|
* Query: {
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* series: requireAuth(),
|
|
20
|
+
* seasons: requireAuth(),
|
|
21
21
|
* },
|
|
22
22
|
* Mutation: {
|
|
23
|
-
*
|
|
23
|
+
* deleteserie: requireRole('admin'),
|
|
24
|
+
* deletestar: requireRole('admin'),
|
|
24
25
|
* },
|
|
25
|
-
*
|
|
26
|
+
* serie: {
|
|
26
27
|
* '*': requireAuth(),
|
|
27
|
-
* email: requireRole('ADMIN')
|
|
28
28
|
* }
|
|
29
29
|
* };
|
|
30
30
|
*
|
|
31
|
-
* const authPlugin = createAuthPlugin(permissions, { defaultPolicy: '
|
|
31
|
+
* const authPlugin = createAuthPlugin(permissions, { defaultPolicy: 'ALLOW' });
|
|
32
32
|
* const yoga = createYoga({ schema, plugins: [authPlugin] });
|
|
33
33
|
*/
|
|
34
34
|
|
package/src/index.js
CHANGED
|
@@ -63,6 +63,7 @@ const FieldExtensionsType = new GraphQLObjectType({
|
|
|
63
63
|
fields: () => ({
|
|
64
64
|
relation: { type: RelationType },
|
|
65
65
|
stateMachine: { type: GraphQLBoolean },
|
|
66
|
+
readOnly: { type: GraphQLBoolean },
|
|
66
67
|
}),
|
|
67
68
|
});
|
|
68
69
|
|
|
@@ -679,7 +680,10 @@ const onUpdateSubject = async (Model, gqltype, controller, args, session, linkTo
|
|
|
679
680
|
|
|
680
681
|
if (args[fieldEntryName] === null
|
|
681
682
|
&& !(fieldEntry.type instanceof GraphQLNonNull)) {
|
|
682
|
-
materializedModel.modelArgs = {
|
|
683
|
+
materializedModel.modelArgs = {
|
|
684
|
+
...materializedModel.modelArgs,
|
|
685
|
+
$unset: { ...materializedModel.modelArgs.$unset, [fieldEntryName]: '' },
|
|
686
|
+
};
|
|
683
687
|
}
|
|
684
688
|
});
|
|
685
689
|
|