Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@datagrok/api-tests

Package Overview
Dependencies
Maintainers
6
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datagrok/api-tests - npm Package Compare versions

Comparing version 1.7.1 to 1.7.2

2

dist/package.js

@@ -1,2 +0,2 @@

var apitests;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{dummyPackageFunction:()=>y,expectTable:()=>d,getColumn:()=>p,getDT:()=>m,getTable:()=>f,testCustomFilter:()=>s,testViewerForProperties:()=>l});const n=grok,r=DG;class o extends r.JsViewer{constructor(){super(),this.field="field value",this.onTableAttachedCounter=0,this.testPropertyString=this.string("testPropertyString",""),this.testPropertyInt=this.int("testPropertyInt",-1)}onTableAttached(){super.onTableAttached(),this.onTableAttachedCounter++}}class u extends r.Filter{get filterSummary(){return""}constructor(){super()}applyState(t){if("string"==typeof t.column||t.column instanceof String){const e=t.column;delete t.column,t.columnName=e}super.applyState(t)}applyFilter(){}}var i;function a(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function c(t,e,n=.001,r){if(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||t===Number.NaN&&e===Number.NaN||isNaN(t)&&isNaN(e))return;const o=Math.abs(t-e)<n;if(a(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(i||(i={}));function l(){return new o}function s(){return new u}function f(t,e){return o=this,u=void 0,a=function*(){const o=(yield n.dapi.files.list(e?`system:appdata/${e}/`:"Demo:Files/",!0,t))[0],u=yield o.readAsString();return r.DataFrame.fromCsv(u)},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{c(a.next(t))}catch(t){e(t)}}function r(t){try{c(a.throw(t))}catch(t){e(t)}}function c(e){var o;e.done?t(e.value):(o=e.value,o instanceof i?o:new i((function(t){t(o)}))).then(n,r)}c((a=a.apply(o,u||[])).next())}));var o,u,i,a}function p(t,e){return t.getCol(e)}function m(t=20,e="demog"){return n.data.demo.getDemoTable(e,t)}function d(t,e){return function(t,e,n){const o=e.rowCount;a(t.rowCount,o,", row count");for(const u of e.columns){const e=t.columns.byName(u.name);if(null==e)throw new Error(`Column ${u.name} not found`);if(e.type!=u.type)throw new Error(`Column ${u.name} type expected ${u.type} got ${e.type}`);for(let t=0;t<o;t++){const o=u.get(t),i=e.get(t);u.type==r.TYPE.FLOAT?c(i,o,1e-4,n):u.type==r.TYPE.DATE_TIME?a(i.isSame(o),!0,n):a(i,o,n)}}}(t,e),!0}function y(t,e){return t+e}apitests=e})();
var apitests;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{dummyDataFrameFunction:()=>N,dummyPackageFunction:()=>y,expectTable:()=>d,getColumn:()=>m,getDT:()=>p,getTable:()=>f,testCustomFilter:()=>s,testViewerForProperties:()=>l});const n=grok,r=DG;class o extends r.JsViewer{constructor(){super(),this.field="field value",this.onTableAttachedCounter=0,this.testPropertyString=this.string("testPropertyString",""),this.testPropertyInt=this.int("testPropertyInt",-1)}onTableAttached(){super.onTableAttached(),this.onTableAttachedCounter++}}class u extends r.Filter{get filterSummary(){return""}constructor(){super()}applyState(t){if("string"==typeof t.column||t.column instanceof String){const e=t.column;delete t.column,t.columnName=e}super.applyState(t)}applyFilter(){}}var i;function a(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function c(t,e,n=.001,r){if(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||t===Number.NaN&&e===Number.NaN||isNaN(t)&&isNaN(e))return;const o=Math.abs(t-e)<n;if(a(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(i||(i={}));function l(){return new o}function s(){return new u}function f(t,e){return o=this,u=void 0,a=function*(){const o=(yield n.dapi.files.list(e?`system:appdata/${e}/`:"Demo:Files/",!0,t))[0],u=yield o.readAsString();return r.DataFrame.fromCsv(u)},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{c(a.next(t))}catch(t){e(t)}}function r(t){try{c(a.throw(t))}catch(t){e(t)}}function c(e){var o;e.done?t(e.value):(o=e.value,o instanceof i?o:new i((function(t){t(o)}))).then(n,r)}c((a=a.apply(o,u||[])).next())}));var o,u,i,a}function m(t,e){return t.getCol(e)}function p(t=20,e="demog"){return n.data.demo.getDemoTable(e,t)}function d(t,e){return function(t,e,n){const o=e.rowCount;a(t.rowCount,o,", row count");for(const u of e.columns){const e=t.columns.byName(u.name);if(null==e)throw new Error(`Column ${u.name} not found`);if(e.type!=u.type)throw new Error(`Column ${u.name} type expected ${u.type} got ${e.type}`);for(let t=0;t<o;t++){const o=u.get(t),i=e.get(t);u.type==r.TYPE.FLOAT?c(i,o,1e-4,n):u.type==r.TYPE.DATE_TIME?a(i.isSame(o),!0,n):a(i,o,n)}}}(t,e),!0}function y(t,e){return t+e}function N(t){return{tableOut:t,count:t.rowCount}}apitests=e})();
//# sourceMappingURL=package.js.map
{
"name": "@datagrok/api-tests",
"friendlyName": "API Tests",
"version": "1.7.1",
"version": "1.7.2",
"author": {

@@ -6,0 +6,0 @@ "name": "Alexander Paramonov",

@@ -11,2 +11,10 @@ import * as grok from 'datagrok-api/grok';

test('clone DFs', async () => {
const funcWithDf: DG.Func = await grok.functions.eval('ApiTests:dummyDataFrameFunction');
const funcCall = await funcWithDf.prepare({'table': grok.data.demo.demog(30)}).call();
const clonedFunccall = funcCall.clone();
expect(funcCall.inputs['table'], clonedFunccall.inputs['table']);
expect(funcCall.outputs['tableOut'], clonedFunccall.outputs['tableOut']);
});
test('save', async () => {

@@ -13,0 +21,0 @@ const func: DG.Func = await grok.functions.eval('Sin');

@@ -303,7 +303,5 @@ import * as DG from 'datagrok-api/dg';

c.set(1, dayjs('2022-01-01'));
expect(c.get(1).valueOf(), 1640995200000);
expect(c.get(1).valueOf(), 1641013200000);
c.set(1, null);
expect(c.get(1), null);
const v = grok.shell.addTableView(t);
v.close();
});

@@ -310,0 +308,0 @@

@@ -12,7 +12,2 @@ import * as DG from 'datagrok-api/dg';

import './shell/windows';
import './views/docking';
import './views/docking-nested';
import './views/events';
import './views/layouts';
import './views/files-view';
import './dapi/files';

@@ -39,8 +34,4 @@ import './dapi/functions';

import './package/upload';
import './viewers/viewers';
import './viewers/filters';
import './grid/grid';
import './grid/color-coding';
import './connections/queries-test';
import './connections/get-all-top100';
import './scripts/scripts-params';

@@ -47,0 +38,0 @@

@@ -79,1 +79,11 @@ /* Do not change these import lines. Datagrok will import API library in exactly the same manner */

}
//name: dummyDataFrameFunction
//input: dataframe table [Data table]
//output: int count
//output: dataframe tableOut
export function dummyDataFrameFunction(table: DG.DataFrame) {
const count = table.rowCount;
const tableOut = table;
return {tableOut, count};
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc