From 88351b95bb812de98ad475a9e88cf33553976335 Mon Sep 17 00:00:00 2001 From: Todd Schiller Date: Sun, 18 Aug 2024 11:55:01 -0400 Subject: [PATCH] Rename remaining uses of service context to integration context (#9017) --- eslint-local-rules/persistBackgroundData.txt | 1 - .../varAnalysis/varAnalysis.ts | 12 ++--- src/bricks/transformers/brickFactory.ts | 4 +- .../transformers/controlFlow/IfElse.test.ts | 2 +- .../widgets/varPopup/SourceLabel.tsx | 2 +- .../widgets/varPopup/menuFilters.ts | 2 +- .../pipelineProtocol/runHeadlessPipeline.ts | 8 +-- .../pipelineProtocol/runRendererPipeline.ts | 10 ++-- ...makeIntegrationContextFromDependencies.ts} | 12 ++--- src/pageEditor/tabs/effect/BrickPreview.tsx | 4 +- .../tabs/effect/useDocumentPreviewRunBlock.ts | 4 +- ...ext.test.ts => integrationContext.test.ts} | 50 +++++++++---------- .../pipelineTests/pipelineTestHelpers.ts | 2 +- .../pipelineTests/validateInput.test.ts | 6 +-- src/runtime/reducePipeline.ts | 12 ++--- .../button/buttonStarterBrick.ts | 14 +++--- .../contextMenu/contextMenuStarterBrick.ts | 11 ++-- .../dynamicQuickBarStarterBrick.tsx | 8 +-- .../quickBar/quickBarStarterBrick.tsx | 11 ++-- .../sidebar/sidebarStarterBrick.ts | 8 +-- .../trigger/triggerStarterBrick.ts | 4 +- src/tsconfig.strictNullChecks.json | 4 +- src/types/runtimeTypes.ts | 18 ++++--- 23 files changed, 107 insertions(+), 102 deletions(-) rename src/integrations/util/{makeIntegrationsContextFromDependencies.ts => makeIntegrationContextFromDependencies.ts} (93%) rename src/runtime/pipelineTests/{integrationsContext.test.ts => integrationContext.test.ts} (88%) diff --git a/eslint-local-rules/persistBackgroundData.txt b/eslint-local-rules/persistBackgroundData.txt index 68eace236d..407fe61284 100644 --- a/eslint-local-rules/persistBackgroundData.txt +++ b/eslint-local-rules/persistBackgroundData.txt @@ -161,7 +161,6 @@ ./src/integrations/util/getModDefinitionIntegrationIds.ts ./src/integrations/util/getUnconfiguredComponentIntegrations.ts ./src/integrations/util/locateSanitizedIntegrationConfigWithRetry.ts -./src/integrations/util/makeServiceContextFromDependencies.ts ./src/integrations/util/permissionsHelpers.ts ./src/modDefinitions/modDefinitionPermissionsHelpers.ts ./src/modDefinitions/modDefinitionsTypes.ts diff --git a/src/analysis/analysisVisitors/varAnalysis/varAnalysis.ts b/src/analysis/analysisVisitors/varAnalysis/varAnalysis.ts index b28af2568d..7bc8f95b45 100644 --- a/src/analysis/analysisVisitors/varAnalysis/varAnalysis.ts +++ b/src/analysis/analysisVisitors/varAnalysis/varAnalysis.ts @@ -52,7 +52,7 @@ import { } from "@/utils/expressionUtils"; import { MOD_VARIABLE_REFERENCE } from "@/runtime/extendModVariableContext"; import { joinPathParts } from "@/utils/formUtils"; -import makeIntegrationsContextFromDependencies from "@/integrations/util/makeIntegrationsContextFromDependencies"; +import makeIntegrationContextFromDependencies from "@/integrations/util/makeIntegrationContextFromDependencies"; import { getOutputReference, isOutputKey } from "@/runtime/runtimeTypes"; import { assertNotNullish } from "@/utils/nullishUtils"; import { BusinessError } from "@/errors/businessErrors"; @@ -103,7 +103,7 @@ export enum KnownSources { /** * Integration configuration. */ - SERVICE = "service", + INTEGRATION = "integration", /** * Observed trace when running the bricks with the Page Editor open. */ @@ -112,7 +112,7 @@ export enum KnownSources { /** * Set availability of variables based on the integrations used by the ModComponentBase - * @see makeIntegrationsContextFromDependencies + * @see makeIntegrationContextFromDependencies */ async function setIntegrationDependencyVars( { integrationDependencies = [] }: ModComponentFormState, @@ -121,12 +121,12 @@ async function setIntegrationDependencyVars( // Loop through all the dependencies, so we can set the source for each dependency variable properly await Promise.all( integrationDependencies.map(async (integrationDependency) => { - const serviceContext = await makeIntegrationsContextFromDependencies([ + const integrationContext = await makeIntegrationContextFromDependencies([ integrationDependency, ]); contextVars.setExistenceFromValues({ - source: `${KnownSources.SERVICE}:${integrationDependency.integrationId}`, - values: serviceContext, + source: `${KnownSources.INTEGRATION}:${integrationDependency.integrationId}`, + values: integrationContext, }); }), ); diff --git a/src/bricks/transformers/brickFactory.ts b/src/bricks/transformers/brickFactory.ts index 46d6c10f98..e57e458116 100644 --- a/src/bricks/transformers/brickFactory.ts +++ b/src/bricks/transformers/brickFactory.ts @@ -335,8 +335,8 @@ class UserDefinedBrick extends BrickABC { input: argsWithClosures, // OptionsArgs are set at the blueprint level. For user-defined bricks, are passed via brick inputs optionsArgs: undefined, - // Services are passed as inputs to the brick - serviceContext: undefined, + // Integration configurations are passed as inputs to the brick + integrationContext: undefined, root: options.root, }; diff --git a/src/bricks/transformers/controlFlow/IfElse.test.ts b/src/bricks/transformers/controlFlow/IfElse.test.ts index 39a07c2643..a68f202ee7 100644 --- a/src/bricks/transformers/controlFlow/IfElse.test.ts +++ b/src/bricks/transformers/controlFlow/IfElse.test.ts @@ -152,7 +152,7 @@ describe("IfElse", () => { root: document.createElement("div"), input: {}, optionsArgs: {}, - serviceContext: {}, + integrationContext: {}, }, reduceOptionsFactory("v3"), ); diff --git a/src/components/fields/schemaFields/widgets/varPopup/SourceLabel.tsx b/src/components/fields/schemaFields/widgets/varPopup/SourceLabel.tsx index 444da8db6d..c14b4918c0 100644 --- a/src/components/fields/schemaFields/widgets/varPopup/SourceLabel.tsx +++ b/src/components/fields/schemaFields/widgets/varPopup/SourceLabel.tsx @@ -36,7 +36,7 @@ const SourceLabel: React.FunctionComponent = ({ break; } - case KnownSources.SERVICE: { + case KnownSources.INTEGRATION: { label = "Integrations"; break; } diff --git a/src/components/fields/schemaFields/widgets/varPopup/menuFilters.ts b/src/components/fields/schemaFields/widgets/varPopup/menuFilters.ts index 92766c51ed..9eea880c95 100644 --- a/src/components/fields/schemaFields/widgets/varPopup/menuFilters.ts +++ b/src/components/fields/schemaFields/widgets/varPopup/menuFilters.ts @@ -59,7 +59,7 @@ function toVarPath(value: string | null): string[] { export function excludeIntegrationVariables(options: MenuOptions): MenuOptions { return options.filter(([source]) => { const [kind] = source.split(":"); - return (kind as KnownSources) !== KnownSources.SERVICE; + return (kind as KnownSources) !== KnownSources.INTEGRATION; }); } diff --git a/src/contentScript/pipelineProtocol/runHeadlessPipeline.ts b/src/contentScript/pipelineProtocol/runHeadlessPipeline.ts index 228cb6f485..e30e776e04 100644 --- a/src/contentScript/pipelineProtocol/runHeadlessPipeline.ts +++ b/src/contentScript/pipelineProtocol/runHeadlessPipeline.ts @@ -18,7 +18,7 @@ import { type RunPipelineParams } from "@/contentScript/pipelineProtocol/types"; import { getPlatform } from "@/platform/platformContext"; import { reducePipeline } from "@/runtime/reducePipeline"; -import { type IntegrationsContext } from "@/types/runtimeTypes"; +import { type IntegrationContext } from "@/types/runtimeTypes"; import { expectContext } from "@/utils/expectContext"; /** @@ -41,11 +41,11 @@ export async function runHeadlessPipeline({ // Pass undefined here to force the runtime to handle correctly. Passing `document` here wouldn't make sense because // it would be the page that contains the React tree (i.e., the frame of the sidebar) root: undefined, - // `reducePipeline` just spreads the serviceContext. If we needed to pick out the actual services we could do the + // `reducePipeline` just spreads the integrationContext. If we needed to pick out the actual services we could do the // following. However, we actually want to pass through the rest of the context and we don't have an affordance // for that in the InitialValues type - // pickBy(context, (value: unknown) => isPlainObject(value) && ("__service" in (value as UnknownObject))) as ServiceContext - serviceContext: context as IntegrationsContext, + // pickBy(context, (value: unknown) => isPlainObject(value) && ("__service" in (value as UnknownObject))) as IntegrationContext + integrationContext: context as IntegrationContext, }, { ...options, diff --git a/src/contentScript/pipelineProtocol/runRendererPipeline.ts b/src/contentScript/pipelineProtocol/runRendererPipeline.ts index 1bddb3c62c..788dcf148a 100644 --- a/src/contentScript/pipelineProtocol/runRendererPipeline.ts +++ b/src/contentScript/pipelineProtocol/runRendererPipeline.ts @@ -2,7 +2,7 @@ import { reducePipeline } from "@/runtime/reducePipeline"; import { expectContext } from "@/utils/expectContext"; import { HeadlessModeError } from "@/bricks/errors"; import { BusinessError } from "@/errors/businessErrors"; -import { type IntegrationsContext } from "@/types/runtimeTypes"; +import { type IntegrationContext } from "@/types/runtimeTypes"; import { type RendererRunPayload } from "@/types/rendererTypes"; import { getPlatform } from "@/platform/platformContext"; import { type RunPipelineParams } from "@/contentScript/pipelineProtocol/types"; @@ -37,11 +37,11 @@ export async function runRendererPipeline({ // Pass undefined here to force the runtime to handle correctly. Passing `document` here wouldn't make sense because // it would be the page that contains the React tree (i.e., the frame of the sidebar) root: undefined, - // `reducePipeline` just spreads the serviceContext. If we needed to pick out the actual services we could do the - // following. However, we actually want to pass through the rest of the context and we don't have an affordance - // for that in the InitialValues type + // `reducePipeline` just spreads the integrationContext. If we needed to pick out the actual integration + // configurations, we could do the following. However, we actually want to pass through the rest of the + // context and we don't have an affordance for that in the InitialValues type // pickBy(context, (value: unknown) => isPlainObject(value) && ("__service" in (value as UnknownObject))) as ServiceContext - serviceContext: context as IntegrationsContext, + integrationContext: context as IntegrationContext, }, { logger: getPlatform().logger.childLogger(messageContext), diff --git a/src/integrations/util/makeIntegrationsContextFromDependencies.ts b/src/integrations/util/makeIntegrationContextFromDependencies.ts similarity index 93% rename from src/integrations/util/makeIntegrationsContextFromDependencies.ts rename to src/integrations/util/makeIntegrationContextFromDependencies.ts index 11c184785a..895fcba459 100644 --- a/src/integrations/util/makeIntegrationsContextFromDependencies.ts +++ b/src/integrations/util/makeIntegrationContextFromDependencies.ts @@ -20,8 +20,8 @@ import { type IntegrationDependency } from "@/integrations/integrationTypes"; import { type IntegrationDependencyVarRef, - type IntegrationsContext, - type IntegrationsContextValue, + type IntegrationContext, + type IntegrationContextValue, } from "@/types/runtimeTypes"; import findSanitizedIntegrationConfigWithRetry from "@/integrations/util/findSanitizedIntegrationConfigWithRetry"; import { pickBy } from "lodash"; @@ -38,7 +38,7 @@ async function dependencyContextValue({ }: { integrationId: RegistryId; configId: UUID; -}): Promise { +}): Promise { // Should be safe to call locateWithRetry in parallel b/c the locator.refresh() method debounces/coalesces // the promise const integrationConfig = await findSanitizedIntegrationConfigWithRetry( @@ -56,13 +56,13 @@ async function dependencyContextValue({ } /** Build the integrations context by locating the dependencies */ -export default async function makeIntegrationsContextFromDependencies( +export default async function makeIntegrationContextFromDependencies( // `ModComponentBase.integrationDependencies` is an optional field. Since we don't have strict-nullness checking on, calls to this method // are error-prone. So just be defensive in the signature // https://github.com/pixiebrix/pixiebrix-extension/issues/3262 dependencies: Nullishable, -): Promise { - const context: IntegrationsContext = {}; +): Promise { + const context: IntegrationContext = {}; if (dependencies == null || dependencies.length === 0) { return context; diff --git a/src/pageEditor/tabs/effect/BrickPreview.tsx b/src/pageEditor/tabs/effect/BrickPreview.tsx index e82faad608..e6f6b51722 100644 --- a/src/pageEditor/tabs/effect/BrickPreview.tsx +++ b/src/pageEditor/tabs/effect/BrickPreview.tsx @@ -40,7 +40,7 @@ import { type Brick } from "@/types/brickTypes"; import { type ApiVersion, type BrickArgsContext } from "@/types/runtimeTypes"; import { type IntegrationDependency } from "@/integrations/integrationTypes"; import { type BaseStarterBrickState } from "@/pageEditor/store/editor/baseFormStateTypes"; -import makeIntegrationsContextFromDependencies from "@/integrations/util/makeIntegrationsContextFromDependencies"; +import makeIntegrationContextFromDependencies from "@/integrations/util/makeIntegrationContextFromDependencies"; import type { FetchableAsyncState } from "@/types/sliceTypes"; import useAsyncState from "@/hooks/useAsyncState"; import { inspectedTab } from "@/pageEditor/context/connection"; @@ -178,7 +178,7 @@ const BrickPreview: React.FunctionComponent<{ }, context: { ...context, - ...(await makeIntegrationsContextFromDependencies( + ...(await makeIntegrationContextFromDependencies( integrationDependencies, )), }, diff --git a/src/pageEditor/tabs/effect/useDocumentPreviewRunBlock.ts b/src/pageEditor/tabs/effect/useDocumentPreviewRunBlock.ts index d43a3beadc..9bc7d88b6c 100644 --- a/src/pageEditor/tabs/effect/useDocumentPreviewRunBlock.ts +++ b/src/pageEditor/tabs/effect/useDocumentPreviewRunBlock.ts @@ -35,7 +35,7 @@ import { selectActiveModComponentTraceForBrick } from "@/pageEditor/store/runtim import { type UUID } from "@/types/stringTypes"; import { type BrickArgsContext } from "@/types/runtimeTypes"; import { isExpression } from "@/utils/expressionUtils"; -import makeIntegrationsContextFromDependencies from "@/integrations/util/makeIntegrationsContextFromDependencies"; +import makeIntegrationContextFromDependencies from "@/integrations/util/makeIntegrationContextFromDependencies"; import useAsyncState from "@/hooks/useAsyncState"; import { inspectedTab } from "@/pageEditor/context/connection"; import { assertNotNullish } from "@/utils/nullishUtils"; @@ -146,7 +146,7 @@ export default function useDocumentPreviewRunBlock( ); const { data: integrationContext, isLoading: isLoadingIntegrationContext } = useAsyncState( - makeIntegrationsContextFromDependencies(integrationDependencies), + makeIntegrationContextFromDependencies(integrationDependencies), [integrationDependencies], ); const context = { diff --git a/src/runtime/pipelineTests/integrationsContext.test.ts b/src/runtime/pipelineTests/integrationContext.test.ts similarity index 88% rename from src/runtime/pipelineTests/integrationsContext.test.ts rename to src/runtime/pipelineTests/integrationContext.test.ts index d0fa122d19..8553f962ba 100644 --- a/src/runtime/pipelineTests/integrationsContext.test.ts +++ b/src/runtime/pipelineTests/integrationContext.test.ts @@ -40,7 +40,7 @@ import { PIXIEBRIX_INTEGRATION_ID, PIXIEBRIX_OUTPUT_KEY, } from "@/integrations/constants"; -import makeIntegrationsContextFromDependencies from "@/integrations/util/makeIntegrationsContextFromDependencies"; +import makeIntegrationContextFromDependencies from "@/integrations/util/makeIntegrationContextFromDependencies"; import { toExpression } from "@/utils/expressionUtils"; import { pixiebrixConfigurationFactory } from "@/integrations/util/pixiebrixConfigurationFactory"; import { autoUUIDSequence } from "@/testUtils/factories/stringFactories"; @@ -67,8 +67,8 @@ describe.each([["v1"], ["v2"], ["v3"]])( }), ]; - const serviceContext = - await makeIntegrationsContextFromDependencies(dependencies); + const integrationContext = + await makeIntegrationContextFromDependencies(dependencies); const result = await reducePipeline( { @@ -77,7 +77,7 @@ describe.each([["v1"], ["v2"], ["v3"]])( }, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); @@ -134,8 +134,8 @@ describe.each([["v1"], ["v2"], ["v3"]])( ); const dependencies: IntegrationDependency[] = [dependency1, dependency2]; - const serviceContext = - await makeIntegrationsContextFromDependencies(dependencies); + const integrationContext = + await makeIntegrationContextFromDependencies(dependencies); const result = await reducePipeline( { @@ -144,7 +144,7 @@ describe.each([["v1"], ["v2"], ["v3"]])( }, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); @@ -174,8 +174,8 @@ describe.each([["v1"], ["v2"]])("apiVersion: %s", (apiVersion: ApiVersion) => { pixiebrixIntegrationDependencyFactory(), ]; - const serviceContext = - await makeIntegrationsContextFromDependencies(dependencies); + const integrationContext = + await makeIntegrationContextFromDependencies(dependencies); const result = await reducePipeline( { @@ -184,7 +184,7 @@ describe.each([["v1"], ["v2"]])("apiVersion: %s", (apiVersion: ApiVersion) => { }, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); @@ -211,22 +211,22 @@ describe.each([["v1"], ["v2"]])("apiVersion: %s", (apiVersion: ApiVersion) => { const dependencies: IntegrationDependency[] = [ integrationDependencyFactory({ integrationId: serviceId, - outputKey: validateOutputKey("service"), + outputKey: validateOutputKey("integration"), configId: authId, }), ]; - const serviceContext = - await makeIntegrationsContextFromDependencies(dependencies); + const integrationContext = + await makeIntegrationContextFromDependencies(dependencies); const result = await reducePipeline( { id: identityBrick.id, - config: { data: "@service.prop" }, + config: { data: "@integration.prop" }, }, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); @@ -242,8 +242,8 @@ describe.each([["v3"]])("apiVersion: %s", (apiVersion: ApiVersion) => { pixiebrixIntegrationDependencyFactory(), ]; - const serviceContext = - await makeIntegrationsContextFromDependencies(dependencies); + const integrationContext = + await makeIntegrationContextFromDependencies(dependencies); const result = await reducePipeline( { @@ -254,7 +254,7 @@ describe.each([["v3"]])("apiVersion: %s", (apiVersion: ApiVersion) => { }, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); @@ -284,7 +284,7 @@ describe.each([["v3"]])("apiVersion: %s", (apiVersion: ApiVersion) => { configId: authId, }); - const serviceContext = await makeIntegrationsContextFromDependencies([ + const integrationContext = await makeIntegrationContextFromDependencies([ dependency, ]); @@ -297,7 +297,7 @@ describe.each([["v3"]])("apiVersion: %s", (apiVersion: ApiVersion) => { }, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); @@ -330,24 +330,24 @@ describe.each([["v3"]])("apiVersion: %s", (apiVersion: ApiVersion) => { const dependencies: IntegrationDependency[] = [ integrationDependencyFactory({ integrationId: serviceId, - outputKey: validateOutputKey("service"), + outputKey: validateOutputKey("integration"), configId: authId, }), ]; - const serviceContext = - await makeIntegrationsContextFromDependencies(dependencies); + const integrationContext = + await makeIntegrationContextFromDependencies(dependencies); const result = await reducePipeline( { id: identityBrick.id, config: { - data: toExpression(templateEngine, "{{ @service.prop }}"), + data: toExpression(templateEngine, "{{ @integration.prop }}"), }, }, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); diff --git a/src/runtime/pipelineTests/pipelineTestHelpers.ts b/src/runtime/pipelineTests/pipelineTestHelpers.ts index cfaf276bf7..f3ec9de5e1 100644 --- a/src/runtime/pipelineTests/pipelineTestHelpers.ts +++ b/src/runtime/pipelineTests/pipelineTestHelpers.ts @@ -374,7 +374,7 @@ export function simpleInput(input: UnknownObject): InitialValues { return { input, root: null, - serviceContext: {}, + integrationContext: {}, optionsArgs: {} as OptionsArgs, }; } diff --git a/src/runtime/pipelineTests/validateInput.test.ts b/src/runtime/pipelineTests/validateInput.test.ts index 80d1a17b30..822bd1c6a1 100644 --- a/src/runtime/pipelineTests/validateInput.test.ts +++ b/src/runtime/pipelineTests/validateInput.test.ts @@ -34,7 +34,7 @@ import { metadataFactory } from "@/testUtils/factories/metadataFactory"; import { ContextError } from "@/errors/genericErrors"; import { propertiesToSchema } from "@/utils/schemaUtils"; import { autoUUIDSequence } from "@/testUtils/factories/stringFactories"; -import makeIntegrationsContextFromDependencies from "@/integrations/util/makeIntegrationsContextFromDependencies"; +import makeIntegrationContextFromDependencies from "@/integrations/util/makeIntegrationContextFromDependencies"; import type { SanitizedConfig, SanitizedIntegrationConfig, @@ -191,7 +191,7 @@ describe.each([["v2"], ["v3"]])("apiVersion: %s", (apiVersion: ApiVersion) => { integrationRegistry.register([fromJS(integrationDefinition)]); brickRegistry.register([new IntegrationBrick()]); - const serviceContext = await makeIntegrationsContextFromDependencies([ + const integrationContext = await makeIntegrationContextFromDependencies([ { integrationId: integrationDefinition.metadata.id, configId: config.id, @@ -214,7 +214,7 @@ describe.each([["v2"], ["v3"]])("apiVersion: %s", (apiVersion: ApiVersion) => { pipeline, { ...simpleInput({}), - serviceContext, + integrationContext, }, reduceOptionsFactory(apiVersion), ); diff --git a/src/runtime/reducePipeline.ts b/src/runtime/reducePipeline.ts index f81331d141..539c18a5bc 100644 --- a/src/runtime/reducePipeline.ts +++ b/src/runtime/reducePipeline.ts @@ -62,7 +62,7 @@ import { type BrickArgsContext, type SelectorRoot, type RenderedArgs, - type IntegrationsContext, + type IntegrationContext, type OptionsArgs, type PipelineExpression, type RunMetadata, @@ -147,10 +147,10 @@ export type InitialValues = { */ optionsArgs?: OptionsArgs; /** - * Service credentials provided by the user during activation of an extension + * Integration configuration provided by the user during activation of a mod or via deployment * @see ModComponentBase.services */ - serviceContext?: IntegrationsContext; + integrationContext?: IntegrationContext; /** * The document root for root-aware bricks, including readers * @see Brick.isRootAware @@ -984,13 +984,13 @@ export async function reducePipeline( ): Promise { const options = await applyReduceDefaults(partialOptions); - const { input, root, serviceContext, optionsArgs } = initialValues; + const { input, root, integrationContext, optionsArgs } = initialValues; const { explicitDataFlow, logger: pipelineLogger, abortSignal } = options; let localVariableContext: BrickArgsContext = { - // Put serviceContext first to prevent overriding the input/options - ...serviceContext, + // Put integrationContext first to prevent overriding the input/options + ...integrationContext, "@input": input, "@options": optionsArgs ?? {}, } as unknown as BrickArgsContext; diff --git a/src/starterBricks/button/buttonStarterBrick.ts b/src/starterBricks/button/buttonStarterBrick.ts index 9a8e8421cf..82c9c7f62e 100644 --- a/src/starterBricks/button/buttonStarterBrick.ts +++ b/src/starterBricks/button/buttonStarterBrick.ts @@ -76,7 +76,7 @@ import { type UUID } from "@/types/stringTypes"; import { type Reader } from "@/types/bricks/readerTypes"; import initialize from "@/vendors/jQueryInitialize"; import { $safeFind } from "@/utils/domUtils"; -import makeIntegrationsContextFromDependencies from "@/integrations/util/makeIntegrationsContextFromDependencies"; +import makeIntegrationContextFromDependencies from "@/integrations/util/makeIntegrationContextFromDependencies"; import { ReusableAbortController, onAbort } from "abort-utils"; import { CONTENT_SCRIPT_CAPABILITIES, @@ -512,13 +512,13 @@ export abstract class ButtonStarterBrickABC extends StarterBrickABC; @@ -263,19 +269,19 @@ export type BrickArgs< */ export type RenderedArgs = Tagged; -export type IntegrationsContextValue = { +export type IntegrationContextValue = { // NOTE: this is not a nominal type brand. The `__service` key is actually used in the runtime. __service: SanitizedIntegrationConfig; [prop: string]: string | SanitizedIntegrationConfig | null; }; /** - * Integrations context passed to bricks. + * Integration configuration context passed to each brick. * @see BrickArgsContext */ -export type IntegrationsContext = Record< +export type IntegrationContext = Record< IntegrationDependencyVarRef, - IntegrationsContextValue | null + IntegrationContextValue | null >; /** @@ -335,7 +341,7 @@ export type BrickOptions< platform: PlatformProtocol; /** - * The variable context, e.g., @input, @options, service definitions, and any output keys from other bricks + * The variable context, e.g., @input, @options, integration configurations, and any output keys from other bricks * * @see BrickArgsContext */