@sequenceholdings/orm 2.6.2 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -1
- package/dist/authoring.cjs +9 -0
- package/dist/authoring.cjs.map +1 -1
- package/dist/authoring.d.cts +6 -0
- package/dist/authoring.d.ts +6 -0
- package/dist/authoring.js +9 -0
- package/dist/authoring.js.map +1 -1
- package/dist/cli.cjs +89 -29
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +89 -29
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +4 -1
- package/dist/client.d.ts +4 -1
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs +68 -29
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.js +68 -29
- package/dist/compiler.js.map +1 -1
- package/dist/index.cjs +82 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +81 -5
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs +19 -3
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.d.cts +13 -6
- package/dist/ir.d.ts +13 -6
- package/dist/ir.js +18 -4
- package/dist/ir.js.map +1 -1
- package/dist/predicate-v2.cjs +24 -2
- package/dist/predicate-v2.cjs.map +1 -1
- package/dist/predicate-v2.d.cts +4 -0
- package/dist/predicate-v2.d.ts +4 -0
- package/dist/predicate-v2.js +24 -2
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +16 -2
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.js +16 -2
- package/dist/sdl.js.map +1 -1
- package/package.json +1 -1
- package/src/codegen-gql/preset.cjs +45 -8
- package/templates/orm-namespace/codegen.ts +5 -0
package/dist/cli.cjs
CHANGED
|
@@ -1462,14 +1462,21 @@ function normalizeCanonical(definition) {
|
|
|
1462
1462
|
var BUILTIN_SQL_READ_HASH = "sha256:a50c477c952a5e0fe68ed158a4530e4aab573c09bcbb1a8ac454dc88a39a6258";
|
|
1463
1463
|
|
|
1464
1464
|
// src/ir/index.ts
|
|
1465
|
-
var IR_VERSION =
|
|
1465
|
+
var IR_VERSION = 6;
|
|
1466
1466
|
var LEGACY_IR_VERSION = 1;
|
|
1467
1467
|
var GUARDED_IR_VERSION = 2;
|
|
1468
1468
|
var COMPOSED_IR_VERSION = 3;
|
|
1469
1469
|
var SQL_IR_VERSION = 4;
|
|
1470
1470
|
var RUNTIME_SQL_IR_VERSION = 5;
|
|
1471
|
-
var
|
|
1471
|
+
var SERVICE_PRINCIPAL_IR_VERSION = 6;
|
|
1472
|
+
var irVersionSchema = zod.z.union([zod.z.literal(LEGACY_IR_VERSION), zod.z.literal(GUARDED_IR_VERSION), zod.z.literal(COMPOSED_IR_VERSION), zod.z.literal(SQL_IR_VERSION), zod.z.literal(RUNTIME_SQL_IR_VERSION), zod.z.literal(SERVICE_PRINCIPAL_IR_VERSION)]);
|
|
1472
1473
|
var operationVersionSchema = zod.z.object({ irVersion: irVersionSchema });
|
|
1474
|
+
function usesServicePrincipal(value) {
|
|
1475
|
+
if (value === null || typeof value !== "object") return false;
|
|
1476
|
+
if (Array.isArray(value)) return value.some(usesServicePrincipal);
|
|
1477
|
+
const row = value;
|
|
1478
|
+
return row.kind === "servicePrincipal" || Object.values(row).some(usesServicePrincipal);
|
|
1479
|
+
}
|
|
1473
1480
|
function requiredArtifactIrVersion(operations) {
|
|
1474
1481
|
let required = LEGACY_IR_VERSION;
|
|
1475
1482
|
for (const operation of operations) {
|
|
@@ -1529,6 +1536,7 @@ var predIrSchema = zod.z.lazy(
|
|
|
1529
1536
|
zod.z.object({ kind: zod.z.literal("capability"), key: zod.z.string(), namespace: zod.z.string().optional() }),
|
|
1530
1537
|
zod.z.object({ kind: zod.z.literal("role"), key: zod.z.string(), namespace: zod.z.string().optional() }),
|
|
1531
1538
|
zod.z.object({ kind: zod.z.literal("dynamicFilter"), slot: zod.z.string() }),
|
|
1539
|
+
zod.z.object({ kind: zod.z.literal("servicePrincipal") }).strict(),
|
|
1532
1540
|
zod.z.object({ kind: zod.z.literal("const"), value: zod.z.boolean() })
|
|
1533
1541
|
])
|
|
1534
1542
|
);
|
|
@@ -1754,7 +1762,7 @@ var variableIrSchema = zod.z.object({
|
|
|
1754
1762
|
/** Absent = no default declared; see {@link variableDefaultIrSchema}. */
|
|
1755
1763
|
defaultValue: variableDefaultIrSchema.optional()
|
|
1756
1764
|
});
|
|
1757
|
-
var sqlColumnSchema = zod.z.object({ name: zod.z.string(), type: zod.z.enum(["text", "boolean", "integer", "bigint", "numeric", "double", "uuid", "date", "timestamptz"]), nullable: zod.z.boolean() });
|
|
1765
|
+
var sqlColumnSchema = zod.z.object({ name: zod.z.string(), type: zod.z.enum(["text", "boolean", "integer", "bigint", "numeric", "double", "uuid", "date", "timestamptz", "jsonb"]), nullable: zod.z.boolean() });
|
|
1758
1766
|
var compiledOperationSchema = zod.z.object({
|
|
1759
1767
|
language: zod.z.literal("sql").optional(),
|
|
1760
1768
|
/** Server-compiled object catalog and permission ceiling, never caller SQL. */
|
|
@@ -1792,6 +1800,9 @@ var compiledOperationSchema = zod.z.object({
|
|
|
1792
1800
|
tableSet: zod.z.array(zod.z.string()).min(1),
|
|
1793
1801
|
roots: zod.z.array(rootIrSchema)
|
|
1794
1802
|
}).superRefine((operation, ctx) => {
|
|
1803
|
+
if (operation.irVersion < SERVICE_PRINCIPAL_IR_VERSION && usesServicePrincipal(operation.roots)) {
|
|
1804
|
+
ctx.addIssue({ code: "custom", message: "servicePrincipal() requires IR v6" });
|
|
1805
|
+
}
|
|
1795
1806
|
if (operation.language === "sql") {
|
|
1796
1807
|
const validPlan = operation.sqlQuery ? !operation.sql && operation.irVersion === RUNTIME_SQL_IR_VERSION : !!operation.sql && operation.irVersion === SQL_IR_VERSION;
|
|
1797
1808
|
const builtin = operation.name === "BuiltinSqlRead" && operation.opHash === BUILTIN_SQL_READ_HASH && operation.requires === null;
|
|
@@ -1924,6 +1935,9 @@ var compiledArtifactSchema = zod.z.object({
|
|
|
1924
1935
|
tables: zod.z.record(zod.z.string(), tableMetaIrSchema),
|
|
1925
1936
|
operations: zod.z.record(zod.z.string(), compiledOperationSchema)
|
|
1926
1937
|
}).superRefine((artifact, ctx) => {
|
|
1938
|
+
if (artifact.irVersion < SERVICE_PRINCIPAL_IR_VERSION && usesServicePrincipal(artifact)) {
|
|
1939
|
+
ctx.addIssue({ code: "custom", message: "servicePrincipal() requires IR v6" });
|
|
1940
|
+
}
|
|
1927
1941
|
if (Object.keys(artifact.dependencies ?? {}).length > 0 && artifact.irVersion < COMPOSED_IR_VERSION) {
|
|
1928
1942
|
ctx.addIssue({ code: "custom", path: ["irVersion"], message: "cross-namespace dependencies require IR v3" });
|
|
1929
1943
|
}
|
|
@@ -2232,6 +2246,12 @@ var Parser2 = class {
|
|
|
2232
2246
|
}
|
|
2233
2247
|
return node;
|
|
2234
2248
|
}
|
|
2249
|
+
if (this.peekKeyword("servicePrincipal") && this.tokens[this.index + 1]?.kind === "lparen") {
|
|
2250
|
+
this.advance();
|
|
2251
|
+
this.expect("lparen", "'(' after servicePrincipal");
|
|
2252
|
+
this.expect("rparen", "')' closing servicePrincipal()");
|
|
2253
|
+
return { kind: "servicePrincipal" };
|
|
2254
|
+
}
|
|
2235
2255
|
if (this.peekKeyword("exists")) return this.parseExists();
|
|
2236
2256
|
if (this.peekKeyword("visible") && this.tokens[this.index + 1]?.kind === "lparen") return this.parseVisible();
|
|
2237
2257
|
return this.parseComparison();
|
|
@@ -2444,6 +2464,8 @@ var PolicyCompiler = class _PolicyCompiler {
|
|
|
2444
2464
|
return { kind: "capability", key: node.key };
|
|
2445
2465
|
case "role":
|
|
2446
2466
|
return { kind: "role", key: node.key };
|
|
2467
|
+
case "servicePrincipal":
|
|
2468
|
+
return { kind: "servicePrincipal" };
|
|
2447
2469
|
case "exists":
|
|
2448
2470
|
return this.compileExists(node.path, node.where, table, depth);
|
|
2449
2471
|
case "visible":
|
|
@@ -3108,7 +3130,10 @@ function platformUserMeta() {
|
|
|
3108
3130
|
{ name: "role", columnName: "role", type: "text", nullable: true },
|
|
3109
3131
|
{ name: "managerId", columnName: "manager_id", type: "text", nullable: true },
|
|
3110
3132
|
// NOT NULL DEFAULT true on chat.users, so non-null through the view.
|
|
3111
|
-
{ name: "accountEnabled", columnName: "account_enabled", type: "boolean", nullable: false }
|
|
3133
|
+
{ name: "accountEnabled", columnName: "account_enabled", type: "boolean", nullable: false },
|
|
3134
|
+
{ name: "canonicalSub", columnName: "canonical_sub", type: "text", nullable: false },
|
|
3135
|
+
{ name: "normalizedEmail", columnName: "normalized_email", type: "text", nullable: true },
|
|
3136
|
+
{ name: "emailDomain", columnName: "email_domain", type: "text", nullable: true }
|
|
3112
3137
|
];
|
|
3113
3138
|
return {
|
|
3114
3139
|
table: "users_directory",
|
|
@@ -5095,7 +5120,7 @@ function compileNamespace({ canonical, sdl, documents }) {
|
|
|
5095
5120
|
}
|
|
5096
5121
|
}
|
|
5097
5122
|
operations[restricted.name] = {
|
|
5098
|
-
irVersion: canonical.imports?.length ? COMPOSED_IR_VERSION : roots.some((root) => root.kind === "mutation" && root.assertAffectedRows !== void 0) ? GUARDED_IR_VERSION : LEGACY_IR_VERSION,
|
|
5123
|
+
irVersion: usesServicePrincipal(roots) ? SERVICE_PRINCIPAL_IR_VERSION : canonical.imports?.length ? COMPOSED_IR_VERSION : roots.some((root) => root.kind === "mutation" && root.assertAffectedRows !== void 0) ? GUARDED_IR_VERSION : LEGACY_IR_VERSION,
|
|
5099
5124
|
name: restricted.name,
|
|
5100
5125
|
opHash: computeOpHash({ definition: flattened, schemaHash }),
|
|
5101
5126
|
kind: restricted.kind,
|
|
@@ -5122,7 +5147,7 @@ function compileNamespace({ canonical, sdl, documents }) {
|
|
|
5122
5147
|
}
|
|
5123
5148
|
if (diagnostics.some((d) => d.severity === "error")) return { ok: false, diagnostics };
|
|
5124
5149
|
const artifact = {
|
|
5125
|
-
irVersion: canonical.imports?.length ? COMPOSED_IR_VERSION : requiredArtifactIrVersion(Object.values(operations)),
|
|
5150
|
+
irVersion: usesServicePrincipal([...ctx.readPolicies.values(), ...ctx.writePolicies.values(), ...ctx.insertPolicies.values(), ...ctx.updatePolicies.values(), ...Object.values(operations)]) ? SERVICE_PRINCIPAL_IR_VERSION : canonical.imports?.length ? COMPOSED_IR_VERSION : requiredArtifactIrVersion(Object.values(operations)),
|
|
5126
5151
|
namespace: ctx.namespace,
|
|
5127
5152
|
schemaHash,
|
|
5128
5153
|
ownSchemaHash: computeSchemaHash(localContract(canonical)),
|
|
@@ -5176,6 +5201,8 @@ function compilePredIrToSql(pred, options = {}) {
|
|
|
5176
5201
|
return `(NOT ${compilePredIrToSql(pred.operand, options)})`;
|
|
5177
5202
|
case "cmp":
|
|
5178
5203
|
return compileCmp(pred.op, pred.column, pred.value, options);
|
|
5204
|
+
case "servicePrincipal":
|
|
5205
|
+
return `coalesce(${claimExpression("servicePrincipal")} = 'true', false)`;
|
|
5179
5206
|
case "capability":
|
|
5180
5207
|
return `(${options.statementClaimChecks ? "SELECT " : ""}${capabilityExpression(pred.key, pred.namespace ?? options.namespace)})`;
|
|
5181
5208
|
case "role":
|
|
@@ -5278,6 +5305,39 @@ function compileArrayValue(value, columnType, _options) {
|
|
|
5278
5305
|
return columnType ? `${array}::${sqlTypeName(columnType)}[]` : array;
|
|
5279
5306
|
}
|
|
5280
5307
|
|
|
5308
|
+
// src/compiler/static-policy-sql.ts
|
|
5309
|
+
function compileStaticPolicySql({ table, predicate, tables, namespace, alias, rootRelation, statementClaimChecks, onRead }) {
|
|
5310
|
+
let sequence = 0;
|
|
5311
|
+
const aliases = new Set([alias, rootRelation].filter((value) => value !== void 0));
|
|
5312
|
+
const column = (meta, qualifier, name2) => {
|
|
5313
|
+
const found = meta.columns.find((c) => c.name === name2 || c.columnName === name2);
|
|
5314
|
+
if (!found) throw new OrmDefinitionError("Static policy relationship column is unavailable");
|
|
5315
|
+
return `${quoteIdentifier(qualifier)}.${quoteIdentifier(found.columnName)}`;
|
|
5316
|
+
};
|
|
5317
|
+
const render = (meta, pred, qualifier, outerRelation) => compilePredIrToSql(pred, {
|
|
5318
|
+
alias: qualifier,
|
|
5319
|
+
namespace: meta.namespace ?? namespace,
|
|
5320
|
+
statementClaimChecks,
|
|
5321
|
+
columnNames: Object.fromEntries(meta.columns.map((c) => [c.name, c.columnName])),
|
|
5322
|
+
columnTypes: Object.fromEntries(meta.columns.map((c) => [c.name, c.type])),
|
|
5323
|
+
exists: (node) => {
|
|
5324
|
+
const link = meta.links.find((candidate) => candidate.name === node.link);
|
|
5325
|
+
const target = link?.target ? tables[link.target] : void 0;
|
|
5326
|
+
const parent = qualifier ?? outerRelation;
|
|
5327
|
+
if (!link || !target || !parent) throw new OrmDefinitionError("Static policy relationship metadata is unavailable");
|
|
5328
|
+
onRead?.(target);
|
|
5329
|
+
let child;
|
|
5330
|
+
do {
|
|
5331
|
+
child = `policy_${++sequence}`;
|
|
5332
|
+
} while (aliases.has(child));
|
|
5333
|
+
aliases.add(child);
|
|
5334
|
+
const join5 = link.kind === "toMany" ? `${column(target, child, link.on)} = ${column(meta, parent, link.references)}` : `${column(meta, parent, link.on)} = ${column(target, child, link.references)}`;
|
|
5335
|
+
return `EXISTS (SELECT 1 FROM ${quoteIdentifier(target.schema)}.${quoteIdentifier(target.table)} AS ${quoteIdentifier(child)} WHERE ${join5} AND (${render(target, node.where, child)}))`;
|
|
5336
|
+
}
|
|
5337
|
+
});
|
|
5338
|
+
return render(table, predicate, alias, rootRelation);
|
|
5339
|
+
}
|
|
5340
|
+
|
|
5281
5341
|
// src/sql/catalog.ts
|
|
5282
5342
|
function sqlHash(value) {
|
|
5283
5343
|
return `sha256:${crypto.createHash("sha256").update(value).digest("hex")}`;
|
|
@@ -5298,27 +5358,6 @@ function createSqlCatalog({ canonical, publishedObjects, executionTarget }) {
|
|
|
5298
5358
|
const meta = Object.values(ctx.tables).find((table) => refOf(table) === ref);
|
|
5299
5359
|
if (!meta || internal.has(ref) || meta.namespace !== canonical.namespace && !meta.exportRead) throw new Error(`SQL object not published: ${ref}`);
|
|
5300
5360
|
const reads = /* @__PURE__ */ new Set([ref]);
|
|
5301
|
-
let sequence = 0;
|
|
5302
|
-
const predicate = (table, pred, alias) => compilePredIrToSql(pred, {
|
|
5303
|
-
alias,
|
|
5304
|
-
namespace: table.namespace ?? canonical.namespace,
|
|
5305
|
-
columnNames: Object.fromEntries(table.columns.map((c) => [c.name, c.columnName])),
|
|
5306
|
-
columnTypes: Object.fromEntries(table.columns.map((c) => [c.name, c.type])),
|
|
5307
|
-
exists: (node) => {
|
|
5308
|
-
const link = table.links.find((candidate) => candidate.name === node.link);
|
|
5309
|
-
const target = link?.target ? ctx.tables[link.target] : void 0;
|
|
5310
|
-
if (!link || !target) throw new Error("SQL policy link is unavailable");
|
|
5311
|
-
reads.add(refOf(target));
|
|
5312
|
-
const child = `p${++sequence}`;
|
|
5313
|
-
const col = (t2, a, name2) => {
|
|
5314
|
-
const c = t2.columns.find((c2) => c2.name === name2 || c2.columnName === name2);
|
|
5315
|
-
if (!c) throw new Error("SQL policy column is unavailable");
|
|
5316
|
-
return `${quoteIdentifier(a)}.${quoteIdentifier(c.columnName)}`;
|
|
5317
|
-
};
|
|
5318
|
-
const join5 = link.kind === "toMany" ? `${col(target, child, link.on)} = ${col(table, alias, link.references)}` : `${col(table, alias, link.on)} = ${col(target, child, link.references)}`;
|
|
5319
|
-
return `EXISTS (SELECT 1 FROM ${quoteIdentifier(target.schema)}.${quoteIdentifier(target.table)} AS ${quoteIdentifier(child)} WHERE ${join5} AND (${predicate(target, node.where, child)}))`;
|
|
5320
|
-
}
|
|
5321
|
-
});
|
|
5322
5361
|
const columns = meta.columns.filter((c) => meta.filterable.includes(c.name)).map((c) => ({
|
|
5323
5362
|
name: c.name,
|
|
5324
5363
|
type: typeof c.type === "string" ? c.type : "text",
|
|
@@ -5329,7 +5368,7 @@ function createSqlCatalog({ canonical, publishedObjects, executionTarget }) {
|
|
|
5329
5368
|
return `${quoteIdentifier("p0")}.${quoteIdentifier(physical.columnName)}${typeof physical.type === "object" ? "::text" : ""} AS ${quoteIdentifier(c.name)}`;
|
|
5330
5369
|
}).join(", ");
|
|
5331
5370
|
const policy = ctx.readPolicies.get(meta.table) ?? { kind: "const", value: true };
|
|
5332
|
-
const scan = `SELECT ${projection} FROM ${quoteIdentifier(meta.schema)}.${quoteIdentifier(meta.table)} AS ${quoteIdentifier("p0")} WHERE ${
|
|
5371
|
+
const scan = `SELECT ${projection} FROM ${quoteIdentifier(meta.schema)}.${quoteIdentifier(meta.table)} AS ${quoteIdentifier("p0")} WHERE ${compileStaticPolicySql({ table: meta, predicate: policy, tables: ctx.tables, namespace: canonical.namespace, alias: "p0", onRead: (target) => reads.add(refOf(target)) })}`;
|
|
5333
5372
|
return { ref, table: meta.table, columns, scan, read: [...reads].sort() };
|
|
5334
5373
|
});
|
|
5335
5374
|
return { identity, objects };
|
|
@@ -5953,7 +5992,7 @@ async function managedViewDiagnostics(canonical) {
|
|
|
5953
5992
|
}
|
|
5954
5993
|
|
|
5955
5994
|
// src/sql/codegen.ts
|
|
5956
|
-
var typeOf = (type) => ["integer", "double"].includes(type) ? "number" : type === "boolean" ? "boolean" : "string";
|
|
5995
|
+
var typeOf = (type) => ["integer", "double"].includes(type) ? "number" : type === "boolean" ? "boolean" : type === "jsonb" ? "unknown" : "string";
|
|
5957
5996
|
function generateSqlOperations({ artifact }) {
|
|
5958
5997
|
const dynamic = Object.values(artifact.operations).some((op) => op.sqlQuery);
|
|
5959
5998
|
const lines = [
|
|
@@ -5990,6 +6029,15 @@ ${variables}
|
|
|
5990
6029
|
return `${lines.join("\n").trimEnd()}
|
|
5991
6030
|
`;
|
|
5992
6031
|
}
|
|
6032
|
+
|
|
6033
|
+
// src/runtime-capabilities.ts
|
|
6034
|
+
function assertServicePrincipalRuntime(value) {
|
|
6035
|
+
const row = value !== null && typeof value === "object" ? value : {};
|
|
6036
|
+
const predicates = row.policyPredicates;
|
|
6037
|
+
if (typeof row.maxIrVersion !== "number" || row.maxIrVersion < 6 || !Array.isArray(predicates) || !predicates.includes("servicePrincipal")) {
|
|
6038
|
+
throw new Error("The target ORM runtime does not support servicePrincipal() / IR v6; deploy the reviewed runtime before applying this namespace");
|
|
6039
|
+
}
|
|
6040
|
+
}
|
|
5993
6041
|
var ENUM_BRAND = "seq-enum";
|
|
5994
6042
|
function isEnumRef(value) {
|
|
5995
6043
|
return typeof value === "object" && value !== null && value.kind === ENUM_BRAND;
|
|
@@ -6241,6 +6289,11 @@ function serializeNamespace(input) {
|
|
|
6241
6289
|
enumsByName.set(ref.name, ref);
|
|
6242
6290
|
}
|
|
6243
6291
|
const canonicalTables = tables.map((table) => buildCanonicalTable({ table, relationsByName, enumsByName }));
|
|
6292
|
+
for (const table of tables) {
|
|
6293
|
+
if (table.source !== void 0 && table.config.internal === true && config.exports && Object.hasOwn(config.exports, table.tableName)) {
|
|
6294
|
+
throw new OrmDefinitionError(`internal synced source "${table.tableName}" cannot be exported; export a permitted managed view instead`, table.file);
|
|
6295
|
+
}
|
|
6296
|
+
}
|
|
6244
6297
|
const canonicalEnums = [...enumsByName.values()].map((ref) => ({
|
|
6245
6298
|
name: ref.name,
|
|
6246
6299
|
values: [...ref.values]
|
|
@@ -6574,6 +6627,9 @@ function buildCanonicalLink({
|
|
|
6574
6627
|
if (!relationsByName.has(targetName)) {
|
|
6575
6628
|
return fail4(`targets ${relationKind(target)} "${targetName}" which is not part of this namespace`);
|
|
6576
6629
|
}
|
|
6630
|
+
if (isSeqTable(target) && target.source !== void 0 && target.config.internal === true) {
|
|
6631
|
+
return fail4(`targets internal synced source "${targetName}"; expose a permitted managed view instead`);
|
|
6632
|
+
}
|
|
6577
6633
|
if (link.enforce && (!isSeqTable(relation) || !isSeqTable(target))) {
|
|
6578
6634
|
return fail4("cannot enforce a PostgreSQL foreign key involving a view");
|
|
6579
6635
|
}
|
|
@@ -11965,6 +12021,10 @@ async function applyV2Command(rest, dir) {
|
|
|
11965
12021
|
}
|
|
11966
12022
|
const { loaded, sdl, documents, manifest } = compiled.project;
|
|
11967
12023
|
const namespace = loaded.canonical.namespace;
|
|
12024
|
+
if (compiled.project.artifact.irVersion >= SERVICE_PRINCIPAL_IR_VERSION || usesServicePrincipal(compiled.project.artifact)) {
|
|
12025
|
+
const support = await apiRequestStrict("GET", "/api/orm/runtime-capabilities");
|
|
12026
|
+
assertServicePrincipalRuntime(support);
|
|
12027
|
+
}
|
|
11968
12028
|
const workspace = await readMigrationWorkspace(dir, namespace);
|
|
11969
12029
|
const migration = await loadCommittedTipMigrationV2({ dir, loaded, workspace });
|
|
11970
12030
|
const registered = await apiRequestStrict("POST", "/api/orm/namespaces", {
|