@transcend-io/mcp-server-admin 0.3.19 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -10
- package/dist/cli.mjs +2 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/graphql-C1RNzXVj.mjs +1136 -0
- package/dist/graphql-C1RNzXVj.mjs.map +1 -0
- package/dist/index.d.mts +25 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +5 -3
- package/dist/graphql-BVMDAAxF.mjs +0 -406
- package/dist/graphql-BVMDAAxF.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-C1RNzXVj.mjs","names":["types.AdminGetOrganizationDocument","types.AdminGetCurrentUserDocument","types.AdminListUsersDocument","types.AdminListTeamsDocument","types.AdminListApiKeysDocument","types.AdminCreateApiKeyDocument","types.AdminGetPrivacyCenterDocument"],"sources":["../src/tools/admin_create_api_key.ts","../src/tools/admin_get_current_user.ts","../src/tools/admin_get_organization.ts","../src/tools/admin_get_privacy_center.ts","../src/tools/admin_list_api_keys.ts","../src/tools/admin_list_teams.ts","../src/tools/admin_list_users.ts","../src/tools/admin_test_connection.ts","../src/tools/index.ts","../src/scopes.ts","../src/__generated__/graphql.ts","../src/__generated__/gql.ts","../src/graphql.ts"],"sourcesContent":["import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\nimport { ScopeName, TRANSCEND_SCOPES } from '@transcend-io/privacy-types';\n\nimport type { AdminMixin } from '../graphql.js';\n\nconst scopeSummary = Object.entries(TRANSCEND_SCOPES)\n .map(([name, def]) => {\n const deps = def.dependencies.length > 0 ? ` (requires: ${def.dependencies.join(', ')})` : '';\n return `- ${name}: ${def.title} — ${def.description}${deps}`;\n })\n .join('\\n');\n\nexport const CreateApiKeySchema = z.object({\n title: z.string().describe('Name/title for the API key'),\n scopes: z.array(z.nativeEnum(ScopeName)).describe('Array of permission scopes for the key'),\n dataSilos: z\n .array(z.string())\n .optional()\n .describe('Array of data silo IDs to assign the key to (optional)'),\n});\nexport type CreateApiKeyInput = z.infer<typeof CreateApiKeySchema>;\n\nexport function createAdminCreateApiKeyTool(clients: ToolClients) {\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_create_api_key',\n description:\n 'Create a new API key with specified scopes. WARNING: The token is only shown once! ' +\n 'Scopes control what the key can access. Some scopes inherit dependencies — ' +\n 'for example, manageDataMap requires viewDataMap. ' +\n 'Use \"readOnly\" for view-only access to all resources, or \"fullAdmin\" for unrestricted access. ' +\n 'Common scopes: manageApiKeys, manageDataMap, manageConsentManager, makeDataSubjectRequest, ' +\n 'connectDataSilos, manageAssessments, manageDataInventory.\\n\\n' +\n 'Available scopes:\\n' +\n scopeSummary,\n category: 'Admin',\n readOnly: false,\n confirmationHint: 'Creates a new API key with the specified scopes',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },\n zodSchema: CreateApiKeySchema,\n handler: async ({ title, scopes, dataSilos }) => {\n const created = await graphql.createApiKey({ title, scopes, dataSilos });\n const { token, ...apiKey } = created;\n return createToolResult(true, {\n apiKey,\n token,\n warning: 'IMPORTANT: Save this token now! It will not be shown again.',\n message: `API key \"${title}\" created successfully`,\n });\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n EmptySchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AdminMixin } from '../graphql.js';\n\nexport function createAdminGetCurrentUserTool(clients: ToolClients) {\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_get_current_user',\n description: 'Get information about the currently authenticated user (the API key owner)',\n category: 'Admin',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: EmptySchema,\n handler: async (_args) => {\n const result = await graphql.getCurrentUser();\n return createToolResult(true, result);\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n EmptySchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AdminMixin } from '../graphql.js';\n\nexport function createAdminGetOrganizationTool(clients: ToolClients) {\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_get_organization',\n description: 'Get information about your Transcend organization',\n category: 'Admin',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: EmptySchema,\n handler: async (_args) => {\n const result = await graphql.getOrganization();\n return createToolResult(true, result);\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n EmptySchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AdminMixin } from '../graphql.js';\n\nexport function createAdminGetPrivacyCenterTool(clients: ToolClients) {\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_get_privacy_center',\n description: 'Get privacy center configuration for your organization',\n category: 'Admin',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: EmptySchema,\n handler: async (_args) => {\n const result = await graphql.getPrivacyCenter();\n if (!result) {\n return createToolResult(true, {\n found: false,\n message: 'No privacy center configured for this organization',\n });\n }\n return createToolResult(true, { found: true, privacyCenter: result });\n },\n });\n}\n","import { createListResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AdminMixin } from '../graphql.js';\n\nexport const ListApiKeysSchema = z.object({\n limit: z.coerce\n .number()\n .min(1)\n .max(100)\n .optional()\n .default(50)\n .describe('Results per page (1-100, default: 50)'),\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n offset: z.coerce\n .number()\n .min(0)\n .optional()\n .default(0)\n .describe('Number of results to skip (default: 0)'),\n});\nexport type ListApiKeysInput = z.infer<typeof ListApiKeysSchema>;\n\nexport function createAdminListApiKeysTool(clients: ToolClients) {\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_list_api_keys',\n description:\n 'List all API keys configured for your organization (tokens are not shown). Note: API does not support cursor pagination (max ~100 results).',\n category: 'Admin',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListApiKeysSchema,\n handler: async ({ limit, offset }) => {\n const result = await graphql.listApiKeys({\n first: limit,\n offset,\n });\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import { createListResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AdminMixin } from '../graphql.js';\n\nexport const ListTeamsSchema = z.object({\n limit: z.coerce\n .number()\n .min(1)\n .max(100)\n .optional()\n .default(50)\n .describe('Results per page (1-100, default: 50)'),\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListTeamsInput = z.infer<typeof ListTeamsSchema>;\n\nexport function createAdminListTeamsTool(clients: ToolClients) {\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_list_teams',\n description:\n 'List all teams in your Transcend organization. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Admin',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListTeamsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listTeams({\n first: limit,\n after: cursor,\n });\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import { createListResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AdminMixin } from '../graphql.js';\n\nexport const ListUsersSchema = z.object({\n limit: z.coerce\n .number()\n .min(1)\n .max(100)\n .optional()\n .default(50)\n .describe('Results per page (1-100, default: 50)'),\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListUsersInput = z.infer<typeof ListUsersSchema>;\n\nexport function createAdminListUsersTool(clients: ToolClients) {\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_list_users',\n description:\n 'List all users in your Transcend organization. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Admin',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListUsersSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listUsers({\n first: limit,\n after: cursor,\n });\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n EmptySchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AdminMixin } from '../graphql.js';\n\nexport function createAdminTestConnectionTool(clients: ToolClients) {\n const { rest } = clients;\n const graphql = clients.graphql as AdminMixin;\n return defineTool({\n name: 'admin_test_connection',\n description: 'Test connectivity to both Transcend REST and GraphQL APIs',\n category: 'Admin',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: EmptySchema,\n handler: async (_args) => {\n const [graphqlConnected, restConnected] = await Promise.all([\n graphql.testConnection(),\n rest.testConnection(),\n ]);\n const allConnected = graphqlConnected && restConnected;\n return createToolResult(true, {\n connected: allConnected,\n details: {\n graphql: { connected: graphqlConnected, url: graphql.getBaseUrl() },\n rest: { connected: restConnected, url: rest.getBaseUrl() },\n },\n message: allConnected\n ? 'Successfully connected to all Transcend APIs'\n : 'Some API connections failed - check details',\n timestamp: new Date().toISOString(),\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createAdminCreateApiKeyTool } from './admin_create_api_key.js';\nimport { createAdminGetCurrentUserTool } from './admin_get_current_user.js';\nimport { createAdminGetOrganizationTool } from './admin_get_organization.js';\nimport { createAdminGetPrivacyCenterTool } from './admin_get_privacy_center.js';\nimport { createAdminListApiKeysTool } from './admin_list_api_keys.js';\nimport { createAdminListTeamsTool } from './admin_list_teams.js';\nimport { createAdminListUsersTool } from './admin_list_users.js';\nimport { createAdminTestConnectionTool } from './admin_test_connection.js';\n\nexport function getAdminTools(clients: ToolClients): ToolDefinition[] {\n return [\n createAdminGetOrganizationTool(clients),\n createAdminGetCurrentUserTool(clients),\n createAdminListUsersTool(clients),\n createAdminListTeamsTool(clients),\n createAdminListApiKeysTool(clients),\n createAdminCreateApiKeyTool(clients),\n createAdminGetPrivacyCenterTool(clients),\n createAdminTestConnectionTool(clients),\n ];\n}\n","import { ScopeName } from '@transcend-io/privacy-types';\n\n/** OAuth scopes required for Admin MCP tools (offline_access added by base). */\nexport const ADMIN_OAUTH_SCOPES = [\n ScopeName.ViewEmployees,\n ScopeName.ViewApiKeys,\n ScopeName.ManageApiKeys,\n] as const;\n","/* eslint-disable */\n/** Internal type. DO NOT USE DIRECTLY. */\ntype Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\n/** Internal type. DO NOT USE DIRECTLY. */\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type ApiKeyInput = {\n dataSilos?: Array<string | number> | null | undefined;\n isMcp?: boolean | null | undefined;\n scopes?: Array<ScopeName> | null | undefined;\n title: string;\n};\n\nexport type PrivacyCenterLookupInput = {\n type?: PrivacyCenterType | null | undefined;\n url?: string | null | undefined;\n};\n\nexport type PrivacyCenterType =\n | 'DEPLOYED'\n | 'PREVIEW';\n\nexport type ScopeName =\n | 'activatePolicyEngineBundles'\n | 'approvePrompts'\n | 'connectDataSilos'\n | 'deployConsentManager'\n | 'deployPrivacyCenter'\n | 'deployTestConsentManager'\n | 'executeAuditor'\n | 'executePrompt'\n | 'executeRules'\n | 'fullAdmin'\n | 'generatePreferenceAccessTokens'\n | 'llmLogTransfer'\n | 'makeDataSubjectRequest'\n | 'manageAccessControl'\n | 'manageActionItemCollections'\n | 'manageAllActionItems'\n | 'manageApiKeys'\n | 'manageAssessments'\n | 'manageAssignedAssessments'\n | 'manageAssignedBulkRespond'\n | 'manageAssignedRules'\n | 'manageAuditor'\n | 'manageBilling'\n | 'manageCodeScanning'\n | 'manageConsentManager'\n | 'manageConsentManagerDeveloperSettings'\n | 'manageConsentManagerDisplaySettings'\n | 'manageContractScanning'\n | 'manageDataFlow'\n | 'manageDataInventory'\n | 'manageDataMap'\n | 'manageDataSubCategories'\n | 'manageDataSubjectRequestSettings'\n | 'manageEmailDomains'\n | 'manageEmailTemplates'\n | 'manageGlobalAttributes'\n | 'manageIntlMessages'\n | 'manageLegalHold'\n | 'manageOrganizationInfo'\n | 'managePathfinder'\n | 'managePolicies'\n | 'managePolicyEngineBundles'\n | 'managePreferenceStoreSettings'\n | 'managePrivacyCenter'\n | 'managePromptRuns'\n | 'managePrompts'\n | 'manageRequestCompilation'\n | 'manageRequestIdentities'\n | 'manageRequestSecurity'\n | 'manageRules'\n | 'manageSSO'\n | 'manageSombraRootKeys'\n | 'manageStoredPreferences'\n | 'manageWorkflows'\n | 'managedAssignedConsentManager'\n | 'managedAssignedDataInventory'\n | 'managedAssignedIntegrations'\n | 'managedAssignedRequests'\n | 'readOnly'\n | 'requestApproval'\n | 'viewAllActionItems'\n | 'viewApiKeys'\n | 'viewAssessments'\n | 'viewAssignedAssessments'\n | 'viewAssignedConsentManager'\n | 'viewAssignedDataInventory'\n | 'viewAssignedIntegrations'\n | 'viewAssignedRequests'\n | 'viewAssignedRules'\n | 'viewAuditEvents'\n | 'viewAuditorRuns'\n | 'viewCodeScanning'\n | 'viewConsentManager'\n | 'viewContractScanning'\n | 'viewCustomerDataDataMapping'\n | 'viewCustomerDataPrivacyRequests'\n | 'viewDataFlow'\n | 'viewDataInventory'\n | 'viewDataMap'\n | 'viewDataSubCategories'\n | 'viewDataSubjectRequestSettings'\n | 'viewEmailDomains'\n | 'viewEmailTemplates'\n | 'viewEmployees'\n | 'viewGlobalAttributes'\n | 'viewIntlMessages'\n | 'viewLegalHold'\n | 'viewManagedConsentDatabaseAdminApi'\n | 'viewPathfinder'\n | 'viewPolicies'\n | 'viewPolicyEngineBundles'\n | 'viewPreferenceStoreSettings'\n | 'viewPrivacyCenter'\n | 'viewPromptRuns'\n | 'viewPrompts'\n | 'viewRequestCompilation'\n | 'viewRequestIdentitySettings'\n | 'viewRequests'\n | 'viewRules'\n | 'viewSSO'\n | 'viewScopes';\n\nexport type UserFiltersInput = {\n canRevealMultiTenantSombraSecret?: boolean | null | undefined;\n derivedScopeNames?: Array<ScopeName> | null | undefined;\n ids?: Array<string | number> | null | undefined;\n isAdmin?: boolean | null | undefined;\n isInvited?: boolean | null | undefined;\n isLocked?: boolean | null | undefined;\n lastLoggedInAfter?: string | null | undefined;\n lastLoggedInBefore?: string | null | undefined;\n scopeNames?: Array<ScopeName> | null | undefined;\n teamIds?: Array<string | number> | null | undefined;\n text?: string | null | undefined;\n};\n\nexport type AdminGetOrganizationQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type AdminGetOrganizationQuery = { organization: { id: string, name: string, uri: string, createdAt: string } };\n\nexport type AdminGetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type AdminGetCurrentUserQuery = { user: { id: string, email: string, name: string, createdAt: string } | null };\n\nexport type AdminListUsersQueryVariables = Exact<{\n first?: number | null | undefined;\n filterBy?: UserFiltersInput | null | undefined;\n}>;\n\n\nexport type AdminListUsersQuery = { users: { totalCount: number, nodes: Array<{ id: string, email: string, name: string }> } };\n\nexport type AdminListTeamsQueryVariables = Exact<{\n first?: number | null | undefined;\n}>;\n\n\nexport type AdminListTeamsQuery = { teams: { totalCount: number, nodes: Array<{ id: string, name: string }> } };\n\nexport type AdminListApiKeysQueryVariables = Exact<{\n first?: number | null | undefined;\n offset?: number | null | undefined;\n}>;\n\n\nexport type AdminListApiKeysQuery = { apiKeys: { totalCount: number, nodes: Array<{ id: string, title: string, lastUsedAt: string | null, createdAt: string, scopes: Array<{ id: string, name: ScopeName }> }> } };\n\nexport type AdminCreateApiKeyMutationVariables = Exact<{\n input: ApiKeyInput;\n}>;\n\n\nexport type AdminCreateApiKeyMutation = { createApiKey: { apiKey: { id: string, title: string, apiKey: string, preview: string, createdAt: string, scopes: Array<{ id: string, name: ScopeName }> } } };\n\nexport type AdminGetPrivacyCenterQueryVariables = Exact<{\n lookup?: PrivacyCenterLookupInput | null | undefined;\n}>;\n\n\nexport type AdminGetPrivacyCenterQuery = { privacyCenter: { id: string } };\n\n\nexport const AdminGetOrganizationDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"AdminGetOrganization\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"organization\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"uri\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdAt\"}}]}}]}}]} as unknown as DocumentNode<AdminGetOrganizationQuery, AdminGetOrganizationQueryVariables>;\nexport const AdminGetCurrentUserDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"AdminGetCurrentUser\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"user\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"email\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdAt\"}}]}}]}}]} as unknown as DocumentNode<AdminGetCurrentUserQuery, AdminGetCurrentUserQueryVariables>;\nexport const AdminListUsersDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"AdminListUsers\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"filterBy\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"UserFiltersInput\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"users\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"filterBy\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"filterBy\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"email\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<AdminListUsersQuery, AdminListUsersQueryVariables>;\nexport const AdminListTeamsDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"AdminListTeams\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"teams\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<AdminListTeamsQuery, AdminListTeamsQueryVariables>;\nexport const AdminListApiKeysDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"AdminListApiKeys\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"offset\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"apiKeys\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"offset\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"offset\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"scopes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"lastUsedAt\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdAt\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<AdminListApiKeysQuery, AdminListApiKeysQueryVariables>;\nexport const AdminCreateApiKeyDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"mutation\",\"name\":{\"kind\":\"Name\",\"value\":\"AdminCreateApiKey\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"ApiKeyInput\"}}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createApiKey\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"input\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"apiKey\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"apiKey\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"preview\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"scopes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdAt\"}}]}}]}}]}}]} as unknown as DocumentNode<AdminCreateApiKeyMutation, AdminCreateApiKeyMutationVariables>;\nexport const AdminGetPrivacyCenterDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"AdminGetPrivacyCenter\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"lookup\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"PrivacyCenterLookupInput\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"privacyCenter\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"lookup\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"lookup\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}}]}}]}}]} as unknown as DocumentNode<AdminGetPrivacyCenterQuery, AdminGetPrivacyCenterQueryVariables>;","/* eslint-disable */\nimport * as types from './graphql.js';\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size\n */\ntype Documents = {\n \"\\n query AdminGetOrganization {\\n organization {\\n id\\n name\\n uri\\n createdAt\\n }\\n }\\n\": typeof types.AdminGetOrganizationDocument,\n \"\\n query AdminGetCurrentUser {\\n user {\\n id\\n email\\n name\\n createdAt\\n }\\n }\\n\": typeof types.AdminGetCurrentUserDocument,\n \"\\n query AdminListUsers($first: Int, $filterBy: UserFiltersInput) {\\n users(first: $first, filterBy: $filterBy) {\\n nodes {\\n id\\n email\\n name\\n }\\n totalCount\\n }\\n }\\n\": typeof types.AdminListUsersDocument,\n \"\\n query AdminListTeams($first: Int) {\\n teams(first: $first) {\\n nodes {\\n id\\n name\\n }\\n totalCount\\n }\\n }\\n\": typeof types.AdminListTeamsDocument,\n \"\\n query AdminListApiKeys($first: Int, $offset: Int) {\\n apiKeys(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n scopes {\\n id\\n name\\n }\\n lastUsedAt\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\": typeof types.AdminListApiKeysDocument,\n \"\\n mutation AdminCreateApiKey($input: ApiKeyInput!) {\\n createApiKey(input: $input) {\\n apiKey {\\n id\\n title\\n apiKey\\n preview\\n scopes {\\n id\\n name\\n }\\n createdAt\\n }\\n }\\n }\\n\": typeof types.AdminCreateApiKeyDocument,\n \"\\n query AdminGetPrivacyCenter($lookup: PrivacyCenterLookupInput) {\\n privacyCenter(lookup: $lookup) {\\n id\\n }\\n }\\n\": typeof types.AdminGetPrivacyCenterDocument,\n};\nconst documents: Documents = {\n \"\\n query AdminGetOrganization {\\n organization {\\n id\\n name\\n uri\\n createdAt\\n }\\n }\\n\": types.AdminGetOrganizationDocument,\n \"\\n query AdminGetCurrentUser {\\n user {\\n id\\n email\\n name\\n createdAt\\n }\\n }\\n\": types.AdminGetCurrentUserDocument,\n \"\\n query AdminListUsers($first: Int, $filterBy: UserFiltersInput) {\\n users(first: $first, filterBy: $filterBy) {\\n nodes {\\n id\\n email\\n name\\n }\\n totalCount\\n }\\n }\\n\": types.AdminListUsersDocument,\n \"\\n query AdminListTeams($first: Int) {\\n teams(first: $first) {\\n nodes {\\n id\\n name\\n }\\n totalCount\\n }\\n }\\n\": types.AdminListTeamsDocument,\n \"\\n query AdminListApiKeys($first: Int, $offset: Int) {\\n apiKeys(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n scopes {\\n id\\n name\\n }\\n lastUsedAt\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\": types.AdminListApiKeysDocument,\n \"\\n mutation AdminCreateApiKey($input: ApiKeyInput!) {\\n createApiKey(input: $input) {\\n apiKey {\\n id\\n title\\n apiKey\\n preview\\n scopes {\\n id\\n name\\n }\\n createdAt\\n }\\n }\\n }\\n\": types.AdminCreateApiKeyDocument,\n \"\\n query AdminGetPrivacyCenter($lookup: PrivacyCenterLookupInput) {\\n privacyCenter(lookup: $lookup) {\\n id\\n }\\n }\\n\": types.AdminGetPrivacyCenterDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query AdminGetOrganization {\\n organization {\\n id\\n name\\n uri\\n createdAt\\n }\\n }\\n\"): (typeof documents)[\"\\n query AdminGetOrganization {\\n organization {\\n id\\n name\\n uri\\n createdAt\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query AdminGetCurrentUser {\\n user {\\n id\\n email\\n name\\n createdAt\\n }\\n }\\n\"): (typeof documents)[\"\\n query AdminGetCurrentUser {\\n user {\\n id\\n email\\n name\\n createdAt\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query AdminListUsers($first: Int, $filterBy: UserFiltersInput) {\\n users(first: $first, filterBy: $filterBy) {\\n nodes {\\n id\\n email\\n name\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query AdminListUsers($first: Int, $filterBy: UserFiltersInput) {\\n users(first: $first, filterBy: $filterBy) {\\n nodes {\\n id\\n email\\n name\\n }\\n totalCount\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query AdminListTeams($first: Int) {\\n teams(first: $first) {\\n nodes {\\n id\\n name\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query AdminListTeams($first: Int) {\\n teams(first: $first) {\\n nodes {\\n id\\n name\\n }\\n totalCount\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query AdminListApiKeys($first: Int, $offset: Int) {\\n apiKeys(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n scopes {\\n id\\n name\\n }\\n lastUsedAt\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query AdminListApiKeys($first: Int, $offset: Int) {\\n apiKeys(first: $first, offset: $offset) {\\n nodes {\\n id\\n title\\n scopes {\\n id\\n name\\n }\\n lastUsedAt\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n mutation AdminCreateApiKey($input: ApiKeyInput!) {\\n createApiKey(input: $input) {\\n apiKey {\\n id\\n title\\n apiKey\\n preview\\n scopes {\\n id\\n name\\n }\\n createdAt\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n mutation AdminCreateApiKey($input: ApiKeyInput!) {\\n createApiKey(input: $input) {\\n apiKey {\\n id\\n title\\n apiKey\\n preview\\n scopes {\\n id\\n name\\n }\\n createdAt\\n }\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query AdminGetPrivacyCenter($lookup: PrivacyCenterLookupInput) {\\n privacyCenter(lookup: $lookup) {\\n id\\n }\\n }\\n\"): (typeof documents)[\"\\n query AdminGetPrivacyCenter($lookup: PrivacyCenterLookupInput) {\\n privacyCenter(lookup: $lookup) {\\n id\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;","import {\n TranscendGraphQLBase,\n type ApiKey,\n type ApiKeyCreateInput,\n type ListOptions,\n type Organization,\n type PaginatedResponse,\n type PrivacyCenter,\n type Team,\n type User,\n} from '@transcend-io/mcp-server-base';\n\nimport { graphql } from './__generated__/gql.js';\nimport type { ScopeName } from './__generated__/graphql.js';\n\nconst GetOrganizationDoc = graphql(/* GraphQL */ `\n query AdminGetOrganization {\n organization {\n id\n name\n uri\n createdAt\n }\n }\n`);\n\nconst GetCurrentUserDoc = graphql(/* GraphQL */ `\n query AdminGetCurrentUser {\n user {\n id\n email\n name\n createdAt\n }\n }\n`);\n\nconst ListUsersDoc = graphql(/* GraphQL */ `\n query AdminListUsers($first: Int, $filterBy: UserFiltersInput) {\n users(first: $first, filterBy: $filterBy) {\n nodes {\n id\n email\n name\n }\n totalCount\n }\n }\n`);\n\nconst ListTeamsDoc = graphql(/* GraphQL */ `\n query AdminListTeams($first: Int) {\n teams(first: $first) {\n nodes {\n id\n name\n }\n totalCount\n }\n }\n`);\n\nconst ListApiKeysDoc = graphql(/* GraphQL */ `\n query AdminListApiKeys($first: Int, $offset: Int) {\n apiKeys(first: $first, offset: $offset) {\n nodes {\n id\n title\n scopes {\n id\n name\n }\n lastUsedAt\n createdAt\n }\n totalCount\n }\n }\n`);\n\nconst CreateApiKeyDoc = graphql(/* GraphQL */ `\n mutation AdminCreateApiKey($input: ApiKeyInput!) {\n createApiKey(input: $input) {\n apiKey {\n id\n title\n apiKey\n preview\n scopes {\n id\n name\n }\n createdAt\n }\n }\n }\n`);\n\nconst GetPrivacyCenterDoc = graphql(/* GraphQL */ `\n query AdminGetPrivacyCenter($lookup: PrivacyCenterLookupInput) {\n privacyCenter(lookup: $lookup) {\n id\n }\n }\n`);\n\n/**\n * The plain-text token returned by `createApiKey`. Exposed once -- the\n * server never returns this value again, so callers must persist it\n * immediately.\n */\nexport interface CreatedApiKey extends ApiKey {\n /**\n * The plain-text bearer token. Only returned by `createApiKey`/`duplicateApiKey`;\n * re-fetching the API key later returns the `preview` instead.\n */\n token: string;\n}\n\nexport class AdminMixin extends TranscendGraphQLBase {\n async getOrganization(): Promise<Organization> {\n const data = await this.makeRequest(GetOrganizationDoc);\n return {\n id: data.organization.id,\n name: data.organization.name,\n uri: data.organization.uri,\n createdAt: data.organization.createdAt,\n };\n }\n\n async getCurrentUser(): Promise<User> {\n const data = await this.makeRequest(GetCurrentUserDoc);\n if (!data.user) {\n throw new Error('No user is currently authenticated for this API key.');\n }\n return {\n id: data.user.id,\n email: data.user.email,\n name: data.user.name,\n isActive: true,\n createdAt: new Date(0).toISOString(),\n };\n }\n\n async listUsers(\n options?: ListOptions & { filterBy?: { text?: string } },\n ): Promise<PaginatedResponse<User>> {\n const data = await this.makeRequest(ListUsersDoc, {\n first: Math.min(options?.first ?? 50, 100),\n filterBy: options?.filterBy ?? null,\n });\n return {\n nodes: data.users.nodes.map((node) => ({\n id: node.id,\n email: node.email,\n name: node.name,\n isActive: true,\n createdAt: new Date(0).toISOString(),\n })),\n pageInfo: {\n hasNextPage: data.users.nodes.length < data.users.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.users.totalCount,\n };\n }\n\n async listTeams(options?: ListOptions): Promise<PaginatedResponse<Team>> {\n const data = await this.makeRequest(ListTeamsDoc, {\n first: Math.min(options?.first ?? 50, 100),\n });\n return {\n nodes: data.teams.nodes.map((node) => ({\n id: node.id,\n name: node.name,\n createdAt: new Date(0).toISOString(),\n })),\n pageInfo: {\n hasNextPage: data.teams.nodes.length < data.teams.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.teams.totalCount,\n };\n }\n\n async listApiKeys(options?: ListOptions): Promise<PaginatedResponse<ApiKey>> {\n const data = await this.makeRequest(ListApiKeysDoc, {\n first: Math.min(options?.first ?? 50, 100),\n offset: options?.offset ?? 0,\n });\n return {\n nodes: data.apiKeys.nodes.map((node) => ({\n id: node.id,\n title: node.title,\n scopes: node.scopes.map((scope) => ({\n id: scope.id,\n name: scope.name,\n })),\n lastUsedAt: node.lastUsedAt ?? undefined,\n createdAt: node.createdAt,\n })),\n pageInfo: {\n hasNextPage: data.apiKeys.nodes.length < data.apiKeys.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.apiKeys.totalCount,\n };\n }\n\n /**\n * Create a new API key. The returned `token` is the plain-text bearer the\n * caller must surface to the user immediately -- the API key endpoint never\n * returns it again. The token is on `createApiKey.apiKey.apiKey` (a sibling\n * of `id`/`title`/`scopes`), not a top-level `token` field.\n */\n async createApiKey(input: ApiKeyCreateInput): Promise<CreatedApiKey> {\n const data = await this.makeRequest(CreateApiKeyDoc, {\n input: {\n title: input.title,\n // The manual ApiKeyCreateInput type accepts string[] for backwards\n // compatibility; the GraphQL schema expects the ScopeName enum, which\n // codegen emits as a string-valued TS enum. Cast at the boundary --\n // invalid scopes still surface as a server-side validation error.\n scopes: input.scopes as ScopeName[],\n dataSilos: input.dataSilos ?? null,\n },\n });\n const created = data.createApiKey.apiKey;\n return {\n id: created.id,\n title: created.title,\n scopes: created.scopes.map((scope) => ({\n id: scope.id,\n name: scope.name,\n })),\n createdAt: created.createdAt,\n token: created.apiKey,\n };\n }\n\n async getPrivacyCenter(lookup?: { url?: string }): Promise<PrivacyCenter | null> {\n try {\n const data = await this.makeRequest(GetPrivacyCenterDoc, {\n lookup: lookup ?? null,\n });\n if (data.privacyCenter) {\n return {\n id: data.privacyCenter.id,\n name: 'Privacy Center',\n url: lookup?.url ?? '',\n isActive: true,\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n }\n return null;\n } catch {\n return null;\n }\n }\n}\n"],"mappings":";;;AAKA,MAAM,eAAe,OAAO,QAAQ,iBAAiB,CAClD,KAAK,CAAC,MAAM,SAAS;CACpB,MAAM,OAAO,IAAI,aAAa,SAAS,IAAI,eAAe,IAAI,aAAa,KAAK,KAAK,CAAC,KAAK;AAC3F,QAAO,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,cAAc;EACtD,CACD,KA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+4,23 @@ import { ScopeName } from "@transcend-io/privacy-types";
|
|
|
4
4
|
//#region src/tools/index.d.ts
|
|
5
5
|
declare function getAdminTools(clients: ToolClients): ToolDefinition[];
|
|
6
6
|
//#endregion
|
|
7
|
+
//#region src/scopes.d.ts
|
|
8
|
+
/** OAuth scopes required for Admin MCP tools (offline_access added by base). */
|
|
9
|
+
declare const ADMIN_OAUTH_SCOPES: readonly [ScopeName.ViewEmployees, ScopeName.ViewApiKeys, ScopeName.ManageApiKeys];
|
|
10
|
+
//#endregion
|
|
7
11
|
//#region src/graphql.d.ts
|
|
12
|
+
/**
|
|
13
|
+
* The plain-text token returned by `createApiKey`. Exposed once -- the
|
|
14
|
+
* server never returns this value again, so callers must persist it
|
|
15
|
+
* immediately.
|
|
16
|
+
*/
|
|
17
|
+
interface CreatedApiKey extends ApiKey {
|
|
18
|
+
/**
|
|
19
|
+
* The plain-text bearer token. Only returned by `createApiKey`/`duplicateApiKey`;
|
|
20
|
+
* re-fetching the API key later returns the `preview` instead.
|
|
21
|
+
*/
|
|
22
|
+
token: string;
|
|
23
|
+
}
|
|
8
24
|
declare class AdminMixin extends TranscendGraphQLBase {
|
|
9
25
|
getOrganization(): Promise<Organization>;
|
|
10
26
|
getCurrentUser(): Promise<User>;
|
|
@@ -15,10 +31,13 @@ declare class AdminMixin extends TranscendGraphQLBase {
|
|
|
15
31
|
}): Promise<PaginatedResponse<User>>;
|
|
16
32
|
listTeams(options?: ListOptions): Promise<PaginatedResponse<Team>>;
|
|
17
33
|
listApiKeys(options?: ListOptions): Promise<PaginatedResponse<ApiKey>>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Create a new API key. The returned `token` is the plain-text bearer the
|
|
36
|
+
* caller must surface to the user immediately -- the API key endpoint never
|
|
37
|
+
* returns it again. The token is on `createApiKey.apiKey.apiKey` (a sibling
|
|
38
|
+
* of `id`/`title`/`scopes`), not a top-level `token` field.
|
|
39
|
+
*/
|
|
40
|
+
createApiKey(input: ApiKeyCreateInput): Promise<CreatedApiKey>;
|
|
22
41
|
getPrivacyCenter(lookup?: {
|
|
23
42
|
url?: string;
|
|
24
43
|
}): Promise<PrivacyCenter | null>;
|
|
@@ -28,7 +47,7 @@ declare class AdminMixin extends TranscendGraphQLBase {
|
|
|
28
47
|
declare const CreateApiKeySchema: z.ZodObject<{
|
|
29
48
|
title: z.ZodString;
|
|
30
49
|
scopes: z.ZodArray<z.ZodEnum<typeof ScopeName>>;
|
|
31
|
-
|
|
50
|
+
dataSilos: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
51
|
}, z.core.$strip>;
|
|
33
52
|
type CreateApiKeyInput = z.infer<typeof CreateApiKeySchema>;
|
|
34
53
|
//#endregion
|
|
@@ -54,5 +73,5 @@ declare const ListUsersSchema: z.ZodObject<{
|
|
|
54
73
|
}, z.core.$strip>;
|
|
55
74
|
type ListUsersInput = z.infer<typeof ListUsersSchema>;
|
|
56
75
|
//#endregion
|
|
57
|
-
export { AdminMixin, type CreateApiKeyInput, CreateApiKeySchema, type ListApiKeysInput, ListApiKeysSchema, type ListTeamsInput, ListTeamsSchema, type ListUsersInput, ListUsersSchema, getAdminTools };
|
|
76
|
+
export { ADMIN_OAUTH_SCOPES, AdminMixin, type CreateApiKeyInput, CreateApiKeySchema, type ListApiKeysInput, ListApiKeysSchema, type ListTeamsInput, ListTeamsSchema, type ListUsersInput, ListUsersSchema, getAdminTools };
|
|
58
77
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/graphql.ts","../src/tools/admin_create_api_key.ts","../src/tools/admin_list_api_keys.ts","../src/tools/admin_list_teams.ts","../src/tools/admin_list_users.ts"],"mappings":";;;;iBAWgB,aAAA,CAAc,OAAA,EAAS,WAAA,GAAc,cAAA
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/scopes.ts","../src/graphql.ts","../src/tools/admin_create_api_key.ts","../src/tools/admin_list_api_keys.ts","../src/tools/admin_list_teams.ts","../src/tools/admin_list_users.ts"],"mappings":";;;;iBAWgB,aAAA,CAAc,OAAA,EAAS,WAAA,GAAc,cAAA;;;;cCRxC,kBAAA,YAAkB,SAAA,CAAA,aAAA,EAAA,SAAA,CAAA,WAAA,EAAA,SAAA,CAAA,aAAA;;;;;;ADQ/B;;UEoGiB,aAAA,SAAsB,MAAA;EFpG4B;;;;EEyGjE,KAAA;AAAA;AAAA,cAGW,UAAA,SAAmB,oBAAA;EACxB,eAAA,CAAA,GAAmB,OAAA,CAAQ,YAAA;EAU3B,cAAA,CAAA,GAAkB,OAAA,CAAQ,IAAA;EAc1B,SAAA,CACJ,OAAA,GAAU,WAAA;IAAgB,QAAA;MAAa,IAAA;IAAA;EAAA,IACtC,OAAA,CAAQ,iBAAA,CAAkB,IAAA;EAqBvB,SAAA,CAAU,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,IAAA;EAkB5D,WAAA,CAAY,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,MAAA;EDtLvC;;;;;;ECoNvB,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAoB,OAAA,CAAQ,aAAA;EAyBhD,gBAAA,CAAiB,MAAA;IAAW,GAAA;EAAA,IAAiB,OAAA,CAAQ,aAAA;AAAA;;;cCpOhD,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;KAQnB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,kBAAA;;;cChBlC,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;KAmBlB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,iBAAA;;;cCnBjC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;KAahB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,eAAA;;;cCb/B,eAAA,EAAe,CAAA,CAAA,SAAA;;;;KAahB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,eAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { AdminMixin, CreateApiKeySchema, ListApiKeysSchema, ListTeamsSchema, ListUsersSchema, getAdminTools };
|
|
1
|
+
import { a as ListTeamsSchema, i as ListUsersSchema, n as ADMIN_OAUTH_SCOPES, o as ListApiKeysSchema, r as getAdminTools, s as CreateApiKeySchema, t as AdminMixin } from "./graphql-C1RNzXVj.mjs";
|
|
2
|
+
export { ADMIN_OAUTH_SCOPES, AdminMixin, CreateApiKeySchema, ListApiKeysSchema, ListTeamsSchema, ListUsersSchema, getAdminTools };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transcend-io/mcp-server-admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Transcend MCP Server — Admin tools.",
|
|
5
5
|
"homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-admin",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@graphql-typed-document-node/core": "^3.2.0",
|
|
33
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
|
+
"graphql": "^16.14.0",
|
|
34
36
|
"zod": "^4.3.6",
|
|
35
|
-
"@transcend-io/mcp-server-base": "0.
|
|
36
|
-
"@transcend-io/privacy-types": "5.
|
|
37
|
+
"@transcend-io/mcp-server-base": "0.5.0",
|
|
38
|
+
"@transcend-io/privacy-types": "5.4.0"
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
39
41
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
import { EmptySchema, TranscendGraphQLBase, createListResult, createToolResult, defineTool, z } from "@transcend-io/mcp-server-base";
|
|
2
|
-
import { ScopeName, TRANSCEND_SCOPES } from "@transcend-io/privacy-types";
|
|
3
|
-
//#region src/tools/admin_create_api_key.ts
|
|
4
|
-
const scopeSummary = Object.entries(TRANSCEND_SCOPES).map(([name, def]) => {
|
|
5
|
-
const deps = def.dependencies.length > 0 ? ` (requires: ${def.dependencies.join(", ")})` : "";
|
|
6
|
-
return `- ${name}: ${def.title} — ${def.description}${deps}`;
|
|
7
|
-
}).join("\n");
|
|
8
|
-
const CreateApiKeySchema = z.object({
|
|
9
|
-
title: z.string().describe("Name/title for the API key"),
|
|
10
|
-
scopes: z.array(z.nativeEnum(ScopeName)).describe("Array of permission scopes for the key"),
|
|
11
|
-
data_silos: z.array(z.string()).optional().describe("Array of data silo IDs to assign the key to (optional)")
|
|
12
|
-
});
|
|
13
|
-
function createAdminCreateApiKeyTool(clients) {
|
|
14
|
-
const graphql = clients.graphql;
|
|
15
|
-
return defineTool({
|
|
16
|
-
name: "admin_create_api_key",
|
|
17
|
-
description: "Create a new API key with specified scopes. WARNING: The token is only shown once! Scopes control what the key can access. Some scopes inherit dependencies — for example, manageDataMap requires viewDataMap. Use \"readOnly\" for view-only access to all resources, or \"fullAdmin\" for unrestricted access. Common scopes: manageApiKeys, manageDataMap, manageConsentManager, makeDataSubjectRequest, connectDataSilos, manageAssessments, manageDataInventory.\n\nAvailable scopes:\n" + scopeSummary,
|
|
18
|
-
category: "Admin",
|
|
19
|
-
readOnly: false,
|
|
20
|
-
confirmationHint: "Creates a new API key with the specified scopes",
|
|
21
|
-
annotations: {
|
|
22
|
-
readOnlyHint: false,
|
|
23
|
-
destructiveHint: true,
|
|
24
|
-
idempotentHint: false
|
|
25
|
-
},
|
|
26
|
-
zodSchema: CreateApiKeySchema,
|
|
27
|
-
handler: async ({ title, scopes, data_silos }) => {
|
|
28
|
-
const result = await graphql.createApiKey({
|
|
29
|
-
title,
|
|
30
|
-
scopes,
|
|
31
|
-
dataSilos: data_silos
|
|
32
|
-
});
|
|
33
|
-
return createToolResult(true, {
|
|
34
|
-
apiKey: result.apiKey,
|
|
35
|
-
token: result.token,
|
|
36
|
-
warning: "IMPORTANT: Save this token now! It will not be shown again.",
|
|
37
|
-
message: `API key "${title}" created successfully`
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/tools/admin_get_current_user.ts
|
|
44
|
-
function createAdminGetCurrentUserTool(clients) {
|
|
45
|
-
const graphql = clients.graphql;
|
|
46
|
-
return defineTool({
|
|
47
|
-
name: "admin_get_current_user",
|
|
48
|
-
description: "Get information about the currently authenticated user (the API key owner)",
|
|
49
|
-
category: "Admin",
|
|
50
|
-
readOnly: true,
|
|
51
|
-
annotations: {
|
|
52
|
-
readOnlyHint: true,
|
|
53
|
-
destructiveHint: false,
|
|
54
|
-
idempotentHint: true
|
|
55
|
-
},
|
|
56
|
-
zodSchema: EmptySchema,
|
|
57
|
-
handler: async (_args) => {
|
|
58
|
-
return createToolResult(true, await graphql.getCurrentUser());
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/tools/admin_get_organization.ts
|
|
64
|
-
function createAdminGetOrganizationTool(clients) {
|
|
65
|
-
const graphql = clients.graphql;
|
|
66
|
-
return defineTool({
|
|
67
|
-
name: "admin_get_organization",
|
|
68
|
-
description: "Get information about your Transcend organization",
|
|
69
|
-
category: "Admin",
|
|
70
|
-
readOnly: true,
|
|
71
|
-
annotations: {
|
|
72
|
-
readOnlyHint: true,
|
|
73
|
-
destructiveHint: false,
|
|
74
|
-
idempotentHint: true
|
|
75
|
-
},
|
|
76
|
-
zodSchema: EmptySchema,
|
|
77
|
-
handler: async (_args) => {
|
|
78
|
-
return createToolResult(true, await graphql.getOrganization());
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/tools/admin_get_privacy_center.ts
|
|
84
|
-
function createAdminGetPrivacyCenterTool(clients) {
|
|
85
|
-
const graphql = clients.graphql;
|
|
86
|
-
return defineTool({
|
|
87
|
-
name: "admin_get_privacy_center",
|
|
88
|
-
description: "Get privacy center configuration for your organization",
|
|
89
|
-
category: "Admin",
|
|
90
|
-
readOnly: true,
|
|
91
|
-
annotations: {
|
|
92
|
-
readOnlyHint: true,
|
|
93
|
-
destructiveHint: false,
|
|
94
|
-
idempotentHint: true
|
|
95
|
-
},
|
|
96
|
-
zodSchema: EmptySchema,
|
|
97
|
-
handler: async (_args) => {
|
|
98
|
-
const result = await graphql.getPrivacyCenter();
|
|
99
|
-
if (!result) return createToolResult(true, {
|
|
100
|
-
found: false,
|
|
101
|
-
message: "No privacy center configured for this organization"
|
|
102
|
-
});
|
|
103
|
-
return createToolResult(true, {
|
|
104
|
-
found: true,
|
|
105
|
-
privacyCenter: result
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/tools/admin_list_api_keys.ts
|
|
112
|
-
const ListApiKeysSchema = z.object({
|
|
113
|
-
limit: z.coerce.number().min(1).max(100).optional().default(50).describe("Results per page (1-100, default: 50)"),
|
|
114
|
-
cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)"),
|
|
115
|
-
offset: z.coerce.number().min(0).optional().default(0).describe("Number of results to skip (default: 0)")
|
|
116
|
-
});
|
|
117
|
-
function createAdminListApiKeysTool(clients) {
|
|
118
|
-
const graphql = clients.graphql;
|
|
119
|
-
return defineTool({
|
|
120
|
-
name: "admin_list_api_keys",
|
|
121
|
-
description: "List all API keys configured for your organization (tokens are not shown). Note: API does not support cursor pagination (max ~100 results).",
|
|
122
|
-
category: "Admin",
|
|
123
|
-
readOnly: true,
|
|
124
|
-
annotations: {
|
|
125
|
-
readOnlyHint: true,
|
|
126
|
-
destructiveHint: false,
|
|
127
|
-
idempotentHint: true
|
|
128
|
-
},
|
|
129
|
-
zodSchema: ListApiKeysSchema,
|
|
130
|
-
handler: async ({ limit, offset }) => {
|
|
131
|
-
const result = await graphql.listApiKeys({
|
|
132
|
-
first: limit,
|
|
133
|
-
offset
|
|
134
|
-
});
|
|
135
|
-
return createListResult(result.nodes, {
|
|
136
|
-
totalCount: result.totalCount,
|
|
137
|
-
hasNextPage: result.pageInfo?.hasNextPage
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/tools/admin_list_teams.ts
|
|
144
|
-
const ListTeamsSchema = z.object({
|
|
145
|
-
limit: z.coerce.number().min(1).max(100).optional().default(50).describe("Results per page (1-100, default: 50)"),
|
|
146
|
-
cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)")
|
|
147
|
-
});
|
|
148
|
-
function createAdminListTeamsTool(clients) {
|
|
149
|
-
const graphql = clients.graphql;
|
|
150
|
-
return defineTool({
|
|
151
|
-
name: "admin_list_teams",
|
|
152
|
-
description: "List all teams in your Transcend organization. Note: API does not support cursor pagination (max ~100 results).",
|
|
153
|
-
category: "Admin",
|
|
154
|
-
readOnly: true,
|
|
155
|
-
annotations: {
|
|
156
|
-
readOnlyHint: true,
|
|
157
|
-
destructiveHint: false,
|
|
158
|
-
idempotentHint: true
|
|
159
|
-
},
|
|
160
|
-
zodSchema: ListTeamsSchema,
|
|
161
|
-
handler: async ({ limit, cursor }) => {
|
|
162
|
-
const result = await graphql.listTeams({
|
|
163
|
-
first: limit,
|
|
164
|
-
after: cursor
|
|
165
|
-
});
|
|
166
|
-
return createListResult(result.nodes, {
|
|
167
|
-
totalCount: result.totalCount,
|
|
168
|
-
hasNextPage: result.pageInfo?.hasNextPage
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
|
-
//#region src/tools/admin_list_users.ts
|
|
175
|
-
const ListUsersSchema = z.object({
|
|
176
|
-
limit: z.coerce.number().min(1).max(100).optional().default(50).describe("Results per page (1-100, default: 50)"),
|
|
177
|
-
cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)")
|
|
178
|
-
});
|
|
179
|
-
function createAdminListUsersTool(clients) {
|
|
180
|
-
const graphql = clients.graphql;
|
|
181
|
-
return defineTool({
|
|
182
|
-
name: "admin_list_users",
|
|
183
|
-
description: "List all users in your Transcend organization. Note: API does not support cursor pagination (max ~100 results).",
|
|
184
|
-
category: "Admin",
|
|
185
|
-
readOnly: true,
|
|
186
|
-
annotations: {
|
|
187
|
-
readOnlyHint: true,
|
|
188
|
-
destructiveHint: false,
|
|
189
|
-
idempotentHint: true
|
|
190
|
-
},
|
|
191
|
-
zodSchema: ListUsersSchema,
|
|
192
|
-
handler: async ({ limit, cursor }) => {
|
|
193
|
-
const result = await graphql.listUsers({
|
|
194
|
-
first: limit,
|
|
195
|
-
after: cursor
|
|
196
|
-
});
|
|
197
|
-
return createListResult(result.nodes, {
|
|
198
|
-
totalCount: result.totalCount,
|
|
199
|
-
hasNextPage: result.pageInfo?.hasNextPage
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
//#endregion
|
|
205
|
-
//#region src/tools/admin_test_connection.ts
|
|
206
|
-
function createAdminTestConnectionTool(clients) {
|
|
207
|
-
const { rest } = clients;
|
|
208
|
-
const graphql = clients.graphql;
|
|
209
|
-
return defineTool({
|
|
210
|
-
name: "admin_test_connection",
|
|
211
|
-
description: "Test connectivity to both Transcend REST and GraphQL APIs",
|
|
212
|
-
category: "Admin",
|
|
213
|
-
readOnly: true,
|
|
214
|
-
annotations: {
|
|
215
|
-
readOnlyHint: true,
|
|
216
|
-
destructiveHint: false,
|
|
217
|
-
idempotentHint: true
|
|
218
|
-
},
|
|
219
|
-
zodSchema: EmptySchema,
|
|
220
|
-
handler: async (_args) => {
|
|
221
|
-
const [graphqlConnected, restConnected] = await Promise.all([graphql.testConnection(), rest.testConnection()]);
|
|
222
|
-
const allConnected = graphqlConnected && restConnected;
|
|
223
|
-
return createToolResult(true, {
|
|
224
|
-
connected: allConnected,
|
|
225
|
-
details: {
|
|
226
|
-
graphql: {
|
|
227
|
-
connected: graphqlConnected,
|
|
228
|
-
url: graphql.getBaseUrl()
|
|
229
|
-
},
|
|
230
|
-
rest: {
|
|
231
|
-
connected: restConnected,
|
|
232
|
-
url: rest.getBaseUrl()
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
message: allConnected ? "Successfully connected to all Transcend APIs" : "Some API connections failed - check details",
|
|
236
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
//#endregion
|
|
242
|
-
//#region src/tools/index.ts
|
|
243
|
-
function getAdminTools(clients) {
|
|
244
|
-
return [
|
|
245
|
-
createAdminGetOrganizationTool(clients),
|
|
246
|
-
createAdminGetCurrentUserTool(clients),
|
|
247
|
-
createAdminListUsersTool(clients),
|
|
248
|
-
createAdminListTeamsTool(clients),
|
|
249
|
-
createAdminListApiKeysTool(clients),
|
|
250
|
-
createAdminCreateApiKeyTool(clients),
|
|
251
|
-
createAdminGetPrivacyCenterTool(clients),
|
|
252
|
-
createAdminTestConnectionTool(clients)
|
|
253
|
-
];
|
|
254
|
-
}
|
|
255
|
-
//#endregion
|
|
256
|
-
//#region src/graphql.ts
|
|
257
|
-
var AdminMixin = class extends TranscendGraphQLBase {
|
|
258
|
-
async getOrganization() {
|
|
259
|
-
return (await this.makeRequest(`
|
|
260
|
-
query {
|
|
261
|
-
organization {
|
|
262
|
-
id
|
|
263
|
-
name
|
|
264
|
-
createdAt
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
`)).organization;
|
|
268
|
-
}
|
|
269
|
-
async getCurrentUser() {
|
|
270
|
-
return (await this.makeRequest(`
|
|
271
|
-
query {
|
|
272
|
-
user {
|
|
273
|
-
id
|
|
274
|
-
email
|
|
275
|
-
name
|
|
276
|
-
createdAt
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
`)).user;
|
|
280
|
-
}
|
|
281
|
-
async listUsers(options) {
|
|
282
|
-
const data = await this.makeRequest(`
|
|
283
|
-
query ListUsers($first: Int, $filterBy: UserFiltersInput) {
|
|
284
|
-
users(first: $first, filterBy: $filterBy) {
|
|
285
|
-
nodes {
|
|
286
|
-
id
|
|
287
|
-
email
|
|
288
|
-
name
|
|
289
|
-
}
|
|
290
|
-
totalCount
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
`, {
|
|
294
|
-
first: Math.min(options?.first || 50, 100),
|
|
295
|
-
...options?.filterBy ? { filterBy: options.filterBy } : {}
|
|
296
|
-
});
|
|
297
|
-
return {
|
|
298
|
-
nodes: data.users.nodes,
|
|
299
|
-
pageInfo: {
|
|
300
|
-
hasNextPage: data.users.nodes.length < data.users.totalCount,
|
|
301
|
-
hasPreviousPage: false
|
|
302
|
-
},
|
|
303
|
-
totalCount: data.users.totalCount
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
async listTeams(options) {
|
|
307
|
-
const data = await this.makeRequest(`
|
|
308
|
-
query ListTeams($first: Int) {
|
|
309
|
-
teams(first: $first) {
|
|
310
|
-
nodes {
|
|
311
|
-
id
|
|
312
|
-
name
|
|
313
|
-
}
|
|
314
|
-
totalCount
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
`, { first: Math.min(options?.first || 50, 100) });
|
|
318
|
-
return {
|
|
319
|
-
nodes: data.teams.nodes,
|
|
320
|
-
pageInfo: {
|
|
321
|
-
hasNextPage: data.teams.nodes.length < data.teams.totalCount,
|
|
322
|
-
hasPreviousPage: false
|
|
323
|
-
},
|
|
324
|
-
totalCount: data.teams.totalCount
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
async listApiKeys(options) {
|
|
328
|
-
const data = await this.makeRequest(`
|
|
329
|
-
query ListApiKeys($first: Int, $offset: Int) {
|
|
330
|
-
apiKeys(first: $first, offset: $offset) {
|
|
331
|
-
nodes {
|
|
332
|
-
id
|
|
333
|
-
title
|
|
334
|
-
scopes {
|
|
335
|
-
id
|
|
336
|
-
name
|
|
337
|
-
}
|
|
338
|
-
lastUsedAt
|
|
339
|
-
createdAt
|
|
340
|
-
}
|
|
341
|
-
totalCount
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
`, {
|
|
345
|
-
first: Math.min(options?.first || 50, 100),
|
|
346
|
-
offset: options?.offset || 0
|
|
347
|
-
});
|
|
348
|
-
return {
|
|
349
|
-
nodes: data.apiKeys.nodes,
|
|
350
|
-
pageInfo: {
|
|
351
|
-
hasNextPage: data.apiKeys.nodes.length < data.apiKeys.totalCount,
|
|
352
|
-
hasPreviousPage: false
|
|
353
|
-
},
|
|
354
|
-
totalCount: data.apiKeys.totalCount
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
async createApiKey(input) {
|
|
358
|
-
const { apiKey: token, ...apiKey } = (await this.makeRequest(`
|
|
359
|
-
mutation CreateApiKey($input: ApiKeyInput!) {
|
|
360
|
-
createApiKey(input: $input) {
|
|
361
|
-
apiKey {
|
|
362
|
-
id
|
|
363
|
-
title
|
|
364
|
-
apiKey
|
|
365
|
-
scopes {
|
|
366
|
-
id
|
|
367
|
-
name
|
|
368
|
-
}
|
|
369
|
-
createdAt
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
`, { input })).createApiKey.apiKey;
|
|
374
|
-
return {
|
|
375
|
-
apiKey,
|
|
376
|
-
token
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
async getPrivacyCenter(lookup) {
|
|
380
|
-
const query = `
|
|
381
|
-
query GetPrivacyCenter($lookup: PrivacyCenterLookupInput) {
|
|
382
|
-
privacyCenter(lookup: $lookup) {
|
|
383
|
-
id
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
`;
|
|
387
|
-
try {
|
|
388
|
-
const data = await this.makeRequest(query, { lookup: lookup || void 0 });
|
|
389
|
-
if (data.privacyCenter) return {
|
|
390
|
-
id: data.privacyCenter.id,
|
|
391
|
-
name: "Privacy Center",
|
|
392
|
-
url: lookup?.url || "",
|
|
393
|
-
isActive: true,
|
|
394
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
395
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
396
|
-
};
|
|
397
|
-
return null;
|
|
398
|
-
} catch {
|
|
399
|
-
return null;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
//#endregion
|
|
404
|
-
export { ListApiKeysSchema as a, ListTeamsSchema as i, getAdminTools as n, CreateApiKeySchema as o, ListUsersSchema as r, AdminMixin as t };
|
|
405
|
-
|
|
406
|
-
//# sourceMappingURL=graphql-BVMDAAxF.mjs.map
|