@grantjs/schema 1.4.2 → 1.5.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.
Files changed (49) hide show
  1. package/package.json +9 -9
  2. package/src/events/event-catalog.ts +214 -0
  3. package/src/events/event-envelope.ts +73 -0
  4. package/src/events/index.ts +2 -0
  5. package/src/generated/graphql.ts +1318 -111
  6. package/src/generated/resolvers.ts +628 -0
  7. package/src/generated/schema-types.ts +312 -0
  8. package/src/index.ts +3 -0
  9. package/src/notifications/notification.types.ts +21 -0
  10. package/src/operations/api-keys/rotate-api-key.graphql +11 -0
  11. package/src/operations/groups/getGroups.graphql +1 -8
  12. package/src/operations/groups/getGroupsList.graphql +6 -0
  13. package/src/operations/me/mark-all-my-notifications-read.graphql +5 -0
  14. package/src/operations/me/mark-my-notification-read.graphql +3 -0
  15. package/src/operations/me/my-notification-preferences.graphql +11 -0
  16. package/src/operations/me/my-notifications.graphql +26 -0
  17. package/src/operations/me/my-project-membership.graphql +14 -0
  18. package/src/operations/me/my-project-memberships.graphql +14 -0
  19. package/src/operations/me/my-unread-notification-count.graphql +5 -0
  20. package/src/operations/me/set-my-notification-preference.graphql +11 -0
  21. package/src/operations/me/update-my-project-membership.graphql +14 -0
  22. package/src/operations/me/upload-my-project-membership-picture.graphql +6 -0
  23. package/src/operations/roles/getRoles.graphql +1 -14
  24. package/src/operations/webhooks/create-webhook-subscription.graphql +13 -0
  25. package/src/operations/webhooks/delete-webhook-subscription.graphql +3 -0
  26. package/src/operations/webhooks/replay-webhook-delivery.graphql +11 -0
  27. package/src/operations/webhooks/rotate-webhook-subscription-secret.graphql +7 -0
  28. package/src/operations/webhooks/update-webhook-subscription.graphql +10 -0
  29. package/src/operations/webhooks/webhook-deliveries.graphql +31 -0
  30. package/src/operations/webhooks/webhook-subscription.graphql +13 -0
  31. package/src/operations/webhooks/webhook-subscriptions.graphql +13 -0
  32. package/src/schema/api-keys/inputs/rotate-api-key.graphql +4 -0
  33. package/src/schema/api-keys/mutations/rotate-api-key.graphql +7 -0
  34. package/src/schema/me/input/notification.graphql +16 -0
  35. package/src/schema/me/input/update-my-project-membership.graphql +5 -0
  36. package/src/schema/me/input/upload-my-project-membership-picture.graphql +6 -0
  37. package/src/schema/me/mutations/my-notifications.graphql +5 -0
  38. package/src/schema/me/mutations/update-my-project-membership.graphql +6 -0
  39. package/src/schema/me/mutations/upload-my-project-membership-picture.graphql +5 -0
  40. package/src/schema/me/queries/my-notifications.graphql +5 -0
  41. package/src/schema/me/queries/my-project-membership.graphql +6 -0
  42. package/src/schema/me/queries/my-project-memberships.graphql +6 -0
  43. package/src/schema/me/types/my-project-membership.graphql +12 -0
  44. package/src/schema/me/types/notification.graphql +63 -0
  45. package/src/schema/webhooks/inputs/webhook-subscription.graphql +33 -0
  46. package/src/schema/webhooks/mutations/webhook-subscriptions.graphql +33 -0
  47. package/src/schema/webhooks/queries/webhook-subscriptions.graphql +22 -0
  48. package/src/schema/webhooks/types/webhook-subscription.graphql +58 -0
  49. package/src/webhooks/webhook.types.ts +25 -0
@@ -686,6 +686,15 @@ export type CreateUserSessionInput = {
686
686
  userId: Scalars['ID']['input'];
687
687
  };
688
688
 
