Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions bin/pos-cli-fetch-logs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env node

const { program } = require('commander');
const Gateway = require('../lib/proxy');
const fetchSettings = require('../lib/settings').fetchSettings;
const logger = require('../lib/logger');
import { program } from 'commander';
import Gateway from '../lib/proxy.js';
import { fetchSettings } from '../lib/settings.js';

program
.name('pos-cli fetch-logs')
Expand All @@ -13,7 +12,7 @@ program
.option('-q, --quiet', 'suppress non-log output')
.action(async (environment, options) => {
try {
const authData = fetchSettings(environment);
const authData = await fetchSettings(environment);
if (!authData) {
console.error('No auth data available. Set environment or MPKIT_* env vars.');
process.exit(2);
Expand Down
Binary file removed gui/admin/dist/dupa.png
Binary file not shown.
Binary file removed gui/admin/static/dupa.png
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/initilizeEsmModules.js

This file was deleted.

5 changes: 1 addition & 4 deletions mcp-min/__tests__/json-to-csv.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { vi, describe, test, expect, beforeAll, afterAll, beforeEach, afterEach } from 'vitest';
import { jsonToZipBuffer } from '../data/json-to-csv.js';
import { createRequire } from 'module';
import unzipper from 'unzipper';
import { Readable } from 'stream';

const require = createRequire(import.meta.url);
const unzipper = require('unzipper');

async function extractZipEntries(buffer) {
const entries = {};
const directory = await unzipper.Open.buffer(buffer);
Expand Down
19 changes: 6 additions & 13 deletions mcp-min/__tests__/tools.test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import os from 'os';
import path from 'path';
import fs from 'fs';
import { vi, describe, test, expect, beforeEach, afterEach } from 'vitest';
import singleFileModule, { computeRemotePath, normalizeLocalPath, toPosix } from '../sync/single-file.js';

const os = require('os');
const path = require('path');
const fs = require('fs');
const { pathToFileURL } = require('url');
let singleFile;
let singleFileTool;
let computeRemotePath, normalizeLocalPath, toPosix;
beforeAll(async () => {
const mod = await import(pathToFileURL(path.resolve(process.cwd(), 'mcp-min', 'sync', 'single-file.js')).href);
singleFile = mod;
singleFileTool = mod.default;
({ computeRemotePath, normalizeLocalPath, toPosix } = mod);
});
const singleFileTool = singleFileModule;

// Basic unit tests for helper functions and dry-run behavior

Expand Down
6 changes: 2 additions & 4 deletions mcp-min/data/validate-schemas.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Schema loading utility for platformOS data validation
// Loads schema files from app/schema/ or app/model_schemas/

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const fs = require('fs');
const path = require('path');
import fs from 'fs';
import path from 'path';

/**
* Simple YAML parser for platformOS schema format
Expand Down
7 changes: 2 additions & 5 deletions mcp-min/data/validate-tool.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// platformos.data.validate - Validate JSON data against platformOS schemas
import { createRequire } from 'module';
import fs from 'fs';
import path from 'path';
import { validateRecords, validateJsonStructure } from './validate.js';
import log from '../log.js';

const require = createRequire(import.meta.url);
const fs = require('fs');
const path = require('path');

const dataValidateTool = {
description: 'Validate JSON data against platformOS schemas before import. Checks required fields (id, type, properties, created_at, updated_at), verifies types match schema files in app/schema/, and validates property names and types.',
inputSchema: {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@platformos/pos-cli",
"version": "6.0.3",
"version": "6.0.4",
"description": "Manage your platformOS application",
"type": "module",
"imports": {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('Server errors', () => {
test('Error in model', async () => {
const { stderr } = await run('incorrect_model');
expect(stderr).toMatch(
'Validation failed: Attribute type `foo` is not allowed. Valid attribute types: string, integer, float, decimal, datetime, time, date, binary, boolean, array, address, file, photo, text, geojson, upload'
'Attribute type `foo` is not allowed. Valid attribute types: string, integer, float, decimal, datetime, time, date, binary, boolean, array, address, file, photo, text, geojson, upload'
);
});

Expand Down
Loading