Update to schedule version

This commit is contained in:
tree 2022-05-30 05:15:41 +02:00
rodič 5d55669c8b
revize 2660285269
13 změnil soubory, kde provedl 1612 přidání a 20059 odebrání

Zobrazit soubor

@ -91,3 +91,5 @@ schedule-multi:
schedule-pdf:
mkdir -p dist/22/pdf && cd utils/schedule-pdf && node index.js $(local)
id:
deno run --unstable --allow-read utils/schedule-id.js

Zobrazit soubor

@ -2181,7 +2181,7 @@
- id: holky-v-kryptu-campfire
type: campfire
name: Potkej Holkyvkryptu
name: Potkej Holky v kryptu
track: zaklady
speakers:
- tereza-starostova
@ -2609,7 +2609,6 @@
description: |
Zhodnocení konference, ještě před tím než skončí. Co se vám na naší konferenci líbilo a co naopak do příště musíme vylepšit? Bude vůbec nějaké příště? Pojďte si popovídat s organizátory konference. Během tohoto campfire bude (možná) šance zakoupit si limitovanou edici vstupenky na UTXO.23 s ultra slevou (ale psst!).
fixed:
stage: campfire-outdoor
time: '2/18:00-18:30'
- id: rbf-labs-venture-studio

Zobrazit soubor

@ -32,6 +32,5 @@ specDef:
- type: partners
- type: projects
- type: team
- type: schedule-candidates
- type: practical-info
- type: schedule

Rozdílový obsah nebyl zobrazen, protože je příliš veliký Načíst rozdílové porovnání

Rozdílový obsah nebyl zobrazen, protože je příliš veliký Načíst rozdílové porovnání

Zobrazit soubor

@ -1,5 +1,5 @@
- id: rajska-zahrada
name: Rajská zahrada
name: 'P1 Rajská zahrada'
types: [ talk, panel, lightning-series ]
capacity:
seat: 325
@ -16,7 +16,7 @@
- '2/09:45-19:15/xxxxx'
- id: lustrovy-sal
name: Lustrový sál
name: 'P2 Lustrový sál'
types: [ talk, panel, lightning-series ]
capacity:
seat: 130
@ -33,7 +33,7 @@
- '2/09:45-18:30/xxxxx'
- id: klenbovy-sal
name: Klenbový sál
name: 'P3 Klenbový sál'
types: [ talk, lightning-series ]
capacity:
seat: 130
@ -50,7 +50,7 @@
- '2/09:45-18:30/xxxxx'
- id: exit-room
name: Exit room
name: 'P4 Exit room'
types: [ talk ]
capacity:
seat: 80
@ -67,7 +67,7 @@
- '2/09:45-18:30/xxxxx'
- id: knihovna
name: Knihovna
name: 'W1 Knihovna'
types: [ workshop ]
capacity:
seat: 40
@ -80,7 +80,7 @@
- '2/14:00-18:30'
- id: white-workshop-room
name: Table room
name: 'W2 Table room'
types: [ workshop ]
capacity:
seat: 30
@ -93,7 +93,7 @@
- '2/14:00-18:30'
- id: campfire-outdoor
name: 🔥 Campfire (venku)
name: '🔥 C1 Campfire (venku)'
types: [ campfire ]
capacity:
seat: 40
@ -105,7 +105,7 @@
- '2/12:30-18:30'
- id: campfire-indoor
name: 🔥 Campfire (uvnitř)
name: '🔥 C2 Campfire (uvnitř)'
types: [ campfire ]
capacity:
seat: 20

16
utils/genid.js Normal file
Zobrazit soubor

@ -0,0 +1,16 @@
export function genId(used) {
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
//const numbers = "";
let output = null;
for (const n of chars) {
for (const ch of chars) {
output = `${n}${ch}`;
if (used.includes(output)) {
continue;
}
return output;
}
}
return false;
}

10
utils/periods.js Normal file
Zobrazit soubor

