mirror of
https://github.com/chatmail/core.git
synced 2026-04-05 23:22:11 +03:00
don't ignore core sourcefiles, prevented npm installation on architectures with no prebuild don't run lint checks on windows github actions don't like double quotes apparently minimize node.js CI update ubuntu runner to 22.04 README: update link to node bindings source simplify link in readme node: fix crash with invalid account id (throw error when getContext failed) fix typo in readme remove node specific changelog change prebuild machine back to ubuntu 18.04 move package.json to root level to include rust source in npm package change path in m1 patch github action to upload to download.delta.chat/node/ on tag try build with ubuntu 20.04 Update node/README.md try building it with newer ubuntu because it wants glibc 2.33 fix path for prebuildify script throw error when instanciating a wrapper class on `null` (Context, Message, Chat, ChatList and so on) try fix selecting the right cache to fix the strange glibc bug also revert back ubuntu version to 18.04 also bump package.json version with release script fix paths since we moved around package.json github action: fix path document npm release - it's so much easier now! there are no PR checks to post to if this action is executed on a tag github action: fix artifact names fix paths? wtf do I know, it's 3AM and I'm drunk fix syntax error don't upload preview if action is run on tag is the tag ID an empty string or null? node-package github action is done so far also include scripts in package only publish docs on push to master branch actually bump package.json version in set_core_version script prettify package.json fix test - we don't really need to assert that remove unnecessary ls statement from github action
53 lines
1.0 KiB
TypeScript
53 lines
1.0 KiB
TypeScript
/* eslint-disable camelcase */
|
|
|
|
const binding = require('../binding')
|
|
const debug = require('debug')('deltachat:node:lot')
|
|
|
|
interface NativeLot {}
|
|
/**
|
|
* Wrapper around dc_lot_t*
|
|
*/
|
|
export class Lot {
|
|
constructor(public dc_lot: NativeLot) {
|
|
debug('Lot constructor')
|
|
if (dc_lot === null) {
|
|
throw new Error('dc_lot can not be null')
|
|
}
|
|
}
|
|
|
|
toJson() {
|
|
debug('toJson')
|
|
return {
|
|
state: this.getState(),
|
|
text1: this.getText1(),
|
|
text1Meaning: this.getText1Meaning(),
|
|
text2: this.getText2(),
|
|
timestamp: this.getTimestamp(),
|
|
}
|
|
}
|
|
|
|
getId(): number {
|
|
return binding.dcn_lot_get_id(this.dc_lot)
|
|
}
|
|
|
|
getState(): number {
|
|
return binding.dcn_lot_get_state(this.dc_lot)
|
|
}
|
|
|
|
getText1(): string {
|
|
return binding.dcn_lot_get_text1(this.dc_lot)
|
|
}
|
|
|
|
getText1Meaning(): string {
|
|
return binding.dcn_lot_get_text1_meaning(this.dc_lot)
|
|
}
|
|
|
|
getText2(): string {
|
|
return binding.dcn_lot_get_text2(this.dc_lot)
|
|
}
|
|
|
|
getTimestamp(): number {
|
|
return binding.dcn_lot_get_timestamp(this.dc_lot)
|
|
}
|
|
}
|