@orchesty/connector-flexi-bee 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Connector/FlexiBeeCreateFakturaPrijataPrilohaConnector.d.ts +30 -0
- package/dist/Connector/FlexiBeeCreateFakturaPrijataPrilohaConnector.js +27 -0
- package/dist/Connector/FlexiBeeGetCompaniesConnector.d.ts +19 -0
- package/dist/Connector/FlexiBeeGetCompaniesConnector.js +27 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "flexibee-create-faktura-prijata-priloha-connector";
|
|
4
|
+
export default class FlexiBeeCreateFakturaPrijataPrilohaConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput[]>>;
|
|
7
|
+
}
|
|
8
|
+
export interface IInput {
|
|
9
|
+
id: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IResponse {
|
|
13
|
+
winstrom: {
|
|
14
|
+
'@version': string;
|
|
15
|
+
success: string;
|
|
16
|
+
stats: {
|
|
17
|
+
created: string;
|
|
18
|
+
updated: string;
|
|
19
|
+
deleted: string;
|
|
20
|
+
skipped: string;
|
|
21
|
+
failed: string;
|
|
22
|
+
};
|
|
23
|
+
results: IOutput[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface IOutput {
|
|
27
|
+
id: string;
|
|
28
|
+
'request-id': `ext:${string}`;
|
|
29
|
+
ref: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const Headers_1 = require("@orchesty/nodejs-sdk/dist/lib/Utils/Headers");
|
|
10
|
+
const FexiBeeApplication_1 = require("../FexiBeeApplication");
|
|
11
|
+
exports.NAME = `${FexiBeeApplication_1.FLEXI_BEE_APPLICATION}-create-faktura-prijata-priloha-connector`;
|
|
12
|
+
class FlexiBeeCreateFakturaPrijataPrilohaConnector extends AConnector_1.default {
|
|
13
|
+
getName() {
|
|
14
|
+
return exports.NAME;
|
|
15
|
+
}
|
|
16
|
+
async processAction(dto) {
|
|
17
|
+
const { id, content } = dto.getJsonData();
|
|
18
|
+
const application = this.getApplication();
|
|
19
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
20
|
+
const requestDto = (await application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PUT, application.getUrl(applicationInstall, `faktura-prijata/${id}/prilohy/new/${id}.pdf`)))
|
|
21
|
+
.addHeaders({ [Headers_1.CommonHeaders.CONTENT_TYPE]: 'application/pdf' })
|
|
22
|
+
.setBody(Buffer.from(content, 'base64'));
|
|
23
|
+
const responseDto = await this.getSender().send(requestDto);
|
|
24
|
+
return dto.setNewJsonData(responseDto.getJsonBody().winstrom.results);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = FlexiBeeCreateFakturaPrijataPrilohaConnector;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const FLEXI_BEE_GET_COMPANIES_CONNECTOR = "flexi-bee-get-companies-connector";
|
|
4
|
+
export default class FlexiBeeGetCompaniesConnector extends AConnector {
|
|
5
|
+
private readonly useInForm;
|
|
6
|
+
constructor(useInForm?: boolean);
|
|
7
|
+
getName(): string;
|
|
8
|
+
processAction(dto: ProcessDto): Promise<ProcessDto<IOutput[]>>;
|
|
9
|
+
}
|
|
10
|
+
export interface IOutput {
|
|
11
|
+
createDt: string;
|
|
12
|
+
dbNazev: string;
|
|
13
|
+
id: string;
|
|
14
|
+
licenseGroup: string;
|
|
15
|
+
nazev: string;
|
|
16
|
+
show: string;
|
|
17
|
+
stavEnum: string;
|
|
18
|
+
watchingChanges: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FLEXI_BEE_GET_COMPANIES_CONNECTOR = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
exports.FLEXI_BEE_GET_COMPANIES_CONNECTOR = 'flexi-bee-get-companies-connector';
|
|
10
|
+
class FlexiBeeGetCompaniesConnector extends AConnector_1.default {
|
|
11
|
+
useInForm;
|
|
12
|
+
constructor(useInForm = false) {
|
|
13
|
+
super();
|
|
14
|
+
this.useInForm = useInForm;
|
|
15
|
+
}
|
|
16
|
+
getName() {
|
|
17
|
+
return exports.FLEXI_BEE_GET_COMPANIES_CONNECTOR;
|
|
18
|
+
}
|
|
19
|
+
async processAction(dto) {
|
|
20
|
+
const application = this.getApplication();
|
|
21
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto, this.useInForm ? null : true);
|
|
22
|
+
const requestDto = await application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.GET, `${new URL(application.getUrl(applicationInstall)).origin}/c.json`);
|
|
23
|
+
const responseDto = await this.getSender().send(requestDto);
|
|
24
|
+
return dto.setNewJsonData(responseDto.getJsonBody().companies.company);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = FlexiBeeGetCompaniesConnector;
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchesty/connector-flexi-bee",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|
|
7
7
|
"repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchesty/connector-flexi-bee",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|
|
7
7
|
"repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|