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

@datagrok/api-tests

Package Overview
Dependencies
Maintainers
5
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.12 to 1.7.13

src/dataframe/add-new-column.ts

2

dist/package.js

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

var apitests;(()=>{"use strict";var e={49:(e,t,n)=>{n.d(t,{M$:()=>i}),n(469);var o,r=n(976);function u(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function a(e,t,n=.001,o){if(e===Number.POSITIVE_INFINITY&&t===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY&&t===Number.NEGATIVE_INFINITY||e===Number.NaN&&t===Number.NaN||isNaN(e)&&isNaN(t))return;const r=Math.abs(e-t)<n;if(u(r,!0,`${null!=o?o:""} (tolerance = ${n})`),!r)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function i(e,t,n){const o=t.rowCount;u(e.rowCount,o,`${null!=n?n:""}, row count`);for(const i of t.columns){const t=e.columns.byName(i.name);if(null==t)throw new Error(`Column ${i.name} not found`);if(t.type!=i.type)throw new Error(`Column ${i.name} type expected ${i.type} got ${t.type}`);for(let e=0;e<o;e++){const o=i.get(e),l=t.get(e);i.type==r.TYPE.FLOAT?a(l,o,1e-4,n):i.type==r.TYPE.DATE_TIME?u(l.isSame(o),!0,n):u(l,o,n)}}}!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(o||(o={})),r.DataFrame.fromColumns([r.Column.fromStrings("col",["val1","val2","val3"])])},976:e=>{e.exports=DG},469:e=>{e.exports=grok}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var u=t[o]={exports:{}};return e[o](u,u.exports,n),u.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{n.r(o),n.d(o,{dummyDataFrameFunction:()=>m,dummyPackageFunction:()=>s,expectTable:()=>f,getCell:()=>c,getColumn:()=>i,getDT:()=>l,getTable:()=>a});var e=n(469),t=n(976),r=n(49),u=function(e,t,n,o){return new(n||(n=Promise))((function(r,u){function a(e){try{l(o.next(e))}catch(e){u(e)}}function i(e){try{l(o.throw(e))}catch(e){u(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}l((o=o.apply(e,t||[])).next())}))};function a(n,o){return u(this,void 0,void 0,(function*(){const r=(yield e.dapi.files.list(o?`system:appdata/${o}/`:"Samples:Files/",!0,n))[0],u=yield r.readAsString();return t.DataFrame.fromCsv(u)}))}function i(e,t){return e.getCol(t)}function l(t=20,n="demog"){return e.data.demo.getDemoTable(n,t)}function c(e,t,n){return e.cell(t,n)}function f(e,t){return(0,r.M$)(e,t),!0}function s(e,t){return e+t}function m(e){return{tableOut:e,count:e.rowCount}}})(),apitests=o})();
var apitests;(()=>{var t={186:(t,e,n)=>{"use strict";var i=n(82);n(316),i.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,').columns.add(i.Column.fromList(i.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))))},703:(t,e,n)=>{"use strict";n.d(e,{sR:()=>a}),n(328);var i,s=n(82);function o(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function r(t,e,n=.001,i){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 s=Math.abs(t-e)<n;if(o(s,!0,`${null!=i?i:""} (tolerance = ${n})`),!s)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}function a(t,e,n){const i=e.rowCount;o(t.rowCount,i,`${null!=n?n:""}, row count`);for(const a of e.columns){const e=t.columns.byName(a.name);if(null==e)throw new Error(`Column ${a.name} not found`);if(e.type!=a.type)throw new Error(`Column ${a.name} type expected ${a.type} got ${e.type}`);for(let t=0;t<i;t++){const i=a.get(t),y=e.get(t);a.type==s.TYPE.FLOAT?r(y,i,1e-4,n):a.type==s.TYPE.DATE_TIME?o(y.isSame(i),!0,n):o(y,i,n)}}}n(186),console.log.bind(console),console.info.bind(console),console.warn.bind(console),console.error.bind(console),function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(i||(i={})),s.DataFrame.fromColumns([s.Column.fromStrings("col",["val1","val2","val3"])])},316:function(t,e,n){var i;!function(e,s){var o={};!function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(t,n,i,s,o){for(var r,a,y,x,c,f,h,u,p,l,C,d,m;o>=64;){for(r=n[0],a=n[1],y=n[2],x=n[3],c=n[4],f=n[5],h=n[6],u=n[7],l=0;l<16;l++)C=s+4*l,t[l]=(255&i[C])<<24|(255&i[C+1])<<16|(255&i[C+2])<<8|255&i[C+3];for(l=16;l<64;l++)d=((p=t[l-2])>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,m=((p=t[l-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,t[l]=(d+t[l-7]|0)+(m+t[l-16]|0);for(l=0;l<64;l++)d=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&f^~c&h)|0)+(u+(e[l]+t[l]|0)|0)|0,m=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&a^r&y^a&y)|0,u=h,h=f,f=c,c=x+d|0,x=y,y=a,a=r,r=d+m|0;n[0]+=r,n[1]+=a,n[2]+=y,n[3]+=x,n[4]+=c,n[5]+=f,n[6]+=h,n[7]+=u,s+=64,o-=64}return s}var i=function(){function e(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return e.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},e.prototype.clean=function(){for(var t=0;t<this.buffer.length;t++)this.buffer[t]=0;for(t=0;t<this.temp.length;t++)this.temp[t]=0;this.reset()},e.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var i=0;if(this.bytesHashed+=e,this.bufferLength>0){for(;this.bufferLength<64&&e>0;)this.buffer[this.bufferLength++]=t[i++],e--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(e>=64&&(i=n(this.temp,this.state,t,i,e),e%=64);e>0;)this.buffer[this.bufferLength++]=t[i++],e--;return this},e.prototype.finish=function(t){if(!this.finished){var e=this.bytesHashed,i=this.bufferLength,s=e/536870912|0,o=e<<3,r=e%64<56?64:128;this.buffer[i]=128;for(var a=i+1;a<r-8;a++)this.buffer[a]=0;this.buffer[r-8]=s>>>24&255,this.buffer[r-7]=s>>>16&255,this.buffer[r-6]=s>>>8&255,this.buffer[r-5]=s>>>0&255,this.buffer[r-4]=o>>>24&255,this.buffer[r-3]=o>>>16&255,this.buffer[r-2]=o>>>8&255,this.buffer[r-1]=o>>>0&255,n(this.temp,this.state,this.buffer,0,r),this.finished=!0}for(a=0;a<8;a++)t[4*a+0]=this.state[a]>>>24&255,t[4*a+1]=this.state[a]>>>16&255,t[4*a+2]=this.state[a]>>>8&255,t[4*a+3]=this.state[a]>>>0&255;return this},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype._saveState=function(t){for(var e=0;e<this.state.length;e++)t[e]=this.state[e]},e.prototype._restoreState=function(t,e){for(var n=0;n<this.state.length;n++)this.state[n]=t[n];this.bytesHashed=e,this.finished=!1,this.bufferLength=0},e}();t.Hash=i;var s=function(){function t(t){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var e=new Uint8Array(this.blockSize);if(t.length>this.blockSize)(new i).update(t).finish(e).clean();else for(var n=0;n<t.length;n++)e[n]=t[n];for(n=0;n<e.length;n++)e[n]^=54;for(this.inner.update(e),n=0;n<e.length;n++)e[n]^=106;for(this.outer.update(e),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<e.length;n++)e[n]=0}return t.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},t.prototype.clean=function(){for(var t=0;t<this.istate.length;t++)this.ostate[t]=this.istate[t]=0;this.inner.clean(),this.outer.clean()},t.prototype.update=function(t){return this.inner.update(t),this},t.prototype.finish=function(t){return this.outer.finished?this.outer.finish(t):(this.inner.finish(t),this.outer.update(t,this.digestLength).finish(t)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t}();function o(t){var e=(new i).update(t),n=e.digest();return e.clean(),n}function r(t,e){var n=new s(t).update(e),i=n.digest();return n.clean(),i}function a(t,e,n,i){var s=i[0];if(0===s)throw new Error("hkdf: cannot expand more");e.reset(),s>1&&e.update(t),n&&e.update(n),e.update(i),e.finish(t),i[0]++}t.HMAC=s,t.hash=o,t.default=o,t.hmac=r;var y=new Uint8Array(t.digestLength);t.hkdf=function(t,e,n,i){void 0===e&&(e=y),void 0===i&&(i=32);for(var o=new Uint8Array([1]),x=r(e,t),c=new s(x),f=new Uint8Array(c.digestLength),h=f.length,u=new Uint8Array(i),p=0;p<i;p++)h===f.length&&(a(f,c,n,o),h=0),u[p]=f[h++];return c.clean(),f.fill(0),o.fill(0),u},t.pbkdf2=function(t,e,n,i){for(var o=new s(t),r=o.digestLength,a=new Uint8Array(4),y=new Uint8Array(r),x=new Uint8Array(r),c=new Uint8Array(i),f=0;f*r<i;f++){var h=f+1;a[0]=h>>>24&255,a[1]=h>>>16&255,a[2]=h>>>8&255,a[3]=h>>>0&255,o.reset(),o.update(e),o.update(a),o.finish(x);for(var u=0;u<r;u++)y[u]=x[u];for(u=2;u<=n;u++){o.reset(),o.update(x).finish(x);for(var p=0;p<r;p++)y[p]^=x[p]}for(u=0;u<r&&f*r+u<i;u++)c[f*r+u]=y[u]}for(f=0;f<r;f++)y[f]=x[f]=0;for(f=0;f<4;f++)a[f]=0;return o.clean(),c}}(o);var r=o.default;for(var a in o)r[a]=o[a];"object"==typeof t.exports?t.exports=r:void 0===(i=function(){return r}.call(o,n,o,t))||(t.exports=i)}()},82:t=>{"use strict";t.exports=DG},328:t=>{"use strict";t.exports=grok}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";n.r(i),n.d(i,{dummyDataFrameFunction:()=>u,dummyPackageFunction:()=>h,dummyPackageFunctionWithDefaultValue:()=>f,expectTable:()=>c,getCell:()=>x,getColumn:()=>a,getDT:()=>y,getTable:()=>r});var t=n(328),e=n(82),s=n(703),o=function(t,e,n,i){return new(n||(n=Promise))((function(s,o){function r(t){try{y(i.next(t))}catch(t){o(t)}}function a(t){try{y(i.throw(t))}catch(t){o(t)}}function y(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}y((i=i.apply(t,e||[])).next())}))};function r(n,i){return o(this,void 0,void 0,(function*(){const s=(yield t.dapi.files.list(i?`system:appdata/${i}/`:"System:DemoFiles/",!0,n))[0],o=yield s.readAsString();return e.DataFrame.fromCsv(o)}))}function a(t,e){return t.getCol(e)}function y(e=20,n="demog"){return t.data.demo.getDemoTable(n,e)}function x(t,e,n){return t.cell(e,n)}function c(t,e){return(0,s.sR)(t,e),!0}function f(t){return t.length}function h(t,e){return t+e}function u(t){return{tableOut:t,count:t.rowCount}}})(),apitests=i})();
//# sourceMappingURL=package.js.map
{
"name": "@datagrok/api-tests",
"friendlyName": "API Tests",
"version": "1.7.12",
"version": "1.7.13",
"author": {

@@ -17,5 +17,5 @@ "name": "Anna Muzychyna",

"dependencies": {
"@datagrok-libraries/utils": "^4.1.4",
"@datagrok-libraries/utils": "^4.1.41",
"cash-dom": "^8.1.1",
"datagrok-api": "^1.17.0",
"datagrok-api": "^1.18.0",
"dayjs": "^1.11.10",

@@ -77,3 +77,3 @@ "rxjs": "^6.6.7",

"name": "FLOAT",
"propertyType": "int",
"propertyType": "double",
"defaultValue": 1.234,

@@ -83,8 +83,2 @@ "nullable": false

{
"name": "NUM",
"propertyType": "int",
"defaultValue": 1,
"nullable": false
},
{
"name": "BOOL",

@@ -91,0 +85,0 @@ "propertyType": "bool",

@@ -6,3 +6,2 @@ import * as grok from 'datagrok-api/grok';

const GDC = grok.dapi.connections;

@@ -15,9 +14,23 @@ category('Dapi: connection', () => {

let dc = DG.DataConnection.create('Local DG Test', dcParams);
dc = await GDC.save(dc);
expect(dc.credentials.parameters['login'], dcParams.login);
expect(dc.credentials.parameters['password'], dcParams.password);
dc = await grok.dapi.connections.save(dc);
expect((dc.parameters as any)['schema'], null);
expect((dc.parameters as any)['db'], dcParams.db);
expect(dc.friendlyName, 'Local DG Test');
expect((await GDC.find(dc.id)).id, dc.id);
await GDC.delete(dc);
expect(await GDC.find(dc.id) == undefined);
expect((await grok.dapi.connections.find(dc.id)).id, dc.id);
// changing credentials
dc.credentials.parameters['login'] = 'changed_login';
dc = await grok.dapi.connections.save(dc);
expect(dc.credentials.openParameters['login'], 'changed_login');
// changing credentials forEntity
let credentials = await grok.dapi.credentials.forEntity(dc);
credentials.parameters['login'] = 'datagrok_dev';
credentials = await grok.dapi.credentials.save(credentials);
expect(credentials.openParameters['login'], 'datagrok_dev');
await grok.dapi.connections.delete(dc);
expect(await grok.dapi.connections.find(dc.id) == undefined);
});

@@ -24,0 +37,0 @@

@@ -16,5 +16,3 @@ import * as grok from 'datagrok-api/grok';

const properties = {
entityId: group.id,
property: 'myProp',
value: 'value',
'myProp': 'value',
};

@@ -27,3 +25,3 @@ await group.setProperties(properties);

expect(typeof props === 'object', true);
expect(Object.keys(props).length, 3);
expect(Object.keys(props).length, 1);
});

@@ -33,3 +31,3 @@

await group.setProperties({testProp1: 'prop1', testProp2: 'prop2'});
expect(Object.keys(await group.getProperties()).length, 5);
expect(Object.keys(await group.getProperties()).length, 3);
});

@@ -36,0 +34,0 @@

@@ -108,2 +108,8 @@ import * as grok from 'datagrok-api/grok';

test('readAsText', async () => {
const files = await _package.files.list('datasets', true, 'demog.csv');
const res = await _package.files.readAsText(files[0]);
expect(!!res);
});
after(async () => {

@@ -110,0 +116,0 @@ await grok.dapi.files.delete(testTextFilePath);

@@ -27,2 +27,24 @@ import * as grok from 'datagrok-api/grok';

test('save & get author', async () => {
const func: DG.Func = await grok.functions.eval('Sin');
const funcCall = await func.prepare({x: xValue}).call();
funcCall.newId();
const savedFuncCall = await GDF.calls.include('session.user').save(funcCall);
expect(savedFuncCall.author, grok.shell.user);
}, {skipReason: 'GROK-15119'});
test('save with DF', async () => {
const funcWithDf: DG.Func = await grok.functions.eval('ApiTests:dummyDataFrameFunction');
const funcCall = await funcWithDf.prepare({'table': grok.data.demo.demog(30)}).call();
const savedFuncCall = await GDF.calls.save(funcCall);
const loadedFuncCall = await GDF.calls.find(savedFuncCall.id);
const loadedInputTableId = loadedFuncCall.inputs['table'];
const loadedOutputTableId = loadedFuncCall.outputs['tableOut'];
expectTable(funcCall.inputs[loadedInputTableId], await grok.dapi.tables.getTable(loadedInputTableId));
expectTable(funcCall.outputs[loadedOutputTableId], await grok.dapi.tables.getTable(loadedOutputTableId));
}, {skipReason: 'GROK-14739'});
test('save options', async () => {

@@ -50,3 +72,3 @@ const func: DG.Func = await grok.functions.eval('Sin');

expect(loadedFunCall.parentCall.id, parentFuncCall.id);
});
}, {skipReason: 'GROK-14488'});

@@ -80,4 +102,4 @@ test('load package function call', async () => {

const loadedCall = await GDF.calls.include('session.user').find(funcCall.id);
expect(loadedCall.author, grok.shell.user.id);
}, {skipReason: 'GROK-14061'});
expect(loadedCall.author.id, grok.shell.user.id);
});

@@ -91,5 +113,23 @@ test('load package function author', async () => {

const loadedCall = await GDF.calls.include('session.user').find(funcCall.id);
expect(loadedCall.author, grok.shell.user.id);
}, {skipReason: 'GROK-14061'});
expect(loadedCall.author.id, grok.shell.user.id);
});
test('load package function with func and package', async () => {
const packFunc = await grok.functions.eval('ApiTests:dummyPackageFunction');
const funcCall = await packFunc.prepare({a: 1, b: 2}).call();
funcCall.newId();
await GDF.calls.save(funcCall);
const loadedCall = await GDF.calls.include('func.package').find(funcCall.id);
expect(loadedCall.func.package.name, 'ApiTests');
}, {skipReason: 'GROK-15174'});
test('load script with func and package', async () => {
const packFunc = await grok.functions.eval('ApiTests:dummyPackageScript');
const funcCall = await packFunc.prepare({a: 1, b: 2}).call();
funcCall.newId();
await GDF.calls.save(funcCall);
const loadedCall = await GDF.calls.include('func.package').find(funcCall.id);
expect(loadedCall.func.package.name, 'ApiTests');
}, {skipReason: 'GROK-15174'});
test('load script call inputs & outputs', async () => {

@@ -159,2 +199,13 @@ const packFunc: DG.Func = await grok.functions.eval('ApiTests:dummyPackageScript');

test('list package function with params', async () => {
const packFunc: DG.Func = await grok.functions.eval('ApiTests:dummyPackageScript');
const funcCall = await packFunc.prepare({a: 1, b: 2}).call();
funcCall.newId();
await GDF.calls.save(funcCall);
const loadedCalls =
await GDF.calls.filter(`session.user.id="${grok.shell.user.id}"`).include('session.user, func.params').first();
expect(loadedCalls.inputs[0].name, 'a');
}, {skipReason: 'GROK-14735'});
test('list package functions with author', async () => {

@@ -171,2 +222,13 @@ const packFunc: DG.Func = await grok.functions.eval('ApiTests:dummyPackageFunction');

test('list package function with params', async () => {
const packFunc: DG.Func = await grok.functions.eval('ApiTests:dummyPackageFunction');
const funcCall = await packFunc.prepare({a: 1, b: 2}).call();
funcCall.newId();
await GDF.calls.save(funcCall);
const loadedCalls =
await GDF.calls.filter(`session.user.id="${grok.shell.user.id}"`).include('session.user, func.params').first();
expect(loadedCalls.inputs[0].name, 'a');
}, {skipReason: 'GROK-14735'});
test('find', async () => {

@@ -191,2 +253,11 @@ const func: DG.Func = await grok.functions.eval('Sin');

test('find func with params', async () => {
const func: DG.Func = await grok.functions.eval('Sin');
const funcCall = await func.prepare({x: xValue}).call();
funcCall.newId();
await GDF.calls.save(funcCall);
const loadedFuncCall = await GDF.calls.include('func.params').find(funcCall.id);
expect(loadedFuncCall.func.inputs[0].name, 'x');
}, {skipReason: 'GROK-14735'});
test('delete', async () => {

@@ -204,2 +275,9 @@ const func: DG.Func = await grok.functions.eval('Sin');

category('Dapi: functions', async () => {
test('Parse default value', async () => {
const func = await grok.functions.eval('ApiTests:dummyPackageFunctionWithDefaultValue') as DG.Func;
const defaultValue = func.inputs.find((p) => p.name === 'a')?.defaultValue;
expect(defaultValue, 'test');
}, {skipReason: 'GROK-14233'});
test('Load package function with package', async () => {

@@ -209,3 +287,2 @@ const func = await grok.functions.eval('ApiTests:dummyPackageFunction');

console.log(loadedFunc);
expect(loadedFunc.package.name, 'ApiTests');

@@ -218,5 +295,14 @@ });

console.log(loadedFunc);
expect(loadedFunc.package.name, 'ApiTests');
});
test('Filter functions by nqName (script)', async () => {
const loadedFuncCalls = await GDF.filter(`nqName="ApiTests:dummyPackageFunction"`).list();
expect(loadedFuncCalls.length, 1);
}, {skipReason: 'GROK-15175'});
test('Filter functions by nqName (package function)', async () => {
const loadedFuncCalls = await GDF.filter(`nqName="ApiTests:dummyPackageScript"`).list();
expect(loadedFuncCalls.length, 1);
}, {skipReason: 'GROK-15175'});
});

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

const t2 = DG.DataFrame.fromCsv(data);
expect(t2 instanceof DG.DataFrame);
expectTable(t2, t);

@@ -137,0 +138,0 @@ const df = DG.DataFrame.fromColumns([]);

@@ -1,6 +0,4 @@

/* eslint-disable max-len */
import * as DG from 'datagrok-api/dg';
import {category, test, expect} from '@datagrok-libraries/utils/src/test';
import {category, test} from '@datagrok-libraries/utils/src/test';
category('Detector', () => {

@@ -21,32 +19,1 @@ test('SingleEmptyCategory', async () => {

});
const testData = DG.DataFrame.fromCsv(`countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,Questions,empty_number,empty_string
Belgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,1,1,1QBS,1,1.23,<chart></chart>,text,100,abc
Burundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,2,2,1ZP8,2,1.23,<chart></chart>,text,,
Cameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,3,3,2BDJ,3,1.23,<chart></chart>,text,,
Canada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,4,4,1IAN,4,1.23,<chart></chart>,text,,
Colombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,5,5,4UJ1,5,1.23,<chart></chart>,text,,
Costa Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,6,6,2BPW,6,1.23,<chart></chart>,text,,
Cuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,7,7,1QBS,7,1.23,<chart></chart>,text,,
Italy,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,8,8,1ZP8,8,1.23,<chart></chart>,text,,
Rwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,9,2BDJ,9,1.23,<chart></chart>,text,,
Switzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,10,1IAN,10,1.23,<chart></chart>,text,,
,,,,,,,,,,,,,,,,,,,,`);
testData.columns.add(DG.Column.fromList(DG.TYPE.BYTE_ARRAY, 'BinaryImage', Array.from(new Uint8Array(11))));
const skip = ['detectMolecules', 'detectFit', 'detectChembl'];
category('Detector: All Detectors', () => {
const detectors = DG.Func.find({tags: ['semTypeDetector']});
for (const detector of detectors) {
if (skip.includes(detector.friendlyName)) continue;
test(detector.friendlyName, async () => {
const arr = [];
const cols = testData.clone().columns;
for (const col of cols) {
const res = await detector.apply([col]);
arr.push(res || col.semType);
}
expect(arr.filter((i) => i).length, 1);
});
}
});
/* eslint-disable */
// @ts-nocheck
import {before, category, delay, expect, expectArray, test} from '@datagrok-libraries/utils/src/test';
import * as grok from 'datagrok-api/grok';
import {Func, Qnum, toDart} from 'datagrok-api/dg';
import * as DG from 'datagrok-api/dg';

@@ -10,3 +8,2 @@ import {check} from './utils';

import dayjs from "dayjs";
import {DataFrame} from "datagrok-api/dg";

@@ -45,3 +42,3 @@ const demogHeavy = grok.data.demo.demog(5000000); // 90mb

const iterations = DG.Test.isInBenchmark ? 100000 : 100;
return toDart(await runLoop(false, tiny, getTinyGenerator(true, iterations)));
return DG.toDart(await runLoop(false, tiny, getTinyGenerator(true, iterations)));
}, {timeout: 400000});

@@ -52,3 +49,3 @@

const iterations = DG.Test.isInBenchmark ? 100000 : 100;
return toDart(await runLoop(true, tiny, getTinyGenerator(true, iterations)));
return DG.toDart(await runLoop(true, tiny, getTinyGenerator(true, iterations)));
}, {timeout: 400000});

@@ -58,3 +55,3 @@

const type = DG.Test.isInBenchmark ? 'h' : 'l';
return toDart(await runLoop(true, demog, getHeavyGenerator(10, type)));
return DG.toDart(await runLoop(true, demog, getHeavyGenerator(10, type)));
}, {timeout: 180000});

@@ -83,3 +80,3 @@

return toDart({"empty": emptyCache, "100k": after100k, "250k": after250k, "500k": after500k, "1kk": after1kk, "2kk": after2kk});
return DG.toDart({"empty": emptyCache, "100k": after100k, "250k": after250k, "500k": after500k, "1kk": after1kk, "2kk": after2kk});
}, {timeout: 10000000000000, skipReason: 'Just for test purposes'});

@@ -116,3 +113,3 @@

return toDart({"empty": emptyCache, "100k": after100k, "250k": after250k, "500k": after500k, "1kk": after1kk, "2kk": after2kk});
return DG.toDart({"empty": emptyCache, "100k": after100k, "250k": after250k, "500k": after500k, "1kk": after1kk, "2kk": after2kk});
}, {timeout: 10000000000000, skipReason: 'Just for test purposes'});

@@ -160,3 +157,3 @@ });

