Compare commits

...

8 Commits

Author SHA1 Message Date
4c13cae34d 1.0.20 2025-03-15 15:10:42 +00:00
f800d61576 fix(letterxpress): Update dependencies, adjust PDF generation parameters, and remove obsolete CI configuration 2025-03-15 15:10:42 +00:00
679d1cf9c4 1.0.19 2024-04-17 19:47:23 +02:00
ce060f0cf9 fix(core): update 2024-04-17 19:47:23 +02:00
4d4d46ef7c 1.0.18 2024-02-19 01:35:47 +01:00
696d56067c fix(core): update 2024-02-19 01:35:46 +01:00
fa3f4b4ccf 1.0.17 2024-02-17 02:34:32 +01:00
5b823b09ac fix(core): update 2024-02-17 02:34:31 +01:00
10 changed files with 8126 additions and 18924 deletions

View File

@ -1,139 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install stable
- npmci npm prepare
- npmci npm install
- npmci command npm run buildDocs
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

104
changelog.md Normal file
View File

@ -0,0 +1,104 @@
# Changelog
## 2025-03-15 - 1.0.20 - fix(letterxpress)
Update dependencies, adjust PDF generation parameters, and remove obsolete CI configuration
- Updated @push.rocks/smartbuffer from ^2.0.1 to ^3.0.4
- Updated @tsclass/tsclass from ^4.0.54 to ^5.0.0
- Updated @types/node from ^20.12.7 to ^22.13.10
- Changed dees-document import path to use the 'node' entry point
- Modified sendLetter to pass an object with letterData and documentSettings to createPdfFromLetterObject
- Removed obsolete .gitlab-ci.yml file
## 2024-04-17 - 1.0.18 - core
fix(core): update
- Core module updated.
## 2024-02-19 - 1.0.17 - core
fix(core): update
- Core module updated.
## 2024-02-17 - 1.0.16 - core
fix(core): update
- Core module updated.
## 2024-02-16 - 1.0.15 - core
fix(core): update
- Core module updated.
## 2022-06-29 - 1.0.14 - core
fix(core): update
- Core module update applied.
## 2022-06-16 - 1.0.13 - core
fix(core): update
- Core module update applied.
## 2022-06-16 - 1.0.12 - core
fix(core): update
- Core module update applied.
## 2022-06-16 - 1.0.11 - core
fix(core): update
- Core module update applied.
## 2019-11-22 - 1.0.10 - build
fix(build): now including all necessary types
- Included all necessary type definitions in the build process.
## 2019-11-22 - 1.0.09 - security
fix(security): update snyk
- Updated snyk for improved security.
## 2019-11-22 - 1.0.08 - core
fix(core): update
- Core module updated.
## 2019-11-21 - 1.0.07 - core
fix(core): update
- Core module updated.
## 2019-11-18 - 1.0.06 - readme
fix(readme): show how to instantiate account
- Updated documentation to show how to instantiate an account.
## 2019-11-18 - 1.0.05 - readme
fix(readme): add links to documentation
- Added links to documentation in the readme.
## 2019-11-18 - 1.0.04 - test
fix(test): add first account test
- Added the first account test.
## 2019-11-18 - 1.0.03 - core
fix(core): update
- Core module updated.
## 2019-11-16 - 1.0.02 - core
fix(core): update
- Core module updated.
## 2019-11-13 - 1.0.01 - core
fix(core): update
- Core module updated.
## Other versions (omitted)
The following version(s) included only version bump commits without additional changes: 1.0.19.

14464
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@apiclient.xyz/letterxpress", "name": "@apiclient.xyz/letterxpress",
"version": "1.0.16", "version": "1.0.20",
"private": false, "private": false,
"description": "an unofficial API package for the letterxpress API", "description": "an unofficial API package for the letterxpress API",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -16,19 +16,19 @@
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.1.63", "@git.zone/tsbuild": "^2.1.63",
"@git.zone/tsrun": "^1.2.46", "@git.zone/tsrun": "^1.2.46",
"@git.zone/tstest": "^1.0.71", "@git.zone/tstest": "^1.0.88",
"@push.rocks/qenv": "^6.0.5", "@push.rocks/qenv": "^6.0.5",
"@push.rocks/tapbundle": "^5.0.3", "@push.rocks/tapbundle": "^5.0.23",
"@types/node": "^20.11.19" "@types/node": "^22.13.10"
}, },
"dependencies": { "dependencies": {
"@design.estate/dees-document": "^1.0.99", "@design.estate/dees-document": "^1.0.99",
"@push.rocks/smartbuffer": "^1.0.3", "@push.rocks/smartbuffer": "^3.0.4",
"@push.rocks/smarthash": "^3.0.1", "@push.rocks/smarthash": "^3.0.1",
"@push.rocks/smartpromise": "^4.0.3", "@push.rocks/smartpromise": "^4.0.3",
"@push.rocks/smartrequest": "^2.0.21", "@push.rocks/smartrequest": "^2.0.22",
"@push.rocks/smartrx": "^3.0.7", "@push.rocks/smartrx": "^3.0.7",
"@tsclass/tsclass": "^4.0.17" "@tsclass/tsclass": "^5.0.0"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
@ -45,5 +45,12 @@
"type": "module", "type": "module",
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ],
"pnpm": {
"onlyBuiltDependencies": [
"esbuild",
"mongodb-memory-server",
"puppeteer"
]
}
} }

