Skip to content

Commit

Permalink
Added readItemByDocument API
Browse files Browse the repository at this point in the history
  • Loading branch information
verheyenkoen committed Jul 13, 2023
1 parent 405f12e commit 5c8832c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ declare function itemData(docNumber: string): Promise<Aleph.BaseResponse>;
declare function present(setNumber: string, setEntry: string): Promise<Aleph.BaseResponse>;

declare function readItem(barcode: string): Promise<Aleph.ReadItemResponse>;
declare function readItemByDocument(doc_number: string, item_sequence: string): Promise<Aleph.BaseResponse>;

declare function updateItem(docNumber: string, itemSequence: string, ...data: object[] | string[]): Promise<Aleph.BaseResponse>;

export { Aleph, borrowerInfo, find, findDocument, holdRequest, holdRequestCancel, itemData, present, readItem, updateItem };
export { Aleph, borrowerInfo, find, findDocument, holdRequest, holdRequestCancel, itemData, present, readItem, readItemByDocument, updateItem };
3 changes: 2 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ declare function itemData(docNumber: string): Promise<Aleph.BaseResponse>;
declare function present(setNumber: string, setEntry: string): Promise<Aleph.BaseResponse>;

declare function readItem(barcode: string): Promise<Aleph.ReadItemResponse>;
declare function readItemByDocument(doc_number: string, item_sequence: string): Promise<Aleph.BaseResponse>;

declare function updateItem(docNumber: string, itemSequence: string, ...data: object[] | string[]): Promise<Aleph.BaseResponse>;

export { Aleph, borrowerInfo, find, findDocument, holdRequest, holdRequestCancel, itemData, present, readItem, updateItem };
export { Aleph, borrowerInfo, find, findDocument, holdRequest, holdRequestCancel, itemData, present, readItem, readItemByDocument, updateItem };
7 changes: 7 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ __export(aleph_fetch_exports, {
itemData: () => itemData,
present: () => present,
readItem: () => readItem,
readItemByDocument: () => readItemByDocument,
updateItem: () => updateItem
});
module.exports = __toCommonJS(aleph_fetch_exports);
Expand Down Expand Up @@ -214,6 +215,11 @@ function readItem(barcode) {
return yield alephFetch("read-item", { item_barcode: barcode });
});
}
function readItemByDocument(doc_number, item_sequence) {
return __async(this, null, function* () {
return yield alephFetch("read-item", { doc_number, item_sequence });
});
}

// update-item.ts
var import_jstoxml = __toESM(require("jstoxml"));
Expand Down Expand Up @@ -259,5 +265,6 @@ function updateItem(docNumber, itemSequence, ...data) {
itemData,
present,
readItem,
readItemByDocument,
updateItem
});
6 changes: 6 additions & 0 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ function readItem(barcode) {
return yield alephFetch("read-item", { item_barcode: barcode });
});
}
function readItemByDocument(doc_number, item_sequence) {
return __async(this, null, function* () {
return yield alephFetch("read-item", { doc_number, item_sequence });
});
}

// update-item.ts
import jstoxml from "jstoxml";
Expand Down Expand Up @@ -217,5 +222,6 @@ export {
itemData,
present,
readItem,
readItemByDocument,
updateItem
};
4 changes: 4 additions & 0 deletions read-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ import alephFetch from './util/aleph-fetch'
export async function readItem(barcode: string): Promise<Aleph.ReadItemResponse> {
return await alephFetch('read-item', { item_barcode: barcode })
}

export async function readItemByDocument(doc_number: string, item_sequence: string) {
return await alephFetch('read-item', { doc_number, item_sequence })
}

0 comments on commit 5c8832c

Please sign in to comment.