Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/plugin-fn-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: PDF Flow-Node

on:
push:
paths:
- 'api-builder-plugin-fn-pdf/**'
pull_request:
paths:
- 'api-builder-plugin-fn-pdf/**'
release:
types:
- published

defaults:
run:
working-directory: api-builder-plugin-fn-pdf

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm test

publish-gpr:
if: contains(github.event.release.tag_name, 'plugin-fn-pdf')
env:
CI: true
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: '@Axway-API-Builder-Ext'
- name: Publish to GitHub package repo
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
npm ci
npm publish

publish-npm:
env:
CI: true
needs: [build, publish-gpr]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Publish to NPM package repo
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: |
npm ci
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" > ~/.npmrc
npm publish --access public
1 change: 1 addition & 0 deletions api-builder-plugin-fn-pdf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
49 changes: 49 additions & 0 deletions api-builder-plugin-fn-pdf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# @axway/api-builder-plugin-fn-pdf

PDF flow-node for [API Builder](https://docs.axway.com/bundle/api-builder/page/docs/index.html) provides functions to generate and parse PDF files.

## Install

Install within an API Builder project using:

```bash
npm install @axway-api-builder-ext/api-builder-plugin-fn-pdf
```

## Methods

The following sections provide details of the PDF flow-node methods.

### Generate PDF from markdown

Generates PDF from markdown text using https://www.npmjs.com/package/md-to-pdf.

#### Parameters

| Parameter | Type | Description | Configuration selection | Required |
| --- | --- | --- | --- | --- |
| Markdown | string | A github flavored markdown string. | Selector, String | Yes |

#### Outputs

| Output | Type | Description | Save output value as: |
| --- | --- | --- | --- |
| Next | any | The PDF data. | `$.pdf` |
| Error | any | The PDF generation failed. | `$.error` |

### Parse PDF data

Parses a PDF using https://www.npmjs.com/package/pdf-parse.

#### Parameters

| Parameter | Type | Description | Configuration selection | Required |
| --- | --- | --- | --- | --- |
| Data | Buffer | A PDF Buffer. | Selector, Object | Yes |

#### Outputs

| Output | Type | Description | Save output value as: |
| --- | --- | --- | --- |
| Next | any | The parsed PDF. | `$.parsedPdf` |
| Error | any | PDF parsing failed. | `$.error` |
Loading