@activepieces/piece-moxie-crm 0.0.1

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.
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MoxieCRMClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ class MoxieCRMClient {
7
+ constructor(baseUrl, apiKey) {
8
+ this.baseUrl = baseUrl;
9
+ this.apiKey = apiKey;
10
+ // Remove trailing slash from base URL
11
+ this.baseUrl = baseUrl.replace(/\/$/, '');
12
+ }
13
+ makeRequest(method, resourceUri, body = undefined, query) {
14
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ return yield pieces_common_1.httpClient.sendRequest({
16
+ method: method,
17
+ url: `${this.baseUrl}${resourceUri}`,
18
+ headers: {
19
+ 'X-API-KEY': this.apiKey,
20
+ },
21
+ body: body,
22
+ queryParams: query,
23
+ });
24
+ });
25
+ }
26
+ createContact(request) {
27
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.POST, '/action/contacts/create', request)).body;
29
+ });
30
+ }
31
+ createClient(request) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.POST, '/action/clients/create', request)).body;
34
+ });
35
+ }
36
+ listClients() {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.GET, '/action/clients/list')).body;
39
+ });
40
+ }
41
+ listInvoiceTemplates() {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.GET, '/action/invoiceTemplates/list')).body;
44
+ });
45
+ }
46
+ createProject(request) {
47
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.POST, '/action/projects/create', request)).body;
49
+ });
50
+ }
51
+ createTask(request) {
52
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
53
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.POST, '/action/tasks/create', request)).body;
54
+ });
55
+ }
56
+ searchProjects(clientName) {
57
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.GET, '/action/projects/search', undefined, { query: clientName })).body;
59
+ });
60
+ }
61
+ listProjectTaskStages() {
62
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
+ return (yield this.makeRequest(pieces_common_1.HttpMethod.GET, '/action/taskStages/list')).body;
64
+ });
65
+ }
66
+ }
67
+ exports.MoxieCRMClient = MoxieCRMClient;
68
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/moxie-crm/src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,+DAMqC;AAWrC,MAAa,cAAc;IACzB,YAAoB,OAAe,EAAU,MAAc;QAAvC,YAAO,GAAP,OAAO,CAAQ;QAAU,WAAM,GAAN,MAAM,CAAQ;QACzD,sCAAsC;QACtC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;IACK,WAAW,CACf,MAAkB,EAClB,WAAmB,EACnB,OAAwB,SAAS,EACjC,KAAmB;;YAEnB,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAI;gBACrC,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,GAAG,WAAW,EAAE;gBACpC,OAAO,EAAE;oBACP,WAAW,EAAE,IAAI,CAAC,MAAM;iBACzB;gBACD,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,KAAK;aACnB,CAAC,CAAC;QACL,CAAC;KAAA;IACK,aAAa,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C,IAAI,CAAC;QACT,CAAC;KAAA;CACF;AAtFD,wCAsFC"}
@@ -0,0 +1,5 @@
1
+ import { PiecePropValueSchema } from '@activepieces/pieces-framework';
2
+ import { moxieCRMAuth } from '../../';
3
+ import { MoxieCRMClient } from './client';
4
+ export declare function makeClient(auth: PiecePropValueSchema<typeof moxieCRMAuth>): Promise<MoxieCRMClient>;
5
+ export declare function reformatDate(s?: string): string | undefined;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reformatDate = exports.makeClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const client_1 = require("./client");
6
+ function makeClient(auth) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const client = new client_1.MoxieCRMClient(auth.baseUrl, auth.apiKey);
9
+ return client;
10
+ });
11
+ }
12
+ exports.makeClient = makeClient;
13
+ function reformatDate(s) {
14
+ if (!s)
15
+ return undefined;
16
+ return s.split('T', 2)[0];
17
+ }
18
+ exports.reformatDate = reformatDate;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/moxie-crm/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAGA,qCAA0C;AAE1C,SAAsB,UAAU,CAC9B,IAA+C;;QAE/C,MAAM,MAAM,GAAG,IAAI,uBAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AALD,gCAKC;AAED,SAAgB,YAAY,CAAC,CAAU;IACrC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AAHD,oCAGC"}
@@ -0,0 +1,77 @@
1
+ export type ContactCreateRequest = {
2
+ first: string;
3
+ last: string;
4
+ email?: string;
5
+ phone?: string;
6
+ notes?: string;
7
+ clientName?: string;
8
+ defaultContact?: boolean;
9
+ portalAccess?: boolean;
10
+ invoiceContact?: boolean;
11
+ };
12
+ export type ClientListResponse = {
13
+ id: string;
14
+ name: string;
15
+ };
16
+ export type ProjectSearchResponse = {
17
+ id: string;
18
+ name: string;
19
+ };
20
+ export type ProjectTaskStageListResponse = {
21
+ id: string;
22
+ label: string;
23
+ hexColor: string;
24
+ complete: boolean;
25
+ clientApproval: boolean;
26
+ };
27
+ export type ProjectCreateRequest = {
28
+ name: string;
29
+ clientName: string;
30
+ startDate?: string;
31
+ dueDate?: string;
32
+ portalAccess: string;
33
+ showTimeWorkedInPortal?: boolean;
34
+ feeSchedule: {
35
+ feeType: string;
36
+ amount?: number;
37
+ estimateMax?: number;
38
+ estimateMin?: number;
39
+ taxable?: boolean;
40
+ };
41
+ };
42
+ export type ClientCreateRequest = {
43
+ name: string;
44
+ clientType: string;
45
+ initials?: string;
46
+ address1?: string;
47
+ address2?: string;
48
+ city?: string;
49
+ locality?: string;
50
+ postal?: string;
51
+ country?: string;
52
+ website?: string;
53
+ phone?: string;
54
+ color?: string;
55
+ taxId?: string;
56
+ leadSource?: string;
57
+ archive: boolean;
58
+ payInstructions?: string;
59
+ hourlyAmount?: number;
60
+ roundingIncrement?: number;
61
+ currency?: string;
62
+ stripeClientId?: string;
63
+ notes?: string;
64
+ };
65
+ export type TaskCreateRequest = {
66
+ name: string;
67
+ clientName: string;
68
+ projectName: string;
69
+ status: string;
70
+ description?: string;
71
+ dueDate?: string;
72
+ startDate?: string;
73
+ priority?: number;
74
+ tasks?: string[];
75
+ assignedTo?: string[];
76
+ customValues?: Record<string, string>;
77
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/moxie-crm/src/lib/common/models.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ export declare const enum MoxieCRMEventType {
2
+ CLIENT_CREATED = "ClientCreate",
3
+ CLIENT_UPDATED = "ClientUpdate",
4
+ CLIENT_DELETED = "ClientDelete",
5
+ PROJECT_CREATED = "ProjectCreate",
6
+ PROJECT_UPDATED = "ProjectUpdate",
7
+ PROJECT_COMPLETED = "ProjectComplete",
8
+ TASK_CREATED = "DeliverableCreate",
9
+ TASK_UPDATED = "DeliverableUpdate",
10
+ TASK_DELETED = "DeliverableDelete",
11
+ TASK_APPROVAL = "DeliverableApproval",
12
+ FORM_SUBMITTED = "FormCompleted",
13
+ TIME_ENTRY_CREATED = "TimerCreate",
14
+ TIME_ENTRY_UPDATED = "TimerUpdate",
15
+ TIME_ENTRY_DELETED = "TimerDelete",
16
+ MEETING_SCHEDULED = "MeetingScheduled",
17
+ MEETING_UPDATED = "MeetingUpdated",
18
+ MEETING_CANCELLED = "MeetingCancelled",
19
+ OPPORTUNITY_CREATED = "OpportunityCreate",
20
+ OPPORTUNITY_UPDATED = "OpportunityUpdate",
21
+ OPPORTUNITY_DELETED = "OpportunityDelete",
22
+ INVOICE_SENT = "InvoiceSent",
23
+ PAYMENT_RECEIVED = "PaymentReceived"
24
+ }
25
+ export declare const moxieCRMTriggers: import("../../../../../../dist/packages/pieces/framework/src").ITrigger<import("../../../../../../dist/packages/pieces/framework/src").TriggerStrategy.WEBHOOK, import("../../../../../../dist/packages/pieces/framework/src").CustomAuthProperty<true, {
26
+ apiKey: import("../../../../../../dist/packages/pieces/framework/src").SecretTextProperty<true>;
27
+ baseUrl: import("../../../../../../dist/packages/pieces/framework/src").ShortTextProperty<true>;
28
+ }>, {
29
+ md: import("../../../../../../dist/packages/pieces/framework/src").MarkDownProperty;
30
+ }>[];