Skip to main content
Version: v2

StagedSchemaUpgradePolicyFactory Interface

Provides factory methods for creating StagedSchemaUpgradePolicy instances.

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

For more information about our API support guarantees, see here.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature​

/** @sealed */
export interface StagedSchemaUpgradePolicyFactory

Remarks​

Use the properties and methods on this object to obtain staged-schema generation options for different scenarios:

Example​

// Enable specific upgrades:
const options = StagedSchemaUpgradePolicy.enabledStagedUpgrades(myUpgrade);

// Use restrictive (default, no staged upgrades):
const options = StagedSchemaUpgradePolicy.restrictive;

// Use permissive (all staged upgrades, useful for testing):
const options = StagedSchemaUpgradePolicy.permissive;

Properties​

PropertyAlertsModifiersTypeDescription
permissiveAlphareadonlyStagedSchemaUpgradePolicyPermissive policy — includes all staged schema upgrades.
restrictiveAlphareadonlyStagedSchemaUpgradePolicyRestrictive policy — excludes all staged schema members.

Methods​

MethodAlertsReturn TypeDescription
enabledStagedUpgrades(upgrades)AlphaStagedSchemaUpgradePolicyCreates options that include only the specified staged schema upgrades.

Property Details​

permissive​

Permissive policy — includes all staged schema upgrades.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

readonly permissive: StagedSchemaUpgradePolicy;

Type: StagedSchemaUpgradePolicy

Remarks​

Use this for testing, validation, and rollout rehearsal scenarios where you want to exercise future document shapes before enabling staged upgrades broadly.

restrictive​

Restrictive policy — excludes all staged schema members.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

readonly restrictive: StagedSchemaUpgradePolicy;

Type: StagedSchemaUpgradePolicy

Remarks​

Use this when you want the most conservative stored schema for compatibility-sensitive scenarios, or when staged schema upgrades should remain disabled.

This is the default behavior when no staged upgrades are enabled.

Method Details​

enabledStagedUpgrades​

Creates options that include only the specified staged schema upgrades.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

enabledStagedUpgrades(...upgrades: SchemaUpgrade[]): StagedSchemaUpgradePolicy;

Remarks​

If an empty set of upgrades is passed, the result is equivalent to StagedSchemaUpgradePolicy.restrictive.

Parameters​

ParameterTypeDescription
upgradesSchemaUpgrade[]The staged schema upgrades to enable.

Returns​

Options that include only the specified upgrades.

Return type: StagedSchemaUpgradePolicy