@activepieces/piece-mautic 0.5.5 → 0.5.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.
Files changed (49) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +14 -49
  3. package/src/index.d.ts +0 -6
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-company.d.ts +0 -12
  7. package/src/lib/actions/create-company.d.ts.map +0 -1
  8. package/src/lib/actions/create-company.js +0 -39
  9. package/src/lib/actions/create-company.js.map +0 -1
  10. package/src/lib/actions/create-contact.d.ts +0 -28
  11. package/src/lib/actions/create-contact.d.ts.map +0 -1
  12. package/src/lib/actions/create-contact.js +0 -39
  13. package/src/lib/actions/create-contact.js.map +0 -1
  14. package/src/lib/actions/index.d.ts +0 -7
  15. package/src/lib/actions/index.d.ts.map +0 -1
  16. package/src/lib/actions/index.js +0 -16
  17. package/src/lib/actions/index.js.map +0 -1
  18. package/src/lib/actions/search-company.d.ts +0 -12
  19. package/src/lib/actions/search-company.d.ts.map +0 -1
  20. package/src/lib/actions/search-company.js +0 -38
  21. package/src/lib/actions/search-company.js.map +0 -1
  22. package/src/lib/actions/search-contact.d.ts +0 -28
  23. package/src/lib/actions/search-contact.d.ts.map +0 -1
  24. package/src/lib/actions/search-contact.js +0 -40
  25. package/src/lib/actions/search-contact.js.map +0 -1
  26. package/src/lib/actions/update-company.d.ts +0 -13
  27. package/src/lib/actions/update-company.d.ts.map +0 -1
  28. package/src/lib/actions/update-company.js +0 -48
  29. package/src/lib/actions/update-company.js.map +0 -1
  30. package/src/lib/actions/update-contact.d.ts +0 -29
  31. package/src/lib/actions/update-contact.d.ts.map +0 -1
  32. package/src/lib/actions/update-contact.js +0 -39
  33. package/src/lib/actions/update-contact.js.map +0 -1
  34. package/src/lib/auth.d.ts +0 -6
  35. package/src/lib/auth.d.ts.map +0 -1
  36. package/src/lib/auth.js +0 -31
  37. package/src/lib/auth.js.map +0 -1
  38. package/src/lib/common/helper.d.ts +0 -12
  39. package/src/lib/common/helper.d.ts.map +0 -1
  40. package/src/lib/common/helper.js +0 -90
  41. package/src/lib/common/helper.js.map +0 -1
  42. package/src/lib/common/index.d.ts +0 -31
  43. package/src/lib/common/index.d.ts.map +0 -1
  44. package/src/lib/common/index.js +0 -32
  45. package/src/lib/common/index.js.map +0 -1
  46. package/src/lib/triggers/index.d.ts +0 -31
  47. package/src/lib/triggers/index.d.ts.map +0 -1
  48. package/src/lib/triggers/index.js +0 -427
  49. package/src/lib/triggers/index.js.map +0 -1
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCompany = exports.searchCompany = exports.createCompany = exports.updateContact = exports.searchContact = exports.createContact = void 0;
4
- var create_contact_1 = require("./create-contact");
5
- Object.defineProperty(exports, "createContact", { enumerable: true, get: function () { return create_contact_1.createContact; } });
6
- var search_contact_1 = require("./search-contact");
7
- Object.defineProperty(exports, "searchContact", { enumerable: true, get: function () { return search_contact_1.searchContact; } });
8
- var update_contact_1 = require("./update-contact");
9
- Object.defineProperty(exports, "updateContact", { enumerable: true, get: function () { return update_contact_1.updateContact; } });
10
- var create_company_1 = require("./create-company");
11
- Object.defineProperty(exports, "createCompany", { enumerable: true, get: function () { return create_company_1.createCompany; } });
12
- var search_company_1 = require("./search-company");
13
- Object.defineProperty(exports, "searchCompany", { enumerable: true, get: function () { return search_company_1.searchCompany; } });
14
- var update_company_1 = require("./update-company");
15
- Object.defineProperty(exports, "updateCompany", { enumerable: true, get: function () { return update_company_1.updateCompany; } });
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/actions/index.ts"],"names":[],"mappings":";;;AAAA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA"}
@@ -1,12 +0,0 @@
1
- export declare const searchCompany: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- fields: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
- }>>;
11
- }>;
12
- //# sourceMappingURL=search-company.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-company.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/search-company.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;;;;;;;;EA6BxB,CAAC"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.searchCompany = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const auth_1 = require("../auth");
8
- exports.searchCompany = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.mauticAuth,
10
- description: 'Search for a company in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
11
- audience: 'both',
12
- aiMetadata: {
13
- description: 'Look up a company in Mautic by matching the supplied field values (combined into a search query), returning the first matching company. Use to find a company or resolve its id before updating, or to verify whether an organization already exists before creating one. Read-only and idempotent.',
14
- idempotent: true,
15
- },
16
- displayName: 'Search Company',
17
- name: 'search_mautic_company',
18
- props: {
19
- fields: common_1.mauticCommon.companyFields,
20
- },
21
- run: function (context) {
22
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
- const { base_url, username, password } = context.auth.props;
24
- const url = (base_url.endsWith('/') ? base_url : base_url + '/') + 'api/companies';
25
- const fields = context.propsValue.fields;
26
- const keys = Object.keys(fields);
27
- let searchParams = '?';
28
- for (const key of keys) {
29
- if (fields[key]) {
30
- searchParams += `search=${key}:${fields[key]}&`;
31
- }
32
- }
33
- const response = yield (0, common_1.searchEntity)(url, searchParams, username, password);
34
- return Object.values(response.body.companies)[0];
35
- });
36
- },
37
- });
38
- //# sourceMappingURL=search-company.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-company.js","sourceRoot":"","sources":["../../../../src/lib/actions/search-company.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,sCAAuD;AACvD,kCAAqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,oCAAoC,EAAE,gEAAgE;IACnH,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,qSAAqS;QACvS,UAAU,EAAE,IAAI;KACjB;IACD,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL,MAAM,EAAE,qBAAY,CAAC,aAAa;KACnC;IACD,GAAG,EAAE,UAAgB,OAAO;;YAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5D,MAAM,GAAG,GACP,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,eAAe,CAAC;YACzE,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACjC,IAAI,YAAY,GAAG,GAAG,CAAC;YACvB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;oBAChB,YAAY,IAAI,UAAU,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;gBAClD,CAAC;YACH,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAY,EAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC3E,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,28 +0,0 @@
1
- export declare const searchContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- fields: {
7
- displayName: string;
8
- description?: string | undefined;
9
- auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
10
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- }>;
14
- props: (propsValue: Record<string, unknown> & {
15
- auth?: import("@activepieces/shared").CustomAuthConnectionValue<import("@activepieces/pieces-framework").StaticPropsValue<{
16
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
18
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
19
- }>> | undefined;
20
- }, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").InputPropertyMap>;
21
- refreshers: string[];
22
- valueSchema: import("@activepieces/pieces-framework").DynamicPropsValue;
23
- type: import("@activepieces/pieces-framework").PropertyType.DYNAMIC;
24
- required: true;
25
- defaultValue?: unknown;
26
- };
27
- }>;
28
- //# sourceMappingURL=search-contact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/search-contact.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BxB,CAAC"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.searchContact = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const auth_1 = require("../auth");
8
- exports.searchContact = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.mauticAuth,
10
- description: 'Search for a contact in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
11
- audience: 'both',
12
- aiMetadata: {
13
- description: 'Look up a contact in Mautic by matching the supplied field values (each provided field becomes an exact-equality filter), returning the first matching contact. Use to find a contact or resolve its id before updating, or to verify whether someone already exists before creating one. Read-only and idempotent.',
14
- idempotent: true,
15
- },
16
- displayName: 'Search Contact',
17
- name: 'search_mautic_contact',
18
- props: {
19
- fields: common_1.mauticCommon.contactFields,
20
- },
21
- run: function (context) {
22
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
- const { base_url, username, password } = context.auth.props;
24
- const url = (base_url.endsWith('/') ? base_url : base_url + '/') + 'api/contacts';
25
- const fields = context.propsValue.fields;
26
- const keys = Object.keys(fields);
27
- let count = 0;
28
- let searchParams = '?';
29
- for (const key of keys) {
30
- if (fields[key]) {
31
- searchParams += `where[${count}][col]=${key}&where[${count}][expr]=eq&where[${count}][val]=${fields[key]}&`;
32
- ++count;
33
- }
34
- }
35
- const response = yield (0, common_1.searchEntity)(url, searchParams, username, password);
36
- return Object.values(response.body.contacts)[0];
37
- });
38
- },
39
- });
40
- //# sourceMappingURL=search-contact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/search-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,sCAAuD;AACvD,kCAAqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,oCAAoC,EAAE,gEAAgE;IACnH,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,qTAAqT;QACvT,UAAU,EAAE,IAAI;KACjB;IACD,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL,MAAM,EAAE,qBAAY,CAAC,aAAa;KACnC;IACD,GAAG,EAAE,UAAgB,OAAO;;YAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5D,MAAM,GAAG,GACP,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,cAAc,CAAC;YACxE,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACjC,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,YAAY,GAAG,GAAG,CAAC;YACvB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;oBAChB,YAAY,IAAI,SAAS,KAAK,UAAU,GAAG,UAAU,KAAK,oBAAoB,KAAK,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;oBAC5G,EAAE,KAAK,CAAC;gBACV,CAAC;YACH,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAY,EAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC3E,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const updateCompany: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- fields: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
- }>>;
12
- }>;
13
- //# sourceMappingURL=update-company.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-company.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-company.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;;;;;;;;;;;EAwCxB,CAAC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCompany = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const common_1 = require("../common");
8
- const auth_1 = require("../auth");
9
- exports.updateCompany = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.mauticAuth,
11
- description: 'Update a company in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
12
- audience: 'both',
13
- aiMetadata: {
14
- description: 'Update an existing Mautic company, identified by its numeric company id, with the provided field values (empty fields are dropped so they are left unchanged). Use when you already know the company id (resolve it first with Search Company if you only have a name). Idempotent: applying the same field values to the same id repeatedly leaves the company in the same state.',
15
- idempotent: true,
16
- },
17
- displayName: 'Update Company With Contact Id',
18
- name: 'update_mautic_company',
19
- props: {
20
- id: common_1.mauticCommon.id,
21
- fields: common_1.mauticCommon.companyFields,
22
- },
23
- run: function (context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- const { base_url, username, password } = context.auth.props;
26
- // This is intentionally done because for `null` data Mautic doesn't change data for contacts but
27
- // for the same it changes data for companies. This step is taken to ensure both behave the same.
28
- const fields = context.propsValue.fields;
29
- const keys = Object.keys(fields);
30
- for (const key of keys) {
31
- if (!fields[key]) {
32
- delete fields[key];
33
- }
34
- }
35
- const request = {
36
- method: pieces_common_1.HttpMethod.PATCH,
37
- url: `${base_url.endsWith('/') ? base_url : base_url + '/'}api/companies/${context.propsValue.id}/edit`,
38
- body: JSON.stringify(fields),
39
- headers: {
40
- Authorization: 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
41
- 'Content-Type': 'application/json',
42
- },
43
- };
44
- return yield pieces_common_1.httpClient.sendRequest(request);
45
- });
46
- },
47
- });
48
- //# sourceMappingURL=update-company.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-company.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-company.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,sCAAyC;AACzC,kCAAqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,gCAAgC,EAAE,gEAAgE;IAC/G,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,oXAAoX;QACtX,UAAU,E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declare const updateContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- fields: {
8
- displayName: string;
9
- description?: string | undefined;
10
- auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
- }>;
15
- props: (propsValue: Record<string, unknown> & {
16
- auth?: import("@activepieces/shared").CustomAuthConnectionValue<import("@activepieces/pieces-framework").StaticPropsValue<{
17
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
18
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
19
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
20
- }>> | undefined;
21
- }, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").InputPropertyMap>;
22
- refreshers: string[];
23
- valueSchema: import("@activepieces/pieces-framework").DynamicPropsValue;
24
- type: import("@activepieces/pieces-framework").PropertyType.DYNAMIC;
25
- required: true;
26
- defaultValue?: unknown;
27
- };
28
- }>;
29
- //# sourceMappingURL=update-contact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-contact.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BxB,CAAC"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateContact = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const common_1 = require("../common");
8
- const auth_1 = require("../auth");
9
- exports.updateContact = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.mauticAuth,
11
- description: 'Update a contact in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
12
- audience: 'both',
13
- aiMetadata: {
14
- description: "Update an existing Mautic contact, identified by its numeric contact id, with the provided field values. Use when you already know the contact id (resolve it first with Search Contact if you only have an email or name). Idempotent: applying the same field values to the same id repeatedly leaves the contact in the same state.",
15
- idempotent: true,
16
- },
17
- displayName: 'Update Contact With Contact Id',
18
- name: 'update_mautic_contact',
19
- props: {
20
- id: common_1.mauticCommon.id,
21
- fields: common_1.mauticCommon.contactFields,
22
- },
23
- run: function (context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- const { base_url, username, password } = context.auth.props;
26
- const request = {
27
- method: pieces_common_1.HttpMethod.PATCH,
28
- url: `${base_url.endsWith('/') ? base_url : base_url + '/'}api/contacts/${context.propsValue.id}/edit`,
29
- body: JSON.stringify(context.propsValue.fields),
30
- headers: {
31
- Authorization: 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
32
- 'Content-Type': 'application/json',
33
- },
34
- };
35
- return yield pieces_common_1.httpClient.sendRequest(request);
36
- });
37
- },
38
- });
39
- //# sourceMappingURL=update-contact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,sCAAyC;AACzC,kCAAqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,gCAAgC,EAAE,gEAAgE;IAC/G,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,wUAAwU;QAC1U,UAAU,EAAE,IAAI;KACjB;IACD,WAAW,EAAE,gCAAgC;IAC7C,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL,EAAE,EAAE,qBAAY,CAAC,EAAE;QACnB,MAAM,EAAE,qBAAY,CAAC,aAAa;KACnC;IACD,GAAG,EAAE,UAAgB,OAAO;;YAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5D,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,KAAK;gBACxB,GAAG,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,gBACxD,OAAO,CAAC,UAAU,CAAC,EACrB,OAAO;gBACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;gBAC/C,OAAO,EAAE;oBACP,aAAa,EACX,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBACtE,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
package/src/lib/auth.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare const mauticAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>;
6
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU;;;;EAiBrB,CAAC"}
package/src/lib/auth.js DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mauticAuth = void 0;
4
- const pieces_framework_1 = require("@activepieces/pieces-framework");
5
- const markdownDescription = `
6
- Follow these steps:
7
-
8
- 1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is "https://mautic.ddev.site/s/dashboard", set your base URL as "https://mautic.ddev.site/".
9
-
10
- 2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.
11
-
12
- `;
13
- exports.mauticAuth = pieces_framework_1.PieceAuth.CustomAuth({
14
- description: markdownDescription,
15
- props: {
16
- base_url: pieces_framework_1.Property.ShortText({
17
- displayName: 'Base URL',
18
- required: true,
19
- }),
20
- username: pieces_framework_1.Property.ShortText({
21
- displayName: 'Username',
22
- required: true,
23
- }),
24
- password: pieces_framework_1.PieceAuth.SecretText({
25
- displayName: 'Password',
26
- required: true,
27
- }),
28
- },
29
- required: true,
30
- });
31
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AAErE,MAAM,mBAAmB,GAAG;;;;;;;CAO3B,CAAC;AAEW,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC7B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- import { DynamicPropsValue } from '@activepieces/pieces-framework';
2
- export declare const mapMauticToActivepiecesProperty: (type: string, fieldMetadata: {
3
- displayName: string;
4
- required: boolean;
5
- }, properties: object) => import("@activepieces/pieces-framework").ShortTextProperty<true> | import("@activepieces/pieces-framework").ShortTextProperty<false> | import("@activepieces/pieces-framework").DateTimeProperty<false> | import("@activepieces/pieces-framework").DateTimeProperty<true> | import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true> | import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<unknown, false> | import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<unknown, true> | import("@activepieces/pieces-framework").StaticDropdownProperty<unknown, false> | import("@activepieces/pieces-framework").StaticDropdownProperty<unknown, true> | null;
6
- export declare const fetchDynamicFieldsFromMetadata: (baseUrl: string, username: string, password: string, type: "contact" | "company" | "lead") => Promise<DynamicPropsValue>;
7
- export declare const getFields: (type: "contact" | "company" | "lead") => import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
- }>>;
12
- //# sourceMappingURL=helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAY,MAAM,gCAAgC,CAAC;AAS7E,eAAO,MAAM,+BAA+B,SACpC,MAAM,iBACG;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,cACW,MAAM,kvBA8CnB,CAAC;AAEF,eAAO,MAAM,8BAA8B,YAChC,MAAM,YACL,MAAM,YACN,MAAM,QACV,SAAS,GAAG,SAAS,GAAG,MAAM,+BA4CrC,CAAC;AAEF,eAAO,MAAM,SAAS,SAAU,SAAS,GAAG,SAAS,GAAG,MAAM;;;;GAY1D,CAAC"}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFields = exports.fetchDynamicFieldsFromMetadata = exports.mapMauticToActivepiecesProperty = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- // Function Section
9
- const mapMauticToActivepiecesProperty = (type, fieldMetadata, properties) => {
10
- switch (type) {
11
- case 'lookup':
12
- case 'text':
13
- case 'email':
14
- case 'tel':
15
- case 'region':
16
- case 'country':
17
- case 'locale':
18
- case 'timezone':
19
- case 'url':
20
- return pieces_framework_1.Property.ShortText(fieldMetadata);
21
- case 'date':
22
- case 'datetime':
23
- return pieces_framework_1.Property.DateTime(fieldMetadata);
24
- case 'number':
25
- return pieces_framework_1.Property.Number(fieldMetadata);
26
- case 'boolean':
27
- return pieces_framework_1.Property.StaticDropdown(Object.assign(Object.assign({}, fieldMetadata), { options: {
28
- options: [
29
- { value: 'no', label: 'No' },
30
- { value: 'yes', label: 'Yes' },
31
- ],
32
- } }));
33
- case 'multiselect':
34
- return pieces_framework_1.Property.StaticMultiSelectDropdown(Object.assign(Object.assign({}, fieldMetadata), { options: {
35
- options: Object.values(properties)[0],
36
- } }));
37
- case 'select':
38
- return pieces_framework_1.Property.StaticDropdown(Object.assign(Object.assign({}, fieldMetadata), { options: {
39
- options: Object.values(properties)[0],
40
- } }));
41
- default:
42
- console.error(`No support of type ${type}`);
43
- return null;
44
- }
45
- };
46
- exports.mapMauticToActivepiecesProperty = mapMauticToActivepiecesProperty;
47
- const fetchDynamicFieldsFromMetadata = (baseUrl, username, password, type) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
48
- const request = {
49
- method: pieces_common_1.HttpMethod.GET,
50
- url: `${baseUrl.endsWith('/') ? baseUrl : baseUrl + '/'}api/fields/${type}?limit=1000`,
51
- headers: {
52
- Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`,
53
- 'Content-Type': 'application/json',
54
- },
55
- };
56
- const result = yield pieces_common_1.httpClient.sendRequest(request);
57
- if (result.status == 200) {
58
- return Object.values(result.body.fields).reduce((fields, field) => {
59
- const { label: displayName, alias, type, properties, } = field;
60
- const fieldMetadata = {
61
- displayName,
62
- required: false,
63
- };
64
- if (!type)
65
- return {};
66
- const f = (0, exports.mapMauticToActivepiecesProperty)(type, fieldMetadata, properties);
67
- if (f) {
68
- fields[alias] = f;
69
- }
70
- return fields;
71
- }, {});
72
- }
73
- throw Error(`Unable to fetch ${type} metadata`);
74
- });
75
- exports.fetchDynamicFieldsFromMetadata = fetchDynamicFieldsFromMetadata;
76
- const getFields = (type) => pieces_framework_1.Property.DynamicProperties({
77
- auth: auth_1.mauticAuth,
78
- displayName: 'All Fields',
79
- description: 'List of all possible fields present',
80
- required: true,
81
- refreshers: [],
82
- props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
83
- if (!auth)
84
- return {};
85
- const { base_url, username, password } = auth.props;
86
- return (0, exports.fetchDynamicFieldsFromMetadata)(base_url, username, password, type);
87
- }),
88
- });
89
- exports.getFields = getFields;
90
- //# sourceMappingURL=helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../src/lib/common/helper.ts"],"names":[],"mappings":";;;;AAAA,qEAA6E;AAC7E,+DAIqC;AACrC,kCAAqC;AAErC,mBAAmB;AACZ,MAAM,+BAA+B,GAAG,CAC7C,IAAY,EACZ,aAGC,EACD,UAAkB,EAClB,EAAE;IACF,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM,CAA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AC,IAAoC,EAAE,EAAE,CAChE,2BAAQ,CAAC,iBAAiB,CAAC;IACzB,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACpB,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACpD,OAAO,IAAA,sCAA8B,EAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC5E,CAAC,CAAA;CACF,CAAC,CAAC;AAZQ,QAAA,SAAS,aAYjB"}
@@ -1,31 +0,0 @@
1
- export declare const mauticCommon: {
2
- contactFields: {
3
- displayName: string;
4
- description?: string | undefined;
5
- auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
9
- }>;
10
- props: (propsValue: Record<string, unknown> & {
11
- auth?: import("@activepieces/shared").CustomAuthConnectionValue<import("@activepieces/pieces-framework").StaticPropsValue<{
12
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
- }>> | undefined;
16
- }, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").InputPropertyMap>;
17
- refreshers: string[];
18
- valueSchema: import("@activepieces/pieces-framework").DynamicPropsValue;
19
- type: import("@activepieces/pieces-framework").PropertyType.DYNAMIC;
20
- required: true;
21
- defaultValue?: unknown;
22
- };
23
- companyFields: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
24
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
25
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
26
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
27
- }>>;
28
- id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
29
- };
30
- export declare const searchEntity: (url: string, searchParams: string, username: string, password: string) => Promise<Record<string, any>>;
31
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOxB,CAAC;AAEF,eAAO,MAAM,YAAY,QAClB,MAAM,gBACG,MAAM,YACV,MAAM,YACN,MAAM,iCAmBjB,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.searchEntity = exports.mauticCommon = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const helper_1 = require("./helper");
7
- const pieces_common_1 = require("@activepieces/pieces-common");
8
- exports.mauticCommon = {
9
- contactFields: Object.assign(Object.assign({}, (0, helper_1.getFields)('contact')), (0, helper_1.getFields)('lead')),
10
- companyFields: (0, helper_1.getFields)('company'),
11
- id: pieces_framework_1.Property.ShortText({
12
- displayName: 'Id of the entity',
13
- required: true,
14
- }),
15
- };
16
- const searchEntity = (url, searchParams, username, password) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
17
- const request = {
18
- method: pieces_common_1.HttpMethod.GET,
19
- url: `${url}${searchParams}`,
20
- headers: {
21
- Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`,
22
- 'Content-Type': 'application/json',
23
- },
24
- };
25
- const response = yield pieces_common_1.httpClient.sendRequest(request);
26
- const length = response.body.total;
27
- if (!length || length != 1)
28
- throw Error('The query is not perfect enough to get single result. Please refine');
29
- return response;
30
- });
31
- exports.searchEntity = searchEntity;
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,qCAAqC;AACrC,+DAIqC;AAExB,QAAA,YAAY,GAAG;IAC1B,aAAa,kCAAO,IAAA,kBAAS,EAAC,SAAS,CAAC,GAAK,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAE;IAChE,aAAa,EAAE,IAAA,kBAAS,EAAC,SAAS,CAAC;IACnC,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;QACrB,WAAW,EAAE,kBAAkB;QAC/B,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;AAEK,MAAM,YAAY,GAAG,CAC1B,GAAW,EACX,YAAoB,EACpB,QAAgB,EAChB,QAAgB,EAChB,EAAE;IACF,MAAM,OAAO,GAAgB;QAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;QACtB,GAAG,EAAE,GAAG,GAAG,GAAG,YAAY,EAAE;QAC5B,OAAO,EAAE;YACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CACrE,QAAQ,CACT,EAAE;YACH,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC;IACF,MAAM,QAAQ,GAAwB,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IACnC,IAAI,CAAC,MAAM,IAAI,MAAM,IAAI,CAAC;QACxB,MAAM,KAAK,CACT,qEAAqE,CACtE,CAAC;IACJ,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAvBW,QAAA,YAAY,gBAuBvB"}
@@ -1,31 +0,0 @@
1
- import { TriggerStrategy } from "@activepieces/pieces-framework";
2
- export declare const triggers: (import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- description: import("@activepieces/pieces-framework").LongTextProperty<true>;
9
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
10
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- }>, {
14
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
15
- description: import("@activepieces/pieces-framework").LongTextProperty<true>;
16
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
17
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
18
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
19
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
20
- }>, {
21
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
22
- description: import("@activepieces/pieces-framework").LongTextProperty<true>;
23
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
24
- base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
25
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
26
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
27
- }>, {
28
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
29
- description: import("@activepieces/pieces-framework").LongTextProperty<true>;
30
- }>)[];
31
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA8S1F,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsDoB,CAAC"}