await expectSameResults(echo(DG.TYPE.FLOAT), {x: 1234.56});
await expectSameResults(echo(DG.TYPE.QNUM), {x: Qnum.less(5)});
await expectSameResults(echo(DG.TYPE.QNUM), {x: DG.Qnum.less(5)});
// await expectSameResults(echo(DG.TYPE.BIG_INT), {x: 9007199254740991n});

@@ -174,3 +171,3 @@ await expectSameResults(echo(DG.TYPE.DATE_TIME), {x: dayjs.utc()})

test('Expiration', async () => {
const func = registerFunc('dataframe getNowDf()', () => DataFrame.fromCsv(`id,date
const func = registerFunc('dataframe getNowDf()', () => DG.DataFrame.fromCsv(`id,date
id1,${Date.now()}`));

@@ -188,3 +185,3 @@ const res1 = await func.apply();

const entryStore = transaction.objectStore('cache_entry');
entryStore.openCursor().onsuccess = (event) => {
entryStore.openCursor().onsuccess = (event: any) => {
const cursor = event.target.result;

@@ -234,3 +231,3 @@ if (cursor) {

else if (first instanceof dayjs)
expect(first.format('YYYY-MM-DDTHH:mm:ss'), second.format('YYYY-MM-DDTHH:mm:ss'));
expect((first as dayjs.Dayjs).format('YYYY-MM-DDTHH:mm:ss'), second.format('YYYY-MM-DDTHH:mm:ss'));
else

@@ -260,3 +257,3 @@ expect(first, second);

function registerFunc(signature: string, run: (param: any) => any, isAsync: boolean = false,
invalidateOn: string = '* * * * *'): Func {
invalidateOn: string = '* * * * *'): DG.Func {
return grok.functions.register({

@@ -270,3 +267,3 @@ signature: signature,

async function getFunctionExecutionTime(f: Func, params: object = {}): Promise<number> {
async function getFunctionExecutionTime(f: DG.Func, params: object = {}): Promise<number> {
const start = Date.now();

@@ -277,3 +274,3 @@ await f.apply(params);

async function runLoop(cache: boolean, func: Func, argumentsProvider: Generator<void, object, object>): object {
async function runLoop(cache: boolean, func: DG.Func, argumentsProvider: Generator<void, object, object>): Promise<object | undefined> {
try {

@@ -284,2 +281,3 @@ if (!cache) {

const results = [];
// @ts-ignore
for (let args of argumentsProvider())

@@ -297,2 +295,3 @@ results.push(await getFunctionExecutionTime(func, args))

function getTinyGenerator(same: boolean = true, count: number = 1000000): Generator<void, object, object> {
// @ts-ignore
return function* () {

@@ -308,2 +307,3 @@ let n = 0;

function getHeavyGenerator(count: number = 5, type:string = 'h'): Generator<void, object, object> {
// @ts-ignore
return function* () {

@@ -310,0 +310,0 @@ let n = 0;

@@ -42,2 +42,17 @@ import './date-functions';

});
test(`script's package load`, async () => {
const sin: DG.Func = await grok.functions.eval('ApiTests:dummyPackageScript');
expect(sin.package.nqName, 'ApiTests');
}, {skipReason: 'GROK-15178'});
test(`package func's package load`, async () => {
const sin: DG.Func = await grok.functions.eval('ApiTests:dummyDataFrameFunction');
expect(sin.package.nqName, 'ApiTests');
}, {skipReason: 'GROK-15178'});
test(`core package load`, async () => {
const sin: DG.Func = await grok.functions.eval('Sin');
expect(sin.package.nqName, 'core');
}, {skipReason: 'GROK-15178'});
});
import * as grok from 'datagrok-api/grok';
import dayjs from 'dayjs';
// import utc from 'dayjs/plugin/utc';
// dayjs.extend(utc);
import {expect, expectArray, expectFloat, expectObject} from '@datagrok-libraries/utils/src/test';

