StagedSchemaUpgradePolicyFactory Interface
Provides factory methods for creating StagedSchemaUpgradePolicy instances.
To use, import via fluid-framework/alpha.
For more information about our API support guarantees, see here.
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:
- restrictive — no staged upgrades (default)
- permissive — all staged upgrades enabled
- enabledStagedUpgrades(upgrades) — only specific upgrades enabled
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
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| permissive | Alpha | readonly | StagedSchemaUpgradePolicy | Permissive policy — includes all staged schema upgrades. |
| restrictive | Alpha | readonly | StagedSchemaUpgradePolicy | Restrictive policy — excludes all staged schema members. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| enabledStagedUpgrades(upgrades) | Alpha | StagedSchemaUpgradePolicy | Creates options that include only the specified staged schema upgrades. |
Property Details
permissive
Permissive policy — includes all staged schema upgrades.
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.
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.
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
| Parameter | Type | Description |
|---|---|---|
| upgrades | SchemaUpgrade[] | The staged schema upgrades to enable. |
Returns
Options that include only the specified upgrades.
Return type: StagedSchemaUpgradePolicy