Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements #10

Merged
merged 3 commits into from
Jan 31, 2024
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2023 Doczilla. (https://www.doczilla.app)
Copyright (C) 2023 Doczilla. (https://doczilla.app)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ yarn add @doczilla/node
## Usage

The package needs to be configured with your account's API key, which is
available your [Doczilla's organisation settings page](https://www.doczilla.app/login).
available your [Doczilla's organisation settings page](https://doczilla.app/login).

```ts
import Doczilla from '@doczilla/node';

const doczilla = new Doczilla('doczilla-...')

const pdfBuffer = await doczilla.pdf.direct({
url: 'https://www.doczilla.app'
url: 'https://doczilla.app'
})
```

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": {
"name": "Doczilla",
"email": "[email protected]",
"url": "https://www.doczilla.app"
"url": "https://doczilla.app"
},
"main": "./dist/index.js",
"module": "./dist/esm/index.js",
Expand All @@ -34,21 +34,21 @@
"test": "jest"
},
"dependencies": {
"axios": "^1.6.2"
"axios": "^1.6.7"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@types/node": "^20.11.10",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"axios-mock-adapter": "^1.22.0",
"eslint": "8.56.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"jest": "^29.7.0",
"openapi-typescript-codegen": "^0.25.0",
"ts-jest": "^29.1.1",
"openapi-typescript-codegen": "^0.27.0",
"ts-jest": "^29.1.2",
"typescript": "^5.3"
},
"packageManager": "[email protected]",
Expand Down
5 changes: 0 additions & 5 deletions src/generated/models/AsyncJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type AsyncJob = {
/**
* Id of the queued job.
Expand All @@ -13,9 +12,7 @@ export type AsyncJob = {
*/
status: AsyncJob.status;
};

export namespace AsyncJob {

/**
* Status of the job.
*/
Expand All @@ -25,7 +22,5 @@ export namespace AsyncJob {
FAILED = 'FAILED',
COMPLETED = 'COMPLETED',
}


}

2 changes: 0 additions & 2 deletions src/generated/models/AsyncPdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PageOptions } from './PageOptions';
import type { PdfOptions } from './PdfOptions';
import type { StorageOptions } from './StorageOptions';
import type { WebhookOptions } from './WebhookOptions';

export type AsyncPdf = {
/**
* Page options, either provide the `url`, `html` or `htmlTemplate` option.
Expand Down
2 changes: 0 additions & 2 deletions src/generated/models/AsyncScreenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PageOptions } from './PageOptions';
import type { ScreenshotOptions } from './ScreenshotOptions';
import type { StorageOptions } from './StorageOptions';
import type { WebhookOptions } from './WebhookOptions';

export type AsyncScreenshot = {
/**
* Page options, either provide the `url`, `html` or `htmlTemplate` option.
Expand Down
1 change: 0 additions & 1 deletion src/generated/models/BadRequestResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type BadRequestResponse = {
message: string;
code: string;
Expand Down
2 changes: 0 additions & 2 deletions src/generated/models/CreatePdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PageOptions } from './PageOptions';
import type { PdfOptions } from './PdfOptions';

export type CreatePdf = {
/**
* Page options, either provide the `url`, `html` or `htmlTemplate` option.
Expand Down
2 changes: 0 additions & 2 deletions src/generated/models/CreateScreenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PageOptions } from './PageOptions';
import type { ScreenshotOptions } from './ScreenshotOptions';

export type CreateScreenshot = {
/**
* Page options, either provide the `url`, `html` or `htmlTemplate` option.
Expand Down
1 change: 0 additions & 1 deletion src/generated/models/ForbiddenResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type ForbiddenResponse = {
message: string;
};
Expand Down
1 change: 0 additions & 1 deletion src/generated/models/InternalServerErrorResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type InternalServerErrorResponse = {
message: string;
};
Expand Down
1 change: 0 additions & 1 deletion src/generated/models/PDFMargin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type PDFMargin = {
top?: (string | number) | null;
bottom?: (string | number) | null;
Expand Down
1 change: 0 additions & 1 deletion src/generated/models/PageAuthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type PageAuthentication = {
username: string;
password: string;
Expand Down
5 changes: 0 additions & 5 deletions src/generated/models/PageCookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type PageCookie = {
/**
* Cookie name.
Expand Down Expand Up @@ -41,9 +40,7 @@ export type PageCookie = {
*/
expires?: number | null;
};

export namespace PageCookie {

/**
* Cookie SameSite type.
*/
Expand All @@ -52,7 +49,5 @@ export namespace PageCookie {
LAX = 'Lax',
NONE = 'None',
}


}

7 changes: 0 additions & 7 deletions src/generated/models/PageOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PageAuthentication } from './PageAuthentication';
import type { PageCookie } from './PageCookie';