@@ -34,1 +37,679 @@

}
export const EXCLUDED = ['Time', 'RandBetween', 'Rnd'];
export const FUNC_TESTS: {[f: string]: {[test: string]: any}} = {
Boolean: {
'Boolean(true)': true,
'Boolean("true")': true,
'Boolean("y")': true,
'Boolean(1)': true,
'Boolean(10)': true,
'Boolean(DateParse("20200131T132700"))': true,
'Boolean(false)': false,
'Boolean("false")': false,
'Boolean("n")': false,
'Boolean("abc")': false,
'Boolean("")': false,
'Boolean(null)': false,
'Boolean(0)': false,
},
ParseFloat: {
'ParseFloat("2025")': 2025,
'ParseFloat("12.78")': 12.78,
'ParseFloat("-012.150")': -12.15,
},
ParseInt: {
'ParseInt("2025")': 2025,
'ParseInt("-012")': -12,
'ParseInt(" 0101 ")': 101,
},
ParseQnum: {
'ParseQnum("100")': 100.00000000000003,
'ParseQnum("<100")': 100.00000000000001,
'ParseQnum(">100")': 100.00000000000004,
'ParseQnum(" 100 ")': 100.00000000000003,
'ParseQnum(" < 100 ")': 100.00000000000001,
'ParseQnum(" > 100 ")': 100.00000000000004,
'Qualifier(ParseQnum("100"))': '=',
'Qualifier(ParseQnum("<100"))': '<',
'Qualifier(ParseQnum(">100"))': '>',
'QnumToString(ParseQnum(" < 100 "))': '<100',
'ParseQnum("10")': 10.000000000000004,
'ParseQnum("<10")': 10.000000000000002,
'ParseQnum(">10")': 10.000000000000005,
'ParseQnum(" < 10")': 10.000000000000002,
'ParseQnum("> 10")': 10.000000000000005,
},
Qnum: {
'ToString(Qnum(1.5, "="))': '1.5000000000000004',
'ToString(Qnum(1.5, "<"))': '1.5000000000000002',
'ToString(Qnum(1.5, ">"))': '1.5000000000000007',
'ToString(Qnum(-1, "="))': '-1.0000000000000004',
'ToString(Qnum(-1, "<"))': '-1.0000000000000002',
'ToString(Qnum(-1, ">"))': '-1.0000000000000007',
},
QnumToString: {
'QnumToString(Qnum(1.5, "="))': '1.50',
'QnumToString(Qnum(1.5, "<"))': '<1.50',
'QnumToString(Qnum(1.5, ">"))': '>1.50',
'QnumToString(Qnum(1.115, "="))': '1.11',
'QnumToString(Qnum(1.115, "<"))': '<1.11',
'QnumToString(Qnum(1.115, ">"))': '>1.11',
},
Qualifier: {
'Qualifier(Qnum(1.5, "="))': '=',
'Qualifier(Qnum(1.5, "<"))': '<',
'Qualifier(Qnum(1.5, ">"))': '>',
'Qualifier(1)': '=',
},
ToString: {
'ToString(1)': '1',
'ToString(3.14)': '3.14',
'ToString(true)': 'true',
},
Date: {
'Date(2020, 1, 1)': dayjs.utc('2020-01-01'),
'Date(2000, 10, 1)': dayjs.utc('2000-10-01'),
'Date(2040, 1, 30)': dayjs.utc('2040-01-30'),
},
DateAdd: {
'DateAdd(Date(2020, 1, 1), 86400000)': dayjs.utc('2020-01-01').add(1, 'd'),
'DateAdd(Date(2020, 1, 1), 10800000)': dayjs.utc('2020-01-01').add(3, 'h'),
'DateAdd(Date(2020, 1, 1), 3605000)': dayjs.utc('2020-01-01').add(1, 'h').add(5, 's'),
},
DateDiff: {
'DateDiff(Date(2020, 1, 2), Date(2020, 1, 1))': 86400000,
'DateDiff(Date(2020, 1, 1), Date(2020, 1, 2))': -86400000,
'DateDiff(Date(2020, 1, 1), Date(2020, 1, 1))': 0,
'DateDiff(DateTime(2020, 1, 1, 0, 0, 0, 125), Date(2020, 1, 1))': 125,
},
DateTime: {
'DateTime(2020, 1, 1, 23, 59, 45, 999)': dayjs.utc('2020-1-1 23:59:45.999'),
'DateTime(2050, 10, 10, 0, 15, 5, 0)': dayjs.utc('2050-10-10 0:15:5'),
},
DayOfMonth: {
'DayOfMonth(Date(2020, 6, 15))': 15,
'DayOfMonth(Date(2020, 6, 1))': 1,
'DayOfMonth(Date(2020, 6, 30))': 30,
},
DayOfWeek: {
'DayOfWeek(Date(2020, 12, 31))': 4,
'DayOfWeek(Date(2020, 1, 1))': 3,
'DayOfWeek(Date(2020, 1, 5))': 7,
},
DayOfYear: {
'DayOfYear(Date(2020, 1, 1))': 1,
'DayOfYear(Date(2020, 2, 25))': 56,
'DayOfYear(Date(2020, 12, 31))': 366,
},
Hour: {
'Hour(DateTime(2020, 1, 1, 23, 59, 45, 999))': 23,
'Hour(DateTime(2020, 1, 1, 0, 59, 45, 999))': 0,
'Hour(DateTime(2020, 1, 1, 12, 0, 0, 0))': 12,
},
Millisecond: {
'Millisecond(DateTime(2020, 1, 1, 0, 0, 0, 0))': 0,
'Millisecond(DateTime(2020, 1, 1, 0, 0, 0, 100))': 100,
'Millisecond(DateTime(2020, 1, 1, 0, 0, 0, 909))': 909,
},
Minute: {
'Minute(DateTime(2020, 1, 1, 0, 0, 0, 0))': 0,
'Minute(DateTime(2020, 1, 1, 0, 5, 50, 50))': 5,
'Minute(DateTime(2020, 1, 1, 0, 59, 0, 0))': 59,
},
Month: {
'Month(Date(2020, 1, 1))': 1,
'Month(Date(2020, 3, 15))': 3,
'Month(Date(2020, 12, 15))': 12,
},
Quarter: {
'Quarter(Date(2020, 1, 1))': 1,
'Quarter(Date(2020, 2, 10))': 1,
'Quarter(Date(2020, 3, 15))': 1,
'Quarter(Date(2020, 4, 1))': 2,
'Quarter(Date(2020, 5, 1))': 2,
'Quarter(Date(2020, 6, 1))': 2,
'Quarter(Date(2020, 7, 1))': 3,
'Quarter(Date(2020, 8, 1))': 3,
'Quarter(Date(2020, 9, 1))': 3,
'Quarter(Date(2020, 10, 1))': 4,
'Quarter(Date(2020, 11, 1))': 4,
'Quarter(Date(2020, 12, 1))': 4,
},
Second: {
'Second(DateTime(2020, 1, 1, 23, 59, 59, 999))': 59,
'Second(DateTime(2020, 1, 1, 23, 59, 45, 999))': 45,
'Second(DateTime(2020, 1, 1, 23, 59, 0, 999))': 0,
},
Time: {
// The function returns a datetime with a special insignificant date `01-01-00`.
// 2-digit year is replaced in expected dates with 4-digit format to address offset inconsistency
'Time(23, 59, 45, 999)': dayjs('2000-01-01 23:59:45.999'),
'Time(10, 35, 15, 500)': dayjs('2000-01-01 10:35:15.500'),
'Time(5, 5, 5, 5)': dayjs('2000-01-01 5:5:5.5'),
'Time(0, 0, 0, 0)': dayjs('2000-01-01 0:0:0.0'),
},
Today: {
'Today()': dayjs().utc().hour(0).minute(0).second(0).millisecond(0),
},
Weeknum: {
'Weeknum(Date(2020, 1, 1))': 0,
'Weeknum(Date(2020, 2, 3))': 5,
'Weeknum(Date(2020, 12, 31))': 53,
},
Year: {
'Year(Date(2020, 1, 1))': 2020,
'Year(Date(1999, 1, 1))': 1999,
'Year(Date(2100, 1, 1))': 2100,
},
And: {
'And(true, true)': true,
'And(true, false)': false,
'And(false, true)': false,
'And(false, false)': false,
'And(5 == 5, 10 < 20)': true,
'And(2, 3)': undefined,
'And(0, 1)': undefined,
'And(1, 1)': undefined,
},
Not: {
'Not(true)': false,
'Not(false)': true,
'Not(1)': undefined,
'Not(0)': undefined,
},
Or: {
'Or(true, true)': true,
'Or(true, false)': true,
'Or(false, true)': true,
'Or(false, false)': false,
'Or(5 == 6, 20 < 10)': false,
'Or(2, 3)': undefined,
'Or(0, 1)': undefined,
'Or(1, 1)': undefined,
},
Xor: {
'Xor(true, true)': false,
'Xor(true, false)': true,
'Xor(false, true)': true,
'Xor(false, false)': false,
'Xor(5 == 6, 20 < 10)': false,
'Xor(5 == 5, 10 < 20)': false,
'Xor(2, 3)': undefined,
'Xor(2, 2)': undefined,
'Xor(1, 0)': undefined,
'Xor(1, 1)': undefined,
},
Abs: {
'Abs(-10)': 10,
'Abs(10)': 10,
'Abs(0)': 0,
},
Acos: {
'Acos(-1)': 3.142,
'Acos(0)': 1.571,
'Acos(0.5)': 1.047,
'Acos(1)': 0,
},
Add: {
'Add(2, 10)': 12,
'Add(24.06, 100.101)': 124.161,
'Add(-70, 25)': -45,
'Add(-11, -22)': -33,
'Add(999, 0)': 999,
'Add(0, -12)': -12,
'Add("bitter", "sweet")': 'bittersweet',
'Add("", "right")': 'right',
'Add("left", "")': 'left',
'Add("", "")': '',
},
Asin: {
'Asin(-1)': -1.571,
'Asin(0)': 0,
'Asin(0.5)': 0.524,
'Asin(1)': 1.571,
},
Atan: {
'Atan(0)': 0,
'Atan(1)': 0.785,
'Atan(1.5)': 0.983,
'Atan(-1)': -0.785,
},
Atan2: {
'Atan2(1, 0)': 1.5707,
'Atan2(0, 1)': 0,
'Atan2(-1, 2)': -0.464,
'Atan2(1, -2)': 2.678,
},
Ceil: {
'Ceil(3.5)': 4,
'Ceil(-3.5)': -3,
'Ceil(1.1)': 2,
'Ceil(-1.1)': -1,
'Ceil(10)': 10,
},
Cos: {
'Cos(0)': 1,
'Cos(PI / 6)': 0.866,
'Cos(PI / 4)': 0.707,
'Cos(PI / 3)': 0.5,
'Cos(PI / 2)': 0.0001,
},
Div: {
'Div(7.542, 2)': 3.771,
'Div(-12, 3)': -4,
'Div(4321, 1)': 4321,
'Div(0, 4)': 0,
// 'Div(1, 0)': Infinity,
},
Eq: {
'Eq(5, 5)': true,
'Eq(-1, 1)': false,
'Eq(-0, 0)': true,
'Eq(3.142, 3.142)': true,
'Eq("1", 1)': false,
'Eq(0, null)': false,
'Eq(null, null)': true,
'Eq("sky", "sky")': true,
'Eq("", "")': true,
'Eq("SKY", "sky")': false,
'Eq(" sky ", "sky")': false,
'Eq("", null)': false,
},
Exp: {
'Exp(1)': 2.718,
'Exp(2)': 7.389,
'Eq(Exp(1), E)': true,
},
Floor: {
'Floor(3.5)': 3,
'Floor(-3.5)': -4,
'Floor(1.1)': 1,
'Floor(-1.1)': -2,
'Floor(10)': 10,
},
Greater: {
'Greater(5, 4)': true,
'Greater(-5, -10)': true,
'Greater(5, 5)': false,
'Greater(4, 5)': false,
},
If: {
'If(true, "a", "b")': 'a',
'If(false, "a", "b")': 'b',
'If(true, If(true, "a", "b"), "c")': 'a',
'If(false, "a", If(false, "b", "c"))': 'c',
'If(Eq(10, 10), 1, 0)': 1,
'If(Eq(10, 50), 1, 0)': 0,
'If(Boolean(1), Boolean(1), Boolean(0))': true,
'If(Boolean(0), Boolean(1), Boolean(0))': false,
},
Ln: {
'Ln(1)': 0,
'Ln(E)': 1,
'Ln(5)': 1.609,
},
Log: {
'Log(25, 5)': 2,
'Log(100, 10)': 2,
'Log(2, 10)': 0.301,
},
Log10: {
'Log10(1)': 0,
'Log10(10)': 1,
'Log10(100)': 2,
'Log10(5)': 0.699,
'Log10(32)': 1.505,
},
Mod: {
'Mod(8, 3)': 2,
'Mod(9, 3)': 0,
'Mod(1, 3)': 1,
'Mod(7, 7)': 0,
},
Mul: {
'Mul(10, 1.5)': 15,
'Mul(12, 30)': 360,
'Mul(0, 13.27)': 0,
'Mul(123, 1)': 123,
},
Neg: {
'Neg(-5)': 5,
'Neg(11)': -11,
'Neg(-0)': 0,
'Neg(+1)': -1,
},
NotEq: {
'NotEq(5, 5)': false,
'NotEq(-1, 1)': true,
'NotEq(-0, 0)': false,
'NotEq(3.142, 3.142)': false,
'NotEq("sky", "sky")': false,
'NotEq("", "")': false,
'NotEq("SKY", "sky")': true,
'NotEq(" sky ", "sky")': true,
},
NotGreater: {
'NotGreater(4, 5)': true,
'NotGreater(5, 5)': true,
'NotGreater(6, 5)': false,
'NotGreater(-5, -7)': false,
},
NotSmaller: {
'NotSmaller(5, 5)': true,
'NotSmaller(6, 5)': true,
'NotSmaller(5, 6)': false,
'NotSmaller(-1, 0)': false,
},
Pow: {
'Pow(2, 0)': 1,
'Pow(7, 1)': 7,
'Pow(2, 3)': 8,
'Pow(2, -2)': 0.25,
},
RandBetween: {
'RandBetween(5, 7)': [5, 7],
'RandBetween(-2, 2)': [-2, 2],
'RandBetween(0, 35)': [0, 35],
'RandBetween(-100, -50)': [-100, -50],
'RandBetween(1, 2)': [1, 2],
},
Rnd: {
'Rnd(80)': [0, 80],
'Rnd(2)': [0, 2],
'Rnd(-2)': [0, 2],
},
Round: {
'Round(3.4)': 3,
'Round(3.5)': 4,
'Round(1)': 1,
'Round(-3.5)': -4,
'Round(-3.4)': -3,
},
Round10: {
'Round10(12345.12345, 6)': 12345.12345,
'Round10(12345.12345, 4)': 12345.1235,
'Round10(12345.12345, 0)': 12345,
'Round10(PI, 2)': 3.14,
'Round10(0.5, 0)': 1,
'Round10(0.3, 0)': 0,
'Round10(-0.5, 0)': -1,
'Round10(175, -1)': 180,
'Round10(170, -1)': 170,
'Round10(175, -2)': 200,
'Round10(125, -2)': 100,
'Round10(12340.12345, -3.8)': 12000,
'Round10(12340.12345, -4.2)': 10000,
'Round10(12340.12345, -5)': 0,
'Round10(null, 2)': undefined,
},
Sin: {
'Sin(0)': 0,
'Sin(PI / 6)': 0.5,
'Sin(PI / 4)': 0.707,
'Sin(PI / 3)': 0.866,
'Sin(PI / 2)': 1,
},
Smaller: {
'Smaller(4, 5)': true,
'Smaller(5, 5)': false,
'Smaller(5, 4)': false,
'Smaller(-10, -5)': true,
},
Sqrt: {
'Sqrt(1)': 1,
'Sqrt(4)': 2,
'Sqrt(9)': 3,
'Sqrt(6.25)': 2.5,
},
Sub: {
'Sub(10, 3)': 7,
'Sub(124.161, 24.06)': 100.101,
'Sub(-50, 25)': -75,
'Sub(-11, -22)': 11,
'Sub(999, 0)': 999,
'Sub(0, -12)': 12,
},
Tan: {
'Tan(0)': 0,
'Tan(PI / 6)': 0.577,
'Tan(PI / 4)': 1.0001,
'Tan(PI / 3)': 1.732,
},
Avg: {
'Avg([1, 2, 3, 4])': 2.5,
'Avg([null, 0.3, 0.7])': 0.5,
'Avg([5.123])': 5.123,
'Avg([-1, -2, 3])': 0,
'Avg([1, null, 2, 3])': 2,
'Avg([])': undefined,
'Avg([null, null])': undefined,
},
Kurt: {
'Kurt([1, 2, 3])': -1.5,
'Kurt([1, 2, 6])': -1.5,
'Kurt([1, null, 2, 3])': -1.5,
'Kurt([null, null])': 0,
},
Max: {
'Max([1, 2, 4, 3])': 4,
'Max([1, null, 2, 3])': 3,
'Max([null, 1, 0.7, 0.3])': 1,
'Max([1.5, -2, 1.9])': 1.9,
'Max([null, null])': undefined,
},
Med: {
'Med([1, 2, 3])': 2,
'Med([1, 2, 3, 4])': 2.5,
'Med([1, null, 2, 3])': 2,
'Med([-100, null, 100])': 0,
'Med([null, 0.3, 0.7])': 0.5,
'Med([null, 1, 0.7, 0.3])': 0.7,
'Med([null, null])': 0,
},
Min: {
'Min([1.5, -2, 1.9])': -2,
'Min([1, 2, 4, 3])': 1,
'Min([2, null, 0, 3])': 0,
'Min([null, 1, 0.7, 0.3])': 0.3,
'Min([null, null])': undefined,
},
MissingValueCount: {
'MissingValueCount([1, 2, 3])': 0,
'MissingValueCount([10, null, 7])': 1,
'MissingValueCount([2, null, 0, null, 3])': 2,
'MissingValueCount([null, null, null])': 3,
},
Percentile: {
'Percentile([10, 9, 8, 7, 6, 5, 4, 3, 2, 1], 0.25)': 3,
'Percentile([1, 2, 3, 4], 0.25)': 2,
'Percentile([1, 2, 3, 4], 0.40)': 2,
'Percentile([1, 2, 3, 4], 0.75)': 4,
'Percentile([1, 2, null, 3, 4], 0.25)': 2,
'Percentile([null], 0.4)': undefined,
'Percentile([], 0.4)': undefined,
},
Q1: {
'Q1([-5, -3, -1, 0, 1, 3, 5])': -3,
'Q1([5, -5, 1, -1, 3, -3, 0])': -3,
'Q1([1, 2, 3])': 1,
'Q1([1, null, 2, 3])': 1,
'Q1([null, null])': 0,
},
Q2: {
'Q2([1, 2, 3])': 2,
'Q2([1, 2, 3, 4])': 2.5,
'Q2([1, null, 2, 3])': 2,
'Q2([-100, null, 100])': 0,
'Q2([null, 0.3, 0.7])': 0.5,
'Q2([null, 1, 0.7, 0.3])': 0.7,
'Q2([null, null])': 0,
},
Q3: {
'Q3([-5, -3, -1, 0, 1, 3, 5])': 3,
'Q3([5, -5, 1, -1, 3, -3, 0])': 3,
'Q3([1, 2, 3])': 3,
'Q3([1, null, 2, 3])': 3,
'Q3([null, null])': 0,
},
Skew: {
'Skew([1, 2, 3])': 0,
'Skew([1, 2, 6])': 0.595,
'Skew([1, null, 2, 3])': 0,
'Skew([null, null])': 0,
},
StDev: {
'StDev([1, 2, 3])': 1,
'StDev([1, null, 2, 3])': 1,
'StDev([null, null])': 0,
'StDev([7, 14, 21])': 7,
'StDev([-15, -5, 5, 15])': 12.91,
},
Sum: {
'Sum([1, 2, 4, 3])': 10,
'Sum([-1, 4, 12, 5])': 20,
'Sum([2, null, 0, 3])': 5,
'Sum([null, 1, 0.7, 0.3])': 2,
'Sum([null, null])': 0,
'Sum([-0])': 0,
},
TotalCount: {
'TotalCount([2, null, 0, 3])': 4,
'TotalCount([1, 2, 4])': 3,
'TotalCount([null, null])': 2,
'TotalCount([100])': 1,
'TotalCount([])': 0,
'TotalCount(null)': undefined,
},
ValueCount: {
'ValueCount([1, 2, 4, 3])': 4,
'ValueCount([2, null, 0, 3])': 3,
'ValueCount([1, 2, 4])': 3,
'ValueCount([null, null])': 0,
'ValueCount([100])': 1,
'ValueCount([])': 0,
'ValueCount(null)': undefined,
},
Variance: {
'Variance([1, 2, 3])': 1,
'Variance([1, null, 2, 3])': 1,
'Variance([null, null])': 0,
'Variance([7, 14, 21])': 49,
'Variance([-15, -5, 5, 15])': 166.667,
},
Contains: {
'Contains("stormy weather", "weather")': true,
'Contains("stormy weather", "sunny")': false,
'Contains("empty", "")': true,
'Contains("Case", "case")': false,
},
EndsWith: {
'EndsWith("White Christmas", "Christmas")': true,
'EndsWith("White Christmas", "White")': false,
'EndsWith("White Christmas", "")': true,
},
IsEmpty: {
'IsEmpty("")': true,
'IsEmpty(null)': true,
'IsEmpty("dream")': false,
'IsEmpty(" ")': false,
},
IsNotEmpty: {
'IsNotEmpty("")': false,
'IsNotEmpty(null)': false,
'IsNotEmpty("dream")': true,
'IsNotEmpty(" ")': true,
},
Length: {
'Length("supercalifragilisticexpialidocious")': 34,
'Length("bright dawn")': 11,
'Length("")': 0,
},
RegExpContains: {
'RegExpContains("stormy weather", "weather")': true,
'RegExpContains("stormy weather", "sunny")': false,
'RegExpContains("empty", "")': true,
'RegExpContains("Case", "case")': false,
'RegExpContains("name@gmail.com", "[\w.\-]{0,25}@(hotmail|gmail)\.com")': true,
},
RegExpExtract: {
'RegExpExtract("Hello, world!", "l+", 0)': 'll',
'RegExpExtract("Hello, world!", "l+", 1)': 'l',
},
RegExpReplace: {
'RegExpReplace("Hello, world!", "l+", "LL")': 'HeLLo, worLLd!',
},
ReplaceAll: {
'ReplaceAll("New York", "York", "Orleans")': 'New Orleans',
'ReplaceAll("day-to-day", "-", " ")': 'day to day',
'ReplaceAll("spaceless", " ", "-")': 'spaceless',
},
SplitString: {
'SplitString("a,b,c,d", ",", 0)': 'a',
'SplitString("devil-may-care", "-", 1)': 'may',
},
StartsWith: {
'StartsWith("Sunrise", "Sun")': true,
'StartsWith("Sunrise", "sun")': false,
'StartsWith("Sunrise", "moon")': false,
'StartsWith("Sunrise", "")': true,
},
StrFind: {
'StrFind("Hello, world!", "Hello")': 0,
'StrFind("Hello, world!", "hello")': -1,
'StrFind("Hello, world!", "world")': 7,
'StrFind("Hello, world!", "sun")': -1,
'StrFind("Hello, world!", "Hello, world!")': 0,
'StrFind("", "moon")': -1,
'StrFind("moon", "")': -1,
'StrFind("", "")': -1,
},
StrLeft: {
'StrLeft("crystal", 100)': 'crystal',
'StrLeft("crystal", 3)': 'cry',
'StrLeft("crystal", 0)': '',
'StrLeft("", 3)': '',
'StrLeft("crystal", -1)': 'crysta',
'StrLeft("crystal", -7)': '',
'StrLeft("crystal", -10)': '',
},
StrRight: {
'StrRight("crystal", 100)': 'crystal',
'StrRight("crystal", 3)': 'tal',
'StrRight("crystal", 0)': '',
'StrRight("", 3)': '',
'StrRight("crystal", -1)': 'rystal',
'StrRight("crystal", -7)': '',
'StrRight("crystal", -10)': '',
},
StrRepeat: {
'StrRepeat("a", 5)': 'aaaaa',
'StrRepeat("ma", 2)': 'mama',
'StrRepeat("", 2)': '',
'StrRepeat("day", 1)': 'day',
'StrRepeat("light", 0)': '',
},
Substring: {
'Substring("Snow storm", 5, 10)': 'storm',
'Substring("stars", 0, 5)': 'stars',
'Substring("galaxy", 0, 0)': '',
'Substring("", 0, 0)': '',
},
ToLowerCase: {
'ToLowerCase("ICE")': 'ice',
'ToLowerCase("snow")': 'snow',
'ToLowerCase("Wind")': 'wind',
},
ToUpperCase: {
'ToUpperCase("home")': 'HOME',
'ToUpperCase("CAT")': 'CAT',
'ToUpperCase("Toy")': 'TOY',
},
Trim: {
'Trim(" Outer space ")': 'Outer space',
'Trim("spacecraft")': 'spacecraft',
'Trim(" ")': '',
'Trim("")': '',
},
};

