diff --git a/README.md b/README.md index a78dd78..4fc9ac5 100644 --- a/README.md +++ b/README.md @@ -49,14 +49,14 @@ Since `v1.28+` import from npm registry using `npm:` prefix. import { decode, encode, -} from "npm:bysquare@2.8.0"; +} from "npm:bysquare@latest"; ``` ### Browser ```html ``` diff --git a/docs/examples/deno/deno.jsonc b/docs/examples/deno/deno.jsonc index 852ed66..72094e3 100644 --- a/docs/examples/deno/deno.jsonc +++ b/docs/examples/deno/deno.jsonc @@ -1,5 +1,6 @@ { + "lock": false, "tasks": { - "dev": "deno run --watch --allow-all --reload --unstable ./main.ts" + "dev": "deno run --watch --allow-all --reload ./main.ts" } } diff --git a/docs/examples/deno/deno.lock b/docs/examples/deno/deno.lock deleted file mode 100644 index a628b94..0000000 --- a/docs/examples/deno/deno.lock +++ /dev/null @@ -1,37 +0,0 @@ -{ - "version": "2", - "remote": {}, - "npm": { - "specifiers": { - "bysquare": "bysquare@2.1.0", - "bysquare@2.1.0": "bysquare@2.1.0" - }, - "packages": { - "bysquare@2.1.0": { - "integrity": "sha512-L6gc3mIxHquBe7mRmDZ6oZcjI7r3BcQqdjxjeqIbm++Tw953pUdBXPXudxHKVv8GbB1WOOqZA/mcuUZVHHaMOA==", - "dependencies": { - "crc-32": "crc-32@1.2.2", - "lodash.deburr": "lodash.deburr@4.1.0", - "lzma": "lzma@2.3.2", - "rfc4648": "rfc4648@1.5.2" - } - }, - "crc-32@1.2.2": { - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "dependencies": {} - }, - "lodash.deburr@4.1.0": { - "integrity": "sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ==", - "dependencies": {} - }, - "lzma@2.3.2": { - "integrity": "sha512-DcfiawQ1avYbW+hsILhF38IKAlnguc/fjHrychs9hdxe4qLykvhT5VTGNs5YRWgaNePh7NTxGD4uv4gKsRomCQ==", - "dependencies": {} - }, - "rfc4648@1.5.2": { - "integrity": "sha512-tLOizhR6YGovrEBLatX1sdcuhoSCXddw3mqNVAcKxGJ+J0hFeJ+SjeWCv5UPA/WU3YzWPPuCVYgXBKZUPGpKtg==", - "dependencies": {} - } - } - } -} diff --git a/docs/examples/deno/main.ts b/docs/examples/deno/main.ts index 5559930..15331c6 100644 --- a/docs/examples/deno/main.ts +++ b/docs/examples/deno/main.ts @@ -1,13 +1,16 @@ -import { generate } from "npm:bysquare@2.1.0"; +import { + CurrencyCode, + encode, +} from "npm:bysquare"; -const qr = await generate({ +const qr = await encode({ invoiceId: "random-id", payments: [ { type: 1, amount: 100.0, bankAccounts: [{ iban: "SK9611000000002918599669" }], - currencyCode: "EUR", + currencyCode: CurrencyCode.EUR, variableSymbol: "123", }, ], diff --git a/docs/examples/express/package.json b/docs/examples/express/package.json index a104567..352035f 100644 --- a/docs/examples/express/package.json +++ b/docs/examples/express/package.json @@ -6,7 +6,7 @@ "start": "tsx server.ts" }, "dependencies": { - "bysquare": "2.4.0", + "bysquare": "latest", "express": "~4.18.0" }, "devDependencies": { diff --git a/docs/examples/express/server.ts b/docs/examples/express/server.ts index 6a7eefa..f9ba6f5 100644 --- a/docs/examples/express/server.ts +++ b/docs/examples/express/server.ts @@ -1,7 +1,7 @@ -// import { DataModel, generate, PaymentOptions } from "./../../../dist/index.js" +// import { DataModel, encode, PaymentOptions } from "./../../../dist/index.js" import { DataModel, - generate, + encode, PaymentOptions, } from "bysquare"; import express from "express"; @@ -32,12 +32,11 @@ const app = express(); app.use("/", publicFolder); app.get("/qr", async (_req, res) => { - const qrstring = await generate(model); + const qrstring = await encode(model); console.log(qrstring); res.send(qrstring); }); -const port = 4_000; -app.listen(port, () => { - console.log(`Example app listening at http://localhost:${port}`); +app.listen(4_000, () => { + console.log(`Example app listening at http://localhost:${4_000}`); }); diff --git a/docs/examples/web/basic/index.js b/docs/examples/web/basic/index.js index aba6d51..5e0cdbc 100644 --- a/docs/examples/web/basic/index.js +++ b/docs/examples/web/basic/index.js @@ -2,7 +2,7 @@ import { CurrencyCode, encode, PaymentOptions, -} from "https://esm.sh/bysquare@2.8.3/"; +} from "https://esm.sh/bysquare@latest/"; import { qrcanvas } from "https://esm.sh/qrcanvas@3.1.2/"; function getEncodedText(iban, amount, variable) { diff --git a/docs/examples/web/lit/index.js b/docs/examples/web/lit/index.js index 208c761..d6cebf1 100644 --- a/docs/examples/web/lit/index.js +++ b/docs/examples/web/lit/index.js @@ -2,11 +2,11 @@ import { CurrencyCode, encode, PaymentOptions, -} from "https://esm.sh/bysquare@2.7.1/"; +} from "https://esm.sh/bysquare@latest/"; import { html, LitElement, -} from "https://esm.sh/lit@3.0.0/"; +} from "https://esm.sh/lit@3.1.0/"; import { qrcanvas } from "https://esm.sh/qrcanvas@3.1.2/"; /** diff --git a/docs/examples/web/preact/index.js b/docs/examples/web/preact/index.js index cc2603e..404b79f 100644 --- a/docs/examples/web/preact/index.js +++ b/docs/examples/web/preact/index.js @@ -2,7 +2,7 @@ import { CurrencyCode, encode, PaymentOptions, -} from "https://esm.sh/bysquare@2.7.1/"; +} from "https://esm.sh/bysquare@latest/"; import { Component, createRef,