Documentation

Échange intelligent

Distribution et collecte coordonnées d'objets entre bots.

collectPickDisable

Désactive le rôle de récupérateur (picker) dans le mode de collecte automatique.

api.smartExchange.collectPickDisable: () => void

Exemple

api.smartExchange.collectPickDisable();

collectPickEnable

Active le rôle de récupérateur (picker) sur le sous-topic donné, en tenant compte ou non de la cellule.

api.smartExchange.collectPickEnable: (subtopic: string, doesCellIdMatter: boolean) => void

Exemple

api.smartExchange.collectPickEnable('suicides', false);

collectPickNbThrowers

Renvoie le nombre de lanceurs (throwers) actuellement enregistrés pour la collecte.

api.smartExchange.collectPickNbThrowers: () => number

Exemple

const throwers = api.smartExchange.collectPickNbThrowers();

collectPickProcess

Exécute la récupération des items lancés jusqu'au délai ou au pourcentage de remplissage indiqué.

api.smartExchange.collectPickProcess: (timeout: number, fullPct?: number) => Promise<boolean>

Exemple

const ok = await api.smartExchange.collectPickProcess(0, 95);

collectThrowAvailablePickers

Renvoie les récupérateurs (pickers) actuellement disponibles pour recevoir des items collectés.

api.smartExchange.collectThrowAvailablePickers: () => SmartExRegistrationMessage[]

Exemple

const pickers = api.smartExchange.collectThrowAvailablePickers();

collectThrowDisable

Désactive le rôle de lanceur (thrower) dans le mode de collecte automatique.

api.smartExchange.collectThrowDisable: () => void

Exemple

api.smartExchange.collectThrowDisable();

collectThrowEnable

Active le rôle de lanceur (thrower) sur le sous-topic donné pour la collecte.

api.smartExchange.collectThrowEnable: (subtopic: string) => void

Exemple

api.smartExchange.collectThrowEnable('suicides');

collectThrowProcess

Envoie les items (par gid) vers un récupérateur disponible et attend la fin de l'échange.

api.smartExchange.collectThrowProcess: (...ids: number[]) => Promise<boolean>

Exemple

const ok = await api.smartExchange.collectThrowProcess(1519, 1522);

dispatchPickAvailableThrowers

Renvoie les lanceurs (throwers) disponibles pour fournir des items en mode distribution (dispatch).

api.smartExchange.dispatchPickAvailableThrowers: () => SmartExRegistrationMessage[]

Exemple

const throwers = api.smartExchange.dispatchPickAvailableThrowers();

dispatchPickDisable

Désactive le rôle de récupérateur (picker) dans le mode de distribution (dispatch).

api.smartExchange.dispatchPickDisable: () => void

Exemple

api.smartExchange.dispatchPickDisable();

dispatchPickEnable

Active le rôle de récupérateur (picker) sur le sous-topic donné en mode distribution (dispatch).

api.smartExchange.dispatchPickEnable: (subtopic: string) => void

Exemple

api.smartExchange.dispatchPickEnable('dispatch/bois');

dispatchPickProcess

Demande des items (gid et quantité) à un lanceur et renvoie le succès ainsi que les ruptures de stock.

api.smartExchange.dispatchPickProcess: ( timeout: number, ...ids: ItemGidEntry[] ) => Promise<DispatchPickerProcessResult>

Exemple

const { success, outOfStock } = await api.smartExchange.dispatchPickProcess(
  60 * 1000,
  { gid: 1519, qty: 100 }
);

dispatchThrowDisable

Désactive le rôle de lanceur (thrower) dans le mode de distribution (dispatch).

api.smartExchange.dispatchThrowDisable: () => void

Exemple

api.smartExchange.dispatchThrowDisable();

dispatchThrowEnable

Active le rôle de lanceur (thrower) sur le sous-topic donné en mode distribution, cellule optionnelle.

api.smartExchange.dispatchThrowEnable: (subtopic: string, doesCellIdMatter?: boolean) => void

Exemple

api.smartExchange.dispatchThrowEnable('dispatch/bois', true);

dispatchThrowItemRanOut

Signale aux récupérateurs qu'un item (par gid) est en rupture de stock chez le lanceur.

api.smartExchange.dispatchThrowItemRanOut: (gid: number) => void

Exemple

api.smartExchange.dispatchThrowItemRanOut(1519);

dispatchThrowNbPickers

Renvoie le nombre de récupérateurs (pickers) actuellement enregistrés en mode distribution (dispatch).

api.smartExchange.dispatchThrowNbPickers: () => number

Exemple

const pickers = api.smartExchange.dispatchThrowNbPickers();

dispatchThrowProcess

Traite les demandes des récupérateurs jusqu'au délai et renvoie les gid des items distribués.

api.smartExchange.dispatchThrowProcess: (timeout: number) => Promise<number[]>

Exemple

const dispatched = await api.smartExchange.dispatchThrowProcess(60 * 1000);