1- import { ZodSchemaType , BaseConfigType , BaseSchema } from './schemas.js'
1+ import { ZodSchemaType , BaseConfigType , BaseExtensionConfigType , BaseSchema } from './schemas.js'
22import { ExtensionInstance } from './extension-instance.js'
33import { patchAppRelativeUrls } from './specifications/validation/app_relative_urls.js'
44import { blocks } from '../../constants.js'
@@ -81,7 +81,7 @@ export interface DevSessionUpdateContext {
8181/**
8282 * Extension specification with all the needed properties and methods to load an extension.
8383 */
84- export interface ExtensionSpecification < TConfiguration extends BaseConfigType = BaseConfigType > {
84+ export interface ExtensionSpecification < TConfiguration extends BaseExtensionConfigType = BaseConfigType > {
8585 identifier : string
8686 externalIdentifier : string
8787 externalName : string
@@ -179,7 +179,7 @@ export interface DevSessionWatchConfig {
179179/**
180180 * Extension specification, explicitly marked as having taken remote configuration values into account.
181181 */
182- export type RemoteAwareExtensionSpecification < TConfiguration extends BaseConfigType = BaseConfigType > =
182+ export type RemoteAwareExtensionSpecification < TConfiguration extends BaseExtensionConfigType = BaseConfigType > =
183183 ExtensionSpecification < TConfiguration > & {
184184 loadedRemoteSpecs : true
185185 }
@@ -202,7 +202,7 @@ type ForbiddenFields =
202202/**
203203 * Partial ExtensionSpec type used when creating a new ExtensionSpec, the only mandatory field is the identifier
204204 */
205- interface CreateExtensionSpecType < TConfiguration extends BaseConfigType = BaseConfigType > extends Partial <
205+ interface CreateExtensionSpecType < TConfiguration extends BaseExtensionConfigType = BaseConfigType > extends Partial <
206206 Omit < ExtensionSpecification < TConfiguration > , ForbiddenFields >
207207> {
208208 identifier : string
@@ -229,9 +229,10 @@ interface CreateExtensionSpecType<TConfiguration extends BaseConfigType = BaseCo
229229 * hasExtensionPointTarget?: (configuration: TConfiguration, target: string) => boolean // function to determine if the extension has a given extension point target
230230 * ```
231231 */
232- export function createExtensionSpecification < TConfiguration extends BaseConfigType = BaseConfigType > (
232+ export function createExtensionSpecification < TConfiguration extends BaseExtensionConfigType = BaseConfigType > (
233233 spec : CreateExtensionSpecType < TConfiguration > ,
234234) : ExtensionSpecification < TConfiguration > {
235+ const baseSchema : ZodSchemaType < BaseExtensionConfigType > = BaseSchema
235236 const defaults = {
236237 // these two fields are going to be overridden by the extension specification API response,
237238 // but we need them to have a default value for tests
@@ -240,7 +241,7 @@ export function createExtensionSpecification<TConfiguration extends BaseConfigTy
240241 externalName : capitalize ( spec . identifier . replace ( / _ / g, ' ' ) ) ,
241242 surface : 'test-surface' ,
242243 partnersWebIdentifier : spec . identifier ,
243- schema : BaseSchema as ZodSchemaType < TConfiguration > ,
244+ schema : baseSchema as ZodSchemaType < TConfiguration > ,
244245 registrationLimit : blocks . extensions . defaultRegistrationLimit ,
245246 transform : spec . transformLocalToRemote ,
246247 reverseTransform : spec . transformRemoteToLocal ,
@@ -292,7 +293,9 @@ export function createExtensionSpecification<TConfiguration extends BaseConfigTy
292293 * - App config extensions have default transform and reverseTransform functions
293294
294295 */
295- export function createConfigExtensionSpecification < TConfiguration extends BaseConfigType = BaseConfigType > ( spec : {
296+ export function createConfigExtensionSpecification <
297+ TConfiguration extends BaseExtensionConfigType = BaseConfigType ,
298+ > ( spec : {
296299 identifier : string
297300 schema : ZodSchemaType < TConfiguration >
298301 clientSteps ?: ClientSteps
@@ -325,7 +328,7 @@ export function createConfigExtensionSpecification<TConfiguration extends BaseCo
325328 } )
326329}
327330
328- export function createContractBasedModuleSpecification < TConfiguration extends BaseConfigType = BaseConfigType > (
331+ export function createContractBasedModuleSpecification < TConfiguration extends BaseExtensionConfigType = BaseConfigType > (
329332 spec : Pick <
330333 CreateExtensionSpecType < TConfiguration > ,
331334 | 'identifier'
0 commit comments