@grantjs/schema 1.5.4 → 1.7.0

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/package.json CHANGED
@@ -1,6 +1,16 @@
1
1
  {
2
2
  "name": "@grantjs/schema",
3
- "version": "1.5.4",
3
+ "version": "1.7.0",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/grant-js/grant.git",
8
+ "directory": "packages/@grantjs/schema"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public",
12
+ "registry": "https://registry.npmjs.org/"
13
+ },
4
14
  "description": "GraphQL schema and generated types for Grant",
5
15
  "main": "src/index.ts",
6
16
  "types": "src/index.ts",
@@ -13,16 +23,17 @@
13
23
  },
14
24
  "devDependencies": {
15
25
  "@graphql-codegen/add": "^7.1.0",
16
- "@graphql-codegen/cli": "^7.2.0",
26
+ "@graphql-codegen/cli": "^7.4.0",
17
27
  "@graphql-codegen/typed-document-node": "^7.1.0",
18
28
  "@graphql-codegen/typescript": "^6.1.0",
19
29
  "@graphql-codegen/typescript-operations": "^6.1.6",
20
30
  "@graphql-codegen/typescript-resolvers": "^6.1.0",
21
31
  "@parcel/watcher": "^2.6.0",
22
- "@types/node": "^26.2.0",
23
- "eslint": "^10.8.1",
32
+ "@types/node": "^26.4.1",
33
+ "eslint": "^10.10.0",
24
34
  "graphql": "^16.14.2",
25
- "typescript": "^6.0.3",
35
+ "@typescript/native": "npm:typescript@^7.0.2",
36
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
26
37
  "vitest": "^4.1.11"
27
38
  },
