1.0.0 • Published 7 months ago

@keeex/maintenance-sdk v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

KeeeX maintenance SDK

Allow manipulation and retrieval of the KeeeX infrastructure maintenance info. This is used as an in-app communication channel to notify user of planned events such as maintenance or ongoing incidents.

App usage

Call getAppStatus() with your app name and the locale to use (if available). You can repeat these calls as needed to update, the default settings will keep data cached for five minutes anyway.

Example:

import {getAppStatus} from "@keeex/maintenance-sdk";

const info = await getAppStatus({appName: "testapp", locale: "fr"});

Which will contain:

{
  events: [
    {
      active: true,
      endAt: 2025-04-03T13:20:00.000Z,
      infrastructure: true,
      links: undefined,
      message: 'Message de test infra',
      startAt: 2025-03-27T13:20:23.404Z,
      type: 'incident',
      id: -872298049
    },
    {
      active: false,
      endAt: 2025-03-29T13:21:00.000Z,
      infrastructure: false,
      links: undefined,
      message: 'Message de test app',
      startAt: 2025-03-28T13:21:00.000Z,
      type: 'maintenance',
      id: -947147315
    }
  ],
  links: {},
  oldDismissed: Set(0) {},
  updatedAt: 2025-03-27T13:22:24.417Z
}

Keeping track of hidden events

Each event is associated to a numeric ID. These IDs are not sequential, but are relatively unique per event. An application that wants to keep track of events that the user hid can store these IDs, as they'll remain constant through multiple updates.

If an application is using an IDs for an event that was deleted, it is notified in the reply of getAppStatus() so that the application can discard the information efficiently.

Updating the maintenance data

Maintenance data are mainly updated by using @keeex/maintenance-tool. See the appropriate directory in the repository config_sysadmin for more details.