Newer
Older
web-services / loterre-resolvers / v1 / D63 / expand.ini
@Nicolas Thouvenin Nicolas Thouvenin on 2 Dec 2022 1 KB fix: default value
# OpenAPI Documentation - JSON format (dot notation)
post.operationId = post-v1-D63-expand
post.responses.default.description = Return all objects with enrich fields
post.responses.default.content.application/json.schema.$ref =  #/components/schemas/JSONStream
post.summary = Enrich on field of each Object with a SKOS concept
post.requestBody.required = true
post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.parameters.0.in = query
post.parameters.0.name = path
post.parameters.0.schema.type = string
post.parameters.0.description = The path in each object to enrcih with a SKOS Cocnept
post.parameters.1.in = query
post.parameters.1.name = indent
post.parameters.1.schema.type = boolean
post.parameters.1.description = Indent or not the JSON Result

[env]
path = primer
value = https://inist-wsdata.dboard.inist.fr/loterre-resolvers-communes.xml

path = weekNumber
value = thru(() => new Date()).thru(currentDate => Math.floor((currentDate - (new Date(currentDate.getFullYear(), 0, 1)))/(24 * 60 * 60 * 1000))).thru(days => Math.ceil(days / 7))

# Necessary plugins
[use]
plugin = basics
plugin = analytics
plugin = storage

# Flow configuration
[JSONParse]
separator = *

[expand]
path = value
size = 1
cacheName = env('weekNumber').prepend('post-v1-D63-expand-week')

[expand/assign]
path = value
value = fix(_.deburr(String(self.value).replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/\s]/g, '').toLowerCase()))

[expand/combine]
path = value
primer = env('primer')
file = ./v1/combine.ini
cacheName = env('weekNumber').prepend('post-v1-D63-combine-week')

[expand/remove]
test = get('value.value').isString()

[expand/replace]
path = id
value = get('id')
path = value
value = get('value.value')

; Pour les documents sans résulat, on donne une valeur par défaut
[swing]
test = get('value.rdf$about').isEmpty()
[swing/assign]
path = value
value = fix('n/a')

[dump]
indent = env('indent', false)