Skip to content
SumOfficeSumOfficeSumOffice

Types: Power Query

Compute Contract type definitions — queries, steps, connectors, source privacy, and mashups. Names: 86.

Definitions of the names from the “TypeScript type” column on the operation pages.

Other dictionary topics: session, workbook, and sheets · cells and ranges · formulas and calculation · formatting · data and sheet objects · pivot tables · charts and graphics · printing and page layout · Power Query · VBA and macros · protection and review · general and utility.

Types on this page — 86
interface AppliedStep {
stepId: string;
displayName: string;
canonicalM: string;
span: MWireSpan;
inputs: string[];
kind: "source" | "transform" | "output";
astNodeId?: string;
}
interface AppliedStepsProjection {
queryStableId: string;
steps: AppliedStep[];
canonicalM: string;
diagnostics: InspectorDiagnostic[];
foldExplainPlan?: FoldExplainPlan;
}
interface ApprovedMacroDescriptor {
macroId: string;
displayName: string;
entrypoint: string;
scope: ApprovedMacroScope;
sourceLabel: string;
sourceText: string;
mode: ApprovedMacroExecutionMode;
summary: string;
effectRangeA1: string;
limitations: string[];
}
type ApprovedMacroExecutionMode = "approved-demo";
type ApprovedMacroScope = "workbook-local";
interface ApprovedODataFeedDescriptor {
serviceUrl: string;
approvedHeaders?: [string, string][];
timeoutMs: number;
maxResponseBytes: number;
maxPageCount: number;
maxTotalRows: number;
queryOptions?: ODataQueryOptions;
credential: ODataFeedCredential;
testAllowlist?: WebSourceTestAllowlist;
}
type ApprovedSourceDescriptor =
| ({ kind: "workbook" } & WorkbookSourceDescriptor)
| ({ kind: "file" } & FileSourceDescriptor)
| ({ kind: "folder" } & FolderSourceDescriptor);
interface ApprovedWebConnectorDescriptor {
source: ApprovedWebSourceDescriptor;
relativePath?: string;
query?: ApprovedWebConnectorHeader[];
headers?: ApprovedWebConnectorHeader[];
cacheRetry?: WebConnectorCacheRetryPolicy;
credentialMode?: WebConnectorCredentialMode;
credentialScope?: WebConnectorCredentialScope;
}
interface ApprovedWebConnectorHeader {
name: string;
value: string;
}
interface ApprovedWebSourceDescriptor {
url: string;
workbookId: string;
queryId?: string;
timeoutMs?: number;
revoked?: boolean;
testAllowlist?: WebSourceTestAllowlist;
}
interface ContractForeignMashupGroup {
id: string;
name?: string;
}
type ContractForeignMashupLoadDestination =
| { mode: "existing_sheet"; sheetName: string; anchor: string }
| { mode: "new_sheet"; sheetName: string }
| { mode: "connection_only" };
interface ContractForeignMashupProjection {
readOnly: boolean;
revision: number;
refused?: ContractForeignMashupRefusal;
queries: ContractForeignMashupQueryEntry[];
groups: ContractForeignMashupGroup[];
connections: ContractWorkbookConnectionEntry[];
loadLinks: ContractWorkbookConnectionLoadLink[];
sourceScopes?: PqSourceScopeWire[];
unknownElements: string[];
sectionName?: string;
sectionDeclarationCount: number;
sectionHasErrors: boolean;
hasConfig: boolean;
}
interface ContractForeignMashupQueryEntry {
identity: string;
name: string;
dependencyIdentities?: string[];
stableGuid?: string;
itemPath?: string;
queryGroupId?: string;
isPrivate?: boolean;
loadEnabled?: boolean;
loadObjectType?: string;
loadToDataModel?: boolean;
resultType?: string;
expressionParseOk?: boolean;
expressionPreview?: string;
expressionSha256?: string;
previewSanitized: boolean;
hasSectionDeclaration: boolean;
}
interface ContractForeignMashupRefreshResult {
status: string;
revision: number;
generation: number;
queryIdentity: string;
valueKind?: string;
rowCount?: number;
columnCount?: number;
packageHash?: string;
code?: string;
detail?: string;
}
interface ContractForeignMashupRefusal {
code: string;
detail: string;
}
type ContractMashupWriteEdit =
| { kind: "replace_expression"; query: string; newExpression: string }
| { kind: "rename_query"; query: string; newName: string }
| { kind: "delete_query"; query: string }
| { kind: "duplicate_query"; query: string; newName: string }
| { kind: "reference_query"; query: string; newName: string }
| { kind: "load_to"; query: string; destination: ContractForeignMashupLoadDestination; }
| { kind: "create_connection";
sourceSubsetId: string;
name: string;
destination: ContractWorkbookConnectionDestination;
refreshOnOpen?: boolean;
}
| { kind: "edit_connection";
connection: string;
sourceSubsetId?: string;
name?: string;
destination?: ContractWorkbookConnectionDestination;
refreshOnOpen?: boolean;
}
| { kind: "rename_connection"; connection: string; newName: string }
| { kind: "delete_connection"; connection: string }
| { kind: "duplicate_connection"; connection: string; newName: string }
| { kind: "reference_connection"; connection: string; newName: string };
interface ContractMashupWriteResult {
status: string;
revision: number;
envelopeHash?: string;
code?: string;
detail?: string;
}
interface ContractPowerQueryCell {
kind: ContractPowerQueryCellKind;
text?: string;
number?: number;
integer?: number;
logical?: boolean;
date?: string;
errorSourceText?: string;
errorTargetType?: string;
}
type ContractPowerQueryCellKind = "null" | "text" | "number" | "integer" | "logical" | "date" | "error";
type ContractPowerQueryTransformOutcome =
| { status: "evaluated";
sourceId: string;
mSource: string;
supportedSubset: string;
columns: string[];
rows: ContractPowerQueryCell[][];
cellErrorCount: number;
}
| { status: "blocked"; sourceId: string; mSource: string; reason: string; detail: string; };
type ContractPrivacyInspectorIntent =
| { action: "scan" }
| { action: "remove_to_copy";
destinationUri: string;
selectedCategories: PrivacyCategory[];
expectedSourceSha256: string;
};
type ContractPrivacyInspectorResult =
| { status: "scanned"; inspection: PrivacyInventoryReport }
| { status: "removed_to_copy"; sanitization: PrivacyMutationReport };
interface ContractQueryDependencyEdge {
dependentStableId: string;
upstreamStableId: string;
}
interface ContractRecomputedQueryStatus {
queryStableId: string;
recomputed: boolean;
}
interface FoldingNativeQuery {
transport: "odata" | "sql" | string;
text: string;
}
interface ODataFeedCredential {
mode?: WebConnectorCredentialMode;
scope: WebConnectorCredentialScope;
}
interface ODataQueryOptions {
select?: string[];
filter?: string;
top?: number;
}
interface PowerQueryInspectorSnapshot {
source: string;
ast?: InspectorAstNode;
bindings: InspectorBinding[];
outcome: InspectorOutcome;
diagnostics: InspectorDiagnostic[];
lineage: InspectorLineage;
foldExplainPlan?: FoldExplainPlan;
foldingVerdict: FoldingVerdict;
}
interface PowerQueryLoadDestination {
mode: PowerQueryLoadMode;
sheetName?: string;
sheet_name?: string;
anchor?: CellAnchor;
}
type PowerQueryLoadMode = "new-sheet" | "current-anchor" | "existing-range" | "connection-only";
interface PowerQueryLoadPlan {
requests: ComputeRequest[];
outputRect: CellRect;
sheetKey: string;
staleClearCount: number;
createdSheet: boolean;
}
interface PqDataSourceEntry {
scopeId: string;
scopeKind: "workbook" | "file" | "folder" | "web" | "odata" | "database";
queryCount: number;
pathChangeable: boolean;
}
interface PqDataSourceSettingsOutcome {
action: string;
requestedScopeId: string;
scopeId?: string;
accepted: boolean;
reason?: string;
workbookChanged: boolean;
}
interface PqPostgresConnectorBounds {
maxPreviewRows?: number;
maxTotalRows?: number;
statementTimeoutMs?: number;
}
interface PqPostgresDeniedWire {
reason: string;
message: string;
}
interface PqPostgresDialogDescriptor {
providerId?: "postgres";
host: string;
port: number;
database: string;
credentialMode?: "stored" | "anonymous";
credentialScope?: WebConnectorCredentialScope;
options?: Record<string, string>;
bounds?: PqPostgresConnectorBounds;
revoked?: boolean;
}
interface PqPostgresInspectHint {
canonicalM: string;
descriptorJson: string;
schema?: string;
item?: string;
}
interface PqPostgresLanGrantWire {
scopeOrigin: string;
allowPrivateNetwork: boolean;
}
interface PqPostgresNavTableWire {
schema: string;
name: string;
kind: string;
}
interface PqPostgresNavigationItemWire {
name: string;
kind: string;
}
interface PqPostgresNavigationSchemaWire {
name: string;
items: PqPostgresNavigationItemWire[];
}
interface PqPostgresPreviewTableRef {
schema: string;
table: string;
}
interface PqPrivacyEvaluationInput {
rootQueryId: string;
graph?: PqPrivacyGraphNode[];
levels?: PqPrivacyLevelAssignment[];
}
interface PqPrivacyGraphNode {
queryId: string;
references?: string[];
parameters?: string[];
dynamicSource?: boolean;
directScopes?: PqSourceScopeWire[];
}
interface PqPrivacyLevelAssignment {
canonicalScope: string;
level: string;
invalid?: boolean;
}
interface PqPrivacyLevelListEntry {
scopeId: string;
scopeKind: "workbook" | "file" | "folder" | "web" | "odata" | "unknown";
displayResource: string;
level: string;
origin: "user-store" | "workbook-declared" | "effective";
reason?: string;
}
interface PqPrivacyLevelWriteOutcome {
canonicalScope: string;
level?: string;
scopeId?: string;
accepted: boolean;
reason?: string;
}
interface PqProductRibbonColumnPayload {
name: string;
inferredType: string;
}
interface PqProductRibbonDenied {
reason: string;
message: string;
}
interface PqProductRibbonQueryPayload {
queryId: string;
sheetName: string;
selectorKind: "table" | "range";
selectorName: string;
columns: PqProductRibbonColumnPayload[];
totalRows: number;
sampledRows: number;
truncated: boolean;
stepCount: number;
canonicalM: string;
editorAvailable: boolean;
loaded: boolean;
loadedQueryStableId?: string;
}
interface PqQueryGraphDiagnostic {
code: string;
nodes: string[];
message: string;
}
interface PqQueryGraphEdge {
from: string;
to: string;
kind: "query-ref" | "parameter-ref" | "source-read" | string;
}
interface PqQueryGraphExplain {
query_stable_id: string;
display_name: string;
dependencies: string[];
plan_availability: string;
fold_explain_plan?: FoldExplainPlan;
folding_verdict: FoldingVerdict;
partition_summary?: PqQueryGraphPartitionSummary;
diagnostics: PqQueryGraphDiagnostic[];
postgres_inspect_hint?: PqPostgresInspectHint;
}
interface PqQueryGraphNode {
id: string;
kind: "query" | "parameter" | "source" | string;
display_name: string;
status: string;
generation: number;
diagnostic_code?: string;
}
interface PqQueryGraphNodePublication {
query_stable_id: string;
load_plan?: PowerQueryLoadPlan;
refresh_outcome: unknown;
persisted_query?: unknown;
}
interface PqQueryGraphPartitionSummary {
transitive_query_ids: string[];
transitive_scope_ids: string[];
}
interface PqQueryGraphRefreshOutcome {
generation: number;
workbook_revision?: number;
states: Record<string, string>;
diagnostics: PqQueryGraphDiagnostic[];
node_reasons?: Record<string, string>;
}
interface PqQueryGraphSnapshot {
schema_version: number;
workbook_revision?: number;
nodes: PqQueryGraphNode[];
edges: PqQueryGraphEdge[];
diagnostics: PqQueryGraphDiagnostic[];
}
type PqScaleBackpressureState = { state: "ready" } | { state: "throttled"; retryAfterMs: number };
interface PqScaleBudget {
maxRows: number;
maxResultBytes: number;
maxRowBytes: number;
maxSpillBytes: number;
maxBatchRows: number;
timeBudgetMs: number;
}
interface PqScaleDenied {
reason: PqScaleDeniedReason;
message: string;
}
type PqScaleDeniedReason =
| "row-budget-exceeded"
| "byte-budget-exceeded"
| "oversized-row"
| "time-budget-exceeded"
| "spill-cap-exceeded"
| "cancelled"
| "superseded"
| "firewall-blocked"
| "unsupported";
interface PqScaleProgressCancelPayload {
cancelled: boolean;
}
interface PqScaleProgressOpenPayload {
sessionId: string;
rowsTotal: number;
budget: PqScaleBudget;
}
interface PqScaleProgressPullPayload {
status: PqScaleProgressStatus;
rowsInBatch: number;
rowsEmitted: number;
rowsTotal: number;
bytesEmitted: number;
backpressure: PqScaleBackpressureState;
elapsedMs: number;
batchesPulled: number;
denied?: PqScaleDenied;
}
interface PqScaleProgressSnapshotPayload {
status: PqScaleProgressStatus;
rowsEmitted: number;
rowsTotal: number;
bytesEmitted: number;
backpressure: PqScaleBackpressureState;
elapsedMs: number;
batchesPulled: number;
denied?: PqScaleDenied;
}
type PqScaleProgressStatus = "batch" | "done" | "denied";
type PqSourceScopeWire =
| { kind: "workbook"; workbookStableId: string }
| { kind: "file"; path: string }
| { kind: "folder"; root: string }
| { kind: "web"; origin: string }
| { kind: "odata"; serviceOrigin: string }
| { kind: "database"; resource: string };
interface PqSqlServerDeniedWire {
reason: string;
message: string;
}
interface PqSqlServerDescriptor {
host: string;
port?: number;
database: string;
user: string;
credentialScope: string;
timeoutMs?: number;
revoked?: boolean;
}
interface PqSqlServerNavigationItemWire {
schema: string;
name: string;
kind: string;
}
interface PqSqlServerTableRef {
schema: string;
table: string;
}
type PrivacyCapabilityState = "remove_live" | "detect_only" | "blocked";
type PrivacyCategory =
| "core_properties"
| "app_properties"
| "custom_properties"
| "custom_xml"
| "thumbnail"
| "document_server_metadata"
| "comments_notes"
| "hidden_sheets"
| "hidden_rows_columns"
| "external_links"
| "custom_views"
| "drawings";
interface PrivacyCategorySummary {
category: PrivacyCategory;
findingCount: number;
capabilityState: PrivacyCapabilityState;
reasonCodes: string[];
}
interface PrivacyFinding {
category: PrivacyCategory;
reasonCode: string;
count: number;
riskLevel: PrivacyRiskLevel;
}
interface PrivacyInventoryReport {
schemaVersion: number;
sourceSha256: string;
signedPackage: boolean;
totalFindingCount: number;
findings: PrivacyFinding[];
categories: PrivacyCategorySummary[];
packageReasonCodes: string[];
}
interface PrivacyMutationReport {
schemaVersion: number;
sourceSha256: string;
outputSha256: string;
removedCategories: PrivacyCategory[];
removedPartCount: number;
modifiedPartCount: number;
after: PrivacyInventoryReport;
}
type PrivacyRiskLevel = "high" | "medium" | "low" | "none";
interface ProductTableRangeRefreshQueryOutcome {
queryStableId: string;
status: "refreshed" | "blocked" | "skipped";
loadPlan?: PowerQueryLoadPlan;
persistedQuery?: unknown;
reason?: string;
detail?: string;
}
interface TableRangeQueryMutationPreview {
mutation: StepMutationResult;
preview: TableRangeQueryPreview;
}
interface TableRangeQueryPreview {
outcome: MExpressionOutcome;
totalRows?: number;
sampledRows?: number;
truncated: boolean;
}
interface WebConnectorCacheRetryPolicy {
cacheEnabled?: boolean;
maxRetries?: number;
}
type WebConnectorCredentialMode = "anonymous" | "webApi";
interface WebConnectorCredentialScope {
origin: string;
queryId?: string;
}

Documentation assistant

Answers are assembled from the documentation and may be inaccurate — check the sources.