@basetime/a2w-api-ts
Version:
Client library that communicates with the addtowallet API.
52 lines (51 loc) • 1.59 kB
TypeScript
import { DataStore, DataStoreInput } from '../../types/DataStore';
import Endpoint from '../Endpoint';
/**
* Communicate with the `/organization/dataStores*` sub-endpoints.
*
* Accessed via `client.organizations.dataStores`. Provides CRUD over data stores that
* workflows can read from.
*/
export default class OrganizationDataStoresEndpoint extends Endpoint {
/**
* Constructor.
*
* @param parent The parent `OrganizationsEndpoint` whose `req`, `do`, and `qb` are
* reused.
*/
constructor(parent: Endpoint);
/**
* Returns all data stores for the authenticated organization.
*/
getAll: () => Promise<DataStore[]>;
/**
* Returns a single data store by ID.
*
* @param id The ID of the data store.
*/
getById: (id: string) => Promise<DataStore>;
/**
* Creates a new data store.
*
* The backend uses `PUT` for create on this collection (the corresponding `POST` is the
* update verb), matching the route definitions.
*
* @param body The data store to create.
*/
create: (body: DataStoreInput) => Promise<DataStore>;
/**
* Updates an existing data store.
*
* @param id The ID of the data store.
* @param body The new data store values.
*/
update: (id: string, body: DataStoreInput) => Promise<DataStore>;
/**
* Deletes a data store.
*
* Returns the remaining data stores for the organization.
*
* @param id The ID of the data store to delete.
*/
delete: (id: string) => Promise<DataStore[]>;
}