Browse Source

test(playwright): update apps page link

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4134/head
Pranav C 2 years ago
parent
commit
4f7d8a48cb
  1. 2
      packages/nc-gui/components.d.ts
  2. 11
      packages/nocodb/package-lock.json
  3. 1
      packages/nocodb/package.json
  4. 2
      packages/nocodb/src/lib/Noco.ts
  5. 4
      packages/nocodb/src/lib/db/sql-client/lib/KnexClient.ts
  6. 2
      packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts
  7. 2
      packages/nocodb/src/lib/meta/NcMetaMgr.ts
  8. 2
      packages/nocodb/src/lib/meta/NcMetaMgrEE.ts
  9. 2
      packages/nocodb/src/lib/meta/api/apiTokenApis.ts
  10. 2
      packages/nocodb/src/lib/meta/api/attachmentApis.ts
  11. 2
      packages/nocodb/src/lib/meta/api/columnApis.ts
  12. 2
      packages/nocodb/src/lib/meta/api/filterApis.ts
  13. 2
      packages/nocodb/src/lib/meta/api/formViewApis.ts
  14. 2
      packages/nocodb/src/lib/meta/api/formViewColumnApis.ts
  15. 2
      packages/nocodb/src/lib/meta/api/galleryViewApis.ts
  16. 2
      packages/nocodb/src/lib/meta/api/gridViewApis.ts
  17. 2
      packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts
  18. 2
      packages/nocodb/src/lib/meta/api/hookApis.ts
  19. 2
      packages/nocodb/src/lib/meta/api/hookFilterApis.ts
  20. 2
      packages/nocodb/src/lib/meta/api/index.ts
  21. 2
      packages/nocodb/src/lib/meta/api/kanbanViewApis.ts
  22. 2
      packages/nocodb/src/lib/meta/api/metaDiffApis.ts
  23. 2
      packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts
  24. 2
      packages/nocodb/src/lib/meta/api/orgTokenApis.ts
  25. 2
      packages/nocodb/src/lib/meta/api/orgUserApis.ts
  26. 2
      packages/nocodb/src/lib/meta/api/pluginApis.ts
  27. 2
      packages/nocodb/src/lib/meta/api/projectApis.ts
  28. 2
      packages/nocodb/src/lib/meta/api/projectUserApis.ts
  29. 2
      packages/nocodb/src/lib/meta/api/sharedBaseApis.ts
  30. 2
      packages/nocodb/src/lib/meta/api/sortApis.ts
  31. 2
      packages/nocodb/src/lib/meta/api/sync/helpers/job.ts
  32. 2
      packages/nocodb/src/lib/meta/api/sync/syncSourceApis.ts
  33. 2
      packages/nocodb/src/lib/meta/api/tableApis.ts
  34. 2
      packages/nocodb/src/lib/meta/api/userApi/initAdminFromEnv.ts
  35. 2
      packages/nocodb/src/lib/meta/api/userApi/userApis.ts
  36. 2
      packages/nocodb/src/lib/meta/api/viewApis.ts
  37. 2
      packages/nocodb/src/lib/meta/api/viewColumnApis.ts
  38. 2
      packages/nocodb/src/lib/meta/helpers/apiMetrics.ts
  39. 292
      packages/nocodb/src/lib/utils/Tele.ts
  40. 2
      packages/nocodb/src/lib/utils/common/BaseApiBuilder.ts
  41. 2
      packages/nocodb/src/lib/v1-legacy/NcProjectBuilder.ts
  42. 2
      packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts
  43. 2
      packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrlEE.ts
  44. 2
      packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts
  45. 2
      tests/playwright/tests/rolesSuperUser.spec.ts

2
packages/nc-gui/components.d.ts vendored

