Table of Contents

Class SxcQuery

Instance Query Service

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Package: Api.Js.SxcJs

Properties

name

Instance Query Service

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
name: string
Property Value
Type Description
string

Methods

getAll()

Instance Query Service

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getAll<T>()
Returns
Type Description
Promise<T>

getAll(string | Record<string, unknown>)

Instance Query Service

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getAll<T>(urlParams: string | Record<string, unknown>)
Parameters
Type Name Description
string | Record<string, unknown> urlParams
Returns
Type Description
Promise<T>

getAll(string | Record<string, unknown>, string | Record<string, unknown>)

Instance Query Service

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getAll<T>(urlParams: string | Record<string, unknown>, data: string | Record<string, unknown>)
Parameters
Type Name Description
string | Record<string, unknown> urlParams
string | Record<string, unknown> data
Returns
Type Description
Promise<T>

getStream(string)

Get just one stream, returning an array of items in that stream

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getStream<T>(stream: string)
Parameters
Type Name Description
string stream
Returns
Type Description
Promise<T[]>

containing an array of items - or empty if stream not found or nothing returned

getStream(string, string | Record<string, unknown>)

Instance Query Service

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getStream<T>(stream: string, urlParams: string | Record<string, unknown>)
Parameters
Type Name Description
string stream
string | Record<string, unknown> urlParams
Returns
Type Description
Promise<T[]>

getStream(string, string | Record<string, unknown>, string | Record<string, unknown>)

Instance Query Service

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getStream<T>(stream: string, urlParams: string | Record<string, unknown>, data: string | Record<string, unknown>)
Parameters
Type Name Description
string stream
string | Record<string, unknown> urlParams
string | Record<string, unknown> data
Returns
Type Description
Promise<T[]>

getStreams(string)

Get a query but only the mentioned streams. This will reduce the amount of data retrieved on queries that have many streams.

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getStreams<T>(streams: string)
Parameters
Type Name Description
string streams
Returns
Type Description
Promise<T>

Promise containing a object with stream-names and items in the streams.

getStreams(string, string | Record<string, unknown>)

Get a query but only the mentioned streams. This will reduce the amount of data retrieved on queries that have many streams.

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getStreams<T>(streams: string, urlParams: string | Record<string, unknown>)
Parameters
Type Name Description
string streams

name of streams to get, comma separated

string | Record<string, unknown> urlParams

additional parameters for the URL, either as a string or as a object

Returns
Type Description
Promise<T>

Promise containing a object with stream-names and items in the streams.

getStreams(string, string | Record<string, unknown>, string | Record<string, unknown>)

Get a query but only the mentioned streams. This will reduce the amount of data retrieved on queries that have many streams.

sxc.query Services of the Sxc Instance

you are here (click to zoom) - discover the stack

A common need in JS is to read/write data from/to the backend.

2sxc 13 introduce new JS APIs for this.

  • data(...) gets a data service to read/write data 👉 docs
  • query(...) gets a query service to call server-side queries (this document)

Note: You can do all what these services do using webApi.fetchJson(...), but this is more convenient.

👉 Check out the Js Data and Query Tutorials

Get a Query Service

  1. Get the Sxc Instance of the current module
  2. Call .query(queryName) to get the service

Example:

const modId = @CmsContext.Module.Id;
const sxc = $2sxc(modId);
const authorsSvc = sxc.query('BlogPosts');
authorsSvc.getAll().then(data => console.log(data));

Query Service Factory Parameters

The query(...) factory just has one parameter: the queryName.

The returned service will always perform actions for this query.

Query Service APIs

Query Services always return a modern Promise containing data.

A Query Service has the following commands:

  • getAll() - no parameters, will return an object with all the streams, each containing an arrays of all the data in that stream
  • getAll(urlParams) - same as above but with url-parameters as a string or object
  • getAll(urlParams, data) - same as above but with post-data
  • getStream(streamName) - Same as GetAll, just using a specific stream name to retrieve
  • getStream(streamName, urlParams) - Same as getStream, just with additional url parameters
  • getStream(streamName, urlParams, data) - Same as before, just with post-data
  • getStreams(streamNames) - Same as GetAll, just using a specific stream name to retrieve - can have multiple stream names comma-separated
  • getStreams(streamNames, urlParams) - Same as above, just with additional url parameters
  • getStreams(streamNames, urlParams, data) - Same as above, just with post-data

Returned Data

getAll and getStreams return multiple streams. The resulting object is based on this structure:

{
  "Default": [
    { ... },
    { ... }
  ],
  "NextStreamName": [
    { ... },
    { ... }
  ]
}

getStream only retrieves one stream, so the it's clear that we don't need to pick by stream. The resulting object is based on this structure.

[
  { ... },
  { ... }
]

You should find some code examples in this demo App

Declaration
function getStreams<T>(streams: string, urlParams: string | Record<string, unknown>, data: string | Record<string, unknown>)
Parameters
Type Name Description
string streams

name of streams to get, comma separated

string | Record<string, unknown> urlParams

additional parameters for the URL, either as a string or as a object

string | Record<string, unknown> data

data to include in case of a POST call - if this is provided, it will use a post

Returns
Type Description
Promise<T>

Promise containing a object with stream-names and items in the streams.