dev-api: add developer portal, OpenAPI spec, and Flatenbadet case study
- New /developers/ page with API docs, SDKs, pricing, use cases - OpenAPI 3.0 spec for Orders, Missions, Photos, Analytics - Case study: Glasskiosken i Flatenbadet — complete ROI analysis - Updated /order/ with recurring missions and frequency dropdown
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
import t from 'tap'
|
||||
import pino from '../../pino.js'
|
||||
import helper from '../helper.js'
|
||||
|
||||
const { sink, check, once } = helper
|
||||
|
||||
t.test('esm support', async ({ equal }) => {
|
||||
const stream = sink()
|
||||
const instance = pino(stream)
|
||||
instance.info('hello world')
|
||||
check(equal, await once(stream, 'data'), 30, 'hello world')
|
||||
})
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
'use strict'
|
||||
|
||||
const t = require('tap')
|
||||
const semver = require('semver')
|
||||
|
||||
const { isYarnPnp } = require('../helper')
|
||||
|
||||
if (!semver.satisfies(process.versions.node, '^13.3.0 || ^12.10.0 || >= 14.0.0') || isYarnPnp) {
|
||||
t.skip('Skip esm because not supported by Node')
|
||||
} else {
|
||||
// Node v8 throw a `SyntaxError: Unexpected token import`
|
||||
// even if this branch is never touch in the code,
|
||||
// by using `eval` we can avoid this issue.
|
||||
// eslint-disable-next-line
|
||||
new Function('module', 'return import(module)')('./esm.mjs').catch((err) => {
|
||||
process.nextTick(() => {
|
||||
throw err
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (!semver.satisfies(process.versions.node, '>= 14.13.0 || ^12.20.0') || isYarnPnp) {
|
||||
t.skip('Skip named exports because not supported by Node')
|
||||
} else {
|
||||
// Node v8 throw a `SyntaxError: Unexpected token import`
|
||||
// even if this branch is never touch in the code,
|
||||
// by using `eval` we can avoid this issue.
|
||||
// eslint-disable-next-line
|
||||
new Function('module', 'return import(module)')('./named-exports.mjs').catch((err) => {
|
||||
process.nextTick(() => {
|
||||
throw err
|
||||
})
|
||||
})
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import { tmpdir, hostname } from 'os'
|
||||
import t from 'tap'
|
||||
import { sink, check, once, watchFileCreated, file } from '../helper.js'
|
||||
import { pino, destination } from '../../pino.js'
|
||||
import { join } from 'path'
|
||||
import { readFileSync } from 'fs'
|
||||
|
||||
t.test('named exports support', async ({ equal }) => {
|
||||
const stream = sink()
|
||||
const instance = pino(stream)
|
||||
instance.info('hello world')
|
||||
check(equal, await once(stream, 'data'), 30, 'hello world')
|
||||
})
|
||||
|
||||
t.test('destination', async ({ same }) => {
|
||||
const tmp = file()
|
||||
const instance = pino(destination(tmp))
|
||||
instance.info('hello')
|
||||
await watchFileCreated(tmp)
|
||||
const result = JSON.parse(readFileSync(tmp).toString())
|
||||
delete result.time
|
||||
same(result, {
|
||||
pid: process.pid,
|
||||
hostname,
|
||||
level: 30,
|
||||
msg: 'hello'
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user