@ -108,8 +108,6 @@ declare module '@vue/runtime-core' {
MdiAccountOutline: typeof import('~icons/mdi/account-outline')['default']
MdiAccountPlusOutline: typeof import('~icons/mdi/account-plus-outline')['default']
MdiAccountSupervisorOutline: typeof import('~icons/mdi/account-supervisor-outline')['default']
MdiAccountSupervisorOutline: typeof import('~icons/mdi/account-supervisor-outline')['default']
MdiAdd: typeof import('~icons/mdi/add')['default']
MdiAdd: typeof import('~icons/mdi/add')['default']
MdiAlpha: typeof import('~icons/mdi/alpha')['default']
MdiAlphaA: typeof import('~icons/mdi/alpha-a')['default']

11
packages/nocodb/package-lock.json generated

@ -68,7 +68,6 @@
"nc-plugin": "0.1.2",
"ncp": "^2.0.0",
"nocodb-sdk": "file:../nocodb-sdk",
"node-machine-id": "^1.1.12",
"nodemailer": "^6.4.10",
"object-hash": "^3.0.0",
"os-locale": "^5.0.0",
@ -11285,11 +11284,6 @@
"inherits": "2.0.3"
}
},
"node_modules/node-machine-id": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/node-machine-id/-/node-machine-id-1.1.12.tgz",
"integrity": "sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ=="
},
"node_modules/node.extend": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.0.8.tgz",
@ -26951,11 +26945,6 @@
}
}
},
"node-machine-id": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/node-machine-id/-/node-machine-id-1.1.12.tgz",
"integrity": "sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ=="
},
"node.extend": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.0.8.tgz",

1
packages/nocodb/package.json

@ -111,7 +111,6 @@
"nc-plugin": "0.1.2",
"ncp": "^2.0.0",
"nocodb-sdk": "file:../nocodb-sdk",
"node-machine-id": "^1.1.12",
"nodemailer": "^6.4.10",
"object-hash": "^3.0.0",
"os-locale": "^5.0.0",

2
packages/nocodb/src/lib/Noco.ts

@ -18,7 +18,7 @@ import { v4 as uuidv4 } from 'uuid';
import { NcConfig } from '../interface/config';
import Migrator from './db/sql-migrator/lib/KnexMigrator';
import NcConfigFactory from './utils/NcConfigFactory';
import { Tele } from './utils/Tele';
import { Tele } from 'nc-help';
import NcProjectBuilderCE from './v1-legacy/NcProjectBuilder';
import NcProjectBuilderEE from './v1-legacy/NcProjectBuilderEE';

4
packages/nocodb/src/lib/db/sql-client/lib/KnexClient.ts

@ -1,6 +1,6 @@
/* eslint-disable no-constant-condition */
import { knex, Knex } from 'knex'
import { Tele } from '../../../utils/Tele';
import { knex, Knex } from 'knex';
import { Tele } from 'nc-help';
import Debug from '../../util/Debug';
import Emit from '../../util/emit';
import Result from '../../util/Result';

2
packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts

@ -6,7 +6,7 @@ import fsExtra from 'fs-extra';
import importFresh from 'import-fresh';
import inflection from 'inflection';
import slash from 'slash';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import SqlClientFactory from '../sql-client/lib/SqlClientFactory';
// import debug from 'debug';

2
packages/nocodb/src/lib/meta/NcMetaMgr.ts

@ -40,7 +40,7 @@ import NcTemplateParser from '../v1-legacy/templates/NcTemplateParser';
import { defaultConnectionConfig } from '../utils/NcConfigFactory';
import xcMetaDiff from './handlers/xcMetaDiff';
import { UITypes } from 'nocodb-sdk';
import { Tele } from '../utils/Tele';
import { Tele } from 'nc-help';
const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10);
const XC_PLUGIN_DET = 'XC_PLUGIN_DET';

2
packages/nocodb/src/lib/meta/NcMetaMgrEE.ts

@ -1,5 +1,5 @@
import { v4 as uuidv4 } from 'uuid';
import { Tele } from '../utils/Tele';
import { Tele } from 'nc-help';
import NcMetaMgr from './NcMetaMgr';

2
packages/nocodb/src/lib/meta/api/apiTokenApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express';
import { OrgUserRoles } from '../../../enums/OrgUserRoles';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import { NcError } from '../helpers/catchError';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import ApiToken from '../../models/ApiToken';

2
packages/nocodb/src/lib/meta/api/attachmentApis.ts

@ -5,7 +5,7 @@ import { nanoid } from 'nanoid';
import path from 'path';
import slash from 'slash';
import mimetypes, { mimeIcons } from '../../utils/mimeTypes';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import catchError from '../helpers/catchError';
import NcPluginMgrv2 from '../helpers/NcPluginMgrv2';

2
packages/nocodb/src/lib/meta/api/columnApis.ts

@ -3,7 +3,7 @@ import Model from '../../models/Model';
import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2';
import Base from '../../models/Base';
import Column from '../../models/Column';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import validateParams from '../helpers/validateParams';
import { customAlphabet } from 'nanoid';

