/**
 * Experimental SDK subpath.
 *
 * Importing from `@zapier/zapier-sdk/experimental` returns an SDK that
 * includes plugins marked with `meta.experimental: true`. The stable
 * subpath (`@zapier/zapier-sdk`) excludes experimental plugins entirely
 * from the typed surface, so editors only autocomplete experimental
 * methods when callers explicitly opt in by import path.
 *
 * The plugin chain in this file is intentionally a full literal copy of
 * the stable factory's chain, with experimental plugins inserted at the
 * right positions (so dependency-ordering invariants hold). Both
 * factories are kept in sync by `experimental-shape.test.ts` — set
 * membership + key-order parity over the shared subset.
 *
 * Public re-exports: this file re-exports `*` from the stable index so
 * callers using `import { ... } from "@zapier/zapier-sdk/experimental"`
 * get the full API (types, helpers, errors, etc.) without juggling two
 * import paths. Only the `createZapierSdk` factory and the `ZapierSdk`
 * type are *replaced* by this subpath.
 */
import { createSdk, createOptionsPlugin } from "./sdk";
import { appsPlugin } from "./plugins/apps/index";
import { fetchPlugin } from "./plugins/fetch/index";
import { apiPlugin } from "./plugins/api/index";
import { getProfilePlugin } from "./plugins/getProfile";
import { listAppsPlugin } from "./plugins/listApps";
import { getAppPlugin } from "./plugins/getApp";
import { listActionsPlugin } from "./plugins/listActions";
import { getActionPlugin } from "./plugins/getAction";
import { runActionPlugin } from "./plugins/runAction";
import { listConnectionsPlugin } from "./plugins/listConnections";
import { getConnectionPlugin } from "./plugins/getConnection";
import { findFirstConnectionPlugin } from "./plugins/findFirstConnection";
import { findUniqueConnectionPlugin } from "./plugins/findUniqueConnection";
import { listAuthenticationsPlugin, getAuthenticationPlugin, findFirstAuthenticationPlugin, findUniqueAuthenticationPlugin, } from "./plugins/deprecated/authentications";
import { listClientCredentialsPlugin } from "./plugins/listClientCredentials";
import { createClientCredentialsPlugin } from "./plugins/createClientCredentials";
import { deleteClientCredentialsPlugin } from "./plugins/deleteClientCredentials";
import { listActionInputFieldsPlugin } from "./plugins/listActionInputFields";
import { getActionInputFieldsSchemaPlugin } from "./plugins/getActionInputFieldsSchema";
import { listActionInputFieldChoicesPlugin } from "./plugins/listActionInputFieldChoices";
import { listInputFieldsDeprecatedPlugin, getInputFieldsSchemaDeprecatedPlugin, listInputFieldChoicesDeprecatedPlugin, } from "./plugins/deprecated/inputFields";
import { createTriggerInboxPlugin } from "./plugins/triggers/createTriggerInbox";
import { ensureTriggerInboxPlugin } from "./plugins/triggers/ensureTriggerInbox";
import { listTriggerInboxesPlugin } from "./plugins/triggers/listTriggerInboxes";
import { getTriggerInboxPlugin } from "./plugins/triggers/getTriggerInbox";
import { updateTriggerInboxPlugin } from "./plugins/triggers/updateTriggerInbox";
import { deleteTriggerInboxPlugin } from "./plugins/triggers/deleteTriggerInbox";
import { pauseTriggerInboxPlugin } from "./plugins/triggers/pauseTriggerInbox";
import { resumeTriggerInboxPlugin } from "./plugins/triggers/resumeTriggerInbox";
import { listTriggerInboxMessagesPlugin } from "./plugins/triggers/listTriggerInboxMessages";
import { leaseTriggerInboxMessagesPlugin } from "./plugins/triggers/leaseTriggerInboxMessages";
import { ackTriggerInboxMessagesPlugin } from "./plugins/triggers/ackTriggerInboxMessages";
import { releaseTriggerInboxMessagesPlugin } from "./plugins/triggers/releaseTriggerInboxMessages";
import { drainTriggerInboxPlugin } from "./plugins/triggers/drainTriggerInbox";
import { watchTriggerInboxPlugin } from "./plugins/triggers/watchTriggerInbox";
import { listTriggersPlugin } from "./plugins/triggers/listTriggers";
import { listTriggerInputFieldsPlugin } from "./plugins/triggers/listTriggerInputFields";
import { listTriggerInputFieldChoicesPlugin } from "./plugins/triggers/listTriggerInputFieldChoices";
import { getTriggerInputFieldsSchemaPlugin } from "./plugins/triggers/getTriggerInputFieldsSchema";
import { listTablesPlugin } from "./plugins/tables/listTables";
import { getTablePlugin } from "./plugins/tables/getTable";
import { deleteTablePlugin } from "./plugins/tables/deleteTable";
import { createTablePlugin } from "./plugins/tables/createTable";
import { listTableFieldsPlugin } from "./plugins/tables/listTableFields";
import { createTableFieldsPlugin } from "./plugins/tables/createTableFields";
import { deleteTableFieldsPlugin } from "./plugins/tables/deleteTableFields";
import { getTableRecordPlugin } from "./plugins/tables/getTableRecord";
import { listTableRecordsPlugin } from "./plugins/tables/listTableRecords";
import { createTableRecordsPlugin } from "./plugins/tables/createTableRecords";
import { deleteTableRecordsPlugin } from "./plugins/tables/deleteTableRecords";
import { updateTableRecordsPlugin } from "./plugins/tables/updateTableRecords";
import { requestPlugin } from "./plugins/request";
import { manifestPlugin } from "./plugins/manifest";
import { capabilitiesPlugin } from "./plugins/capabilities";
import { connectionsPlugin } from "./plugins/connections";
import { eventEmissionPlugin } from "./plugins/eventEmission";
// Re-export everything from the stable index so callers importing from
// the experimental subpath get the full API surface (types, helpers,
// errors) without having to import from two paths.
export * from "./index";
export function createZapierSdk(options = {}) {
    return (createSdk()
        .addPlugin(createOptionsPlugin(options))
        .addPlugin(eventEmissionPlugin)
        .addPlugin(apiPlugin)
        .addPlugin(manifestPlugin)
        .addPlugin(capabilitiesPlugin)
        .addPlugin(connectionsPlugin)
        // Apps/actions/fields
        .addPlugin(listAppsPlugin)
        .addPlugin(getAppPlugin)
        .addPlugin(listActionsPlugin)
        .addPlugin(getActionPlugin)
        .addPlugin(listActionInputFieldsPlugin)
        .addPlugin(getActionInputFieldsSchemaPlugin)
        .addPlugin(listActionInputFieldChoicesPlugin)
        .addPlugin(listInputFieldsDeprecatedPlugin)
        .addPlugin(getInputFieldsSchemaDeprecatedPlugin)
        .addPlugin(listInputFieldChoicesDeprecatedPlugin)
        // Run action
        .addPlugin(runActionPlugin)
        // Connections
        .addPlugin(listConnectionsPlugin)
        .addPlugin(getConnectionPlugin)
        .addPlugin(findFirstConnectionPlugin)
        .addPlugin(findUniqueConnectionPlugin)
        // Deprecated authentication aliases
        .addPlugin(listAuthenticationsPlugin)
        .addPlugin(getAuthenticationPlugin)
        .addPlugin(findFirstAuthenticationPlugin)
        .addPlugin(findUniqueAuthenticationPlugin)
        // Client Credentials
        .addPlugin(listClientCredentialsPlugin)
        .addPlugin(createClientCredentialsPlugin)
        .addPlugin(deleteClientCredentialsPlugin)
        // Relay fetching
        .addPlugin(fetchPlugin)
        .addPlugin(requestPlugin)
        // Triggers (experimental — registered here, NOT in the stable factory)
        .addPlugin(createTriggerInboxPlugin)
        .addPlugin(ensureTriggerInboxPlugin)
        .addPlugin(listTriggerInboxesPlugin)
        .addPlugin(getTriggerInboxPlugin)
        .addPlugin(updateTriggerInboxPlugin)
        .addPlugin(deleteTriggerInboxPlugin)
        .addPlugin(pauseTriggerInboxPlugin)
        .addPlugin(resumeTriggerInboxPlugin)
        .addPlugin(listTriggerInboxMessagesPlugin)
        .addPlugin(leaseTriggerInboxMessagesPlugin)
        .addPlugin(ackTriggerInboxMessagesPlugin)
        .addPlugin(releaseTriggerInboxMessagesPlugin)
        .addPlugin(drainTriggerInboxPlugin)
        .addPlugin(watchTriggerInboxPlugin)
        .addPlugin(listTriggersPlugin)
        .addPlugin(listTriggerInputFieldsPlugin)
        .addPlugin(listTriggerInputFieldChoicesPlugin)
        .addPlugin(getTriggerInputFieldsSchemaPlugin)
        // Tables
        .addPlugin(listTablesPlugin)
        .addPlugin(getTablePlugin)
        .addPlugin(deleteTablePlugin)
        .addPlugin(createTablePlugin)
        .addPlugin(listTableFieldsPlugin)
        .addPlugin(createTableFieldsPlugin)
        .addPlugin(deleteTableFieldsPlugin)
        .addPlugin(getTableRecordPlugin)
        .addPlugin(listTableRecordsPlugin)
        .addPlugin(createTableRecordsPlugin)
        .addPlugin(deleteTableRecordsPlugin)
        .addPlugin(updateTableRecordsPlugin)
        // Magic apps plugin
        .addPlugin(appsPlugin)
        // Profile
        .addPlugin(getProfilePlugin));
}
