@rafads/plugin-openapi 1.5.38
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 +83 -0
- package/dist/AddOpenApiIntegration-JPAEXE56.js +512 -0
- package/dist/AddOpenApiIntegration-JPAEXE56.js.map +1 -0
- package/dist/OpenApiAccountsPanel-GZFDSTAU.js +106 -0
- package/dist/OpenApiAccountsPanel-GZFDSTAU.js.map +1 -0
- package/dist/UpdateSpecSection-KUSNI44Q.js +106 -0
- package/dist/UpdateSpecSection-KUSNI44Q.js.map +1 -0
- package/dist/api/group.d.ts +239 -0
- package/dist/api/handlers.d.ts +7 -0
- package/dist/api/index.d.ts +237 -0
- package/dist/chunk-6V45G2XQ.js +199 -0
- package/dist/chunk-6V45G2XQ.js.map +1 -0
- package/dist/chunk-CURJJXB3.js +132 -0
- package/dist/chunk-CURJJXB3.js.map +1 -0
- package/dist/chunk-CXFO6TLJ.js +39 -0
- package/dist/chunk-CXFO6TLJ.js.map +1 -0
- package/dist/chunk-HTHEUUJA.js +2873 -0
- package/dist/chunk-HTHEUUJA.js.map +1 -0
- package/dist/chunk-IG6QTTZB.js +79 -0
- package/dist/chunk-IG6QTTZB.js.map +1 -0
- package/dist/chunk-O2LMSZ2Z.js +120 -0
- package/dist/chunk-O2LMSZ2Z.js.map +1 -0
- package/dist/chunk-OR27BCXQ.js +956 -0
- package/dist/chunk-OR27BCXQ.js.map +1 -0
- package/dist/chunk-R7TVM3XD.js +275 -0
- package/dist/chunk-R7TVM3XD.js.map +1 -0
- package/dist/client.js +38 -0
- package/dist/client.js.map +1 -0
- package/dist/core.js +331 -0
- package/dist/core.js.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/google/config.d.ts +34 -0
- package/dist/providers/google/discovery.d.ts +49 -0
- package/dist/providers/google/discovery.test.d.ts +1 -0
- package/dist/providers/google/index.d.ts +5 -0
- package/dist/providers/google/oauth-scopes.d.ts +3 -0
- package/dist/providers/google/oauth-scopes.test.d.ts +1 -0
- package/dist/providers/google/openapi-ownership-migration.d.ts +7 -0
- package/dist/providers/google/openapi-ownership-migration.test.d.ts +1 -0
- package/dist/providers/google/presets.d.ts +31 -0
- package/dist/providers/google/presets.test.d.ts +1 -0
- package/dist/providers/google/spec-format-adapter.d.ts +3 -0
- package/dist/providers/google/spec-format-adapter.test.d.ts +1 -0
- package/dist/providers/google.js +1446 -0
- package/dist/providers/google.js.map +1 -0
- package/dist/providers/microsoft/graph.d.ts +76 -0
- package/dist/providers/microsoft/graph.test.d.ts +1 -0
- package/dist/providers/microsoft/index.d.ts +3 -0
- package/dist/providers/microsoft/presets.d.ts +46 -0
- package/dist/providers/microsoft/presets.test.d.ts +1 -0
- package/dist/providers/microsoft/spec-format-adapter.d.ts +2 -0
- package/dist/providers/microsoft/spec-format-adapter.test.d.ts +1 -0
- package/dist/providers/microsoft.js +1056 -0
- package/dist/providers/microsoft.js.map +1 -0
- package/dist/react/AddOpenApiIntegration.d.ts +22 -0
- package/dist/react/AddOpenApiIntegration.test.d.ts +1 -0
- package/dist/react/OpenApiAccountsPanel.d.ts +6 -0
- package/dist/react/OpenApiIntegrationDetailsFields.d.ts +25 -0
- package/dist/react/UpdateSpecSection.d.ts +2 -0
- package/dist/react/atoms.d.ts +317 -0
- package/dist/react/auth-method-config.d.ts +18 -0
- package/dist/react/auth-method-config.test.d.ts +1 -0
- package/dist/react/client.d.ts +233 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/integration-plugin.d.ts +6 -0
- package/dist/react/plugin-client.d.ts +2 -0
- package/dist/sdk/backing.d.ts +188 -0
- package/dist/sdk/client-credentials-oauth.test.d.ts +1 -0
- package/dist/sdk/compiled-spec-cache.test.d.ts +1 -0
- package/dist/sdk/config.d.ts +81 -0
- package/dist/sdk/configure.test.d.ts +1 -0
- package/dist/sdk/definitions.d.ts +57 -0
- package/dist/sdk/derive-auth.d.ts +11 -0
- package/dist/sdk/describe-auth-methods.test.d.ts +1 -0
- package/dist/sdk/errors.d.ts +45 -0
- package/dist/sdk/extract.d.ts +157 -0
- package/dist/sdk/extract.test.d.ts +1 -0
- package/dist/sdk/form-urlencoded-body.test.d.ts +1 -0
- package/dist/sdk/index.d.ts +19 -0
- package/dist/sdk/index.test.d.ts +1 -0
- package/dist/sdk/invoke.d.ts +150 -0
- package/dist/sdk/migrate-config.d.ts +4 -0
- package/dist/sdk/migrate-config.test.d.ts +1 -0
- package/dist/sdk/multi-scope-bearer.test.d.ts +1 -0
- package/dist/sdk/multi-scope-oauth.test.d.ts +1 -0
- package/dist/sdk/ndjson-output-migration.d.ts +13 -0
- package/dist/sdk/ndjson-output-migration.test.d.ts +1 -0
- package/dist/sdk/non-json-body.test.d.ts +1 -0
- package/dist/sdk/oauth-refresh.test.d.ts +1 -0
- package/dist/sdk/openapi-utils.d.ts +65 -0
- package/dist/sdk/output-schema-migration.d.ts +21 -0
- package/dist/sdk/output-schema-migration.test.d.ts +1 -0
- package/dist/sdk/parse.d.ts +33 -0
- package/dist/sdk/parse.test.d.ts +1 -0
- package/dist/sdk/plugin.d.ts +109 -0
- package/dist/sdk/plugin.test.d.ts +1 -0
- package/dist/sdk/presets.d.ts +15 -0
- package/dist/sdk/preview-oauth2.test.d.ts +1 -0
- package/dist/sdk/preview.d.ts +514 -0
- package/dist/sdk/query-serialization.test.d.ts +1 -0
- package/dist/sdk/real-specs.test.d.ts +1 -0
- package/dist/sdk/request-user-agent.test.d.ts +1 -0
- package/dist/sdk/response-headers-timeout.test.d.ts +1 -0
- package/dist/sdk/server-url-resolution.test.d.ts +1 -0
- package/dist/sdk/spec-blob-migration.d.ts +7 -0
- package/dist/sdk/spec-blob.test.d.ts +1 -0
- package/dist/sdk/spec-format.d.ts +36 -0
- package/dist/sdk/spec-format.test.d.ts +1 -0
- package/dist/sdk/split.d.ts +84 -0
- package/dist/sdk/store.d.ts +49 -0
- package/dist/sdk/store.test.d.ts +1 -0
- package/dist/sdk/streaming-response.test.d.ts +1 -0
- package/dist/sdk/tool-row-projection.test.d.ts +1 -0
- package/dist/sdk/types.d.ts +352 -0
- package/dist/sdk/upstream-failures.test.d.ts +1 -0
- package/dist/sdk/usage-scope-isolation.test.d.ts +1 -0
- package/dist/testing/index.d.ts +177 -0
- package/dist/testing.js +454 -0
- package/dist/testing.js.map +1 -0
- package/dist/testing.test.d.ts +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/providers/microsoft/presets.ts","../../src/providers/microsoft/graph.ts","../../src/providers/microsoft/spec-format-adapter.ts"],"sourcesContent":["import type { IntegrationPreset } from \"@rafads/sdk/core\";\n\nexport interface MicrosoftGraphPreset {\n readonly id: string;\n readonly name: string;\n readonly summary: string;\n readonly icon?: string;\n readonly featured?: boolean;\n}\n\nexport type MicrosoftGraphScopeAudience =\n | \"productivity\"\n | \"files-content\"\n | \"collaboration\"\n | \"directory-identity\"\n | \"admin-security\"\n | \"platform-business\";\n\nexport interface MicrosoftGraphScopePreset {\n readonly id: string;\n readonly name: string;\n readonly summary: string;\n readonly icon?: string;\n readonly scopes: readonly string[];\n readonly exactPaths?: readonly string[];\n readonly pathPrefixes?: readonly string[];\n readonly tagPrefixes?: readonly string[];\n readonly featured?: boolean;\n readonly audience: MicrosoftGraphScopeAudience;\n}\n\nconst svglIcon = (name: string) => `https://svgl.app/library/${name}.svg`;\n\nexport const MICROSOFT_GRAPH_OPENAPI_URL =\n \"https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/openapi/v1.0/openapi.yaml\";\nexport const MICROSOFT_GRAPH_PERMISSIONS_REFERENCE_URL =\n \"https://raw.githubusercontent.com/microsoftgraph/microsoft-graph-docs-contrib/main/concepts/permissions-reference.md\";\nexport const MICROSOFT_GRAPH_BASE_URL = \"https://graph.microsoft.com/v1.0\";\nexport const MICROSOFT_AUTHORIZATION_URL =\n \"https://login.microsoftonline.com/common/oauth2/v2.0/authorize\";\nexport const MICROSOFT_TOKEN_URL = \"https://login.microsoftonline.com/common/oauth2/v2.0/token\";\nexport const MICROSOFT_AUTH_TEMPLATE_SLUG = \"azureAdDelegated\";\nexport const MICROSOFT_CLIENT_CREDENTIALS_AUTH_TEMPLATE_SLUG = \"azureAdClientCredentials\";\nexport const MICROSOFT_GRAPH_BASE_SCOPES: readonly string[] = [\"offline_access\"];\nexport const MICROSOFT_GRAPH_IDENTITY_SCOPE = \"User.Read\";\nexport const MICROSOFT_GRAPH_DEFAULT_SCOPE = \"https://graph.microsoft.com/.default\";\nexport const MICROSOFT_GRAPH_DELEGATED_DEFAULT_SCOPES: readonly string[] = [\n ...MICROSOFT_GRAPH_BASE_SCOPES,\n MICROSOFT_GRAPH_IDENTITY_SCOPE,\n MICROSOFT_GRAPH_DEFAULT_SCOPE,\n];\nexport const MICROSOFT_GRAPH_CLIENT_CREDENTIALS_SCOPES: readonly string[] = [\n MICROSOFT_GRAPH_DEFAULT_SCOPE,\n];\n\nexport const MICROSOFT_GRAPH_PRESET_ID = \"microsoft\";\n\nexport const microsoftGraphPreset: MicrosoftGraphPreset = {\n id: MICROSOFT_GRAPH_PRESET_ID,\n name: \"Microsoft Graph\",\n summary: \"Bundle Microsoft 365 workloads into one Graph integration and one OAuth consent.\",\n featured: true,\n};\n\nexport const microsoftGraphScopePresets: readonly MicrosoftGraphScopePreset[] = [\n {\n id: \"profile\",\n name: \"Profile\",\n summary: \"Signed-in user profile and photo.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"User.Read\"],\n exactPaths: [\"/me\", \"/me/photo\", \"/me/photo/$value\"],\n featured: true,\n audience: \"productivity\",\n },\n {\n id: \"me-surface\",\n name: \"My Graph Operations\",\n summary: \"All operation groups rooted under /me.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"User.Read\"],\n pathPrefixes: [\"/me\"],\n audience: \"productivity\",\n },\n {\n id: \"mail\",\n name: \"Outlook Mail\",\n summary: \"Messages, folders, attachments, settings, and send mail.\",\n icon: svglIcon(\"microsoft-outlook\"),\n scopes: [\"Mail.ReadWrite\", \"Mail.Send\", \"MailboxSettings.ReadWrite\"],\n pathPrefixes: [\n \"/me/messages\",\n \"/me/mailFolders\",\n \"/me/sendMail\",\n \"/me/getMailTips\",\n \"/me/inferenceClassification\",\n \"/me/mailboxSettings\",\n \"/me/outlook\",\n \"/users/{user-id}/messages\",\n \"/users/{user-id}/mailFolders\",\n \"/users/{user-id}/sendMail\",\n \"/users/{user-id}/outlook\",\n ],\n featured: true,\n audience: \"productivity\",\n },\n {\n id: \"calendar\",\n name: \"Outlook Calendar\",\n summary: \"Calendars, events, and scheduling.\",\n icon: svglIcon(\"microsoft-outlook\"),\n scopes: [\"Calendars.ReadWrite\"],\n pathPrefixes: [\n \"/me/calendar\",\n \"/me/calendars\",\n \"/me/calendarGroups\",\n \"/me/calendarView\",\n \"/me/events\",\n \"/me/findMeetingTimes\",\n \"/me/reminderView\",\n \"/users/{user-id}/calendar\",\n \"/users/{user-id}/calendars\",\n \"/users/{user-id}/calendarGroups\",\n \"/users/{user-id}/calendarView\",\n \"/users/{user-id}/events\",\n \"/users/{user-id}/findMeetingTimes\",\n \"/users/{user-id}/reminderView\",\n ],\n featured: true,\n audience: \"productivity\",\n },\n {\n id: \"contacts\",\n name: \"Outlook Contacts\",\n summary: \"Contacts, contact folders, and people suggestions.\",\n icon: svglIcon(\"microsoft-outlook\"),\n scopes: [\"Contacts.ReadWrite\", \"People.Read.All\"],\n pathPrefixes: [\n \"/me/contacts\",\n \"/me/contactFolders\",\n \"/me/people\",\n \"/users/{user-id}/contacts\",\n \"/users/{user-id}/contactFolders\",\n \"/users/{user-id}/people\",\n ],\n audience: \"productivity\",\n },\n {\n id: \"tasks\",\n name: \"To Do Tasks\",\n summary: \"Task lists, tasks, and checklist items.\",\n icon: svglIcon(\"microsoft-todo\"),\n scopes: [\"Tasks.ReadWrite\"],\n pathPrefixes: [\"/me/todo\", \"/users/{user-id}/todo\"],\n audience: \"productivity\",\n },\n {\n id: \"planner\",\n name: \"Planner\",\n summary: \"Plans, buckets, tasks, assignments, and Planner user data.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"Tasks.ReadWrite\"],\n pathPrefixes: [\n \"/planner\",\n \"/me/planner\",\n \"/users/{user-id}/planner\",\n \"/groups/{group-id}/planner\",\n ],\n audience: \"productivity\",\n },\n {\n id: \"files\",\n name: \"OneDrive Files\",\n summary: \"Drives, files, folders, sharing links, and permissions.\",\n icon: svglIcon(\"microsoft-onedrive\"),\n scopes: [\"Files.ReadWrite.All\", \"Sites.ReadWrite.All\"],\n pathPrefixes: [\n \"/me/drive\",\n \"/me/drives\",\n \"/me/followedSites\",\n \"/users/{user-id}/drive\",\n \"/users/{user-id}/drives\",\n \"/groups/{group-id}/drive\",\n \"/groups/{group-id}/drives\",\n \"/drives\",\n \"/shares\",\n ],\n featured: true,\n audience: \"files-content\",\n },\n {\n id: \"excel\",\n name: \"Excel Workbooks\",\n summary: \"Workbook tables, worksheets, ranges, charts, and sessions.\",\n icon: svglIcon(\"microsoft-excel\"),\n scopes: [\"Files.ReadWrite.All\"],\n pathPrefixes: [\n \"/me/drive/items/{driveItem-id}/workbook\",\n \"/users/{user-id}/drive/items/{driveItem-id}/workbook\",\n \"/groups/{group-id}/drive/items/{driveItem-id}/workbook\",\n \"/drives/{drive-id}/items/{driveItem-id}/workbook\",\n ],\n audience: \"files-content\",\n },\n {\n id: \"sites\",\n name: \"SharePoint Sites\",\n summary: \"Sites, lists, pages, columns, content types, and stores.\",\n icon: svglIcon(\"microsoft-sharepoint\"),\n scopes: [\"Sites.ReadWrite.All\"],\n pathPrefixes: [\"/sites\"],\n featured: true,\n audience: \"files-content\",\n },\n {\n id: \"onenote\",\n name: \"OneNote\",\n summary: \"Notebooks, sections, pages, and page content.\",\n icon: svglIcon(\"microsoft-onenote\"),\n scopes: [\"Notes.ReadWrite\"],\n pathPrefixes: [\n \"/me/onenote\",\n \"/users/{user-id}/onenote\",\n \"/groups/{group-id}/onenote\",\n \"/sites/{site-id}/onenote\",\n ],\n audience: \"files-content\",\n },\n {\n id: \"teams-chat\",\n name: \"Teams Chats\",\n summary: \"Chats, chat messages, installed apps, and members.\",\n icon: svglIcon(\"microsoft-teams\"),\n scopes: [\"Chat.ReadWrite\"],\n pathPrefixes: [\"/me/chats\", \"/chats\"],\n audience: \"collaboration\",\n },\n {\n id: \"teams-channels\",\n name: \"Teams Channels\",\n summary: \"Teams, channels, channel messages, replies, and joined teams.\",\n icon: svglIcon(\"microsoft-teams\"),\n scopes: [\n \"Team.ReadBasic.All\",\n \"Channel.ReadBasic.All\",\n \"ChannelMessage.Read.All\",\n \"ChannelMessage.Send\",\n ],\n pathPrefixes: [\n \"/me/joinedTeams\",\n \"/groups/{group-id}/team\",\n \"/teams\",\n \"/teamwork\",\n \"/teamsTemplates\",\n ],\n audience: \"collaboration\",\n },\n {\n id: \"meetings-calls\",\n name: \"Meetings and Calls\",\n summary: \"Online meetings, calls, call records, and communications APIs.\",\n icon: svglIcon(\"microsoft-teams\"),\n scopes: [\"OnlineMeetings.ReadWrite\"],\n pathPrefixes: [\"/communications\", \"/me/onlineMeetings\", \"/users/{user-id}/onlineMeetings\"],\n audience: \"collaboration\",\n },\n {\n id: \"users\",\n name: \"Users\",\n summary: \"User objects plus user-scoped Graph operations.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"User.ReadWrite.All\", \"Directory.Read.All\"],\n pathPrefixes: [\"/users\", \"/users(userPrincipalName='{userPrincipalName}')\"],\n featured: true,\n audience: \"directory-identity\",\n },\n {\n id: \"groups\",\n name: \"Groups\",\n summary: \"Groups, settings, lifecycle policies, and group-scoped operations.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"Group.ReadWrite.All\", \"Directory.Read.All\"],\n pathPrefixes: [\n \"/groups\",\n \"/groups(uniqueName='{uniqueName}')\",\n \"/groupSettings\",\n \"/groupSettingTemplates\",\n \"/groupLifecyclePolicies\",\n ],\n audience: \"directory-identity\",\n },\n {\n id: \"directory\",\n name: \"Directory\",\n summary: \"Directory roles, objects, contacts, contracts, and invitations.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"Directory.Read.All\"],\n pathPrefixes: [\n \"/contacts\",\n \"/contracts\",\n \"/directory\",\n \"/directoryObjects\",\n \"/directoryRoles\",\n \"/directoryRoles(roleTemplateId='{roleTemplateId}')\",\n \"/directoryRoleTemplates\",\n \"/invitations\",\n \"/scopedRoleMemberships\",\n ],\n audience: \"directory-identity\",\n },\n {\n id: \"applications\",\n name: \"Applications\",\n summary: \"Applications, service principals, app templates, catalogs, and grants.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"Application.ReadWrite.All\", \"AppRoleAssignment.ReadWrite.All\"],\n pathPrefixes: [\n \"/applications\",\n \"/applications(appId='{appId}')\",\n \"/applications(uniqueName='{uniqueName}')\",\n \"/applicationTemplates\",\n \"/appCatalogs\",\n \"/oauth2PermissionGrants\",\n \"/permissionGrants\",\n \"/servicePrincipals\",\n \"/servicePrincipals(appId='{appId}')\",\n ],\n audience: \"directory-identity\",\n },\n {\n id: \"identity\",\n name: \"Identity and Governance\",\n summary: \"Identity, governance, policies, access reviews, roles, and providers.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"Policy.ReadWrite.ConditionalAccess\", \"RoleManagement.Read.Directory\"],\n pathPrefixes: [\n \"/agreementAcceptances\",\n \"/agreements\",\n \"/authenticationMethodConfigurations\",\n \"/authenticationMethodsPolicy\",\n \"/certificateBasedAuthConfiguration\",\n \"/identity\",\n \"/identityGovernance\",\n \"/identityProviders\",\n \"/identityProtection\",\n \"/policies\",\n \"/roleManagement\",\n ],\n audience: \"directory-identity\",\n },\n {\n id: \"admin-reports\",\n name: \"Admin and Reports\",\n summary: \"Admin centers, audit logs, domains, reports, organization, and tenants.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"AuditLog.Read.All\", \"Reports.Read.All\"],\n pathPrefixes: [\n \"/admin\",\n \"/auditLogs\",\n \"/domains\",\n \"/domainDnsRecords\",\n \"/organization\",\n \"/reports\",\n \"/subscribedSkus\",\n \"/tenantRelationships\",\n ],\n audience: \"admin-security\",\n },\n {\n id: \"security-compliance\",\n name: \"Security and Compliance\",\n summary: \"Security, compliance, privacy, information protection, and data policy.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"SecurityEvents.Read.All\"],\n pathPrefixes: [\n \"/compliance\",\n \"/dataPolicyOperations\",\n \"/informationProtection\",\n \"/privacy\",\n \"/security\",\n ],\n audience: \"admin-security\",\n },\n {\n id: \"devices\",\n name: \"Devices and Intune\",\n summary: \"Devices, device management, Intune apps, managed devices, and policies.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"DeviceManagementApps.ReadWrite.All\", \"DeviceManagementManagedDevices.ReadWrite.All\"],\n pathPrefixes: [\n \"/devices\",\n \"/devices(deviceId='{deviceId}')\",\n \"/deviceAppManagement\",\n \"/deviceManagement\",\n ],\n audience: \"admin-security\",\n },\n {\n id: \"education\",\n name: \"Education\",\n summary: \"Classes, schools, education users, assignments, and reports.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [],\n pathPrefixes: [\"/education\"],\n audience: \"admin-security\",\n },\n {\n id: \"search\",\n name: \"Microsoft Search\",\n summary: \"Search across Microsoft Graph content connectors.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"ExternalItem.Read.All\", \"Acronym.Read.All\", \"Bookmark.Read.All\", \"QnA.Read.All\"],\n pathPrefixes: [\"/search\"],\n audience: \"platform-business\",\n },\n {\n id: \"external-connections\",\n name: \"External Connections\",\n summary: \"External connections, schemas, items, and content connectors.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"ExternalConnection.ReadWrite.OwnedBy\", \"ExternalItem.ReadWrite.OwnedBy\"],\n pathPrefixes: [\"/connections\", \"/external\"],\n audience: \"platform-business\",\n },\n {\n id: \"solutions\",\n name: \"Solutions and Employee Experience\",\n summary: \"Bookings, virtual events, backup, employee experience, and Copilot.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [],\n pathPrefixes: [\"/copilot\", \"/employeeExperience\", \"/solutions\"],\n audience: \"platform-business\",\n },\n {\n id: \"platform-services\",\n name: \"Platform Services\",\n summary: \"Places, print, storage, subscriptions, functions, filters, and extensions.\",\n icon: svglIcon(\"microsoft\"),\n scopes: [\"Place.Read.All\", \"Printer.ReadWrite.All\"],\n pathPrefixes: [\n \"/filterOperators\",\n \"/functions\",\n \"/places\",\n \"/print\",\n \"/schemaExtensions\",\n \"/storage\",\n \"/subscriptions\",\n ],\n audience: \"platform-business\",\n },\n];\n\nexport const MICROSOFT_GRAPH_DEFAULT_PRESET_IDS: readonly string[] = [\n \"profile\",\n \"mail\",\n \"calendar\",\n \"contacts\",\n \"tasks\",\n \"files\",\n \"excel\",\n \"sites\",\n \"onenote\",\n \"teams-chat\",\n \"teams-channels\",\n \"meetings-calls\",\n];\n\nexport const MICROSOFT_GRAPH_ALL_PRESET_IDS: readonly string[] = microsoftGraphScopePresets.map(\n (preset) => preset.id,\n);\n\nconst orderedUnique = (values: Iterable<string>): readonly string[] => {\n const seen = new Set<string>();\n const result: string[] = [];\n for (const value of values) {\n const trimmed = value.trim();\n if (!trimmed || seen.has(trimmed)) continue;\n seen.add(trimmed);\n result.push(trimmed);\n }\n return result;\n};\n\nexport const microsoftGraphPresetForId = (\n presetId: string,\n): MicrosoftGraphScopePreset | undefined =>\n microsoftGraphScopePresets.find((preset) => preset.id === presetId);\n\nexport const microsoftGraphPresetIdsCoverFullGraph = (presetIds: Iterable<string>): boolean => {\n const selected = new Set([...presetIds]);\n return microsoftGraphScopePresets.every((preset) => selected.has(preset.id));\n};\n\nexport const microsoftGraphScopesForPresetIds = (\n presetIds: Iterable<string>,\n customScopes: Iterable<string> = [],\n): readonly string[] =>\n orderedUnique([\n ...MICROSOFT_GRAPH_BASE_SCOPES,\n MICROSOFT_GRAPH_IDENTITY_SCOPE,\n ...[...presetIds].flatMap((presetId) => microsoftGraphPresetForId(presetId)?.scopes ?? []),\n ...customScopes,\n ]);\n\nexport const microsoftGraphExactPathsForPresetIds = (\n presetIds: Iterable<string>,\n): readonly string[] =>\n orderedUnique(\n [...presetIds].flatMap((presetId) => microsoftGraphPresetForId(presetId)?.exactPaths ?? []),\n );\n\nexport const microsoftGraphPathPrefixesForPresetIds = (\n presetIds: Iterable<string>,\n): readonly string[] =>\n orderedUnique(\n [...presetIds].flatMap((presetId) => microsoftGraphPresetForId(presetId)?.pathPrefixes ?? []),\n );\n\nexport const microsoftGraphTagPrefixesForPresetIds = (\n presetIds: Iterable<string>,\n): readonly string[] =>\n orderedUnique(\n [...presetIds].flatMap((presetId) => microsoftGraphPresetForId(presetId)?.tagPrefixes ?? []),\n );\n\nexport const microsoftServiceSlug = (presetId: string): string =>\n `microsoft_${presetId.replaceAll(\"-\", \"_\")}`;\n\nconst microsoftGraphCatalogUrl = (presetId: string): string =>\n `${MICROSOFT_GRAPH_OPENAPI_URL}#preset=${encodeURIComponent(presetId)}`;\n\nconst microsoftGraphCatalogAuthTemplate = (preset: MicrosoftGraphScopePreset) => [\n {\n slug: MICROSOFT_AUTH_TEMPLATE_SLUG,\n kind: \"oauth2\" as const,\n authorizationUrl: MICROSOFT_AUTHORIZATION_URL,\n tokenUrl: MICROSOFT_TOKEN_URL,\n scopes: microsoftGraphScopesForPresetIds([preset.id]),\n },\n {\n slug: MICROSOFT_CLIENT_CREDENTIALS_AUTH_TEMPLATE_SLUG,\n kind: \"oauth2\" as const,\n authorizationUrl: MICROSOFT_AUTHORIZATION_URL,\n tokenUrl: MICROSOFT_TOKEN_URL,\n scopes: [...MICROSOFT_GRAPH_CLIENT_CREDENTIALS_SCOPES],\n },\n];\n\nexport const microsoftCatalog: readonly IntegrationPreset[] = microsoftGraphScopePresets.map(\n (preset) => ({\n id: `microsoft-${preset.id}`,\n name: preset.name,\n summary: preset.summary,\n url: microsoftGraphCatalogUrl(preset.id),\n ...(preset.icon ? { icon: preset.icon } : {}),\n ...(preset.featured ? { featured: preset.featured } : {}),\n family: \"microsoft\",\n specFormat: \"microsoft-graph\",\n defaultSlug: microsoftServiceSlug(preset.id),\n authTemplate: microsoftGraphCatalogAuthTemplate(preset),\n ...(preset.id === \"profile\" ? { healthCheck: { operation: \"me.GetUser\" } } : {}),\n }),\n);\n","import { Effect, Option, Schema } from \"effect\";\nimport type { Layer } from \"effect\";\nimport { HttpClient, HttpClientRequest } from \"effect/unstable/http\";\n\nimport { AuthTemplateSlug } from \"@rafads/sdk/core\";\nimport { AuthenticationSchema, type OpenApiIntegrationConfig } from \"../../sdk/config\";\nimport { OpenApiParseError } from \"../../sdk/errors\";\nimport {\n parseEntry,\n parseHead,\n parseSmallComponents,\n structuralSplit,\n type KeepPathItem,\n type SpecStructure,\n} from \"../../sdk/split\";\nimport type { Authentication } from \"../../sdk/types\";\n\nimport {\n MICROSOFT_AUTHORIZATION_URL,\n MICROSOFT_AUTH_TEMPLATE_SLUG,\n MICROSOFT_CLIENT_CREDENTIALS_AUTH_TEMPLATE_SLUG,\n MICROSOFT_GRAPH_BASE_SCOPES,\n MICROSOFT_GRAPH_CLIENT_CREDENTIALS_SCOPES,\n MICROSOFT_GRAPH_DELEGATED_DEFAULT_SCOPES,\n MICROSOFT_GRAPH_DEFAULT_PRESET_IDS,\n MICROSOFT_GRAPH_IDENTITY_SCOPE,\n MICROSOFT_GRAPH_OPENAPI_URL,\n MICROSOFT_GRAPH_PERMISSIONS_REFERENCE_URL,\n MICROSOFT_TOKEN_URL,\n microsoftGraphExactPathsForPresetIds,\n microsoftGraphPathPrefixesForPresetIds,\n microsoftGraphPresetIdsCoverFullGraph,\n microsoftGraphScopesForPresetIds,\n microsoftGraphTagPrefixesForPresetIds,\n} from \"./presets\";\n\nexport interface MicrosoftGraphSelectionInput {\n readonly presetIds?: readonly string[];\n readonly customScopes?: readonly string[];\n readonly baseUrl?: string;\n readonly specUrl?: string;\n readonly authorizationUrl?: string;\n readonly tokenUrl?: string;\n readonly clientCredentialsTokenUrl?: string;\n}\n\nexport interface MicrosoftGraphSpecBuild {\n readonly specText: string;\n readonly specUrl: string;\n readonly baseUrl?: string;\n readonly authorizationUrl: string;\n readonly tokenUrl: string;\n readonly clientCredentialsTokenUrl: string;\n readonly presetIds: readonly string[];\n readonly customScopes: readonly string[];\n readonly scopes: readonly string[];\n readonly exactPaths: readonly string[];\n readonly pathPrefixes: readonly string[];\n readonly tagPrefixes: readonly string[];\n readonly coversFullGraph: boolean;\n readonly authenticationTemplate: readonly Authentication[];\n}\n\nexport interface MicrosoftGraphUrlPolicy {\n /**\n * When true, spec/base/OAuth endpoint URLs may point anywhere a trusted\n * https URL could, plus plain http on loopback (local Graph emulators).\n * Every other host is still rejected. Off by default — production leaves\n * this unset so only the pinned Microsoft Graph URLs are accepted.\n */\n readonly allowUnsafeUrlOverrides?: boolean;\n}\n\nexport type MicrosoftGraphIntegrationConfig = OpenApiIntegrationConfig & {\n readonly microsoftGraphPresetIds?: readonly string[];\n readonly microsoftGraphCustomScopes?: readonly string[];\n readonly microsoftGraphScopes?: readonly string[];\n readonly microsoftGraphExactPaths?: readonly string[];\n readonly microsoftGraphPathPrefixes?: readonly string[];\n readonly microsoftGraphTagPrefixes?: readonly string[];\n readonly microsoftGraphCoversFullGraph?: boolean;\n readonly microsoftGraphAuthorizationUrl?: string;\n readonly microsoftGraphTokenUrl?: string;\n readonly microsoftGraphClientCredentialsTokenUrl?: string;\n};\n\nconst MicrosoftGraphIntegrationConfigSchema = Schema.Struct({\n specHash: Schema.optional(Schema.String),\n specUrl: Schema.optional(Schema.String),\n baseUrl: Schema.optional(Schema.String),\n headers: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n queryParams: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n authenticationTemplate: Schema.optional(Schema.Array(AuthenticationSchema)),\n microsoftGraphPresetIds: Schema.optional(Schema.Array(Schema.String)),\n microsoftGraphCustomScopes: Schema.optional(Schema.Array(Schema.String)),\n microsoftGraphScopes: Schema.optional(Schema.Array(Schema.String)),\n microsoftGraphExactPaths: Schema.optional(Schema.Array(Schema.String)),\n microsoftGraphPathPrefixes: Schema.optional(Schema.Array(Schema.String)),\n microsoftGraphTagPrefixes: Schema.optional(Schema.Array(Schema.String)),\n microsoftGraphCoversFullGraph: Schema.optional(Schema.Boolean),\n microsoftGraphAuthorizationUrl: Schema.optional(Schema.String),\n microsoftGraphTokenUrl: Schema.optional(Schema.String),\n microsoftGraphClientCredentialsTokenUrl: Schema.optional(Schema.String),\n});\n\nconst decodeMicrosoftConfig = Schema.decodeUnknownOption(MicrosoftGraphIntegrationConfigSchema);\n\nexport const decodeMicrosoftGraphIntegrationConfig = (\n value: unknown,\n): MicrosoftGraphIntegrationConfig | null =>\n Option.getOrNull(decodeMicrosoftConfig(value)) as MicrosoftGraphIntegrationConfig | null;\n\nconst uniqueStrings = (values: Iterable<string>): readonly string[] => {\n const seen = new Set<string>();\n const result: string[] = [];\n for (const value of values) {\n const trimmed = value.trim();\n if (!trimmed || seen.has(trimmed)) continue;\n seen.add(trimmed);\n result.push(trimmed);\n }\n return result;\n};\n\nconst normalizeSelection = (input: MicrosoftGraphSelectionInput) => {\n const presetIds = uniqueStrings(\n input.presetIds && input.presetIds.length > 0\n ? input.presetIds\n : MICROSOFT_GRAPH_DEFAULT_PRESET_IDS,\n );\n const customScopes = uniqueStrings(input.customScopes ?? []);\n const scopes = microsoftGraphScopesForPresetIds(presetIds, customScopes);\n const exactPaths = microsoftGraphExactPathsForPresetIds(presetIds);\n const pathPrefixes = microsoftGraphPathPrefixesForPresetIds(presetIds);\n const tagPrefixes = microsoftGraphTagPrefixesForPresetIds(presetIds);\n const coversFullGraph = microsoftGraphPresetIdsCoverFullGraph(presetIds);\n const specUrl = input.specUrl?.trim() || MICROSOFT_GRAPH_OPENAPI_URL;\n const baseUrl = input.baseUrl?.trim() || undefined;\n const authorizationUrl = input.authorizationUrl?.trim() || undefined;\n const tokenUrl = input.tokenUrl?.trim() || undefined;\n const clientCredentialsTokenUrl = input.clientCredentialsTokenUrl?.trim() || undefined;\n return {\n presetIds,\n customScopes,\n scopes,\n exactPaths,\n pathPrefixes,\n tagPrefixes,\n coversFullGraph,\n specUrl,\n baseUrl,\n authorizationUrl,\n tokenUrl,\n clientCredentialsTokenUrl,\n };\n};\n\ninterface MicrosoftOAuthEndpoints {\n readonly authorizationUrl: string;\n readonly tokenUrl: string;\n readonly clientCredentialsTokenUrl: string;\n}\n\nconst microsoftOAuthTemplate = (\n scopes: readonly string[],\n endpoints: MicrosoftOAuthEndpoints,\n): readonly Authentication[] => [\n {\n slug: AuthTemplateSlug.make(MICROSOFT_AUTH_TEMPLATE_SLUG),\n kind: \"oauth2\",\n authorizationUrl: endpoints.authorizationUrl,\n tokenUrl: endpoints.tokenUrl,\n scopes,\n },\n {\n slug: AuthTemplateSlug.make(MICROSOFT_CLIENT_CREDENTIALS_AUTH_TEMPLATE_SLUG),\n kind: \"oauth2\",\n authorizationUrl: endpoints.authorizationUrl,\n tokenUrl: endpoints.clientCredentialsTokenUrl,\n scopes: [...MICROSOFT_GRAPH_CLIENT_CREDENTIALS_SCOPES],\n },\n];\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === \"object\" && !Array.isArray(value);\n\nconst HTTP_METHODS = new Set([\"delete\", \"get\", \"patch\", \"post\", \"put\"]);\nconst REQUEST_BASE_SCOPES = new Set([\"offline_access\", \"openid\", \"profile\", \"email\"]);\nconst PATH_SCOPE_IGNORED_SCOPES = new Set([\n \"offline_access\",\n \"openid\",\n \"profile\",\n \"email\",\n MICROSOFT_GRAPH_IDENTITY_SCOPE,\n]);\n\nconst firstString = (values: readonly unknown[]): string | undefined =>\n values.find((value): value is string => typeof value === \"string\" && value.trim().length > 0);\n\nconst parseTrustedHttpsUrl = (value: string): URL | null => {\n if (!URL.canParse(value)) return null;\n const parsed = new URL(value);\n if (parsed.protocol !== \"https:\" || parsed.username || parsed.password || parsed.hash) {\n return null;\n }\n return parsed;\n};\n\n// Local emulators (microsoft-emulator.test.ts, `microsoft.emulators.dev` run\n// locally) serve plain http on loopback. Only these three hostnames count —\n// this is not a general SSRF-safe \"is this private\" check, just a narrow\n// allowance for the dev machine talking to itself.\nconst isLoopbackHostname = (hostname: string): boolean => {\n const lower = hostname.toLowerCase();\n return lower === \"localhost\" || lower === \"127.0.0.1\" || lower === \"::1\" || lower === \"[::1]\";\n};\n\nconst parseTrustedLoopbackHttpUrl = (value: string): URL | null => {\n if (!URL.canParse(value)) return null;\n const parsed = new URL(value);\n if (parsed.protocol !== \"http:\" || parsed.username || parsed.password || parsed.hash) {\n return null;\n }\n return isLoopbackHostname(parsed.hostname) ? parsed : null;\n};\n\n/**\n * Under `allowUnsafeUrlOverrides`, accept either a trusted https URL or a\n * plain-http URL on loopback (local emulators have no TLS). Every other URL\n * shape is still rejected, override or not.\n */\nconst allowUnsafeUrl = (\n value: string | undefined,\n policy: MicrosoftGraphUrlPolicy | undefined,\n): string | undefined | null => {\n if (!value) return undefined;\n if (policy?.allowUnsafeUrlOverrides !== true) return null;\n return parseTrustedHttpsUrl(value) || parseTrustedLoopbackHttpUrl(value) ? value : null;\n};\n\nconst normalizeMicrosoftGraphSpecUrl = (\n value: string,\n policy?: MicrosoftGraphUrlPolicy,\n): string | null => {\n if (value === MICROSOFT_GRAPH_OPENAPI_URL) return value;\n return allowUnsafeUrl(value, policy) ?? null;\n};\n\nconst MICROSOFT_GRAPH_HOSTS = new Set([\n \"graph.microsoft.com\",\n \"graph.microsoft.us\",\n \"dod-graph.microsoft.us\",\n \"microsoftgraph.chinacloudapi.cn\",\n]);\n\nconst normalizeMicrosoftGraphBaseUrl = (\n value: string | undefined,\n policy?: MicrosoftGraphUrlPolicy,\n): string | undefined | null => {\n const unsafe = allowUnsafeUrl(value, policy);\n if (unsafe !== null) return unsafe;\n if (!value) return undefined;\n const parsed = parseTrustedHttpsUrl(value);\n if (!parsed || !MICROSOFT_GRAPH_HOSTS.has(parsed.hostname.toLowerCase())) return null;\n if (!/^\\/(?:v1\\.0|beta)(?:\\/)?$/.test(parsed.pathname)) return null;\n if (parsed.search) return null;\n return parsed.toString().replace(/\\/$/, \"\");\n};\n\nconst MICROSOFT_IDENTITY_HOSTS = new Set([\n \"login.microsoftonline.com\",\n \"login.microsoftonline.us\",\n \"login.partner.microsoftonline.cn\",\n]);\n\nconst normalizeMicrosoftOAuthEndpointUrl = (\n value: string,\n endpoint: \"authorize\" | \"token\",\n policy?: MicrosoftGraphUrlPolicy,\n): string | null => {\n const unsafe = allowUnsafeUrl(value, policy);\n if (unsafe !== null) return unsafe ?? null;\n const parsed = parseTrustedHttpsUrl(value);\n if (!parsed || !MICROSOFT_IDENTITY_HOSTS.has(parsed.hostname.toLowerCase())) return null;\n if (parsed.search) return null;\n const suffix = endpoint === \"authorize\" ? \"authorize\" : \"token\";\n return /^\\/[^/]+\\/oauth2\\/v2\\.0\\/(?:authorize|token)$/.test(parsed.pathname) &&\n parsed.pathname.endsWith(`/${suffix}`)\n ? parsed.toString()\n : null;\n};\n\nconst validateSelectionUrls = (\n selection: ReturnType<typeof normalizeSelection>,\n policy?: MicrosoftGraphUrlPolicy,\n): Effect.Effect<ReturnType<typeof normalizeSelection>, OpenApiParseError> =>\n Effect.gen(function* () {\n const specUrl = normalizeMicrosoftGraphSpecUrl(selection.specUrl, policy);\n if (!specUrl) {\n return yield* new OpenApiParseError({\n message: \"Microsoft Graph specUrl must point to the trusted Microsoft Graph OpenAPI spec\",\n });\n }\n const baseUrl = normalizeMicrosoftGraphBaseUrl(selection.baseUrl, policy);\n if (baseUrl === null) {\n return yield* new OpenApiParseError({\n message: \"Microsoft Graph baseUrl must point to a supported Microsoft Graph endpoint\",\n });\n }\n const authorizationUrl = selection.authorizationUrl\n ? normalizeMicrosoftOAuthEndpointUrl(selection.authorizationUrl, \"authorize\", policy)\n : undefined;\n if (selection.authorizationUrl && !authorizationUrl) {\n return yield* new OpenApiParseError({\n message: \"Microsoft authorizationUrl must point to a supported Microsoft identity endpoint\",\n });\n }\n const tokenUrl = selection.tokenUrl\n ? normalizeMicrosoftOAuthEndpointUrl(selection.tokenUrl, \"token\", policy)\n : undefined;\n if (selection.tokenUrl && !tokenUrl) {\n return yield* new OpenApiParseError({\n message: \"Microsoft tokenUrl must point to a supported Microsoft identity endpoint\",\n });\n }\n const clientCredentialsTokenUrl = selection.clientCredentialsTokenUrl\n ? normalizeMicrosoftOAuthEndpointUrl(selection.clientCredentialsTokenUrl, \"token\", policy)\n : undefined;\n if (selection.clientCredentialsTokenUrl && !clientCredentialsTokenUrl) {\n return yield* new OpenApiParseError({\n message:\n \"Microsoft clientCredentialsTokenUrl must point to a supported Microsoft identity endpoint\",\n });\n }\n return {\n ...selection,\n specUrl,\n ...(baseUrl ? { baseUrl } : { baseUrl: undefined }),\n ...(authorizationUrl ? { authorizationUrl } : { authorizationUrl: undefined }),\n ...(tokenUrl ? { tokenUrl } : { tokenUrl: undefined }),\n ...(clientCredentialsTokenUrl\n ? { clientCredentialsTokenUrl }\n : { clientCredentialsTokenUrl: undefined }),\n };\n });\n\nconst validateResolvedOAuthEndpoints = (\n endpoints: MicrosoftOAuthEndpoints,\n policy?: MicrosoftGraphUrlPolicy,\n): Effect.Effect<MicrosoftOAuthEndpoints, OpenApiParseError> =>\n Effect.gen(function* () {\n const authorizationUrl = normalizeMicrosoftOAuthEndpointUrl(\n endpoints.authorizationUrl,\n \"authorize\",\n policy,\n );\n const tokenUrl = normalizeMicrosoftOAuthEndpointUrl(endpoints.tokenUrl, \"token\", policy);\n const clientCredentialsTokenUrl = normalizeMicrosoftOAuthEndpointUrl(\n endpoints.clientCredentialsTokenUrl,\n \"token\",\n policy,\n );\n if (!authorizationUrl || !tokenUrl || !clientCredentialsTokenUrl) {\n return yield* new OpenApiParseError({\n message: \"Microsoft OAuth endpoints must point to supported Microsoft identity endpoints\",\n });\n }\n return { authorizationUrl, tokenUrl, clientCredentialsTokenUrl };\n });\n\nconst recordValues = (value: unknown): readonly unknown[] =>\n isRecord(value) ? Object.values(value) : [];\n\nconst firstOAuthFlows = (parsed: Record<string, unknown>): readonly Record<string, unknown>[] => {\n const components = isRecord(parsed.components) ? parsed.components : {};\n const securitySchemes = isRecord(components.securitySchemes) ? components.securitySchemes : {};\n return recordValues(securitySchemes)\n .filter(isRecord)\n .filter((scheme) => scheme.type === \"oauth2\")\n .flatMap((scheme) => recordValues(scheme.flows).filter(isRecord));\n};\n\nconst resolveOAuthEndpoints = (\n parsed: Record<string, unknown>,\n overrides: {\n readonly authorizationUrl?: string;\n readonly tokenUrl?: string;\n readonly clientCredentialsTokenUrl?: string;\n },\n): MicrosoftOAuthEndpoints => {\n const flows = firstOAuthFlows(parsed);\n const authorizationCode = flows.find((flow) => flow.authorizationUrl !== undefined);\n const clientCredentials = flows.find(\n (flow) => flow.tokenUrl !== undefined && flow.authorizationUrl === undefined,\n );\n const authorizationUrl =\n overrides.authorizationUrl ??\n (isRecord(authorizationCode) ? firstString([authorizationCode.authorizationUrl]) : undefined) ??\n MICROSOFT_AUTHORIZATION_URL;\n const tokenUrl =\n overrides.tokenUrl ??\n (isRecord(authorizationCode) ? firstString([authorizationCode.tokenUrl]) : undefined) ??\n firstString(flows.map((flow) => flow.tokenUrl)) ??\n MICROSOFT_TOKEN_URL;\n const clientCredentialsTokenUrl =\n overrides.clientCredentialsTokenUrl ??\n (isRecord(clientCredentials) ? firstString([clientCredentials.tokenUrl]) : undefined) ??\n tokenUrl;\n return { authorizationUrl, tokenUrl, clientCredentialsTokenUrl };\n};\n\nconst graphPathMatchVariants = (path: string): readonly string[] => {\n const withoutVersion = path.replace(/^\\/(?:v1\\.0|beta)(?=\\/)/, \"\");\n return withoutVersion === path ? [path, `/v1.0${path}`] : [path, withoutVersion];\n};\n\nconst matchesGraphPath = (\n path: string,\n exactPaths: ReadonlySet<string>,\n pathPrefixes: readonly string[],\n): boolean => {\n const variants = graphPathMatchVariants(path);\n if (variants.some((variant) => exactPaths.has(variant))) return true;\n return variants.some((variant) =>\n pathPrefixes.some(\n (prefix) =>\n variant === prefix || variant.startsWith(`${prefix}/`) || variant.startsWith(`${prefix}(`),\n ),\n );\n};\n\nconst isIdentityHealthPath = (path: string): boolean =>\n graphPathMatchVariants(path).some((variant) => variant === \"/me\");\n\nconst operationTags = (operation: Record<string, unknown>): readonly string[] =>\n Array.isArray(operation.tags)\n ? operation.tags.filter((tag): tag is string => typeof tag === \"string\")\n : [];\n\nconst operationMatchesTagPrefix = (\n operation: Record<string, unknown>,\n tagPrefixes: readonly string[],\n): boolean =>\n tagPrefixes.length > 0 &&\n operationTags(operation).some((tag) =>\n tagPrefixes.some((prefix) => tag === prefix || tag.startsWith(prefix)),\n );\n\nconst isGraphPermissionScope = (value: string): boolean =>\n value.startsWith(\"https://graph.microsoft.com/\") ||\n /^[A-Z][A-Za-z0-9]*(?:\\.[A-Za-z0-9]+)+(?:\\.All)?$/.test(value);\n\nexport const parseMicrosoftGraphDelegatedScopes = (\n permissionsReference: string,\n): readonly string[] =>\n uniqueStrings(\n permissionsReference.split(/\\n(?=###\\s+)/).flatMap((section) => {\n const scope = section.match(/^###\\s+([^\\n]+)$/m)?.[1]?.trim();\n if (!scope || !isGraphPermissionScope(scope)) return [];\n const identifierRow = section.match(/^\\|\\s*Identifier\\s*\\|\\s*([^|]*)\\|\\s*([^|]*)\\|/m);\n const delegatedIdentifier = identifierRow?.[2]?.trim();\n return delegatedIdentifier && delegatedIdentifier !== \"-\" ? [scope] : [];\n }),\n );\n\nconst collectScopeStrings = (value: unknown): readonly string[] => {\n if (typeof value === \"string\") return isGraphPermissionScope(value) ? [value] : [];\n if (Array.isArray(value)) return value.flatMap(collectScopeStrings);\n if (!isRecord(value)) return [];\n return Object.values(value).flatMap(collectScopeStrings);\n};\n\nconst securityScopes = (\n value: unknown,\n options?: { readonly delegatedOnly?: boolean },\n): readonly string[] => {\n if (!Array.isArray(value)) return [];\n return value.flatMap((entry) => {\n if (!isRecord(entry)) return [];\n return Object.entries(entry).flatMap(([scheme, scopes]) => {\n const lowerScheme = scheme.toLowerCase();\n if (options?.delegatedOnly && lowerScheme.includes(\"app\")) return [];\n if (options?.delegatedOnly && lowerScheme.includes(\"application\")) return [];\n return Array.isArray(scopes)\n ? scopes.filter((scope): scope is string => typeof scope === \"string\")\n : [];\n });\n });\n};\n\nconst permissionScopes = (\n operation: Record<string, unknown>,\n options?: { readonly delegatedOnly?: boolean },\n): readonly string[] => {\n const xMsPermissions = isRecord(operation[\"x-ms-permissions\"])\n ? operation[\"x-ms-permissions\"]\n : {};\n const delegatedScopes = options?.delegatedOnly\n ? collectScopeStrings({\n delegated: xMsPermissions.delegated,\n leastPrivilegedDelegated: xMsPermissions.leastPrivilegedDelegated,\n })\n : collectScopeStrings(xMsPermissions);\n return uniqueStrings([...securityScopes(operation.security, options), ...delegatedScopes]);\n};\n\nconst operationMatchesScope = (\n operation: Record<string, unknown>,\n selectedScopes: ReadonlySet<string>,\n): boolean =>\n permissionScopes(operation).some(\n (scope) => selectedScopes.has(scope) && !PATH_SCOPE_IGNORED_SCOPES.has(scope),\n );\n\nconst filterPathItem = (\n path: string,\n pathItem: Record<string, unknown>,\n options: {\n readonly exactPaths: ReadonlySet<string>;\n readonly pathPrefixes: readonly string[];\n readonly tagPrefixes: readonly string[];\n readonly selectedScopes: ReadonlySet<string>;\n },\n): Record<string, unknown> | null => {\n // Always keep bare /me: the default identity health check depends on GET /me\n // even when the profile workload is unchecked.\n const pathMatchesSelection = matchesGraphPath(path, options.exactPaths, options.pathPrefixes);\n const identityHealthGetOnly = !pathMatchesSelection && isIdentityHealthPath(path);\n const kept: Record<string, unknown> = {};\n let hasOperation = false;\n\n for (const [key, value] of Object.entries(pathItem)) {\n const lowerKey = key.toLowerCase();\n if (!HTTP_METHODS.has(lowerKey)) continue;\n if (!isRecord(value)) continue;\n if (identityHealthGetOnly && lowerKey !== \"get\") continue;\n if (\n pathMatchesSelection ||\n identityHealthGetOnly ||\n operationMatchesTagPrefix(value, options.tagPrefixes) ||\n operationMatchesScope(value, options.selectedScopes)\n ) {\n kept[key] = value;\n hasOperation = true;\n }\n }\n\n if (!hasOperation) return null;\n for (const [key, value] of Object.entries(pathItem)) {\n if (!HTTP_METHODS.has(key.toLowerCase())) kept[key] = value;\n }\n return kept;\n};\n\nconst normalizedMediaType = (mediaType: string): string =>\n mediaType.split(\";\")[0]?.trim().toLowerCase() ?? \"\";\n\nconst isBinaryStringSchema = (schema: unknown): boolean =>\n isRecord(schema) &&\n (schema.type === \"string\" || (Array.isArray(schema.type) && schema.type.includes(\"string\"))) &&\n (schema.format === \"binary\" || schema.format === \"byte\");\n\n// Graph declares success responses with the OpenAPI wildcard status key \"2XX\",\n// never numeric codes like \"200\" (only \"204\" appears numerically in the spec).\nconst isSuccessStatusKey = (status: string): boolean =>\n /^2\\d\\d$/.test(status) || /^2xx$/i.test(status);\n\n// Rewrite any success response whose `application/octet-stream` media carries a\n// non-binary schema (report-style Graph endpoints declare `type: object` with a\n// `value` property there) to a plain binary string, so the OpenAPI extractor\n// emits a `binaryResponse` file hint. Already-binary media and all other media\n// types and response fields are left untouched.\nconst normalizeMicrosoftGraphContentPathItem = (\n pathItem: Record<string, unknown>,\n): Record<string, unknown> => {\n let changed = false;\n const next: Record<string, unknown> = { ...pathItem };\n\n for (const [key, operation] of Object.entries(pathItem)) {\n if (!HTTP_METHODS.has(key.toLowerCase()) || !isRecord(operation)) continue;\n const responses = isRecord(operation.responses) ? operation.responses : undefined;\n if (!responses) continue;\n\n let responsesChanged = false;\n const nextResponses: Record<string, unknown> = { ...responses };\n for (const [status, response] of Object.entries(responses)) {\n if (!isSuccessStatusKey(status) || !isRecord(response)) continue;\n const content = isRecord(response.content) ? response.content : undefined;\n if (!content) continue;\n\n let contentChanged = false;\n const nextContent: Record<string, unknown> = { ...content };\n for (const [mediaType, media] of Object.entries(content)) {\n if (normalizedMediaType(mediaType) !== \"application/octet-stream\") continue;\n const schema = isRecord(media) ? media.schema : undefined;\n if (isBinaryStringSchema(schema)) continue;\n nextContent[mediaType] = {\n ...(isRecord(media) ? media : {}),\n schema: { type: \"string\", format: \"binary\" },\n };\n contentChanged = true;\n }\n\n if (contentChanged) {\n nextResponses[status] = { ...response, content: nextContent };\n responsesChanged = true;\n }\n }\n\n if (responsesChanged) {\n next[key] = { ...operation, responses: nextResponses };\n changed = true;\n }\n }\n\n return changed ? next : pathItem;\n};\n\nexport const fetchMicrosoftGraphOpenApiSpec = Effect.fn(\"Microsoft.fetchGraphOpenApiSpec\")(\n function* (specUrl: string) {\n const client = yield* HttpClient.HttpClient;\n const response = yield* client\n .execute(\n HttpClientRequest.get(specUrl).pipe(\n HttpClientRequest.setHeader(\"Accept\", \"application/yaml, text/yaml, */*\"),\n ),\n )\n .pipe(\n Effect.mapError(\n () =>\n new OpenApiParseError({\n message: \"Failed to fetch Microsoft Graph OpenAPI document\",\n }),\n ),\n );\n if (response.status < 200 || response.status >= 300) {\n return yield* new OpenApiParseError({\n message: `Failed to fetch Microsoft Graph OpenAPI document: HTTP ${response.status}`,\n });\n }\n return yield* response.text.pipe(\n Effect.mapError(\n () =>\n new OpenApiParseError({\n message: \"Failed to read Microsoft Graph OpenAPI document body\",\n }),\n ),\n );\n },\n);\n\nexport const fetchMicrosoftGraphPermissionsReference = Effect.fn(\n \"Microsoft.fetchGraphPermissionsReference\",\n)(function* () {\n const client = yield* HttpClient.HttpClient;\n const response = yield* client\n .execute(\n HttpClientRequest.get(MICROSOFT_GRAPH_PERMISSIONS_REFERENCE_URL).pipe(\n HttpClientRequest.setHeader(\"Accept\", \"text/markdown, text/plain, */*\"),\n ),\n )\n .pipe(\n Effect.mapError(\n () =>\n new OpenApiParseError({\n message: \"Failed to fetch Microsoft Graph permissions reference\",\n }),\n ),\n );\n if (response.status < 200 || response.status >= 300) {\n return yield* new OpenApiParseError({\n message: `Failed to fetch Microsoft Graph permissions reference: HTTP ${response.status}`,\n });\n }\n return yield* response.text.pipe(\n Effect.mapError(\n () =>\n new OpenApiParseError({\n message: \"Failed to read Microsoft Graph permissions reference body\",\n }),\n ),\n );\n});\n\n/**\n * Build the per-path-item filter that the streaming compile applies to each\n * path-item as it parses the 37MB source. Full-graph selections keep every\n * path-item, but still pass through this transform so octet-stream success\n * responses are normalized to binary before the OpenAPI extractor runs. The\n * selection predicate is identical to the old two-pass filter: the selected\n * scopes are derived from the PRESET scopes (`microsoftGraphScopesForPresetIds`),\n * not the expanded OAuth scopes, so the kept operation set matches regardless\n * of caller.\n */\nexport const microsoftGraphKeepPathItem = (selection: {\n readonly coversFullGraph: boolean;\n readonly presetIds: readonly string[];\n readonly customScopes: readonly string[];\n readonly exactPaths: readonly string[];\n readonly pathPrefixes: readonly string[];\n readonly tagPrefixes: readonly string[];\n}): KeepPathItem => {\n const exactPaths = new Set(selection.exactPaths);\n const selectedScopes = new Set(\n microsoftGraphScopesForPresetIds(selection.presetIds, selection.customScopes),\n );\n return (path, pathItem) => {\n const kept = selection.coversFullGraph\n ? pathItem\n : filterPathItem(path, pathItem, {\n exactPaths,\n pathPrefixes: selection.pathPrefixes,\n tagPrefixes: selection.tagPrefixes,\n selectedScopes,\n });\n return kept ? normalizeMicrosoftGraphContentPathItem(kept) : null;\n };\n};\n\n/**\n * Compute the OAuth scopes for the selection by streaming the source path-items\n * once (never materializing the whole tree). Mirrors the old\n * `selectedOAuthScopesForPaths`: base scopes + full-graph scopes + requested\n * scopes + the delegated permission scopes of every kept operation. `keepPathItem`\n * (when present) restricts the walk to the filtered operation set, exactly as the\n * old code computed scopes over the already-filtered paths.\n */\nconst streamSelectedScopes = (\n structure: SpecStructure,\n requestedScopes: readonly string[],\n fullGraphScopes: readonly string[],\n keepPathItem?: KeepPathItem,\n): readonly string[] => {\n const collected = [\n ...MICROSOFT_GRAPH_BASE_SCOPES,\n ...fullGraphScopes,\n ...requestedScopes.filter((scope) => !REQUEST_BASE_SCOPES.has(scope)),\n ];\n for (const range of structure.pathItems) {\n const entry = parseEntry(structure.text, range, 2);\n if (!entry) continue;\n const [path, rawItem] = entry;\n if (!isRecord(rawItem)) continue;\n const pathItem = keepPathItem ? keepPathItem(path, rawItem) : rawItem;\n if (!pathItem) continue;\n for (const [method, operation] of Object.entries(pathItem)) {\n if (HTTP_METHODS.has(method.toLowerCase()) && isRecord(operation)) {\n collected.push(...permissionScopes(operation, { delegatedOnly: true }));\n }\n }\n }\n return uniqueStrings(collected);\n};\n\nexport const buildMicrosoftGraphOpenApiSpec = (\n input: MicrosoftGraphSelectionInput,\n httpClientLayer: Layer.Layer<HttpClient.HttpClient, never, never>,\n urlPolicy?: MicrosoftGraphUrlPolicy,\n): Effect.Effect<MicrosoftGraphSpecBuild, OpenApiParseError> =>\n Effect.gen(function* () {\n const selection = yield* validateSelectionUrls(normalizeSelection(input), urlPolicy);\n const sourceText = yield* fetchMicrosoftGraphOpenApiSpec(selection.specUrl).pipe(\n Effect.provide(httpClientLayer),\n );\n\n // Structural split is the only entry point: parsing the whole 37MB tree\n // OOMs the 128MB Workers isolate (measured: HTTP 503). No fallback. A spec\n // outside the streamable block-YAML profile is a hard error on this path;\n // arbitrary user specs still go through the generic openapi plugin.\n const structure = structuralSplit(sourceText);\n if (!structure) {\n return yield* new OpenApiParseError({\n message:\n \"Microsoft Graph OpenAPI document is not in the streamable block-YAML profile; cannot compile it in-band on Workers.\",\n });\n }\n\n // Head + small components (servers + securitySchemes) parse cheaply and\n // carry everything `resolveOAuthEndpoints` needs.\n const headDoc = { ...parseHead(structure), components: parseSmallComponents(structure) };\n const endpoints = yield* validateResolvedOAuthEndpoints(\n resolveOAuthEndpoints(headDoc, selection),\n urlPolicy,\n );\n\n const permissionsReference =\n selection.coversFullGraph === true\n ? yield* fetchMicrosoftGraphPermissionsReference().pipe(Effect.provide(httpClientLayer))\n : undefined;\n const fullGraphScopes = permissionsReference\n ? parseMicrosoftGraphDelegatedScopes(permissionsReference)\n : [];\n\n const keepPathItem = microsoftGraphKeepPathItem(selection);\n const scopes =\n selection.coversFullGraph === true && selection.customScopes.length === 0\n ? [...MICROSOFT_GRAPH_DELEGATED_DEFAULT_SCOPES]\n : streamSelectedScopes(\n structure,\n selection.coversFullGraph === true\n ? uniqueStrings([...MICROSOFT_GRAPH_BASE_SCOPES, ...selection.customScopes])\n : selection.scopes,\n fullGraphScopes,\n keepPathItem,\n );\n\n return {\n ...selection,\n specText: sourceText,\n scopes,\n authorizationUrl: endpoints.authorizationUrl,\n tokenUrl: endpoints.tokenUrl,\n clientCredentialsTokenUrl: endpoints.clientCredentialsTokenUrl,\n authenticationTemplate: microsoftOAuthTemplate(scopes, endpoints),\n };\n });\n","import { Effect } from \"effect\";\n\nimport type { SpecFormatAdapter } from \"../../sdk/spec-format\";\n\nimport { buildMicrosoftGraphOpenApiSpec, microsoftGraphKeepPathItem } from \"./graph\";\n\nconst graphCatalogSelection = (\n rawUrl: string | undefined,\n): { readonly specUrl?: string; readonly presetIds?: readonly string[] } => {\n if (!rawUrl || !URL.canParse(rawUrl)) return rawUrl ? { specUrl: rawUrl } : {};\n const parsed = new URL(rawUrl);\n const preset = parsed.hash.startsWith(\"#preset=\")\n ? decodeURIComponent(parsed.hash.slice(\"#preset=\".length))\n : \"\";\n parsed.hash = \"\";\n return {\n specUrl: parsed.toString(),\n ...(preset.length > 0 ? { presetIds: [preset] } : {}),\n };\n};\n\nexport const microsoftGraphAdapter: SpecFormatAdapter = {\n id: \"microsoft-graph\",\n fetch: (input) =>\n buildMicrosoftGraphOpenApiSpec(\n graphCatalogSelection(input.urls[0]),\n input.httpClientLayer,\n ).pipe(\n Effect.map((graphSpec) => ({\n specText: graphSpec.specText,\n specUrl: graphSpec.specUrl,\n baseUrl: graphSpec.baseUrl,\n authenticationTemplate: graphSpec.authenticationTemplate,\n // Stream the full Graph source straight to persisted bindings. This is\n // the measured Workers contention/OOM path from the Microsoft plugin:\n // structural split stays serial and avoids materializing the 37MB tree.\n keepPathItem: microsoftGraphKeepPathItem(graphSpec),\n config: {\n microsoftGraphPresetIds: graphSpec.presetIds,\n microsoftGraphCustomScopes: graphSpec.customScopes,\n microsoftGraphScopes: graphSpec.scopes,\n microsoftGraphExactPaths: graphSpec.exactPaths,\n microsoftGraphPathPrefixes: graphSpec.pathPrefixes,\n microsoftGraphTagPrefixes: graphSpec.tagPrefixes,\n microsoftGraphCoversFullGraph: graphSpec.coversFullGraph,\n microsoftGraphAuthorizationUrl: graphSpec.authorizationUrl,\n microsoftGraphTokenUrl: graphSpec.tokenUrl,\n microsoftGraphClientCredentialsTokenUrl: graphSpec.clientCredentialsTokenUrl,\n },\n })),\n ),\n};\n"],"mappings":";;;;;;;;;;;;AA+BA,IAAM,WAAW,CAAC,SAAiB,4BAA4B,IAAI;AAE5D,IAAM,8BACX;AACK,IAAM,4CACX;AACK,IAAM,2BAA2B;AACjC,IAAM,8BACX;AACK,IAAM,sBAAsB;AAC5B,IAAM,+BAA+B;AACrC,IAAM,kDAAkD;AACxD,IAAM,8BAAiD,CAAC,gBAAgB;AACxE,IAAM,iCAAiC;AACvC,IAAM,gCAAgC;AACtC,IAAM,2CAA8D;AAAA,EACzE,GAAG;AAAA,EACH;AAAA,EACA;AACF;AACO,IAAM,4CAA+D;AAAA,EAC1E;AACF;AAEO,IAAM,4BAA4B;AAElC,IAAM,uBAA6C;AAAA,EACxD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AACZ;AAEO,IAAM,6BAAmE;AAAA,EAC9E;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,SAAS,WAAW;AAAA,IAC1B,QAAQ,CAAC,WAAW;AAAA,IACpB,YAAY,CAAC,OAAO,aAAa,kBAAkB;AAAA,IACnD,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,SAAS,WAAW;AAAA,IAC1B,QAAQ,CAAC,WAAW;AAAA,IACpB,cAAc,CAAC,KAAK;AAAA,IACpB,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;A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C7B,QAAM,SAAS,OAAO,KAAK,WAAW,UAAU,IAC5C,mBAAmB,OAAO,KAAK,MAAM,WAAW,MAAM,CAAC,IACvD;AACJ,SAAO,OAAO;AACd,SAAO;AAAA,IACL,SAAS,OAAO,SAAS;AAAA,IACzB,GAAI,OAAO,SAAS,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC;AAAA,EACrD;AACF;AAEO,IAAM,wBAA2C;AAAA,EACtD,IAAI;AAAA,EACJ,OAAO,CAAC,UACN;AAAA,IACE,sBAAsB,MAAM,KAAK,CAAC,CAAC;AAAA,IACnC,MAAM;AAAA,EACR,EAAE;AAAA,IACAC,QAAO,IAAI,CAAC,eAAe;AAAA,MACzB,UAAU,UAAU;AAAA,MACpB,SAAS,UAAU;AAAA,MACnB,SAAS,UAAU;AAAA,MACnB,wBAAwB,UAAU;AAAA;AAAA;AAAA;AAAA,MAIlC,cAAc,2BAA2B,SAAS;AAAA,MAClD,QAAQ;AAAA,QACN,yBAAyB,UAAU;AAAA,QACnC,4BAA4B,UAAU;AAAA,QACtC,sBAAsB,UAAU;AAAA,QAChC,0BAA0B,UAAU;AAAA,QACpC,4BAA4B,UAAU;AAAA,QACtC,2BAA2B,UAAU;AAAA,QACrC,+BAA+B,UAAU;AAAA,QACzC,gCAAgC,UAAU;AAAA,QAC1C,wBAAwB,UAAU;AAAA,QAClC,yCAAyC,UAAU;AAAA,MACrD;AAAA,IACF,EAAE;AAAA,EACJ;AACJ;","names":["Effect","Effect"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type HealthCheckCandidate, type HealthCheckSpec } from "@rafads/sdk/shared";
|
|
2
|
+
export declare const baseUrlFromSpecInput: (input: string) => string;
|
|
3
|
+
export declare const openApiPreviewFailureMessage: (message: string | null | undefined) => string;
|
|
4
|
+
export declare function AddOpenApiHealthCheckSection(props: {
|
|
5
|
+
readonly presetHealthCheck?: HealthCheckSpec;
|
|
6
|
+
readonly candidates: readonly HealthCheckCandidate[];
|
|
7
|
+
readonly selected: HealthCheckCandidate | null;
|
|
8
|
+
readonly operation: string;
|
|
9
|
+
readonly onOperationChange: (operation: string) => void;
|
|
10
|
+
readonly identityField: string;
|
|
11
|
+
readonly onIdentityFieldChange: (field: string) => void;
|
|
12
|
+
readonly args: Record<string, string>;
|
|
13
|
+
readonly onArgChange: (name: string, value: string) => void;
|
|
14
|
+
readonly disabled: boolean;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export default function AddOpenApiIntegration(props: {
|
|
17
|
+
onComplete: (slug?: string) => void;
|
|
18
|
+
onCancel: () => void;
|
|
19
|
+
initialUrl?: string;
|
|
20
|
+
initialPreset?: string;
|
|
21
|
+
initialNamespace?: string;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IntegrationAccountHandoff } from "@rafads/sdk/client";
|
|
2
|
+
export default function OpenApiAccountsPanel(props: {
|
|
3
|
+
readonly integrationId: string;
|
|
4
|
+
readonly integrationName: string;
|
|
5
|
+
readonly accountHandoff?: IntegrationAccountHandoff | null;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type FreeformComboboxOption } from "@rafads/react/components/combobox";
|
|
2
|
+
import { type IntegrationIdentity } from "@rafads/react/plugins/integration-identity";
|
|
3
|
+
export declare function OpenApiIntegrationDetailsFields(props: {
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly subtitle?: string;
|
|
6
|
+
readonly identity: IntegrationIdentity;
|
|
7
|
+
/** The integration's agent-visible description (prefilled from the spec). */
|
|
8
|
+
readonly description?: string;
|
|
9
|
+
readonly onDescriptionChange?: (value: string) => void;
|
|
10
|
+
readonly baseUrl: string;
|
|
11
|
+
readonly onBaseUrlChange: (value: string) => void;
|
|
12
|
+
readonly baseUrlOptions?: readonly FreeformComboboxOption[];
|
|
13
|
+
readonly baseUrlLabel?: string;
|
|
14
|
+
readonly baseUrlPlaceholder?: string;
|
|
15
|
+
readonly baseUrlHint?: string;
|
|
16
|
+
readonly specUrl?: string;
|
|
17
|
+
readonly onSpecUrlChange?: (value: string) => void;
|
|
18
|
+
readonly faviconIcon?: string | null;
|
|
19
|
+
readonly faviconUrl?: string;
|
|
20
|
+
readonly namespaceReadOnly?: boolean;
|
|
21
|
+
readonly specUrlDisabled?: boolean;
|
|
22
|
+
readonly saveState?: "idle" | "saving" | "saved";
|
|
23
|
+
readonly baseUrlMissingMessage?: string;
|
|
24
|
+
readonly footer?: string;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import type { IntegrationSlug } from "@rafads/sdk/shared";
|
|
2
|
+
import * as Atom from "effect/unstable/reactivity/Atom";
|
|
3
|
+
export declare const openApiIntegrationAtom: (slug: IntegrationSlug) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
4
|
+
readonly description: string;
|
|
5
|
+
readonly slug: string & import("effect/Brand").Brand<"IntegrationSlug">;
|
|
6
|
+
readonly kind: string;
|
|
7
|
+
readonly canRemove: boolean;
|
|
8
|
+
readonly canRefresh: boolean;
|
|
9
|
+
} | null, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
|
|
10
|
+
export declare const openApiConfigAtom: (slug: IntegrationSlug) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
11
|
+
readonly specUrl?: string | undefined;
|
|
12
|
+
readonly headers?: {
|
|
13
|
+
readonly [x: string]: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
readonly queryParams?: {
|
|
16
|
+
readonly [x: string]: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
readonly baseUrl?: string | undefined;
|
|
19
|
+
readonly authenticationTemplate?: readonly ({
|
|
20
|
+
readonly slug: string;
|
|
21
|
+
readonly kind: "apikey";
|
|
22
|
+
readonly placements: readonly {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly carrier: "header" | "query";
|
|
25
|
+
readonly variable?: string | undefined;
|
|
26
|
+
readonly prefix?: string | undefined;
|
|
27
|
+
readonly literal?: string | undefined;
|
|
28
|
+
}[];
|
|
29
|
+
readonly label?: string | undefined;
|
|
30
|
+
} | {
|
|
31
|
+
readonly slug: string;
|
|
32
|
+
readonly kind: "oauth2";
|
|
33
|
+
readonly authorizationUrl: string;
|
|
34
|
+
readonly tokenUrl: string;
|
|
35
|
+
readonly scopes: readonly string[];
|
|
36
|
+
readonly resource?: string | null | undefined;
|
|
37
|
+
readonly supportsClientIdMetadataDocument?: boolean | undefined;
|
|
38
|
+
})[] | undefined;
|
|
39
|
+
} | null, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
|
|
40
|
+
export declare const previewOpenApiSpec: Atom.AtomResultFn<{
|
|
41
|
+
readonly payload: {
|
|
42
|
+
readonly spec: string;
|
|
43
|
+
readonly specFormat?: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
46
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
readonly version: import("effect/Option").Option<string>;
|
|
49
|
+
readonly description: import("effect/Option").Option<string>;
|
|
50
|
+
readonly title: import("effect/Option").Option<string>;
|
|
51
|
+
readonly servers: readonly {
|
|
52
|
+
readonly description: import("effect/Option").Option<string>;
|
|
53
|
+
readonly url: string;
|
|
54
|
+
readonly variables: import("effect/Option").Option<{
|
|
55
|
+
readonly [x: string]: {
|
|
56
|
+
readonly default: string;
|
|
57
|
+
readonly description: import("effect/Option").Option<string>;
|
|
58
|
+
readonly enum: import("effect/Option").Option<readonly string[]>;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
}[];
|
|
62
|
+
readonly tags: readonly string[];
|
|
63
|
+
readonly securitySchemes: readonly {
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly type: "oauth2" | "apiKey" | "http" | "openIdConnect";
|
|
66
|
+
readonly in: import("effect/Option").Option<"header" | "query" | "cookie">;
|
|
67
|
+
readonly description: import("effect/Option").Option<string>;
|
|
68
|
+
readonly scheme: import("effect/Option").Option<string>;
|
|
69
|
+
readonly bearerFormat: import("effect/Option").Option<string>;
|
|
70
|
+
readonly headerName: import("effect/Option").Option<string>;
|
|
71
|
+
readonly flows: import("effect/Option").Option<{
|
|
72
|
+
readonly authorizationCode: import("effect/Option").Option<{
|
|
73
|
+
readonly authorizationUrl: string;
|
|
74
|
+
readonly tokenUrl: string;
|
|
75
|
+
readonly scopes: {
|
|
76
|
+
readonly [x: string]: string;
|
|
77
|
+
};
|
|
78
|
+
readonly refreshUrl: import("effect/Option").Option<string>;
|
|
79
|
+
}>;
|
|
80
|
+
readonly clientCredentials: import("effect/Option").Option<{
|
|
81
|
+
readonly tokenUrl: string;
|
|
82
|
+
readonly scopes: {
|
|
83
|
+
readonly [x: string]: string;
|
|
84
|
+
};
|
|
85
|
+
readonly refreshUrl: import("effect/Option").Option<string>;
|
|
86
|
+
}>;
|
|
87
|
+
}>;
|
|
88
|
+
readonly openIdConnectUrl: import("effect/Option").Option<string>;
|
|
89
|
+
}[];
|
|
90
|
+
readonly authStrategies: readonly {
|
|
91
|
+
readonly schemes: readonly string[];
|
|
92
|
+
}[];
|
|
93
|
+
readonly headerPresets: readonly {
|
|
94
|
+
readonly label: string;
|
|
95
|
+
readonly headers: {
|
|
96
|
+
readonly [x: string]: string | null;
|
|
97
|
+
};
|
|
98
|
+
readonly secretHeaders: readonly string[];
|
|
99
|
+
}[];
|
|
100
|
+
readonly oauth2Presets: readonly {
|
|
101
|
+
readonly resource: import("effect/Option").Option<string>;
|
|
102
|
+
readonly label: string;
|
|
103
|
+
readonly authorizationUrl: import("effect/Option").Option<string>;
|
|
104
|
+
readonly tokenUrl: string;
|
|
105
|
+
readonly scopes: {
|
|
106
|
+
readonly [x: string]: string;
|
|
107
|
+
};
|
|
108
|
+
readonly refreshUrl: import("effect/Option").Option<string>;
|
|
109
|
+
readonly flow: "authorizationCode" | "clientCredentials";
|
|
110
|
+
readonly identityScopes: false | "auto" | readonly string[];
|
|
111
|
+
readonly securitySchemeName: string;
|
|
112
|
+
readonly supportsClientIdMetadataDocument?: boolean | undefined;
|
|
113
|
+
}[];
|
|
114
|
+
readonly healthCheckCandidates: readonly {
|
|
115
|
+
readonly operation: string;
|
|
116
|
+
readonly method: string;
|
|
117
|
+
readonly requiredArgCount: number;
|
|
118
|
+
readonly destructive: boolean;
|
|
119
|
+
readonly summary?: string | undefined;
|
|
120
|
+
readonly parameters?: readonly {
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly required: boolean;
|
|
123
|
+
readonly location: string;
|
|
124
|
+
readonly description?: string | undefined;
|
|
125
|
+
}[] | undefined;
|
|
126
|
+
readonly responseFields?: readonly {
|
|
127
|
+
readonly type: string;
|
|
128
|
+
readonly path: string;
|
|
129
|
+
}[] | undefined;
|
|
130
|
+
}[];
|
|
131
|
+
readonly operationCount: number;
|
|
132
|
+
}, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
133
|
+
export declare const addOpenApiSpec: Atom.AtomResultFn<{
|
|
134
|
+
readonly payload: {
|
|
135
|
+
readonly spec: {
|
|
136
|
+
readonly kind: "url";
|
|
137
|
+
readonly url: string;
|
|
138
|
+
} | {
|
|
139
|
+
readonly value: string;
|
|
140
|
+
readonly kind: "blob";
|
|
141
|
+
};
|
|
142
|
+
readonly name?: string | undefined;
|
|
143
|
+
readonly description?: string | undefined;
|
|
144
|
+
readonly slug?: string | undefined;
|
|
145
|
+
readonly headers?: {
|
|
146
|
+
readonly [x: string]: string;
|
|
147
|
+
} | undefined;
|
|
148
|
+
readonly family?: string | undefined;
|
|
149
|
+
readonly queryParams?: {
|
|
150
|
+
readonly [x: string]: string;
|
|
151
|
+
} | undefined;
|
|
152
|
+
readonly baseUrl?: string | undefined;
|
|
153
|
+
readonly specFormat?: string | undefined;
|
|
154
|
+
readonly authenticationTemplate?: readonly ({
|
|
155
|
+
readonly type: "apiKey";
|
|
156
|
+
readonly slug?: string | undefined;
|
|
157
|
+
readonly label?: string | undefined;
|
|
158
|
+
readonly headers?: {
|
|
159
|
+
readonly [x: string]: string | readonly (string | {
|
|
160
|
+
readonly name: string;
|
|
161
|
+
readonly type: "variable";
|
|
162
|
+
})[];
|
|
163
|
+
} | undefined;
|
|
164
|
+
readonly queryParams?: {
|
|
165
|
+
readonly [x: string]: string | readonly (string | {
|
|
166
|
+
readonly name: string;
|
|
167
|
+
readonly type: "variable";
|
|
168
|
+
})[];
|
|
169
|
+
} | undefined;
|
|
170
|
+
} | {
|
|
171
|
+
readonly slug: string;
|
|
172
|
+
readonly kind: "oauth2";
|
|
173
|
+
readonly authorizationUrl: string;
|
|
174
|
+
readonly tokenUrl: string;
|
|
175
|
+
readonly scopes: readonly string[];
|
|
176
|
+
readonly resource?: string | null | undefined;
|
|
177
|
+
readonly supportsClientIdMetadataDocument?: boolean | undefined;
|
|
178
|
+
})[] | undefined;
|
|
179
|
+
readonly healthCheck?: {
|
|
180
|
+
readonly operation: string;
|
|
181
|
+
readonly args?: {
|
|
182
|
+
readonly [x: string]: unknown;
|
|
183
|
+
} | undefined;
|
|
184
|
+
readonly identityField?: string | undefined;
|
|
185
|
+
} | undefined;
|
|
186
|
+
};
|
|
187
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
188
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
readonly slug: string & import("effect/Brand").Brand<"IntegrationSlug">;
|
|
191
|
+
readonly toolCount: number;
|
|
192
|
+
}, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
193
|
+
export declare const removeOpenApiSpec: Atom.AtomResultFn<{
|
|
194
|
+
readonly params: {
|
|
195
|
+
readonly slug: string;
|
|
196
|
+
};
|
|
197
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
198
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
199
|
+
}, void, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
200
|
+
/** Re-fetch (or replace) the integration's spec and rebuild its tools in
|
|
201
|
+
* place — connections, policies, and the description survive. Pass
|
|
202
|
+
* `reactivityKeys: integrationWriteKeys` at the call site. */
|
|
203
|
+
export declare const updateOpenApiSpec: Atom.AtomResultFn<{
|
|
204
|
+
readonly params: {
|
|
205
|
+
readonly slug: string;
|
|
206
|
+
};
|
|
207
|
+
readonly payload: {
|
|
208
|
+
readonly spec?: {
|
|
209
|
+
readonly kind: "url";
|
|
210
|
+
readonly url: string;
|
|
211
|
+
} | {
|
|
212
|
+
readonly value: string;
|
|
213
|
+
readonly kind: "blob";
|
|
214
|
+
} | undefined;
|
|
215
|
+
};
|
|
216
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
217
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
218
|
+
}, {
|
|
219
|
+
readonly slug: string & import("effect/Brand").Brand<"IntegrationSlug">;
|
|
220
|
+
readonly toolCount: number;
|
|
221
|
+
readonly addedTools: readonly string[];
|
|
222
|
+
readonly removedTools: readonly string[];
|
|
223
|
+
}, import("@rafads/sdk").IntegrationNotFoundError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
224
|
+
export declare const openapiConfigure: Atom.AtomResultFn<{
|
|
225
|
+
readonly params: {
|
|
226
|
+
readonly slug: string;
|
|
227
|
+
};
|
|
228
|
+
readonly payload: {
|
|
229
|
+
readonly mode?: "replace" | "merge" | undefined;
|
|
230
|
+
readonly baseUrl?: string | undefined;
|
|
231
|
+
readonly authenticationTemplate?: readonly ({
|
|
232
|
+
readonly type: "apiKey";
|
|
233
|
+
readonly slug?: string | undefined;
|
|
234
|
+
readonly label?: string | undefined;
|
|
235
|
+
readonly headers?: {
|
|
236
|
+
readonly [x: string]: string | readonly (string | {
|
|
237
|
+
readonly name: string;
|
|
238
|
+
readonly type: "variable";
|
|
239
|
+
})[];
|
|
240
|
+
} | undefined;
|
|
241
|
+
readonly queryParams?: {
|
|
242
|
+
readonly [x: string]: string | readonly (string | {
|
|
243
|
+
readonly name: string;
|
|
244
|
+
readonly type: "variable";
|
|
245
|
+
})[];
|
|
246
|
+
} | undefined;
|
|
247
|
+
} | {
|
|
248
|
+
readonly slug: string;
|
|
249
|
+
readonly kind: "oauth2";
|
|
250
|
+
readonly authorizationUrl: string;
|
|
251
|
+
readonly tokenUrl: string;
|
|
252
|
+
readonly scopes: readonly string[];
|
|
253
|
+
readonly resource?: string | null | undefined;
|
|
254
|
+
readonly supportsClientIdMetadataDocument?: boolean | undefined;
|
|
255
|
+
})[] | undefined;
|
|
256
|
+
};
|
|
257
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
258
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
259
|
+
}, {
|
|
260
|
+
readonly authenticationTemplate: readonly ({
|
|
261
|
+
readonly slug: string;
|
|
262
|
+
readonly kind: "apikey";
|
|
263
|
+
readonly placements: readonly {
|
|
264
|
+
readonly name: string;
|
|
265
|
+
readonly carrier: "header" | "query";
|
|
266
|
+
readonly variable?: string | undefined;
|
|
267
|
+
readonly prefix?: string | undefined;
|
|
268
|
+
readonly literal?: string | undefined;
|
|
269
|
+
}[];
|
|
270
|
+
readonly label?: string | undefined;
|
|
271
|
+
} | {
|
|
272
|
+
readonly slug: string;
|
|
273
|
+
readonly kind: "oauth2";
|
|
274
|
+
readonly authorizationUrl: string;
|
|
275
|
+
readonly tokenUrl: string;
|
|
276
|
+
readonly scopes: readonly string[];
|
|
277
|
+
readonly resource?: string | null | undefined;
|
|
278
|
+
readonly supportsClientIdMetadataDocument?: boolean | undefined;
|
|
279
|
+
})[];
|
|
280
|
+
}, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
281
|
+
export declare const openApiIntegrationFamily: (arg: string & import("effect/Brand").Brand<"IntegrationSlug">) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
282
|
+
readonly description: string;
|
|
283
|
+
readonly slug: string & import("effect/Brand").Brand<"IntegrationSlug">;
|
|
284
|
+
readonly kind: string;
|
|
285
|
+
readonly canRemove: boolean;
|
|
286
|
+
readonly canRefresh: boolean;
|
|
287
|
+
} | null, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
|
|
288
|
+
export declare const openApiConfigFamily: (arg: string & import("effect/Brand").Brand<"IntegrationSlug">) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
289
|
+
readonly specUrl?: string | undefined;
|
|
290
|
+
readonly headers?: {
|
|
291
|
+
readonly [x: string]: string;
|
|
292
|
+
} | undefined;
|
|
293
|
+
readonly queryParams?: {
|
|
294
|
+
readonly [x: string]: string;
|
|
295
|
+
} | undefined;
|
|
296
|
+
readonly baseUrl?: string | undefined;
|
|
297
|
+
readonly authenticationTemplate?: readonly ({
|
|
298
|
+
readonly slug: string;
|
|
299
|
+
readonly kind: "apikey";
|
|
300
|
+
readonly placements: readonly {
|
|
301
|
+
readonly name: string;
|
|
302
|
+
readonly carrier: "header" | "query";
|
|
303
|
+
readonly variable?: string | undefined;
|
|
304
|
+
readonly prefix?: string | undefined;
|
|
305
|
+
readonly literal?: string | undefined;
|
|
306
|
+
}[];
|
|
307
|
+
readonly label?: string | undefined;
|
|
308
|
+
} | {
|
|
309
|
+
readonly slug: string;
|
|
310
|
+
readonly kind: "oauth2";
|
|
311
|
+
readonly authorizationUrl: string;
|
|
312
|
+
readonly tokenUrl: string;
|
|
313
|
+
readonly scopes: readonly string[];
|
|
314
|
+
readonly resource?: string | null | undefined;
|
|
315
|
+
readonly supportsClientIdMetadataDocument?: boolean | undefined;
|
|
316
|
+
})[] | undefined;
|
|
317
|
+
} | null, import("@rafads/sdk").IntegrationAlreadyExistsError | import("@rafads/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AuthMethod, Placement } from "@rafads/react/lib/auth-placements";
|
|
2
|
+
import type { AuthTemplateEditorValue } from "@rafads/react/components/auth-template-editor";
|
|
3
|
+
import type { APIKeyAuthentication, Authentication, AuthenticationInput } from "../sdk/types";
|
|
4
|
+
/** Serialize a canonical method into the wire input union (apikey → the
|
|
5
|
+
* request-shaped dialect; oauth passes through). */
|
|
6
|
+
export declare const openApiWireAuthInput: (method: Authentication) => AuthenticationInput;
|
|
7
|
+
export declare const placementsFromApiKey: (template: APIKeyAuthentication) => readonly Placement[];
|
|
8
|
+
/** Map each stored auth template to a generic `AuthMethod`. */
|
|
9
|
+
export declare function authMethodsFromConfig(templates: readonly Authentication[]): AuthMethod[];
|
|
10
|
+
/** Build an apikey method from generic placements. When `slug` is omitted the
|
|
11
|
+
* backend assigns a `custom_<id>` slug. */
|
|
12
|
+
export declare function templateFromPlacements(placements: readonly Placement[], slug?: string): APIKeyAuthentication;
|
|
13
|
+
/** Convert one stored `Authentication` template into a generic editor value. */
|
|
14
|
+
export declare function editorValueFromAuthentication(template: Authentication): AuthTemplateEditorValue;
|
|
15
|
+
/** Convert one generic editor value back into a stored `Authentication`, or
|
|
16
|
+
* `null` for `none` (no method to register). The optional `slug` names the
|
|
17
|
+
* template; when omitted the backend backfills `custom_<id>`. */
|
|
18
|
+
export declare function authenticationFromEditorValue(value: AuthTemplateEditorValue, slug?: string): Authentication | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|