12297
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

0
readme.hints.md Normal file
View File

View File

@ -9,7 +9,7 @@ let testAccount: letterxpress.LetterXpressAccount;
let testLetter: tsclass.business.ILetter; let testLetter: tsclass.business.ILetter;
tap.test('should create a valid account', async () => { tap.test('should create a valid account', async () => {
testAccount = await letterxpress.LetterXpressAccount.createAndInit({ testAccount = await letterxpress.LetterXpressAccount.createAndStart({
apiKey: await testQenv.getEnvVarOnDemand('API_TOKEN'), apiKey: await testQenv.getEnvVarOnDemand('API_TOKEN'),
username: await testQenv.getEnvVarOnDemand('API_USERNAME'), username: await testQenv.getEnvVarOnDemand('API_USERNAME'),
}); });
@ -104,7 +104,7 @@ tap.test('should send an actual letter', async () => {
}); });
tap.test('should be able to delete the sending job', async (toolsArg) => { tap.test('should be able to delete the sending job', async (toolsArg) => {
await toolsArg.delayFor(30000); await toolsArg.delayFor(5000);
await testAccount.cancelLetter(testLetter); await testAccount.cancelLetter(testLetter);
}); });

View File

@ -1,8 +1,8 @@
/** /**
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @push.rocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@apiclient.xyz/letterxpress', name: '@apiclient.xyz/letterxpress',
version: '1.0.16', version: '1.0.20',
description: 'an unofficial API package for the letterxpress API' description: 'an unofficial API package for the letterxpress API'
} }

View File

@ -7,9 +7,9 @@ export interface ILetterXpressConstructorOptions {
export class LetterXpressAccount { export class LetterXpressAccount {
// STATIC // STATIC
public static async createAndInit(optionsArg: ConstructorParameters<typeof LetterXpressAccount>[0]) { public static async createAndStart(optionsArg: ConstructorParameters<typeof LetterXpressAccount>[0]) {
const letterXpressInstance = new LetterXpressAccount(optionsArg); const letterXpressInstance = new LetterXpressAccount(optionsArg);
await letterXpressInstance.init(); await letterXpressInstance.start();
return letterXpressInstance; return letterXpressInstance;
} }
@ -25,7 +25,7 @@ export class LetterXpressAccount {
this.options = optionsArg; this.options = optionsArg;
} }
public async init() { public async start() {
this.deesDocumentInstance = await plugins.deesDocument.PdfService.createAndStart({}); this.deesDocumentInstance = await plugins.deesDocument.PdfService.createAndStart({});
} }
@ -34,12 +34,12 @@ export class LetterXpressAccount {
* @param letterArg * @param letterArg
*/ */
public async sendLetter(letterArg: plugins.tsclass.business.ILetter) { public async sendLetter(letterArg: plugins.tsclass.business.ILetter) {
const pdfToSend = await this.deesDocumentInstance.createPdfFromLetterObject(letterArg); const pdfToSend = await this.deesDocumentInstance.createPdfFromLetterObject({letterData: letterArg, documentSettings: {}});
const response = await this.request('/printjobs', 'POST', { const response = await this.request('/printjobs', 'POST', {
letter: { letter: {
base64_file: plugins.smartbuffer.arrayBufferToBase64(pdfToSend.buffer), base64_file: plugins.smartbuffer.uInt8ArrayToBase64(pdfToSend.buffer),
base64_file_checksum: await plugins.smarthash.md5FromString( base64_file_checksum: await plugins.smarthash.md5FromString(
plugins.smartbuffer.arrayBufferToBase64(pdfToSend.buffer) plugins.smartbuffer.uInt8ArrayToBase64(pdfToSend.buffer)
), ),
specification: { specification: {
color: '4', color: '4',
@ -97,6 +97,7 @@ export class LetterXpressAccount {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
requestBody: JSON.stringify(requestData), requestBody: JSON.stringify(requestData),
keepAlive: false,
}); });
console.log(response.body); console.log(response.body);
return response; return response;

View File

@ -7,7 +7,7 @@ import * as smartrx from '@push.rocks/smartrx';
export { smartbuffer, smarthash, smartpromise, smartrequest, smartrx }; export { smartbuffer, smarthash, smartpromise, smartrequest, smartrx };
// @design.estate scope // @design.estate scope
import * as deesDocument from '@design.estate/dees-document/ts'; import * as deesDocument from '@design.estate/dees-document/node';
export { export {
deesDocument deesDocument