This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.LocalDate; | |
import java.time.LocalDateTime; | |
import java.time.format.DateTimeFormatter; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | |
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; | |
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys, requests, base64, re | |
import xml.etree.ElementTree as ET | |
NS = {'exl': 'http://com/exlibris/repository/acq/invoice/xmlbeans'} | |
URL = 'https://api-na.hosted.exlibrisgroup.com' | |
def process_invoice( invoice ): | |
id = invoice.find('exl:unique_identifier', NS).text | |
number_of_attachments = invoice.find('exl:number_of_attachments', NS) | |
if (number_of_attachments is None or int(number_of_attachments.text) > 0): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM lambci/lambda:build-nodejs12.x | |
RUN yum install -y \ | |
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ | |
https://rpms.remirepo.net/enterprise/remi-release-7.rpm | |
RUN yum install -y \ | |
ImageMagick-devel openjpeg-devel jasper-devel glib2-devel \ | |
expat-devel libtiff-devel openslide-devel giflib-devel libpng-devel \ | |
libjpeg-turbo-devel libgsf-devel poppler-glib librsvg2-devel libimagequant \ | |
libgsf-devel libexif-devel wget nodejs python3 && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const bodyParser = require('body-parser'); | |
const crypto = require('crypto'); | |
const app = express() | |
const port = 8000 | |
const webhook_secret = process.env.WEBHOOK_SECRET || '1234' | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: false })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.Base64; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
public class ValidateSignature { | |
public static String encode(String key, byte[] data) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
AWS_BUCKET="na-st01.ext.exlibrisgroup.com" | |
FILENAME=`basename "$1"` | |
FOLDER=$((1 + RANDOM % 32767)) | |
if [ $# -lt 2 ]; then | |
echo "Usage: `basename $0` file-name representation-id institution [file-label]" | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IFS=$'\n' # break on newline only | |
echo "Getting invoices ready for payment" | |
invoices=`curl -s --fail -H "Authorization: apikey $ALMA_APIKEY" -H "Accept: application/json" "https://api-na.hosted.exlibrisgroup.com/almaws/v1/acq/invoices?invoice_workflow_status=Waiting%20to%20be%20Sent&view=brief" | jq -c '.invoice | .[]'`; | |
for id in $invoices; do | |
echo "Marking invoice $(echo $id | jq -r '.number') as sent to ERP" | |
curl -s -o /dev/null -X POST -H "Authorization: apikey $ALMA_APIKEY" -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{}' "https://api-na.hosted.exlibrisgroup.com/almaws/v1/acq/invoices/$(echo $id | jq -r '.id')?op=mark_in_erp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.LocalDate; | |
import java.time.LocalDateTime; | |
import java.time.format.DateTimeFormatter; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | |
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; | |
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { PerformanceObserver, performance } = require('perf_hooks'); | |
const alma = require('almarestapi-lib'); | |
const records = 10000; | |
const limit = 25; | |
const url = '/users?view=brief'; | |
const arrayName = 'user'; | |
var offset = 0, total = 0, processed = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Refit; | |
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace refitalma | |
{ | |
[Headers("Accept: application/json")] | |
public interface IAlmaApi |