@@ -19,7 +19,9 @@ import * as grok from 'datagrok-api/grok';

demog.col('started')!.colors.setLinear([DG.Color.white, DG.Color.red]);
grid.setOptions({colorCoding: 'All'});
grid.setOptions({colorCoding: 'None'});
grid.setOptions({colorCoding: 'Auto'});
testTags();
grid.setOptions({colorCoding: 'All'});
grid.setOptions({colorScheme: [4294922560, 4294944000, 4283477800]});
if (grid.cell('weight', 0).color !== 4288522774)
throw new Error('Grid Color Coding > Color Scheme was not applied');
const layout = v.saveLayout();

@@ -26,0 +28,0 @@ v.close();

@@ -9,3 +9,3 @@ import * as grok from 'datagrok-api/grok';

for (let j = 0; j < colTags[i].length; j++) {
console.log('TAG Value: ' + colTags[i][j]);
// console.log('TAG Value: ' + colTags[i][j]);
if (colTags[i][j] == colTagValue)

@@ -12,0 +12,0 @@ return true;

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

import './dataframe/dataframe-link';
// import './dataframe/add-new-column';
import './functions/functions';

@@ -55,3 +56,2 @@ import './functions/conversion-functions';

//name: test

@@ -62,3 +62,2 @@ //input: string category {optional: true}

//output: dataframe result
//top-menu: Tools | Dev | JS API Tests
export async function test(category: string, test: string, testContext: TestContext): Promise<DG.DataFrame> {

@@ -69,5 +68,14 @@ const data = await runTests({category, test, testContext});

//name: testPlatform
//output: dataframe result
//top-menu: Tools | Dev | Test | Platform
export async function testPlatform(): Promise<DG.DataFrame> {
const skip = ['Benchmarks', 'Packages: Docker', 'Functions: Client-side cache'];
const data = await runTests({exclude: skip});
return DG.DataFrame.fromObjects(data)!;
}
//name: testPackages
//output: dataframe result
//top-menu: Tools | Dev | Test Packages
//top-menu: Tools | Dev | Test | Packages
export async function testPackages(): Promise<DG.DataFrame> {

@@ -74,0 +82,0 @@ const funcs = DG.Func.find({name: 'test'});

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

export async function getTable(name: string, path: string): Promise<DG.DataFrame> {
const file = (await grok.dapi.files.list(path ? `system:appdata/${path}/` : 'Samples:Files/', true, name))[0];
const file = (await grok.dapi.files.list(path ? `system:appdata/${path}/` : 'System:DemoFiles/', true, name))[0];
const str = await file.readAsString();

@@ -57,2 +57,10 @@ const result = DG.DataFrame.fromCsv(str);

//name: dummyPackageFunctionWithDefaultValue
//input: string a = "test"
//output: int c
export function dummyPackageFunctionWithDefaultValue(a: string) {
const c = a.length;
return c;
}
//name: dummyPackageFunction

@@ -59,0 +67,0 @@ //input: int a

import * as grok from 'datagrok-api/grok';
import {delay, category, expect, test} from '@datagrok-libraries/utils/src/test';
import {DockerContainer} from 'datagrok-api/dg';
import {category, expect, expectObject, test} from '@datagrok-libraries/utils/src/test';
export async function awaitContainerStart(containerName: string, tries: number = 3): Promise<DockerContainer> {
let dockerContainer;
let count: number = 0;
do {
dockerContainer = await grok.dapi.docker.dockerContainers.filter(containerName).first();
count++;
if (dockerContainer.status == 'started' || dockerContainer.status == 'checking')
return dockerContainer;
await delay(500);
}
while (count < tries);
throw Error('Container didn\'t start');
}
category('Packages: Docker', () => {

@@ -23,3 +8,5 @@ const containerName: string = 'Apitests-docker-test1';

test('Get response', async () => {
const container = await awaitContainerStart(containerName);
const container = await grok.dapi.docker.dockerContainers.filter(containerName).first();
if (container.status !== 'started' && container.status !== 'checking')
await grok.dapi.docker.dockerContainers.run(container.id, true);
await testResponse(container.id);

@@ -35,3 +22,5 @@ }, {timeout: 30000});

test('Get container logs', async () => {
const container = await awaitContainerStart(containerName);
const container = await grok.dapi.docker.dockerContainers.filter(containerName).first();
if (container.status !== 'started' && container.status !== 'checking')
await grok.dapi.docker.dockerContainers.run(container.id, true);
const logs = await grok.dapi.docker.dockerContainers.getContainerLogs(container.id);

@@ -43,8 +32,7 @@ expect(!logs || logs.length === 0, false);

async function testResponse(containerId: string): Promise<void> {
const params: RequestInit = {
method: 'GET',
};
const path = '/square?number=4';
const response = await grok.dapi.docker.dockerContainers.request(containerId, path, params);
expect(response?.trim(), '{"result":16}');
const response = await grok.dapi.docker.dockerContainers.fetchProxy(containerId, path);
expect(response.status, 200, `Container response status was ${response.status}`);
const result = await response.json();
expectObject(result, {"result": 16});
}

@@ -1,41 +0,42 @@

// import * as DG from 'datagrok-api/dg';
// import * as grok from 'datagrok-api/grok';
import * as DG from 'datagrok-api/dg';
import * as grok from 'datagrok-api/grok';
import {category, test, expect, after} from '@datagrok-libraries/utils/src/test';
import {category, test, expect, before, after} from '@datagrok-libraries/utils/src/test';
import {_package} from '../package-test';
let group: DG.Group;
category('Packages: Properties', () => {
before(async () => {
if (!group)
group = (await grok.dapi.groups.getGroupsLookup('All users'))[0];
});
test('INT', async () => {
await changeProp('INT', 10);
}, {skipReason: 'GROK-14019'});
});
test('BIG_INT', async () => {
await changeProp('BIG_INT', 10);
}, {skipReason: 'GROK-14019'});
test('FLOAT', async () => {
await changeProp('FLOAT', 10.567);
}, {skipReason: 'GROK-14019'});
});
test('NUM', async () => {
await changeProp('NUM', 1.234);
}, {skipReason: 'GROK-14019'});
test('BOOL', async () => {
await changeProp('BOOL', false);
}, {skipReason: 'GROK-14019'});
});
test('STRING', async () => {
await changeProp('STRING', 'value2');
}, {skipReason: 'GROK-14019'});
});
// after(async () => {
// await _package.setProperties({INT: 1, BIG_INT: 1, FLOAT: 1.234, NUM: 1, BOOL: true, STRING: 'value1'});
// });
after(async () => {
await _package.setProperties({INT: 1, FLOAT: 1.234, BOOL: true, STRING: 'value1'});
});
});
async function changeProp(name: string, value: any): Promise<void> {
await _package.setProperties({[name]: value});
const props = await _package.getProperties();
expect(props.get(name), value);
//@ts-ignore
await _package.setSettings({[name]: value}, group);
const props = await _package.getSettings();
//@ts-ignore
expect(props[name], value);
}

