@pdf-generator/client@1.0

A TypeScript SDK client for the localhost API.

Usage

First, install the SDK from npm.

npm install @pdf-generator/client --save

Next, try it out.

import {
  Configuration,
  DocumentsApi,
} from '@pdf-generator/client';
import type { DeleteRequest } from '@pdf-generator/client';

async function example() {
  console.log("🚀 Testing @pdf-generator/client SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: api-key
    apiKey: "YOUR API KEY",
  });
  const api = new DocumentsApi(config);

  const body = {
    // string | Document filename
    lookup: lookup_example,
  } satisfies DeleteRequest;

  try {
    const data = await api._delete(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Documentation

API Endpoints

All URIs are relative to /api

ClassMethodHTTP requestDescription
DocumentsApi_deleteDELETE /documents/{lookup}Delete document(s) by name
DocumentsApilistGET /documentsList documents
DocumentsApiretrieveGET /documents/{key}Download a document
PdfTemplateApicreatePOST /pdf-templateCreate a template
PdfTemplateApicreateFilesPOST /pdf-template/{id}/filesUpload template files
PdfTemplateApicreateFromZipPOST /pdf-template/from-zipCreate template from ZIP
PdfTemplateApideleteFileDELETE /pdf-template/{id}/files/{file}Delete a file
PdfTemplateApidestroyDELETE /pdf-template/{lookup}Delete a template
PdfTemplateApiexportAsZipGET /pdf-template/{id}/files/export-zipExport template files as ZIP archive
PdfTemplateApigetContextSchemaGET /pdf-template/{id}/context-schemaGet JSON schema for template variables
PdfTemplateApigetDefaultValuesGET /pdf-template/{id}/variables-default-valuesGet template variable default values
PdfTemplateApigetFileContentGET /pdf-template/{id}/files/content/{file}Download file content
PdfTemplateApigetFileTypeGET /pdf-template/{id}/files/type/{file}Get file type
PdfTemplateApiimportZipPOST /pdf-template/{id}/files/import-zipUpload files from ZIP
PdfTemplateApilistGET /pdf-templateList templates
PdfTemplateApilistFilesGET /pdf-template/{id}/filesList template files
PdfTemplateApirenderPOST /pdf-template/renderRender a PDF
PdfTemplateApireplacePUT /pdf-template/{lookup}Replace a template
PdfTemplateApiretrieveGET /pdf-template/{lookup}Get a template
PdfTemplateApiupdatePATCH /pdf-template/{lookup}Update a template
TemplateVariablesApicreatePOST /template-variablesCreate a variable
TemplateVariablesApidestroyDELETE /template-variables/{lookup}Delete a variable
TemplateVariablesApilistGET /template-variablesList template variables
TemplateVariablesApireplacePUT /template-variables/{lookup}Replace a variable
TemplateVariablesApiretrieveGET /template-variables/{lookup}Get a variable
TemplateVariablesApiupdatePATCH /template-variables/{lookup}Update a variable

Models

Authorization

Authentication schemes defined for the API:

api-key

  • Type: API key
  • API key parameter name: Api-Key
  • Location: HTTP header

About

This TypeScript SDK client supports the Fetch API and is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0
  • Generator version: 7.23.0
  • Build package: org.openapitools.codegen.languages.TypeScriptFetchClientCodegen

The generated npm module supports the following:

  • Environments
    • Node.js
    • Webpack
    • Browserify
  • Language levels
    • ES5 - you must have a Promises/A+ library installed
    • ES6
  • Module systems
    • CommonJS
    • ES6 module system

Development

Building

To build the TypeScript source code, you need to have Node.js and npm installed. After cloning the repository, navigate to the project directory and run:

npm install
npm run build

Publishing

Once you've built the package, you can publish it to npm:

npm publish

License