@grantjs/schema 1.4.2 → 1.5.1
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 +9 -9
- package/src/events/event-catalog.ts +214 -0
- package/src/events/event-envelope.ts +73 -0
- package/src/events/index.ts +2 -0
- package/src/generated/graphql.ts +1318 -111
- package/src/generated/resolvers.ts +628 -0
- package/src/generated/schema-types.ts +312 -0
- package/src/index.ts +3 -0
- package/src/notifications/notification.types.ts +21 -0
- package/src/operations/api-keys/rotate-api-key.graphql +11 -0
- package/src/operations/groups/getGroups.graphql +1 -8
- package/src/operations/groups/getGroupsList.graphql +6 -0
- package/src/operations/me/mark-all-my-notifications-read.graphql +5 -0
- package/src/operations/me/mark-my-notification-read.graphql +3 -0
- package/src/operations/me/my-notification-preferences.graphql +11 -0
- package/src/operations/me/my-notifications.graphql +26 -0
- package/src/operations/me/my-project-membership.graphql +14 -0
- package/src/operations/me/my-project-memberships.graphql +14 -0
- package/src/operations/me/my-unread-notification-count.graphql +5 -0
- package/src/operations/me/set-my-notification-preference.graphql +11 -0
- package/src/operations/me/update-my-project-membership.graphql +14 -0
- package/src/operations/me/upload-my-project-membership-picture.graphql +6 -0
- package/src/operations/roles/getRoles.graphql +1 -14
- package/src/operations/webhooks/create-webhook-subscription.graphql +13 -0
- package/src/operations/webhooks/delete-webhook-subscription.graphql +3 -0
- package/src/operations/webhooks/replay-webhook-delivery.graphql +11 -0
- package/src/operations/webhooks/rotate-webhook-subscription-secret.graphql +7 -0
- package/src/operations/webhooks/update-webhook-subscription.graphql +10 -0
- package/src/operations/webhooks/webhook-deliveries.graphql +31 -0
- package/src/operations/webhooks/webhook-subscription.graphql +13 -0
- package/src/operations/webhooks/webhook-subscriptions.graphql +13 -0
- package/src/schema/api-keys/inputs/rotate-api-key.graphql +4 -0
- package/src/schema/api-keys/mutations/rotate-api-key.graphql +7 -0
- package/src/schema/me/input/notification.graphql +16 -0
- package/src/schema/me/input/update-my-project-membership.graphql +5 -0
- package/src/schema/me/input/upload-my-project-membership-picture.graphql +6 -0
- package/src/schema/me/mutations/my-notifications.graphql +5 -0
- package/src/schema/me/mutations/update-my-project-membership.graphql +6 -0
- package/src/schema/me/mutations/upload-my-project-membership-picture.graphql +5 -0
- package/src/schema/me/queries/my-notifications.graphql +5 -0
- package/src/schema/me/queries/my-project-membership.graphql +6 -0
- package/src/schema/me/queries/my-project-memberships.graphql +6 -0
- package/src/schema/me/types/my-project-membership.graphql +12 -0
- package/src/schema/me/types/notification.graphql +63 -0
- package/src/schema/webhooks/inputs/webhook-subscription.graphql +33 -0
- package/src/schema/webhooks/mutations/webhook-subscriptions.graphql +33 -0
- package/src/schema/webhooks/queries/webhook-subscriptions.graphql +22 -0
- package/src/schema/webhooks/types/webhook-subscription.graphql +58 -0
- package/src/webhooks/webhook.types.ts +25 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
mutation UpdateMyProjectMembership($input: UpdateMyProjectMembershipInput!) {
|
|
2
|
+
updateMyProjectMembership(input: $input) {
|
|
3
|
+
projectId
|
|
4
|
+
projectName
|
|
5
|
+
displayName
|
|
6
|
+
pictureUrl
|
|
7
|
+
metadata
|
|
8
|
+
role
|
|
9
|
+
joinedAt
|
|
10
|
+
organizationId
|
|
11
|
+
organizationName
|
|
12
|
+
accountId
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -23,27 +23,14 @@ query GetRoles(
|
|
|
23
23
|
metadata
|
|
24
24
|
createdAt
|
|
25
25
|
updatedAt
|
|
26
|
+
# Group ids/names only — no nested group.tags (unused by attachment UIs).
|
|
26
27
|
groups {
|
|
27
28
|
id
|
|
28
29
|
name
|
|
29
|
-
tags {
|
|
30
|
-
id
|
|
31
|
-
name
|
|
32
|
-
color
|
|
33
|
-
isPrimary
|
|
34
|
-
}
|
|
35
30
|
}
|
|
36
31
|
rolePermissions {
|
|
37
32
|
id
|
|
38
33
|
permissionId
|
|
39
|
-
permission(scope: $scope) {
|
|
40
|
-
id
|
|
41
|
-
name
|
|
42
|
-
action
|
|
43
|
-
resource {
|
|
44
|
-
slug
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
34
|
}
|
|
48
35
|
tags {
|
|
49
36
|
id
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
query WebhookDeliveries(
|
|
2
|
+
$scope: Scope!
|
|
3
|
+
$subscriptionId: ID
|
|
4
|
+
$status: WebhookDeliveryStatus
|
|
5
|
+
$page: Int
|
|
6
|
+
$limit: Int
|
|
7
|
+
) {
|
|
8
|
+
webhookDeliveries(
|
|
9
|
+
scope: $scope
|
|
10
|
+
subscriptionId: $subscriptionId
|
|
11
|
+
status: $status
|
|
12
|
+
page: $page
|
|
13
|
+
limit: $limit
|
|
14
|
+
) {
|
|
15
|
+
items {
|
|
16
|
+
id
|
|
17
|
+
eventId
|
|
18
|
+
subscriptionId
|
|
19
|
+
status
|
|
20
|
+
attemptCount
|
|
21
|
+
nextRetryAt
|
|
22
|
+
lastResponseStatus
|
|
23
|
+
errorDetails
|
|
24
|
+
deliveredAt
|
|
25
|
+
createdAt
|
|
26
|
+
updatedAt
|
|
27
|
+
}
|
|
28
|
+
totalCount
|
|
29
|
+
hasNextPage
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
input MyNotificationsInput {
|
|
2
|
+
unreadOnly: Boolean
|
|
3
|
+
page: Int
|
|
4
|
+
limit: Int
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
input SetMyNotificationPreferenceInput {
|
|
8
|
+
scopeTenant: String!
|
|
9
|
+
scopeId: String
|
|
10
|
+
"""
|
|
11
|
+
Notification preference category (security, iam, membership, integrations).
|
|
12
|
+
"""
|
|
13
|
+
category: String!
|
|
14
|
+
channel: NotificationChannel!
|
|
15
|
+
enabled: Boolean!
|
|
16
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
enum NotificationChannel {
|
|
2
|
+
in_app
|
|
3
|
+
email
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
enum NotificationStatus {
|
|
7
|
+
pending
|
|
8
|
+
delivered
|
|
9
|
+
failed
|
|
10
|
+
dead
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
enum NotificationPreferenceSource {
|
|
14
|
+
user
|
|
15
|
+
org_enforced
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type NotificationEventScope {
|
|
19
|
+
tenant: String!
|
|
20
|
+
id: ID!
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type Notification {
|
|
24
|
+
id: ID!
|
|
25
|
+
eventId: ID!
|
|
26
|
+
category: String!
|
|
27
|
+
type: String!
|
|
28
|
+
channel: NotificationChannel!
|
|
29
|
+
title: String!
|
|
30
|
+
body: String
|
|
31
|
+
refEntity: String
|
|
32
|
+
refId: ID
|
|
33
|
+
scope: NotificationEventScope
|
|
34
|
+
status: NotificationStatus!
|
|
35
|
+
seenAt: Date
|
|
36
|
+
readAt: Date
|
|
37
|
+
createdAt: Date!
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type NotificationPage {
|
|
41
|
+
notifications: [Notification!]!
|
|
42
|
+
totalCount: Int!
|
|
43
|
+
unreadCount: Int!
|
|
44
|
+
hasNextPage: Boolean!
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type UnreadNotificationCount {
|
|
48
|
+
unreadCount: Int!
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type NotificationPreference {
|
|
52
|
+
id: ID!
|
|
53
|
+
scopeTenant: String!
|
|
54
|
+
scopeId: String!
|
|
55
|
+
category: String!
|
|
56
|
+
channel: NotificationChannel!
|
|
57
|
+
enabled: Boolean!
|
|
58
|
+
source: NotificationPreferenceSource!
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
type MarkAllNotificationsReadResult {
|
|
62
|
+
updated: Int!
|
|
63
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
input CreateWebhookSubscriptionMutationInput {
|
|
2
|
+
scope: Scope!
|
|
3
|
+
url: String!
|
|
4
|
+
"""
|
|
5
|
+
Domain event type filters (must be known catalog types).
|
|
6
|
+
"""
|
|
7
|
+
eventTypes: [String!]!
|
|
8
|
+
description: String
|
|
9
|
+
active: Boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
input UpdateWebhookSubscriptionMutationInput {
|
|
13
|
+
scope: Scope!
|
|
14
|
+
url: String
|
|
15
|
+
eventTypes: [String!]
|
|
16
|
+
description: String
|
|
17
|
+
active: Boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
input DeleteWebhookSubscriptionInput {
|
|
21
|
+
scope: Scope!
|
|
22
|
+
id: ID!
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input RotateWebhookSubscriptionSecretInput {
|
|
26
|
+
scope: Scope!
|
|
27
|
+
id: ID!
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
input ReplayWebhookDeliveryInput {
|
|
31
|
+
scope: Scope!
|
|
32
|
+
deliveryId: ID!
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
extend type Mutation {
|
|
2
|
+
"""
|
|
3
|
+
Create a project webhook subscription. The signing secret is returned once.
|
|
4
|
+
"""
|
|
5
|
+
createWebhookSubscription(
|
|
6
|
+
input: CreateWebhookSubscriptionMutationInput!
|
|
7
|
+
): WebhookSubscriptionWithSecret!
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
Update a webhook subscription URL, event filters, description, or active flag.
|
|
11
|
+
"""
|
|
12
|
+
updateWebhookSubscription(
|
|
13
|
+
id: ID!
|
|
14
|
+
input: UpdateWebhookSubscriptionMutationInput!
|
|
15
|
+
): WebhookSubscription!
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
Soft-delete a webhook subscription.
|
|
19
|
+
"""
|
|
20
|
+
deleteWebhookSubscription(input: DeleteWebhookSubscriptionInput!): Boolean!
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
Rotate the signing secret. The new secret is returned once.
|
|
24
|
+
"""
|
|
25
|
+
rotateWebhookSubscriptionSecret(
|
|
26
|
+
input: RotateWebhookSubscriptionSecretInput!
|
|
27
|
+
): WebhookSubscriptionWithSecret!
|
|
28
|
+
|
|
29
|
+
"""
|
|
30
|
+
Re-queue a delivery attempt for another POST.
|
|
31
|
+
"""
|
|
32
|
+
replayWebhookDelivery(input: ReplayWebhookDeliveryInput!): WebhookDeliveryAttempt!
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
extend type Query {
|
|
2
|
+
"""
|
|
3
|
+
List webhook subscriptions for a project scope.
|
|
4
|
+
"""
|
|
5
|
+
webhookSubscriptions(scope: Scope!): [WebhookSubscription!]!
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
Get a single webhook subscription by id.
|
|
9
|
+
"""
|
|
10
|
+
webhookSubscription(scope: Scope!, id: ID!): WebhookSubscription!
|
|
11
|
+
|
|
12
|
+
"""
|
|
13
|
+
List delivery attempts for a project (optionally filtered by subscription or status).
|
|
14
|
+
"""
|
|
15
|
+
webhookDeliveries(
|
|
16
|
+
scope: Scope!
|
|
17
|
+
subscriptionId: ID
|
|
18
|
+
status: WebhookDeliveryStatus
|
|
19
|
+
page: Int
|
|
20
|
+
limit: Int
|
|
21
|
+
): WebhookDeliveryPage!
|
|
22
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
enum WebhookDeliveryStatus {
|
|
2
|
+
pending
|
|
3
|
+
running
|
|
4
|
+
delivered
|
|
5
|
+
failed
|
|
6
|
+
dead
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type WebhookSubscription {
|
|
10
|
+
id: ID!
|
|
11
|
+
projectId: ID!
|
|
12
|
+
url: String!
|
|
13
|
+
eventTypes: [String!]!
|
|
14
|
+
active: Boolean!
|
|
15
|
+
description: String
|
|
16
|
+
createdById: ID
|
|
17
|
+
createdAt: Date!
|
|
18
|
+
updatedAt: Date!
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
Returned only at creation or secret rotation. Store the secret immediately.
|
|
23
|
+
"""
|
|
24
|
+
type WebhookSubscriptionWithSecret {
|
|
25
|
+
id: ID!
|
|
26
|
+
projectId: ID!
|
|
27
|
+
url: String!
|
|
28
|
+
eventTypes: [String!]!
|
|
29
|
+
active: Boolean!
|
|
30
|
+
description: String
|
|
31
|
+
createdById: ID
|
|
32
|
+
createdAt: Date!
|
|
33
|
+
updatedAt: Date!
|
|
34
|
+
"""
|
|
35
|
+
Plaintext signing secret. Shown once; never returned by list/get/update.
|
|
36
|
+
"""
|
|
37
|
+
secret: String!
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type WebhookDeliveryAttempt {
|
|
41
|
+
id: ID!
|
|
42
|
+
eventId: ID!
|
|
43
|
+
subscriptionId: ID!
|
|
44
|
+
status: WebhookDeliveryStatus!
|
|
45
|
+
attemptCount: Int!
|
|
46
|
+
nextRetryAt: Date
|
|
47
|
+
lastResponseStatus: Int
|
|
48
|
+
errorDetails: JSON
|
|
49
|
+
deliveredAt: Date
|
|
50
|
+
createdAt: Date!
|
|
51
|
+
updatedAt: Date!
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type WebhookDeliveryPage {
|
|
55
|
+
items: [WebhookDeliveryAttempt!]!
|
|
56
|
+
totalCount: Int!
|
|
57
|
+
hasNextPage: Boolean!
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { EventType } from '../events/event-catalog';
|
|
2
|
+
|
|
3
|
+
export const WEBHOOK_DELIVERY_STATUSES = [
|
|
4
|
+
'pending',
|
|
5
|
+
'running',
|
|
6
|
+
'delivered',
|
|
7
|
+
'failed',
|
|
8
|
+
'dead',
|
|
9
|
+
] as const;
|
|
10
|
+
|
|
11
|
+
/** Service-layer create payload (scope is passed separately). */
|
|
12
|
+
export interface CreateWebhookSubscriptionInput {
|
|
13
|
+
url: string;
|
|
14
|
+
eventTypes: EventType[];
|
|
15
|
+
description?: string | null;
|
|
16
|
+
active?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Service-layer update payload (scope is passed separately). */
|
|
20
|
+
export interface UpdateWebhookSubscriptionInput {
|
|
21
|
+
url?: string;
|
|
22
|
+
eventTypes?: EventType[];
|
|
23
|
+
description?: string | null;
|
|
24
|
+
active?: boolean;
|
|
25
|
+
}
|