@forklaunch/core 4.1.1 → 4.3.0
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/bin/gateway-mock/routes/payments.mjs +5 -2
- package/lib/agent/agent.d.ts +14 -0
- package/lib/agent/agent.d.ts.map +1 -1
- package/lib/agent/approvals.d.ts +52 -0
- package/lib/agent/approvals.d.ts.map +1 -0
- package/lib/agent/continuation.d.ts +28 -3
- package/lib/agent/continuation.d.ts.map +1 -1
- package/lib/agent/index.d.ts +4 -2
- package/lib/agent/index.d.ts.map +1 -1
- package/lib/agent/index.js +191 -50
- package/lib/agent/index.js.map +1 -1
- package/lib/agent/index.mjs +185 -49
- package/lib/agent/index.mjs.map +1 -1
- package/lib/agent/types.d.ts +22 -2
- package/lib/agent/types.d.ts.map +1 -1
- package/lib/http/index.d.ts +2 -0
- package/lib/http/index.d.ts.map +1 -1
- package/lib/http/index.js +610 -221
- package/lib/http/index.js.map +1 -1
- package/lib/http/index.mjs +607 -222
- package/lib/http/index.mjs.map +1 -1
- package/lib/http/mcpGenerator/mcpAuth.d.ts +52 -0
- package/lib/http/mcpGenerator/mcpAuth.d.ts.map +1 -0
- package/lib/http/mcpGenerator/mcpGenerator.d.ts +2 -1
- package/lib/http/mcpGenerator/mcpGenerator.d.ts.map +1 -1
- package/lib/http/mcpGenerator/mcpHttpHandler.d.ts +14 -1
- package/lib/http/mcpGenerator/mcpHttpHandler.d.ts.map +1 -1
- package/lib/http/mcpGenerator/mcpOAuth.d.ts +110 -0
- package/lib/http/mcpGenerator/mcpOAuth.d.ts.map +1 -0
- package/lib/http/paymentsClient.d.ts +6 -0
- package/lib/http/paymentsClient.d.ts.map +1 -1
- package/lib/http/telemetry/pinoLogger.d.ts +2 -1
- package/lib/http/telemetry/pinoLogger.d.ts.map +1 -1
- package/lib/http/types/expressLikeOptions.d.ts +8 -0
- package/lib/http/types/expressLikeOptions.d.ts.map +1 -1
- package/lib/persistence/index.d.ts +1 -0
- package/lib/persistence/index.d.ts.map +1 -1
- package/lib/persistence/index.js +39 -0
- package/lib/persistence/index.js.map +1 -1
- package/lib/persistence/index.mjs +38 -0
- package/lib/persistence/index.mjs.map +1 -1
- package/lib/persistence/migrationLock.d.ts +61 -0
- package/lib/persistence/migrationLock.d.ts.map +1 -0
- package/package.json +5 -4
|
@@ -2107,6 +2107,43 @@ function wrapEmWithTenantContext(em, tenantId) {
|
|
|
2107
2107
|
function rebind(result, target, proxy) {
|
|
2108
2108
|
return result === target ? proxy : result;
|
|
2109
2109
|
}
|
|
2110
|
+
|
|
2111
|
+
// src/persistence/migrationLock.ts
|
|
2112
|
+
async function runMigrationsWithLock(orm, options = {}) {
|
|
2113
|
+
const run = options.run ?? (() => {
|
|
2114
|
+
const migrator = orm.migrator ?? orm.getMigrator?.();
|
|
2115
|
+
if (!migrator) {
|
|
2116
|
+
throw new Error(
|
|
2117
|
+
"runMigrationsWithLock: the ORM has no Migrator extension; add `extensions: [Migrator]` to the config"
|
|
2118
|
+
);
|
|
2119
|
+
}
|
|
2120
|
+
return migrator.up();
|
|
2121
|
+
});
|
|
2122
|
+
const log = options.log ?? (() => void 0);
|
|
2123
|
+
const isPostgres = orm.em.getPlatform().getDefaultSchemaName?.() === "public";
|
|
2124
|
+
if (!isPostgres) {
|
|
2125
|
+
await run();
|
|
2126
|
+
return;
|
|
2127
|
+
}
|
|
2128
|
+
const connection = orm.em.getConnection();
|
|
2129
|
+
await connection.transactional(async (trx) => {
|
|
2130
|
+
const name = options.lockName ?? `${(await connection.execute(
|
|
2131
|
+
"select current_database() as name",
|
|
2132
|
+
[],
|
|
2133
|
+
"get",
|
|
2134
|
+
trx
|
|
2135
|
+
)).name}:migrations`;
|
|
2136
|
+
log(`[migrations] waiting for lock ${name}`);
|
|
2137
|
+
await connection.execute(
|
|
2138
|
+
"select pg_advisory_xact_lock(hashtext(?))",
|
|
2139
|
+
[name],
|
|
2140
|
+
"run",
|
|
2141
|
+
trx
|
|
2142
|
+
);
|
|
2143
|
+
log(`[migrations] holding lock ${name}`);
|
|
2144
|
+
await run();
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2110
2147
|
export {
|
|
2111
2148
|
Anon,
|
|
2112
2149
|
BLIND_INDEX_PREFIX,
|
|
@@ -2166,6 +2203,7 @@ export {
|
|
|
2166
2203
|
reencryptEncryptedColumns,
|
|
2167
2204
|
registerEncryptor,
|
|
2168
2205
|
rotationTotals,
|
|
2206
|
+
runMigrationsWithLock,
|
|
2169
2207
|
sealedAnon,
|
|
2170
2208
|
setEncryptionTenantId,
|
|
2171
2209
|
setupRls,
|