From 1a76ef634df998953b688d582cb81dc18c18f181 Mon Sep 17 00:00:00 2001 From: Aurelien Arino Date: Mon, 20 Mar 2023 13:12:04 +0100 Subject: [PATCH 1/6] fix(chart.getPanels): make the query params optional When the array is empty, the SDK strips the query param from the query, so the schema doesn't type check --- src/routes/chart/get-panels.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/routes/chart/get-panels.ts b/src/routes/chart/get-panels.ts index 0fb2abcd..a756ae32 100644 --- a/src/routes/chart/get-panels.ts +++ b/src/routes/chart/get-panels.ts @@ -13,7 +13,7 @@ const kindsResources = ['pinGroups', 'pins'] as const; type KindsResources = typeof kindsResources[number]; type Request = { - query: Record>; + query: Partial>>; } type Panel = { @@ -24,10 +24,10 @@ type Panel = { }, }; -type Response = Record>; +}>>>; const charts = (apiVersion: number) => Joi.object().keys({ lastMode: Joi.string().valid('manual', 'automatic').example('automatic').required(), @@ -41,19 +41,19 @@ const controllerGeneratorOptions: ControllerGeneratorOptionsWithClient = { method: 'get', path: '/panels', query: Joi.object().keys({ - pinGroupHashIds: Joi.array().items(Joi.string()).max(30).required(), - pinHashIds: Joi.array().items(Joi.string()).max(30).required(), + pinGroupHashIds: Joi.array().items(Joi.string()).max(30), + pinHashIds: Joi.array().items(Joi.string()).max(30), }).required(), right: { environment: 'READ' }, response: (apiVersion: number): Joi.ObjectSchema => Joi.object().keys({ pinGroups: Joi.array().items(Joi.object().keys({ hashId: Joi.string().required().example('dao97'), panel: charts(apiVersion), - }).required()).required(), + }).required()), pins: Joi.array().items(Joi.object().keys({ hashId: Joi.string().required().example('e13d57'), panel: charts(apiVersion), - }).required()).required(), + }).required()), }), description: 'Get multiple chart panels from pinGroups and grids', }; From be78eda1806092f2ce1e4e245c52eb0918a8e121 Mon Sep 17 00:00:00 2001 From: GitHub Actions Documentation Bot <> Date: Mon, 20 Mar 2023 12:14:57 +0000 Subject: [PATCH 2/6] chore: Documentation updated by github actions --- docs/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index ad932533..0083b09f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4473,7 +4473,7 @@

Headers

{
  • "hashId": "b45zo0",
  • "email": "info@acme.com",
  • "name": "John Doe",
  • "timezone": "Europe/Amsterdam",
  • "locale": "en",
  • "phone": "string",
  • "company": "string",
  • "rights": [
    ],
  • "twoFactorAuthenticationEnabled": true
}

userEnvironmentSettings

notificationLevel
required
number or null <float>
Enum: 0 1 2

The user is subscribed to every issue created on locations in this environment (0), when the issue gets serious (1) or when the issue gets critical (2). If null, the user is not autmatically subscribed to new issues.

defaultAnalyticsPanelHashId
required
string or null
{
  • "notificationLevel": 0,
  • "defaultAnalyticsPanelHashId": "7usgt"
}

userSubscription

hashId
required
string
objectType
required
string
Enum: "supplierReportType" "deviceType" "supplierWebhook" "supplierCertificate"
objectHashId
required
string
lastNotification
required
string or null <date-time>
alertsSinceLastNotification
required
integer
createdAt
required
string <date-time>
{
  • "hashId": "dfa1p",
  • "objectType": "deviceType",
  • "objectHashId": "wasd2",
  • "lastNotification": "2020-01-31T11:17Z",
  • "alertsSinceLastNotification": 0,
  • "createdAt": "2019-12-31T15:23Z"
}

webRequest

hashId
required
string
incoming
required
boolean
createdAt
required
string <date-time>
required
object
required
object or null
{
  • "hashId": "1a532q",
  • "incoming": true,
  • "createdAt": "2019-12-31T15:23Z",
  • "request": {
    },
  • "response": {
    }
}