@upstart.gg/sdk
Version:
You can test the CLI without recompiling by running:
35 lines (33 loc) • 1.49 kB
TypeScript
import { Datasource } from "./datasources/types.js";
import * as _sinclair_typebox7927 from "@sinclair/typebox";
import { Static, TArray } from "@sinclair/typebox";
//#region src/shared/datasources.d.ts
/**
* For now, defineDatasources() force the usage of a custom (internal) datasource
* @returns
*/
declare function defineDatasource<D extends Datasource>(datasource: D): D & {
provider: string;
schema: any;
};
declare const datasourceSystemProperties: _sinclair_typebox7927.TObject<{
$id: _sinclair_typebox7927.TOptional<_sinclair_typebox7927.TString>;
$publicationDate: _sinclair_typebox7927.TOptional<_sinclair_typebox7927.TString>;
$slug: _sinclair_typebox7927.TOptional<_sinclair_typebox7927.TString>;
$lastModificationDate: _sinclair_typebox7927.TOptional<_sinclair_typebox7927.TString>;
}>;
type DatasourceSystemProperties = Static<typeof datasourceSystemProperties>;
/**
* Map a datasource schema to include $id, $createdAt, and $updatedAt properties.
*/
declare function mapDatasourceSchemaWithInternalProperties(schema: TArray): Datasource["schema"];
/**
* Extract the indexed fields of a datasource with their titles
*/
declare function getDatasourceIndexedFieldsWithTitles(datasource: Datasource): {
value: string;
title: any;
}[];
//#endregion
export { DatasourceSystemProperties, datasourceSystemProperties, defineDatasource, getDatasourceIndexedFieldsWithTitles, mapDatasourceSchemaWithInternalProperties };
//# sourceMappingURL=datasources.d.ts.map