2
packages/nocodb/src/lib/meta/api/filterApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
// @ts-ignore
import Model from '../../models/Model';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
// @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse';
// @ts-ignore

2
packages/nocodb/src/lib/meta/api/formViewApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
// @ts-ignore
import Model from '../../models/Model';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
// @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse';
import { FormType, ViewTypes } from 'nocodb-sdk';

2
packages/nocodb/src/lib/meta/api/formViewColumnApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express';
import FormViewColumn from '../../models/FormViewColumn';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { metaApiMetrics } from '../helpers/apiMetrics';

2
packages/nocodb/src/lib/meta/api/galleryViewApis.ts

@ -2,7 +2,7 @@ import { Request, Response, Router } from 'express';
import { GalleryType, ViewTypes } from 'nocodb-sdk';
import View from '../../models/View';
import GalleryView from '../../models/GalleryView';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { metaApiMetrics } from '../helpers/apiMetrics';
export async function galleryViewGet(req: Request, res: Response<GalleryType>) {

2
packages/nocodb/src/lib/meta/api/gridViewApis.ts

@ -1,7 +1,7 @@
import { Request, Router } from 'express';
// @ts-ignore
import Model from '../../models/Model';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
// @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse';
import { ViewTypes } from 'nocodb-sdk';

2
packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express';
import GridViewColumn from '../../models/GridViewColumn';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { metaApiMetrics } from '../helpers/apiMetrics';

2
packages/nocodb/src/lib/meta/api/hookApis.ts

@ -1,4 +1,4 @@
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import catchError from '../helpers/catchError';
import { Request, Response, Router } from 'express';
import Hook from '../../models/Hook';

2
packages/nocodb/src/lib/meta/api/hookFilterApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
// @ts-ignore
import Model from '../../models/Model';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
// @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse';
// @ts-ignore

2
packages/nocodb/src/lib/meta/api/index.ts

@ -1,4 +1,4 @@
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import orgLicenseApis from './orgLicenseApis'
import orgTokenApis from './orgTokenApis';
import orgUserApis from './orgUserApis';

2
packages/nocodb/src/lib/meta/api/kanbanViewApis.ts

@ -2,7 +2,7 @@ import { Request, Response, Router } from 'express';
import { KanbanType, ViewTypes } from 'nocodb-sdk';
import View from '../../models/View';
import KanbanView from '../../models/KanbanView';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { metaApiMetrics } from '../helpers/apiMetrics';

2
packages/nocodb/src/lib/meta/api/metaDiffApis.ts

@ -1,6 +1,6 @@
// // Project CRUD
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import Model from '../../models/Model';
import Project from '../../models/Project';

2
packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts

@ -1,7 +1,7 @@
import Model from '../../models/Model';
import ModelRoleVisibility from '../../models/ModelRoleVisibility';
import { Router } from 'express';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import Project from '../../models/Project';
import { metaApiMetrics } from '../helpers/apiMetrics';

2
packages/nocodb/src/lib/meta/api/orgTokenApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
import { OrgUserRoles } from '../../../enums/OrgUserRoles';
import ApiToken from '../../models/ApiToken';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics';
import { NcError } from '../helpers/catchError';
import getHandler from '../helpers/getHandler';

2
packages/nocodb/src/lib/meta/api/orgUserApis.ts

@ -15,7 +15,7 @@ import SyncSource from '../../models/SyncSource';
import User from '../../models/User';
import Noco from '../../Noco';
import { MetaTable } from '../../utils/globals';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics';
import { NcError } from '../helpers/catchError';
import { extractProps } from '../helpers/extractProps';

2
packages/nocodb/src/lib/meta/api/pluginApis.ts

@ -1,5 +1,5 @@
import { Request, Response, Router } from 'express';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import { PagedResponseImpl } from '../helpers/PagedResponse';
import Plugin from '../../models/Plugin';
import { PluginType } from 'nocodb-sdk';

2
packages/nocodb/src/lib/meta/api/projectApis.ts

@ -3,7 +3,7 @@ import Project from '../../models/Project';
import { ModelTypes, ProjectListType, UITypes } from 'nocodb-sdk';
import DOMPurify from 'isomorphic-dompurify';
import { packageVersion } from '../../utils/packageVersion';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import { PagedResponseImpl } from '../helpers/PagedResponse';
import syncMigration from '../helpers/syncMigration';
import { IGNORE_TABLES } from '../../utils/common/BaseApiBuilder';

2
packages/nocodb/src/lib/meta/api/projectUserApis.ts

@ -1,5 +1,5 @@
import { OrgUserRoles } from '../../../enums/OrgUserRoles';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Router } from 'express';
import { PagedResponseImpl } from '../helpers/PagedResponse';

