@activepieces/piece-beebole 0.1.6 → 0.1.7
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/package.json +7 -12
- package/src/index.js +20 -44
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-company.d.ts +0 -5
- package/src/lib/actions/create-company.d.ts.map +0 -1
- package/src/lib/actions/create-company.js +0 -51
- package/src/lib/actions/create-company.js.map +0 -1
- package/src/lib/actions/create-multiple-time-entries.d.ts +0 -12
- package/src/lib/actions/create-multiple-time-entries.d.ts.map +0 -1
- package/src/lib/actions/create-multiple-time-entries.js +0 -141
- package/src/lib/actions/create-multiple-time-entries.js.map +0 -1
- package/src/lib/actions/create-person.d.ts +0 -8
- package/src/lib/actions/create-person.d.ts.map +0 -1
- package/src/lib/actions/create-person.js +0 -81
- package/src/lib/actions/create-person.js.map +0 -1
- package/src/lib/actions/create-project.d.ts +0 -7
- package/src/lib/actions/create-project.d.ts.map +0 -1
- package/src/lib/actions/create-project.js +0 -64
- package/src/lib/actions/create-project.js.map +0 -1
- package/src/lib/actions/create-subproject.d.ts +0 -6
- package/src/lib/actions/create-subproject.d.ts.map +0 -1
- package/src/lib/actions/create-subproject.js +0 -54
- package/src/lib/actions/create-subproject.js.map +0 -1
- package/src/lib/actions/deactivate-subproject.d.ts +0 -6
- package/src/lib/actions/deactivate-subproject.d.ts.map +0 -1
- package/src/lib/actions/deactivate-subproject.js +0 -56
- package/src/lib/actions/deactivate-subproject.js.map +0 -1
- package/src/lib/actions/delete-multiple-time-entries.d.ts +0 -5
- package/src/lib/actions/delete-multiple-time-entries.d.ts.map +0 -1
- package/src/lib/actions/delete-multiple-time-entries.js +0 -104
- package/src/lib/actions/delete-multiple-time-entries.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -2
- package/src/lib/common/auth.d.ts.map +0 -1
- package/src/lib/common/auth.js +0 -37
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -10
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -24
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -23
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -207
- package/src/lib/common/props.js.map +0 -1
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createMultipleTimeEntriesAction = 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 props_1 = require("../common/props");
|
|
9
|
-
const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
|
|
10
|
-
exports.createMultipleTimeEntriesAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.beeboleAuth,
|
|
12
|
-
name: 'create_multiple_time_entries',
|
|
13
|
-
displayName: 'Create Multiple Time Entries',
|
|
14
|
-
description: 'Creates time entries (working time or absence) across multiple days in Beebole.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Logs the same number of hours on each of several dates in Beebole, in one of two modes: working time against a chosen subproject, or an absence of a chosen type (e.g. vacation, sick leave). Use to bulk-log time across a date range; per-date failures are collected rather than aborting unless continue-on-error is disabled. Not idempotent: each call appends new time entries, so repeating it duplicates them.',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
entryType: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
-
displayName: 'Entry Type',
|
|
23
|
-
description: 'Choose whether you are logging working time on a subproject or an absence (e.g. vacation, sick leave).',
|
|
24
|
-
required: true,
|
|
25
|
-
defaultValue: 'working_time',
|
|
26
|
-
options: {
|
|
27
|
-
options: [
|
|
28
|
-
{ label: 'Working Time', value: 'working_time' },
|
|
29
|
-
{ label: 'Absence', value: 'absence' },
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
}),
|
|
33
|
-
absence: props_1.beeboleProps.absenceDropdown({
|
|
34
|
-
required: false,
|
|
35
|
-
description: 'The absence type (e.g. Vacation, Sick Leave) to log on the selected dates.',
|
|
36
|
-
}),
|
|
37
|
-
company: props_1.beeboleProps.companyDropdown({
|
|
38
|
-
required: false,
|
|
39
|
-
description: 'The company that owns the project.',
|
|
40
|
-
}),
|
|
41
|
-
project: props_1.beeboleProps.projectDropdown({
|
|
42
|
-
required: false,
|
|
43
|
-
description: 'The project containing the subproject.',
|
|
44
|
-
}),
|
|
45
|
-
subproject: props_1.beeboleProps.subprojectDropdown({
|
|
46
|
-
required: false,
|
|
47
|
-
description: 'The subproject to log working time against.',
|
|
48
|
-
}),
|
|
49
|
-
dates: pieces_framework_1.Property.Array({
|
|
50
|
-
displayName: 'Dates',
|
|
51
|
-
description: 'The dates to create time entries for, each in YYYY-MM-DD format (e.g. "2026-05-21").',
|
|
52
|
-
required: true,
|
|
53
|
-
}),
|
|
54
|
-
hours: pieces_framework_1.Property.Number({
|
|
55
|
-
displayName: 'Hours per Day',
|
|
56
|
-
description: 'The number of hours to log for each date (e.g. 8 for a full working day).',
|
|
57
|
-
required: true,
|
|
58
|
-
defaultValue: 8,
|
|
59
|
-
}),
|
|
60
|
-
comment: pieces_framework_1.Property.LongText({
|
|
61
|
-
displayName: 'Comment',
|
|
62
|
-
description: 'Optional comment applied to every created time entry.',
|
|
63
|
-
required: false,
|
|
64
|
-
}),
|
|
65
|
-
continueOnError: pieces_framework_1.Property.Checkbox({
|
|
66
|
-
displayName: 'Continue on Error',
|
|
67
|
-
description: 'If enabled, a failure on one date will not stop creation for the remaining dates.',
|
|
68
|
-
required: false,
|
|
69
|
-
defaultValue: true,
|
|
70
|
-
}),
|
|
71
|
-
},
|
|
72
|
-
run(context) {
|
|
73
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
var _a, _b, _c, _d, _e;
|
|
75
|
-
const { entryType, dates, hours, comment, continueOnError } = context.propsValue;
|
|
76
|
-
const dateList = dates
|
|
77
|
-
.map((d) => (typeof d === 'string' ? d.trim() : ''))
|
|
78
|
-
.filter((d) => d.length > 0);
|
|
79
|
-
if (dateList.length === 0) {
|
|
80
|
-
throw new Error('At least one date is required.');
|
|
81
|
-
}
|
|
82
|
-
const invalidDates = dateList.filter((d) => !dateRegex.test(d));
|
|
83
|
-
if (invalidDates.length > 0) {
|
|
84
|
-
throw new Error(`Invalid date format (expected YYYY-MM-DD): ${invalidDates.join(', ')}`);
|
|
85
|
-
}
|
|
86
|
-
if (entryType === 'absence' && !context.propsValue.absence) {
|
|
87
|
-
throw new Error('Absence type is required when Entry Type is Absence.');
|
|
88
|
-
}
|
|
89
|
-
if (entryType === 'working_time' && !context.propsValue.subproject) {
|
|
90
|
-
throw new Error('Subproject is required when Entry Type is Working Time.');
|
|
91
|
-
}
|
|
92
|
-
const targetBody = {};
|
|
93
|
-
if (entryType === 'absence') {
|
|
94
|
-
targetBody['absence'] = { id: context.propsValue.absence };
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
targetBody['subproject'] = { id: context.propsValue.subproject };
|
|
98
|
-
}
|
|
99
|
-
const created = [];
|
|
100
|
-
const failed = [];
|
|
101
|
-
for (const date of dateList) {
|
|
102
|
-
const body = Object.assign(Object.assign({ service: 'time_entry.create' }, targetBody), { date,
|
|
103
|
-
hours });
|
|
104
|
-
if (comment) {
|
|
105
|
-
body['comment'] = comment;
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
const response = yield client_1.beeboleClient.call({
|
|
109
|
-
token: context.auth.secret_text,
|
|
110
|
-
body,
|
|
111
|
-
});
|
|
112
|
-
if (response.body.status !== 'ok') {
|
|
113
|
-
throw new Error((_a = response.body.message) !== null && _a !== void 0 ? _a : 'Unknown error');
|
|
114
|
-
}
|
|
115
|
-
const entry = response.body.time_entry;
|
|
116
|
-
created.push({
|
|
117
|
-
time_entry_id: (_b = entry === null || entry === void 0 ? void 0 : entry.id) !== null && _b !== void 0 ? _b : null,
|
|
118
|
-
date,
|
|
119
|
-
hours: (_c = entry === null || entry === void 0 ? void 0 : entry.hours) !== null && _c !== void 0 ? _c : hours,
|
|
120
|
-
comment: (_e = (_d = entry === null || entry === void 0 ? void 0 : entry.comment) !== null && _d !== void 0 ? _d : comment) !== null && _e !== void 0 ? _e : null,
|
|
121
|
-
status: 'ok',
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
catch (error) {
|
|
125
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
126
|
-
if (!continueOnError) {
|
|
127
|
-
throw new Error(`Failed to create time entry for ${date}: ${message}`);
|
|
128
|
-
}
|
|
129
|
-
failed.push({ date, error: message });
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
created_count: created.length,
|
|
134
|
-
failed_count: failed.length,
|
|
135
|
-
created,
|
|
136
|
-
failed,
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
//# sourceMappingURL=create-multiple-time-entries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-multiple-time-entries.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-multiple-time-entries.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,yCAA6C;AAC7C,6CAAiD;AACjD,2CAA+C;AAa/C,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAE3B,QAAA,+BAA+B,GAAG,IAAA,+BAAY,EAAC;IAC1D,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EACT,iFAAiF;IACnF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,yZAAy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,KAAK,CAAE,KAAK,mCAAI,KAAK;wBAC5B,OAAO,EAAE,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,OAAO,mCAAI,IAAI;wBAC1C,MAAM,EAAE,IAAI;qBACb,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACvE,IAAI,CAAC,eAAe,EAAE,CAAC;wBACrB,MAAM,IAAI,KAAK,CACb,mCAAmC,IAAI,KAAK,OAAO,EAAE,CACtD,CAAC;oBACJ,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;YAED,OAAO;gBACL,aAAa,EAAE,OAAO,CAAC,MAAM;gBAC7B,YAAY,EAAE,MAAM,CAAC,MAAM;gBAC3B,OAAO;gBACP,MAAM;aACP,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const createPersonAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
company: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
invite: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
|
-
userGroup: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=create-person.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-person.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-person.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,kBAAkB;;;;;;EAuE7B,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPersonAction = 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 props_1 = require("../common/props");
|
|
9
|
-
exports.createPersonAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.beeboleAuth,
|
|
11
|
-
name: 'create_person',
|
|
12
|
-
displayName: 'Create Person',
|
|
13
|
-
description: 'Creates a new person in Beebole. An available license is required for the person to be active.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Creates a person (employee, project lead, or admin) under a given company in Beebole, optionally emailing them a login invitation when an email is provided. Use to onboard a new team member or contact. Not idempotent: each call creates a new person record and may re-send an invite, with no de-duplication on name or email.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
company: props_1.beeboleProps.companyDropdown({
|
|
21
|
-
required: true,
|
|
22
|
-
description: 'The company this person belongs to.',
|
|
23
|
-
}),
|
|
24
|
-
name: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Full Name',
|
|
26
|
-
description: 'The full name of the person (e.g. "Jane Doe").',
|
|
27
|
-
required: true,
|
|
28
|
-
}),
|
|
29
|
-
email: pieces_framework_1.Property.ShortText({
|
|
30
|
-
displayName: 'Email',
|
|
31
|
-
description: 'Email address. Required if you want to invite the person to log in to Beebole.',
|
|
32
|
-
required: false,
|
|
33
|
-
}),
|
|
34
|
-
invite: pieces_framework_1.Property.Checkbox({
|
|
35
|
-
displayName: 'Send Invitation Email',
|
|
36
|
-
description: 'Send an invitation email so the person can log in to Beebole. Requires an email address.',
|
|
37
|
-
required: false,
|
|
38
|
-
defaultValue: false,
|
|
39
|
-
}),
|
|
40
|
-
userGroup: pieces_framework_1.Property.StaticDropdown({
|
|
41
|
-
displayName: 'User Group',
|
|
42
|
-
description: 'The permission level for this person. "Employee" can log time; "Project Lead" can also manage projects; "Admin" has full access.',
|
|
43
|
-
required: false,
|
|
44
|
-
defaultValue: 'employee',
|
|
45
|
-
options: {
|
|
46
|
-
options: [
|
|
47
|
-
{ label: 'Employee', value: 'employee' },
|
|
48
|
-
{ label: 'Project Lead', value: 'project_lead' },
|
|
49
|
-
{ label: 'Administrator', value: 'admin' },
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
53
|
-
},
|
|
54
|
-
run(context) {
|
|
55
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
var _a;
|
|
57
|
-
const person = {
|
|
58
|
-
name: context.propsValue.name,
|
|
59
|
-
company: { id: context.propsValue.company },
|
|
60
|
-
};
|
|
61
|
-
if (context.propsValue.email) {
|
|
62
|
-
person['email'] = context.propsValue.email;
|
|
63
|
-
}
|
|
64
|
-
if (context.propsValue.invite !== undefined) {
|
|
65
|
-
person['invite'] = context.propsValue.invite;
|
|
66
|
-
}
|
|
67
|
-
if (context.propsValue.userGroup) {
|
|
68
|
-
person['userGroup'] = context.propsValue.userGroup;
|
|
69
|
-
}
|
|
70
|
-
const response = yield client_1.beeboleClient.call({
|
|
71
|
-
token: context.auth.secret_text,
|
|
72
|
-
body: { service: 'person.create', person },
|
|
73
|
-
});
|
|
74
|
-
if (response.body.status !== 'ok') {
|
|
75
|
-
throw new Error(`Beebole returned an error: ${(_a = response.body.message) !== null && _a !== void 0 ? _a : 'Unknown error'}`);
|
|
76
|
-
}
|
|
77
|
-
return response.body;
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
//# sourceMappingURL=create-person.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-person.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-person.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA6C;AAC7C,6CAAiD;AACjD,2CAA+C;AAclC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,gGAAgG;IAC7G,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,qUAAqU;QAClV,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,oBAAY,CAAC,eAAe,CAAC;YACpC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,qCAAqC;SACnD,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,gFAAgF;YAC7F,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,uBAAuB;YACpC,WAAW,EAAE,0FAA0F;YACvG,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACjC,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,kIAAkI;YAC/I,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE;gBACP,OAAO,EA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AAC,IAAI,CAAA;QACtB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const createProjectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
company: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
startDate: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
description: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=create-project.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-project.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB;;;;;EAsD9B,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createProjectAction = 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 props_1 = require("../common/props");
|
|
9
|
-
exports.createProjectAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.beeboleAuth,
|
|
11
|
-
name: 'create_project',
|
|
12
|
-
displayName: 'Create Project',
|
|
13
|
-
description: 'Creates a new project under a company in Beebole.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Creates a project owned by an existing company in Beebole, with an optional start date and description. Use after the company exists and before adding subprojects or logging time. Not idempotent: each call creates a new project even with identical details.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
company: props_1.beeboleProps.companyDropdown({
|
|
21
|
-
required: true,
|
|
22
|
-
description: 'The company (customer) that owns this project.',
|
|
23
|
-
}),
|
|
24
|
-
name: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Project Name',
|
|
26
|
-
description: 'The name of the new project (e.g. "Website Redesign").',
|
|
27
|
-
required: true,
|
|
28
|
-
}),
|
|
29
|
-
startDate: pieces_framework_1.Property.ShortText({
|
|
30
|
-
displayName: 'Start Date',
|
|
31
|
-
description: 'The project start date in YYYY-MM-DD format (e.g. "2026-01-15"). Leave empty for no start date.',
|
|
32
|
-
required: false,
|
|
33
|
-
}),
|
|
34
|
-
description: pieces_framework_1.Property.LongText({
|
|
35
|
-
displayName: 'Description',
|
|
36
|
-
description: 'Optional description of the project.',
|
|
37
|
-
required: false,
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
run(context) {
|
|
41
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a;
|
|
43
|
-
const project = {
|
|
44
|
-
name: context.propsValue.name,
|
|
45
|
-
company: { id: context.propsValue.company },
|
|
46
|
-
};
|
|
47
|
-
if (context.propsValue.startDate) {
|
|
48
|
-
project['startDate'] = context.propsValue.startDate;
|
|
49
|
-
}
|
|
50
|
-
if (context.propsValue.description) {
|
|
51
|
-
project['description'] = context.propsValue.description;
|
|
52
|
-
}
|
|
53
|
-
const response = yield client_1.beeboleClient.call({
|
|
54
|
-
token: context.auth.secret_text,
|
|
55
|
-
body: { service: 'project.create', project },
|
|
56
|
-
});
|
|
57
|
-
if (response.body.status !== 'ok') {
|
|
58
|
-
throw new Error(`Beebole returned an error: ${(_a = response.body.message) !== null && _a !== void 0 ? _a : 'Unknown error'}`);
|
|
59
|
-
}
|
|
60
|
-
return response.body;
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
//# sourceMappingURL=create-project.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-project.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA6C;AAC7C,6CAAiD;AACjD,2CAA+C;AAclC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mDAAmD;IAChE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,kQAAkQ;QAC/Q,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,oBAAY,CAAC,eAAe,CAAC;YACpC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gDAAgD;SAC9D,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,wDAAwD;YACrE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,iGAAiG;YAC9G,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,OAAO,GAA4B;gBACvC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;gBAC7B,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;aAC5C,CAAC;YACF,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;gBACjC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;YACtD,CAAC;YACD,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;gBACnC,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;YAC1D,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,sBAAa,CAAC,IAAI,CAAwB;gBAC/D,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE;aAC7C,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,mCAAI,eAAe,EAAE,CAAC,CAAC;YAC5F,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAA;QACtB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const createSubprojectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
company: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
project: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=create-subproject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-subproject.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-subproject.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,sBAAsB;;;;EA2CjC,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSubprojectAction = 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 props_1 = require("../common/props");
|
|
9
|
-
exports.createSubprojectAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.beeboleAuth,
|
|
11
|
-
name: 'create_subproject',
|
|
12
|
-
displayName: 'Create Subproject',
|
|
13
|
-
description: 'Creates a new subproject under an existing project in Beebole.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Creates a subproject inside an existing project (under its company) in Beebole. Use to break a project into work streams that time can be logged against. Not idempotent: each call creates a new subproject even with the same name.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
company: props_1.beeboleProps.companyDropdown({
|
|
21
|
-
required: true,
|
|
22
|
-
description: 'The company that owns the parent project.',
|
|
23
|
-
}),
|
|
24
|
-
project: props_1.beeboleProps.projectDropdown({
|
|
25
|
-
required: true,
|
|
26
|
-
description: 'The project that will contain this subproject.',
|
|
27
|
-
}),
|
|
28
|
-
name: pieces_framework_1.Property.ShortText({
|
|
29
|
-
displayName: 'Subproject Name',
|
|
30
|
-
description: 'The name of the new subproject (e.g. "Prototype", "Phase 1").',
|
|
31
|
-
required: true,
|
|
32
|
-
}),
|
|
33
|
-
},
|
|
34
|
-
run(context) {
|
|
35
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
var _a;
|
|
37
|
-
const response = yield client_1.beeboleClient.call({
|
|
38
|
-
token: context.auth.secret_text,
|
|
39
|
-
body: {
|
|
40
|
-
service: 'subproject.create',
|
|
41
|
-
subproject: {
|
|
42
|
-
name: context.propsValue.name,
|
|
43
|
-
project: { id: context.propsValue.project },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
if (response.body.status !== 'ok') {
|
|
48
|
-
throw new Error(`Beebole returned an error: ${(_a = response.body.message) !== null && _a !== void 0 ? _a : 'Unknown error'}`);
|
|
49
|
-
}
|
|
50
|
-
return response.body;
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=create-subproject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-subproject.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-subproject.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA6C;AAC7C,6CAAiD;AACjD,2CAA+C;AAYlC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,gEAAgE;IAC7E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,uOAAuO;QACpP,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,oBAAY,CAAC,eAAe,CAAC;YACpC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,2CAA2C;SACzD,CAAC;QACF,OAAO,EAAE,oBAAY,CAAC,eAAe,CAAC;YACpC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gDAAgD;SAC9D,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,+DAA+D;YAC5E,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,sBAAa,CAAC,IAAI,CAA2B;gBAClE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,IAAI,EAAE;oBACJ,OAAO,EAAE,mBAAmB;oBAC5B,UAAU,EAAE;wBACV,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;wBAC7B,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;qBAC5C;iBACF;aACF,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,mCAAI,eAAe,EAAE,CAAC,CAAC;YAC5F,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAA;QACtB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const deactivateSubprojectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
company: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
project: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
subproject: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=deactivate-subproject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deactivate-subproject.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/deactivate-subproject.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,0BAA0B;;;;EA6CrC,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deactivateSubprojectAction = 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 props_1 = require("../common/props");
|
|
9
|
-
exports.deactivateSubprojectAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.beeboleAuth,
|
|
11
|
-
name: 'deactivate_subproject',
|
|
12
|
-
displayName: 'Deactivate Subproject',
|
|
13
|
-
description: 'Marks a subproject as inactive in Beebole. Inactive subprojects are hidden from new time entries.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Deactivates a subproject in Beebole so it is hidden from new time entries while existing entries are preserved. Use to retire a completed or unused work stream. Effectively idempotent: a subproject already inactive stays inactive, though the call still hits the API each time.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
company: props_1.beeboleProps.companyDropdown({
|
|
21
|
-
required: true,
|
|
22
|
-
description: 'The company that owns the project.',
|
|
23
|
-
}),
|
|
24
|
-
project: props_1.beeboleProps.projectDropdown({
|
|
25
|
-
required: true,
|
|
26
|
-
description: 'The project containing the subproject to deactivate.',
|
|
27
|
-
}),
|
|
28
|
-
subproject: props_1.beeboleProps.subprojectDropdown({
|
|
29
|
-
required: true,
|
|
30
|
-
description: 'The subproject to deactivate.',
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
33
|
-
run(context) {
|
|
34
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
var _a;
|
|
36
|
-
const response = yield client_1.beeboleClient.call({
|
|
37
|
-
token: context.auth.secret_text,
|
|
38
|
-
body: {
|
|
39
|
-
service: 'subproject.deactivate',
|
|
40
|
-
id: context.propsValue.subproject,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
if (response.body.status !== 'ok') {
|
|
44
|
-
throw new Error(`Beebole returned an error: ${(_a = response.body.message) !== null && _a !== void 0 ? _a : 'Unknown error'}`);
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
subproject_id: context.propsValue.subproject,
|
|
48
|
-
project_id: context.propsValue.project,
|
|
49
|
-
company_id: context.propsValue.company,
|
|
50
|
-
status: response.body.status,
|
|
51
|
-
deactivated: true,
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=deactivate-subproject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deactivate-subproject.js","sourceRoot":"","sources":["../../../../src/lib/actions/deactivate-subproject.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,yCAA6C;AAC7C,6CAAiD;AACjD,2CAA+C;AAOlC,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,mGAAmG;IAChH,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,sRAAsR;QACnS,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,oBAAY,CAAC,eAAe,CAAC;YACpC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,oCAAoC;SAClD,CAAC;QACF,OAAO,EAAE,oBAAY,CAAC,eAAe,CAAC;YACpC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,sDAAsD;SACpE,CAAC;QACF,UAAU,EAAE,oBAAY,CAAC,kBAAkB,CAAC;YAC1C,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+BAA+B;SAC7C,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,sBAAa,CAAC,IAAI,CAA+B;gBACtE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,IAAI,EAAE;oBACJ,OAAO,EAAE,uBAAuB;oBAChC,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;iBAClC;aACF,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,mCAAI,eAAe,EAAE,CAAC,CAAC;YAC5F,CAAC;YAED,OAAO;gBACL,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;gBAC5C,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACtC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACtC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;gBAC5B,WAAW,EAAE,IAAI;aAClB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const deleteMultipleTimeEntriesAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
entries: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
3
|
-
continueOnError: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=delete-multiple-time-entries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-multiple-time-entries.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-multiple-time-entries.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,+BAA+B;;;EAoG1C,CAAC"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteMultipleTimeEntriesAction = 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 dateRegex = /^\d{4}-\d{2}-\d{2}$/;
|
|
9
|
-
exports.deleteMultipleTimeEntriesAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.beeboleAuth,
|
|
11
|
-
name: 'delete_multiple_time_entries',
|
|
12
|
-
displayName: 'Delete Multiple Time Entries',
|
|
13
|
-
description: 'Deletes multiple time entries (working time or absence) by their IDs and dates.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Deletes a batch of time entries in Beebole, each identified by its numeric time-entry ID plus the date it was logged on. Use to remove previously created entries; per-entry failures are collected rather than aborting unless continue-on-error is disabled. Idempotent in effect: once an entry is deleted, re-running with the same IDs has no further effect (already-removed entries simply fail).',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
entries: pieces_framework_1.Property.Array({
|
|
21
|
-
displayName: 'Time Entries to Delete',
|
|
22
|
-
description: 'List of time entries to delete. Each row requires the time entry ID and the date it was logged on (YYYY-MM-DD).',
|
|
23
|
-
required: true,
|
|
24
|
-
properties: {
|
|
25
|
-
id: pieces_framework_1.Property.Number({
|
|
26
|
-
displayName: 'Time Entry ID',
|
|
27
|
-
description: 'The numeric ID of the time entry to delete. You can get this from a "List Time Entries" step or the Beebole API response when the entry was created.',
|
|
28
|
-
required: true,
|
|
29
|
-
}),
|
|
30
|
-
date: pieces_framework_1.Property.ShortText({
|
|
31
|
-
displayName: 'Date',
|
|
32
|
-
description: 'The date the entry was logged, in YYYY-MM-DD format (e.g. "2026-05-21").',
|
|
33
|
-
required: true,
|
|
34
|
-
}),
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
continueOnError: pieces_framework_1.Property.Checkbox({
|
|
38
|
-
displayName: 'Continue on Error',
|
|
39
|
-
description: 'If enabled, a failure on one entry will not stop deletion for the remaining entries.',
|
|
40
|
-
required: false,
|
|
41
|
-
defaultValue: true,
|
|
42
|
-
}),
|
|
43
|
-
},
|
|
44
|
-
run(context) {
|
|
45
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
var _a, _b;
|
|
47
|
-
const { entries, continueOnError } = context.propsValue;
|
|
48
|
-
const rows = entries;
|
|
49
|
-
if (!rows || rows.length === 0) {
|
|
50
|
-
throw new Error('At least one time entry is required.');
|
|
51
|
-
}
|
|
52
|
-
const deleted = [];
|
|
53
|
-
const failed = [];
|
|
54
|
-
for (const row of rows) {
|
|
55
|
-
const id = typeof row.id === 'string' ? Number(row.id) : row.id;
|
|
56
|
-
const date = typeof row.date === 'string' ? row.date.trim() : '';
|
|
57
|
-
if (!id || Number.isNaN(id)) {
|
|
58
|
-
const message = 'Missing or invalid time entry ID.';
|
|
59
|
-
if (!continueOnError) {
|
|
60
|
-
throw new Error(message);
|
|
61
|
-
}
|
|
62
|
-
failed.push({ time_entry_id: (_a = row.id) !== null && _a !== void 0 ? _a : null, date: date || null, error: message });
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
if (!dateRegex.test(date)) {
|
|
66
|
-
const message = `Invalid date format (expected YYYY-MM-DD): "${date}"`;
|
|
67
|
-
if (!continueOnError) {
|
|
68
|
-
throw new Error(message);
|
|
69
|
-
}
|
|
70
|
-
failed.push({ time_entry_id: id, date: date || null, error: message });
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
const response = yield client_1.beeboleClient.call({
|
|
75
|
-
token: context.auth.secret_text,
|
|
76
|
-
body: {
|
|
77
|
-
service: 'time_entry.delete',
|
|
78
|
-
id,
|
|
79
|
-
date,
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
if (response.body.status !== 'ok') {
|
|
83
|
-
throw new Error((_b = response.body.message) !== null && _b !== void 0 ? _b : 'Unknown error');
|
|
84
|
-
}
|
|
85
|
-
deleted.push({ time_entry_id: id, date, status: 'ok' });
|
|
86
|
-
}
|
|
87
|
-
catch (error) {
|
|
88
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
89
|
-
if (!continueOnError) {
|
|
90
|
-
throw new Error(`Failed to delete time entry ${id} on ${date}: ${message}`);
|
|
91
|
-
}
|
|
92
|
-
failed.push({ time_entry_id: id, date, error: message });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
deleted_count: deleted.length,
|
|
97
|
-
failed_count: failed.length,
|
|
98
|
-
deleted,
|
|
99
|
-
failed,
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=delete-multiple-time-entries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-multiple-time-entries.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-multiple-time-entries.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA6C;AAC7C,6CAAiD;AAOjD,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAE3B,QAAA,+BAA+B,GAAG,IAAA,+BAAY,EAAC;IAC1D,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EAAE,iFAAiF;IAC9F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,0YAA0Y;QACvZ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