Fix StartOS 0.4 TypeScript packaging to match SDK API

This commit is contained in:
MacPro
2026-04-09 15:10:44 -05:00
parent 68ec875ee7
commit 8298c083c7
3436 changed files with 867051 additions and 92 deletions
+67
View File
@@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VersionInfo = exports.IMPOSSIBLE = void 0;
/**
* Sentinel value indicating that a migration in a given direction is not possible.
* Use this for `migrations.up` or `migrations.down` to prevent migration.
*/
exports.IMPOSSIBLE = Symbol('IMPOSSIBLE');
/**
* Represents a single version of the service, including its release notes,
* migration scripts, and backwards-compatibility declarations.
*
* By convention, each version gets its own file (e.g. `versions/v1_0_0.ts`).
*
* @typeParam Version - The string literal exver version number
*/
class VersionInfo {
constructor(options) {
this.options = options;
this._version = null;
}
/**
* @description Use this function to define a new version of the service. By convention, each version should receive its own file.
* @property {string} version
* @property {string} releaseNotes
* @property {object} migrations
* @returns A VersionInfo class instance that is exported, then imported into versions/index.ts.
*/
static of(options) {
return new VersionInfo({ ...options, satisfies: [] });
}
/** Specify a version that this version is 100% backwards compatible to */
satisfies(version) {
return new VersionInfo({
...this.options,
satisfies: [...this.options.satisfies, version],
});
}
}
exports.VersionInfo = VersionInfo;
function __type_tests() {
const version = VersionInfo.of({
version: '1.0.0:0',
releaseNotes: '',
migrations: {},
})
.satisfies('#other:1.0.0:0')
.satisfies('#other:2.0.0:0')
// @ts-expect-error
.satisfies('#other:2.f.0:0');
let a = version;
// @ts-expect-error
let b = version;
VersionInfo.of({
// @ts-expect-error
version: 'test',
releaseNotes: '',
migrations: {},
});
VersionInfo.of({
// @ts-expect-error
version: 'test',
releaseNotes: '',
migrations: {},
});
}
//# sourceMappingURL=VersionInfo.js.map