@ -0,0 +1,10 @@
import { format, parse } from "https://deno.land/std@0.139.0/datetime/mod.ts";
export function getDate(time) {
return format(new Date(time), "yyyy-MM-dd");
}
export function isPeriodOverlap(x, y) {
return (new Date(x.start).getTime() < new Date(y.end).getTime() &&
new Date(x.end).getTime() > new Date(y.start).getTime());
}

Zobrazit soubor

@ -1,6 +1,8 @@
import { format, parse } from "https://deno.land/std@0.139.0/datetime/mod.ts";
import { createHash } from "https://deno.land/std/hash/mod.ts";
import { UTXOEngine } from "./engine.js";
import { isPeriodOverlap } from "./periods.js";
import { genId } from "./genid.js";
const utxo = new UTXOEngine({ silent: true });
await utxo.init();
@ -31,23 +33,6 @@ function rand(max) {
return Math.floor(Math.random() * max);
}
function genId(used) {
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
//const numbers = "";
let output = null;
for (const n of chars) {
for (const ch of chars) {
output = `${n}${ch}`;
if (used.includes(output)) {
continue;
}
return output;
}
}
return false;
}
class UTXOPlanner {
constructor() {
this.eventsAll = specs.events;
@ -197,11 +182,6 @@ class UTXOPlanner {
return [null, null];
}
isPeriodOverlap(x, y) {
return (x.start.getTime() < y.end.getTime() &&
x.end.getTime() > y.start.getTime());
}
eventSlotValidator(ev, slot, stage) {
// check "after"
if (ev.after) {
@ -236,7 +216,7 @@ class UTXOPlanner {
0,
);
if (speakers > 0) {
if (this.isPeriodOverlap(si.period, slot)) {
if (isPeriodOverlap(si.period, slot)) {
return false;
}
}
@ -251,7 +231,7 @@ class UTXOPlanner {
let okey = false;
for (const spa of sp.available) {
if (
this.isPeriodOverlap({
isPeriodOverlap({
start: new Date(spa.from),
end: new Date(spa.to),
}, slot)
@ -394,7 +374,7 @@ class UTXOPlanner {
if (ssi.event === si.event) {
continue;
}
if (this.isPeriodOverlap(si.period, ssi.period)) {
if (isPeriodOverlap(si.period, ssi.period)) {
const eev = this.eventsOriginal.find((e) => e.id === ssi.event);
const tagsCrossing = ev.tags.reduce((prev, cur) =>
prev + (eev.tags.includes(cur)

11
utils/schedule-id.js Normal file
Zobrazit soubor

@ -0,0 +1,11 @@
import { UTXOEngine } from "./engine.js";
import { genId } from "./genid.js";
const utxo = new UTXOEngine({ silent: true });
await utxo.init();
const entryId = "22";
const entry = utxo.entries[entryId];
const id = genId(entry.specs.schedule.map((s) => s.id));
console.log(id);

Zobrazit soubor

@ -9,7 +9,8 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"puppeteer": "^14.1.1"
"puppeteer": "^14.1.1",
"puppeteer-core": "^1.9.0"
}
},
"node_modules/@types/node": {
@ -38,6 +39,11 @@
"node": ">= 6.0.0"
}
},
"node_modules/async-limiter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -112,6 +118,11 @@
"node": "*"
}
},
"node_modules/buffer-from": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"node_modules/chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
@ -122,6 +133,52 @@
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"node_modules/concat-stream": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"engines": [
"node >= 0.8"
],
"dependencies": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
}
},
"node_modules/concat-stream/node_modules/readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"node_modules/concat-stream/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/concat-stream/node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dependencies": {
"safe-buffer": "~5.1.0"
}
},
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"node_modules/cross-fetch": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz",
@ -159,6 +216,19 @@
"once": "^1.4.0"
}
},
"node_modules/es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
},
"node_modules/es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
"dependencies": {
"es6-promise": "^4.0.3"
}
},
"node_modules/extract-zip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
@ -286,6 +356,11 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@ -297,6 +372,17 @@
"node": ">=8"
}
},
"node_modules/mime": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
"integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@ -308,6 +394,22 @@
"node": "*"
}
},
"node_modules/minimist": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
},
"node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
@ -410,6 +512,11 @@
"node": ">=8"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"node_modules/progress": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
@ -455,6 +562,102 @@
"node": ">=14.1.0"
}
},
"node_modules/puppeteer-core": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-1.9.0.tgz",
"integrity": "sha512-dn6z40tv0tDHbzeXzTavmAFCcIlPQdvx2qbziu/QN3yBiC3HJ6i8YeS1QZ73xS8eeYtcEgywzbTXOc38eOaFBQ==",
"hasInstallScript": true,
"dependencies": {
"debug": "^3.1.0",
"extract-zip": "^1.6.6",
"https-proxy-agent": "^2.2.1",
"mime": "^2.0.3",
"progress": "^2.0.0",
"proxy-from-env": "^1.0.0",
"rimraf": "^2.6.1",
"ws": "^5.1.1"
},
"engines": {
"node": ">=6.4.0"
}
},
"node_modules/puppeteer-core/node_modules/agent-base": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
"integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
"dependencies": {
"es6-promisify": "^5.0.0"
},
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/puppeteer-core/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/puppeteer-core/node_modules/extract-zip": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz",
"integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==",
"dependencies": {
"concat-stream": "^1.6.2",
"debug": "^2.6.9",
"mkdirp": "^0.5.4",
"yauzl": "^2.10.0"
},
"bin": {
"extract-zip": "cli.js"
}
},
"node_modules/puppeteer-core/node_modules/extract-zip/node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dependencies": {
"ms": "2.0.0"
}
},
"node_modules/puppeteer-core/node_modules/extract-zip/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"node_modules/puppeteer-core/node_modules/https-proxy-agent": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
"integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==",
"dependencies": {
"agent-base": "^4.3.0",
"debug": "^3.1.0"
},
"engines": {
"node": ">= 4.5.0"
}
},
"node_modules/puppeteer-core/node_modules/rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"dependencies": {
"glob": "^7.1.3"
},
"bin": {
"rimraf": "bin.js"
}
},
"node_modules/puppeteer-core/node_modules/ws": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz",
"integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==",
"dependencies": {
"async-limiter": "~1.0.0"
}
},
"node_modules/readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
@ -545,6 +748,11 @@
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"node_modules/typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"node_modules/unbzip2-stream": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
@ -632,6 +840,11 @@
"debug": "4"
}
},
"async-limiter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -675,6 +888,11 @@
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="
},
"buffer-from": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
@ -685,6 +903,51 @@
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"concat-stream": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"requires": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
},
"dependencies": {
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
}
},
"core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"cross-fetch": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz",
@ -714,6 +977,19 @@
"once": "^1.4.0"
}
},
"es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
},
"es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
"requires": {
"es6-promise": "^4.0.3"
}
},
"extract-zip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
@ -801,6 +1077,11 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@ -809,6 +1090,11 @@
"p-locate": "^4.1.0"
}
},
"mime": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
"integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg=="
},
"minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@ -817,6 +1103,19 @@
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
},
"mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"requires": {
"minimist": "^1.2.6"
}
},
"mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
@ -887,6 +1186,11 @@
"find-up": "^4.0.0"
}
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"progress": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
@ -925,6 +1229,90 @@
"ws": "8.6.0"
}
},
"puppeteer-core": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-1.9.0.tgz",
"integrity": "sha512-dn6z40tv0tDHbzeXzTavmAFCcIlPQdvx2qbziu/QN3yBiC3HJ6i8YeS1QZ73xS8eeYtcEgywzbTXOc38eOaFBQ==",
"requires": {
"debug": "^3.1.0",
"extract-zip": "^1.6.6",
"https-proxy-agent": "^2.2.1",
"mime": "^2.0.3",
"progress": "^2.0.0",
"proxy-from-env": "^1.0.0",
"rimraf": "^2.6.1",
"ws": "^5.1.1"
},
"dependencies": {
"agent-base": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
"integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
"requires": {
"es6-promisify": "^5.0.0"
}
},
"debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"requires": {
"ms": "^2.1.1"
}
},
"extract-zip": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz",
"integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==",
"requires": {
"concat-stream": "^1.6.2",
"debug": "^2.6.9",
"mkdirp": "^0.5.4",
"yauzl": "^2.10.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"https-proxy-agent": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
"integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==",
"requires": {
"agent-base": "^4.3.0",
"debug": "^3.1.0"
}
},
"rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"requires": {
"glob": "^7.1.3"
}
},
"ws": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz",
"integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==",
"requires": {
"async-limiter": "~1.0.0"
}
}
}
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
@ -989,6 +1377,11 @@
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"unbzip2-stream": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",

