@activepieces/piece-bokio 0.0.6 → 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.
Files changed (57) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +13 -52
  3. package/src/index.d.ts +0 -5
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-line-item-to-invoice.d.ts +0 -15
  7. package/src/lib/actions/add-line-item-to-invoice.d.ts.map +0 -1
  8. package/src/lib/actions/add-line-item-to-invoice.js +0 -65
  9. package/src/lib/actions/add-line-item-to-invoice.js.map +0 -1
  10. package/src/lib/actions/create-a-journal-entry.d.ts +0 -9
  11. package/src/lib/actions/create-a-journal-entry.d.ts.map +0 -1
  12. package/src/lib/actions/create-a-journal-entry.js +0 -68
  13. package/src/lib/actions/create-a-journal-entry.js.map +0 -1
  14. package/src/lib/actions/create-an-item.d.ts +0 -11
  15. package/src/lib/actions/create-an-item.d.ts.map +0 -1
  16. package/src/lib/actions/create-an-item.js +0 -58
  17. package/src/lib/actions/create-an-item.js.map +0 -1
  18. package/src/lib/actions/create-customer.d.ts +0 -19
  19. package/src/lib/actions/create-customer.d.ts.map +0 -1
  20. package/src/lib/actions/create-customer.js +0 -143
  21. package/src/lib/actions/create-customer.js.map +0 -1
  22. package/src/lib/actions/create-invoice.d.ts +0 -18
  23. package/src/lib/actions/create-invoice.d.ts.map +0 -1
  24. package/src/lib/actions/create-invoice.js +0 -123
  25. package/src/lib/actions/create-invoice.js.map +0 -1
  26. package/src/lib/actions/find-customer.d.ts +0 -10
  27. package/src/lib/actions/find-customer.d.ts.map +0 -1
  28. package/src/lib/actions/find-customer.js +0 -76
  29. package/src/lib/actions/find-customer.js.map +0 -1
  30. package/src/lib/actions/get-a-journal-entry.d.ts +0 -7
  31. package/src/lib/actions/get-a-journal-entry.d.ts.map +0 -1
  32. package/src/lib/actions/get-a-journal-entry.js +0 -32
  33. package/src/lib/actions/get-a-journal-entry.js.map +0 -1
  34. package/src/lib/actions/get-an-invoice.d.ts +0 -7
  35. package/src/lib/actions/get-an-invoice.d.ts.map +0 -1
  36. package/src/lib/actions/get-an-invoice.js +0 -32
  37. package/src/lib/actions/get-an-invoice.js.map +0 -1
  38. package/src/lib/actions/get-draft-invoice-by-customer-name.d.ts +0 -9
  39. package/src/lib/actions/get-draft-invoice-by-customer-name.d.ts.map +0 -1
  40. package/src/lib/actions/get-draft-invoice-by-customer-name.js +0 -73
  41. package/src/lib/actions/get-draft-invoice-by-customer-name.js.map +0 -1
  42. package/src/lib/actions/update-an-invoice.d.ts +0 -18
  43. package/src/lib/actions/update-an-invoice.d.ts.map +0 -1
  44. package/src/lib/actions/update-an-invoice.js +0 -107
  45. package/src/lib/actions/update-an-invoice.js.map +0 -1
  46. package/src/lib/common/auth.d.ts +0 -5
  47. package/src/lib/common/auth.d.ts.map +0 -1
  48. package/src/lib/common/auth.js +0 -45
  49. package/src/lib/common/auth.js.map +0 -1
  50. package/src/lib/common/client.d.ts +0 -4
  51. package/src/lib/common/client.d.ts.map +0 -1
  52. package/src/lib/common/client.js +0 -27
  53. package/src/lib/common/client.js.map +0 -1
  54. package/src/lib/common/props.d.ts +0 -10
  55. package/src/lib/common/props.d.ts.map +0 -1
  56. package/src/lib/common/props.js +0 -126
  57. package/src/lib/common/props.js.map +0 -1
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAJournalEntry = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const client_1 = require("../common/client");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- exports.createAJournalEntry = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.bokioAuth,
11
- name: 'createAJournalEntry',
12
- displayName: 'Create a journal entry',
13
- description: 'Creates a new journal entry in Bokio',
14
- audience: 'both',
15
- 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 },
16
- props: {
17
- title: pieces_framework_1.Property.ShortText({
18
- displayName: 'Title',
19
- description: 'Title of the journal entry',
20
- required: false,
21
- }),
22
- date: pieces_framework_1.Property.ShortText({
23
- displayName: 'Date',
24
- description: 'Journal entry date (YYYY-MM-DD)',
25
- required: true,
26
- }),
27
- items: pieces_framework_1.Property.Array({
28
- displayName: 'Items (JSON)',
29
- description: 'Journal entry items as JSON array. Each item should have: account (account number), debit (optional), credit (optional)',
30
- required: false,
31
- properties: {
32
- account: pieces_framework_1.Property.Number({
33
- displayName: 'Account Number',
34
- description: 'Account number for the journal entry item',
35
- required: false,
36
- }),
37
- debit: pieces_framework_1.Property.Number({
38
- displayName: 'Debit Amount',
39
- description: 'Debit amount for the journal entry item',
40
- required: false,
41
- }),
42
- credit: pieces_framework_1.Property.Number({
43
- displayName: 'Credit Amount',
44
- description: 'Credit amount for the journal entry item',
45
- required: false,
46
- }),
47
- },
48
- }),
49
- },
50
- run(context) {
51
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
- const { title, date, items } = context.propsValue;
53
- const { api_key, companyId } = context.auth.props;
54
- const body = {
55
- date,
56
- };
57
- if (title) {
58
- body.title = title;
59
- }
60
- if (items) {
61
- body.items = items;
62
- }
63
- const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/journal-entries`, body);
64
- return response;
65
- });
66
- },
67
- });
68
- //# sourceMappingURL=create-a-journal-entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-a-journal-entry.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-a-journal-entry.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA2C;AAC3C,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAA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AAI,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"}
@@ -1,11 +0,0 @@
1
- export declare const createAnItem: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>, {
5
- itemType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
6
- dynamicProps: import("@activepieces/pieces-framework").DynamicProperties<false, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- }>>;
10
- }>;
11
- //# sourceMappingURL=create-an-item.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-an-item.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-an-item.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;;;;;;;EA6DvB,CAAC"}
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAnItem = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const client_1 = require("../common/client");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const props_1 = require("../common/props");
10
- exports.createAnItem = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.bokioAuth,
12
- name: 'createAnItem',
13
- displayName: 'Create an item',
14
- description: 'Creates a new item in Bokio',
15
- audience: 'both',
16
- 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 },
17
- props: {
18
- itemType: pieces_framework_1.Property.StaticDropdown({
19
- displayName: 'Item Type',
20
- description: 'Type of the item',
21
- required: true,
22
- options: {
23
- options: [
24
- { label: 'Sales Item', value: 'salesItem' },
25
- { label: 'Text', value: 'text' },
26
- ],
27
- },
28
- }),
29
- dynamicProps: props_1.lineItemsProps,
30
- },
31
- run(context) {
32
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
- const { itemType, dynamicProps } = context.propsValue;
34
- const { api_key, companyId } = context.auth.props;
35
- const body = {
36
- itemType,
37
- description: dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['description'],
38
- };
39
- if (dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['productType']) {
40
- body.productType = dynamicProps['productType'];
41
- }
42
- if (dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['unitType']) {
43
- body.unitType = dynamicProps['unitType'];
44
- }
45
- if ((dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['unitPrice']) !== undefined &&
46
- (dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['unitPrice']) !== null) {
47
- body.unitPrice = dynamicProps['unitPrice'];
48
- }
49
- if ((dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['taxRate']) !== undefined &&
50
- (dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['taxRate']) !== null) {
51
- body.taxRate = dynamicProps['taxRate'];
52
- }
53
- const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/items`, body);
54
- return response;
55
- });
56
- },
57
- });
58
- //# sourceMappingURL=create-an-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-an-item.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-an-item.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA2C;AAC3C,6CAA+C;AAC/C,+DAAyD;AACzD,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"}
@@ -1,19 +0,0 @@
1
- export declare const createCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>, {
5
- customerName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
- type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
7
- vatNumber: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- orgNumber: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- paymentTerms: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- customerNumber: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- lin1: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- line2: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
- zipCode: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
- city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
- country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
18
- }>;
19
- //# sourceMappingURL=create-customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-customer.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;EA4JzB,CAAC"}
@@ -1,143 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCustomer = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const client_1 = require("../common/client");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- exports.createCustomer = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.bokioAuth,
11
- name: 'createCustomer',
12
- displayName: 'Create Customer',
13
- description: 'Creates a new customer in Bokio',
14
- audience: 'both',
15
- 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 },
16
- props: {
17
- customerName: pieces_framework_1.Property.ShortText({
18
- displayName: 'Customer Name',
19
- description: 'Name of the customer',
20
- required: true,
21
- }),
22
- type: pieces_framework_1.Property.StaticDropdown({
23
- displayName: 'Customer Type',
24
- description: 'Type of the customer',
25
- required: true,
26
- options: {
27
- options: [
28
- { label: 'Individual', value: 'private' },
29
- { label: 'Company', value: 'company' },
30
- ],
31
- },
32
- }),
33
- vatNumber: pieces_framework_1.Property.ShortText({
34
- displayName: 'VAT Number',
35
- description: 'Customer VAT number',
36
- required: false,
37
- }),
38
- orgNumber: pieces_framework_1.Property.ShortText({
39
- displayName: 'Organization Number',
40
- description: 'Customer organization number',
41
- required: false,
42
- }),
43
- paymentTerms: pieces_framework_1.Property.ShortText({
44
- displayName: 'Payment Terms',
45
- 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.',
46
- required: false,
47
- }),
48
- customerNumber: pieces_framework_1.Property.ShortText({
49
- displayName: 'Customer Number',
50
- description: 'Customer number (optional)',
51
- required: false,
52
- }),
53
- email: pieces_framework_1.Property.ShortText({
54
- displayName: 'Email',
55
- description: 'Customer email address',
56
- required: false,
57
- }),
58
- phone: pieces_framework_1.Property.ShortText({
59
- displayName: 'Phone',
60
- description: 'Customer phone number',
61
- required: false,
62
- }),
63
- lin1: pieces_framework_1.Property.ShortText({
64
- displayName: 'Address line 1',
65
- description: 'Customer address line 1',
66
- required: false,
67
- }),
68
- line2: pieces_framework_1.Property.ShortText({
69
- displayName: 'Address line 2',
70
- description: 'Customer address line 2',
71
- required: false,
72
- }),
73
- zipCode: pieces_framework_1.Property.ShortText({
74
- displayName: 'Zip Code',
75
- description: 'Customer zip code',
76
- required: false,
77
- }),
78
- city: pieces_framework_1.Property.ShortText({
79
- displayName: 'City',
80
- description: 'Customer city',
81
- required: false,
82
- }),
83
- country: pieces_framework_1.Property.ShortText({
84
- displayName: 'Country',
85
- description: 'Customer country (ISO 3166-1 alpha-2 country code)',
86
- required: false,
87
- }),
88
- },
89
- run(context) {
90
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
91
- const { customerName, type, vatNumber, orgNumber, paymentTerms, customerNumber, email, phone, lin1, line2, zipCode, city, country, } = context.propsValue;
92
- const { api_key, companyId } = context.auth.props;
93
- const body = {
94
- name: customerName,
95
- type: type,
96
- };
97
- if (vatNumber) {
98
- body.vat_number = vatNumber;
99
- }
100
- if (orgNumber) {
101
- body.org_number = orgNumber;
102
- }
103
- if (customerNumber) {
104
- body.customer_number = customerNumber;
105
- }
106
- if (paymentTerms) {
107
- body.payment_terms = paymentTerms;
108
- }
109
- const contactsDetails = {};
110
- if (email) {
111
- contactsDetails.email = email;
112
- }
113
- if (phone) {
114
- contactsDetails.phone = phone;
115
- }
116
- if (Object.keys(contactsDetails).length > 0) {
117
- body.contactsDetails = contactsDetails;
118
- }
119
- const addressDetails = {};
120
- if (lin1) {
121
- addressDetails.line_1 = lin1;
122
- }
123
- if (line2) {
124
- addressDetails.line_2 = line2;
125
- }
126
- if (zipCode) {
127
- addressDetails.zip_code = zipCode;
128
- }
129
- if (city) {
130
- addressDetails.city = city;
131
- }
132
- if (country) {
133
- addressDetails.country = country;
134
- }
135
- if (Object.keys(addressDetails).length > 0) {
136
- body.address = addressDetails;
137
- }
138
- const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/customers`, body);
139
- return response;
140
- });
141
- },
142
- });
143
- //# sourceMappingURL=create-customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA2C;AAC3C,6CAA+C;AAC/C,+DAAyD;AAG5C,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,iCAAiC;IAC9C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4SAA4S,EAAE,UAAU,EAAE,KAAK,EAAE;IAC5V,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B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AC,CAAC"}
@@ -1,18 +0,0 @@
1
- export declare const createInvoice: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>, {
5
- invoiceType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
- customerRef: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- invoiceDate: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- dueDate: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- orderNumberReference: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- currency: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- currencyRate: import("@activepieces/pieces-framework").NumberProperty<false>;
12
- itemType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
13
- dynamicProps: import("@activepieces/pieces-framework").DynamicProperties<false, import("@activepieces/pieces-framework").CustomAuthProperty<{
14
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
15
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
16
- }>>;
17
- }>;
18
- //# sourceMappingURL=create-invoice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-invoice.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-invoice.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;EA0IxB,CAAC"}
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createInvoice = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const client_1 = require("../common/client");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const props_1 = require("../common/props");
10
- exports.createInvoice = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.bokioAuth,
12
- name: 'createInvoice',
13
- displayName: 'Create Invoice',
14
- description: 'Creates a new draft invoice in Bokio',
15
- audience: 'both',
16
- aiMetadata: { description: 'Creates a new draft invoice in a Bokio company with a single line item. Use to start a new customer invoice; invoice date, due date, and item type are required, and the customer is linked by passing the customer UUID. Not idempotent — each call creates a separate draft invoice.', idempotent: false },
17
- props: {
18
- invoiceType: pieces_framework_1.Property.StaticDropdown({
19
- displayName: 'Invoice Type',
20
- description: 'Type of invoice',
21
- required: false,
22
- options: {
23
- options: [
24
- { label: 'Invoice', value: 'invoice' },
25
- { label: 'Cash Invoice', value: 'cashInvoice' },
26
- ],
27
- },
28
- }),
29
- customerRef: pieces_framework_1.Property.ShortText({
30
- displayName: 'Customer ID',
31
- description: 'UUID of the customer',
32
- required: false,
33
- }),
34
- invoiceDate: pieces_framework_1.Property.ShortText({
35
- displayName: 'Invoice Date',
36
- description: 'Invoice date (YYYY-MM-DD)',
37
- required: true,
38
- }),
39
- dueDate: pieces_framework_1.Property.ShortText({
40
- displayName: 'Due Date',
41
- description: 'Due date (YYYY-MM-DD)',
42
- required: true,
43
- }),
44
- orderNumberReference: pieces_framework_1.Property.ShortText({
45
- displayName: 'Order Number Reference',
46
- description: 'The order number associated with the invoice',
47
- required: false,
48
- }),
49
- currency: pieces_framework_1.Property.ShortText({
50
- displayName: 'Currency',
51
- description: 'ISO 4217 currency code (e.g., SEK, EUR, USD)',
52
- required: false,
53
- }),
54
- currencyRate: pieces_framework_1.Property.Number({
55
- displayName: 'Currency Rate',
56
- description: 'Currency rate (defaults to 1)',
57
- required: false,
58
- }),
59
- itemType: pieces_framework_1.Property.StaticDropdown({
60
- displayName: 'Item Type',
61
- description: 'Type of the line item',
62
- required: true,
63
- options: {
64
- options: [
65
- { label: 'Sales Item', value: 'salesItem' },
66
- { label: 'Description Only Item', value: 'descriptionOnlyItem' },
67
- ],
68
- },
69
- }),
70
- dynamicProps: props_1.lineItemsProps,
71
- },
72
- run(context) {
73
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
74
- const { invoiceType, customerRef, invoiceDate, dueDate, orderNumberReference, currency, currencyRate, itemType, dynamicProps, } = context.propsValue;
75
- const { api_key, companyId } = context.auth.props;
76
- const body = {
77
- type: invoiceType || 'invoice',
78
- invoiceDate,
79
- dueDate,
80
- };
81
- if (customerRef) {
82
- body.customerRef = {
83
- id: customerRef,
84
- };
85
- }
86
- if (orderNumberReference) {
87
- body.orderNumberReference = orderNumberReference;
88
- }
89
- if (currency) {
90
- body.currency = currency;
91
- }
92
- if (currencyRate !== undefined && currencyRate !== null) {
93
- body.currencyRate = currencyRate;
94
- }
95
- const lineItems = {};
96
- if (itemType === 'salesItem' && dynamicProps) {
97
- lineItems.itemType = itemType;
98
- body.description = dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['description'];
99
- lineItems.quantity = dynamicProps['quantity'];
100
- lineItems.unitPrice = dynamicProps['unitPrice'];
101
- if (dynamicProps['itemRefId']) {
102
- lineItems.itemRef = {
103
- id: dynamicProps['itemRefId'],
104
- };
105
- }
106
- if (dynamicProps['productType']) {
107
- lineItems.productType = dynamicProps['productType'];
108
- }
109
- if (dynamicProps['unitType']) {
110
- lineItems.unitType = dynamicProps['unitType'];
111
- }
112
- if (dynamicProps['taxRate'] !== undefined &&
113
- dynamicProps['taxRate'] !== null) {
114
- lineItems.taxRate = dynamicProps['taxRate'];
115
- }
116
- }
117
- body.lineItems = [lineItems];
118
- const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/invoices`, body);
119
- return response;
120
- });
121
- },
122
- });
123
- //# sourceMappingURL=create-invoice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-invoice.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-invoice.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA2C;AAC3C,6CAA+C;AAC/C,+DAAyD;AACzD,2CAAiD;AAEpC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,I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Property<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>, {
5
- filterType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
- filterValue: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- page: import("@activepieces/pieces-framework").NumberProperty<false>;
8
- pageSize: import("@activepieces/pieces-framework").NumberProperty<false>;
9
- }>;
10
- //# sourceMappingURL=find-customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-customer.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-customer.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;EAqEvB,CAAC"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findCustomer = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const client_1 = require("../common/client");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- exports.findCustomer = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.bokioAuth,
11
- name: 'findCustomer',
12
- displayName: 'Find Customer',
13
- description: 'Find customers in Bokio by filtering and pagination',
14
- audience: 'both',
15
- aiMetadata: { description: 'Lists customers in a Bokio company with pagination, optionally filtered by name, type, VAT number, or organization number. Leaving the filter empty returns all customers; supplying a filter type and value narrows to matching records. Use to look up a customer or their ID. Idempotent read-only lookup.', idempotent: true },
16
- props: {
17
- filterType: pieces_framework_1.Property.StaticDropdown({
18
- displayName: 'Filter Type',
19
- description: 'Type of filter to use',
20
- required: false,
21
- options: {
22
- options: [
23
- { label: 'Name', value: 'name' },
24
- { label: 'Type', value: 'type' },
25
- { label: 'VAT Number', value: 'vatNumber' },
26
- { label: 'Organization Number', value: 'orgNumber' },
27
- ],
28
- },
29
- }),
30
- filterValue: pieces_framework_1.Property.ShortText({
31
- displayName: 'Filter Value',
32
- description: 'Value to filter by',
33
- required: false,
34
- }),
35
- page: pieces_framework_1.Property.Number({
36
- displayName: 'Page',
37
- description: 'Page number (defaults to 1)',
38
- required: false,
39
- }),
40
- pageSize: pieces_framework_1.Property.Number({
41
- displayName: 'Page Size',
42
- description: 'Number of items per page (max 100, defaults to 25)',
43
- required: false,
44
- }),
45
- },
46
- run(context) {
47
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
- const { filterType, filterValue, page, pageSize } = context.propsValue;
49
- const { api_key, companyId } = context.auth.props;
50
- let query = '';
51
- if (filterType && filterValue) {
52
- query = `${filterType}=='${filterValue}'`;
53
- }
54
- const params = new URLSearchParams();
55
- if (page !== undefined && page !== null) {
56
- params.append('page', String(page));
57
- }
58
- else {
59
- params.append('page', '1');
60
- }
61
- if (pageSize !== undefined && pageSize !== null) {
62
- params.append('pageSize', String(pageSize));
63
- }
64
- else {
65
- params.append('pageSize', '25');
66
- }
67
- if (query) {
68
- params.append('query', query);
69
- }
70
- const url = `/companies/${companyId}/customers?${params.toString()}`;
71
- const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.GET, url);
72
- return response;
73
- });
74
- },
75
- });
76
- //# sourceMappingURL=find-customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-customer.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA2C;AAC3C,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,qDAAqD;IAClE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,+SAA+S,EAAE,UAAU,EAAE,IAAI,EAAE;IAC9V,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,cAAc,CA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AK,IAAI,EAAE,CAAC;gBACxC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;YACtC,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC7B,CAAC;YAED,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBAChD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC9C,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAClC,CAAC;YAED,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAChC,CAAC;YAED,MAAM,GAAG,GAAG,cAAc,SAAS,cAAc,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YAErE,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAAC,OAAO,EAAE,0BAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAEjE,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const getAJournalEntry: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>, {
5
- journalEntryId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
- }>;
7
- //# sourceMappingURL=get-a-journal-entry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-a-journal-entry.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-a-journal-entry.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;EA0B3B,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAJournalEntry = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const client_1 = require("../common/client");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- exports.getAJournalEntry = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.bokioAuth,
11
- name: 'getAJournalEntry',
12
- displayName: 'Get a journal entry',
13
- description: 'Retrieve a specific journal entry by its ID',
14
- audience: 'both',
15
- aiMetadata: { description: 'Retrieves a single journal entry from a Bokio company by its UUID. Use when you already have the journal entry ID and need its full bookkeeping details. Idempotent read-only lookup.', idempotent: true },
16
- props: {
17
- journalEntryId: pieces_framework_1.Property.ShortText({
18
- displayName: 'Journal Entry ID',
19
- description: 'UUID of the journal entry',
20
- required: true,
21
- }),
22
- },
23
- run(context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- const { journalEntryId } = context.propsValue;
26
- const { api_key, companyId } = context.auth.props;
27
- const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.GET, `/companies/${companyId}/journal-entries/${journalEntryId}`);
28
- return response;
29
- });
30
- },
31
- });
32
- //# sourceMappingURL=get-a-journal-entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-a-journal-entry.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-a-journal-entry.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA2C;AAC3C,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,6CAA6C;IAC1D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uLAAuL,EAAE,UAAU,EAAE,IAAI,EAAE;IACtO,KAAK,EAAE;QACL,cAAc,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC9C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAElD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,EACP,0BAAU,CAAC,GAAG,EACd,cAAc,SAAS,oBAAoB,cAAc,EAAE,CAC5D,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}