@agnocon/piece-bokio 0.0.8
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/LICENSE.MIT-AP +24 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions/add-line-item-to-invoice.d.ts +15 -0
- package/dist/lib/actions/add-line-item-to-invoice.d.ts.map +1 -0
- package/dist/lib/actions/add-line-item-to-invoice.js +67 -0
- package/dist/lib/actions/add-line-item-to-invoice.js.map +1 -0
- package/dist/lib/actions/create-a-journal-entry.d.ts +9 -0
- package/dist/lib/actions/create-a-journal-entry.d.ts.map +1 -0
- package/dist/lib/actions/create-a-journal-entry.js +70 -0
- package/dist/lib/actions/create-a-journal-entry.js.map +1 -0
- package/dist/lib/actions/create-an-item.d.ts +11 -0
- package/dist/lib/actions/create-an-item.d.ts.map +1 -0
- package/dist/lib/actions/create-an-item.js +60 -0
- package/dist/lib/actions/create-an-item.js.map +1 -0
- package/dist/lib/actions/create-customer.d.ts +19 -0
- package/dist/lib/actions/create-customer.d.ts.map +1 -0
- package/dist/lib/actions/create-customer.js +145 -0
- package/dist/lib/actions/create-customer.js.map +1 -0
- package/dist/lib/actions/create-invoice.d.ts +18 -0
- package/dist/lib/actions/create-invoice.d.ts.map +1 -0
- package/dist/lib/actions/create-invoice.js +125 -0
- package/dist/lib/actions/create-invoice.js.map +1 -0
- package/dist/lib/actions/find-customer.d.ts +10 -0
- package/dist/lib/actions/find-customer.d.ts.map +1 -0
- package/dist/lib/actions/find-customer.js +78 -0
- package/dist/lib/actions/find-customer.js.map +1 -0
- package/dist/lib/actions/get-a-journal-entry.d.ts +7 -0
- package/dist/lib/actions/get-a-journal-entry.d.ts.map +1 -0
- package/dist/lib/actions/get-a-journal-entry.js +34 -0
- package/dist/lib/actions/get-a-journal-entry.js.map +1 -0
- package/dist/lib/actions/get-an-invoice.d.ts +7 -0
- package/dist/lib/actions/get-an-invoice.d.ts.map +1 -0
- package/dist/lib/actions/get-an-invoice.js +34 -0
- package/dist/lib/actions/get-an-invoice.js.map +1 -0
- package/dist/lib/actions/get-draft-invoice-by-customer-name.d.ts +9 -0
- package/dist/lib/actions/get-draft-invoice-by-customer-name.d.ts.map +1 -0
- package/dist/lib/actions/get-draft-invoice-by-customer-name.js +75 -0
- package/dist/lib/actions/get-draft-invoice-by-customer-name.js.map +1 -0
- package/dist/lib/actions/update-an-invoice.d.ts +18 -0
- package/dist/lib/actions/update-an-invoice.d.ts.map +1 -0
- package/dist/lib/actions/update-an-invoice.js +109 -0
- package/dist/lib/actions/update-an-invoice.js.map +1 -0
- package/dist/lib/common/auth.d.ts +5 -0
- package/dist/lib/common/auth.d.ts.map +1 -0
- package/dist/lib/common/auth.js +47 -0
- package/dist/lib/common/auth.js.map +1 -0
- package/dist/lib/common/client.d.ts +4 -0
- package/dist/lib/common/client.d.ts.map +1 -0
- package/dist/lib/common/client.js +29 -0
- package/dist/lib/common/client.js.map +1 -0
- package/dist/lib/common/props.d.ts +10 -0
- package/dist/lib/common/props.d.ts.map +1 -0
- package/dist/lib/common/props.js +128 -0
- package/dist/lib/common/props.js.map +1 -0
- package/package.json +47 -0
- package/src/index.ts +49 -0
- package/src/lib/actions/add-line-item-to-invoice.ts +74 -0
- package/src/lib/actions/create-a-journal-entry.ts +72 -0
- package/src/lib/actions/create-an-item.ts +68 -0
- package/src/lib/actions/create-customer.ts +163 -0
- package/src/lib/actions/create-invoice.ts +145 -0
- package/src/lib/actions/find-customer.ts +75 -0
- package/src/lib/actions/get-a-journal-entry.ts +32 -0
- package/src/lib/actions/get-an-invoice.ts +32 -0
- package/src/lib/actions/get-draft-invoice-by-customer-name.ts +78 -0
- package/src/lib/actions/update-an-invoice.ts +127 -0
- package/src/lib/common/auth.ts +44 -0
- package/src/lib/common/client.ts +25 -0
- package/src/lib/common/props.ts +136 -0
package/LICENSE.MIT-AP
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Activepieces AB
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Derived helpers in this folder are adapted from Activepieces (MIT) for use
|
|
24
|
+
inside CX without depending on @activepieces/* packages at runtime.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const bokio: import("@agnocon/pieces-framework").Piece<import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,KAAK;;;GAiChB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bokio = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/bokio/src/index.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("./lib/common/auth");
|
|
9
|
+
const create_customer_1 = require("./lib/actions/create-customer");
|
|
10
|
+
const create_invoice_1 = require("./lib/actions/create-invoice");
|
|
11
|
+
const add_line_item_to_invoice_1 = require("./lib/actions/add-line-item-to-invoice");
|
|
12
|
+
const create_an_item_1 = require("./lib/actions/create-an-item");
|
|
13
|
+
const create_a_journal_entry_1 = require("./lib/actions/create-a-journal-entry");
|
|
14
|
+
const update_an_invoice_1 = require("./lib/actions/update-an-invoice");
|
|
15
|
+
const find_customer_1 = require("./lib/actions/find-customer");
|
|
16
|
+
const get_draft_invoice_by_customer_name_1 = require("./lib/actions/get-draft-invoice-by-customer-name");
|
|
17
|
+
const get_an_invoice_1 = require("./lib/actions/get-an-invoice");
|
|
18
|
+
const get_a_journal_entry_1 = require("./lib/actions/get-a-journal-entry");
|
|
19
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
20
|
+
const pieces_framework_2 = require("@agnocon/pieces-framework");
|
|
21
|
+
exports.bokio = (0, pieces_framework_1.createPiece)({
|
|
22
|
+
displayName: 'Bokio',
|
|
23
|
+
auth: auth_1.bokioAuth,
|
|
24
|
+
minimumSupportedRelease: '0.36.1',
|
|
25
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/bokio.png',
|
|
26
|
+
authors: ['sanket-a11y'],
|
|
27
|
+
categories: [pieces_framework_2.PieceCategory.ACCOUNTING],
|
|
28
|
+
description: 'Bokio is an accounting software platform which offers digital bookkeeping, invoicing, and financial management tools to help simplify accounting processes.',
|
|
29
|
+
actions: [
|
|
30
|
+
create_customer_1.createCustomer,
|
|
31
|
+
create_invoice_1.createInvoice,
|
|
32
|
+
add_line_item_to_invoice_1.addLineItemToInvoice,
|
|
33
|
+
create_an_item_1.createAnItem,
|
|
34
|
+
create_a_journal_entry_1.createAJournalEntry,
|
|
35
|
+
update_an_invoice_1.updateAnInvoice,
|
|
36
|
+
find_customer_1.findCustomer,
|
|
37
|
+
get_draft_invoice_by_customer_name_1.getDraftInvoiceByCustomerName,
|
|
38
|
+
get_an_invoice_1.getAnInvoice,
|
|
39
|
+
get_a_journal_entry_1.getAJournalEntry,
|
|
40
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
41
|
+
auth: auth_1.bokioAuth,
|
|
42
|
+
baseUrl: (auth) => {
|
|
43
|
+
return `https://api.bokio.se/v1/companies/${auth === null || auth === void 0 ? void 0 : auth.props.companyId}`;
|
|
44
|
+
},
|
|
45
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
return {
|
|
47
|
+
Authorization: `Bearer ${auth === null || auth === void 0 ? void 0 : auth.props.api_key}`,
|
|
48
|
+
};
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
triggers: [],
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,iFAAiF;AACjF,qEAAqE;AACrE,gEAAmE;AACnE,4CAA8C;AAC9C,mEAA+D;AAC/D,iEAA6D;AAC7D,qFAA8E;AAC9E,iEAA4D;AAC5D,iFAA2E;AAC3E,uEAAkE;AAClE,+DAA2D;AAC3D,yGAAiG;AACjG,iEAA4D;AAC5D,2EAAqE;AACrE,0DAAmE;AACnE,gEAA0D;AAE7C,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,gBAAS;IACf,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,+CAA+C;IACxD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,UAAU,EAAE,CAAC,gCAAa,CAAC,UAAU,CAAC;IACtC,WAAW,EACT,6JAA6J;IAC/J,OAAO,EAAE;QACP,gCAAc;QACd,8BAAa;QACb,+CAAoB;QACpB,6BAAY;QACZ,4CAAmB;QACnB,mCAAe;QACf,4BAAY;QACZ,kEAA6B;QAC7B,6BAAY;QACZ,sCAAgB;QAChB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,gBAAS;YACf,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,OAAO,qCAAqC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,SAAS,EAAE,CAAC;YACtE,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,OAAO,EAAE;iBAC/C,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const addLineItemToInvoice: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
invoiceId: import("@agnocon/pieces-framework").DropdownProperty<unknown, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
}>>;
|
|
9
|
+
itemType: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
dynamicProps: import("@agnocon/pieces-framework").DynamicProperties<false, import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
11
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
}>>;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=add-line-item-to-invoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-line-item-to-invoice.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/add-line-item-to-invoice.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAmE/B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addLineItemToInvoice = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/bokio/src/lib/actions/add-line-item-to-invoice.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
11
|
+
const props_1 = require("../common/props");
|
|
12
|
+
exports.addLineItemToInvoice = (0, pieces_framework_1.createAction)({
|
|
13
|
+
auth: auth_1.bokioAuth,
|
|
14
|
+
name: 'addLineItemToInvoice',
|
|
15
|
+
displayName: 'Add line item to invoice',
|
|
16
|
+
description: 'Adds a line item to an existing draft invoice',
|
|
17
|
+
audience: 'both',
|
|
18
|
+
aiMetadata: { description: 'Appends a single line item to an existing draft invoice in Bokio, identified by invoice ID. Use to add a product, service, or description-only row to an invoice that already exists; pricing fields apply only when item type is a sales item. Not idempotent — each call appends another line item.', idempotent: false },
|
|
19
|
+
props: {
|
|
20
|
+
invoiceId: props_1.invoiceIdDropdown,
|
|
21
|
+
itemType: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
+
displayName: 'Item Type',
|
|
23
|
+
description: 'Type of the item',
|
|
24
|
+
required: true,
|
|
25
|
+
options: {
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'Sales Item', value: 'salesItem' },
|
|
28
|
+
{ label: 'Description Only Item', value: 'descriptionOnlyItem' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
dynamicProps: props_1.lineItemsProps,
|
|
33
|
+
},
|
|
34
|
+
run(context) {
|
|
35
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const { invoiceId, itemType, dynamicProps } = context.propsValue;
|
|
37
|
+
const { api_key, companyId } = context.auth.props;
|
|
38
|
+
const body = {
|
|
39
|
+
itemType,
|
|
40
|
+
description: dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['description'],
|
|
41
|
+
};
|
|
42
|
+
// Only add pricing fields for sales items
|
|
43
|
+
if (itemType === 'salesItem' && dynamicProps) {
|
|
44
|
+
body.quantity = dynamicProps['quantity'];
|
|
45
|
+
body.unitPrice = dynamicProps['unitPrice'];
|
|
46
|
+
if (dynamicProps['itemRefId']) {
|
|
47
|
+
body.itemRef = {
|
|
48
|
+
id: dynamicProps['itemRefId'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (dynamicProps['productType']) {
|
|
52
|
+
body.productType = dynamicProps['productType'];
|
|
53
|
+
}
|
|
54
|
+
if (dynamicProps['unitType']) {
|
|
55
|
+
body.unitType = dynamicProps['unitType'];
|
|
56
|
+
}
|
|
57
|
+
if (dynamicProps['taxRate'] !== undefined &&
|
|
58
|
+
dynamicProps['taxRate'] !== null) {
|
|
59
|
+
body.taxRate = dynamicProps['taxRate'];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/invoices/${invoiceId}/line-items`, body);
|
|
63
|
+
return response;
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=add-line-item-to-invoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-line-item-to-invoice.js","sourceRoot":"","sources":["../../../src/lib/actions/add-line-item-to-invoice.ts"],"names":[],"mappings":";;;;AAAA,gHAAgH;AAChH,qEAAqE;AACrE,gEAAmE;AACnE,yCAA2C;AAC3C,6CAA+C;AAC/C,0DAAoD;AACpD,2CAAsF;AAEzE,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,+CAA+C;IAC5D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uSAAuS,EAAE,UAAU,EAAE,KAAK,EAAE;IACvV,KAAK,EAAE;QACL,SAAS,EAAE,yBAAiB;QAC5B,QAAQ,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAChC,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC3C,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,qBA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CAAC,IAAI,EACf,cAAc,SAAS,aAAa,SAAS,aAAa,EAC1D,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const createAJournalEntry: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
title: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
date: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
items: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=create-a-journal-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-a-journal-entry.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-a-journal-entry.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;;EAkE9B,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAJournalEntry = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/bokio/src/lib/actions/create-a-journal-entry.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
11
|
+
exports.createAJournalEntry = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.bokioAuth,
|
|
13
|
+
name: 'createAJournalEntry',
|
|
14
|
+
displayName: 'Create a journal entry',
|
|
15
|
+
description: 'Creates a new journal entry in Bokio',
|
|
16
|
+
audience: 'both',
|
|
17
|
+
aiMetadata: { description: 'Records a new bookkeeping journal entry in a Bokio company, posting debit/credit amounts against account numbers. Use for manual double-entry transactions; the entry date is required and items carry the per-account debit/credit lines. Not idempotent — each call posts a separate journal entry.', idempotent: false },
|
|
18
|
+
props: {
|
|
19
|
+
title: pieces_framework_1.Property.ShortText({
|
|
20
|
+
displayName: 'Title',
|
|
21
|
+
description: 'Title of the journal entry',
|
|
22
|
+
required: false,
|
|
23
|
+
}),
|
|
24
|
+
date: pieces_framework_1.Property.ShortText({
|
|
25
|
+
displayName: 'Date',
|
|
26
|
+
description: 'Journal entry date (YYYY-MM-DD)',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
items: pieces_framework_1.Property.Array({
|
|
30
|
+
displayName: 'Items (JSON)',
|
|
31
|
+
description: 'Journal entry items as JSON array. Each item should have: account (account number), debit (optional), credit (optional)',
|
|
32
|
+
required: false,
|
|
33
|
+
properties: {
|
|
34
|
+
account: pieces_framework_1.Property.Number({
|
|
35
|
+
displayName: 'Account Number',
|
|
36
|
+
description: 'Account number for the journal entry item',
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
debit: pieces_framework_1.Property.Number({
|
|
40
|
+
displayName: 'Debit Amount',
|
|
41
|
+
description: 'Debit amount for the journal entry item',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
credit: pieces_framework_1.Property.Number({
|
|
45
|
+
displayName: 'Credit Amount',
|
|
46
|
+
description: 'Credit amount for the journal entry item',
|
|
47
|
+
required: false,
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
run(context) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const { title, date, items } = context.propsValue;
|
|
55
|
+
const { api_key, companyId } = context.auth.props;
|
|
56
|
+
const body = {
|
|
57
|
+
date,
|
|
58
|
+
};
|
|
59
|
+
if (title) {
|
|
60
|
+
body.title = title;
|
|
61
|
+
}
|
|
62
|
+
if (items) {
|
|
63
|
+
body.items = items;
|
|
64
|
+
}
|
|
65
|
+
const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/journal-entries`, body);
|
|
66
|
+
return response;
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=create-a-journal-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-a-journal-entry.js","sourceRoot":"","sources":["../../../src/lib/actions/create-a-journal-entry.ts"],"names":[],"mappings":";;;;AAAA,8GAA8G;AAC9G,qEAAqE;AACrE,gEAAmE;AACnE,yCAA2C;AAC3C,6CAA+C;AAC/C,0DAAoD;AAEvC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uSAAuS,EAAE,UAAU,EAAE,KAAK,EAAE;IACvV,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACpB,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,yHAAyH;YAC3H,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE;gBACV,OAAO,EAAE,2BAAQ,CAAC,MAAM,CAAC;oBACvB,WAAW,EAAE,gBAAgB;oBAC7B,WAAW,EAAE,2CAA2C;oBACxD,QAAQ,EAAE,KAAK;iBAChB,CAAC;gBACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;oBACrB,WAAW,EAAE,cAAc;oBAC3B,WAAW,EAAE,yCAAyC;oBACtD,QAAQ,EAAE,KAAK;iBAChB,CAAC;gBACF,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;oBACtB,WAAW,EAAE,eAAe;oBAC5B,WAAW,EAAE,0CAA0C;oBACvD,QAAQ,EAAE,KAAK;iBAChB,CAAC;aACH;SACF,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAClD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAElD,MAAM,IAAI,GAAQ;gBAChB,IAAI;aACL,CAAC;YAEF,IAAI,KAAK,EAAE,CAAC;gBACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACrB,CAAC;YACD,IAAI,KAAK,EAAE,CAAC;gBACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACrB,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,EACP,0BAAU,CAAC,IAAI,EACf,cAAc,SAAS,kBAAkB,EACzC,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const createAnItem: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
itemType: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
6
|
+
dynamicProps: import("@agnocon/pieces-framework").DynamicProperties<false, import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
}>>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=create-an-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-an-item.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-an-item.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;;;;;;;EA6DvB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAnItem = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/bokio/src/lib/actions/create-an-item.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
11
|
+
const props_1 = require("../common/props");
|
|
12
|
+
exports.createAnItem = (0, pieces_framework_1.createAction)({
|
|
13
|
+
auth: auth_1.bokioAuth,
|
|
14
|
+
name: 'createAnItem',
|
|
15
|
+
displayName: 'Create an item',
|
|
16
|
+
description: 'Creates a new item in Bokio',
|
|
17
|
+
audience: 'both',
|
|
18
|
+
aiMetadata: { description: 'Creates a new reusable item (a sales item with pricing, or a text item) in a Bokio company catalog. Use to define a product or service that can later be referenced on invoices; item type is required. Not idempotent — each call creates a separate item.', idempotent: false },
|
|
19
|
+
props: {
|
|
20
|
+
itemType: pieces_framework_1.Property.StaticDropdown({
|
|
21
|
+
displayName: 'Item Type',
|
|
22
|
+
description: 'Type of the item',
|
|
23
|
+
required: true,
|
|
24
|
+
options: {
|
|
25
|
+
options: [
|
|
26
|
+
{ label: 'Sales Item', value: 'salesItem' },
|
|
27
|
+
{ label: 'Text', value: 'text' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
dynamicProps: props_1.lineItemsProps,
|
|
32
|
+
},
|
|
33
|
+
run(context) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const { itemType, dynamicProps } = context.propsValue;
|
|
36
|
+
const { api_key, companyId } = context.auth.props;
|
|
37
|
+
const body = {
|
|
38
|
+
itemType,
|
|
39
|
+
description: dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['description'],
|
|
40
|
+
};
|
|
41
|
+
if (dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['productType']) {
|
|
42
|
+
body.productType = dynamicProps['productType'];
|
|
43
|
+
}
|
|
44
|
+
if (dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['unitType']) {
|
|
45
|
+
body.unitType = dynamicProps['unitType'];
|
|
46
|
+
}
|
|
47
|
+
if ((dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['unitPrice']) !== undefined &&
|
|
48
|
+
(dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['unitPrice']) !== null) {
|
|
49
|
+
body.unitPrice = dynamicProps['unitPrice'];
|
|
50
|
+
}
|
|
51
|
+
if ((dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['taxRate']) !== undefined &&
|
|
52
|
+
(dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['taxRate']) !== null) {
|
|
53
|
+
body.taxRate = dynamicProps['taxRate'];
|
|
54
|
+
}
|
|
55
|
+
const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/items`, body);
|
|
56
|
+
return response;
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=create-an-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-an-item.js","sourceRoot":"","sources":["../../../src/lib/actions/create-an-item.ts"],"names":[],"mappings":";;;;AAAA,sGAAsG;AACtG,qEAAqE;AACrE,gEAAmE;AACnE,yCAA2C;AAC3C,6CAA+C;AAC/C,0DAAoD;AACpD,2CAAmE;AAEtD,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,6PAA6P,EAAE,UAAU,EAAE,KAAK,EAAE;IAC7S,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAChC,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC3C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;iBACjC;aACF;SACF,CAAC;QACF,YAAY,EAAE,sBAAc;KAC7B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACtD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAElD,MAAM,IAAI,GAAQ;gBAChB,QAAQ;gBACR,WAAW,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,aAAa,CAAC;aAC3C,CAAC;YAEF,IAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,aAAa,CAAC,EAAE,CAAC;gBAClC,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;YACjD,CAAC;YAED,IAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,UAAU,CAAC,EAAE,CAAC;gBAC/B,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;YAC3C,CAAC;YAED,IACE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,WAAW,CAAC,MAAK,SAAS;gBACzC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,WAAW,CAAC,MAAK,IAAI,EACpC,CAAC;gBACD,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;YAC7C,CAAC;YAED,IACE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,SAAS,CAAC,MAAK,SAAS;gBACvC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,SAAS,CAAC,MAAK,IAAI,EAClC,CAAC;gBACD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,EACP,0BAAU,CAAC,IAAI,EACf,cAAc,SAAS,QAAQ,EAC/B,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const createCustomer: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
customerName: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
7
|
+
vatNumber: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
orgNumber: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
paymentTerms: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
customerNumber: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
email: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
12
|
+
phone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
13
|
+
lin1: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
14
|
+
line2: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
15
|
+
zipCode: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
16
|
+
city: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
17
|
+
country: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=create-customer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-customer.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-customer.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;EA4JzB,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCustomer = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/bokio/src/lib/actions/create-customer.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../common/auth");
|
|
9
|
+
const client_1 = require("../common/client");
|
|
10
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
11
|
+
exports.createCustomer = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.bokioAuth,
|
|
13
|
+
name: 'createCustomer',
|
|
14
|
+
displayName: 'Create Customer',
|
|
15
|
+
description: 'Creates a new customer in Bokio',
|
|
16
|
+
audience: 'both',
|
|
17
|
+
aiMetadata: { description: 'Creates a new customer record in a Bokio accounting company. Use to register a person or company before invoicing them; only customer name and type (individual/company) are required, with optional VAT/org number, contact, and address details. Not idempotent — each call creates a separate customer.', idempotent: false },
|
|
18
|
+
props: {
|
|
19
|
+
customerName: pieces_framework_1.Property.ShortText({
|
|
20
|
+
displayName: 'Customer Name',
|
|
21
|
+
description: 'Name of the customer',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
type: pieces_framework_1.Property.StaticDropdown({
|
|
25
|
+
displayName: 'Customer Type',
|
|
26
|
+
description: 'Type of the customer',
|
|
27
|
+
required: true,
|
|
28
|
+
options: {
|
|
29
|
+
options: [
|
|
30
|
+
{ label: 'Individual', value: 'private' },
|
|
31
|
+
{ label: 'Company', value: 'company' },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
vatNumber: pieces_framework_1.Property.ShortText({
|
|
36
|
+
displayName: 'VAT Number',
|
|
37
|
+
description: 'Customer VAT number',
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
orgNumber: pieces_framework_1.Property.ShortText({
|
|
41
|
+
displayName: 'Organization Number',
|
|
42
|
+
description: 'Customer organization number',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
paymentTerms: pieces_framework_1.Property.ShortText({
|
|
46
|
+
displayName: 'Payment Terms',
|
|
47
|
+
description: 'Payment terms for the customer. Payment terms for the invoices. Payment terms can both take free text or days, in digits, until the payment is due.',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
customerNumber: pieces_framework_1.Property.ShortText({
|
|
51
|
+
displayName: 'Customer Number',
|
|
52
|
+
description: 'Customer number (optional)',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
email: pieces_framework_1.Property.ShortText({
|
|
56
|
+
displayName: 'Email',
|
|
57
|
+
description: 'Customer email address',
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
phone: pieces_framework_1.Property.ShortText({
|
|
61
|
+
displayName: 'Phone',
|
|
62
|
+
description: 'Customer phone number',
|
|
63
|
+
required: false,
|
|
64
|
+
}),
|
|
65
|
+
lin1: pieces_framework_1.Property.ShortText({
|
|
66
|
+
displayName: 'Address line 1',
|
|
67
|
+
description: 'Customer address line 1',
|
|
68
|
+
required: false,
|
|
69
|
+
}),
|
|
70
|
+
line2: pieces_framework_1.Property.ShortText({
|
|
71
|
+
displayName: 'Address line 2',
|
|
72
|
+
description: 'Customer address line 2',
|
|
73
|
+
required: false,
|
|
74
|
+
}),
|
|
75
|
+
zipCode: pieces_framework_1.Property.ShortText({
|
|
76
|
+
displayName: 'Zip Code',
|
|
77
|
+
description: 'Customer zip code',
|
|
78
|
+
required: false,
|
|
79
|
+
}),
|
|
80
|
+
city: pieces_framework_1.Property.ShortText({
|
|
81
|
+
displayName: 'City',
|
|
82
|
+
description: 'Customer city',
|
|
83
|
+
required: false,
|
|
84
|
+
}),
|
|
85
|
+
country: pieces_framework_1.Property.ShortText({
|
|
86
|
+
displayName: 'Country',
|
|
87
|
+
description: 'Customer country (ISO 3166-1 alpha-2 country code)',
|
|
88
|
+
required: false,
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
run(context) {
|
|
92
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const { customerName, type, vatNumber, orgNumber, paymentTerms, customerNumber, email, phone, lin1, line2, zipCode, city, country, } = context.propsValue;
|
|
94
|
+
const { api_key, companyId } = context.auth.props;
|
|
95
|
+
const body = {
|
|
96
|
+
name: customerName,
|
|
97
|
+
type: type,
|
|
98
|
+
};
|
|
99
|
+
if (vatNumber) {
|
|
100
|
+
body.vat_number = vatNumber;
|
|
101
|
+
}
|
|
102
|
+
if (orgNumber) {
|
|
103
|
+
body.org_number = orgNumber;
|
|
104
|
+
}
|
|
105
|
+
if (customerNumber) {
|
|
106
|
+
body.customer_number = customerNumber;
|
|
107
|
+
}
|
|
108
|
+
if (paymentTerms) {
|
|
109
|
+
body.payment_terms = paymentTerms;
|
|
110
|
+
}
|
|
111
|
+
const contactsDetails = {};
|
|
112
|
+
if (email) {
|
|
113
|
+
contactsDetails.email = email;
|
|
114
|
+
}
|
|
115
|
+
if (phone) {
|
|
116
|
+
contactsDetails.phone = phone;
|
|
117
|
+
}
|
|
118
|
+
if (Object.keys(contactsDetails).length > 0) {
|
|
119
|
+
body.contactsDetails = contactsDetails;
|
|
120
|
+
}
|
|
121
|
+
const addressDetails = {};
|
|
122
|
+
if (lin1) {
|
|
123
|
+
addressDetails.line_1 = lin1;
|
|
124
|
+
}
|
|
125
|
+
if (line2) {
|
|
126
|
+
addressDetails.line_2 = line2;
|
|
127
|
+
}
|
|
128
|
+
if (zipCode) {
|
|
129
|
+
addressDetails.zip_code = zipCode;
|
|
130
|
+
}
|
|
131
|
+
if (city) {
|
|
132
|
+
addressDetails.city = city;
|
|
133
|
+
}
|
|
134
|
+
if (country) {
|
|
135
|
+
addressDetails.country = country;
|
|
136
|
+
}
|
|
137
|
+
if (Object.keys(addressDetails).length > 0) {
|
|
138
|
+
body.address = addressDetails;
|
|
139
|
+
}
|
|
140
|
+
const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/customers`, body);
|
|
141
|
+
return response;
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=create-customer.js.map
|
|
@@ -0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G,OAAO,CAAC;YACpC,CAAC;YACD,IAAI,IAAI,EAAE,CAAC;gBACT,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC;YAC7B,CAAC;YACD,IAAI,OAAO,EAAE,CAAC;gBACZ,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;YACnC,CAAC;YAED,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3C,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC;YAChC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,EACP,0BAAU,CAAC,IAAI,EACf,cAAc,SAAS,YAAY,EACnC,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const createInvoice: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
invoiceType: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
|
+
customerRef: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
invoiceDate: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
dueDate: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
orderNumberReference: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
currency: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
currencyRate: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
12
|
+
itemType: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
13
|
+
dynamicProps: import("@agnocon/pieces-framework").DynamicProperties<false, import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
14
|
+
companyId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
api_key: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
16
|
+
}>>;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=create-invoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-invoice.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-invoice.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;EA0IxB,CAAC"}
|