From c115e2c9dcb52d6f2bd14aa223bc0ce380a512c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Fri, 13 Feb 2026 10:07:52 +0400 Subject: [PATCH] Update graphql schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- .../iam/InvitationCardMutation.graphql.ts | 126 +- .../MembershipsDropdownMenuQuery.graphql.ts | 77 +- .../iam/MembershipsPageQuery.graphql.ts | 111 +- ...PeopleListFragment_RefetchQuery.graphql.ts | 65 +- .../iam/PeoplePageQuery.graphql.ts | 73 +- .../iam/PersonFormMutation.graphql.ts | 4 +- .../iam/PersonPageQuery.graphql.ts | 57 +- .../SCIMEventListPaginationQuery.graphql.ts | 30 +- .../iam/SCIMSettingsPageQuery.graphql.ts | 30 +- .../ViewerMembershipLayoutQuery.graphql.ts | 42 +- pkg/coredata/membership.go | 110 +- pkg/coredata/membership_profile.go | 78 +- .../membership_profile_order_field.go | 7 +- pkg/coredata/migrations/20260212T163603Z.sql | 31 + pkg/iam/account_service.go | 26 - pkg/iam/organization_service.go | 29 - pkg/server/api/connect/v1/schema.graphql | 114 +- pkg/server/api/connect/v1/schema/schema.go | 3491 ++++++++--------- pkg/server/api/connect/v1/types/membership.go | 53 +- .../types/{identity_profile.go => profile.go} | 52 +- pkg/server/api/connect/v1/types/scim_event.go | 11 +- pkg/server/api/connect/v1/types/types.go | 103 +- pkg/server/api/connect/v1/v1_resolver.go | 288 +- 23 files changed, 2259 insertions(+), 2749 deletions(-) create mode 100644 pkg/coredata/migrations/20260212T163603Z.sql rename pkg/server/api/connect/v1/types/{identity_profile.go => profile.go} (56%) diff --git a/apps/console/src/__generated__/iam/InvitationCardMutation.graphql.ts b/apps/console/src/__generated__/iam/InvitationCardMutation.graphql.ts index 78378693d..6e8f5b33e 100644 --- a/apps/console/src/__generated__/iam/InvitationCardMutation.graphql.ts +++ b/apps/console/src/__generated__/iam/InvitationCardMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<2d970c5558233522bbd695a075469cad>> + * @generated SignedSource<<8369cd1e8f928481ea43a4e09f11a3f4>> * @lightSyntaxTransform * @nogrep */ @@ -15,7 +15,6 @@ export type AcceptInvitationInput = { }; export type InvitationCardMutation$variables = { input: AcceptInvitationInput; - membershipConnections: ReadonlyArray; pendingInvitationConnections: ReadonlyArray; }; export type InvitationCardMutation$data = { @@ -23,14 +22,9 @@ export type InvitationCardMutation$data = { readonly invitation: { readonly id: string; }; - readonly membershipEdge: { - readonly node: { - readonly id: string; - readonly organization: { - readonly name: string; - } | null | undefined; - readonly " $fragmentSpreads": FragmentRefs<"MembershipCardFragment">; - }; + readonly membership: { + readonly id: string; + readonly " $fragmentSpreads": FragmentRefs<"MembershipCardFragment">; }; } | null | undefined; }; @@ -46,11 +40,6 @@ var v0 = [ "kind": "LocalArgument", "name": "input" }, - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "membershipConnections" - }, { "defaultValue": null, "kind": "LocalArgument", @@ -70,13 +59,6 @@ v2 = { "kind": "ScalarField", "name": "id", "storageKey": null -}, -v3 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null }; return { "fragment": { @@ -108,39 +90,16 @@ return { { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "Membership", "kind": "LinkedField", - "name": "membershipEdge", + "name": "membership", "plural": false, "selections": [ + (v2/*: any*/), { - "alias": null, "args": null, - "concreteType": "Membership", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "MembershipCardFragment" - }, - { - "alias": null, - "args": null, - "concreteType": "Organization", - "kind": "LinkedField", - "name": "organization", - "plural": false, - "selections": [ - (v3/*: any*/) - ], - "storageKey": null - } - ], - "storageKey": null + "kind": "FragmentSpread", + "name": "MembershipCardFragment" } ], "storageKey": null @@ -197,57 +156,26 @@ return { { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "Membership", "kind": "LinkedField", - "name": "membershipEdge", + "name": "membership", "plural": false, "selections": [ + (v2/*: any*/), { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Session", "kind": "LinkedField", - "name": "node", + "name": "lastSession", "plural": false, "selections": [ (v2/*: any*/), { "alias": null, "args": null, - "concreteType": "Session", - "kind": "LinkedField", - "name": "lastSession", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "expiresAt", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "Organization", - "kind": "LinkedField", - "name": "organization", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "logoUrl", - "storageKey": null - } - ], + "kind": "ScalarField", + "name": "expiresAt", "storageKey": null } ], @@ -255,22 +183,6 @@ return { } ], "storageKey": null - }, - { - "alias": null, - "args": null, - "filters": null, - "handle": "prependEdge", - "key": "", - "kind": "LinkedHandle", - "name": "membershipEdge", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "membershipConnections" - } - ] } ], "storageKey": null @@ -278,16 +190,16 @@ return { ] }, "params": { - "cacheID": "15ed0089d35b0163252ef542a4b1b667", + "cacheID": "bebfc1241803845587648eaad4988fcb", "id": null, "metadata": {}, "name": "InvitationCardMutation", "operationKind": "mutation", - "text": "mutation InvitationCardMutation(\n $input: AcceptInvitationInput!\n) {\n acceptInvitation(input: $input) {\n invitation {\n id\n }\n membershipEdge {\n node {\n id\n ...MembershipCardFragment\n organization {\n name\n id\n }\n }\n }\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n organization {\n id\n name\n logoUrl\n }\n}\n" + "text": "mutation InvitationCardMutation(\n $input: AcceptInvitationInput!\n) {\n acceptInvitation(input: $input) {\n invitation {\n id\n }\n membership {\n id\n ...MembershipCardFragment\n }\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n}\n" } }; })(); -(node as any).hash = "587f3fc115f88830e5ee49759f3ab7b5"; +(node as any).hash = "32d7fb0d26660c95e87012d3b31068e8"; export default node; diff --git a/apps/console/src/__generated__/iam/MembershipsDropdownMenuQuery.graphql.ts b/apps/console/src/__generated__/iam/MembershipsDropdownMenuQuery.graphql.ts index 2e89a6b32..5f3830d9e 100644 --- a/apps/console/src/__generated__/iam/MembershipsDropdownMenuQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/MembershipsDropdownMenuQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -13,14 +13,17 @@ import { FragmentRefs } from "relay-runtime"; export type MembershipsDropdownMenuQuery$variables = Record; export type MembershipsDropdownMenuQuery$data = { readonly viewer: { - readonly memberships: { + readonly profiles: { readonly edges: ReadonlyArray<{ readonly node: { readonly id: string; + readonly membership: { + readonly " $fragmentSpreads": FragmentRefs<"MembershipsDropdownMenuItemFragment">; + } | null | undefined; readonly organization: { readonly name: string; + readonly " $fragmentSpreads": FragmentRefs<"MembershipsDropdownMenuItem_organizationFragment">; }; - readonly " $fragmentSpreads": FragmentRefs<"MembershipsDropdownMenuItemFragment">; }; }>; }; @@ -83,9 +86,9 @@ return { "field": { "alias": null, "args": (v0/*: any*/), - "concreteType": "MembershipConnection", + "concreteType": "ProfileConnection", "kind": "LinkedField", - "name": "memberships", + "name": "profiles", "plural": false, "selections": [ { @@ -93,7 +96,7 @@ return { "field": { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "ProfileEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -103,7 +106,7 @@ return { "field": { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", "name": "node", "plural": false, @@ -119,16 +122,32 @@ return { "name": "organization", "plural": false, "selections": [ - (v2/*: any*/) + (v2/*: any*/), + { + "args": null, + "kind": "FragmentSpread", + "name": "MembershipsDropdownMenuItem_organizationFragment" + } ], "storageKey": null }, "action": "THROW" }, { + "alias": null, "args": null, - "kind": "FragmentSpread", - "name": "MembershipsDropdownMenuItemFragment" + "concreteType": "Membership", + "kind": "LinkedField", + "name": "membership", + "plural": false, + "selections": [ + { + "args": null, + "kind": "FragmentSpread", + "name": "MembershipsDropdownMenuItemFragment" + } + ], + "storageKey": null } ], "storageKey": null @@ -141,7 +160,7 @@ return { "action": "THROW" } ], - "storageKey": "memberships(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" + "storageKey": "profiles(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" }, "action": "THROW" } @@ -171,15 +190,15 @@ return { { "alias": null, "args": (v0/*: any*/), - "concreteType": "MembershipConnection", + "concreteType": "ProfileConnection", "kind": "LinkedField", - "name": "memberships", + "name": "profiles", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "ProfileEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -187,7 +206,7 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", "name": "node", "plural": false, @@ -216,17 +235,29 @@ return { { "alias": null, "args": null, - "concreteType": "Session", + "concreteType": "Membership", "kind": "LinkedField", - "name": "lastSession", + "name": "membership", "plural": false, "selections": [ (v1/*: any*/), { "alias": null, "args": null, - "kind": "ScalarField", - "name": "expiresAt", + "concreteType": "Session", + "kind": "LinkedField", + "name": "lastSession", + "plural": false, + "selections": [ + (v1/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "expiresAt", + "storageKey": null + } + ], "storageKey": null } ], @@ -239,7 +270,7 @@ return { "storageKey": null } ], - "storageKey": "memberships(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" + "storageKey": "profiles(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" }, (v1/*: any*/) ], @@ -248,16 +279,16 @@ return { ] }, "params": { - "cacheID": "9295fb9d95666f4b397645e143b7e774", + "cacheID": "aaad8b2150ade721cdcbd9c3eb35318d", "id": null, "metadata": {}, "name": "MembershipsDropdownMenuQuery", "operationKind": "query", - "text": "query MembershipsDropdownMenuQuery {\n viewer {\n memberships(first: 1000, orderBy: {direction: ASC, field: ORGANIZATION_NAME}) {\n edges {\n node {\n id\n organization {\n name\n id\n }\n ...MembershipsDropdownMenuItemFragment\n }\n }\n }\n id\n }\n}\n\nfragment MembershipsDropdownMenuItemFragment on Membership {\n id\n lastSession {\n id\n expiresAt\n }\n organization {\n id\n logoUrl\n name\n }\n}\n" + "text": "query MembershipsDropdownMenuQuery {\n viewer {\n profiles(first: 1000, orderBy: {direction: ASC, field: ORGANIZATION_NAME}) {\n edges {\n node {\n id\n organization {\n name\n ...MembershipsDropdownMenuItem_organizationFragment\n id\n }\n membership {\n ...MembershipsDropdownMenuItemFragment\n id\n }\n }\n }\n }\n id\n }\n}\n\nfragment MembershipsDropdownMenuItemFragment on Membership {\n id\n lastSession {\n id\n expiresAt\n }\n}\n\nfragment MembershipsDropdownMenuItem_organizationFragment on Organization {\n id\n name\n logoUrl\n}\n" } }; })(); -(node as any).hash = "cd47570a10588c0e1c68240817141fd8"; +(node as any).hash = "14dbd79243ffb6104ff7315b78aa7990"; export default node; diff --git a/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts b/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts index 7a7401ace..2135da3a2 100644 --- a/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<3a268aba389df25968eb44b454150288>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -13,18 +13,6 @@ import { FragmentRefs } from "relay-runtime"; export type MembershipsPageQuery$variables = Record; export type MembershipsPageQuery$data = { readonly viewer: { - readonly memberships: { - readonly __id: string; - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; - readonly organization: { - readonly name: string; - }; - readonly " $fragmentSpreads": FragmentRefs<"MembershipCardFragment">; - }; - }>; - }; readonly pendingInvitations: { readonly __id: string; readonly edges: ReadonlyArray<{ @@ -34,6 +22,21 @@ export type MembershipsPageQuery$data = { }; }>; }; + readonly profiles: { + readonly __id: string; + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string; + readonly membership: { + readonly " $fragmentSpreads": FragmentRefs<"MembershipCardFragment">; + } | null | undefined; + readonly organization: { + readonly name: string; + readonly " $fragmentSpreads": FragmentRefs<"MembershipCard_organizationFragment">; + }; + }; + }>; + }; }; }; export type MembershipsPageQuery = { @@ -159,13 +162,13 @@ return { { "kind": "RequiredField", "field": { - "alias": "memberships", + "alias": "profiles", "args": [ (v0/*: any*/) ], - "concreteType": "MembershipConnection", + "concreteType": "ProfileConnection", "kind": "LinkedField", - "name": "__MembershipsPage_memberships_connection", + "name": "__MembershipsPage_profiles_connection", "plural": false, "selections": [ { @@ -173,7 +176,7 @@ return { "field": { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "ProfileEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -181,16 +184,27 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", "name": "node", "plural": false, "selections": [ (v1/*: any*/), { + "alias": null, "args": null, - "kind": "FragmentSpread", - "name": "MembershipCardFragment" + "concreteType": "Membership", + "kind": "LinkedField", + "name": "membership", + "plural": false, + "selections": [ + { + "args": null, + "kind": "FragmentSpread", + "name": "MembershipCardFragment" + } + ], + "storageKey": null }, { "kind": "RequiredField", @@ -202,7 +216,12 @@ return { "name": "organization", "plural": false, "selections": [ - (v2/*: any*/) + (v2/*: any*/), + { + "args": null, + "kind": "FragmentSpread", + "name": "MembershipCard_organizationFragment" + } ], "storageKey": null }, @@ -221,7 +240,7 @@ return { (v5/*: any*/), (v6/*: any*/) ], - "storageKey": "__MembershipsPage_memberships_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" + "storageKey": "__MembershipsPage_profiles_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" }, "action": "THROW" }, @@ -304,15 +323,15 @@ return { { "alias": null, "args": (v9/*: any*/), - "concreteType": "MembershipConnection", + "concreteType": "ProfileConnection", "kind": "LinkedField", - "name": "memberships", + "name": "profiles", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "ProfileEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -320,7 +339,7 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", "name": "node", "plural": false, @@ -329,19 +348,31 @@ return { { "alias": null, "args": null, - "concreteType": "Session", + "concreteType": "Membership", "kind": "LinkedField", - "name": "lastSession", + "name": "membership", "plural": false, "selections": [ - (v1/*: any*/), { "alias": null, "args": null, - "kind": "ScalarField", - "name": "expiresAt", + "concreteType": "Session", + "kind": "LinkedField", + "name": "lastSession", + "plural": false, + "selections": [ + (v1/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "expiresAt", + "storageKey": null + } + ], "storageKey": null - } + }, + (v1/*: any*/) ], "storageKey": null }, @@ -353,8 +384,8 @@ return { "name": "organization", "plural": false, "selections": [ - (v1/*: any*/), (v2/*: any*/), + (v1/*: any*/), { "alias": null, "args": null, @@ -376,16 +407,16 @@ return { (v5/*: any*/), (v6/*: any*/) ], - "storageKey": "memberships(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" + "storageKey": "profiles(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" }, { "alias": null, "args": (v9/*: any*/), "filters": (v10/*: any*/), "handle": "connection", - "key": "MembershipsPage_memberships", + "key": "MembershipsPage_profiles", "kind": "LinkedHandle", - "name": "memberships" + "name": "profiles" }, { "alias": null, @@ -468,7 +499,7 @@ return { ] }, "params": { - "cacheID": "9807cdf4aa713babb1639e4effd96e54", + "cacheID": "7bcb990f0e847ce0528d9df9ef6c1c94", "id": null, "metadata": { "connection": [ @@ -478,7 +509,7 @@ return { "direction": "forward", "path": [ "viewer", - "memberships" + "profiles" ] }, { @@ -494,11 +525,11 @@ return { }, "name": "MembershipsPageQuery", "operationKind": "query", - "text": "query MembershipsPageQuery {\n viewer {\n memberships(first: 1000, orderBy: {direction: ASC, field: ORGANIZATION_NAME}) {\n edges {\n node {\n id\n ...MembershipCardFragment\n organization {\n name\n id\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n pendingInvitations(first: 1000, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...InvitationCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n}\n\nfragment InvitationCardFragment on Invitation {\n id\n role\n createdAt\n organization {\n id\n name\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n organization {\n id\n name\n logoUrl\n }\n}\n" + "text": "query MembershipsPageQuery {\n viewer {\n profiles(first: 1000, orderBy: {direction: ASC, field: ORGANIZATION_NAME}) {\n edges {\n node {\n id\n membership {\n ...MembershipCardFragment\n id\n }\n organization {\n name\n ...MembershipCard_organizationFragment\n id\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n pendingInvitations(first: 1000, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...InvitationCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n}\n\nfragment InvitationCardFragment on Invitation {\n id\n role\n createdAt\n organization {\n id\n name\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n}\n\nfragment MembershipCard_organizationFragment on Organization {\n id\n name\n logoUrl\n}\n" } }; })(); -(node as any).hash = "7956b20535004550c271e1a520c95fe4"; +(node as any).hash = "05ac7c8fa236be3a01eeb28fc14ceb9d"; export default node; diff --git a/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts b/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts index 6f630eab8..34f786b59 100644 --- a/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<2fcd3cca1f1b02c835d906b3b2ebdcea>> + * @generated SignedSource<<5916f4df5b8113a300774131759cb218>> * @lightSyntaxTransform * @nogrep */ @@ -10,11 +10,11 @@ import { ConcreteRequest } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; -export type MembershipOrderField = "CREATED_AT" | "EMAIL_ADDRESS" | "FULL_NAME" | "ORGANIZATION_NAME" | "ROLE"; export type OrderDirection = "ASC" | "DESC"; -export type MembershipOrder = { +export type ProfileOrderField = "CREATED_AT" | "FULL_NAME" | "KIND" | "ORGANIZATION_NAME"; +export type ProfileOrder = { direction: OrderDirection; - field: MembershipOrderField; + field: ProfileOrderField; }; export type PeopleListFragment_RefetchQuery$variables = { after?: string | null | undefined; @@ -22,7 +22,7 @@ export type PeopleListFragment_RefetchQuery$variables = { first?: number | null | undefined; id: string; last?: number | null | undefined; - order?: MembershipOrder | null | undefined; + order?: ProfileOrder | null | undefined; }; export type PeopleListFragment_RefetchQuery$data = { readonly node: { @@ -193,9 +193,9 @@ return { { "alias": null, "args": (v13/*: any*/), - "concreteType": "MembershipConnection", + "concreteType": "ProfileConnection", "kind": "LinkedField", - "name": "members", + "name": "profiles", "plural": false, "selections": [ { @@ -208,7 +208,7 @@ return { { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "ProfileEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -216,7 +216,7 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", "name": "node", "plural": false, @@ -226,29 +226,29 @@ return { "alias": null, "args": null, "kind": "ScalarField", - "name": "role", + "name": "fullName", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", - "name": "source", + "name": "kind", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", - "name": "state", + "name": "position", "storageKey": null }, { "alias": null, "args": null, - "concreteType": "MembershipProfile", + "concreteType": "Membership", "kind": "LinkedField", - "name": "profile", + "name": "membership", "plural": false, "selections": [ (v12/*: any*/), @@ -256,22 +256,35 @@ return { "alias": null, "args": null, "kind": "ScalarField", - "name": "fullName", + "name": "role", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", - "name": "kind", + "name": "source", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", - "name": "position", + "name": "state", "storageKey": null + }, + { + "alias": "canUpdate", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:membership:update" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:membership:update\")" } ], "storageKey": null @@ -308,12 +321,12 @@ return { { "kind": "Literal", "name": "action", - "value": "iam:membership:update" + "value": "iam:membership-profile:update" } ], "kind": "ScalarField", "name": "permission", - "storageKey": "permission(action:\"iam:membership:update\")" + "storageKey": "permission(action:\"iam:membership-profile:update\")" }, { "alias": "canDelete", @@ -321,12 +334,12 @@ return { { "kind": "Literal", "name": "action", - "value": "iam:membership:delete" + "value": "iam:membership-profile:delete" } ], "kind": "ScalarField", "name": "permission", - "storageKey": "permission(action:\"iam:membership:delete\")" + "storageKey": "permission(action:\"iam:membership-profile:delete\")" }, (v11/*: any*/) ], @@ -403,9 +416,9 @@ return { "orderBy" ], "handle": "connection", - "key": "PeopleListFragment_members", + "key": "PeopleListFragment_profiles", "kind": "LinkedHandle", - "name": "members" + "name": "profiles" } ], "type": "Organization", @@ -417,16 +430,16 @@ return { ] }, "params": { - "cacheID": "7b0c4eff8642cc6d595afdd01f4a643e", + "cacheID": "3ed525921615d7910d784222c189566a", "id": null, "metadata": {}, "name": "PeopleListFragment_RefetchQuery", "operationKind": "query", - "text": "query PeopleListFragment_RefetchQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 20\n $last: Int = null\n $order: MembershipOrder = {direction: ASC, field: FULL_NAME}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...PeopleListFragment_16fISc\n id\n }\n}\n\nfragment PeopleListFragment_16fISc on Organization {\n members(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Membership {\n id\n role\n source\n state\n profile {\n id\n fullName\n kind\n position\n }\n identity {\n email\n id\n }\n createdAt\n canUpdate: permission(action: \"iam:membership:update\")\n canDelete: permission(action: \"iam:membership:delete\")\n}\n" + "text": "query PeopleListFragment_RefetchQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 20\n $last: Int = null\n $order: ProfileOrder = {direction: ASC, field: FULL_NAME}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...PeopleListFragment_16fISc\n id\n }\n}\n\nfragment PeopleListFragment_16fISc on Organization {\n profiles(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n fullName\n kind\n position\n membership {\n id\n role\n source\n state\n canUpdate: permission(action: \"iam:membership:update\")\n }\n identity {\n email\n id\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n}\n" } }; })(); -(node as any).hash = "c62c77bc2ef0e36b7eaf4553cc721e0c"; +(node as any).hash = "ee3aeca404063a0660eeb9ff27592e86"; export default node; diff --git a/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts b/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts index df8deb745..b17b19b7b 100644 --- a/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<06a60a60cf7ca339c25395a94906774a>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -21,8 +21,8 @@ export type PeoplePageQuery$data = { readonly $updatableFragmentSpreads: FragmentRefs<"PeoplePage_invitationsTotalCountFragment">; readonly totalCount: number | null | undefined; }; - readonly members: { - readonly totalCount: number | null | undefined; + readonly profiles: { + readonly totalCount: number; }; readonly " $fragmentSpreads": FragmentRefs<"InvitationListFragment" | "PeopleListFragment">; } | { @@ -118,14 +118,14 @@ v11 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "role", + "name": "fullName", "storageKey": null }, v12 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "fullName", + "name": "role", "storageKey": null }, v13 = { @@ -230,14 +230,14 @@ return { "field": { "alias": null, "args": (v6/*: any*/), - "concreteType": "MembershipConnection", + "concreteType": "ProfileConnection", "kind": "LinkedField", - "name": "members", + "name": "profiles", "plural": false, "selections": [ (v7/*: any*/) ], - "storageKey": "members(first:20,orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" + "storageKey": "profiles(first:20,orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" }, "action": "THROW" }, @@ -322,16 +322,16 @@ return { { "alias": null, "args": (v6/*: any*/), - "concreteType": "MembershipConnection", + "concreteType": "ProfileConnection", "kind": "LinkedField", - "name": "members", + "name": "profiles", "plural": false, "selections": [ (v7/*: any*/), { "alias": null, "args": null, - "concreteType": "MembershipEdge", + "concreteType": "ProfileEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -339,7 +339,7 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", "name": "node", "plural": false, @@ -350,22 +350,22 @@ return { "alias": null, "args": null, "kind": "ScalarField", - "name": "source", + "name": "kind", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", - "name": "state", + "name": "position", "storageKey": null }, { "alias": null, "args": null, - "concreteType": "MembershipProfile", + "concreteType": "Membership", "kind": "LinkedField", - "name": "profile", + "name": "membership", "plural": false, "selections": [ (v10/*: any*/), @@ -374,15 +374,28 @@ return { "alias": null, "args": null, "kind": "ScalarField", - "name": "kind", + "name": "source", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", - "name": "position", + "name": "state", "storageKey": null + }, + { + "alias": "canUpdate", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:membership:update" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:membership:update\")" } ], "storageKey": null @@ -407,12 +420,12 @@ return { { "kind": "Literal", "name": "action", - "value": "iam:membership:update" + "value": "iam:membership-profile:update" } ], "kind": "ScalarField", "name": "permission", - "storageKey": "permission(action:\"iam:membership:update\")" + "storageKey": "permission(action:\"iam:membership-profile:update\")" }, { "alias": "canDelete", @@ -420,12 +433,12 @@ return { { "kind": "Literal", "name": "action", - "value": "iam:membership:delete" + "value": "iam:membership-profile:delete" } ], "kind": "ScalarField", "name": "permission", - "storageKey": "permission(action:\"iam:membership:delete\")" + "storageKey": "permission(action:\"iam:membership-profile:delete\")" }, (v2/*: any*/) ], @@ -438,16 +451,16 @@ return { (v16/*: any*/), (v17/*: any*/) ], - "storageKey": "members(first:20,orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" + "storageKey": "profiles(first:20,orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" }, { "alias": null, "args": (v6/*: any*/), "filters": (v18/*: any*/), "handle": "connection", - "key": "PeopleListFragment_members", + "key": "PeopleListFragment_profiles", "kind": "LinkedHandle", - "name": "members" + "name": "profiles" }, { "alias": null, @@ -476,9 +489,9 @@ return { "plural": false, "selections": [ (v10/*: any*/), - (v12/*: any*/), - (v13/*: any*/), (v11/*: any*/), + (v13/*: any*/), + (v12/*: any*/), { "alias": null, "args": null, @@ -539,16 +552,16 @@ return { ] }, "params": { - "cacheID": "425e73a84c96979c3b380c17512c744a", + "cacheID": "d13993ce884669894f65925a714aeaa6", "id": null, "metadata": {}, "name": "PeoplePageQuery", "operationKind": "query", - "text": "query PeoplePageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n canInviteUser: permission(action: \"iam:invitation:create\")\n members(first: 20, orderBy: {direction: ASC, field: FULL_NAME}) {\n totalCount\n }\n ...PeopleListFragment_8lnpd\n invitations(first: 20, orderBy: {direction: DESC, field: CREATED_AT}) {\n totalCount\n __typename\n }\n ...InvitationListFragment_1PypFi\n }\n id\n }\n}\n\nfragment InvitationListFragment_1PypFi on Organization {\n invitations(first: 20, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...InvitationListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment InvitationListItemFragment on Invitation {\n id\n fullName\n email\n role\n status\n createdAt\n acceptedAt\n canDelete: permission(action: \"iam:invitation:delete\")\n}\n\nfragment PeopleListFragment_8lnpd on Organization {\n members(first: 20, orderBy: {direction: ASC, field: FULL_NAME}) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Membership {\n id\n role\n source\n state\n profile {\n id\n fullName\n kind\n position\n }\n identity {\n email\n id\n }\n createdAt\n canUpdate: permission(action: \"iam:membership:update\")\n canDelete: permission(action: \"iam:membership:delete\")\n}\n" + "text": "query PeoplePageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n canInviteUser: permission(action: \"iam:invitation:create\")\n profiles(first: 20, orderBy: {direction: ASC, field: FULL_NAME}) {\n totalCount\n }\n ...PeopleListFragment_8lnpd\n invitations(first: 20, orderBy: {direction: DESC, field: CREATED_AT}) {\n totalCount\n __typename\n }\n ...InvitationListFragment_1PypFi\n }\n id\n }\n}\n\nfragment InvitationListFragment_1PypFi on Organization {\n invitations(first: 20, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...InvitationListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment InvitationListItemFragment on Invitation {\n id\n fullName\n email\n role\n status\n createdAt\n acceptedAt\n canDelete: permission(action: \"iam:invitation:delete\")\n}\n\nfragment PeopleListFragment_8lnpd on Organization {\n profiles(first: 20, orderBy: {direction: ASC, field: FULL_NAME}) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n fullName\n kind\n position\n membership {\n id\n role\n source\n state\n canUpdate: permission(action: \"iam:membership:update\")\n }\n identity {\n email\n id\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n}\n" } }; })(); -(node as any).hash = "9ab9d1a720b23dd78bdb82530a30b6f3"; +(node as any).hash = "4cb0d9ec65b3a55eb1decb4de36ac2d8"; export default node; diff --git a/apps/console/src/__generated__/iam/PersonFormMutation.graphql.ts b/apps/console/src/__generated__/iam/PersonFormMutation.graphql.ts index 6721164e7..9d9c12d97 100644 --- a/apps/console/src/__generated__/iam/PersonFormMutation.graphql.ts +++ b/apps/console/src/__generated__/iam/PersonFormMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -60,7 +60,7 @@ v1 = [ { "alias": null, "args": null, - "concreteType": "MembershipProfile", + "concreteType": "Profile", "kind": "LinkedField", "name": "profile", "plural": false, diff --git a/apps/console/src/__generated__/iam/PersonPageQuery.graphql.ts b/apps/console/src/__generated__/iam/PersonPageQuery.graphql.ts index a4d3c37c4..ec6c7a476 100644 --- a/apps/console/src/__generated__/iam/PersonPageQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/PersonPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<405fdde1b279cf7336ca395457041b93>> * @lightSyntaxTransform * @nogrep */ @@ -15,13 +15,15 @@ export type PersonPageQuery$variables = { }; export type PersonPageQuery$data = { readonly person: { - readonly __typename: "MembershipProfile"; + readonly __typename: "Profile"; readonly canDelete: boolean; readonly fullName: string; readonly identity: { readonly email: string; }; - readonly membershipId: string; + readonly membership: { + readonly id: string; + } | null | undefined; readonly " $fragmentSpreads": FragmentRefs<"PersonFormFragment">; } | { // This will never be '%other', but we need some @@ -67,17 +69,29 @@ v4 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "membershipId", + "name": "id", "storageKey": null }, v5 = { + "alias": null, + "args": null, + "concreteType": "Membership", + "kind": "LinkedField", + "name": "membership", + "plural": false, + "selections": [ + (v4/*: any*/) + ], + "storageKey": null +}, +v6 = { "alias": null, "args": null, "kind": "ScalarField", "name": "email", "storageKey": null }, -v6 = { +v7 = { "alias": "canDelete", "args": [ { @@ -89,13 +103,6 @@ v6 = { "kind": "ScalarField", "name": "permission", "storageKey": "permission(action:\"iam:membership-profile:delete\")" -}, -v7 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null }; return { "fragment": { @@ -119,7 +126,7 @@ return { "kind": "InlineFragment", "selections": [ (v3/*: any*/), - (v4/*: any*/), + (v5/*: any*/), { "kind": "RequiredField", "field": { @@ -130,20 +137,20 @@ return { "name": "identity", "plural": false, "selections": [ - (v5/*: any*/) + (v6/*: any*/) ], "storageKey": null }, "action": "THROW" }, - (v6/*: any*/), + (v7/*: any*/), { "args": null, "kind": "FragmentSpread", "name": "PersonFormFragment" } ], - "type": "MembershipProfile", + "type": "Profile", "abstractKey": null } ], @@ -170,12 +177,12 @@ return { "plural": false, "selections": [ (v2/*: any*/), - (v7/*: any*/), + (v4/*: any*/), { "kind": "InlineFragment", "selections": [ (v3/*: any*/), - (v4/*: any*/), + (v5/*: any*/), { "alias": null, "args": null, @@ -184,12 +191,12 @@ return { "name": "identity", "plural": false, "selections": [ - (v5/*: any*/), - (v7/*: any*/) + (v6/*: any*/), + (v4/*: any*/) ], "storageKey": null }, - (v6/*: any*/), + (v7/*: any*/), { "alias": null, "args": null, @@ -239,7 +246,7 @@ return { "storageKey": "permission(action:\"iam:membership-profile:update\")" } ], - "type": "MembershipProfile", + "type": "Profile", "abstractKey": null } ], @@ -248,16 +255,16 @@ return { ] }, "params": { - "cacheID": "f754630a84c19798f2b0611dba4c6603", + "cacheID": "e148eb605cc90b57c6c7772b9045217d", "id": null, "metadata": {}, "name": "PersonPageQuery", "operationKind": "query", - "text": "query PersonPageQuery(\n $personId: ID!\n) {\n person: node(id: $personId) {\n __typename\n ... on MembershipProfile {\n fullName\n membershipId\n identity {\n email\n id\n }\n canDelete: permission(action: \"iam:membership-profile:delete\")\n ...PersonFormFragment\n }\n id\n }\n}\n\nfragment PersonFormFragment on MembershipProfile {\n id\n fullName\n kind\n position\n additionalEmailAddresses\n contractStartDate\n contractEndDate\n canUpdate: permission(action: \"iam:membership-profile:update\")\n}\n" + "text": "query PersonPageQuery(\n $personId: ID!\n) {\n person: node(id: $personId) {\n __typename\n ... on Profile {\n fullName\n membership {\n id\n }\n identity {\n email\n id\n }\n canDelete: permission(action: \"iam:membership-profile:delete\")\n ...PersonFormFragment\n }\n id\n }\n}\n\nfragment PersonFormFragment on Profile {\n id\n fullName\n kind\n position\n additionalEmailAddresses\n contractStartDate\n contractEndDate\n canUpdate: permission(action: \"iam:membership-profile:update\")\n}\n" } }; })(); -(node as any).hash = "d701ae3a51eb1fed62aec260f42b3c41"; +(node as any).hash = "24863216f5484c1fae7ff6ad002a7f8c"; export default node; diff --git a/apps/console/src/__generated__/iam/SCIMEventListPaginationQuery.graphql.ts b/apps/console/src/__generated__/iam/SCIMEventListPaginationQuery.graphql.ts index 41ba0c6a3..335e1fab0 100644 --- a/apps/console/src/__generated__/iam/SCIMEventListPaginationQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/SCIMEventListPaginationQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<22d63f81020d1e99f7cdb84fc23913a4>> * @lightSyntaxTransform * @nogrep */ @@ -224,31 +224,19 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", - "name": "membership", + "name": "profile", "plural": false, "selections": [ - (v8/*: any*/), { "alias": null, "args": null, - "concreteType": "MembershipProfile", - "kind": "LinkedField", - "name": "profile", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "fullName", - "storageKey": null - }, - (v8/*: any*/) - ], + "kind": "ScalarField", + "name": "fullName", "storageKey": null - } + }, + (v8/*: any*/) ], "storageKey": null }, @@ -327,12 +315,12 @@ return { ] }, "params": { - "cacheID": "eea534b94a74bce26338555fbb71364e", + "cacheID": "58b36de1b4c1f54de6433a95b297b570", "id": null, "metadata": {}, "name": "SCIMEventListPaginationQuery", "operationKind": "query", - "text": "query SCIMEventListPaginationQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 20\n $last: Int = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...SCIMEventListFragment_pbnwq\n id\n }\n}\n\nfragment SCIMEventListFragment_pbnwq on SCIMConfiguration {\n events(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...SCIMEventListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment SCIMEventListItemFragment on SCIMEvent {\n id\n method\n path\n statusCode\n errorMessage\n ipAddress\n createdAt\n membership {\n id\n profile {\n fullName\n id\n }\n }\n}\n" + "text": "query SCIMEventListPaginationQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 20\n $last: Int = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...SCIMEventListFragment_pbnwq\n id\n }\n}\n\nfragment SCIMEventListFragment_pbnwq on SCIMConfiguration {\n events(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n ...SCIMEventListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment SCIMEventListItemFragment on SCIMEvent {\n method\n path\n statusCode\n errorMessage\n ipAddress\n createdAt\n profile {\n fullName\n id\n }\n}\n" } }; })(); diff --git a/apps/console/src/__generated__/iam/SCIMSettingsPageQuery.graphql.ts b/apps/console/src/__generated__/iam/SCIMSettingsPageQuery.graphql.ts index 39a5e59dc..bd81109ee 100644 --- a/apps/console/src/__generated__/iam/SCIMSettingsPageQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/SCIMSettingsPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<339e086642b09eb0bacbc51601014fe7>> * @lightSyntaxTransform * @nogrep */ @@ -277,31 +277,19 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", - "name": "membership", + "name": "profile", "plural": false, "selections": [ - (v3/*: any*/), { "alias": null, "args": null, - "concreteType": "MembershipProfile", - "kind": "LinkedField", - "name": "profile", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "fullName", - "storageKey": null - }, - (v3/*: any*/) - ], + "kind": "ScalarField", + "name": "fullName", "storageKey": null - } + }, + (v3/*: any*/) ], "storageKey": null }, @@ -416,12 +404,12 @@ return { ] }, "params": { - "cacheID": "1074234a9a3734270b5da7420dea2ec6", + "cacheID": "3d49152bd3fd384a0b1de3d012268ebe", "id": null, "metadata": {}, "name": "SCIMSettingsPageQuery", "operationKind": "query", - "text": "query SCIMSettingsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n scimConfiguration {\n id\n bridge {\n id\n }\n ...SCIMEventListFragment\n }\n ...SCIMConfigurationFragment\n ...ConnectorListFragment\n }\n id\n }\n}\n\nfragment ConnectorListFragment on Organization {\n scimConfiguration {\n ...GoogleWorkspaceConnectorFragment\n id\n }\n}\n\nfragment GoogleWorkspaceConnectorFragment on SCIMConfiguration {\n id\n bridge {\n id\n excludedUserNames\n connector {\n id\n createdAt\n }\n }\n}\n\nfragment SCIMConfigurationFragment on Organization {\n canCreateSCIMConfiguration: permission(action: \"iam:scim-configuration:create\")\n canDeleteSCIMConfiguration: permission(action: \"iam:scim-configuration:delete\")\n scimConfiguration {\n id\n endpointUrl\n bridge {\n id\n }\n }\n}\n\nfragment SCIMEventListFragment on SCIMConfiguration {\n events(first: 20) {\n edges {\n node {\n id\n ...SCIMEventListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment SCIMEventListItemFragment on SCIMEvent {\n id\n method\n path\n statusCode\n errorMessage\n ipAddress\n createdAt\n membership {\n id\n profile {\n fullName\n id\n }\n }\n}\n" + "text": "query SCIMSettingsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n scimConfiguration {\n id\n bridge {\n id\n }\n ...SCIMEventListFragment\n }\n ...SCIMConfigurationFragment\n ...ConnectorListFragment\n }\n id\n }\n}\n\nfragment ConnectorListFragment on Organization {\n scimConfiguration {\n ...GoogleWorkspaceConnectorFragment\n id\n }\n}\n\nfragment GoogleWorkspaceConnectorFragment on SCIMConfiguration {\n id\n bridge {\n id\n excludedUserNames\n connector {\n id\n createdAt\n }\n }\n}\n\nfragment SCIMConfigurationFragment on Organization {\n canCreateSCIMConfiguration: permission(action: \"iam:scim-configuration:create\")\n canDeleteSCIMConfiguration: permission(action: \"iam:scim-configuration:delete\")\n scimConfiguration {\n id\n endpointUrl\n bridge {\n id\n }\n }\n}\n\nfragment SCIMEventListFragment on SCIMConfiguration {\n events(first: 20) {\n edges {\n node {\n id\n ...SCIMEventListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment SCIMEventListItemFragment on SCIMEvent {\n method\n path\n statusCode\n errorMessage\n ipAddress\n createdAt\n profile {\n fullName\n id\n }\n}\n" } }; })(); diff --git a/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts b/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts index e15363d0c..485235676 100644 --- a/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -18,11 +18,11 @@ export type ViewerMembershipLayoutQuery$variables = { export type ViewerMembershipLayoutQuery$data = { readonly organization: { readonly __typename: "Organization"; - readonly viewerMembership: { - readonly profile: { - readonly fullName: string; + readonly viewer: { + readonly fullName: string; + readonly membership: { + readonly role: MembershipRole; }; - readonly role: MembershipRole; }; readonly " $fragmentSpreads": FragmentRefs<"MembershipsDropdown_organizationFragment" | "SidebarFragment" | "ViewerMembershipDropdownFragment">; } | { @@ -72,14 +72,14 @@ v4 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "role", + "name": "fullName", "storageKey": null }, v5 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "fullName", + "name": "role", "storageKey": null }, v6 = { @@ -154,9 +154,9 @@ return { "field": { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", - "name": "viewerMembership", + "name": "viewer", "plural": false, "selections": [ (v4/*: any*/), @@ -165,9 +165,9 @@ return { "field": { "alias": null, "args": null, - "concreteType": "MembershipProfile", + "concreteType": "Membership", "kind": "LinkedField", - "name": "profile", + "name": "membership", "plural": false, "selections": [ (v5/*: any*/) @@ -266,11 +266,12 @@ return { { "alias": null, "args": null, - "concreteType": "Membership", + "concreteType": "Profile", "kind": "LinkedField", - "name": "viewerMembership", + "name": "viewer", "plural": false, "selections": [ + (v4/*: any*/), { "alias": null, "args": null, @@ -297,21 +298,20 @@ return { ], "storageKey": null }, + (v8/*: any*/), { "alias": null, "args": null, - "concreteType": "MembershipProfile", + "concreteType": "Membership", "kind": "LinkedField", - "name": "profile", + "name": "membership", "plural": false, "selections": [ (v5/*: any*/), (v8/*: any*/) ], "storageKey": null - }, - (v8/*: any*/), - (v4/*: any*/) + } ], "storageKey": null }, @@ -618,16 +618,16 @@ return { ] }, "params": { - "cacheID": "a553750ba3bad35fb5b3ed7c1bebcbb4", + "cacheID": "63f113e3848e77978d2caee55ca07ed4", "id": null, "metadata": {}, "name": "ViewerMembershipLayoutQuery", "operationKind": "query", - "text": "query ViewerMembershipLayoutQuery(\n $organizationId: ID!\n $hideSidebar: Boolean!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n ...MembershipsDropdown_organizationFragment\n ...ViewerMembershipDropdownFragment\n ...SidebarFragment @skip(if: $hideSidebar)\n viewerMembership {\n role\n profile {\n fullName\n id\n }\n id\n }\n }\n id\n }\n viewer {\n email\n ...MembershipsDropdown_viewerFragment\n pendingInvitations {\n totalCount\n }\n id\n }\n}\n\nfragment MembershipsDropdown_organizationFragment on Organization {\n name\n}\n\nfragment MembershipsDropdown_viewerFragment on Identity {\n pendingInvitations {\n totalCount\n }\n}\n\nfragment SidebarFragment on Organization {\n canListMeetings: permission(action: \"core:meeting:list\")\n canListTasks: permission(action: \"core:task:list\")\n canListMeasures: permission(action: \"core:measure:list\")\n canListRisks: permission(action: \"core:risk:list\")\n canListFrameworks: permission(action: \"core:framework:list\")\n canListMembers: permission(action: \"iam:membership:list\")\n canListVendors: permission(action: \"core:vendor:list\")\n canListDocuments: permission(action: \"core:document:list\")\n canListAssets: permission(action: \"core:asset:list\")\n canListData: permission(action: \"core:datum:list\")\n canListAudits: permission(action: \"core:audit:list\")\n canListNonconformities: permission(action: \"core:nonconformity:list\")\n canListObligations: permission(action: \"core:obligation:list\")\n canListContinualImprovements: permission(action: \"core:continual-improvement:list\")\n canListProcessingActivities: permission(action: \"core:processing-activity:list\")\n canListRightsRequests: permission(action: \"core:rights-request:list\")\n canListSnapshots: permission(action: \"core:snapshot:list\")\n canGetTrustCenter: permission(action: \"core:trust-center:get\")\n canUpdateOrganization: permission(action: \"iam:organization:update\")\n canListStatesOfApplicability: permission(action: \"core:state-of-applicability:list\")\n}\n\nfragment ViewerMembershipDropdownFragment on Organization {\n viewerMembership {\n identity {\n email\n canListAPIKeys: permission(action: \"iam:personal-api-key:list\")\n id\n }\n profile {\n fullName\n id\n }\n id\n }\n}\n" + "text": "query ViewerMembershipLayoutQuery(\n $organizationId: ID!\n $hideSidebar: Boolean!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n ...MembershipsDropdown_organizationFragment\n ...ViewerMembershipDropdownFragment\n ...SidebarFragment @skip(if: $hideSidebar)\n viewer {\n fullName\n membership {\n role\n id\n }\n id\n }\n }\n id\n }\n viewer {\n email\n ...MembershipsDropdown_viewerFragment\n pendingInvitations {\n totalCount\n }\n id\n }\n}\n\nfragment MembershipsDropdown_organizationFragment on Organization {\n name\n}\n\nfragment MembershipsDropdown_viewerFragment on Identity {\n pendingInvitations {\n totalCount\n }\n}\n\nfragment SidebarFragment on Organization {\n canListMeetings: permission(action: \"core:meeting:list\")\n canListTasks: permission(action: \"core:task:list\")\n canListMeasures: permission(action: \"core:measure:list\")\n canListRisks: permission(action: \"core:risk:list\")\n canListFrameworks: permission(action: \"core:framework:list\")\n canListMembers: permission(action: \"iam:membership:list\")\n canListVendors: permission(action: \"core:vendor:list\")\n canListDocuments: permission(action: \"core:document:list\")\n canListAssets: permission(action: \"core:asset:list\")\n canListData: permission(action: \"core:datum:list\")\n canListAudits: permission(action: \"core:audit:list\")\n canListNonconformities: permission(action: \"core:nonconformity:list\")\n canListObligations: permission(action: \"core:obligation:list\")\n canListContinualImprovements: permission(action: \"core:continual-improvement:list\")\n canListProcessingActivities: permission(action: \"core:processing-activity:list\")\n canListRightsRequests: permission(action: \"core:rights-request:list\")\n canListSnapshots: permission(action: \"core:snapshot:list\")\n canGetTrustCenter: permission(action: \"core:trust-center:get\")\n canUpdateOrganization: permission(action: \"iam:organization:update\")\n canListStatesOfApplicability: permission(action: \"core:state-of-applicability:list\")\n}\n\nfragment ViewerMembershipDropdownFragment on Organization {\n viewer {\n fullName\n identity {\n email\n canListAPIKeys: permission(action: \"iam:personal-api-key:list\")\n id\n }\n id\n }\n}\n" } }; })(); -(node as any).hash = "298aba62d7920932f86433919c623d4c"; +(node as any).hash = "1ca4734452833d75388f7409315cf715"; export default node; diff --git a/pkg/coredata/membership.go b/pkg/coredata/membership.go index 6d234e86e..81664868e 100644 --- a/pkg/coredata/membership.go +++ b/pkg/coredata/membership.go @@ -31,17 +31,16 @@ import ( type ( Membership struct { - ID gid.GID `db:"id"` - IdentityID gid.GID `db:"identity_id"` - OrganizationID gid.GID `db:"organization_id"` - Role MembershipRole `db:"role"` - Source MembershipSource `db:"source"` - State MembershipState `db:"state"` - FullName string `db:"full_name"` - EmailAddress mail.Addr `db:"email_address"` - OrganizationName string `db:"organization_name"` - CreatedAt time.Time `db:"created_at"` - UpdatedAt time.Time `db:"updated_at"` + ID gid.GID `db:"id"` + IdentityID gid.GID `db:"identity_id"` + OrganizationID gid.GID `db:"organization_id"` + Role MembershipRole `db:"role"` + Source MembershipSource `db:"source"` + State MembershipState `db:"state"` + FullName string `db:"full_name"` + EmailAddress mail.Addr `db:"email_address"` + CreatedAt time.Time `db:"created_at"` + UpdatedAt time.Time `db:"updated_at"` } Memberships []*Membership @@ -49,8 +48,6 @@ type ( func (m Membership) CursorKey(orderBy MembershipOrderField) page.CursorKey { switch orderBy { - case MembershipOrderFieldOrganizationName: - return page.NewCursorKey(m.ID, m.OrganizationName) case MembershipOrderFieldFullName: return page.NewCursorKey(m.ID, m.FullName) case MembershipOrderFieldEmailAddress: @@ -426,93 +423,6 @@ WHERE return nil } -func (m *Memberships) LoadByIdentityID( - ctx context.Context, - conn pg.Conn, - scope Scoper, - identityID gid.GID, - cursor *page.Cursor[MembershipOrderField], -) error { - query := ` -WITH mbr AS ( - SELECT - id, - identity_id, - organization_id, - role, - source, - state, - created_at, - updated_at - FROM - iam_memberships - WHERE - identity_id = @identity_id - AND state = 'ACTIVE' - AND %s -), -r AS ( - SELECT - mbr.id, - mbr.identity_id, - mbr.organization_id, - mbr.role, - mbr.source, - mbr.state, - COALESCE(mp.full_name, i.full_name, '') as full_name, - i.email_address, - o.name as organization_name, - mbr.created_at, - mbr.updated_at - FROM - mbr - JOIN - identities i ON mbr.identity_id = i.id - JOIN - organizations o ON mbr.organization_id = o.id - LEFT JOIN - iam_membership_profiles mp ON mp.membership_id = mbr.id -) -SELECT - id, - identity_id, - organization_id, - role, - source, - state, - full_name, - email_address, - organization_name, - created_at, - updated_at -FROM - r -WHERE - %s -` - - query = fmt.Sprintf(query, scope.SQLFragment(), cursor.SQLFragment()) - - args := pgx.StrictNamedArgs{ - "identity_id": identityID, - } - maps.Copy(args, scope.SQLArguments()) - maps.Copy(args, cursor.SQLArguments()) - - rows, err := conn.Query(ctx, query, args) - if err != nil { - return fmt.Errorf("cannot query memberships: %w", err) - } - - memberships, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Membership]) - if err != nil { - return fmt.Errorf("cannot collect memberships: %w", err) - } - - *m = memberships - return nil -} - func (m *Memberships) LoadByOrganizationID( ctx context.Context, conn pg.Conn, diff --git a/pkg/coredata/membership_profile.go b/pkg/coredata/membership_profile.go index ac7ebe812..e694304d5 100644 --- a/pkg/coredata/membership_profile.go +++ b/pkg/coredata/membership_profile.go @@ -40,6 +40,7 @@ type ( Position *string `db:"position"` ContractStartDate *time.Time `db:"contract_start_date"` ContractEndDate *time.Time `db:"contract_end_date"` + OrganizationName string `db:"organization_name"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` } @@ -55,6 +56,8 @@ func (p MembershipProfile) CursorKey(orderBy MembershipProfileOrderField) page.C return page.NewCursorKey(p.ID, p.FullName) case MembershipProfileOrderFieldKind: return page.NewCursorKey(p.ID, p.Kind) + case MembershipProfileOrderFieldOrganizationName: + return page.NewCursorKey(p.ID, p.OrganizationName) } panic(fmt.Sprintf("unsupported order by: %s", orderBy)) @@ -307,6 +310,75 @@ INNER JOIN identities i ON i.id = p.identity_id return nil } +func (p *MembershipProfiles) LoadByIdentityID( + ctx context.Context, + conn pg.Conn, + scope Scoper, + identityID gid.GID, + cursor *page.Cursor[MembershipProfileOrderField], + filter *MembershipProfileFilter, +) error { + q := ` +WITH profiles AS ( + SELECT + id, + identity_id, + organization_id, + full_name, + kind, + additional_email_addresses, + position, + contract_start_date, + contract_end_date, + created_at, + updated_at + FROM + iam_membership_profiles + WHERE + %s + AND identity_id = @identity_id + AND %s + AND %s +) +SELECT + p.id, + p.identity_id, + p.organization_id, + i.email_address, + p.full_name, + p.kind, + p.additional_email_addresses, + p.position, + p.contract_start_date, + p.contract_end_date, + o.name AS organization_name, + p.created_at, + p.updated_at +FROM profiles p +INNER JOIN identities i ON i.id = p.identity_id +INNER JOIN organizations o ON o.id = p.organization_id +` + + q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment()) + + args := pgx.NamedArgs{"identity_id": identityID} + maps.Copy(args, scope.SQLArguments()) + + rows, err := conn.Query(ctx, q, args) + if err != nil { + return fmt.Errorf("cannot query profiles: %w", err) + } + + profiles, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[MembershipProfile]) + if err != nil { + return fmt.Errorf("cannot collect profiles: %w", err) + } + + *p = profiles + + return nil +} + func (p *MembershipProfiles) LoadByDocumentID( ctx context.Context, conn pg.Conn, @@ -320,7 +392,6 @@ WITH profiles AS ( mp.id, mp.identity_id, mp.organization_id, - mp.membership_id, mp.full_name, mp.kind, mp.additional_email_addresses, @@ -344,7 +415,6 @@ SELECT p.id, p.identity_id, p.organization_id, - p.membership_id, i.email_address, p.full_name, p.kind, @@ -423,7 +493,6 @@ WITH profiles AS ( mp.id, mp.identity_id, mp.organization_id, - mp.membership_id, mp.full_name, mp.kind, mp.additional_email_addresses, @@ -447,7 +516,6 @@ SELECT p.id, p.identity_id, p.organization_id, - p.membership_id, i.email_address, p.full_name, p.kind, @@ -654,7 +722,7 @@ FROM iam_membership_profiles WHERE %s - AND %s + AND %s AND organization_id = @organization_id ` diff --git a/pkg/coredata/membership_profile_order_field.go b/pkg/coredata/membership_profile_order_field.go index f89db5e03..8cc64a4d2 100644 --- a/pkg/coredata/membership_profile_order_field.go +++ b/pkg/coredata/membership_profile_order_field.go @@ -19,9 +19,10 @@ type ( ) const ( - MembershipProfileOrderFieldCreatedAt MembershipProfileOrderField = "CREATED_AT" - MembershipProfileOrderFieldFullName MembershipProfileOrderField = "FULL_NAME" - MembershipProfileOrderFieldKind MembershipProfileOrderField = "KIND" + MembershipProfileOrderFieldCreatedAt MembershipProfileOrderField = "CREATED_AT" + MembershipProfileOrderFieldFullName MembershipProfileOrderField = "FULL_NAME" + MembershipProfileOrderFieldKind MembershipProfileOrderField = "KIND" + MembershipProfileOrderFieldOrganizationName MembershipProfileOrderField = "ORGANIZATION_NAME" ) func (p MembershipProfileOrderField) Column() string { diff --git a/pkg/coredata/migrations/20260212T163603Z.sql b/pkg/coredata/migrations/20260212T163603Z.sql new file mode 100644 index 000000000..0179c827e --- /dev/null +++ b/pkg/coredata/migrations/20260212T163603Z.sql @@ -0,0 +1,31 @@ +ALTER TABLE + iam_memberships +ADD + COLUMN profile_id REFERENCES iam_membership_profiles(id); + +UPDATE + iam_memberships m +SET + profile_id = p.id +FROM + iam_membership_profiles p +WHERE + p.membership_id = m.id; + +DROP INDEX authz_memberships_user_id_organization_id_key; + +DROP INDEX idx_iam_memberships_identity_tenant_org; + +CREATE UNIQUE INDEX idx_iam_memberships_profile_id_idx ON iam_memberships(profile_id); + +ALTER TABLE + iam_memberships +ALTER COLUMN + profile_id +SET + NOT NULL, + DROP COLUMN organization_id, + DROP COLUMN identity_id; + +ALTER TABLE + iam_membership_profiles DROP COLUMN membership_id; diff --git a/pkg/iam/account_service.go b/pkg/iam/account_service.go index 49ec8534d..3cf8ae422 100644 --- a/pkg/iam/account_service.go +++ b/pkg/iam/account_service.go @@ -384,32 +384,6 @@ func (s *AccountService) CountPendingInvitations( return count, nil } -func (s *AccountService) ListMemberships( - ctx context.Context, - identityID gid.GID, - cursor *page.Cursor[coredata.MembershipOrderField], -) (*page.Page[*coredata.Membership, coredata.MembershipOrderField], error) { - var memberships coredata.Memberships - - err := s.pg.WithConn( - ctx, - func(conn pg.Conn) error { - err := memberships.LoadByIdentityID(ctx, conn, coredata.NewNoScope(), identityID, cursor) - if err != nil { - return fmt.Errorf("cannot load memberships: %w", err) - } - - return nil - }, - ) - - if err != nil { - return nil, err - } - - return page.NewPage(memberships, cursor), nil -} - func (s *AccountService) CountMemberships( ctx context.Context, identityID gid.GID, diff --git a/pkg/iam/organization_service.go b/pkg/iam/organization_service.go index 03b343cdc..a97d4388d 100644 --- a/pkg/iam/organization_service.go +++ b/pkg/iam/organization_service.go @@ -944,35 +944,6 @@ func (s *OrganizationService) DeleteOrganization(ctx context.Context, organizati ) } -func (s *OrganizationService) ListMembers( - ctx context.Context, - organizationID gid.GID, - cursor *page.Cursor[coredata.MembershipOrderField], -) (*page.Page[*coredata.Membership, coredata.MembershipOrderField], error) { - var ( - scope = coredata.NewScopeFromObjectID(organizationID) - memberships = coredata.Memberships{} - ) - - err := s.pg.WithConn( - ctx, - func(conn pg.Conn) error { - err := memberships.LoadByOrganizationID(ctx, conn, scope, organizationID, cursor, coredata.NewMembershipFilter()) - if err != nil { - return fmt.Errorf("cannot load memberships: %w", err) - } - - return nil - }, - ) - - if err != nil { - return nil, err - } - - return page.NewPage(memberships, cursor), nil -} - func (s *OrganizationService) UpdateProfile(ctx context.Context, req *UpdateProfileRequest) (*coredata.MembershipProfile, error) { if err := req.Validate(); err != nil { return nil, fmt.Errorf("invalid request: %w", err) diff --git a/pkg/server/api/connect/v1/schema.graphql b/pkg/server/api/connect/v1/schema.graphql index d151a6f53..147f8114c 100644 --- a/pkg/server/api/connect/v1/schema.graphql +++ b/pkg/server/api/connect/v1/schema.graphql @@ -138,13 +138,13 @@ type Identity implements Node { createdAt: Datetime! updatedAt: Datetime! - memberships( + profiles( first: Int after: CursorKey last: Int before: CursorKey - orderBy: MembershipOrder - ): MembershipConnection @goField(forceResolver: true) + orderBy: ProfileOrder + ): ProfileConnection @goField(forceResolver: true) pendingInvitations( first: Int @@ -178,7 +178,7 @@ type Identity implements Node { @session(required: PRESENT) } -type MembershipProfile implements Node { +type Profile implements Node { id: ID! fullName: String! additionalEmailAddresses: [EmailAddr!]! @@ -191,9 +191,7 @@ type MembershipProfile implements Node { identity: Identity @goField(forceResolver: true) organization: Organization @goField(forceResolver: true) - - # FIXME: remove when memberships are under profile - membershipId: ID! + membership: Membership @goField(forceResolver: true) permission(action: String!): Boolean! @goField(forceResolver: true) @@ -212,13 +210,13 @@ type Organization implements Node { createdAt: Datetime! updatedAt: Datetime! - members( + profiles( first: Int after: CursorKey last: Int before: CursorKey - orderBy: MembershipOrder - ): MembershipConnection @goField(forceResolver: true) + orderBy: ProfileOrder + ): ProfileConnection @goField(forceResolver: true) invitations( first: Int @@ -238,7 +236,7 @@ type Organization implements Node { scimConfiguration: SCIMConfiguration @goField(forceResolver: true) - viewerMembership: Membership @goField(forceResolver: true) + viewer: Profile @goField(forceResolver: true) permission(action: String!): Boolean! @goField(forceResolver: true) @@ -285,9 +283,6 @@ enum MembershipState type Membership implements Node { id: ID! createdAt: Datetime! - identity: Identity @goField(forceResolver: true) - profile: MembershipProfile @goField(forceResolver: true) - organization: Organization @goField(forceResolver: true) role: MembershipRole! source: MembershipSource! state: MembershipState! @@ -445,7 +440,7 @@ type SCIMEvent implements Node { requestBody: String responseBody: String errorMessage: String - membership: Membership @goField(forceResolver: true) + profile: Profile @goField(forceResolver: true) ipAddress: String! createdAt: Datetime! @@ -483,50 +478,6 @@ enum ReauthenticationReason { POLICY_REQUIREMENT } -enum MembershipOrderField - @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipOrderField") { - FULL_NAME - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldFullName" - ) - ORGANIZATION_NAME - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldOrganizationName" - ) - EMAIL_ADDRESS - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldEmailAddress" - ) - ROLE - @goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldRole") - CREATED_AT - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldCreatedAt" - ) -} - -input MembershipOrder - @goModel( - model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.MembershipOrderBy" - ) { - direction: OrderDirection! - field: MembershipOrderField! -} - -type MembershipConnection - @goModel( - model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.MembershipConnection" - ) { - edges: [MembershipEdge!]! - pageInfo: PageInfo! - totalCount: Int @goField(forceResolver: true) -} - -type MembershipEdge { - node: Membership! - cursor: CursorKey! -} - enum InvitationOrderField @goModel(model: "go.probo.inc/probo/pkg/coredata.InvitationOrderField") { FULL_NAME @@ -573,6 +524,45 @@ type InvitationEdge { cursor: CursorKey! } +enum ProfileOrderField + @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderField") { + FULL_NAME + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldFullName" + ) + CREATED_AT + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldCreatedAt" + ) + KIND @goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldKind") + ORGANIZATION_NAME + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldOrganizationName" + ) +} + +input ProfileOrder + @goModel( + model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.ProfileOrderBy" + ) { + direction: OrderDirection! + field: ProfileOrderField! +} + +type ProfileConnection + @goModel( + model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.ProfileConnection" + ) { + totalCount: Int @goField(forceResolver: true) + edges: [ProfileEdge!]! + pageInfo: PageInfo! +} + +type ProfileEdge { + cursor: CursorKey! + node: Profile! +} + type SessionConnection @goModel( model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.SessionConnection" @@ -885,7 +875,7 @@ type RevokePersonalAPIKeyPayload { type CreateOrganizationPayload { organization: Organization - membershipEdge: MembershipEdge! + membership: Membership! } type UpdateOrganizationPayload { @@ -905,7 +895,7 @@ type InviteMemberPayload { } type UpdateProfilePayload { - profile: MembershipProfile! + profile: Profile! } type UpdateMembershipPayload { @@ -917,7 +907,7 @@ type RemoveMemberPayload { } type AcceptInvitationPayload { - membershipEdge: MembershipEdge! + membership: Membership! invitation: Invitation! } diff --git a/pkg/server/api/connect/v1/schema/schema.go b/pkg/server/api/connect/v1/schema/schema.go index 249c4a311..05ebdbe9b 100644 --- a/pkg/server/api/connect/v1/schema/schema.go +++ b/pkg/server/api/connect/v1/schema/schema.go @@ -52,12 +52,12 @@ type ResolverRoot interface { Invitation() InvitationResolver InvitationConnection() InvitationConnectionResolver Membership() MembershipResolver - MembershipConnection() MembershipConnectionResolver - MembershipProfile() MembershipProfileResolver Mutation() MutationResolver Organization() OrganizationResolver PersonalAPIKey() PersonalAPIKeyResolver PersonalAPIKeyConnection() PersonalAPIKeyConnectionResolver + Profile() ProfileResolver + ProfileConnection() ProfileConnectionResolver Query() QueryResolver SAMLConfiguration() SAMLConfigurationResolver SAMLConfigurationConnection() SAMLConfigurationConnectionResolver @@ -75,8 +75,8 @@ type DirectiveRoot struct { type ComplexityRoot struct { AcceptInvitationPayload struct { - Invitation func(childComplexity int) int - MembershipEdge func(childComplexity int) int + Invitation func(childComplexity int) int + Membership func(childComplexity int) int } AssumeOrganizationSessionPayload struct { @@ -100,8 +100,8 @@ type ComplexityRoot struct { } CreateOrganizationPayload struct { - MembershipEdge func(childComplexity int) int - Organization func(childComplexity int) int + Membership func(childComplexity int) int + Organization func(childComplexity int) int } CreatePersonalAPIKeyPayload struct { @@ -149,10 +149,10 @@ type ComplexityRoot struct { EmailVerified func(childComplexity int) int FullName func(childComplexity int) int ID func(childComplexity int) int - Memberships func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MembershipOrderBy) int PendingInvitations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.InvitationOrderBy) int Permission func(childComplexity int, action string) int PersonalAPIKeys func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey) int + Profiles func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProfileOrderBy) int Sessions func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.SessionOrder) int SsoLoginURL func(childComplexity int) int UpdatedAt func(childComplexity int) int @@ -187,43 +187,13 @@ type ComplexityRoot struct { } Membership struct { - CreatedAt func(childComplexity int) int - ID func(childComplexity int) int - Identity func(childComplexity int) int - LastSession func(childComplexity int) int - Organization func(childComplexity int) int - Permission func(childComplexity int, action string) int - Profile func(childComplexity int) int - Role func(childComplexity int) int - Source func(childComplexity int) int - State func(childComplexity int) int - } - - MembershipConnection struct { - Edges func(childComplexity int) int - PageInfo func(childComplexity int) int - TotalCount func(childComplexity int) int - } - - MembershipEdge struct { - Cursor func(childComplexity int) int - Node func(childComplexity int) int - } - - MembershipProfile struct { - AdditionalEmailAddresses func(childComplexity int) int - ContractEndDate func(childComplexity int) int - ContractStartDate func(childComplexity int) int - CreatedAt func(childComplexity int) int - FullName func(childComplexity int) int - ID func(childComplexity int) int - Identity func(childComplexity int) int - Kind func(childComplexity int) int - MembershipID func(childComplexity int) int - Organization func(childComplexity int) int - Permission func(childComplexity int, action string) int - Position func(childComplexity int) int - UpdatedAt func(childComplexity int) int + CreatedAt func(childComplexity int) int + ID func(childComplexity int) int + LastSession func(childComplexity int) int + Permission func(childComplexity int, action string) int + Role func(childComplexity int) int + Source func(childComplexity int) int + State func(childComplexity int) int } Mutation struct { @@ -269,13 +239,13 @@ type ComplexityRoot struct { ID func(childComplexity int) int Invitations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, status *coredata.InvitationStatus, orderBy *types.InvitationOrderBy) int LogoURL func(childComplexity int) int - Members func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MembershipOrderBy) int Name func(childComplexity int) int Permission func(childComplexity int, action string) int + Profiles func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProfileOrderBy) int SamlConfigurations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey) int ScimConfiguration func(childComplexity int) int UpdatedAt func(childComplexity int) int - ViewerMembership func(childComplexity int) int + Viewer func(childComplexity int) int WebsiteURL func(childComplexity int) int } @@ -316,6 +286,33 @@ type ComplexityRoot struct { Node func(childComplexity int) int } + Profile struct { + AdditionalEmailAddresses func(childComplexity int) int + ContractEndDate func(childComplexity int) int + ContractStartDate func(childComplexity int) int + CreatedAt func(childComplexity int) int + FullName func(childComplexity int) int + ID func(childComplexity int) int + Identity func(childComplexity int) int + Kind func(childComplexity int) int + Membership func(childComplexity int) int + Organization func(childComplexity int) int + Permission func(childComplexity int, action string) int + Position func(childComplexity int) int + UpdatedAt func(childComplexity int) int + } + + ProfileConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + ProfileEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + Query struct { Node func(childComplexity int, id gid.GID) int SsoLoginURL func(childComplexity int, email mail.Addr) int @@ -414,10 +411,10 @@ type ComplexityRoot struct { ErrorMessage func(childComplexity int) int ID func(childComplexity int) int IPAddress func(childComplexity int) int - Membership func(childComplexity int) int Method func(childComplexity int) int Path func(childComplexity int) int Permission func(childComplexity int, action string) int + Profile func(childComplexity int) int RequestBody func(childComplexity int) int ResponseBody func(childComplexity int) int StatusCode func(childComplexity int) int @@ -502,7 +499,7 @@ type ConnectorResolver interface { Permission(ctx context.Context, obj *types.Connector, action string) (bool, error) } type IdentityResolver interface { - Memberships(ctx context.Context, obj *types.Identity, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MembershipOrderBy) (*types.MembershipConnection, error) + Profiles(ctx context.Context, obj *types.Identity, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProfileOrderBy) (*types.ProfileConnection, error) PendingInvitations(ctx context.Context, obj *types.Identity, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.InvitationOrderBy) (*types.InvitationConnection, error) Sessions(ctx context.Context, obj *types.Identity, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.SessionOrder) (*types.SessionConnection, error) PersonalAPIKeys(ctx context.Context, obj *types.Identity, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.PersonalAPIKeyConnection, error) @@ -517,22 +514,9 @@ type InvitationConnectionResolver interface { TotalCount(ctx context.Context, obj *types.InvitationConnection) (*int, error) } type MembershipResolver interface { - Identity(ctx context.Context, obj *types.Membership) (*types.Identity, error) - Profile(ctx context.Context, obj *types.Membership) (*types.MembershipProfile, error) - Organization(ctx context.Context, obj *types.Membership) (*types.Organization, error) - LastSession(ctx context.Context, obj *types.Membership) (*types.Session, error) Permission(ctx context.Context, obj *types.Membership, action string) (bool, error) } -type MembershipConnectionResolver interface { - TotalCount(ctx context.Context, obj *types.MembershipConnection) (*int, error) -} -type MembershipProfileResolver interface { - Identity(ctx context.Context, obj *types.MembershipProfile) (*types.Identity, error) - Organization(ctx context.Context, obj *types.MembershipProfile) (*types.Organization, error) - - Permission(ctx context.Context, obj *types.MembershipProfile, action string) (bool, error) -} type MutationResolver interface { SignIn(ctx context.Context, input types.SignInInput) (*types.SignInPayload, error) SignUp(ctx context.Context, input types.SignUpInput) (*types.SignUpPayload, error) @@ -570,11 +554,11 @@ type OrganizationResolver interface { LogoURL(ctx context.Context, obj *types.Organization) (*string, error) HorizontalLogoURL(ctx context.Context, obj *types.Organization) (*string, error) - Members(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MembershipOrderBy) (*types.MembershipConnection, error) + Profiles(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProfileOrderBy) (*types.ProfileConnection, error) Invitations(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, status *coredata.InvitationStatus, orderBy *types.InvitationOrderBy) (*types.InvitationConnection, error) SamlConfigurations(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.SAMLConfigurationConnection, error) ScimConfiguration(ctx context.Context, obj *types.Organization) (*types.SCIMConfiguration, error) - ViewerMembership(ctx context.Context, obj *types.Organization) (*types.Membership, error) + Viewer(ctx context.Context, obj *types.Organization) (*types.Profile, error) Permission(ctx context.Context, obj *types.Organization, action string) (bool, error) } type PersonalAPIKeyResolver interface { @@ -584,6 +568,15 @@ type PersonalAPIKeyResolver interface { type PersonalAPIKeyConnectionResolver interface { TotalCount(ctx context.Context, obj *types.PersonalAPIKeyConnection) (*int, error) } +type ProfileResolver interface { + Identity(ctx context.Context, obj *types.Profile) (*types.Identity, error) + Organization(ctx context.Context, obj *types.Profile) (*types.Organization, error) + Membership(ctx context.Context, obj *types.Profile) (*types.Membership, error) + Permission(ctx context.Context, obj *types.Profile, action string) (bool, error) +} +type ProfileConnectionResolver interface { + TotalCount(ctx context.Context, obj *types.ProfileConnection) (*int, error) +} type QueryResolver interface { Node(ctx context.Context, id gid.GID) (types.Node, error) Viewer(ctx context.Context) (*types.Identity, error) @@ -612,7 +605,7 @@ type SCIMConfigurationResolver interface { Permission(ctx context.Context, obj *types.SCIMConfiguration, action string) (bool, error) } type SCIMEventResolver interface { - Membership(ctx context.Context, obj *types.SCIMEvent) (*types.Membership, error) + Profile(ctx context.Context, obj *types.SCIMEvent) (*types.Profile, error) Permission(ctx context.Context, obj *types.SCIMEvent, action string) (bool, error) } @@ -653,12 +646,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.AcceptInvitationPayload.Invitation(childComplexity), true - case "AcceptInvitationPayload.membershipEdge": - if e.complexity.AcceptInvitationPayload.MembershipEdge == nil { + case "AcceptInvitationPayload.membership": + if e.complexity.AcceptInvitationPayload.Membership == nil { break } - return e.complexity.AcceptInvitationPayload.MembershipEdge(childComplexity), true + return e.complexity.AcceptInvitationPayload.Membership(childComplexity), true case "AssumeOrganizationSessionPayload.result": if e.complexity.AssumeOrganizationSessionPayload.Result == nil { @@ -717,12 +710,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.Connector.UpdatedAt(childComplexity), true - case "CreateOrganizationPayload.membershipEdge": - if e.complexity.CreateOrganizationPayload.MembershipEdge == nil { + case "CreateOrganizationPayload.membership": + if e.complexity.CreateOrganizationPayload.Membership == nil { break } - return e.complexity.CreateOrganizationPayload.MembershipEdge(childComplexity), true + return e.complexity.CreateOrganizationPayload.Membership(childComplexity), true case "CreateOrganizationPayload.organization": if e.complexity.CreateOrganizationPayload.Organization == nil { break @@ -841,17 +834,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Identity.ID(childComplexity), true - case "Identity.memberships": - if e.complexity.Identity.Memberships == nil { - break - } - - args, err := ec.field_Identity_memberships_args(ctx, rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Identity.Memberships(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.MembershipOrderBy)), true case "Identity.pendingInvitations": if e.complexity.Identity.PendingInvitations == nil { break @@ -885,6 +867,17 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Identity.PersonalAPIKeys(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey)), true + case "Identity.profiles": + if e.complexity.Identity.Profiles == nil { + break + } + + args, err := ec.field_Identity_profiles_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Identity.Profiles(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.ProfileOrderBy)), true case "Identity.sessions": if e.complexity.Identity.Sessions == nil { break @@ -1026,24 +1019,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Membership.ID(childComplexity), true - case "Membership.identity": - if e.complexity.Membership.Identity == nil { - break - } - - return e.complexity.Membership.Identity(childComplexity), true case "Membership.lastSession": if e.complexity.Membership.LastSession == nil { break } return e.complexity.Membership.LastSession(childComplexity), true - case "Membership.organization": - if e.complexity.Membership.Organization == nil { - break - } - - return e.complexity.Membership.Organization(childComplexity), true case "Membership.permission": if e.complexity.Membership.Permission == nil { break @@ -1055,12 +1036,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Membership.Permission(childComplexity, args["action"].(string)), true - case "Membership.profile": - if e.complexity.Membership.Profile == nil { - break - } - - return e.complexity.Membership.Profile(childComplexity), true case "Membership.role": if e.complexity.Membership.Role == nil { break @@ -1080,122 +1055,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.Membership.State(childComplexity), true - case "MembershipConnection.edges": - if e.complexity.MembershipConnection.Edges == nil { - break - } - - return e.complexity.MembershipConnection.Edges(childComplexity), true - case "MembershipConnection.pageInfo": - if e.complexity.MembershipConnection.PageInfo == nil { - break - } - - return e.complexity.MembershipConnection.PageInfo(childComplexity), true - case "MembershipConnection.totalCount": - if e.complexity.MembershipConnection.TotalCount == nil { - break - } - - return e.complexity.MembershipConnection.TotalCount(childComplexity), true - - case "MembershipEdge.cursor": - if e.complexity.MembershipEdge.Cursor == nil { - break - } - - return e.complexity.MembershipEdge.Cursor(childComplexity), true - case "MembershipEdge.node": - if e.complexity.MembershipEdge.Node == nil { - break - } - - return e.complexity.MembershipEdge.Node(childComplexity), true - - case "MembershipProfile.additionalEmailAddresses": - if e.complexity.MembershipProfile.AdditionalEmailAddresses == nil { - break - } - - return e.complexity.MembershipProfile.AdditionalEmailAddresses(childComplexity), true - case "MembershipProfile.contractEndDate": - if e.complexity.MembershipProfile.ContractEndDate == nil { - break - } - - return e.complexity.MembershipProfile.ContractEndDate(childComplexity), true - case "MembershipProfile.contractStartDate": - if e.complexity.MembershipProfile.ContractStartDate == nil { - break - } - - return e.complexity.MembershipProfile.ContractStartDate(childComplexity), true - case "MembershipProfile.createdAt": - if e.complexity.MembershipProfile.CreatedAt == nil { - break - } - - return e.complexity.MembershipProfile.CreatedAt(childComplexity), true - case "MembershipProfile.fullName": - if e.complexity.MembershipProfile.FullName == nil { - break - } - - return e.complexity.MembershipProfile.FullName(childComplexity), true - case "MembershipProfile.id": - if e.complexity.MembershipProfile.ID == nil { - break - } - - return e.complexity.MembershipProfile.ID(childComplexity), true - case "MembershipProfile.identity": - if e.complexity.MembershipProfile.Identity == nil { - break - } - - return e.complexity.MembershipProfile.Identity(childComplexity), true - case "MembershipProfile.kind": - if e.complexity.MembershipProfile.Kind == nil { - break - } - - return e.complexity.MembershipProfile.Kind(childComplexity), true - case "MembershipProfile.membershipId": - if e.complexity.MembershipProfile.MembershipID == nil { - break - } - - return e.complexity.MembershipProfile.MembershipID(childComplexity), true - case "MembershipProfile.organization": - if e.complexity.MembershipProfile.Organization == nil { - break - } - - return e.complexity.MembershipProfile.Organization(childComplexity), true - case "MembershipProfile.permission": - if e.complexity.MembershipProfile.Permission == nil { - break - } - - args, err := ec.field_MembershipProfile_permission_args(ctx, rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.MembershipProfile.Permission(childComplexity, args["action"].(string)), true - case "MembershipProfile.position": - if e.complexity.MembershipProfile.Position == nil { - break - } - - return e.complexity.MembershipProfile.Position(childComplexity), true - case "MembershipProfile.updatedAt": - if e.complexity.MembershipProfile.UpdatedAt == nil { - break - } - - return e.complexity.MembershipProfile.UpdatedAt(childComplexity), true - case "Mutation.acceptInvitation": if e.complexity.Mutation.AcceptInvitation == nil { break @@ -1581,17 +1440,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Organization.LogoURL(childComplexity), true - case "Organization.members": - if e.complexity.Organization.Members == nil { - break - } - - args, err := ec.field_Organization_members_args(ctx, rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Organization.Members(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.MembershipOrderBy)), true case "Organization.name": if e.complexity.Organization.Name == nil { break @@ -1609,6 +1457,17 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Organization.Permission(childComplexity, args["action"].(string)), true + case "Organization.profiles": + if e.complexity.Organization.Profiles == nil { + break + } + + args, err := ec.field_Organization_profiles_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Organization.Profiles(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.ProfileOrderBy)), true case "Organization.samlConfigurations": if e.complexity.Organization.SamlConfigurations == nil { break @@ -1632,12 +1491,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Organization.UpdatedAt(childComplexity), true - case "Organization.viewerMembership": - if e.complexity.Organization.ViewerMembership == nil { + case "Organization.viewer": + if e.complexity.Organization.Viewer == nil { break } - return e.complexity.Organization.ViewerMembership(childComplexity), true + return e.complexity.Organization.Viewer(childComplexity), true case "Organization.websiteUrl": if e.complexity.Organization.WebsiteURL == nil { break @@ -1770,6 +1629,122 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.PersonalAPIKeyEdge.Node(childComplexity), true + case "Profile.additionalEmailAddresses": + if e.complexity.Profile.AdditionalEmailAddresses == nil { + break + } + + return e.complexity.Profile.AdditionalEmailAddresses(childComplexity), true + case "Profile.contractEndDate": + if e.complexity.Profile.ContractEndDate == nil { + break + } + + return e.complexity.Profile.ContractEndDate(childComplexity), true + case "Profile.contractStartDate": + if e.complexity.Profile.ContractStartDate == nil { + break + } + + return e.complexity.Profile.ContractStartDate(childComplexity), true + case "Profile.createdAt": + if e.complexity.Profile.CreatedAt == nil { + break + } + + return e.complexity.Profile.CreatedAt(childComplexity), true + case "Profile.fullName": + if e.complexity.Profile.FullName == nil { + break + } + + return e.complexity.Profile.FullName(childComplexity), true + case "Profile.id": + if e.complexity.Profile.ID == nil { + break + } + + return e.complexity.Profile.ID(childComplexity), true + case "Profile.identity": + if e.complexity.Profile.Identity == nil { + break + } + + return e.complexity.Profile.Identity(childComplexity), true + case "Profile.kind": + if e.complexity.Profile.Kind == nil { + break + } + + return e.complexity.Profile.Kind(childComplexity), true + case "Profile.membership": + if e.complexity.Profile.Membership == nil { + break + } + + return e.complexity.Profile.Membership(childComplexity), true + case "Profile.organization": + if e.complexity.Profile.Organization == nil { + break + } + + return e.complexity.Profile.Organization(childComplexity), true + case "Profile.permission": + if e.complexity.Profile.Permission == nil { + break + } + + args, err := ec.field_Profile_permission_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Profile.Permission(childComplexity, args["action"].(string)), true + case "Profile.position": + if e.complexity.Profile.Position == nil { + break + } + + return e.complexity.Profile.Position(childComplexity), true + case "Profile.updatedAt": + if e.complexity.Profile.UpdatedAt == nil { + break + } + + return e.complexity.Profile.UpdatedAt(childComplexity), true + + case "ProfileConnection.edges": + if e.complexity.ProfileConnection.Edges == nil { + break + } + + return e.complexity.ProfileConnection.Edges(childComplexity), true + case "ProfileConnection.pageInfo": + if e.complexity.ProfileConnection.PageInfo == nil { + break + } + + return e.complexity.ProfileConnection.PageInfo(childComplexity), true + case "ProfileConnection.totalCount": + if e.complexity.ProfileConnection.TotalCount == nil { + break + } + + return e.complexity.ProfileConnection.TotalCount(childComplexity), true + + case "ProfileEdge.cursor": + if e.complexity.ProfileEdge.Cursor == nil { + break + } + + return e.complexity.ProfileEdge.Cursor(childComplexity), true + case "ProfileEdge.node": + if e.complexity.ProfileEdge.Node == nil { + break + } + + return e.complexity.ProfileEdge.Node(childComplexity), true + case "Query.node": if e.complexity.Query.Node == nil { break @@ -2144,12 +2119,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.SCIMEvent.IPAddress(childComplexity), true - case "SCIMEvent.membership": - if e.complexity.SCIMEvent.Membership == nil { - break - } - - return e.complexity.SCIMEvent.Membership(childComplexity), true case "SCIMEvent.method": if e.complexity.SCIMEvent.Method == nil { break @@ -2173,6 +2142,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.SCIMEvent.Permission(childComplexity, args["action"].(string)), true + case "SCIMEvent.profile": + if e.complexity.SCIMEvent.Profile == nil { + break + } + + return e.complexity.SCIMEvent.Profile(childComplexity), true case "SCIMEvent.requestBody": if e.complexity.SCIMEvent.RequestBody == nil { break @@ -2410,7 +2385,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputForgotPasswordInput, ec.unmarshalInputInvitationOrder, ec.unmarshalInputInviteMemberInput, - ec.unmarshalInputMembershipOrder, + ec.unmarshalInputProfileOrder, ec.unmarshalInputRegenerateSCIMTokenInput, ec.unmarshalInputRemoveMemberInput, ec.unmarshalInputResetPasswordInput, @@ -2665,13 +2640,13 @@ type Identity implements Node { createdAt: Datetime! updatedAt: Datetime! - memberships( + profiles( first: Int after: CursorKey last: Int before: CursorKey - orderBy: MembershipOrder - ): MembershipConnection @goField(forceResolver: true) + orderBy: ProfileOrder + ): ProfileConnection @goField(forceResolver: true) pendingInvitations( first: Int @@ -2705,7 +2680,7 @@ type Identity implements Node { @session(required: PRESENT) } -type MembershipProfile implements Node { +type Profile implements Node { id: ID! fullName: String! additionalEmailAddresses: [EmailAddr!]! @@ -2718,9 +2693,7 @@ type MembershipProfile implements Node { identity: Identity @goField(forceResolver: true) organization: Organization @goField(forceResolver: true) - - # FIXME: remove when memberships are under profile - membershipId: ID! + membership: Membership @goField(forceResolver: true) permission(action: String!): Boolean! @goField(forceResolver: true) @@ -2739,13 +2712,13 @@ type Organization implements Node { createdAt: Datetime! updatedAt: Datetime! - members( + profiles( first: Int after: CursorKey last: Int before: CursorKey - orderBy: MembershipOrder - ): MembershipConnection @goField(forceResolver: true) + orderBy: ProfileOrder + ): ProfileConnection @goField(forceResolver: true) invitations( first: Int @@ -2765,7 +2738,7 @@ type Organization implements Node { scimConfiguration: SCIMConfiguration @goField(forceResolver: true) - viewerMembership: Membership @goField(forceResolver: true) + viewer: Profile @goField(forceResolver: true) permission(action: String!): Boolean! @goField(forceResolver: true) @@ -2812,9 +2785,6 @@ enum MembershipState type Membership implements Node { id: ID! createdAt: Datetime! - identity: Identity @goField(forceResolver: true) - profile: MembershipProfile @goField(forceResolver: true) - organization: Organization @goField(forceResolver: true) role: MembershipRole! source: MembershipSource! state: MembershipState! @@ -2972,7 +2942,7 @@ type SCIMEvent implements Node { requestBody: String responseBody: String errorMessage: String - membership: Membership @goField(forceResolver: true) + profile: Profile @goField(forceResolver: true) ipAddress: String! createdAt: Datetime! @@ -3010,50 +2980,6 @@ enum ReauthenticationReason { POLICY_REQUIREMENT } -enum MembershipOrderField - @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipOrderField") { - FULL_NAME - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldFullName" - ) - ORGANIZATION_NAME - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldOrganizationName" - ) - EMAIL_ADDRESS - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldEmailAddress" - ) - ROLE - @goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldRole") - CREATED_AT - @goEnum( - value: "go.probo.inc/probo/pkg/coredata.MembershipOrderFieldCreatedAt" - ) -} - -input MembershipOrder - @goModel( - model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.MembershipOrderBy" - ) { - direction: OrderDirection! - field: MembershipOrderField! -} - -type MembershipConnection - @goModel( - model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.MembershipConnection" - ) { - edges: [MembershipEdge!]! - pageInfo: PageInfo! - totalCount: Int @goField(forceResolver: true) -} - -type MembershipEdge { - node: Membership! - cursor: CursorKey! -} - enum InvitationOrderField @goModel(model: "go.probo.inc/probo/pkg/coredata.InvitationOrderField") { FULL_NAME @@ -3100,6 +3026,45 @@ type InvitationEdge { cursor: CursorKey! } +enum ProfileOrderField + @goModel(model: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderField") { + FULL_NAME + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldFullName" + ) + CREATED_AT + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldCreatedAt" + ) + KIND @goEnum(value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldKind") + ORGANIZATION_NAME + @goEnum( + value: "go.probo.inc/probo/pkg/coredata.MembershipProfileOrderFieldOrganizationName" + ) +} + +input ProfileOrder + @goModel( + model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.ProfileOrderBy" + ) { + direction: OrderDirection! + field: ProfileOrderField! +} + +type ProfileConnection + @goModel( + model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.ProfileConnection" + ) { + totalCount: Int @goField(forceResolver: true) + edges: [ProfileEdge!]! + pageInfo: PageInfo! +} + +type ProfileEdge { + cursor: CursorKey! + node: Profile! +} + type SessionConnection @goModel( model: "go.probo.inc/probo/pkg/server/api/connect/v1/types.SessionConnection" @@ -3412,7 +3377,7 @@ type RevokePersonalAPIKeyPayload { type CreateOrganizationPayload { organization: Organization - membershipEdge: MembershipEdge! + membership: Membership! } type UpdateOrganizationPayload { @@ -3432,7 +3397,7 @@ type InviteMemberPayload { } type UpdateProfilePayload { - profile: MembershipProfile! + profile: Profile! } type UpdateMembershipPayload { @@ -3444,7 +3409,7 @@ type RemoveMemberPayload { } type AcceptInvitationPayload { - membershipEdge: MembershipEdge! + membership: Membership! invitation: Invitation! } @@ -3572,37 +3537,6 @@ func (ec *executionContext) field_Connector_permission_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Identity_memberships_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := graphql.ProcessArgField(ctx, rawArgs, "first", ec.unmarshalOInt2ᚖint) - if err != nil { - return nil, err - } - args["first"] = arg0 - arg1, err := graphql.ProcessArgField(ctx, rawArgs, "after", ec.unmarshalOCursorKey2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋpageᚐCursorKey) - if err != nil { - return nil, err - } - args["after"] = arg1 - arg2, err := graphql.ProcessArgField(ctx, rawArgs, "last", ec.unmarshalOInt2ᚖint) - if err != nil { - return nil, err - } - args["last"] = arg2 - arg3, err := graphql.ProcessArgField(ctx, rawArgs, "before", ec.unmarshalOCursorKey2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋpageᚐCursorKey) - if err != nil { - return nil, err - } - args["before"] = arg3 - arg4, err := graphql.ProcessArgField(ctx, rawArgs, "orderBy", ec.unmarshalOMembershipOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipOrderBy) - if err != nil { - return nil, err - } - args["orderBy"] = arg4 - return args, nil -} - func (ec *executionContext) field_Identity_pendingInvitations_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -3671,6 +3605,37 @@ func (ec *executionContext) field_Identity_personalAPIKeys_args(ctx context.Cont return args, nil } +func (ec *executionContext) field_Identity_profiles_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "first", ec.unmarshalOInt2ᚖint) + if err != nil { + return nil, err + } + args["first"] = arg0 + arg1, err := graphql.ProcessArgField(ctx, rawArgs, "after", ec.unmarshalOCursorKey2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋpageᚐCursorKey) + if err != nil { + return nil, err + } + args["after"] = arg1 + arg2, err := graphql.ProcessArgField(ctx, rawArgs, "last", ec.unmarshalOInt2ᚖint) + if err != nil { + return nil, err + } + args["last"] = arg2 + arg3, err := graphql.ProcessArgField(ctx, rawArgs, "before", ec.unmarshalOCursorKey2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋpageᚐCursorKey) + if err != nil { + return nil, err + } + args["before"] = arg3 + arg4, err := graphql.ProcessArgField(ctx, rawArgs, "orderBy", ec.unmarshalOProfileOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileOrderBy) + if err != nil { + return nil, err + } + args["orderBy"] = arg4 + return args, nil +} + func (ec *executionContext) field_Identity_sessions_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -3713,17 +3678,6 @@ func (ec *executionContext) field_Invitation_permission_args(ctx context.Context return args, nil } -func (ec *executionContext) field_MembershipProfile_permission_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := graphql.ProcessArgField(ctx, rawArgs, "action", ec.unmarshalNString2string) - if err != nil { - return nil, err - } - args["action"] = arg0 - return args, nil -} - func (ec *executionContext) field_Membership_permission_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -4090,7 +4044,18 @@ func (ec *executionContext) field_Organization_invitations_args(ctx context.Cont return args, nil } -func (ec *executionContext) field_Organization_members_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_Organization_permission_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "action", ec.unmarshalNString2string) + if err != nil { + return nil, err + } + args["action"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Organization_profiles_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} arg0, err := graphql.ProcessArgField(ctx, rawArgs, "first", ec.unmarshalOInt2ᚖint) @@ -4113,7 +4078,7 @@ func (ec *executionContext) field_Organization_members_args(ctx context.Context, return nil, err } args["before"] = arg3 - arg4, err := graphql.ProcessArgField(ctx, rawArgs, "orderBy", ec.unmarshalOMembershipOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipOrderBy) + arg4, err := graphql.ProcessArgField(ctx, rawArgs, "orderBy", ec.unmarshalOProfileOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileOrderBy) if err != nil { return nil, err } @@ -4121,17 +4086,6 @@ func (ec *executionContext) field_Organization_members_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Organization_permission_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := graphql.ProcessArgField(ctx, rawArgs, "action", ec.unmarshalNString2string) - if err != nil { - return nil, err - } - args["action"] = arg0 - return args, nil -} - func (ec *executionContext) field_Organization_samlConfigurations_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -4169,6 +4123,17 @@ func (ec *executionContext) field_PersonalAPIKey_permission_args(ctx context.Con return args, nil } +func (ec *executionContext) field_Profile_permission_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "action", ec.unmarshalNString2string) + if err != nil { + return nil, err + } + args["action"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -4340,23 +4305,23 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg // region **************************** field.gotpl ***************************** -func (ec *executionContext) _AcceptInvitationPayload_membershipEdge(ctx context.Context, field graphql.CollectedField, obj *types.AcceptInvitationPayload) (ret graphql.Marshaler) { +func (ec *executionContext) _AcceptInvitationPayload_membership(ctx context.Context, field graphql.CollectedField, obj *types.AcceptInvitationPayload) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_AcceptInvitationPayload_membershipEdge, + ec.fieldContext_AcceptInvitationPayload_membership, func(ctx context.Context) (any, error) { - return obj.MembershipEdge, nil + return obj.Membership, nil }, nil, - ec.marshalNMembershipEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipEdge, + ec.marshalNMembership2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembership, true, true, ) } -func (ec *executionContext) fieldContext_AcceptInvitationPayload_membershipEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_AcceptInvitationPayload_membership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "AcceptInvitationPayload", Field: field, @@ -4364,12 +4329,22 @@ func (ec *executionContext) fieldContext_AcceptInvitationPayload_membershipEdge( IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "node": - return ec.fieldContext_MembershipEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_MembershipEdge_cursor(ctx, field) + case "id": + return ec.fieldContext_Membership_id(ctx, field) + case "createdAt": + return ec.fieldContext_Membership_createdAt(ctx, field) + case "role": + return ec.fieldContext_Membership_role(ctx, field) + case "source": + return ec.fieldContext_Membership_source(ctx, field) + case "state": + return ec.fieldContext_Membership_state(ctx, field) + case "lastSession": + return ec.fieldContext_Membership_lastSession(ctx, field) + case "permission": + return ec.fieldContext_Membership_permission(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type MembershipEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Membership", field.Name) }, } return fc, nil @@ -4732,16 +4707,16 @@ func (ec *executionContext) fieldContext_CreateOrganizationPayload_organization( return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Organization_updatedAt(ctx, field) - case "members": - return ec.fieldContext_Organization_members(ctx, field) + case "profiles": + return ec.fieldContext_Organization_profiles(ctx, field) case "invitations": return ec.fieldContext_Organization_invitations(ctx, field) case "samlConfigurations": return ec.fieldContext_Organization_samlConfigurations(ctx, field) case "scimConfiguration": return ec.fieldContext_Organization_scimConfiguration(ctx, field) - case "viewerMembership": - return ec.fieldContext_Organization_viewerMembership(ctx, field) + case "viewer": + return ec.fieldContext_Organization_viewer(ctx, field) case "permission": return ec.fieldContext_Organization_permission(ctx, field) } @@ -4751,23 +4726,23 @@ func (ec *executionContext) fieldContext_CreateOrganizationPayload_organization( return fc, nil } -func (ec *executionContext) _CreateOrganizationPayload_membershipEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateOrganizationPayload) (ret graphql.Marshaler) { +func (ec *executionContext) _CreateOrganizationPayload_membership(ctx context.Context, field graphql.CollectedField, obj *types.CreateOrganizationPayload) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_CreateOrganizationPayload_membershipEdge, + ec.fieldContext_CreateOrganizationPayload_membership, func(ctx context.Context) (any, error) { - return obj.MembershipEdge, nil + return obj.Membership, nil }, nil, - ec.marshalNMembershipEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipEdge, + ec.marshalNMembership2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembership, true, true, ) } -func (ec *executionContext) fieldContext_CreateOrganizationPayload_membershipEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CreateOrganizationPayload_membership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "CreateOrganizationPayload", Field: field, @@ -4775,12 +4750,22 @@ func (ec *executionContext) fieldContext_CreateOrganizationPayload_membershipEdg IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "node": - return ec.fieldContext_MembershipEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_MembershipEdge_cursor(ctx, field) + case "id": + return ec.fieldContext_Membership_id(ctx, field) + case "createdAt": + return ec.fieldContext_Membership_createdAt(ctx, field) + case "role": + return ec.fieldContext_Membership_role(ctx, field) + case "source": + return ec.fieldContext_Membership_source(ctx, field) + case "state": + return ec.fieldContext_Membership_state(ctx, field) + case "lastSession": + return ec.fieldContext_Membership_lastSession(ctx, field) + case "permission": + return ec.fieldContext_Membership_permission(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type MembershipEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Membership", field.Name) }, } return fc, nil @@ -5083,16 +5068,16 @@ func (ec *executionContext) fieldContext_DeleteOrganizationHorizontalLogoPayload return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Organization_updatedAt(ctx, field) - case "members": - return ec.fieldContext_Organization_members(ctx, field) + case "profiles": + return ec.fieldContext_Organization_profiles(ctx, field) case "invitations": return ec.fieldContext_Organization_invitations(ctx, field) case "samlConfigurations": return ec.fieldContext_Organization_samlConfigurations(ctx, field) case "scimConfiguration": return ec.fieldContext_Organization_scimConfiguration(ctx, field) - case "viewerMembership": - return ec.fieldContext_Organization_viewerMembership(ctx, field) + case "viewer": + return ec.fieldContext_Organization_viewer(ctx, field) case "permission": return ec.fieldContext_Organization_permission(ctx, field) } @@ -5392,24 +5377,24 @@ func (ec *executionContext) fieldContext_Identity_updatedAt(_ context.Context, f return fc, nil } -func (ec *executionContext) _Identity_memberships(ctx context.Context, field graphql.CollectedField, obj *types.Identity) (ret graphql.Marshaler) { +func (ec *executionContext) _Identity_profiles(ctx context.Context, field graphql.CollectedField, obj *types.Identity) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_Identity_memberships, + ec.fieldContext_Identity_profiles, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Identity().Memberships(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.MembershipOrderBy)) + return ec.resolvers.Identity().Profiles(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.ProfileOrderBy)) }, nil, - ec.marshalOMembershipConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipConnection, + ec.marshalOProfileConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileConnection, true, false, ) } -func (ec *executionContext) fieldContext_Identity_memberships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Identity_profiles(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Identity", Field: field, @@ -5417,14 +5402,14 @@ func (ec *executionContext) fieldContext_Identity_memberships(ctx context.Contex IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_MembershipConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_MembershipConnection_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_MembershipConnection_totalCount(ctx, field) + return ec.fieldContext_ProfileConnection_totalCount(ctx, field) + case "edges": + return ec.fieldContext_ProfileConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ProfileConnection_pageInfo(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type MembershipConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ProfileConnection", field.Name) }, } defer func() { @@ -5434,7 +5419,7 @@ func (ec *executionContext) fieldContext_Identity_memberships(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Identity_memberships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Identity_profiles_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -5970,16 +5955,16 @@ func (ec *executionContext) fieldContext_Invitation_organization(_ context.Conte return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Organization_updatedAt(ctx, field) - case "members": - return ec.fieldContext_Organization_members(ctx, field) + case "profiles": + return ec.fieldContext_Organization_profiles(ctx, field) case "invitations": return ec.fieldContext_Organization_invitations(ctx, field) case "samlConfigurations": return ec.fieldContext_Organization_samlConfigurations(ctx, field) case "scimConfiguration": return ec.fieldContext_Organization_scimConfiguration(ctx, field) - case "viewerMembership": - return ec.fieldContext_Organization_viewerMembership(ctx, field) + case "viewer": + return ec.fieldContext_Organization_viewer(ctx, field) case "permission": return ec.fieldContext_Organization_permission(ctx, field) } @@ -6324,181 +6309,6 @@ func (ec *executionContext) fieldContext_Membership_createdAt(_ context.Context, return fc, nil } -func (ec *executionContext) _Membership_identity(ctx context.Context, field graphql.CollectedField, obj *types.Membership) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_Membership_identity, - func(ctx context.Context) (any, error) { - return ec.resolvers.Membership().Identity(ctx, obj) - }, - nil, - ec.marshalOIdentity2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐIdentity, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_Membership_identity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Membership", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Identity_id(ctx, field) - case "email": - return ec.fieldContext_Identity_email(ctx, field) - case "fullName": - return ec.fieldContext_Identity_fullName(ctx, field) - case "emailVerified": - return ec.fieldContext_Identity_emailVerified(ctx, field) - case "createdAt": - return ec.fieldContext_Identity_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_Identity_updatedAt(ctx, field) - case "memberships": - return ec.fieldContext_Identity_memberships(ctx, field) - case "pendingInvitations": - return ec.fieldContext_Identity_pendingInvitations(ctx, field) - case "sessions": - return ec.fieldContext_Identity_sessions(ctx, field) - case "personalAPIKeys": - return ec.fieldContext_Identity_personalAPIKeys(ctx, field) - case "ssoLoginURL": - return ec.fieldContext_Identity_ssoLoginURL(ctx, field) - case "permission": - return ec.fieldContext_Identity_permission(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Identity", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Membership_profile(ctx context.Context, field graphql.CollectedField, obj *types.Membership) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_Membership_profile, - func(ctx context.Context) (any, error) { - return ec.resolvers.Membership().Profile(ctx, obj) - }, - nil, - ec.marshalOMembershipProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipProfile, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_Membership_profile(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Membership", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_MembershipProfile_id(ctx, field) - case "fullName": - return ec.fieldContext_MembershipProfile_fullName(ctx, field) - case "additionalEmailAddresses": - return ec.fieldContext_MembershipProfile_additionalEmailAddresses(ctx, field) - case "kind": - return ec.fieldContext_MembershipProfile_kind(ctx, field) - case "position": - return ec.fieldContext_MembershipProfile_position(ctx, field) - case "contractStartDate": - return ec.fieldContext_MembershipProfile_contractStartDate(ctx, field) - case "contractEndDate": - return ec.fieldContext_MembershipProfile_contractEndDate(ctx, field) - case "createdAt": - return ec.fieldContext_MembershipProfile_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_MembershipProfile_updatedAt(ctx, field) - case "identity": - return ec.fieldContext_MembershipProfile_identity(ctx, field) - case "organization": - return ec.fieldContext_MembershipProfile_organization(ctx, field) - case "membershipId": - return ec.fieldContext_MembershipProfile_membershipId(ctx, field) - case "permission": - return ec.fieldContext_MembershipProfile_permission(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type MembershipProfile", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Membership_organization(ctx context.Context, field graphql.CollectedField, obj *types.Membership) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_Membership_organization, - func(ctx context.Context) (any, error) { - return ec.resolvers.Membership().Organization(ctx, obj) - }, - nil, - ec.marshalOOrganization2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐOrganization, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_Membership_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Membership", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Organization_id(ctx, field) - case "name": - return ec.fieldContext_Organization_name(ctx, field) - case "logoUrl": - return ec.fieldContext_Organization_logoUrl(ctx, field) - case "horizontalLogoUrl": - return ec.fieldContext_Organization_horizontalLogoUrl(ctx, field) - case "email": - return ec.fieldContext_Organization_email(ctx, field) - case "description": - return ec.fieldContext_Organization_description(ctx, field) - case "websiteUrl": - return ec.fieldContext_Organization_websiteUrl(ctx, field) - case "headquarterAddress": - return ec.fieldContext_Organization_headquarterAddress(ctx, field) - case "createdAt": - return ec.fieldContext_Organization_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_Organization_updatedAt(ctx, field) - case "members": - return ec.fieldContext_Organization_members(ctx, field) - case "invitations": - return ec.fieldContext_Organization_invitations(ctx, field) - case "samlConfigurations": - return ec.fieldContext_Organization_samlConfigurations(ctx, field) - case "scimConfiguration": - return ec.fieldContext_Organization_scimConfiguration(ctx, field) - case "viewerMembership": - return ec.fieldContext_Organization_viewerMembership(ctx, field) - case "permission": - return ec.fieldContext_Organization_permission(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) - }, - } - return fc, nil -} - func (ec *executionContext) _Membership_role(ctx context.Context, field graphql.CollectedField, obj *types.Membership) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, @@ -6692,656 +6502,6 @@ func (ec *executionContext) fieldContext_Membership_permission(ctx context.Conte return fc, nil } -func (ec *executionContext) _MembershipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *types.MembershipConnection) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipConnection_edges, - func(ctx context.Context) (any, error) { - return obj.Edges, nil - }, - nil, - ec.marshalNMembershipEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipEdgeᚄ, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipConnection", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_MembershipEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_MembershipEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type MembershipEdge", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *types.MembershipConnection) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipConnection_pageInfo, - func(ctx context.Context) (any, error) { - return obj.PageInfo, nil - }, - nil, - ec.marshalNPageInfo2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐPageInfo, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipConnection", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *types.MembershipConnection) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipConnection_totalCount, - func(ctx context.Context) (any, error) { - return ec.resolvers.MembershipConnection().TotalCount(ctx, obj) - }, - nil, - ec.marshalOInt2ᚖint, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_MembershipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipConnection", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipEdge_node(ctx context.Context, field graphql.CollectedField, obj *types.MembershipEdge) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipEdge_node, - func(ctx context.Context) (any, error) { - return obj.Node, nil - }, - nil, - ec.marshalNMembership2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembership, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Membership_id(ctx, field) - case "createdAt": - return ec.fieldContext_Membership_createdAt(ctx, field) - case "identity": - return ec.fieldContext_Membership_identity(ctx, field) - case "profile": - return ec.fieldContext_Membership_profile(ctx, field) - case "organization": - return ec.fieldContext_Membership_organization(ctx, field) - case "role": - return ec.fieldContext_Membership_role(ctx, field) - case "source": - return ec.fieldContext_Membership_source(ctx, field) - case "state": - return ec.fieldContext_Membership_state(ctx, field) - case "lastSession": - return ec.fieldContext_Membership_lastSession(ctx, field) - case "permission": - return ec.fieldContext_Membership_permission(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Membership", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *types.MembershipEdge) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipEdge_cursor, - func(ctx context.Context) (any, error) { - return obj.Cursor, nil - }, - nil, - ec.marshalNCursorKey2goᚗproboᚗincᚋproboᚋpkgᚋpageᚐCursorKey, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type CursorKey does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_id(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_id, - func(ctx context.Context) (any, error) { - return obj.ID, nil - }, - nil, - ec.marshalNID2goᚗproboᚗincᚋproboᚋpkgᚋgidᚐGID, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_fullName(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_fullName, - func(ctx context.Context) (any, error) { - return obj.FullName, nil - }, - nil, - ec.marshalNString2string, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_fullName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_additionalEmailAddresses(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_additionalEmailAddresses, - func(ctx context.Context) (any, error) { - return obj.AdditionalEmailAddresses, nil - }, - nil, - ec.marshalNEmailAddr2ᚕgoᚗproboᚗincᚋproboᚋpkgᚋmailᚐAddrᚄ, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_additionalEmailAddresses(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type EmailAddr does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_kind(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_kind, - func(ctx context.Context) (any, error) { - return obj.Kind, nil - }, - nil, - ec.marshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ProfileKind does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_position(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_position, - func(ctx context.Context) (any, error) { - return obj.Position, nil - }, - nil, - ec.marshalOString2ᚖstring, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_position(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_contractStartDate(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_contractStartDate, - func(ctx context.Context) (any, error) { - return obj.ContractStartDate, nil - }, - nil, - ec.marshalODatetime2ᚖtimeᚐTime, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_contractStartDate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Datetime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_contractEndDate(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_contractEndDate, - func(ctx context.Context) (any, error) { - return obj.ContractEndDate, nil - }, - nil, - ec.marshalODatetime2ᚖtimeᚐTime, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_contractEndDate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Datetime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_createdAt(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_createdAt, - func(ctx context.Context) (any, error) { - return obj.CreatedAt, nil - }, - nil, - ec.marshalNDatetime2timeᚐTime, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Datetime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_updatedAt(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_updatedAt, - func(ctx context.Context) (any, error) { - return obj.UpdatedAt, nil - }, - nil, - ec.marshalNDatetime2timeᚐTime, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Datetime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_identity(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_identity, - func(ctx context.Context) (any, error) { - return ec.resolvers.MembershipProfile().Identity(ctx, obj) - }, - nil, - ec.marshalOIdentity2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐIdentity, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_identity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Identity_id(ctx, field) - case "email": - return ec.fieldContext_Identity_email(ctx, field) - case "fullName": - return ec.fieldContext_Identity_fullName(ctx, field) - case "emailVerified": - return ec.fieldContext_Identity_emailVerified(ctx, field) - case "createdAt": - return ec.fieldContext_Identity_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_Identity_updatedAt(ctx, field) - case "memberships": - return ec.fieldContext_Identity_memberships(ctx, field) - case "pendingInvitations": - return ec.fieldContext_Identity_pendingInvitations(ctx, field) - case "sessions": - return ec.fieldContext_Identity_sessions(ctx, field) - case "personalAPIKeys": - return ec.fieldContext_Identity_personalAPIKeys(ctx, field) - case "ssoLoginURL": - return ec.fieldContext_Identity_ssoLoginURL(ctx, field) - case "permission": - return ec.fieldContext_Identity_permission(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Identity", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_organization(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_organization, - func(ctx context.Context) (any, error) { - return ec.resolvers.MembershipProfile().Organization(ctx, obj) - }, - nil, - ec.marshalOOrganization2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐOrganization, - true, - false, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Organization_id(ctx, field) - case "name": - return ec.fieldContext_Organization_name(ctx, field) - case "logoUrl": - return ec.fieldContext_Organization_logoUrl(ctx, field) - case "horizontalLogoUrl": - return ec.fieldContext_Organization_horizontalLogoUrl(ctx, field) - case "email": - return ec.fieldContext_Organization_email(ctx, field) - case "description": - return ec.fieldContext_Organization_description(ctx, field) - case "websiteUrl": - return ec.fieldContext_Organization_websiteUrl(ctx, field) - case "headquarterAddress": - return ec.fieldContext_Organization_headquarterAddress(ctx, field) - case "createdAt": - return ec.fieldContext_Organization_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_Organization_updatedAt(ctx, field) - case "members": - return ec.fieldContext_Organization_members(ctx, field) - case "invitations": - return ec.fieldContext_Organization_invitations(ctx, field) - case "samlConfigurations": - return ec.fieldContext_Organization_samlConfigurations(ctx, field) - case "scimConfiguration": - return ec.fieldContext_Organization_scimConfiguration(ctx, field) - case "viewerMembership": - return ec.fieldContext_Organization_viewerMembership(ctx, field) - case "permission": - return ec.fieldContext_Organization_permission(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_membershipId(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_membershipId, - func(ctx context.Context) (any, error) { - return obj.MembershipID, nil - }, - nil, - ec.marshalNID2goᚗproboᚗincᚋproboᚋpkgᚋgidᚐGID, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_membershipId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MembershipProfile_permission(ctx context.Context, field graphql.CollectedField, obj *types.MembershipProfile) (ret graphql.Marshaler) { - return graphql.ResolveField( - ctx, - ec.OperationContext, - field, - ec.fieldContext_MembershipProfile_permission, - func(ctx context.Context) (any, error) { - fc := graphql.GetFieldContext(ctx) - return ec.resolvers.MembershipProfile().Permission(ctx, obj, fc.Args["action"].(string)) - }, - func(ctx context.Context, next graphql.Resolver) graphql.Resolver { - directive0 := next - - directive1 := func(ctx context.Context) (any, error) { - required, err := ec.unmarshalNSessionRequirement2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋgqlutilsᚋdirectivesᚋsessionᚐSessionRequirement(ctx, "PRESENT") - if err != nil { - var zeroVal bool - return zeroVal, err - } - if ec.directives.Session == nil { - var zeroVal bool - return zeroVal, errors.New("directive session is not implemented") - } - return ec.directives.Session(ctx, obj, directive0, required) - } - - next = directive1 - return next - }, - ec.marshalNBoolean2bool, - true, - true, - ) -} - -func (ec *executionContext) fieldContext_MembershipProfile_permission(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MembershipProfile", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_MembershipProfile_permission_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - func (ec *executionContext) _Mutation_signIn(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, @@ -8249,8 +7409,8 @@ func (ec *executionContext) fieldContext_Mutation_createOrganization(ctx context switch field.Name { case "organization": return ec.fieldContext_CreateOrganizationPayload_organization(ctx, field) - case "membershipEdge": - return ec.fieldContext_CreateOrganizationPayload_membershipEdge(ctx, field) + case "membership": + return ec.fieldContext_CreateOrganizationPayload_membership(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type CreateOrganizationPayload", field.Name) }, @@ -8780,8 +7940,8 @@ func (ec *executionContext) fieldContext_Mutation_acceptInvitation(ctx context.C IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "membershipEdge": - return ec.fieldContext_AcceptInvitationPayload_membershipEdge(ctx, field) + case "membership": + return ec.fieldContext_AcceptInvitationPayload_membership(ctx, field) case "invitation": return ec.fieldContext_AcceptInvitationPayload_invitation(ctx, field) } @@ -9539,24 +8699,24 @@ func (ec *executionContext) fieldContext_Organization_updatedAt(_ context.Contex return fc, nil } -func (ec *executionContext) _Organization_members(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) { +func (ec *executionContext) _Organization_profiles(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_Organization_members, + ec.fieldContext_Organization_profiles, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Organization().Members(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.MembershipOrderBy)) + return ec.resolvers.Organization().Profiles(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.ProfileOrderBy)) }, nil, - ec.marshalOMembershipConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipConnection, + ec.marshalOProfileConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileConnection, true, false, ) } -func (ec *executionContext) fieldContext_Organization_members(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_profiles(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Organization", Field: field, @@ -9564,14 +8724,14 @@ func (ec *executionContext) fieldContext_Organization_members(ctx context.Contex IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_MembershipConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_MembershipConnection_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_MembershipConnection_totalCount(ctx, field) + return ec.fieldContext_ProfileConnection_totalCount(ctx, field) + case "edges": + return ec.fieldContext_ProfileConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ProfileConnection_pageInfo(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type MembershipConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ProfileConnection", field.Name) }, } defer func() { @@ -9581,7 +8741,7 @@ func (ec *executionContext) fieldContext_Organization_members(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Organization_members_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Organization_profiles_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -9733,23 +8893,23 @@ func (ec *executionContext) fieldContext_Organization_scimConfiguration(_ contex return fc, nil } -func (ec *executionContext) _Organization_viewerMembership(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) { +func (ec *executionContext) _Organization_viewer(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_Organization_viewerMembership, + ec.fieldContext_Organization_viewer, func(ctx context.Context) (any, error) { - return ec.resolvers.Organization().ViewerMembership(ctx, obj) + return ec.resolvers.Organization().Viewer(ctx, obj) }, nil, - ec.marshalOMembership2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembership, + ec.marshalOProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfile, true, false, ) } -func (ec *executionContext) fieldContext_Organization_viewerMembership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_viewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Organization", Field: field, @@ -9758,27 +8918,33 @@ func (ec *executionContext) fieldContext_Organization_viewerMembership(_ context Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Membership_id(ctx, field) + return ec.fieldContext_Profile_id(ctx, field) + case "fullName": + return ec.fieldContext_Profile_fullName(ctx, field) + case "additionalEmailAddresses": + return ec.fieldContext_Profile_additionalEmailAddresses(ctx, field) + case "kind": + return ec.fieldContext_Profile_kind(ctx, field) + case "position": + return ec.fieldContext_Profile_position(ctx, field) + case "contractStartDate": + return ec.fieldContext_Profile_contractStartDate(ctx, field) + case "contractEndDate": + return ec.fieldContext_Profile_contractEndDate(ctx, field) case "createdAt": - return ec.fieldContext_Membership_createdAt(ctx, field) + return ec.fieldContext_Profile_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Profile_updatedAt(ctx, field) case "identity": - return ec.fieldContext_Membership_identity(ctx, field) - case "profile": - return ec.fieldContext_Membership_profile(ctx, field) + return ec.fieldContext_Profile_identity(ctx, field) case "organization": - return ec.fieldContext_Membership_organization(ctx, field) - case "role": - return ec.fieldContext_Membership_role(ctx, field) - case "source": - return ec.fieldContext_Membership_source(ctx, field) - case "state": - return ec.fieldContext_Membership_state(ctx, field) - case "lastSession": - return ec.fieldContext_Membership_lastSession(ctx, field) + return ec.fieldContext_Profile_organization(ctx, field) + case "membership": + return ec.fieldContext_Profile_membership(ctx, field) case "permission": - return ec.fieldContext_Membership_permission(ctx, field) + return ec.fieldContext_Profile_permission(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Membership", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Profile", field.Name) }, } return fc, nil @@ -9918,12 +9084,6 @@ func (ec *executionContext) fieldContext_OrganizationSessionCreated_membership(_ return ec.fieldContext_Membership_id(ctx, field) case "createdAt": return ec.fieldContext_Membership_createdAt(ctx, field) - case "identity": - return ec.fieldContext_Membership_identity(ctx, field) - case "profile": - return ec.fieldContext_Membership_profile(ctx, field) - case "organization": - return ec.fieldContext_Membership_organization(ctx, field) case "role": return ec.fieldContext_Membership_role(ctx, field) case "source": @@ -10496,6 +9656,676 @@ func (ec *executionContext) fieldContext_PersonalAPIKeyEdge_cursor(_ context.Con return fc, nil } +func (ec *executionContext) _Profile_id(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_id, + func(ctx context.Context) (any, error) { + return obj.ID, nil + }, + nil, + ec.marshalNID2goᚗproboᚗincᚋproboᚋpkgᚋgidᚐGID, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_Profile_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_fullName(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_fullName, + func(ctx context.Context) (any, error) { + return obj.FullName, nil + }, + nil, + ec.marshalNString2string, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_Profile_fullName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_additionalEmailAddresses(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_additionalEmailAddresses, + func(ctx context.Context) (any, error) { + return obj.AdditionalEmailAddresses, nil + }, + nil, + ec.marshalNEmailAddr2ᚕgoᚗproboᚗincᚋproboᚋpkgᚋmailᚐAddrᚄ, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_Profile_additionalEmailAddresses(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type EmailAddr does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_kind(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_kind, + func(ctx context.Context) (any, error) { + return obj.Kind, nil + }, + nil, + ec.marshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_Profile_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ProfileKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_position(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_position, + func(ctx context.Context) (any, error) { + return obj.Position, nil + }, + nil, + ec.marshalOString2ᚖstring, + true, + false, + ) +} + +func (ec *executionContext) fieldContext_Profile_position(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_contractStartDate(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_contractStartDate, + func(ctx context.Context) (any, error) { + return obj.ContractStartDate, nil + }, + nil, + ec.marshalODatetime2ᚖtimeᚐTime, + true, + false, + ) +} + +func (ec *executionContext) fieldContext_Profile_contractStartDate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Datetime does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_contractEndDate(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_contractEndDate, + func(ctx context.Context) (any, error) { + return obj.ContractEndDate, nil + }, + nil, + ec.marshalODatetime2ᚖtimeᚐTime, + true, + false, + ) +} + +func (ec *executionContext) fieldContext_Profile_contractEndDate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Datetime does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_createdAt(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_createdAt, + func(ctx context.Context) (any, error) { + return obj.CreatedAt, nil + }, + nil, + ec.marshalNDatetime2timeᚐTime, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_Profile_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Datetime does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_updatedAt(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_updatedAt, + func(ctx context.Context) (any, error) { + return obj.UpdatedAt, nil + }, + nil, + ec.marshalNDatetime2timeᚐTime, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_Profile_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Datetime does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_identity(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_identity, + func(ctx context.Context) (any, error) { + return ec.resolvers.Profile().Identity(ctx, obj) + }, + nil, + ec.marshalOIdentity2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐIdentity, + true, + false, + ) +} + +func (ec *executionContext) fieldContext_Profile_identity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Identity_id(ctx, field) + case "email": + return ec.fieldContext_Identity_email(ctx, field) + case "fullName": + return ec.fieldContext_Identity_fullName(ctx, field) + case "emailVerified": + return ec.fieldContext_Identity_emailVerified(ctx, field) + case "createdAt": + return ec.fieldContext_Identity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Identity_updatedAt(ctx, field) + case "profiles": + return ec.fieldContext_Identity_profiles(ctx, field) + case "pendingInvitations": + return ec.fieldContext_Identity_pendingInvitations(ctx, field) + case "sessions": + return ec.fieldContext_Identity_sessions(ctx, field) + case "personalAPIKeys": + return ec.fieldContext_Identity_personalAPIKeys(ctx, field) + case "permission": + return ec.fieldContext_Identity_permission(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Identity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_organization(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_organization, + func(ctx context.Context) (any, error) { + return ec.resolvers.Profile().Organization(ctx, obj) + }, + nil, + ec.marshalOOrganization2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐOrganization, + true, + false, + ) +} + +func (ec *executionContext) fieldContext_Profile_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Organization_id(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "logoUrl": + return ec.fieldContext_Organization_logoUrl(ctx, field) + case "horizontalLogoUrl": + return ec.fieldContext_Organization_horizontalLogoUrl(ctx, field) + case "email": + return ec.fieldContext_Organization_email(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "websiteUrl": + return ec.fieldContext_Organization_websiteUrl(ctx, field) + case "headquarterAddress": + return ec.fieldContext_Organization_headquarterAddress(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "profiles": + return ec.fieldContext_Organization_profiles(ctx, field) + case "invitations": + return ec.fieldContext_Organization_invitations(ctx, field) + case "samlConfigurations": + return ec.fieldContext_Organization_samlConfigurations(ctx, field) + case "scimConfiguration": + return ec.fieldContext_Organization_scimConfiguration(ctx, field) + case "viewer": + return ec.fieldContext_Organization_viewer(ctx, field) + case "permission": + return ec.fieldContext_Organization_permission(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_membership(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_membership, + func(ctx context.Context) (any, error) { + return ec.resolvers.Profile().Membership(ctx, obj) + }, + nil, + ec.marshalOMembership2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembership, + true, + false, + ) +} + +func (ec *executionContext) fieldContext_Profile_membership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Membership_id(ctx, field) + case "createdAt": + return ec.fieldContext_Membership_createdAt(ctx, field) + case "role": + return ec.fieldContext_Membership_role(ctx, field) + case "source": + return ec.fieldContext_Membership_source(ctx, field) + case "state": + return ec.fieldContext_Membership_state(ctx, field) + case "lastSession": + return ec.fieldContext_Membership_lastSession(ctx, field) + case "permission": + return ec.fieldContext_Membership_permission(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Membership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Profile_permission(ctx context.Context, field graphql.CollectedField, obj *types.Profile) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_Profile_permission, + func(ctx context.Context) (any, error) { + fc := graphql.GetFieldContext(ctx) + return ec.resolvers.Profile().Permission(ctx, obj, fc.Args["action"].(string)) + }, + func(ctx context.Context, next graphql.Resolver) graphql.Resolver { + directive0 := next + + directive1 := func(ctx context.Context) (any, error) { + required, err := ec.unmarshalNSessionRequirement2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋgqlutilsᚋdirectivesᚋsessionᚐSessionRequirement(ctx, "PRESENT") + if err != nil { + var zeroVal bool + return zeroVal, err + } + if ec.directives.Session == nil { + var zeroVal bool + return zeroVal, errors.New("directive session is not implemented") + } + return ec.directives.Session(ctx, obj, directive0, required) + } + + next = directive1 + return next + }, + ec.marshalNBoolean2bool, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_Profile_permission(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Profile", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Profile_permission_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ProfileConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *types.ProfileConnection) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_ProfileConnection_totalCount, + func(ctx context.Context) (any, error) { + return ec.resolvers.ProfileConnection().TotalCount(ctx, obj) + }, + nil, + ec.marshalOInt2ᚖint, + true, + false, + ) +} + +func (ec *executionContext) fieldContext_ProfileConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProfileConnection", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProfileConnection_edges(ctx context.Context, field graphql.CollectedField, obj *types.ProfileConnection) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_ProfileConnection_edges, + func(ctx context.Context) (any, error) { + return obj.Edges, nil + }, + nil, + ec.marshalNProfileEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileEdgeᚄ, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_ProfileConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProfileConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "cursor": + return ec.fieldContext_ProfileEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_ProfileEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProfileEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProfileConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *types.ProfileConnection) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_ProfileConnection_pageInfo, + func(ctx context.Context) (any, error) { + return obj.PageInfo, nil + }, + nil, + ec.marshalNPageInfo2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐPageInfo, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_ProfileConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProfileConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProfileEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *types.ProfileEdge) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_ProfileEdge_cursor, + func(ctx context.Context) (any, error) { + return obj.Cursor, nil + }, + nil, + ec.marshalNCursorKey2goᚗproboᚗincᚋproboᚋpkgᚋpageᚐCursorKey, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_ProfileEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProfileEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type CursorKey does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ProfileEdge_node(ctx context.Context, field graphql.CollectedField, obj *types.ProfileEdge) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + ec.fieldContext_ProfileEdge_node, + func(ctx context.Context) (any, error) { + return obj.Node, nil + }, + nil, + ec.marshalNProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfile, + true, + true, + ) +} + +func (ec *executionContext) fieldContext_ProfileEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProfileEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Profile_id(ctx, field) + case "fullName": + return ec.fieldContext_Profile_fullName(ctx, field) + case "additionalEmailAddresses": + return ec.fieldContext_Profile_additionalEmailAddresses(ctx, field) + case "kind": + return ec.fieldContext_Profile_kind(ctx, field) + case "position": + return ec.fieldContext_Profile_position(ctx, field) + case "contractStartDate": + return ec.fieldContext_Profile_contractStartDate(ctx, field) + case "contractEndDate": + return ec.fieldContext_Profile_contractEndDate(ctx, field) + case "createdAt": + return ec.fieldContext_Profile_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Profile_updatedAt(ctx, field) + case "identity": + return ec.fieldContext_Profile_identity(ctx, field) + case "organization": + return ec.fieldContext_Profile_organization(ctx, field) + case "membership": + return ec.fieldContext_Profile_membership(ctx, field) + case "permission": + return ec.fieldContext_Profile_permission(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Profile", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Query_node(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, @@ -10609,8 +10439,8 @@ func (ec *executionContext) fieldContext_Query_viewer(_ context.Context, field g return ec.fieldContext_Identity_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Identity_updatedAt(ctx, field) - case "memberships": - return ec.fieldContext_Identity_memberships(ctx, field) + case "profiles": + return ec.fieldContext_Identity_profiles(ctx, field) case "pendingInvitations": return ec.fieldContext_Identity_pendingInvitations(ctx, field) case "sessions": @@ -12279,16 +12109,16 @@ func (ec *executionContext) fieldContext_SCIMConfiguration_organization(_ contex return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Organization_updatedAt(ctx, field) - case "members": - return ec.fieldContext_Organization_members(ctx, field) + case "profiles": + return ec.fieldContext_Organization_profiles(ctx, field) case "invitations": return ec.fieldContext_Organization_invitations(ctx, field) case "samlConfigurations": return ec.fieldContext_Organization_samlConfigurations(ctx, field) case "scimConfiguration": return ec.fieldContext_Organization_scimConfiguration(ctx, field) - case "viewerMembership": - return ec.fieldContext_Organization_viewerMembership(ctx, field) + case "viewer": + return ec.fieldContext_Organization_viewer(ctx, field) case "permission": return ec.fieldContext_Organization_permission(ctx, field) } @@ -12658,23 +12488,23 @@ func (ec *executionContext) fieldContext_SCIMEvent_errorMessage(_ context.Contex return fc, nil } -func (ec *executionContext) _SCIMEvent_membership(ctx context.Context, field graphql.CollectedField, obj *types.SCIMEvent) (ret graphql.Marshaler) { +func (ec *executionContext) _SCIMEvent_profile(ctx context.Context, field graphql.CollectedField, obj *types.SCIMEvent) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_SCIMEvent_membership, + ec.fieldContext_SCIMEvent_profile, func(ctx context.Context) (any, error) { - return ec.resolvers.SCIMEvent().Membership(ctx, obj) + return ec.resolvers.SCIMEvent().Profile(ctx, obj) }, nil, - ec.marshalOMembership2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembership, + ec.marshalOProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfile, true, false, ) } -func (ec *executionContext) fieldContext_SCIMEvent_membership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SCIMEvent_profile(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "SCIMEvent", Field: field, @@ -12683,27 +12513,33 @@ func (ec *executionContext) fieldContext_SCIMEvent_membership(_ context.Context, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_Membership_id(ctx, field) + return ec.fieldContext_Profile_id(ctx, field) + case "fullName": + return ec.fieldContext_Profile_fullName(ctx, field) + case "additionalEmailAddresses": + return ec.fieldContext_Profile_additionalEmailAddresses(ctx, field) + case "kind": + return ec.fieldContext_Profile_kind(ctx, field) + case "position": + return ec.fieldContext_Profile_position(ctx, field) + case "contractStartDate": + return ec.fieldContext_Profile_contractStartDate(ctx, field) + case "contractEndDate": + return ec.fieldContext_Profile_contractEndDate(ctx, field) case "createdAt": - return ec.fieldContext_Membership_createdAt(ctx, field) + return ec.fieldContext_Profile_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Profile_updatedAt(ctx, field) case "identity": - return ec.fieldContext_Membership_identity(ctx, field) - case "profile": - return ec.fieldContext_Membership_profile(ctx, field) + return ec.fieldContext_Profile_identity(ctx, field) case "organization": - return ec.fieldContext_Membership_organization(ctx, field) - case "role": - return ec.fieldContext_Membership_role(ctx, field) - case "source": - return ec.fieldContext_Membership_source(ctx, field) - case "state": - return ec.fieldContext_Membership_state(ctx, field) - case "lastSession": - return ec.fieldContext_Membership_lastSession(ctx, field) + return ec.fieldContext_Profile_organization(ctx, field) + case "membership": + return ec.fieldContext_Profile_membership(ctx, field) case "permission": - return ec.fieldContext_Membership_permission(ctx, field) + return ec.fieldContext_Profile_permission(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Membership", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Profile", field.Name) }, } return fc, nil @@ -12967,8 +12803,8 @@ func (ec *executionContext) fieldContext_SCIMEventEdge_node(_ context.Context, f return ec.fieldContext_SCIMEvent_responseBody(ctx, field) case "errorMessage": return ec.fieldContext_SCIMEvent_errorMessage(ctx, field) - case "membership": - return ec.fieldContext_SCIMEvent_membership(ctx, field) + case "profile": + return ec.fieldContext_SCIMEvent_profile(ctx, field) case "ipAddress": return ec.fieldContext_SCIMEvent_ipAddress(ctx, field) case "createdAt": @@ -13076,8 +12912,8 @@ func (ec *executionContext) fieldContext_Session_identity(_ context.Context, fie return ec.fieldContext_Identity_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Identity_updatedAt(ctx, field) - case "memberships": - return ec.fieldContext_Identity_memberships(ctx, field) + case "profiles": + return ec.fieldContext_Identity_profiles(ctx, field) case "pendingInvitations": return ec.fieldContext_Identity_pendingInvitations(ctx, field) case "sessions": @@ -13514,8 +13350,8 @@ func (ec *executionContext) fieldContext_SignInPayload_identity(_ context.Contex return ec.fieldContext_Identity_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Identity_updatedAt(ctx, field) - case "memberships": - return ec.fieldContext_Identity_memberships(ctx, field) + case "profiles": + return ec.fieldContext_Identity_profiles(ctx, field) case "pendingInvitations": return ec.fieldContext_Identity_pendingInvitations(ctx, field) case "sessions": @@ -13645,8 +13481,8 @@ func (ec *executionContext) fieldContext_SignUpFromInvitationPayload_identity(_ return ec.fieldContext_Identity_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Identity_updatedAt(ctx, field) - case "memberships": - return ec.fieldContext_Identity_memberships(ctx, field) + case "profiles": + return ec.fieldContext_Identity_profiles(ctx, field) case "pendingInvitations": return ec.fieldContext_Identity_pendingInvitations(ctx, field) case "sessions": @@ -13700,8 +13536,8 @@ func (ec *executionContext) fieldContext_SignUpPayload_identity(_ context.Contex return ec.fieldContext_Identity_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Identity_updatedAt(ctx, field) - case "memberships": - return ec.fieldContext_Identity_memberships(ctx, field) + case "profiles": + return ec.fieldContext_Identity_profiles(ctx, field) case "pendingInvitations": return ec.fieldContext_Identity_pendingInvitations(ctx, field) case "sessions": @@ -13747,12 +13583,6 @@ func (ec *executionContext) fieldContext_UpdateMembershipPayload_membership(_ co return ec.fieldContext_Membership_id(ctx, field) case "createdAt": return ec.fieldContext_Membership_createdAt(ctx, field) - case "identity": - return ec.fieldContext_Membership_identity(ctx, field) - case "profile": - return ec.fieldContext_Membership_profile(ctx, field) - case "organization": - return ec.fieldContext_Membership_organization(ctx, field) case "role": return ec.fieldContext_Membership_role(ctx, field) case "source": @@ -13814,16 +13644,16 @@ func (ec *executionContext) fieldContext_UpdateOrganizationPayload_organization( return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": return ec.fieldContext_Organization_updatedAt(ctx, field) - case "members": - return ec.fieldContext_Organization_members(ctx, field) + case "profiles": + return ec.fieldContext_Organization_profiles(ctx, field) case "invitations": return ec.fieldContext_Organization_invitations(ctx, field) case "samlConfigurations": return ec.fieldContext_Organization_samlConfigurations(ctx, field) case "scimConfiguration": return ec.fieldContext_Organization_scimConfiguration(ctx, field) - case "viewerMembership": - return ec.fieldContext_Organization_viewerMembership(ctx, field) + case "viewer": + return ec.fieldContext_Organization_viewer(ctx, field) case "permission": return ec.fieldContext_Organization_permission(ctx, field) } @@ -13843,7 +13673,7 @@ func (ec *executionContext) _UpdateProfilePayload_profile(ctx context.Context, f return obj.Profile, nil }, nil, - ec.marshalNMembershipProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipProfile, + ec.marshalNProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfile, true, true, ) @@ -13858,33 +13688,33 @@ func (ec *executionContext) fieldContext_UpdateProfilePayload_profile(_ context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_MembershipProfile_id(ctx, field) + return ec.fieldContext_Profile_id(ctx, field) case "fullName": - return ec.fieldContext_MembershipProfile_fullName(ctx, field) + return ec.fieldContext_Profile_fullName(ctx, field) case "additionalEmailAddresses": - return ec.fieldContext_MembershipProfile_additionalEmailAddresses(ctx, field) + return ec.fieldContext_Profile_additionalEmailAddresses(ctx, field) case "kind": - return ec.fieldContext_MembershipProfile_kind(ctx, field) + return ec.fieldContext_Profile_kind(ctx, field) case "position": - return ec.fieldContext_MembershipProfile_position(ctx, field) + return ec.fieldContext_Profile_position(ctx, field) case "contractStartDate": - return ec.fieldContext_MembershipProfile_contractStartDate(ctx, field) + return ec.fieldContext_Profile_contractStartDate(ctx, field) case "contractEndDate": - return ec.fieldContext_MembershipProfile_contractEndDate(ctx, field) + return ec.fieldContext_Profile_contractEndDate(ctx, field) case "createdAt": - return ec.fieldContext_MembershipProfile_createdAt(ctx, field) + return ec.fieldContext_Profile_createdAt(ctx, field) case "updatedAt": - return ec.fieldContext_MembershipProfile_updatedAt(ctx, field) + return ec.fieldContext_Profile_updatedAt(ctx, field) case "identity": - return ec.fieldContext_MembershipProfile_identity(ctx, field) + return ec.fieldContext_Profile_identity(ctx, field) case "organization": - return ec.fieldContext_MembershipProfile_organization(ctx, field) - case "membershipId": - return ec.fieldContext_MembershipProfile_membershipId(ctx, field) + return ec.fieldContext_Profile_organization(ctx, field) + case "membership": + return ec.fieldContext_Profile_membership(ctx, field) case "permission": - return ec.fieldContext_MembershipProfile_permission(ctx, field) + return ec.fieldContext_Profile_permission(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type MembershipProfile", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Profile", field.Name) }, } return fc, nil @@ -16045,8 +15875,8 @@ func (ec *executionContext) unmarshalInputInviteMemberInput(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputMembershipOrder(ctx context.Context, obj any) (types.MembershipOrderBy, error) { - var it types.MembershipOrderBy +func (ec *executionContext) unmarshalInputProfileOrder(ctx context.Context, obj any) (types.ProfileOrderBy, error) { + var it types.ProfileOrderBy asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v @@ -16068,7 +15898,7 @@ func (ec *executionContext) unmarshalInputMembershipOrder(ctx context.Context, o it.Direction = data case "field": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNMembershipOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipOrderField(ctx, v) + data, err := ec.unmarshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField(ctx, v) if err != nil { return it, err } @@ -16881,6 +16711,13 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._SAMLConfiguration(ctx, sel, obj) + case types.Profile: + return ec._Profile(ctx, sel, &obj) + case *types.Profile: + if obj == nil { + return graphql.Null + } + return ec._Profile(ctx, sel, obj) case types.PersonalAPIKey: return ec._PersonalAPIKey(ctx, sel, &obj) case *types.PersonalAPIKey: @@ -16895,13 +16732,6 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._Organization(ctx, sel, obj) - case types.MembershipProfile: - return ec._MembershipProfile(ctx, sel, &obj) - case *types.MembershipProfile: - if obj == nil { - return graphql.Null - } - return ec._MembershipProfile(ctx, sel, obj) case types.Membership: return ec._Membership(ctx, sel, &obj) case *types.Membership: @@ -16954,8 +16784,8 @@ func (ec *executionContext) _AcceptInvitationPayload(ctx context.Context, sel as switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("AcceptInvitationPayload") - case "membershipEdge": - out.Values[i] = ec._AcceptInvitationPayload_membershipEdge(ctx, field, obj) + case "membership": + out.Values[i] = ec._AcceptInvitationPayload_membership(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -17207,8 +17037,8 @@ func (ec *executionContext) _CreateOrganizationPayload(ctx context.Context, sel out.Values[i] = graphql.MarshalString("CreateOrganizationPayload") case "organization": out.Values[i] = ec._CreateOrganizationPayload_organization(ctx, field, obj) - case "membershipEdge": - out.Values[i] = ec._CreateOrganizationPayload_membershipEdge(ctx, field, obj) + case "membership": + out.Values[i] = ec._CreateOrganizationPayload_membership(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -17639,7 +17469,7 @@ func (ec *executionContext) _Identity(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "memberships": + case "profiles": field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { @@ -17648,7 +17478,7 @@ func (ec *executionContext) _Identity(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Identity_memberships(ctx, field, obj) + res = ec._Identity_profiles(ctx, field, obj) return res } @@ -18184,105 +18014,6 @@ func (ec *executionContext) _Membership(ctx context.Context, sel ast.SelectionSe if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "identity": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Membership_identity(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "profile": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Membership_profile(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "organization": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Membership_organization(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "role": out.Values[i] = ec._Membership_role(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -18390,304 +18121,6 @@ func (ec *executionContext) _Membership(ctx context.Context, sel ast.SelectionSe return out } -var membershipConnectionImplementors = []string{"MembershipConnection"} - -func (ec *executionContext) _MembershipConnection(ctx context.Context, sel ast.SelectionSet, obj *types.MembershipConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, membershipConnectionImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("MembershipConnection") - case "edges": - out.Values[i] = ec._MembershipConnection_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "pageInfo": - out.Values[i] = ec._MembershipConnection_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "totalCount": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._MembershipConnection_totalCount(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var membershipEdgeImplementors = []string{"MembershipEdge"} - -func (ec *executionContext) _MembershipEdge(ctx context.Context, sel ast.SelectionSet, obj *types.MembershipEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, membershipEdgeImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("MembershipEdge") - case "node": - out.Values[i] = ec._MembershipEdge_node(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "cursor": - out.Values[i] = ec._MembershipEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var membershipProfileImplementors = []string{"MembershipProfile", "Node"} - -func (ec *executionContext) _MembershipProfile(ctx context.Context, sel ast.SelectionSet, obj *types.MembershipProfile) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, membershipProfileImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("MembershipProfile") - case "id": - out.Values[i] = ec._MembershipProfile_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "fullName": - out.Values[i] = ec._MembershipProfile_fullName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "additionalEmailAddresses": - out.Values[i] = ec._MembershipProfile_additionalEmailAddresses(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "kind": - out.Values[i] = ec._MembershipProfile_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "position": - out.Values[i] = ec._MembershipProfile_position(ctx, field, obj) - case "contractStartDate": - out.Values[i] = ec._MembershipProfile_contractStartDate(ctx, field, obj) - case "contractEndDate": - out.Values[i] = ec._MembershipProfile_contractEndDate(ctx, field, obj) - case "createdAt": - out.Values[i] = ec._MembershipProfile_createdAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "updatedAt": - out.Values[i] = ec._MembershipProfile_updatedAt(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "identity": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._MembershipProfile_identity(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "organization": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._MembershipProfile_organization(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "membershipId": - out.Values[i] = ec._MembershipProfile_membershipId(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "permission": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._MembershipProfile_permission(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { @@ -18968,7 +18401,7 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "members": + case "profiles": field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { @@ -18977,7 +18410,7 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Organization_members(ctx, field, obj) + res = ec._Organization_profiles(ctx, field, obj) return res } @@ -19100,7 +18533,7 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "viewerMembership": + case "viewer": field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { @@ -19109,7 +18542,7 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Organization_viewerMembership(ctx, field, obj) + res = ec._Organization_viewer(ctx, field, obj) return res } @@ -19569,6 +19002,332 @@ func (ec *executionContext) _PersonalAPIKeyEdge(ctx context.Context, sel ast.Sel return out } +var profileImplementors = []string{"Profile", "Node"} + +func (ec *executionContext) _Profile(ctx context.Context, sel ast.SelectionSet, obj *types.Profile) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, profileImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Profile") + case "id": + out.Values[i] = ec._Profile_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "fullName": + out.Values[i] = ec._Profile_fullName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "additionalEmailAddresses": + out.Values[i] = ec._Profile_additionalEmailAddresses(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "kind": + out.Values[i] = ec._Profile_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "position": + out.Values[i] = ec._Profile_position(ctx, field, obj) + case "contractStartDate": + out.Values[i] = ec._Profile_contractStartDate(ctx, field, obj) + case "contractEndDate": + out.Values[i] = ec._Profile_contractEndDate(ctx, field, obj) + case "createdAt": + out.Values[i] = ec._Profile_createdAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "updatedAt": + out.Values[i] = ec._Profile_updatedAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "identity": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Profile_identity(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organization": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Profile_organization(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "membership": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Profile_membership(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "permission": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Profile_permission(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var profileConnectionImplementors = []string{"ProfileConnection"} + +func (ec *executionContext) _ProfileConnection(ctx context.Context, sel ast.SelectionSet, obj *types.ProfileConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, profileConnectionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ProfileConnection") + case "totalCount": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ProfileConnection_totalCount(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "edges": + out.Values[i] = ec._ProfileConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "pageInfo": + out.Values[i] = ec._ProfileConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var profileEdgeImplementors = []string{"ProfileEdge"} + +func (ec *executionContext) _ProfileEdge(ctx context.Context, sel ast.SelectionSet, obj *types.ProfileEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, profileEdgeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ProfileEdge") + case "cursor": + out.Values[i] = ec._ProfileEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "node": + out.Values[i] = ec._ProfileEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { @@ -20712,7 +20471,7 @@ func (ec *executionContext) _SCIMEvent(ctx context.Context, sel ast.SelectionSet out.Values[i] = ec._SCIMEvent_responseBody(ctx, field, obj) case "errorMessage": out.Values[i] = ec._SCIMEvent_errorMessage(ctx, field, obj) - case "membership": + case "profile": field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { @@ -20721,7 +20480,7 @@ func (ec *executionContext) _SCIMEvent(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._SCIMEvent_membership(ctx, field, obj) + res = ec._SCIMEvent_profile(ctx, field, obj) return res } @@ -22280,104 +22039,6 @@ func (ec *executionContext) marshalNMembership2ᚖgoᚗproboᚗincᚋproboᚋpkg return ec._Membership(ctx, sel, v) } -func (ec *executionContext) marshalNMembershipEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*types.MembershipEdge) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNMembershipEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipEdge(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNMembershipEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipEdge(ctx context.Context, sel ast.SelectionSet, v *types.MembershipEdge) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._MembershipEdge(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNMembershipOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipOrderField(ctx context.Context, v any) (coredata.MembershipOrderField, error) { - tmp, err := graphql.UnmarshalString(v) - res := unmarshalNMembershipOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipOrderField[tmp] - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNMembershipOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.MembershipOrderField) graphql.Marshaler { - _ = sel - res := graphql.MarshalString(marshalNMembershipOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipOrderField[v]) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -var ( - unmarshalNMembershipOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipOrderField = map[string]coredata.MembershipOrderField{ - "FULL_NAME": coredata.MembershipOrderFieldFullName, - "ORGANIZATION_NAME": coredata.MembershipOrderFieldOrganizationName, - "EMAIL_ADDRESS": coredata.MembershipOrderFieldEmailAddress, - "ROLE": coredata.MembershipOrderFieldRole, - "CREATED_AT": coredata.MembershipOrderFieldCreatedAt, - } - marshalNMembershipOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipOrderField = map[coredata.MembershipOrderField]string{ - coredata.MembershipOrderFieldFullName: "FULL_NAME", - coredata.MembershipOrderFieldOrganizationName: "ORGANIZATION_NAME", - coredata.MembershipOrderFieldEmailAddress: "EMAIL_ADDRESS", - coredata.MembershipOrderFieldRole: "ROLE", - coredata.MembershipOrderFieldCreatedAt: "CREATED_AT", - } -) - -func (ec *executionContext) marshalNMembershipProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipProfile(ctx context.Context, sel ast.SelectionSet, v *types.MembershipProfile) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._MembershipProfile(ctx, sel, v) -} - func (ec *executionContext) unmarshalNMembershipRole2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipRole(ctx context.Context, v any) (coredata.MembershipRole, error) { tmp, err := graphql.UnmarshalString(v) res := unmarshalNMembershipRole2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipRole[tmp] @@ -22576,6 +22237,70 @@ func (ec *executionContext) marshalNPersonalAPIKeyEdge2ᚖgoᚗproboᚗincᚋpro return ec._PersonalAPIKeyEdge(ctx, sel, v) } +func (ec *executionContext) marshalNProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfile(ctx context.Context, sel ast.SelectionSet, v *types.Profile) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Profile(ctx, sel, v) +} + +func (ec *executionContext) marshalNProfileEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*types.ProfileEdge) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNProfileEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNProfileEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileEdge(ctx context.Context, sel ast.SelectionSet, v *types.ProfileEdge) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ProfileEdge(ctx, sel, v) +} + func (ec *executionContext) unmarshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind(ctx context.Context, v any) (coredata.MembershipProfileKind, error) { tmp, err := graphql.UnmarshalString(v) res := unmarshalNProfileKind2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileKind[tmp] @@ -22606,6 +22331,38 @@ var ( } ) +func (ec *executionContext) unmarshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField(ctx context.Context, v any) (coredata.MembershipProfileOrderField, error) { + tmp, err := graphql.UnmarshalString(v) + res := unmarshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField[tmp] + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.MembershipProfileOrderField) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(marshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField[v]) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +var ( + unmarshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField = map[string]coredata.MembershipProfileOrderField{ + "FULL_NAME": coredata.MembershipProfileOrderFieldFullName, + "CREATED_AT": coredata.MembershipProfileOrderFieldCreatedAt, + "KIND": coredata.MembershipProfileOrderFieldKind, + "ORGANIZATION_NAME": coredata.MembershipProfileOrderFieldOrganizationName, + } + marshalNProfileOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐMembershipProfileOrderField = map[coredata.MembershipProfileOrderField]string{ + coredata.MembershipProfileOrderFieldFullName: "FULL_NAME", + coredata.MembershipProfileOrderFieldCreatedAt: "CREATED_AT", + coredata.MembershipProfileOrderFieldKind: "KIND", + coredata.MembershipProfileOrderFieldOrganizationName: "ORGANIZATION_NAME", + } +) + func (ec *executionContext) unmarshalNReauthenticationReason2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐReauthenticationReason(ctx context.Context, v any) (types.ReauthenticationReason, error) { var res types.ReauthenticationReason err := res.UnmarshalGQL(v) @@ -23732,28 +23489,6 @@ func (ec *executionContext) marshalOMembership2ᚖgoᚗproboᚗincᚋproboᚋpkg return ec._Membership(ctx, sel, v) } -func (ec *executionContext) marshalOMembershipConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipConnection(ctx context.Context, sel ast.SelectionSet, v *types.MembershipConnection) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._MembershipConnection(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOMembershipOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipOrderBy(ctx context.Context, v any) (*types.MembershipOrderBy, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputMembershipOrder(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOMembershipProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐMembershipProfile(ctx context.Context, sel ast.SelectionSet, v *types.MembershipProfile) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._MembershipProfile(ctx, sel, v) -} - func (ec *executionContext) marshalONode2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐNode(ctx context.Context, sel ast.SelectionSet, v types.Node) graphql.Marshaler { if v == nil { return graphql.Null @@ -23775,6 +23510,28 @@ func (ec *executionContext) marshalOPersonalAPIKeyConnection2ᚖgoᚗproboᚗinc return ec._PersonalAPIKeyConnection(ctx, sel, v) } +func (ec *executionContext) marshalOProfile2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfile(ctx context.Context, sel ast.SelectionSet, v *types.Profile) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Profile(ctx, sel, v) +} + +func (ec *executionContext) marshalOProfileConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileConnection(ctx context.Context, sel ast.SelectionSet, v *types.ProfileConnection) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ProfileConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOProfileOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐProfileOrderBy(ctx context.Context, v any) (*types.ProfileOrderBy, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputProfileOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) marshalORegenerateSCIMTokenPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐRegenerateSCIMTokenPayload(ctx context.Context, sel ast.SelectionSet, v *types.RegenerateSCIMTokenPayload) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/pkg/server/api/connect/v1/types/membership.go b/pkg/server/api/connect/v1/types/membership.go index ce40d2c88..1444d4dc1 100644 --- a/pkg/server/api/connect/v1/types/membership.go +++ b/pkg/server/api/connect/v1/types/membership.go @@ -16,61 +16,14 @@ package types import ( "go.probo.inc/probo/pkg/coredata" - "go.probo.inc/probo/pkg/gid" - "go.probo.inc/probo/pkg/page" ) -type ( - MembershipOrderBy OrderBy[coredata.MembershipOrderField] - - MembershipConnection struct { - TotalCount int - Edges []*MembershipEdge - PageInfo PageInfo - - Resolver any - ParentID gid.GID - } -) - -func NewMembershipConnection( - p *page.Page[*coredata.Membership, coredata.MembershipOrderField], - resolver any, - parentID gid.GID, -) *MembershipConnection { - edges := make([]*MembershipEdge, len(p.Data)) - for i, membership := range p.Data { - edges[i] = NewMembershipEdge(membership, p.Cursor.OrderBy.Field) - } - - return &MembershipConnection{ - Edges: edges, - PageInfo: *NewPageInfo(p), - - Resolver: resolver, - ParentID: parentID, - } -} - -func NewMembershipEdge(membership *coredata.Membership, orderField coredata.MembershipOrderField) *MembershipEdge { - return &MembershipEdge{ - Node: NewMembership(membership), - Cursor: membership.CursorKey(orderField), - } -} - func NewMembership(membership *coredata.Membership) *Membership { return &Membership{ ID: membership.ID, CreatedAt: membership.CreatedAt, - Identity: &Identity{ - ID: membership.IdentityID, - }, - Organization: &Organization{ - ID: membership.OrganizationID, - }, - Role: membership.Role, - Source: membership.Source, - State: membership.State, + Role: membership.Role, + Source: membership.Source, + State: membership.State, } } diff --git a/pkg/server/api/connect/v1/types/identity_profile.go b/pkg/server/api/connect/v1/types/profile.go similarity index 56% rename from pkg/server/api/connect/v1/types/identity_profile.go rename to pkg/server/api/connect/v1/types/profile.go index bf0973c02..1762c01c2 100644 --- a/pkg/server/api/connect/v1/types/identity_profile.go +++ b/pkg/server/api/connect/v1/types/profile.go @@ -14,10 +14,56 @@ package types -import "go.probo.inc/probo/pkg/coredata" +import ( + "go.probo.inc/probo/pkg/coredata" + "go.probo.inc/probo/pkg/gid" + "go.probo.inc/probo/pkg/page" +) -func NewMembershipProfile(profile *coredata.MembershipProfile) *MembershipProfile { - return &MembershipProfile{ +type ( + ProfileOrderBy OrderBy[coredata.MembershipProfileOrderField] + + ProfileConnection struct { + TotalCount int + Edges []*ProfileEdge + PageInfo PageInfo + + Resolver any + ParentID gid.GID + } +) + +func NewProfileConnection( + p *page.Page[*coredata.MembershipProfile, coredata.MembershipProfileOrderField], + resolver any, + parentID gid.GID, +) *ProfileConnection { + edges := make([]*ProfileEdge, len(p.Data)) + for i, profile := range p.Data { + edges[i] = NewProfileEdge(profile, p.Cursor.OrderBy.Field) + } + + return &ProfileConnection{ + Edges: edges, + PageInfo: *NewPageInfo(p), + + Resolver: resolver, + ParentID: parentID, + } +} + +func NewProfileEdge( + profile *coredata.MembershipProfile, + orderField coredata.MembershipProfileOrderField, +) *ProfileEdge { + return &ProfileEdge{ + Node: NewProfile(profile), + Cursor: profile.CursorKey(orderField), + } +} + +func NewProfile(profile *coredata.MembershipProfile) *Profile { + return &Profile{ ID: profile.ID, FullName: profile.FullName, AdditionalEmailAddresses: profile.AdditionalEmailAddresses, diff --git a/pkg/server/api/connect/v1/types/scim_event.go b/pkg/server/api/connect/v1/types/scim_event.go index a5fa0951c..056cbda28 100644 --- a/pkg/server/api/connect/v1/types/scim_event.go +++ b/pkg/server/api/connect/v1/types/scim_event.go @@ -72,11 +72,12 @@ func NewSCIMEvent(scimEvent *coredata.SCIMEvent) *SCIMEvent { CreatedAt: scimEvent.CreatedAt, } - if scimEvent.MembershipID != nil { - event.Membership = &Membership{ - ID: *scimEvent.MembershipID, - } - } + // FIXME: profile + // if scimEvent.MembershipID != nil { + // event.Membership = &Membership{ + // ID: *scimEvent.MembershipID, + // } + // } return event } diff --git a/pkg/server/api/connect/v1/types/types.go b/pkg/server/api/connect/v1/types/types.go index f48617f61..447cb7f5f 100644 --- a/pkg/server/api/connect/v1/types/types.go +++ b/pkg/server/api/connect/v1/types/types.go @@ -30,8 +30,8 @@ type AcceptInvitationInput struct { } type AcceptInvitationPayload struct { - MembershipEdge *MembershipEdge `json:"membershipEdge"` - Invitation *Invitation `json:"invitation"` + Membership *Membership `json:"membership"` + Invitation *Invitation `json:"invitation"` } type AssumeOrganizationSessionInput struct { @@ -79,8 +79,8 @@ type CreateOrganizationInput struct { } type CreateOrganizationPayload struct { - Organization *Organization `json:"organization,omitempty"` - MembershipEdge *MembershipEdge `json:"membershipEdge"` + Organization *Organization `json:"organization,omitempty"` + Membership *Membership `json:"membership"` } type CreatePersonalAPIKeyInput struct { @@ -176,7 +176,7 @@ type Identity struct { EmailVerified bool `json:"emailVerified"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` - Memberships *MembershipConnection `json:"memberships,omitempty"` + Profiles *ProfileConnection `json:"profiles,omitempty"` PendingInvitations *InvitationConnection `json:"pendingInvitations,omitempty"` Sessions *SessionConnection `json:"sessions,omitempty"` PersonalAPIKeys *PersonalAPIKeyConnection `json:"personalAPIKeys,omitempty"` @@ -220,45 +220,18 @@ type InviteMemberPayload struct { } type Membership struct { - ID gid.GID `json:"id"` - CreatedAt time.Time `json:"createdAt"` - Identity *Identity `json:"identity,omitempty"` - Profile *MembershipProfile `json:"profile,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Role coredata.MembershipRole `json:"role"` - Source coredata.MembershipSource `json:"source"` - State coredata.MembershipState `json:"state"` - LastSession *Session `json:"lastSession,omitempty"` - Permission bool `json:"permission"` + ID gid.GID `json:"id"` + CreatedAt time.Time `json:"createdAt"` + Role coredata.MembershipRole `json:"role"` + Source coredata.MembershipSource `json:"source"` + State coredata.MembershipState `json:"state"` + LastSession *Session `json:"lastSession,omitempty"` + Permission bool `json:"permission"` } func (Membership) IsNode() {} func (this Membership) GetID() gid.GID { return this.ID } -type MembershipEdge struct { - Node *Membership `json:"node"` - Cursor page.CursorKey `json:"cursor"` -} - -type MembershipProfile struct { - ID gid.GID `json:"id"` - FullName string `json:"fullName"` - AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses"` - Kind coredata.MembershipProfileKind `json:"kind"` - Position *string `json:"position,omitempty"` - ContractStartDate *time.Time `json:"contractStartDate,omitempty"` - ContractEndDate *time.Time `json:"contractEndDate,omitempty"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - Identity *Identity `json:"identity,omitempty"` - Organization *Organization `json:"organization,omitempty"` - MembershipID gid.GID `json:"membershipId"` - Permission bool `json:"permission"` -} - -func (MembershipProfile) IsNode() {} -func (this MembershipProfile) GetID() gid.GID { return this.ID } - type Mutation struct { } @@ -273,11 +246,11 @@ type Organization struct { HeadquarterAddress *string `json:"headquarterAddress,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` - Members *MembershipConnection `json:"members,omitempty"` + Profiles *ProfileConnection `json:"profiles,omitempty"` Invitations *InvitationConnection `json:"invitations,omitempty"` SamlConfigurations *SAMLConfigurationConnection `json:"samlConfigurations,omitempty"` ScimConfiguration *SCIMConfiguration `json:"scimConfiguration,omitempty"` - ViewerMembership *Membership `json:"viewerMembership,omitempty"` + Viewer *Profile `json:"viewer,omitempty"` Permission bool `json:"permission"` } @@ -322,6 +295,30 @@ type PersonalAPIKeyEdge struct { Cursor page.CursorKey `json:"cursor"` } +type Profile struct { + ID gid.GID `json:"id"` + FullName string `json:"fullName"` + AdditionalEmailAddresses []mail.Addr `json:"additionalEmailAddresses"` + Kind coredata.MembershipProfileKind `json:"kind"` + Position *string `json:"position,omitempty"` + ContractStartDate *time.Time `json:"contractStartDate,omitempty"` + ContractEndDate *time.Time `json:"contractEndDate,omitempty"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + Identity *Identity `json:"identity,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Membership *Membership `json:"membership,omitempty"` + Permission bool `json:"permission"` +} + +func (Profile) IsNode() {} +func (this Profile) GetID() gid.GID { return this.ID } + +type ProfileEdge struct { + Cursor page.CursorKey `json:"cursor"` + Node *Profile `json:"node"` +} + type Query struct { } @@ -448,17 +445,17 @@ func (SCIMConfiguration) IsNode() {} func (this SCIMConfiguration) GetID() gid.GID { return this.ID } type SCIMEvent struct { - ID gid.GID `json:"id"` - Method string `json:"method"` - Path string `json:"path"` - StatusCode int `json:"statusCode"` - RequestBody *string `json:"requestBody,omitempty"` - ResponseBody *string `json:"responseBody,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - Membership *Membership `json:"membership,omitempty"` - IPAddress string `json:"ipAddress"` - CreatedAt time.Time `json:"createdAt"` - Permission bool `json:"permission"` + ID gid.GID `json:"id"` + Method string `json:"method"` + Path string `json:"path"` + StatusCode int `json:"statusCode"` + RequestBody *string `json:"requestBody,omitempty"` + ResponseBody *string `json:"responseBody,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Profile *Profile `json:"profile,omitempty"` + IPAddress string `json:"ipAddress"` + CreatedAt time.Time `json:"createdAt"` + Permission bool `json:"permission"` } func (SCIMEvent) IsNode() {} @@ -564,7 +561,7 @@ type UpdateProfileInput struct { } type UpdateProfilePayload struct { - Profile *MembershipProfile `json:"profile"` + Profile *Profile `json:"profile"` } type UpdateSAMLConfigurationInput struct { diff --git a/pkg/server/api/connect/v1/v1_resolver.go b/pkg/server/api/connect/v1/v1_resolver.go index 71cc26252..4845aff56 100644 --- a/pkg/server/api/connect/v1/v1_resolver.go +++ b/pkg/server/api/connect/v1/v1_resolver.go @@ -23,6 +23,7 @@ import ( "go.probo.inc/probo/pkg/server/api/authz" "go.probo.inc/probo/pkg/server/api/connect/v1/schema" "go.probo.inc/probo/pkg/server/api/connect/v1/types" + types1 "go.probo.inc/probo/pkg/server/api/console/v1/types" "go.probo.inc/probo/pkg/server/gqlutils" "go.probo.inc/probo/pkg/server/gqlutils/types/cursor" ) @@ -32,39 +33,9 @@ func (r *connectorResolver) Permission(ctx context.Context, obj *types.Connector return r.Resolver.Permission(ctx, obj, action) } -// Memberships is the resolver for the memberships field. -func (r *identityResolver) Memberships(ctx context.Context, obj *types.Identity, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MembershipOrderBy) (*types.MembershipConnection, error) { - if err := r.authorize(ctx, obj.ID, iam.ActionMembershipList); err != nil { - return nil, err - } - - if gqlutils.OnlyTotalCountSelected(ctx) { - return &types.MembershipConnection{ - Resolver: r, - ParentID: obj.ID, - }, nil - } - - pageOrderBy := page.OrderBy[coredata.MembershipOrderField]{ - Field: coredata.MembershipOrderFieldCreatedAt, - Direction: page.OrderDirectionDesc, - } - if orderBy != nil { - pageOrderBy = page.OrderBy[coredata.MembershipOrderField]{ - Field: orderBy.Field, - Direction: orderBy.Direction, - } - } - - cursor := cursor.NewCursor(first, after, last, before, pageOrderBy) - - page, err := r.iam.AccountService.ListMemberships(ctx, obj.ID, cursor) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot list memberships", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return types.NewMembershipConnection(page, r, obj.ID), nil +// Profiles is the resolver for the profiles field. +func (r *identityResolver) Profiles(ctx context.Context, obj *types.Identity, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types1.ProfileOrderBy) (*types1.ProfileConnection, error) { + panic(fmt.Errorf("not implemented: Profiles - profiles")) } // PendingInvitations is the resolver for the pendingInvitations field. @@ -267,73 +238,6 @@ func (r *invitationConnectionResolver) TotalCount(ctx context.Context, obj *type return nil, gqlutils.Internal(ctx) } -// Identity is the resolver for the identity field. -func (r *membershipResolver) Identity(ctx context.Context, obj *types.Membership) (*types.Identity, error) { - if err := r.authorize( - ctx, - obj.Identity.ID, - iam.ActionIdentityGet, - authz.WithAttr("organization_id", obj.Organization.ID.String()), - ); err != nil { - return nil, err - } - - if gqlutils.OnlyIDSelected(ctx) { - return &types.Identity{ - ID: obj.Identity.ID, - }, nil - } - - identity, err := r.iam.AccountService.GetIdentityForMembership(ctx, obj.ID) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot get identity for membership", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return types.NewIdentity(identity), nil -} - -// Profile is the resolver for the profile field. -func (r *membershipResolver) Profile(ctx context.Context, obj *types.Membership) (*types.MembershipProfile, error) { - if err := r.authorize(ctx, obj.ID, iam.ActionMembershipProfileGet, authz.WithSkipAssumptionCheck()); err != nil { - return nil, err - } - - profile, err := r.iam.AccountService.GetProfileForMembership(ctx, obj.ID) - if err != nil { - var errProfileNotFound *iam.ErrProfileNotFound - if errors.As(err, &errProfileNotFound) { - return nil, gqlutils.NotFound(ctx, err) - } - - r.logger.ErrorCtx(ctx, "cannot get profile for membership", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return types.NewMembershipProfile(profile), nil -} - -// Organization is the resolver for the organization field. -func (r *membershipResolver) Organization(ctx context.Context, obj *types.Membership) (*types.Organization, error) { - if err := r.authorize(ctx, obj.Organization.ID, iam.ActionOrganizationGet, authz.WithSkipAssumptionCheck()); err != nil { - return nil, err - } - - if gqlutils.OnlyIDSelected(ctx) { - return &types.Organization{ - ID: obj.Organization.ID, - }, nil - } - - organization, err := r.iam.OrganizationService.GetOrganizationForMembership(ctx, obj.ID) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot get organization for membership", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return types.NewOrganization(organization), nil -} - // LastSession is the resolver for the lastSession field. func (r *membershipResolver) LastSession(ctx context.Context, obj *types.Membership) (*types.Session, error) { if err := r.authorize(ctx, obj.ID, iam.ActionMembershipGet, authz.WithSkipAssumptionCheck()); err != nil { @@ -364,87 +268,6 @@ func (r *membershipResolver) Permission(ctx context.Context, obj *types.Membersh return r.Resolver.Permission(ctx, obj, action) } -// TotalCount is the resolver for the totalCount field. -func (r *membershipConnectionResolver) TotalCount(ctx context.Context, obj *types.MembershipConnection) (*int, error) { - if err := r.authorize(ctx, obj.ParentID, iam.ActionMembershipList); err != nil { - return nil, err - } - - switch obj.Resolver.(type) { - case *identityResolver: - count, err := r.iam.AccountService.CountMemberships(ctx, obj.ParentID) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot count memberships", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return &count, nil - case *organizationResolver: - count, err := r.iam.OrganizationService.CountMemberships(ctx, obj.ParentID) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot count memberships", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return &count, nil - } - - r.logger.ErrorCtx(ctx, "unsupported resolver", log.Any("resolver", obj.Resolver)) - return nil, gqlutils.Internal(ctx) -} - -// Identity is the resolver for the identity field. -func (r *membershipProfileResolver) Identity(ctx context.Context, obj *types.MembershipProfile) (*types.Identity, error) { - if err := r.authorize( - ctx, - obj.Identity.ID, - iam.ActionIdentityGet, - authz.WithAttr("organization_id", obj.Organization.ID.String()), - ); err != nil { - return nil, err - } - - if gqlutils.OnlyIDSelected(ctx) { - return &types.Identity{ - ID: obj.Identity.ID, - }, nil - } - - identity, err := r.iam.AccountService.GetIdentity(ctx, obj.Identity.ID) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot get identity for membership", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return types.NewIdentity(identity), nil -} - -// Organization is the resolver for the organization field. -func (r *membershipProfileResolver) Organization(ctx context.Context, obj *types.MembershipProfile) (*types.Organization, error) { - if err := r.authorize(ctx, obj.Organization.ID, iam.ActionOrganizationGet, authz.WithSkipAssumptionCheck()); err != nil { - return nil, err - } - - if gqlutils.OnlyIDSelected(ctx) { - return &types.Organization{ - ID: obj.Organization.ID, - }, nil - } - - organization, err := r.iam.OrganizationService.GetOrganizationForMembership(ctx, obj.ID) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot get organization for membership", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return types.NewOrganization(organization), nil -} - -// Permission is the resolver for the permission field. -func (r *membershipProfileResolver) Permission(ctx context.Context, obj *types.MembershipProfile, action string) (bool, error) { - return r.Resolver.Permission(ctx, obj, action) -} - // SignIn is the resolver for the signIn field. func (r *mutationResolver) SignIn(ctx context.Context, input types.SignInInput) (*types.SignInPayload, error) { identity, err := r.iam.AuthService.CheckCredentials(ctx, input.Email, input.Password) @@ -938,8 +761,8 @@ func (r *mutationResolver) CreateOrganization(ctx context.Context, input types.C } return &types.CreateOrganizationPayload{ - Organization: types.NewOrganization(organization), - MembershipEdge: types.NewMembershipEdge(membership, coredata.MembershipOrderFieldCreatedAt), + Organization: types.NewOrganization(organization), + Membership: types.NewMembership(membership), }, nil } @@ -1105,7 +928,7 @@ func (r *mutationResolver) UpdateProfile(ctx context.Context, input types.Update } return &types.UpdateProfilePayload{ - Profile: types.NewMembershipProfile(profile), + Profile: types.NewProfile(profile), }, nil } @@ -1173,8 +996,8 @@ func (r *mutationResolver) AcceptInvitation(ctx context.Context, input types.Acc } return &types.AcceptInvitationPayload{ - MembershipEdge: types.NewMembershipEdge(membership, coredata.MembershipOrderFieldCreatedAt), - Invitation: types.NewInvitation(invitation), + Membership: types.NewMembership(membership), + Invitation: types.NewInvitation(invitation), }, nil } @@ -1387,37 +1210,9 @@ func (r *organizationResolver) HorizontalLogoURL(ctx context.Context, obj *types return presignedURL, nil } -// Members is the resolver for the members field. -func (r *organizationResolver) Members(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MembershipOrderBy) (*types.MembershipConnection, error) { - if err := r.authorize(ctx, obj.ID, iam.ActionMembershipList); err != nil { - return nil, err - } - - if gqlutils.OnlyTotalCountSelected(ctx) { - return &types.MembershipConnection{ - Resolver: r, - ParentID: obj.ID, - }, nil - } - - pageOrderBy := page.OrderBy[coredata.MembershipOrderField]{ - Field: coredata.MembershipOrderFieldCreatedAt, - Direction: page.OrderDirectionDesc, - } - if orderBy != nil { - pageOrderBy.Field = coredata.MembershipOrderField(orderBy.Field) - pageOrderBy.Direction = page.OrderDirection(orderBy.Direction) - } - - cursor := cursor.NewCursor(first, after, last, before, pageOrderBy) - - page, err := r.iam.OrganizationService.ListMembers(ctx, obj.ID, cursor) - if err != nil { - r.logger.ErrorCtx(ctx, "cannot list memberships", log.Error(err)) - return nil, gqlutils.Internal(ctx) - } - - return types.NewMembershipConnection(page, r, obj.ID), nil +// Profiles is the resolver for the profiles field. +func (r *organizationResolver) Profiles(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types1.ProfileOrderBy) (*types1.ProfileConnection, error) { + panic(fmt.Errorf("not implemented: Profiles - profiles")) } // Invitations is the resolver for the invitations field. @@ -1575,6 +1370,41 @@ func (r *personalAPIKeyConnectionResolver) TotalCount(ctx context.Context, obj * return nil, gqlutils.Internal(ctx) } +// Identity is the resolver for the identity field. +func (r *profileResolver) Identity(ctx context.Context, obj *types.Profile) (*types.Identity, error) { + panic(fmt.Errorf("not implemented: Identity - identity")) +} + +// Organization is the resolver for the organization field. +func (r *profileResolver) Organization(ctx context.Context, obj *types.Profile) (*types.Organization, error) { + panic(fmt.Errorf("not implemented: Organization - organization")) +} + +// Membership is the resolver for the membership field. +func (r *profileResolver) Membership(ctx context.Context, obj *types.Profile) (*types.Membership, error) { + panic(fmt.Errorf("not implemented: Membership - membership")) +} + +// Permission is the resolver for the permission field. +func (r *profileResolver) Permission(ctx context.Context, obj *types.Profile, action string) (bool, error) { + panic(fmt.Errorf("not implemented: Permission - permission")) +} + +// TotalCount is the resolver for the totalCount field. +func (r *profileConnectionResolver) TotalCount(ctx context.Context, obj *types1.ProfileConnection) (int, error) { + panic(fmt.Errorf("not implemented: TotalCount - totalCount")) +} + +// Edges is the resolver for the edges field. +func (r *profileConnectionResolver) Edges(ctx context.Context, obj *types1.ProfileConnection) ([]*types.ProfileEdge, error) { + panic(fmt.Errorf("not implemented: Edges - edges")) +} + +// PageInfo is the resolver for the pageInfo field. +func (r *profileConnectionResolver) PageInfo(ctx context.Context, obj *types1.ProfileConnection) (*types.PageInfo, error) { + panic(fmt.Errorf("not implemented: PageInfo - pageInfo")) +} + // Node is the resolver for the node field. func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error) { var ( @@ -1620,7 +1450,7 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error return nil, err } - return types.NewMembershipProfile(profile), nil + return types.NewProfile(profile), nil } case coredata.MembershipEntityType: action = iam.ActionMembershipGet @@ -2042,16 +1872,6 @@ func (r *Resolver) InvitationConnection() schema.InvitationConnectionResolver { // Membership returns schema.MembershipResolver implementation. func (r *Resolver) Membership() schema.MembershipResolver { return &membershipResolver{r} } -// MembershipConnection returns schema.MembershipConnectionResolver implementation. -func (r *Resolver) MembershipConnection() schema.MembershipConnectionResolver { - return &membershipConnectionResolver{r} -} - -// MembershipProfile returns schema.MembershipProfileResolver implementation. -func (r *Resolver) MembershipProfile() schema.MembershipProfileResolver { - return &membershipProfileResolver{r} -} - // Mutation returns schema.MutationResolver implementation. func (r *Resolver) Mutation() schema.MutationResolver { return &mutationResolver{r} } @@ -2066,6 +1886,14 @@ func (r *Resolver) PersonalAPIKeyConnection() schema.PersonalAPIKeyConnectionRes return &personalAPIKeyConnectionResolver{r} } +// Profile returns schema.ProfileResolver implementation. +func (r *Resolver) Profile() schema.ProfileResolver { return &profileResolver{r} } + +// ProfileConnection returns schema.ProfileConnectionResolver implementation. +func (r *Resolver) ProfileConnection() schema.ProfileConnectionResolver { + return &profileConnectionResolver{r} +} + // Query returns schema.QueryResolver implementation. func (r *Resolver) Query() schema.QueryResolver { return &queryResolver{r} } @@ -2108,12 +1936,12 @@ type identityResolver struct{ *Resolver } type invitationResolver struct{ *Resolver } type invitationConnectionResolver struct{ *Resolver } type membershipResolver struct{ *Resolver } -type membershipConnectionResolver struct{ *Resolver } -type membershipProfileResolver struct{ *Resolver } type mutationResolver struct{ *Resolver } type organizationResolver struct{ *Resolver } type personalAPIKeyResolver struct{ *Resolver } type personalAPIKeyConnectionResolver struct{ *Resolver } +type profileResolver struct{ *Resolver } +type profileConnectionResolver struct{ *Resolver } type queryResolver struct{ *Resolver } type sAMLConfigurationResolver struct{ *Resolver } type sAMLConfigurationConnectionResolver struct{ *Resolver }