689
+ export type CreateWebhookSubscriptionMutationInput = {
690
+ active?: InputMaybe<Scalars['Boolean']['input']>;
691
+ description?: InputMaybe<Scalars['String']['input']>;
692
+ /** Domain event type filters (must be known catalog types). */
693
+ eventTypes: Array<Scalars['String']['input']>;
694
+ scope: Scope;
695
+ url: Scalars['String']['input'];
696
+ };
697
+
689
698
  export type DeleteApiKeyInput = {
690
699
  hardDelete?: InputMaybe<Scalars['Boolean']['input']>;
691
700
  id: Scalars['ID']['input'];
@@ -704,6 +713,11 @@ export type DeleteUserSessionInput = {
704
713
  id: Scalars['ID']['input'];
705
714
  };
706
715
 
716
+ export type DeleteWebhookSubscriptionInput = {
717
+ id: Scalars['ID']['input'];
718
+ scope: Scope;
719
+ };
720
+
707
721
  export type EmailVerificationProofInput = {
708
722
  emailProofToken: Scalars['String']['input'];
709
723
  token: Scalars['String']['input'];
@@ -895,6 +909,11 @@ export type LogoutMyUserResponse = {
895
909
  message: Scalars['String']['output'];
896
910
  };
897
911
 
912
+ export type MarkAllNotificationsReadResult = {
913
+ __typename?: 'MarkAllNotificationsReadResult';
914
+ updated: Scalars['Int']['output'];
915
+ };
916
+
898
917
  export type MeResponse = {
899
918
  __typename?: 'MeResponse';
900
919
  accounts: Array<Account>;
@@ -979,6 +998,8 @@ export type Mutation = {
979
998
  createRole: Role;
980
999
  createTag: Tag;
981
1000
  createUser: User;
1001
+ /** Create a project webhook subscription. The signing secret is returned once. */
1002
+ createWebhookSubscription: WebhookSubscriptionWithSecret;
982
1003
  deleteApiKey: ApiKey;
983
1004
  deleteGroup: Group;
984
1005
  deleteMyAccounts: User;
@@ -991,16 +1012,22 @@ export type Mutation = {
991
1012
  deleteRole: Role;
992
1013
  deleteTag: Tag;
993
1014
  deleteUser: User;
1015
+ /** Soft-delete a webhook subscription. */
1016
+ deleteWebhookSubscription: Scalars['Boolean']['output'];
994
1017
  exchangeApiKey: ExchangeApiKeyResult;
995
1018
  generateMyMfaRecoveryCodes: Array<Scalars['String']['output']>;
996
1019
  inviteMember: OrganizationInvitation;
997
1020
  login: LoginResponse;
998
1021
  logoutMyUser: LogoutMyUserResponse;
1022
+ markAllMyNotificationsRead: MarkAllNotificationsReadResult;
1023
+ markMyNotificationRead: Scalars['Boolean']['output'];
999
1024
  refreshSession: RefreshSessionResponse;
1000
1025
  register: CreateAccountResult;
1001
1026
  removeMyMfaDevice: MfaVerifyResult;
1002
1027
  removeOrganizationMember: OrganizationMember;
1003
1028
  renewInvitation: OrganizationInvitation;
1029
+ /** Re-queue a delivery attempt for another POST. */
1030
+ replayWebhookDelivery: WebhookDeliveryAttempt;
1004
1031
  requestPasswordReset: RequestPasswordResetResponse;
1005
1032
  resendInvitationEmail: OrganizationInvitation;
1006
1033
  resendVerification: ResendVerificationResponse;
@@ -1010,12 +1037,20 @@ export type Mutation = {
1010
1037
  revokeMyUserSession: RevokeMyUserSessionResult;
1011
1038
  revokeRolePermission: RolePermission;
1012
1039
  revokeUserPermission: UserPermission;
1040
+ /**
1041
+ * Rotate an API key secret in place. Returns the new plaintext secret once.
1042
+ * Keeps the same key id and clientId; rejects revoked keys.
1043
+ */
1044
+ rotateApiKey: CreateApiKeyResult;
1013
1045
  /**
1014
1046
  * Rotate the signing key for the given scope: create a new active key and mark the previous one as rotated.
1015
1047
  * Allowed scopes: accountProject, organizationProject only.
1016
1048
  * Returns the new signing key (public info).
1017
1049
  */
1018
1050
  rotateSigningKey: SigningKey;
1051
+ /** Rotate the signing secret. The new secret is returned once. */
1052
+ rotateWebhookSubscriptionSecret: WebhookSubscriptionWithSecret;
1053
+ setMyNotificationPreference: NotificationPreference;
1019
1054
  setMyPrimaryAuthenticationMethod: UserAuthenticationMethod;
1020
1055
  setMyPrimaryMfaDevice: MfaDevice;
1021
1056
  setupMfa: MfaSetupResponse;
@@ -1043,6 +1078,8 @@ export type Mutation = {
1043
1078
  */
1044
1079
  startProjectSync: ProjectSyncJob;
1045
1080
  updateGroup: Group;
1081
+ /** Update the authenticated user's project membership profile (display name / picture). */
1082
+ updateMyProjectMembership: MyProjectMembership;
1046
1083
  updateMyUser: User;
1047
1084
  updateOrganization: Organization;
1048
1085
  updateOrganizationMember: OrganizationMember;
@@ -1054,6 +1091,9 @@ export type Mutation = {
1054
1091
  updateRole: Role;
1055
1092
  updateTag: Tag;
1056
1093
  updateUser: User;
1094
+ /** Update a webhook subscription URL, event filters, description, or active flag. */
1095
+ updateWebhookSubscription: WebhookSubscription;
1096
+ uploadMyProjectMembershipPicture: UploadUserPictureResult;
1057
1097
  uploadMyUserPicture: UploadUserPictureResult;
1058
1098
  uploadUserPicture: UploadUserPictureResult;
1059
1099
  verifyEmail: VerifyEmailResponse;
@@ -1128,6 +1168,10 @@ export type MutationCreateUserArgs = {
1128
1168
  input: CreateUserInput;
1129
1169
  };
1130
1170
 
1171
+ export type MutationCreateWebhookSubscriptionArgs = {
1172
+ input: CreateWebhookSubscriptionMutationInput;
1173
+ };
1174
+
1131
1175
  export type MutationDeleteApiKeyArgs = {
1132
1176
  input: DeleteApiKeyInput;
1133
1177
  };
@@ -1185,6 +1229,10 @@ export type MutationDeleteUserArgs = {
1185
1229
  scope: Scope;
1186
1230
  };
1187
1231
 
1232
+ export type MutationDeleteWebhookSubscriptionArgs = {
1233
+ input: DeleteWebhookSubscriptionInput;
1234
+ };
1235
+
1188
1236
  export type MutationExchangeApiKeyArgs = {
1189
1237
  input: ExchangeApiKeyInput;
1190
1238
  };
@@ -1201,6 +1249,10 @@ export type MutationLoginArgs = {
1201
1249
  input: LoginInput;
1202
1250
  };
1203
1251
 
1252
+ export type MutationMarkMyNotificationReadArgs = {
1253
+ id: Scalars['ID']['input'];
1254
+ };
1255
+
1204
1256
  export type MutationRegisterArgs = {
1205
1257
  input: RegisterInput;
1206
1258
  };
@@ -1219,6 +1271,10 @@ export type MutationRenewInvitationArgs = {
1219
1271
  scope: Scope;
1220
1272
  };
1221
1273
 
1274
+ export type MutationReplayWebhookDeliveryArgs = {
1275
+ input: ReplayWebhookDeliveryInput;
1276
+ };
1277
+
1222
1278
  export type MutationRequestPasswordResetArgs = {
1223
1279
  input: RequestPasswordResetInput;
1224
1280
  };
@@ -1257,10 +1313,22 @@ export type MutationRevokeUserPermissionArgs = {
1257
1313
  input: RevokeUserPermissionInput;
1258
1314
  };
1259
1315
 
1316
+ export type MutationRotateApiKeyArgs = {
1317
+ input: RotateApiKeyInput;
1318
+ };
1319
+
1260
1320
  export type MutationRotateSigningKeyArgs = {
1261
1321
  scope: Scope;
1262
1322
  };
1263
1323
 
1324
+ export type MutationRotateWebhookSubscriptionSecretArgs = {
1325
+ input: RotateWebhookSubscriptionSecretInput;
1326
+ };
1327
+
1328
+ export type MutationSetMyNotificationPreferenceArgs = {
1329
+ input: SetMyNotificationPreferenceInput;
1330
+ };
1331
+
1264
1332
  export type MutationSetMyPrimaryAuthenticationMethodArgs = {
1265
1333
  id: Scalars['ID']['input'];
1266
1334
  };
@@ -1286,6 +1354,10 @@ export type MutationUpdateGroupArgs = {
1286
1354
  input: UpdateGroupInput;
1287
1355
  };
1288
1356
 
1357
+ export type MutationUpdateMyProjectMembershipArgs = {
1358
+ input: UpdateMyProjectMembershipInput;
1359
+ };
1360
+
1289
1361
  export type MutationUpdateMyUserArgs = {
1290
1362
  input: UpdateMyUserInput;
1291
1363
  };
@@ -1335,6 +1407,15 @@ export type MutationUpdateUserArgs = {
1335
1407
  input: UpdateUserInput;
1336
1408
  };
1337
1409
 
1410
+ export type MutationUpdateWebhookSubscriptionArgs = {
1411
+ id: Scalars['ID']['input'];
1412
+ input: UpdateWebhookSubscriptionMutationInput;
1413
+ };
1414
+
1415
+ export type MutationUploadMyProjectMembershipPictureArgs = {
1416
+ input: UploadMyProjectMembershipPictureInput;
1417
+ };
1418
+
1338
1419
  export type MutationUploadMyUserPictureArgs = {
1339
1420
  input: UploadMyUserPictureInput;
1340
1421
  };
@@ -1359,6 +1440,26 @@ export type MutationVerifyMyMfaEnrollmentArgs = {
1359
1440
  input: VerifyMyMfaEnrollmentInput;
1360
1441
  };
1361
1442
 
1443
+ export type MyNotificationsInput = {
1444
+ limit?: InputMaybe<Scalars['Int']['input']>;
1445
+ page?: InputMaybe<Scalars['Int']['input']>;
1446
+ unreadOnly?: InputMaybe<Scalars['Boolean']['input']>;
1447
+ };
1448
+
1449
+ export type MyProjectMembership = {
1450
+ __typename?: 'MyProjectMembership';
1451
+ accountId?: Maybe<Scalars['ID']['output']>;
1452
+ displayName?: Maybe<Scalars['String']['output']>;
1453
+ joinedAt: Scalars['Date']['output'];
1454
+ metadata: Scalars['JSON']['output'];
1455
+ organizationId?: Maybe<Scalars['ID']['output']>;
1456
+ organizationName?: Maybe<Scalars['String']['output']>;
1457
+ pictureUrl?: Maybe<Scalars['String']['output']>;
1458
+ projectId: Scalars['ID']['output'];
1459
+ projectName: Scalars['String']['output'];
1460
+ role?: Maybe<Scalars['String']['output']>;
1461
+ };
1462
+
1362
1463
  export type MyUserSessionsInput = {
1363
1464
  audience?: InputMaybe<Scalars['String']['input']>;
1364
1465
  limit?: InputMaybe<Scalars['Int']['input']>;
@@ -1366,6 +1467,66 @@ export type MyUserSessionsInput = {
1366
1467
  search?: InputMaybe<Scalars['String']['input']>;
1367
1468
  };
1368
1469
 
1470
+ export type Notification = {
1471
+ __typename?: 'Notification';
1472
+ body?: Maybe<Scalars['String']['output']>;
1473
+ category: Scalars['String']['output'];
1474
+ channel: NotificationChannel;
1475
+ createdAt: Scalars['Date']['output'];
1476
+ eventId: Scalars['ID']['output'];
1477
+ id: Scalars['ID']['output'];
1478
+ readAt?: Maybe<Scalars['Date']['output']>;
1479
+ refEntity?: Maybe<Scalars['String']['output']>;
1480
+ refId?: Maybe<Scalars['ID']['output']>;
1481
+ scope?: Maybe<NotificationEventScope>;
1482
+ seenAt?: Maybe<Scalars['Date']['output']>;
1483
+ status: NotificationStatus;
1484
+ title: Scalars['String']['output'];
1485
+ type: Scalars['String']['output'];
1486
+ };
1487
+
1488
+ export enum NotificationChannel {
1489
+ Email = 'email',
1490
+ InApp = 'in_app',
1491
+ }
1492
+
1493
+ export type NotificationEventScope = {
1494
+ __typename?: 'NotificationEventScope';
1495
+ id: Scalars['ID']['output'];
1496
+ tenant: Scalars['String']['output'];
1497
+ };
1498
+
1499
+ export type NotificationPage = {
1500
+ __typename?: 'NotificationPage';
1501
+ hasNextPage: Scalars['Boolean']['output'];
1502
+ notifications: Array<Notification>;
1503
+ totalCount: Scalars['Int']['output'];
1504
+ unreadCount: Scalars['Int']['output'];
1505
+ };
1506
+
1507
+ export type NotificationPreference = {
1508
+ __typename?: 'NotificationPreference';
1509
+ category: Scalars['String']['output'];
1510
+ channel: NotificationChannel;
1511
+ enabled: Scalars['Boolean']['output'];
1512
+ id: Scalars['ID']['output'];
1513
+ scopeId: Scalars['String']['output'];
1514
+ scopeTenant: Scalars['String']['output'];
1515
+ source: NotificationPreferenceSource;
1516
+ };
1517
+
1518
+ export enum NotificationPreferenceSource {
1519
+ OrgEnforced = 'org_enforced',
1520
+ User = 'user',
1521
+ }
1522
+
1523
+ export enum NotificationStatus {
1524
+ Dead = 'dead',
1525
+ Delivered = 'delivered',
1526
+ Failed = 'failed',
1527
+ Pending = 'pending',
1528
+ }
1529
+
1369
1530
  export type Organization = Auditable & {
1370
1531
  __typename?: 'Organization';
1371
1532
  createdAt: Scalars['Date']['output'];
@@ -2009,6 +2170,13 @@ export type Query = {
2009
2170
  me: MeResponse;
2010
2171
  myMfaDevices: Array<MfaDevice>;
2011
2172
  myMfaRecoveryCodeStatus: MfaRecoveryCodeStatus;
2173
+ myNotificationPreferences: Array<NotificationPreference>;
2174
+ myNotifications: NotificationPage;
2175
+ /** A single project membership for the authenticated user. */
2176
+ myProjectMembership?: Maybe<MyProjectMembership>;
2177
+ /** Project memberships for the authenticated user (project_users pivots). */
2178
+ myProjectMemberships: Array<MyProjectMembership>;
2179
+ myUnreadNotificationCount: UnreadNotificationCount;
2012
2180
  myUserAuthenticationMethods: Array<UserAuthenticationMethod>;
2013
2181
  myUserDataExport: UserDataExport;
2014
2182
  myUserSessions: UserSessionPage;
@@ -2040,6 +2208,12 @@ export type Query = {
2040
2208
  signingKeys: Array<SigningKey>;
2041
2209
  tags: TagPage;
2042
2210
  users: UserPage;
2211
+ /** List delivery attempts for a project (optionally filtered by subscription or status). */
2212
+ webhookDeliveries: WebhookDeliveryPage;
2213
+ /** Get a single webhook subscription by id. */
2214
+ webhookSubscription: WebhookSubscription;
2215
+ /** List webhook subscriptions for a project scope. */
2216
+ webhookSubscriptions: Array<WebhookSubscription>;
2043
2217
  };
2044
2218
 
2045
2219
  export type QueryApiKeysArgs = {
@@ -2069,6 +2243,18 @@ export type QueryIsAuthorizedArgs = {
2069
2243
  input: IsAuthorizedInput;
2070
2244
  };
2071
2245
 
2246
+ export type QueryMyNotificationPreferencesArgs = {
2247
+ scopeTenant: Scalars['String']['input'];
2248
+ };
2249
+
2250
+ export type QueryMyNotificationsArgs = {
2251
+ input?: InputMaybe<MyNotificationsInput>;
2252
+ };
2253
+
2254
+ export type QueryMyProjectMembershipArgs = {
2255
+ projectId: Scalars['ID']['input'];
2256
+ };
2257
+
2072
2258
  export type QueryMyUserSessionsArgs = {
2073
2259
  input: MyUserSessionsInput;
2074
2260
  };
@@ -2191,6 +2377,23 @@ export type QueryUsersArgs = {
2191
2377
  tagIds?: InputMaybe<Array<Scalars['ID']['input']>>;
2192
2378
  };
2193
2379
 
2380
+ export type QueryWebhookDeliveriesArgs = {
2381
+ limit?: InputMaybe<Scalars['Int']['input']>;
2382
+ page?: InputMaybe<Scalars['Int']['input']>;
2383
+ scope: Scope;
2384
+ status?: InputMaybe<WebhookDeliveryStatus>;
2385
+ subscriptionId?: InputMaybe<Scalars['ID']['input']>;
2386
+ };
2387
+
2388
+ export type QueryWebhookSubscriptionArgs = {
2389
+ id: Scalars['ID']['input'];
2390
+ scope: Scope;
2391
+ };
2392
+
2393
+ export type QueryWebhookSubscriptionsArgs = {
2394
+ scope: Scope;
2395
+ };
2396
+
2194
2397
  export type QueryAccountProjectApiKeysInput = {
2195
2398
  accountId?: InputMaybe<Scalars['ID']['input']>;
2196
2399
  apiKeyId?: InputMaybe<Scalars['ID']['input']>;
@@ -2572,6 +2775,11 @@ export type RemoveUserTagInput = {
2572
2775
  userId: Scalars['ID']['input'];
2573
2776
  };
2574
2777
 
2778
+ export type ReplayWebhookDeliveryInput = {
2779
+ deliveryId: Scalars['ID']['input'];
2780
+ scope: Scope;
2781
+ };
2782
+
2575
2783
  export type RequestPasswordResetInput = {
2576
2784
  email: Scalars['String']['input'];
2577
2785
  };
@@ -2826,6 +3034,16 @@ export type RoleTagTagArgs = {
2826
3034
  scope: Scope;
2827
3035
  };
2828
3036
 
3037
+ export type RotateApiKeyInput = {
3038
+ id: Scalars['ID']['input'];
3039
+ scope: Scope;
3040
+ };
3041
+
3042
+ export type RotateWebhookSubscriptionSecretInput = {
3043
+ id: Scalars['ID']['input'];
3044
+ scope: Scope;
3045
+ };
3046
+
2829
3047
  export type Scope = {
2830
3048
  id: Scalars['ID']['input'];
2831
3049
  tenant: Tenant;
@@ -2847,6 +3065,15 @@ export type SessionExportData = {
2847
3065
  userAgent?: Maybe<Scalars['String']['output']>;
2848
3066
  };
2849
3067
 
3068
+ export type SetMyNotificationPreferenceInput = {
3069
+ /** Notification preference category (security, iam, membership, integrations). */
3070
+ category: Scalars['String']['input'];
3071
+ channel: NotificationChannel;
3072
+ enabled: Scalars['Boolean']['input'];
3073
+ scopeId?: InputMaybe<Scalars['String']['input']>;
3074
+ scopeTenant: Scalars['String']['input'];
3075
+ };
3076
+
2850
3077
  export type SetMyPrimaryMfaDeviceInput = {
2851
3078
  factorId: Scalars['ID']['input'];
2852
3079
  };
@@ -3007,6 +3234,11 @@ export enum TokenType {
3007
3234
  System = 'system',
3008
3235
  }
3009
3236
 
3237
+ export type UnreadNotificationCount = {
3238
+ __typename?: 'UnreadNotificationCount';
3239
+ unreadCount: Scalars['Int']['output'];
3240
+ };
3241
+
3010
3242
  export type UpdateAccountProjectTagInput = {
3011
3243
  accountId: Scalars['ID']['input'];
3012
3244
  isPrimary: Scalars['Boolean']['input'];
@@ -3036,6 +3268,12 @@ export type UpdateGroupTagInput = {
3036
3268
  tagId: Scalars['ID']['input'];
3037
3269
  };
3038
3270
 
3271
+ export type UpdateMyProjectMembershipInput = {
3272
+ displayName?: InputMaybe<Scalars['String']['input']>;
3273
+ pictureUrl?: InputMaybe<Scalars['String']['input']>;
3274
+ projectId: Scalars['ID']['input'];
3275
+ };
3276
+
3039
3277
  export type UpdateMyUserAuthenticationMethodInput = {
3040
3278
  isPrimary?: InputMaybe<Scalars['Boolean']['input']>;
3041
3279
  isVerified?: InputMaybe<Scalars['Boolean']['input']>;
@@ -3211,6 +3449,21 @@ export type UpdateUserTagInput = {
3211
3449
  userId: Scalars['ID']['input'];
3212
3450
  };
3213
3451
 
3452
+ export type UpdateWebhookSubscriptionMutationInput = {
3453
+ active?: InputMaybe<Scalars['Boolean']['input']>;
3454
+ description?: InputMaybe<Scalars['String']['input']>;
3455
+ eventTypes?: InputMaybe<Array<Scalars['String']['input']>>;
3456
+ scope: Scope;
3457
+ url?: InputMaybe<Scalars['String']['input']>;
3458
+ };
3459
+
3460
+ export type UploadMyProjectMembershipPictureInput = {
3461
+ contentType: Scalars['String']['input'];
3462
+ file: Scalars['String']['input'];
3463
+ filename: Scalars['String']['input'];
3464
+ projectId: Scalars['ID']['input'];
3465
+ };
3466
+
3214
3467
  export type UploadMyUserPictureInput = {
3215
3468
  contentType: Scalars['String']['input'];
3216
3469
  file: Scalars['String']['input'];
@@ -3498,3 +3751,62 @@ export type VerifyMfaRecoveryCodeInput = {
3498
3751
  export type VerifyMyMfaEnrollmentInput = {
3499
3752
  code: Scalars['String']['input'];
3500
3753
  };
3754
+
3755
+ export type WebhookDeliveryAttempt = {
3756
+ __typename?: 'WebhookDeliveryAttempt';
3757
+ attemptCount: Scalars['Int']['output'];
3758
+ createdAt: Scalars['Date']['output'];
3759
+ deliveredAt?: Maybe<Scalars['Date']['output']>;
3760
+ errorDetails?: Maybe<Scalars['JSON']['output']>;
3761
+ eventId: Scalars['ID']['output'];
3762
+ id: Scalars['ID']['output'];
3763
+ lastResponseStatus?: Maybe<Scalars['Int']['output']>;
3764
+ nextRetryAt?: Maybe<Scalars['Date']['output']>;
3765
+ status: WebhookDeliveryStatus;
3766
+ subscriptionId: Scalars['ID']['output'];
3767
+ updatedAt: Scalars['Date']['output'];
3768
+ };
3769
+
3770
+ export type WebhookDeliveryPage = {
3771
+ __typename?: 'WebhookDeliveryPage';
3772
+ hasNextPage: Scalars['Boolean']['output'];
3773
+ items: Array<WebhookDeliveryAttempt>;
3774
+ totalCount: Scalars['Int']['output'];
3775
+ };
3776
+
3777
+ export enum WebhookDeliveryStatus {
3778
+ Dead = 'dead',
3779
+ Delivered = 'delivered',
3780
+ Failed = 'failed',
3781
+ Pending = 'pending',
3782
+ Running = 'running',
3783
+ }
3784
+
3785
+ export type WebhookSubscription = {
3786
+ __typename?: 'WebhookSubscription';
3787
+ active: Scalars['Boolean']['output'];
3788
+ createdAt: Scalars['Date']['output'];
3789
+ createdById?: Maybe<Scalars['ID']['output']>;
3790
+ description?: Maybe<Scalars['String']['output']>;
3791
+ eventTypes: Array<Scalars['String']['output']>;
3792
+ id: Scalars['ID']['output'];
3793
+ projectId: Scalars['ID']['output'];
3794
+ updatedAt: Scalars['Date']['output'];
3795
+ url: Scalars['String']['output'];
3796
+ };
3797
+
3798
+ /** Returned only at creation or secret rotation. Store the secret immediately. */
3799
+ export type WebhookSubscriptionWithSecret = {
3800
+ __typename?: 'WebhookSubscriptionWithSecret';
3801
+ active: Scalars['Boolean']['output'];
3802
+ createdAt: Scalars['Date']['output'];
3803
+ createdById?: Maybe<Scalars['ID']['output']>;
3804
+ description?: Maybe<Scalars['String']['output']>;
3805
+ eventTypes: Array<Scalars['String']['output']>;
3806
+ id: Scalars['ID']['output'];
3807
+ projectId: Scalars['ID']['output'];
3808
+ /** Plaintext signing secret. Shown once; never returned by list/get/update. */
3809
+ secret: Scalars['String']['output'];
3810
+ updatedAt: Scalars['Date']['output'];
3811
+ url: Scalars['String']['output'];
3812
+ };
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './cdm/cdm-export-sections';
2
+ export * from './events';
2
3
  export * from './generated/graphql';
3
4
  export type {
4
5
  AccountResolvers,
@@ -25,6 +26,7 @@ export type {
25
26
  UserResolvers,
26
27
  } from './generated/resolvers';
27
28
  export * from './generated/schema-types';
29
+ export * from './notifications/notification.types';
28
30
  export type {
29
31
  ProjectAppPublicInfo,
30
32
  ProjectAppScopeInfo,
@@ -32,3 +34,4 @@ export type {
32
34
  ProjectConsentInfoUser,
33
35
  ProjectConsentRedirectResult,
34
36
  } from './project-oauth.types';
37
+ export * from './webhooks/webhook.types';
@@ -0,0 +1,21 @@
1
+ import type { EventCategory } from '../events/event-catalog';
2
+
3
+ export const NOTIFICATION_CHANNELS = ['in_app', 'email'] as const;
4
+
5
+ export const NOTIFICATION_STATUSES = ['pending', 'delivered', 'failed', 'dead'] as const;
6
+
7
+ export const NOTIFICATION_PREFERENCE_SOURCES = ['user', 'org_enforced'] as const;
8
+
9
+ export interface ListNotificationsInput {
10
+ unreadOnly?: boolean;
11
+ page?: number;
12
+ limit?: number;
13
+ }
14
+
15
+ export interface SetNotificationPreferenceInput {
16
+ scopeTenant: string;
17
+ scopeId?: string;
18
+ category: EventCategory;
19
+ channel: (typeof NOTIFICATION_CHANNELS)[number];
20
+ enabled: boolean;
21
+ }
@@ -0,0 +1,11 @@
1
+ mutation RotateApiKey($input: RotateApiKeyInput!) {
2
+ rotateApiKey(input: $input) {
3
+ id
4
+ clientId
5
+ clientSecret
6
+ name
7
+ description
8
+ expiresAt
9
+ createdAt
10
+ }
11
+ }
@@ -23,16 +23,9 @@ query GetGroups(
23
23
  metadata
24
24
  createdAt
25
25
  updatedAt
26
+ # IDs only — enough for inheritance maps; avoid nested permission.tags (N+1).
26
27
  permissions {
27
28
  id
28
- name
29
- action
30
- tags {
31
- id
32
- name
33
- color
34
- isPrimary
35
- }
36
29
  }
37
30
  tags {
38
31
  id
@@ -29,6 +29,12 @@ query GetGroupsList(
29
29
  color
30
30
  isPrimary
31
31
  }
32
+ tags {
33
+ id
34
+ name
35
+ color
36
+ isPrimary
37
+ }
32
38
  permissionCount
33
39
  tagCount
34
40
  }
@@ -0,0 +1,5 @@
1
+ mutation MarkAllMyNotificationsRead {
2
+ markAllMyNotificationsRead {
3
+ updated
4
+ }
5
+ }
@@ -0,0 +1,3 @@
1
+ mutation MarkMyNotificationRead($id: ID!) {
2
+ markMyNotificationRead(id: $id)
3
+ }
@@ -0,0 +1,11 @@
1
+ query MyNotificationPreferences($scopeTenant: String!) {
2
+ myNotificationPreferences(scopeTenant: $scopeTenant) {
3
+ id
4
+ scopeTenant
5
+ scopeId
6
+ category
7
+ channel
8
+ enabled
9
+ source
10
+ }
11
+ }
@@ -0,0 +1,26 @@
1
+ query MyNotifications($input: MyNotificationsInput) {
2
+ myNotifications(input: $input) {
3
+ notifications {
4
+ id
5
+ eventId
6
+ category
7
+ type
8
+ channel
9
+ title
10
+ body
11
+ refEntity
12
+ refId
13
+ scope {
14
+ tenant
15
+ id
16
+ }
17
+ status
18
+ seenAt
19
+ readAt
20
+ createdAt
21
+ }
22
+ totalCount
23
+ unreadCount
24
+ hasNextPage
25
+ }
26
+ }
@@ -0,0 +1,14 @@
1
+ query MyProjectMembership($projectId: ID!) {
2
+ myProjectMembership(projectId: $projectId) {
3
+ projectId
4
+ projectName
5
+ displayName
6
+ pictureUrl
7
+ metadata
8
+ role
9
+ joinedAt
10
+ organizationId
11
+ organizationName
12
+ accountId
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ query MyProjectMemberships {
2
+ myProjectMemberships {
3
+ projectId
4
+ projectName
5
+ displayName
6
+ pictureUrl
7
+ metadata
8
+ role
9
+ joinedAt
10
+ organizationId
11
+ organizationName
12
+ accountId
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ query MyUnreadNotificationCount {
2
+ myUnreadNotificationCount {
3
+ unreadCount
4
+ }
5
+ }