/** * State object * @typedef {Object} HttpState * @property data - the parsed response body * @property response - the response from the HTTP server, including headers, statusCode, body, etc * @property references - an array of all previous data objects used in the Job * @private **/ /** * @typedef {Object} RequestBody * @property {string} query - The GraphQL query string * @property {object} variables - The variables for that query string */ /** * @typedef {Object} GetItemsVariables * @property {string} key - The unique key of each item in the list * @property {string} storeId - The msupply store id the list is being fetched from */ /** * @typedef {Object} InsertOutboundShipmentvariables * @property {string} otherPartyId - The recieving party id * @property {string} storeId - The id of the store the shipment is being made from */ /** * @typedef {Object} UpsertOutboundShipmentvariables * @property {Object} input - The payload for the target shipment * @property {string} storeId - The id of the store the shipment is being made from */ /** * Get the list of items in the catalogue * @public * @function * @example Get items in the catalogue * getItemsWithStats({ "key": "name", "storeId": "DFE0F611AD84A0419D36F8FEFAD1894C", }) * @param {GetItemsVariables} variables - GraphQL query variables * @returns {Operation} * @state {HttpState} */ export function getItemsWithStats(variables: GetItemsVariables): Operation; /** * Create an outbound shipment. * @public * @function * @example Create an outbound shipment * insertOutboundShipment({ "otherPartyId": "861102F624354F15ABEB48DC207A4C2D", "storeId": "DFE0F611AD84A0419D36F8FEFAD1894C" }) * @param {InsertOutboundShipmentvariables} variables - GraphQL query variables * @returns {Operation} * @state {HttpState} */ export function insertOutboundShipment(variables: InsertOutboundShipmentvariables): Operation; /** * Update an outbound shipment * @public * @function * @example Update outbound shipment status to 'PICKED' * upsertOutboundShipment({ * "storeId": "DFE0F611AD84A0419D36F8FEFAD1894C", * "input": { * "updateOutboundShipments": [ * { * "id": "01961fce-9ef6-7198-93c1-866395094e48", * "status": "PICKED" * } * ] * } * }) * @param {UpsertOutboundShipmentvariables} variables - GraphQL query variables * @returns {Operation} * @state {HttpState} */ export function upsertOutboundShipment(variables: UpsertOutboundShipmentvariables): Operation; /** * Make a generic GraphQL request * @public * @function * @example * query(` query isCentralServer { isCentralServer }` ) *@param {string} query - GraphQl query string *@param {Object} variables - GraphQl query variables * @returns {Operation} * @state {HttpState} */ export function query(query: string, variables?: any): Operation; /** * State object */ export type HttpState = { /** * - the parsed response body */ data: any; /** * - the response from the HTTP server, including headers, statusCode, body, etc */ response: any; /** * - an array of all previous data objects used in the Job */ references: any; }; export type RequestBody = { /** * - The GraphQL query string */ query: string; /** * - The variables for that query string */ variables: object; }; export type GetItemsVariables = { /** * - The unique key of each item in the list */ key: string; /** * - The msupply store id the list is being fetched from */ storeId: string; }; export type InsertOutboundShipmentvariables = { /** * - The recieving party id */ otherPartyId: string; /** * - The id of the store the shipment is being made from */ storeId: string; }; export type UpsertOutboundShipmentvariables = { /** * - The payload for the target shipment */ input: any; /** * - The id of the store the shipment is being made from */ storeId: string; }; export { combine, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, group, lastReferenceValue, log, merge, scrubEmojis, sourceValue, util } from "@openfn/language-common";