28
39
  "scripts": {
@@ -935,7 +935,14 @@ export type CreateOrganizationMutationVariables = Exact<{
935
935
  }>;
936
936
 
937
937
  export type CreateOrganizationMutation = {
938
- createOrganization: { id: string; name: string; slug: string; createdAt: Date; updatedAt: Date };
938
+ createOrganization: {
939
+ id: string;
940
+ name: string;
941
+ slug: string;
942
+ pictureUrl: string | null;
943
+ createdAt: Date;
944
+ updatedAt: Date;
945
+ };
939
946
  };
940
947
 
941
948
  export type DeleteOrganizationMutationVariables = Exact<{
@@ -944,7 +951,14 @@ export type DeleteOrganizationMutationVariables = Exact<{
944
951
  }>;
945
952
 
946
953
  export type DeleteOrganizationMutation = {
947
- deleteOrganization: { id: string; name: string; slug: string; createdAt: Date; updatedAt: Date };
954
+ deleteOrganization: {
955
+ id: string;
956
+ name: string;
957
+ slug: string;
958
+ pictureUrl: string | null;
959
+ createdAt: Date;
960
+ updatedAt: Date;
961
+ };
948
962
  };
949
963
 
950
964
  export type GetOrganizationsQueryVariables = Exact<{
@@ -964,6 +978,7 @@ export type GetOrganizationsQuery = {
964
978
  id: string;
965
979
  name: string;
966
980
  slug: string;
981
+ pictureUrl: string | null;
967
982
  requireMfaForSensitiveActions: boolean;
968
983
  createdAt: Date;
969
984
  updatedAt: Date;
@@ -982,12 +997,21 @@ export type UpdateOrganizationMutation = {
982
997
  id: string;
983
998
  name: string;
984
999
  slug: string;
1000
+ pictureUrl: string | null;
985
1001
  requireMfaForSensitiveActions: boolean;
986
1002
  createdAt: Date;
987
1003
  updatedAt: Date;
988
1004
  };
989
1005
  };
990
1006
 
1007
+ export type UploadOrganizationPictureMutationVariables = Exact<{
1008
+ input: Types.UploadOrganizationPictureInput;
1009
+ }>;
1010
+
1011
+ export type UploadOrganizationPictureMutation = {
1012
+ uploadOrganizationPicture: { url: string; path: string };
1013
+ };
1014
+
991
1015
  export type CreatePermissionMutationVariables = Exact<{
992
1016
  input: Types.CreatePermissionInput;
993
1017
  }>;
@@ -5670,6 +5694,7 @@ export const CreateOrganizationDocument = {
5670
5694
  { kind: 'Field', name: { kind: 'Name', value: 'id' } },
5671
5695
  { kind: 'Field', name: { kind: 'Name', value: 'name' } },
5672
5696
  { kind: 'Field', name: { kind: 'Name', value: 'slug' } },
5697
+ { kind: 'Field', name: { kind: 'Name', value: 'pictureUrl' } },
5673
5698
  { kind: 'Field', name: { kind: 'Name', value: 'createdAt' } },
5674
5699
  { kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },
5675
5700
  ],
@@ -5729,6 +5754,7 @@ export const DeleteOrganizationDocument = {
5729
5754
  { kind: 'Field', name: { kind: 'Name', value: 'id' } },
5730
5755
  { kind: 'Field', name: { kind: 'Name', value: 'name' } },
5731
5756
  { kind: 'Field', name: { kind: 'Name', value: 'slug' } },
5757
+ { kind: 'Field', name: { kind: 'Name', value: 'pictureUrl' } },
5732
5758
  { kind: 'Field', name: { kind: 'Name', value: 'createdAt' } },
5733
5759
  { kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },
5734
5760
  ],
@@ -5837,6 +5863,7 @@ export const GetOrganizationsDocument = {
5837
5863
  { kind: 'Field', name: { kind: 'Name', value: 'id' } },
5838
5864
  { kind: 'Field', name: { kind: 'Name', value: 'name' } },
5839
5865
  { kind: 'Field', name: { kind: 'Name', value: 'slug' } },
5866
+ { kind: 'Field', name: { kind: 'Name', value: 'pictureUrl' } },
5840
5867
  {
5841
5868
  kind: 'Field',
5842
5869
  name: { kind: 'Name', value: 'requireMfaForSensitiveActions' },
@@ -5918,6 +5945,7 @@ export const UpdateOrganizationDocument = {
5918
5945
  { kind: 'Field', name: { kind: 'Name', value: 'id' } },
5919
5946
  { kind: 'Field', name: { kind: 'Name', value: 'name' } },
5920
5947
  { kind: 'Field', name: { kind: 'Name', value: 'slug' } },
5948
+ { kind: 'Field', name: { kind: 'Name', value: 'pictureUrl' } },
5921
5949
  { kind: 'Field', name: { kind: 'Name', value: 'requireMfaForSensitiveActions' } },
5922
5950
  { kind: 'Field', name: { kind: 'Name', value: 'createdAt' } },
5923
5951
  { kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },
@@ -5929,6 +5957,55 @@ export const UpdateOrganizationDocument = {
5929
5957
  },
5930
5958
  ],
5931
5959
  } as unknown as DocumentNode<UpdateOrganizationMutation, UpdateOrganizationMutationVariables>;
5960
+ export const UploadOrganizationPictureDocument = {
5961
+ kind: 'Document',
5962
+ definitions: [
5963
+ {
5964
+ kind: 'OperationDefinition',
5965
+ operation: 'mutation',
5966
+ name: { kind: 'Name', value: 'UploadOrganizationPicture' },
5967
+ variableDefinitions: [
5968
+ {
5969
+ kind: 'VariableDefinition',
5970
+ variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
5971
+ type: {
5972
+ kind: 'NonNullType',
5973
+ type: {
5974
+ kind: 'NamedType',
5975
+ name: { kind: 'Name', value: 'UploadOrganizationPictureInput' },
5976
+ },
5977
+ },
5978
+ },
5979
+ ],
5980
+ selectionSet: {
5981
+ kind: 'SelectionSet',
5982
+ selections: [
5983
+ {
5984
+ kind: 'Field',
5985
+ name: { kind: 'Name', value: 'uploadOrganizationPicture' },
5986
+ arguments: [
5987
+ {
5988
+ kind: 'Argument',
5989
+ name: { kind: 'Name', value: 'input' },
5990
+ value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
5991
+ },
5992
+ ],
5993
+ selectionSet: {
5994
+ kind: 'SelectionSet',
5995
+ selections: [
5996
+ { kind: 'Field', name: { kind: 'Name', value: 'url' } },
5997
+ { kind: 'Field', name: { kind: 'Name', value: 'path' } },
5998
+ ],
5999
+ },
6000
+ },
6001
+ ],
6002
+ },
6003
+ },
6004
+ ],
6005
+ } as unknown as DocumentNode<
6006
+ UploadOrganizationPictureMutation,
6007
+ UploadOrganizationPictureMutationVariables
6008
+ >;
5932
6009
  export const CreatePermissionDocument = {
5933
6010
  kind: 'Document',
5934
6011
  definitions: [
@@ -521,6 +521,8 @@ export type ResolversTypes = ResolversObject<{
521
521
  UpdateWebhookSubscriptionMutationInput: Types.UpdateWebhookSubscriptionMutationInput;
522
522
  UploadMyProjectMembershipPictureInput: Types.UploadMyProjectMembershipPictureInput;
523
523
  UploadMyUserPictureInput: Types.UploadMyUserPictureInput;
524
+ UploadOrganizationPictureInput: Types.UploadOrganizationPictureInput;
525
+ UploadOrganizationPictureResult: ResolverTypeWrapper<Types.UploadOrganizationPictureResult>;
524
526
  UploadUserPictureInput: Types.UploadUserPictureInput;
525
527
  UploadUserPictureResult: ResolverTypeWrapper<Types.UploadUserPictureResult>;
526
528
  User: ResolverTypeWrapper<Types.User>;
@@ -867,6 +869,8 @@ export type ResolversParentTypes = ResolversObject<{
867
869
  UpdateWebhookSubscriptionMutationInput: Types.UpdateWebhookSubscriptionMutationInput;
868
870
  UploadMyProjectMembershipPictureInput: Types.UploadMyProjectMembershipPictureInput;
869
871
  UploadMyUserPictureInput: Types.UploadMyUserPictureInput;
872
+ UploadOrganizationPictureInput: Types.UploadOrganizationPictureInput;
873
+ UploadOrganizationPictureResult: Types.UploadOrganizationPictureResult;
870
874
  UploadUserPictureInput: Types.UploadUserPictureInput;
871
875
  UploadUserPictureResult: Types.UploadUserPictureResult;
872
876
  User: Types.User;
@@ -1878,6 +1882,12 @@ export type MutationResolvers<
1878
1882
  ContextType,
1879
1883
  RequireFields<Types.MutationUploadMyUserPictureArgs, 'input'>
1880
1884
  >;
1885
+ uploadOrganizationPicture?: Resolver<
1886
+ ResolversTypes['UploadOrganizationPictureResult'],
1887
+ ParentType,
1888
+ ContextType,
1889
+ RequireFields<Types.MutationUploadOrganizationPictureArgs, 'input'>
1890
+ >;
1881
1891
  uploadUserPicture?: Resolver<
1882
1892
  ResolversTypes['UploadUserPictureResult'],
1883
1893
  ParentType,
@@ -1991,6 +2001,7 @@ export type OrganizationResolvers<
1991
2001
  id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
1992
2002
  name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
1993
2003
  permissions?: Resolver<Types.Maybe<Array<ResolversTypes['Permission']>>, ParentType, ContextType>;
2004
+ pictureUrl?: Resolver<Types.Maybe<ResolversTypes['String']>, ParentType, ContextType>;
1994
2005
  projects?: Resolver<Types.Maybe<Array<ResolversTypes['Project']>>, ParentType, ContextType>;
1995
2006
  requireMfaForSensitiveActions?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
1996
2007
  roles?: Resolver<Types.Maybe<Array<ResolversTypes['Role']>>, ParentType, ContextType>;
@@ -3108,6 +3119,15 @@ export type UnreadNotificationCountResolvers<
3108
3119
  unreadCount?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
3109
3120
  }>;
3110
3121
 
3122
+ export type UploadOrganizationPictureResultResolvers<
3123
+ ContextType = any,
3124
+ ParentType extends ResolversParentTypes['UploadOrganizationPictureResult'] =
3125
+ ResolversParentTypes['UploadOrganizationPictureResult'],
3126
+ > = ResolversObject<{
3127
+ path?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
3128
+ url?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
3129
+ }>;
3130
+
3111
3131
  export type UploadUserPictureResultResolvers<
3112
3132
  ContextType = any,
3113
3133
  ParentType extends ResolversParentTypes['UploadUserPictureResult'] =
@@ -3528,6 +3548,7 @@ export type Resolvers<ContextType = any> = ResolversObject<{
3528
3548
  Tag?: TagResolvers<ContextType>;
3529
3549
  TagPage?: TagPageResolvers<ContextType>;
3530
3550
  UnreadNotificationCount?: UnreadNotificationCountResolvers<ContextType>;
3551
+ UploadOrganizationPictureResult?: UploadOrganizationPictureResultResolvers<ContextType>;
3531
3552
  UploadUserPictureResult?: UploadUserPictureResultResolvers<ContextType>;
3532
3553
  User?: UserResolvers<ContextType>;
3533
3554
  UserAuthenticationMethod?: UserAuthenticationMethodResolvers<ContextType>;
@@ -1086,6 +1086,8 @@ export type Mutation = {
1086
1086
  updateWebhookSubscription: WebhookSubscription;
1087
1087
  uploadMyProjectMembershipPicture: UploadUserPictureResult;
1088
1088
  uploadMyUserPicture: UploadUserPictureResult;
1089
+ /** Upload an organization logo and persist its public URL. */
1090
+ uploadOrganizationPicture: UploadOrganizationPictureResult;
1089
1091
  uploadUserPicture: UploadUserPictureResult;
1090
1092
  verifyEmail: VerifyEmailResponse;
1091
1093
  verifyMfa: MfaVerifyResponse;
@@ -1411,6 +1413,10 @@ export type MutationUploadMyUserPictureArgs = {
1411
1413
  input: UploadMyUserPictureInput;
1412
1414
  };
1413
1415
 
1416
+ export type MutationUploadOrganizationPictureArgs = {
1417
+ input: UploadOrganizationPictureInput;
1418
+ };
1419
+
1414
1420
  export type MutationUploadUserPictureArgs = {
1415
1421
  input: UploadUserPictureInput;
1416
1422
  };
@@ -1526,6 +1532,7 @@ export type Organization = Auditable & {
1526
1532
  id: Scalars['ID']['output'];
1527
1533
  name: Scalars['String']['output'];
1528
1534
  permissions?: Maybe<Array<Permission>>;
1535
+ pictureUrl?: Maybe<Scalars['String']['output']>;
1529
1536
  projects?: Maybe<Array<Project>>;
1530
1537
  requireMfaForSensitiveActions: Scalars['Boolean']['output'];
1531
1538
  roles?: Maybe<Array<Role>>;
@@ -3436,6 +3443,20 @@ export type UploadMyUserPictureInput = {
3436
3443
  filename: Scalars['String']['input'];
3437
3444
  };
3438
3445
 
3446
+ export type UploadOrganizationPictureInput = {
3447
+ contentType: Scalars['String']['input'];
3448
+ file: Scalars['String']['input'];
3449
+ filename: Scalars['String']['input'];
3450
+ organizationId: Scalars['ID']['input'];
3451
+ scope: Scope;
3452
+ };
3453
+
3454
+ export type UploadOrganizationPictureResult = {
3455
+ __typename?: 'UploadOrganizationPictureResult';
3456
+ path: Scalars['String']['output'];
3457
+ url: Scalars['String']['output'];
3458
+ };
3459
+
3439
3460
  export type UploadUserPictureInput = {
3440
3461
  contentType: Scalars['String']['input'];
3441
3462
  file: Scalars['String']['input'];
@@ -3,6 +3,7 @@ mutation CreateOrganization($input: CreateOrganizationInput!) {
3
3
  id
4
4
  name
5
5
  slug
6
+ pictureUrl
6
7
  createdAt
7
8
  updatedAt
8
9
  }
@@ -3,6 +3,7 @@ mutation DeleteOrganization($id: ID!, $scope: Scope!) {
3
3
  id
4
4
  name
5
5
  slug
6
+ pictureUrl
6
7
  createdAt
7
8
  updatedAt
8
9
  }
@@ -18,6 +18,7 @@ query GetOrganizations(
18
18
  id
19
19
  name
20
20
  slug
21
+ pictureUrl
21
22
  requireMfaForSensitiveActions
22
23
  createdAt
23
24
  updatedAt
@@ -3,6 +3,7 @@ mutation UpdateOrganization($id: ID!, $input: UpdateOrganizationInput!) {
3
3
  id
4
4
  name
5
5
  slug
6
+ pictureUrl
6
7
  requireMfaForSensitiveActions
7
8
  createdAt
8
9
  updatedAt
@@ -0,0 +1,6 @@
1
+ mutation UploadOrganizationPicture($input: UploadOrganizationPictureInput!) {
2
+ uploadOrganizationPicture(input: $input) {
3
+ url
4
+ path
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ input UploadOrganizationPictureInput {
2
+ scope: Scope!
3
+ organizationId: ID!
4
+ file: String!
5
+ filename: String!
6
+ contentType: String!
7
+ }
@@ -0,0 +1,8 @@
1
+ extend type Mutation {
2
+ """
3
+ Upload an organization logo and persist its public URL.
4
+ """
5
+ uploadOrganizationPicture(
6
+ input: UploadOrganizationPictureInput!
7
+ ): UploadOrganizationPictureResult!
8
+ }
@@ -2,6 +2,7 @@ type Organization implements Auditable {
2
2
  id: ID!
3
3
  name: String!
4
4
  slug: String!
5
+ pictureUrl: String
5
6
  requireMfaForSensitiveActions: Boolean!
6
7
  projects: [Project!]
7
8
  roles: [Role!]
@@ -0,0 +1,4 @@
1
+ type UploadOrganizationPictureResult {
2
+ url: String!
3
+ path: String!
4
+ }
@@ -40,9 +40,9 @@ describe('operation documents', () => {
40
40
 
41
41
  // Pinned, not a floor: pass 5 slice 5 removed one file and two query operations
42
42
  // that were superseded by list queries, and a floor would have absorbed that
43
- // silently. 116 before that slice.
43
+ // silently. 116 before that slice, 115 after, 116 with upload-organization-picture.
44
44
  it('finds every document under src/operations', () => {
45
- expect(files).toHaveLength(115);
45
+ expect(files).toHaveLength(116);
46
46
  });
47
47
 
48
48
  it.each(files.map((f) => [relative(process.cwd(), f), f]))('%s validates', (_label, file) => {