Zobrazit soubor

@ -9,6 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"puppeteer": "^14.1.1"
"puppeteer": "^14.1.1",
"puppeteer-core": "^1.9.0"
}
}

Zobrazit soubor

@ -1,5 +1,6 @@
import { assertEquals } from "https://deno.land/std@0.119.0/testing/asserts.ts";
import { UTXOEngine } from "./engine.js";
import { getDate, isPeriodOverlap } from "./periods.js";
// initialize ajv JSON Schema validator
import Ajv from "https://esm.sh/ajv@8.8.1?pin=v58";
@ -139,5 +140,96 @@ for (const entryId of utxo.entriesList()) {
}
});
}
if (["schedule"].includes(specId)) {
Deno.test(`UTXO.${entryId}: ${specId}[rules]`, () => {
const usedEvs = [];
for (const item of entry.specs[specId]) {
const ev = entry.specs.events.find((e) => e.id === item.event);
// fixed.date
if (ev.fixed && ev.fixed.date) {
const evDate = getDate(item.period.start);
if (evDate !== ev.fixed.date) {
throw new Error(
`Break fixed date [${ev.id}] - fixed: ${ev.fixed.date}, scheduled: ${evDate}`,
);
}
}
// fixed.stage
if (ev.fixed && ev.fixed.stage && ev.fixed.stage !== item.stage) {
throw new Error(
`Break fixed.stage [${ev.id}] - fixed: ${ev.fixed.stage}, scheduled: ${item.stage}`,
);
}
// paralel events for speakers
for (
const si of entry.specs[specId].filter((e) => e.id !== item.id)
) {
if (!isPeriodOverlap(item.period, si.period)) {
continue;
}
const sev = entry.specs.events.find((e) => e.id === si.event);
for (const sp of sev.speakers) {
if (ev.speakers.includes(sp)) {
throw new Error(
`Speaker have overlapping events [${sp}]: ${ev.id} + ${sev.id}`,
);
}
}
}
// availability rules
for (const sp of ev.speakers) {
const speaker = entry.specs.speakers.find((s) => s.id === sp);
if (!speaker.available || speaker.available.length === 0) {
continue;
}
let ok = false;
for (const av of speaker.available) {
const period = { start: av.from, end: av.to };
if (isPeriodOverlap(item.period, period)) {
ok = true;
}
}
if (!ok) {
throw new Error(
`Speaker availability rule break [${sp}]: ${
JSON.stringify(item.period)
}`,
);
}
}
for (
const si of entry.specs[specId].filter((e) =>
e.stage === item.stage && item.id !== e.id
)
) {
if (isPeriodOverlap(item.period, si.period)) {
throw new Error(
`Overlapping events on same stage (?): ${item.event} vs ${si.event}`,
);
}
}
if (usedEvs.includes(ev.id)) {
throw new Error(`Duplicate event (?): ${ev.id}`);
}
usedEvs.push(ev.id);
}
for (
const ev of entry.specs.events.filter((s) =>
!["lightning"].includes(s.type)
)
) {
if (!usedEvs.includes(ev.id)) {
throw new Error(`Event not found in schedule: ${ev.id}`);
}
}
});
}
}
}