1.0.5 • Published 2 years ago

@zeushq/zstatus-node v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

zstatus-node

Install

npm i zstatus-node or yarn add zstatus-node

Documentation

https://docs.zstatus.io

Create an API Client

Create an API key for your page on the Api Keys tab of your page management dashboard.

const api = new ZStatusClient({
  apiKey: "[API_KEY]"
});

Pagination

ZStatus uses cursor based pagination with the following param structure:

interface APIPaginationArgs {
  skip?: number;
  take?: number;
  after?: string; // record ID or cursor
  before?: string; // record ID or cursor
  first?: number;
  last?: number;
}

Search a resource

const services = await api.getServices({ })

Searches will return the following paginated response structure:

interface PaginatedResponse<T> {
  edges: APINode<T>[];
  totalCount: number;
  pageInfo: APIPageInfo;
}

interface APINode<T> {
  cursor: string;
  node: T;
}

interface APIPageInfo {
  hasNextPage: boolean;
  hasPreviousPage: boolean;
  startCursor?: string;
  endCursor?: string;
}

Get a resource record

const services = await api.getService("cl4ws9q7e0213tovc0kd5rl8m")

Create a resource record

const service = await api.createService({ 
  name: "API"
})

Update a resource record

const service = await api.updateService("cl4ws9q7e0213tovc0kd5rl8m", { 
  name: "Frontend"
})

Delete a resource record

const result = await api.deleteService("cl4ws9q7e0213tovc0kd5rl8m")

Resources

  • ApiKey
  • Incident
  • Integration
  • Invitation
  • Member
  • Service
  • ServiceGroup
  • StatusOption
  • Subscription
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago