From 8979453f34440a47235a186e3542ecdde2bedfaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20Sj=C3=B6stedt?= Date: Fri, 22 Mar 2024 11:26:36 +0100 Subject: [PATCH 1/4] add decibel admin --- package-lock.json | 4 ++-- src/models/generated/graphql.ts | 1 + src/reducers/access.reducer.ts | 1 + src/schemas/access.graphql | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ab1980dc..dc790b90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ekorre-ts", - "version": "1.8.0", + "version": "1.7.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ekorre-ts", - "version": "1.8.0", + "version": "1.7.1", "license": "AGPL-3.0-only", "dependencies": { "@esek/auth-server": "5.0.2", diff --git a/src/models/generated/graphql.ts b/src/models/generated/graphql.ts index 51279a35..a9c75c34 100644 --- a/src/models/generated/graphql.ts +++ b/src/models/generated/graphql.ts @@ -143,6 +143,7 @@ export enum Feature { AccessAdmin = 'access_admin', AhsAdmin = 'ahs_admin', ArticleEditor = 'article_editor', + DecibelAdmin = 'decibel_admin', ElectionAdmin = 'election_admin', EmailAdmin = 'email_admin', FilesAdmin = 'files_admin', diff --git a/src/reducers/access.reducer.ts b/src/reducers/access.reducer.ts index 5c71dcb4..a98c3cec 100644 --- a/src/reducers/access.reducer.ts +++ b/src/reducers/access.reducer.ts @@ -60,6 +60,7 @@ const featureDescriptions: Record = { [Feature.FilesAdmin]: 'För att kunna administrera filer', [Feature.EmailAdmin]: 'För att kunna skicka mejl', [Feature.AhsAdmin]: 'För att kunna administrera AHS', + [Feature.DecibelAdmin]: 'För att kunna gå in på decibel', }; export const featureReducer = (features: Feature[]): FeatureInfo[] => { diff --git a/src/schemas/access.graphql b/src/schemas/access.graphql index 73217bfa..ee84886b 100644 --- a/src/schemas/access.graphql +++ b/src/schemas/access.graphql @@ -79,4 +79,5 @@ enum Feature { user_admin, email_admin, ahs_admin, + decibel_admin, } From 21c48fcf77b1444308c7f6a40a35bd412fcb53ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20Sj=C3=B6stedt?= Date: Fri, 22 Mar 2024 11:29:35 +0100 Subject: [PATCH 2/4] update changelog --- CHANGELOG.MD | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 2f6ea629..0fdef50d 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -5,6 +5,10 @@ Alla märkbara ändringar ska dokumenteras i denna fil. Baserat på [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), och följer [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.9.0] - 2024-03-22 +### Tillagt +- adds decibel_admin feature + ## [1.8.0] - 2024-01-31 ### Tillagt From ee431d3fa3296c8015ef92ce45cd369eb208344b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20Sj=C3=B6stedt?= Date: Fri, 22 Mar 2024 11:30:23 +0100 Subject: [PATCH 3/4] format --- src/models/generated/graphql.ts | 901 ++++++++++++++++++++++++-------- 1 file changed, 674 insertions(+), 227 deletions(-) diff --git a/src/models/generated/graphql.ts b/src/models/generated/graphql.ts index a9c75c34..794a641d 100644 --- a/src/models/generated/graphql.ts +++ b/src/models/generated/graphql.ts @@ -1,6 +1,17 @@ import type { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; -import type { ArticleResponse, FileResponse, MeetingResponse, ElectionResponse, ProposalResponse, NominationResponse, HeheResponse, ApiKeyResponse } from '../mappers'; + import type { Context } from '../context'; +import type { + ArticleResponse, + FileResponse, + MeetingResponse, + ElectionResponse, + ProposalResponse, + NominationResponse, + HeheResponse, + ApiKeyResponse, +} from '../mappers'; + export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; @@ -32,13 +43,13 @@ export type AccessInput = { export enum AccessResourceType { Door = 'door', - Feature = 'feature' + Feature = 'feature', } export enum AccessType { Admin = 'ADMIN', Authenticated = 'AUTHENTICATED', - Public = 'PUBLIC' + Public = 'PUBLIC', } export type ApiKey = { @@ -65,7 +76,6 @@ export type Article = { title: Scalars['String']; }; - /** Body is saved as HTML serversInte, but edited in MarkDown */ export type ArticleTagsArgs = { includeSpecial?: InputMaybe; @@ -74,7 +84,7 @@ export type ArticleTagsArgs = { /** News are the ones to be used by a website newsreel */ export enum ArticleType { Information = 'INFORMATION', - News = 'NEWS' + News = 'NEWS', } export type CasLoginResponse = { @@ -98,7 +108,7 @@ export enum Door { Pa = 'pa', Pump = 'pump', Sikrit = 'sikrit', - Ulla = 'ulla' + Ulla = 'ulla', } export type DoorInfo = { @@ -135,7 +145,7 @@ export enum EmergencyContactType { Mom = 'MOM', Other = 'OTHER', SignificantOther = 'SIGNIFICANT_OTHER', - Sister = 'SISTER' + Sister = 'SISTER', } /** Features are used for mapping access to a feature (ex article or election) for user or a post. This is not limited to efterphest */ @@ -152,7 +162,7 @@ export enum Feature { NewsEditor = 'news_editor', PostAdmin = 'post_admin', Superadmin = 'superadmin', - UserAdmin = 'user_admin' + UserAdmin = 'user_admin', } export type FeatureInfo = { @@ -190,7 +200,7 @@ export enum FileType { Pdf = 'PDF', Powerpoint = 'POWERPOINT', Spreadsheet = 'SPREADSHEET', - Text = 'TEXT' + Text = 'TEXT', } export type GroupedPost = { @@ -258,7 +268,7 @@ export enum MeetingDocumentType { LateDocuments = 'lateDocuments', Protocol = 'protocol', /** Kallelse */ - Summons = 'summons' + Summons = 'summons', } export enum MeetingType { @@ -277,7 +287,7 @@ export enum MeetingType { /** Valmöte */ Vm = 'VM', /** Vårterminsmöte */ - Vtm = 'VTM' + Vtm = 'VTM', } /** We don't need every part; It should already exist */ @@ -367,56 +377,47 @@ export type Mutation = { validateToken: Scalars['Boolean']; }; - export type MutationActivatePostArgs = { id: Scalars['Int']; }; - export type MutationAddArticleArgs = { entry: NewArticle; }; - export type MutationAddElectablesArgs = { electionId: Scalars['Int']; postIds: Array; }; - export type MutationAddEmergencyContactArgs = { name: Scalars['String']; phone: Scalars['String']; type: EmergencyContactType; }; - export type MutationAddFileToMeetingArgs = { fileId: Scalars['String']; fileType: MeetingDocumentType; meetingId: Scalars['Int']; }; - export type MutationAddHeheArgs = { fileId: Scalars['ID']; number: Scalars['Int']; year: Scalars['Int']; }; - export type MutationAddMeetingArgs = { number?: InputMaybe; type: MeetingType; year?: InputMaybe; }; - export type MutationAddPostArgs = { info: NewPost; }; - export type MutationAddUsersToPostArgs = { end?: InputMaybe; id: Scalars['Int']; @@ -424,243 +425,200 @@ export type MutationAddUsersToPostArgs = { usernames: Array; }; - export type MutationCasCreateUserArgs = { hash: Scalars['String']; input: NewUser; }; - export type MutationCasLoginArgs = { token: Scalars['String']; }; - export type MutationChangePasswordArgs = { newPassword: Scalars['String']; oldPassword: Scalars['String']; }; - export type MutationCreateApiKeyArgs = { description: Scalars['String']; }; - export type MutationCreateElectionArgs = { electables: Array; nominationsHidden: Scalars['Boolean']; }; - export type MutationCreateFolderArgs = { name: Scalars['String']; path: Scalars['String']; }; - export type MutationCreateUserArgs = { input: NewUser; }; - export type MutationDeactivatePostArgs = { id: Scalars['Int']; }; - export type MutationDeleteApiKeyArgs = { key: Scalars['String']; }; - export type MutationDeleteFileArgs = { id: Scalars['ID']; }; - export type MutationForgetUserArgs = { username: Scalars['String']; }; - export type MutationIssueTokensArgs = { username: Scalars['String']; }; - export type MutationLinkLoginProviderArgs = { input: ProviderOptions; }; - export type MutationLoginArgs = { password: Scalars['String']; username: Scalars['String']; }; - export type MutationModifyArticleArgs = { articleId: Scalars['Int']; entry: ModifyArticle; }; - export type MutationModifyPostArgs = { info: ModifyPost; }; - export type MutationNominateArgs = { postIds: Array; username: Scalars['String']; }; - export type MutationOpenElectionArgs = { electionId: Scalars['Int']; }; - export type MutationProposeArgs = { electionId: Scalars['Int']; postId: Scalars['Int']; username: Scalars['String']; }; - export type MutationProviderLoginArgs = { input: ProviderOptions; }; - export type MutationRefreshArgs = { refreshToken: Scalars['String']; }; - export type MutationRemoveArticleArgs = { articleId: Scalars['Int']; }; - export type MutationRemoveElectablesArgs = { electionId: Scalars['Int']; postIds: Array; }; - export type MutationRemoveEmergencyContactArgs = { id: Scalars['Int']; }; - export type MutationRemoveFileFromMeetingArgs = { fileType: MeetingDocumentType; meetingId: Scalars['Int']; }; - export type MutationRemoveHeheArgs = { number: Scalars['Int']; year: Scalars['Int']; }; - export type MutationRemoveHistoryEntryArgs = { id: Scalars['Int']; }; - export type MutationRemoveMeetingArgs = { id: Scalars['Int']; }; - export type MutationRemoveProposalArgs = { electionId: Scalars['Int']; postId: Scalars['Int']; username: Scalars['String']; }; - export type MutationRequestPasswordResetArgs = { resetLink: Scalars['String']; returnTo?: InputMaybe; username: Scalars['String']; }; - export type MutationResetPasswordArgs = { password: Scalars['String']; token: Scalars['String']; username: Scalars['String']; }; - export type MutationRespondToNominationArgs = { accepts: NominationAnswer; postId: Scalars['Int']; }; - export type MutationSendEmailArgs = { options: SendEmailOptions; }; - export type MutationSetApiKeyAccessArgs = { access: AccessInput; key: Scalars['String']; }; - export type MutationSetElectablesArgs = { electionId: Scalars['Int']; postIds: Array; }; - export type MutationSetHiddenNominationsArgs = { electionId: Scalars['Int']; hidden: Scalars['Boolean']; }; - export type MutationSetIndividualAccessArgs = { access: AccessInput; username: Scalars['String']; }; - export type MutationSetPostAccessArgs = { access: AccessInput; postId: Scalars['Int']; }; - export type MutationSetUserPostEndArgs = { end: Scalars['Date']; id: Scalars['Int']; }; - export type MutationUnlinkLoginProviderArgs = { id: Scalars['Int']; }; - export type MutationUpdateUserArgs = { input: UpdateUser; }; - export type MutationValidatePasswordResetTokenArgs = { token: Scalars['String']; username: Scalars['String']; }; - export type MutationValidateTokenArgs = { token: Scalars['String']; }; @@ -709,7 +667,7 @@ export type Nomination = { export enum NominationAnswer { No = 'NO', NotAnswered = 'NOT_ANSWERED', - Yes = 'YES' + Yes = 'YES', } export type Post = { @@ -734,7 +692,6 @@ export type Post = { utskott: Utskott; }; - export type PostHistoryArgs = { current?: InputMaybe; }; @@ -751,7 +708,7 @@ export enum PostType { /** Upp till _n_ stycken */ N = 'N', /** Unik, finns bara 1, t.ex. utskottsordförande */ - U = 'U' + U = 'U', } /** Valberedningens förslag */ @@ -815,7 +772,6 @@ export type Query = { utskott: Utskott; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -824,7 +780,6 @@ export type QueryApiKeyArgs = { key: Scalars['String']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -834,7 +789,6 @@ export type QueryArticleArgs = { slug?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -846,7 +800,6 @@ export type QueryArticlesArgs = { type?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -855,7 +808,6 @@ export type QueryElectionArgs = { electionId: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -864,7 +816,6 @@ export type QueryElectionsArgs = { electionIds: Array; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -873,7 +824,6 @@ export type QueryFileArgs = { id: Scalars['ID']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -882,7 +832,6 @@ export type QueryFileSystemArgs = { folder: Scalars['String']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -891,7 +840,6 @@ export type QueryFilesArgs = { type?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -900,7 +848,6 @@ export type QueryGroupedPostsArgs = { includeInactive?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -910,7 +857,6 @@ export type QueryHeheArgs = { year: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -919,7 +865,6 @@ export type QueryHehesArgs = { year: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -929,7 +874,6 @@ export type QueryHiddenNominationsArgs = { electionId: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -938,7 +882,6 @@ export type QueryIndividualAccessArgs = { username: Scalars['String']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -947,7 +890,6 @@ export type QueryLatestBoardMeetingsArgs = { limit?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -958,7 +900,6 @@ export type QueryLatestElectionsArgs = { limit?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -968,7 +909,6 @@ export type QueryLatestHeheArgs = { sortOrder?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -977,7 +917,6 @@ export type QueryLatestnewsArgs = { limit?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -986,7 +925,6 @@ export type QueryMeetingArgs = { id: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -997,7 +935,6 @@ export type QueryMeetingsArgs = { year?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1007,7 +944,6 @@ export type QueryMyNominationsArgs = { electionId: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1018,7 +954,6 @@ export type QueryNewsentriesArgs = { before?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1027,7 +962,6 @@ export type QueryNumberOfMembersArgs = { noAlumni?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1037,7 +971,6 @@ export type QueryNumberOfNominationsArgs = { postId?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1047,7 +980,6 @@ export type QueryNumberOfProposalsArgs = { postId?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1056,7 +988,6 @@ export type QueryNumberOfVolunteersArgs = { date?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1065,7 +996,6 @@ export type QueryPostArgs = { id: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1074,7 +1004,6 @@ export type QueryPostAccessArgs = { postId: Scalars['Int']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1084,7 +1013,6 @@ export type QueryPostsArgs = { utskott?: InputMaybe; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1093,7 +1021,6 @@ export type QuerySearchFilesArgs = { search: Scalars['String']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1102,7 +1029,6 @@ export type QuerySearchUserArgs = { search: Scalars['String']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1111,7 +1037,6 @@ export type QueryUserArgs = { username: Scalars['String']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1120,7 +1045,6 @@ export type QueryUserByCardArgs = { luCard: Scalars['String']; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1129,7 +1053,6 @@ export type QueryUsersArgs = { usernames: Array; }; - /** * Queries and mutations that relies on an election being open * does not take an `electionId` parameter. @@ -1148,7 +1071,7 @@ export type SendEmailOptions = { export enum SortOrder { Asc = 'asc', - Desc = 'desc' + Desc = 'desc', } export type TokenResponse = { @@ -1191,7 +1114,6 @@ export type User = { zipCode?: Maybe; }; - export type UserPostHistoryArgs = { current?: InputMaybe; }; @@ -1214,7 +1136,7 @@ export enum Utskott { Other = 'OTHER', Pengu = 'PENGU', Sre = 'SRE', - Styrelsen = 'STYRELSEN' + Styrelsen = 'STYRELSEN', } export type WithIndex = TObject & Record; @@ -1222,34 +1144,41 @@ export type ResolversObject = WithIndex; export type ResolverTypeWrapper = Promise | T; - export type ResolverWithResolve = { resolve: ResolverFn; }; -export type Resolver = ResolverFn | ResolverWithResolve; +export type Resolver = + | ResolverFn + | ResolverWithResolve; export type ResolverFn = ( parent: TParent, args: TArgs, context: TContext, - info: GraphQLResolveInfo + info: GraphQLResolveInfo, ) => Promise | TResult; export type SubscriptionSubscribeFn = ( parent: TParent, args: TArgs, context: TContext, - info: GraphQLResolveInfo + info: GraphQLResolveInfo, ) => AsyncIterable | Promise>; export type SubscriptionResolveFn = ( parent: TParent, args: TArgs, context: TContext, - info: GraphQLResolveInfo + info: GraphQLResolveInfo, ) => TResult | Promise; -export interface SubscriptionSubscriberObject { +export interface SubscriptionSubscriberObject< + TResult, + TKey extends string, + TParent, + TContext, + TArgs, +> { subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>; resolve?: SubscriptionResolveFn; } @@ -1263,17 +1192,27 @@ export type SubscriptionObject | SubscriptionResolverObject; -export type SubscriptionResolver = +export type SubscriptionResolver< + TResult, + TKey extends string, + TParent = {}, + TContext = {}, + TArgs = {}, +> = | ((...args: any[]) => SubscriptionObject) | SubscriptionObject; export type TypeResolveFn = ( parent: TParent, context: TContext, - info: GraphQLResolveInfo + info: GraphQLResolveInfo, ) => Maybe | Promise>; -export type IsTypeOfResolverFn = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise; +export type IsTypeOfResolverFn = ( + obj: T, + context: TContext, + info: GraphQLResolveInfo, +) => boolean | Promise; export type NextResolverFn = () => Promise; @@ -1282,7 +1221,7 @@ export type DirectiveResolverFn TResult | Promise; /** Mapping between all available schema types and the resolvers types */ @@ -1305,7 +1244,9 @@ export type ResolversTypes = ResolversObject<{ Feature: Feature; FeatureInfo: ResolverTypeWrapper; File: ResolverTypeWrapper; - FileSystemResponse: ResolverTypeWrapper & { files: Array }>; + FileSystemResponse: ResolverTypeWrapper< + Omit & { files: Array } + >; FileSystemResponsePath: ResolverTypeWrapper; FileType: FileType; GroupedPost: ResolverTypeWrapper; @@ -1356,7 +1297,9 @@ export type ResolversParentTypes = ResolversObject<{ EmergencyContact: EmergencyContact; FeatureInfo: FeatureInfo; File: FileResponse; - FileSystemResponse: Omit & { files: Array }; + FileSystemResponse: Omit & { + files: Array; + }; FileSystemResponsePath: FileSystemResponsePath; GroupedPost: GroupedPost; Hehe: HeheResponse; @@ -1386,13 +1329,19 @@ export type ResolversParentTypes = ResolversObject<{ UserPostHistoryEntry: UserPostHistoryEntry; }>; -export type AccessResolvers = ResolversObject<{ +export type AccessResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Access'] = ResolversParentTypes['Access'], +> = ResolversObject<{ doors?: Resolver, ParentType, ContextType>; features?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }>; -export type ApiKeyResolvers = ResolversObject<{ +export type ApiKeyResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['ApiKey'] = ResolversParentTypes['ApiKey'], +> = ResolversObject<{ access?: Resolver; creator?: Resolver; description?: Resolver; @@ -1400,7 +1349,10 @@ export type ApiKeyResolvers; }>; -export type ArticleResolvers = ResolversObject<{ +export type ArticleResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Article'] = ResolversParentTypes['Article'], +> = ResolversObject<{ articleType?: Resolver; author?: Resolver; body?: Resolver; @@ -1410,12 +1362,20 @@ export type ArticleResolvers; signature?: Resolver; slug?: Resolver; - tags?: Resolver, ParentType, ContextType, Partial>; + tags?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; title?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type CasLoginResponseResolvers = ResolversObject<{ +export type CasLoginResponseResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['CasLoginResponse'] = ResolversParentTypes['CasLoginResponse'], +> = ResolversObject<{ exists?: Resolver; hash?: Resolver; username?: Resolver; @@ -1426,13 +1386,19 @@ export interface DateScalarConfig extends GraphQLScalarTypeConfig = ResolversObject<{ +export type DoorInfoResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['DoorInfo'] = ResolversParentTypes['DoorInfo'], +> = ResolversObject<{ description?: Resolver; name?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type ElectionResolvers = ResolversObject<{ +export type ElectionResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Election'] = ResolversParentTypes['Election'], +> = ResolversObject<{ acceptedNominations?: Resolver, ParentType, ContextType>; closedAt?: Resolver, ParentType, ContextType>; createdAt?: Resolver; @@ -1446,7 +1412,10 @@ export type ElectionResolvers; }>; -export type EmergencyContactResolvers = ResolversObject<{ +export type EmergencyContactResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['EmergencyContact'] = ResolversParentTypes['EmergencyContact'], +> = ResolversObject<{ id?: Resolver; name?: Resolver; phone?: Resolver; @@ -1454,13 +1423,19 @@ export type EmergencyContactResolvers; }>; -export type FeatureInfoResolvers = ResolversObject<{ +export type FeatureInfoResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['FeatureInfo'] = ResolversParentTypes['FeatureInfo'], +> = ResolversObject<{ description?: Resolver; name?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type FileResolvers = ResolversObject<{ +export type FileResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['File'] = ResolversParentTypes['File'], +> = ResolversObject<{ accessType?: Resolver; createdAt?: Resolver, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; @@ -1473,25 +1448,37 @@ export type FileResolvers; }>; -export type FileSystemResponseResolvers = ResolversObject<{ +export type FileSystemResponseResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['FileSystemResponse'] = ResolversParentTypes['FileSystemResponse'], +> = ResolversObject<{ files?: Resolver, ParentType, ContextType>; path?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }>; -export type FileSystemResponsePathResolvers = ResolversObject<{ +export type FileSystemResponsePathResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['FileSystemResponsePath'] = ResolversParentTypes['FileSystemResponsePath'], +> = ResolversObject<{ id?: Resolver; name?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type GroupedPostResolvers = ResolversObject<{ +export type GroupedPostResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['GroupedPost'] = ResolversParentTypes['GroupedPost'], +> = ResolversObject<{ posts?: Resolver, ParentType, ContextType>; utskott?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type HeheResolvers = ResolversObject<{ +export type HeheResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Hehe'] = ResolversParentTypes['Hehe'], +> = ResolversObject<{ file?: Resolver; number?: Resolver; uploader?: Resolver; @@ -1499,7 +1486,10 @@ export type HeheResolvers; }>; -export type HistoryEntryResolvers = ResolversObject<{ +export type HistoryEntryResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['HistoryEntry'] = ResolversParentTypes['HistoryEntry'], +> = ResolversObject<{ end?: Resolver, ParentType, ContextType>; holder?: Resolver; id?: Resolver; @@ -1507,7 +1497,10 @@ export type HistoryEntryResolvers; }>; -export type LoginProviderResolvers = ResolversObject<{ +export type LoginProviderResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['LoginProvider'] = ResolversParentTypes['LoginProvider'], +> = ResolversObject<{ email?: Resolver, ParentType, ContextType>; id?: Resolver; provider?: Resolver; @@ -1515,14 +1508,20 @@ export type LoginProviderResolvers; }>; -export type LoginResponseResolvers = ResolversObject<{ +export type LoginResponseResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['LoginResponse'] = ResolversParentTypes['LoginResponse'], +> = ResolversObject<{ accessToken?: Resolver; refreshToken?: Resolver; user?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type MeetingResolvers = ResolversObject<{ +export type MeetingResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Meeting'] = ResolversParentTypes['Meeting'], +> = ResolversObject<{ agenda?: Resolver, ParentType, ContextType>; appendix?: Resolver, ParentType, ContextType>; documents?: Resolver, ParentType, ContextType>; @@ -1537,64 +1536,330 @@ export type MeetingResolvers; }>; -export type MutationResolvers = ResolversObject<{ - activatePost?: Resolver>; - addArticle?: Resolver>; - addElectables?: Resolver>; - addEmergencyContact?: Resolver>; - addFileToMeeting?: Resolver>; - addHehe?: Resolver>; - addMeeting?: Resolver>; - addPost?: Resolver>; - addUsersToPost?: Resolver>; - casCreateUser?: Resolver>; - casLogin?: Resolver>; - changePassword?: Resolver>; +export type MutationResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation'], +> = ResolversObject<{ + activatePost?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + addArticle?: Resolver< + ResolversTypes['Article'], + ParentType, + ContextType, + RequireFields + >; + addElectables?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + addEmergencyContact?: Resolver< + ResolversTypes['EmergencyContact'], + ParentType, + ContextType, + RequireFields + >; + addFileToMeeting?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + addHehe?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + addMeeting?: Resolver< + ResolversTypes['Meeting'], + ParentType, + ContextType, + RequireFields + >; + addPost?: Resolver< + ResolversTypes['Post'], + ParentType, + ContextType, + RequireFields + >; + addUsersToPost?: Resolver< + ResolversTypes['Post'], + ParentType, + ContextType, + RequireFields + >; + casCreateUser?: Resolver< + ResolversTypes['User'], + ParentType, + ContextType, + RequireFields + >; + casLogin?: Resolver< + ResolversTypes['CasLoginResponse'], + ParentType, + ContextType, + RequireFields + >; + changePassword?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; closeElection?: Resolver; - createApiKey?: Resolver>; - createElection?: Resolver>; - createFolder?: Resolver>; - createUser?: Resolver>; - deactivatePost?: Resolver>; - deleteApiKey?: Resolver>; - deleteFile?: Resolver>; - forgetUser?: Resolver>; - issueTokens?: Resolver>; - linkLoginProvider?: Resolver>; - login?: Resolver>; + createApiKey?: Resolver< + ResolversTypes['String'], + ParentType, + ContextType, + RequireFields + >; + createElection?: Resolver< + ResolversTypes['Election'], + ParentType, + ContextType, + RequireFields + >; + createFolder?: Resolver< + ResolversTypes['File'], + ParentType, + ContextType, + RequireFields + >; + createUser?: Resolver< + ResolversTypes['User'], + ParentType, + ContextType, + RequireFields + >; + deactivatePost?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + deleteApiKey?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + deleteFile?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + forgetUser?: Resolver< + ResolversTypes['User'], + ParentType, + ContextType, + RequireFields + >; + issueTokens?: Resolver< + ResolversTypes['TokenResponse'], + ParentType, + ContextType, + RequireFields + >; + linkLoginProvider?: Resolver< + ResolversTypes['LoginProvider'], + ParentType, + ContextType, + RequireFields + >; + login?: Resolver< + ResolversTypes['LoginResponse'], + ParentType, + ContextType, + RequireFields + >; logout?: Resolver; - modifyArticle?: Resolver>; - modifyPost?: Resolver>; - nominate?: Resolver>; - openElection?: Resolver>; - propose?: Resolver>; - providerLogin?: Resolver>; - refresh?: Resolver>; - removeArticle?: Resolver>; - removeElectables?: Resolver>; - removeEmergencyContact?: Resolver>; - removeFileFromMeeting?: Resolver>; - removeHehe?: Resolver>; - removeHistoryEntry?: Resolver>; - removeMeeting?: Resolver>; - removeProposal?: Resolver>; - requestPasswordReset?: Resolver>; - resetPassword?: Resolver>; - respondToNomination?: Resolver>; - sendEmail?: Resolver>; - setApiKeyAccess?: Resolver>; - setElectables?: Resolver>; - setHiddenNominations?: Resolver>; - setIndividualAccess?: Resolver>; - setPostAccess?: Resolver>; - setUserPostEnd?: Resolver>; - unlinkLoginProvider?: Resolver>; - updateUser?: Resolver>; - validatePasswordResetToken?: Resolver>; - validateToken?: Resolver>; + modifyArticle?: Resolver< + ResolversTypes['Article'], + ParentType, + ContextType, + RequireFields + >; + modifyPost?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + nominate?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + openElection?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + propose?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + providerLogin?: Resolver< + ResolversTypes['LoginResponse'], + ParentType, + ContextType, + RequireFields + >; + refresh?: Resolver< + ResolversTypes['TokenResponse'], + ParentType, + ContextType, + RequireFields + >; + removeArticle?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + removeElectables?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + removeEmergencyContact?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + removeFileFromMeeting?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + removeHehe?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + removeHistoryEntry?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + removeMeeting?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + removeProposal?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + requestPasswordReset?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + resetPassword?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + respondToNomination?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + sendEmail?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + setApiKeyAccess?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + setElectables?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + setHiddenNominations?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + setIndividualAccess?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + setPostAccess?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + setUserPostEnd?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + unlinkLoginProvider?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + updateUser?: Resolver< + ResolversTypes['User'], + ParentType, + ContextType, + RequireFields + >; + validatePasswordResetToken?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; + validateToken?: Resolver< + ResolversTypes['Boolean'], + ParentType, + ContextType, + RequireFields + >; }>; -export type NominationResolvers = ResolversObject<{ +export type NominationResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Nomination'] = ResolversParentTypes['Nomination'], +> = ResolversObject<{ answer?: Resolver; post?: Resolver; user?: Resolver; @@ -1605,12 +1870,20 @@ export interface ObjectScalarConfig extends GraphQLScalarTypeConfig = ResolversObject<{ +export type PostResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Post'] = ResolversParentTypes['Post'], +> = ResolversObject<{ access?: Resolver; active?: Resolver; description?: Resolver; email?: Resolver, ParentType, ContextType>; - history?: Resolver, ParentType, ContextType, Partial>; + history?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; id?: Resolver; interviewRequired?: Resolver, ParentType, ContextType>; postType?: Resolver; @@ -1621,62 +1894,229 @@ export type PostResolvers; }>; -export type ProposalResolvers = ResolversObject<{ +export type ProposalResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Proposal'] = ResolversParentTypes['Proposal'], +> = ResolversObject<{ post?: Resolver; user?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type QueryResolvers = ResolversObject<{ - apiKey?: Resolver>; +export type QueryResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query'], +> = ResolversObject<{ + apiKey?: Resolver< + ResolversTypes['ApiKey'], + ParentType, + ContextType, + RequireFields + >; apiKeys?: Resolver, ParentType, ContextType>; article?: Resolver>; - articles?: Resolver, ParentType, ContextType, Partial>; + articles?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; doors?: Resolver, ParentType, ContextType>; - election?: Resolver>; - elections?: Resolver, ParentType, ContextType, RequireFields>; + election?: Resolver< + ResolversTypes['Election'], + ParentType, + ContextType, + RequireFields + >; + elections?: Resolver< + Array, + ParentType, + ContextType, + RequireFields + >; features?: Resolver, ParentType, ContextType>; - file?: Resolver>; - fileSystem?: Resolver>; + file?: Resolver< + ResolversTypes['File'], + ParentType, + ContextType, + RequireFields + >; + fileSystem?: Resolver< + ResolversTypes['FileSystemResponse'], + ParentType, + ContextType, + RequireFields + >; files?: Resolver, ParentType, ContextType, Partial>; - groupedPosts?: Resolver, ParentType, ContextType, Partial>; - hehe?: Resolver>; - hehes?: Resolver, ParentType, ContextType, RequireFields>; - hiddenNominations?: Resolver, ParentType, ContextType, RequireFields>; - individualAccess?: Resolver>; - latestBoardMeetings?: Resolver, ParentType, ContextType, Partial>; - latestElections?: Resolver, ParentType, ContextType, Partial>; - latestHehe?: Resolver, ParentType, ContextType, Partial>; - latestnews?: Resolver, ParentType, ContextType, Partial>; + groupedPosts?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; + hehe?: Resolver< + ResolversTypes['Hehe'], + ParentType, + ContextType, + RequireFields + >; + hehes?: Resolver< + Array, + ParentType, + ContextType, + RequireFields + >; + hiddenNominations?: Resolver< + Array, + ParentType, + ContextType, + RequireFields + >; + individualAccess?: Resolver< + ResolversTypes['Access'], + ParentType, + ContextType, + RequireFields + >; + latestBoardMeetings?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; + latestElections?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; + latestHehe?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; + latestnews?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; me?: Resolver; - meeting?: Resolver>; - meetings?: Resolver, ParentType, ContextType, Partial>; - myNominations?: Resolver, ParentType, ContextType, RequireFields>; - newsentries?: Resolver, ParentType, ContextType, Partial>; - numberOfMembers?: Resolver>; - numberOfNominations?: Resolver>; - numberOfProposals?: Resolver>; - numberOfVolunteers?: Resolver>; + meeting?: Resolver< + ResolversTypes['Meeting'], + ParentType, + ContextType, + RequireFields + >; + meetings?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; + myNominations?: Resolver< + Array, + ParentType, + ContextType, + RequireFields + >; + newsentries?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; + numberOfMembers?: Resolver< + ResolversTypes['Int'], + ParentType, + ContextType, + Partial + >; + numberOfNominations?: Resolver< + ResolversTypes['Int'], + ParentType, + ContextType, + RequireFields + >; + numberOfProposals?: Resolver< + ResolversTypes['Int'], + ParentType, + ContextType, + RequireFields + >; + numberOfVolunteers?: Resolver< + ResolversTypes['Int'], + ParentType, + ContextType, + Partial + >; openElection?: Resolver; - post?: Resolver>; - postAccess?: Resolver>; + post?: Resolver< + ResolversTypes['Post'], + ParentType, + ContextType, + RequireFields + >; + postAccess?: Resolver< + ResolversTypes['Access'], + ParentType, + ContextType, + RequireFields + >; posts?: Resolver, ParentType, ContextType, Partial>; - searchFiles?: Resolver, ParentType, ContextType, RequireFields>; - searchUser?: Resolver, ParentType, ContextType, RequireFields>; - user?: Resolver>; - userByCard?: Resolver>; - users?: Resolver, ParentType, ContextType, RequireFields>; + searchFiles?: Resolver< + Array, + ParentType, + ContextType, + RequireFields + >; + searchUser?: Resolver< + Array, + ParentType, + ContextType, + RequireFields + >; + user?: Resolver< + ResolversTypes['User'], + ParentType, + ContextType, + RequireFields + >; + userByCard?: Resolver< + ResolversTypes['User'], + ParentType, + ContextType, + RequireFields + >; + users?: Resolver< + Array, + ParentType, + ContextType, + RequireFields + >; usersWithIndividualAccess?: Resolver, ParentType, ContextType>; - utskott?: Resolver>; + utskott?: Resolver< + ResolversTypes['Utskott'], + ParentType, + ContextType, + RequireFields + >; }>; -export type TokenResponseResolvers = ResolversObject<{ +export type TokenResponseResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['TokenResponse'] = ResolversParentTypes['TokenResponse'], +> = ResolversObject<{ accessToken?: Resolver; refreshToken?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type UserResolvers = ResolversObject<{ +export type UserResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['User'] = ResolversParentTypes['User'], +> = ResolversObject<{ access?: Resolver; address?: Resolver, ParentType, ContextType>; class?: Resolver; @@ -1689,7 +2129,12 @@ export type UserResolvers, ParentType, ContextType>; phone?: Resolver, ParentType, ContextType>; photoUrl?: Resolver, ParentType, ContextType>; - postHistory?: Resolver, ParentType, ContextType, Partial>; + postHistory?: Resolver< + Array, + ParentType, + ContextType, + Partial + >; posts?: Resolver, ParentType, ContextType>; username?: Resolver; website?: Resolver, ParentType, ContextType>; @@ -1698,7 +2143,10 @@ export type UserResolvers; }>; -export type UserPostHistoryEntryResolvers = ResolversObject<{ +export type UserPostHistoryEntryResolvers< + ContextType = Context, + ParentType extends ResolversParentTypes['UserPostHistoryEntry'] = ResolversParentTypes['UserPostHistoryEntry'], +> = ResolversObject<{ end?: Resolver, ParentType, ContextType>; post?: Resolver; start?: Resolver; @@ -1734,4 +2182,3 @@ export type Resolvers = ResolversObject<{ User?: UserResolvers; UserPostHistoryEntry?: UserPostHistoryEntryResolvers; }>; - From 82ff52ef0614a7d34aa6799111c00424dcfe17f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20Sj=C3=B6stedt?= Date: Fri, 22 Mar 2024 12:32:25 +0100 Subject: [PATCH 4/4] update version package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6b00519f..c82c873d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ekorre-ts", - "version": "1.7.1", + "version": "1.9.0", "description": "E-Sektionens backend", "main": "src/index.ts", "scripts": {