export type PageOptions = {
/**
* URL to go to.
Expand Down Expand Up @@ -65,9 +63,7 @@ export type PageOptions = {
*/
timezone?: string | null;
};

export namespace PageOptions {

/**
* When to consider waiting succeeds.
* - `auto` our smart waiting option that can handle 90% of the cases.
Expand All @@ -83,15 +79,12 @@ export namespace PageOptions {
NETWORKIDLE0 = 'networkidle0',
NETWORKIDLE2 = 'networkidle2',
}

/**
* Changes the CSS media type of the page.
*/
export enum mediaType {
SCREEN = 'screen',
PRINT = 'print',
}


}

1 change: 0 additions & 1 deletion src/generated/models/PayloadTooLargeResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type PayloadTooLargeResponse = {
message: string;
};
Expand Down
6 changes: 0 additions & 6 deletions src/generated/models/PdfOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PDFMargin } from './PDFMargin';

export type PdfOptions = {
/**
* Scales the rendering of the web page. Amount must be between `0.1` and `2`.
Expand Down Expand Up @@ -76,9 +74,7 @@ export type PdfOptions = {
*/
omitBackground?: boolean;
};

export namespace PdfOptions {

/**
* If set, this takes priority over the `width` and `height` options.
* The sizes of each format are as follows:
Expand Down Expand Up @@ -107,7 +103,5 @@ export namespace PdfOptions {
A5 = 'a5',
A6 = 'a6',
}


}

1 change: 0 additions & 1 deletion src/generated/models/ScreenshotClip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type ScreenshotClip = {
scale?: number;
/**
Expand Down
7 changes: 0 additions & 7 deletions src/generated/models/ScreenshotOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { ScreenshotClip } from './ScreenshotClip';
import type { ScreenshotOverlay } from './ScreenshotOverlay';
import type { ScreenshotViewport } from './ScreenshotViewport';

export type ScreenshotOptions = {
type?: ScreenshotOptions.type | null;
/**
Expand Down Expand Up @@ -51,15 +49,12 @@ export type ScreenshotOptions = {
*/
overlay?: ScreenshotOverlay | null;
};

export namespace ScreenshotOptions {

export enum type {
PNG = 'png',
JPEG = 'jpeg',
WEBP = 'webp',
}

/**
* Device preset to use, will not be set when `viewport` option is provided!
*/
Expand Down Expand Up @@ -188,7 +183,5 @@ export namespace ScreenshotOptions {
I_MAC_27 = 'iMac 27',
I_MAC_27_5K = 'iMac 27 5K',
}


}

5 changes: 0 additions & 5 deletions src/generated/models/ScreenshotOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type ScreenshotOverlay = {
/**
* Color to apply as background, can be an an hexadecimal/rgb/rgba color code or CSS gradient.
Expand All @@ -25,17 +24,13 @@ export type ScreenshotOverlay = {
*/
screenshotBorderRadius?: number;
};

export namespace ScreenshotOverlay {

/**
* Browser to apply.
*/
export enum browser {
LIGHT = 'light',
DARK = 'dark',
}


}

1 change: 0 additions & 1 deletion src/generated/models/ScreenshotViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type ScreenshotViewport = {
/**
* The page width in CSS pixels.
Expand Down
1 change: 0 additions & 1 deletion src/generated/models/StorageOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type StorageOptions = {
/**
* Pre-signed url to upload the generated pdf/screenshot to.
Expand Down
1 change: 0 additions & 1 deletion src/generated/models/SubscriptionLimitReachedResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type SubscriptionLimitReachedResponse = {
message: string;
};
Expand Down
5 changes: 0 additions & 5 deletions src/generated/models/SyncJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type SyncJob = {
/**
* Id of the queued job.
Expand All @@ -24,9 +23,7 @@ export type SyncJob = {
*/
signedUrlStatus?: string | null;
};

export namespace SyncJob {

/**
* Status of the job.
*/
Expand All @@ -36,7 +33,5 @@ export namespace SyncJob {
FAILED = 'FAILED',
COMPLETED = 'COMPLETED',
}


}

Loading