@@ -68,5 +68,5 @@ {

/* Advanced Options */
"skipLibCheck": false, /* Skip type checking of declaration files. */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}
const path = require('path');
module.exports = {
cache: {
type: 'filesystem',
cache: {
type: 'filesystem',
},
mode: 'development',
entry: {
test: {
filename: 'package-test.js',
library: {type: 'var', name: `apitests_test`},
import: './src/package-test.ts',
},
mode: 'development',
entry: {
test: {
filename: 'package-test.js',
library: {type: 'var', name: `apitests_test`},
import: './src/package-test.ts'
},
package: './src/package.ts',
},
resolve: {
extensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /\.js$/,
enforce: 'pre',
use: ['source-map-loader'],
},
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/,
},
],
},
devtool: 'source-map',
externals: {
'datagrok-api/dg': 'DG',
'datagrok-api/grok': 'grok',
'datagrok-api/ui': 'ui',
'openchemlib/full.js': 'OCL',
'rxjs': 'rxjs',
'dayjs': 'dayjs',
'dayjs/plugin/utc': 'utc',
'rxjs/operators': 'rxjs.operators',
},
output: {
filename: '[name].js',
library: 'apitests',
libraryTarget: 'var',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
package: './src/package.ts',
},
resolve: {
extensions: ['.wasm', '.mjs', '.ts', '.json', '.js', '.tsx'],
},
module: {
rules: [
{
test: /\.js$/,
enforce: 'pre',
use: ['source-map-loader'],
},
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/,
},
],
},
devtool: 'source-map',
externals: {
'datagrok-api/dg': 'DG',
'datagrok-api/grok': 'grok',
'datagrok-api/ui': 'ui',
'openchemlib/full.js': 'OCL',
'rxjs': 'rxjs',
'dayjs': 'dayjs',
'dayjs/plugin/utc': 'utc',
'rxjs/operators': 'rxjs.operators',
},
output: {
filename: '[name].js',
library: 'apitests',
libraryTarget: 'var',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
};

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