2
packages/nocodb/src/lib/meta/api/sharedBaseApis.ts

@ -1,5 +1,5 @@
import { Router } from 'express';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { v4 as uuidv4 } from 'uuid';
import Project from '../../models/Project';

2
packages/nocodb/src/lib/meta/api/sortApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
// @ts-ignore
import Model from '../../models/Model';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
// @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse';
import { SortListType, TableReqType, TableType } from 'nocodb-sdk';

2
packages/nocodb/src/lib/meta/api/sync/helpers/job.ts

@ -1,4 +1,4 @@
import { Tele } from '../../../../utils/Tele';
import { Tele } from 'nc-help';
import FetchAT from './fetchAT';
import { UITypes } from 'nocodb-sdk';
// import * as sMap from './syncMap';

2
packages/nocodb/src/lib/meta/api/sync/syncSourceApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
import SyncSource from '../../../models/SyncSource';
import { Tele } from '../../../utils/Tele';
import { Tele } from 'nc-help';
import { PagedResponseImpl } from '../../helpers/PagedResponse';
import ncMetaAclMw from '../../helpers/ncMetaAclMw';

2
packages/nocodb/src/lib/meta/api/tableApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express';
import Model from '../../models/Model';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import { PagedResponseImpl } from '../helpers/PagedResponse';
import DOMPurify from 'isomorphic-dompurify';
import {

2
packages/nocodb/src/lib/meta/api/userApi/initAdminFromEnv.ts

@ -9,7 +9,7 @@ import ProjectUser from '../../../models/ProjectUser';
import { validatePassword } from 'nocodb-sdk';
import boxen from 'boxen';
import NocoCache from '../../../cache/NocoCache';
import { Tele } from '../../../utils/Tele';
import { Tele } from 'nc-help';
const { isEmail } = require('validator');
const rolesLevel = { owner: 0, creator: 1, editor: 2, commenter: 3, viewer: 4 };

2
packages/nocodb/src/lib/meta/api/userApi/userApis.ts

@ -3,7 +3,7 @@ import { TableType, validatePassword } from 'nocodb-sdk';
import { OrgUserRoles } from '../../../../enums/OrgUserRoles';
import { NC_APP_SETTINGS } from '../../../constants';
import Store from '../../../models/Store';
import { Tele } from '../../../utils/Tele';
import { Tele } from 'nc-help';
import catchError, { NcError } from '../../helpers/catchError';
const { isEmail } = require('validator');

2
packages/nocodb/src/lib/meta/api/viewApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
// @ts-ignore
import Model from '../../models/Model';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
// @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse';
// @ts-ignore

2
packages/nocodb/src/lib/meta/api/viewColumnApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express';
import View from '../../models/View';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { metaApiMetrics } from '../helpers/apiMetrics';

2
packages/nocodb/src/lib/meta/helpers/apiMetrics.ts

@ -1,5 +1,5 @@
import { Request } from 'express';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
const countMap = {};

292
packages/nocodb/src/lib/utils/Tele.ts

@ -1,292 +0,0 @@
import Emittery from 'emittery';
import { machineIdSync } from 'node-machine-id';
import axios from 'axios';
import os from 'os';
import isDocker from 'is-docker';
import { packageVersion } from './packageVersion';
import Analytics from '@rudderstack/rudder-sdk-node';
const isDisabled = !!process.env.NC_DISABLE_TELE;
const cache = !!process.env.NC_REDIS_URL;
const executable = !!process.env.NC_BINARY_BUILD;
const litestream = !!(
process.env.AWS_ACCESS_KEY_ID &&
process.env.AWS_SECRET_ACCESS_KEY &&
process.env.AWS_BUCKET
);
const sendEvt = () => {
try {
const upTime = Math.round(process.uptime() / 3600);
Tele.emit('evt', {
evt_type: 'alive',
count: global.NC_COUNT,
upTime,
});
Tele.event({
event: 'alive',
id: Tele.machineId,
data: {
cache,
upTime,
litestream,
executable,
},
});
} catch {}
};
setInterval(sendEvt, 4 * 60 * 60 * 1000);
class Tele {
public static machineId: string;
public static emitter: Emittery;
private static config: Record<string, any>;
private static client: any;
static emit(event, data) {
try {
this._init();
Tele.emitter.emit(event, data);
} catch (e) {}
}
static init(config) {
Tele.config = config;
Tele._init();
}
static page(args) {
this.emit('page', args);
}
static event(args) {
this.emit('ph_event', args);
}
static _init() {
try {
if (!Tele.emitter) {
Tele.emitter = new Emittery();
Tele.machineId = machineIdSync();
let package_id = '';
let xc_version = '';
try {
xc_version = process.env.NC_SERVER_UUID;
package_id = packageVersion;
} catch (e) {
console.log(e);
}
const teleData: Record<string, any> = {
package_id,
os_type: os.type(),
os_platform: os.platform(),
os_release: os.release(),
node_version: process.version,
docker: isDocker(),
xc_version: xc_version,
env: process.env.NODE_ENV || 'production',
oneClick: !!process.env.NC_ONE_CLICK,
};
teleData.machine_id = `${machineIdSync()},,`;
Tele.emitter.on('evt_app_started', async (msg: Record<string, any>) => {
try {
await waitForMachineId(teleData);
if (isDisabled) return;
if (msg && msg.count !== undefined) {
global.NC_COUNT = msg.count;
}
await axios.post('https://nocodb.com/api/v1/telemetry', {
...teleData,
evt_type: 'started',
payload: {
count: global.NC_COUNT,
},
});
} catch (e) {
} finally {
sendEvt();
}
});
Tele.emitter.on('evt', async (payload: Record<string, any>) => {
try {
await waitForMachineId(teleData);
if (payload.check) {
teleData.machine_id = `${machineIdSync()},,`;
}
if (isDisabled) return;
if (payload.evt_type === 'project:invite') {
global.NC_COUNT = payload.count || global.NC_COUNT;
}
if (payload.evt_type === 'user:first_signup') {
global.NC_COUNT = +global.NC_COUNT || 1;
}
await axios.post('https://nocodb.com/api/v1/telemetry', {
...teleData,
evt_type: payload.evt_type,
payload: payload,
});
} catch (e) {
// console.log(e)
}
});
Tele.emitter.on(
'evt_api_created',
async (data: Record<string, any>) => {
try {
await waitForMachineId(teleData);
const stats = {
...teleData,
table_count: data.tablesCount || 0,
relation_count: data.relationsCount || 0,
view_count: data.viewsCount || 0,
api_count: data.apiCount || 0,
function_count: data.functionsCount || 0,
procedure_count: data.proceduresCount || 0,
mysql: data.dbType === 'mysql2' ? 1 : 0,
pg: data.dbType === 'pg' ? 1 : 0,
mssql: data.dbType === 'mssql' ? 1 : 0,
sqlite3: data.dbType === 'sqlite3' ? 1 : 0,
oracledb: data.dbType === 'oracledb' ? 1 : 0,
rest: data.type === 'rest' ? 1 : 0,
graphql: data.type === 'graphql' ? 1 : 0,
grpc: data.type === 'grpc' ? 1 : 0,
time_taken: data.timeTaken,
};
if (isDisabled) return;
await axios.post(
'https://nocodb.com/api/v1/telemetry/apis_created',
stats
);
} catch (e) {}
}
);
Tele.emitter.on('evt_subscribe', async (email) => {
try {
if (isDisabled) return;
await axios.post(
'https://nocodb.com/api/v1/newsletter/sdhjh34u3yuy34bj343jhj4iwolaAdsdj3434uiut4nn',
{
email,
}
);
} catch (e) {}
});
Tele.emitter.on('page', async (args: Record<string, any>) => {
try {
if (isDisabled) return;
const instanceMeta = await this.getInstanceMeta();
this.client.track({
userId: args.id || `${this.machineId}:public`,
distinctId: args.id || `${this.machineId}:public`,
event: '$pageview',
properties: {
...teleData,
...instanceMeta,
$current_url: args.path,
},
});
} catch (e) {}
});
Tele.emitter.on('ph_event', async (args: Record<string, any>) => {
try {
if (isDisabled) return;
const instanceMeta = await this.getInstanceMeta();
let id = args.id;
if (!id) {
if (args.event && args.event.startsWith('a:api:')) {
id = this.machineId;
} else {
id = `${this.machineId}:public`;
}
}
this.client.track({
userId: id,
distinctId: id,
event: args.event,
properties: {
...teleData,
...instanceMeta,
...(args.data || {}),
},
});
} catch (e) {}
});
}
} catch (e) {}
try {
if (!this.client) {
this.client = new Analytics(
'26w4gRDLSWVX0rtMR0enhTIOu7G',
'https://nocodbnavehd.dataplane.rudderstack.com/v1/batch',
{
logLevel: '-1',
}
);
}
} catch (e) {}
}
static async getInstanceMeta() {
try {
return (
(Tele.config &&
Tele.config.instance &&
(await Tele.config.instance())) ||
{}
);
} catch {
return {};
}
}
static get id() {
return this.machineId || machineIdSync();
}
}
async function waitForMachineId(teleData) {
let i = 5;
while (i-- && !teleData.machine_id) {
await new Promise((resolve) => setTimeout(() => resolve(null), 500));
}
}
// keep polling the site url to avoid going machine idle
if (process.env.NC_PUBLIC_URL) {
setInterval(() => {
axios({
method: 'get',
url: process.env.NC_PUBLIC_URL,
})
.then(() => {})
.catch(() => {});
}, 2 * 60 * 60 * 1000);
}
if (process.env.NC_ONE_CLICK) {
try {
Tele.emit('evt', {
evt_type: 'ONE_CLICK',
});
} catch (e) {
//
}
}
export { Tele };

2
packages/nocodb/src/lib/utils/common/BaseApiBuilder.ts

@ -21,7 +21,7 @@ import NcProjectBuilder from '../../v1-legacy/NcProjectBuilder';
import Noco from '../../Noco';
import NcMetaIO from '../../meta/NcMetaIO';
import XcCache from '../../v1-legacy/plugins/adapters/cache/XcCache';
import { Tele } from '../Tele';
import { Tele } from 'nc-help';
import BaseModel from './BaseModel';
import { XcCron } from './XcCron';

2
packages/nocodb/src/lib/v1-legacy/NcProjectBuilder.ts

@ -9,7 +9,7 @@ import SqlClientFactory from '../db/sql-client/lib/SqlClientFactory';
import Migrator from '../db/sql-migrator/lib/KnexMigrator';
import Noco from '../Noco';
import { Tele } from '../utils/Tele';
import { Tele } from 'nc-help';
import { GqlApiBuilder } from './gql/GqlApiBuilder';
import { XCEeError } from '../meta/NcMetaMgr';
import { RestApiBuilder } from './rest/RestApiBuilder';

2
packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts

@ -29,7 +29,7 @@ const { isEmail } = require('validator');
import axios from 'axios';
import IEmailAdapter from '../../../interface/IEmailAdapter';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import XcCache from '../plugins/adapters/cache/XcCache';
passport.serializeUser(function (

2
packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrlEE.ts

@ -2,7 +2,7 @@ import passport from 'passport';
import { Strategy } from 'passport-jwt';
import { v4 as uuidv4 } from 'uuid';
import validator from 'validator';
import { Tele } from '../../utils/Tele';
import { Tele } from 'nc-help';
import XcCache from '../plugins/adapters/cache/XcCache';

2
packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts

@ -2,7 +2,7 @@ import { NcConfig } from '../../interface/config';
import debug from 'debug';
import NcMetaIO from '../meta/NcMetaIO';
import { Tele } from '../utils/Tele';
import { Tele } from 'nc-help';
import ncProjectEnvUpgrader from './ncProjectEnvUpgrader';
import ncProjectEnvUpgrader0011045 from './ncProjectEnvUpgrader0011045';
import ncProjectUpgraderV2_0090000 from './ncProjectUpgraderV2_0090000';

2
tests/playwright/tests/rolesSuperUser.spec.ts

@ -14,7 +14,7 @@ test.describe('Super user', () => {
test('AppStore access', async () => {
await dashboard.closeTab({ title: 'Team & Auth' });
await dashboard.rootPage.goto('/#/apps');
await dashboard.rootPage.goto('/#/account/apps', { waitUntil: 'networkidle' });
await dashboard.rootPage.waitForLoadState('load');
const appPage = await dashboard.rootPage;

Loading…
Cancel
Save