@columnus/api-cli 0.1.56 → 0.1.59
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/dist/cli.js +20 -26
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7452,7 +7452,7 @@ var DISPLAYABLE_VECTOR_CONTENT_TYPE_SET = new Set(
|
|
|
7452
7452
|
);
|
|
7453
7453
|
|
|
7454
7454
|
// ../shared/src/assetGraph.ts
|
|
7455
|
-
var MAX_RENDER_MEGAPIXELS =
|
|
7455
|
+
var MAX_RENDER_MEGAPIXELS = 500;
|
|
7456
7456
|
var MAX_RENDER_PIXELS = MAX_RENDER_MEGAPIXELS * 1e6;
|
|
7457
7457
|
var ASSET_PROCESSING_STATUSES = ["ready", "pending", "failed", "dead_letter"];
|
|
7458
7458
|
|
|
@@ -7576,9 +7576,8 @@ function generateSchemaTs(manifest, opts) {
|
|
|
7576
7576
|
const includeManifestTable = opts?.includeManifestTable ?? true;
|
|
7577
7577
|
const includeAuditTable = opts?.includeAuditTable ?? true;
|
|
7578
7578
|
const includeDisplayValuesTable = opts?.includeDisplayValuesTable ?? true;
|
|
7579
|
-
const assetFieldIds = opts?.assetFieldIds ?? "assets";
|
|
7580
7579
|
const userTables = [...manifest.tables].sort((a, b) => a.name.localeCompare(b.name));
|
|
7581
|
-
const userBody = userTables.map((t) => ` ${t.name}: ${renderTable(t
|
|
7580
|
+
const userBody = userTables.map((t) => ` ${t.name}: ${renderTable(t)},`).join("\n");
|
|
7582
7581
|
let body;
|
|
7583
7582
|
if (includeColumnusTables) {
|
|
7584
7583
|
const columnusSource = columnusTablesSource({
|
|
@@ -7594,15 +7593,14 @@ function generateSchemaTs(manifest, opts) {
|
|
|
7594
7593
|
const banner = includeColumnusTables ? BANNER : CONSUMER_BANNER;
|
|
7595
7594
|
const schemaBody = body ? `${body}
|
|
7596
7595
|
` : "";
|
|
7597
|
-
const schemaOpts = opts?.schemaValidation === false ? ", { schemaValidation: false }" : "";
|
|
7598
7596
|
return `${banner}import { defineSchema, defineTable } from "convex/server";
|
|
7599
7597
|
import { v } from "convex/values";
|
|
7600
7598
|
|
|
7601
7599
|
export default defineSchema({
|
|
7602
|
-
${schemaBody}}
|
|
7600
|
+
${schemaBody}});
|
|
7603
7601
|
`;
|
|
7604
7602
|
}
|
|
7605
|
-
function renderTable(t
|
|
7603
|
+
function renderTable(t) {
|
|
7606
7604
|
const fields = isAssetTable(t) ? [
|
|
7607
7605
|
...t.fields,
|
|
7608
7606
|
{
|
|
@@ -7613,7 +7611,7 @@ function renderTable(t, assetFieldIds) {
|
|
|
7613
7611
|
] : t.fields;
|
|
7614
7612
|
const fieldsBlock = fields.length ? `{
|
|
7615
7613
|
${fields.map((f) => {
|
|
7616
|
-
const inner = renderType(f.type
|
|
7614
|
+
const inner = renderType(f.type);
|
|
7617
7615
|
const value = f.optional ? `v.optional(${inner})` : inner;
|
|
7618
7616
|
return ` ${f.name}: ${value},`;
|
|
7619
7617
|
}).join("\n")}
|
|
@@ -7637,20 +7635,7 @@ ${fields.map((f) => {
|
|
|
7637
7635
|
}
|
|
7638
7636
|
return out;
|
|
7639
7637
|
}
|
|
7640
|
-
function
|
|
7641
|
-
const assetId = `v.id(${JSON.stringify(ASSETS_TABLE_NAME)})`;
|
|
7642
|
-
switch (assetFieldIds) {
|
|
7643
|
-
case "storage-or-assets":
|
|
7644
|
-
return `v.union(v.id("_storage"), ${assetId})`;
|
|
7645
|
-
case "assets":
|
|
7646
|
-
return assetId;
|
|
7647
|
-
default: {
|
|
7648
|
-
const _exhaustive = assetFieldIds;
|
|
7649
|
-
return _exhaustive;
|
|
7650
|
-
}
|
|
7651
|
-
}
|
|
7652
|
-
}
|
|
7653
|
-
function renderType(t, assetFieldIds) {
|
|
7638
|
+
function renderType(t) {
|
|
7654
7639
|
switch (t.kind) {
|
|
7655
7640
|
case "string":
|
|
7656
7641
|
case "markdown":
|
|
@@ -7672,24 +7657,24 @@ function renderType(t, assetFieldIds) {
|
|
|
7672
7657
|
return "v.bytes()";
|
|
7673
7658
|
case "file":
|
|
7674
7659
|
case "image":
|
|
7675
|
-
return
|
|
7660
|
+
return `v.id(${JSON.stringify(ASSETS_TABLE_NAME)})`;
|
|
7676
7661
|
case "id":
|
|
7677
7662
|
return `v.id(${JSON.stringify(t.table)})`;
|
|
7678
7663
|
case "literal":
|
|
7679
7664
|
return `v.literal(${JSON.stringify(t.value)})`;
|
|
7680
7665
|
case "array":
|
|
7681
|
-
return `v.array(${renderType(t.element
|
|
7666
|
+
return `v.array(${renderType(t.element)})`;
|
|
7682
7667
|
case "object": {
|
|
7683
7668
|
if (t.fields.length === 0) return `v.object({})`;
|
|
7684
7669
|
const inner = t.fields.map((f) => {
|
|
7685
|
-
const inner2 = renderType(f.type
|
|
7670
|
+
const inner2 = renderType(f.type);
|
|
7686
7671
|
const value = f.optional ? `v.optional(${inner2})` : inner2;
|
|
7687
7672
|
return `${f.name}: ${value}`;
|
|
7688
7673
|
}).join(", ");
|
|
7689
7674
|
return `v.object({ ${inner} })`;
|
|
7690
7675
|
}
|
|
7691
7676
|
case "union":
|
|
7692
|
-
return `v.union(${t.options.map((option) => renderType(option
|
|
7677
|
+
return `v.union(${t.options.map((option) => renderType(option)).join(", ")})`;
|
|
7693
7678
|
}
|
|
7694
7679
|
throw new Error(`unknown field kind: ${t.kind}`);
|
|
7695
7680
|
}
|
|
@@ -7738,6 +7723,7 @@ var apiProfilesSchema = external_exports.array(apiProfileSnapshotSchema);
|
|
|
7738
7723
|
function editorAccessEnabled(access2) {
|
|
7739
7724
|
return access2.editorAccess === true;
|
|
7740
7725
|
}
|
|
7726
|
+
var MEDIA_LIBRARY_JOURNAL_TTL_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
7741
7727
|
|
|
7742
7728
|
// ../api-codegen/src/generate-documents.ts
|
|
7743
7729
|
function fieldTypeToTs(type) {
|
|
@@ -8130,6 +8116,13 @@ export const createAssetFromStorageRef = anyApi.columnus.assets.createAssetFromS
|
|
|
8130
8116
|
string
|
|
8131
8117
|
>;
|
|
8132
8118
|
|
|
8119
|
+
export const replaceAssetFromStorageRef = anyApi.columnus.assets.replaceAssetFromStorage as FunctionReference<
|
|
8120
|
+
"mutation",
|
|
8121
|
+
"public",
|
|
8122
|
+
{ assetId: string; storageId: string; filename: string },
|
|
8123
|
+
null
|
|
8124
|
+
>;
|
|
8125
|
+
|
|
8133
8126
|
export const listAssetsRef = anyApi.columnus.assets.listAssets as FunctionReference<
|
|
8134
8127
|
"query",
|
|
8135
8128
|
"public",
|
|
@@ -8234,6 +8227,7 @@ export const cmsHostRefs = {
|
|
|
8234
8227
|
generateUploadUrl: generateUploadUrlRef,
|
|
8235
8228
|
deleteStorageFile: deleteStorageFileRef,
|
|
8236
8229
|
createAssetFromStorage: createAssetFromStorageRef,
|
|
8230
|
+
replaceAssetFromStorage: replaceAssetFromStorageRef,
|
|
8237
8231
|
listAssets: listAssetsRef,
|
|
8238
8232
|
addProfileToAsset: addProfileToAssetRef,
|
|
8239
8233
|
getAssetSettings: getAssetSettingsRef,
|
|
@@ -8456,7 +8450,7 @@ var cleanupStateValidator = v.object({
|
|
|
8456
8450
|
});
|
|
8457
8451
|
|
|
8458
8452
|
// ../shared/src/assetJobs.ts
|
|
8459
|
-
var ASSET_JOB_LEASE_MS =
|
|
8453
|
+
var ASSET_JOB_LEASE_MS = 15 * 6e4;
|
|
8460
8454
|
var ASSET_JOB_BACKOFF_MS = [15e3, 6e4, 5 * 6e4, 60 * 6e4];
|
|
8461
8455
|
|
|
8462
8456
|
// ../shared/src/assetSettings.ts
|