@activepieces/piece-trust 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.
Files changed (61) hide show
  1. package/package.json +18 -0
  2. package/src/index.d.ts +5 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +53 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/create-contact.d.ts +11 -0
  7. package/src/lib/actions/create-contact.d.ts.map +1 -0
  8. package/src/lib/actions/create-contact.js +64 -0
  9. package/src/lib/actions/create-contact.js.map +1 -0
  10. package/src/lib/actions/create-testimonial.d.ts +20 -0
  11. package/src/lib/actions/create-testimonial.d.ts.map +1 -0
  12. package/src/lib/actions/create-testimonial.js +127 -0
  13. package/src/lib/actions/create-testimonial.js.map +1 -0
  14. package/src/lib/actions/delete-contact.d.ts +7 -0
  15. package/src/lib/actions/delete-contact.d.ts.map +1 -0
  16. package/src/lib/actions/delete-contact.js +33 -0
  17. package/src/lib/actions/delete-contact.js.map +1 -0
  18. package/src/lib/actions/delete-testimonial.d.ts +7 -0
  19. package/src/lib/actions/delete-testimonial.d.ts.map +1 -0
  20. package/src/lib/actions/delete-testimonial.js +33 -0
  21. package/src/lib/actions/delete-testimonial.js.map +1 -0
  22. package/src/lib/actions/find-contact.d.ts +8 -0
  23. package/src/lib/actions/find-contact.d.ts.map +1 -0
  24. package/src/lib/actions/find-contact.js +51 -0
  25. package/src/lib/actions/find-contact.js.map +1 -0
  26. package/src/lib/actions/find-testimonial.d.ts +7 -0
  27. package/src/lib/actions/find-testimonial.d.ts.map +1 -0
  28. package/src/lib/actions/find-testimonial.js +33 -0
  29. package/src/lib/actions/find-testimonial.js.map +1 -0
  30. package/src/lib/actions/update-contact.d.ts +12 -0
  31. package/src/lib/actions/update-contact.d.ts.map +1 -0
  32. package/src/lib/actions/update-contact.js +68 -0
  33. package/src/lib/actions/update-contact.js.map +1 -0
  34. package/src/lib/actions/update-testimonial.d.ts +21 -0
  35. package/src/lib/actions/update-testimonial.d.ts.map +1 -0
  36. package/src/lib/actions/update-testimonial.js +123 -0
  37. package/src/lib/actions/update-testimonial.js.map +1 -0
  38. package/src/lib/actions/upload-image.d.ts +7 -0
  39. package/src/lib/actions/upload-image.d.ts.map +1 -0
  40. package/src/lib/actions/upload-image.js +44 -0
  41. package/src/lib/actions/upload-image.js.map +1 -0
  42. package/src/lib/actions/upload-small-video.d.ts +7 -0
  43. package/src/lib/actions/upload-small-video.d.ts.map +1 -0
  44. package/src/lib/actions/upload-small-video.js +44 -0
  45. package/src/lib/actions/upload-small-video.js.map +1 -0
  46. package/src/lib/actions/upload-video.d.ts +7 -0
  47. package/src/lib/actions/upload-video.d.ts.map +1 -0
  48. package/src/lib/actions/upload-video.js +44 -0
  49. package/src/lib/actions/upload-video.js.map +1 -0
  50. package/src/lib/auth.d.ts +5 -0
  51. package/src/lib/auth.d.ts.map +1 -0
  52. package/src/lib/auth.js +41 -0
  53. package/src/lib/auth.js.map +1 -0
  54. package/src/lib/common/client.d.ts +10 -0
  55. package/src/lib/common/client.d.ts.map +1 -0
  56. package/src/lib/common/client.js +23 -0
  57. package/src/lib/common/client.js.map +1 -0
  58. package/src/lib/triggers/new-testimonial.d.ts +15 -0
  59. package/src/lib/triggers/new-testimonial.d.ts.map +1 -0
  60. package/src/lib/triggers/new-testimonial.js +67 -0
  61. package/src/lib/triggers/new-testimonial.js.map +1 -0
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateContactAction = 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
+ const client_1 = require("../common/client");
9
+ exports.updateContactAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.trustAuth,
11
+ name: 'update_contact',
12
+ displayName: 'Update Contact',
13
+ description: 'Updates an existing contact in the system.',
14
+ props: {
15
+ contactId: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Contact ID',
17
+ description: 'The ID of the contact to update.',
18
+ required: true,
19
+ }),
20
+ firstname: pieces_framework_1.Property.ShortText({
21
+ displayName: 'First Name',
22
+ required: false,
23
+ }),
24
+ lastname: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Last Name',
26
+ required: false,
27
+ }),
28
+ email: pieces_framework_1.Property.ShortText({
29
+ displayName: 'Email',
30
+ description: 'Required by the Trust API to identify the contact.',
31
+ required: true,
32
+ }),
33
+ phone: pieces_framework_1.Property.ShortText({
34
+ displayName: 'Phone Number',
35
+ required: false,
36
+ }),
37
+ imageUrl: pieces_framework_1.Property.ShortText({
38
+ displayName: 'Profile Image URL',
39
+ required: false,
40
+ }),
41
+ },
42
+ run(context) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ const { props } = context.auth;
45
+ const p = context.propsValue;
46
+ const body = {
47
+ workspaceId: props.workspace_id,
48
+ };
49
+ if (p.firstname)
50
+ body['firstname'] = p.firstname;
51
+ if (p.lastname)
52
+ body['lastname'] = p.lastname;
53
+ body['email'] = p.email;
54
+ if (p.phone)
55
+ body['phone'] = p.phone;
56
+ if (p.imageUrl)
57
+ body['imageUrl'] = p.imageUrl;
58
+ const response = yield (0, client_1.trustApiRequest)({
59
+ apiKey: props.api_key,
60
+ method: pieces_common_1.HttpMethod.PUT,
61
+ path: `/contacts/${p.contactId}`,
62
+ body,
63
+ });
64
+ return response.body;
65
+ });
66
+ },
67
+ });
68
+ //# sourceMappingURL=update-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAoC;AACpC,6CAAmD;AAEtC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,gBAAgB;IAC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CAAC,CAAC,KAAK;gBAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;YACrC,IAAI,CAAC,CAAC,QAAQ;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;YAE9C,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAC;gBACrC,MAAM,EAAE,KAAK,CAAC,OAAO;gBACrB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,aAAa,CAAC,CAAC,SAAS,EAAE;gBAChC,IAAI;aACL,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const updateTestimonialAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ testimonialId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ firstname: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ lastname: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ subtitle: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ testimonialText: import("@activepieces/pieces-framework").LongTextProperty<false>;
13
+ stars: import("@activepieces/pieces-framework").NumberProperty<false>;
14
+ imageUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
+ videoUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
+ externalVideoHtml: import("@activepieces/pieces-framework").LongTextProperty<false>;
17
+ published: import("@activepieces/pieces-framework").CheckboxProperty<false>;
18
+ gaveConsent: import("@activepieces/pieces-framework").CheckboxProperty<false>;
19
+ consentDateTime: import("@activepieces/pieces-framework").DateTimeProperty<false>;
20
+ }>;
21
+ //# sourceMappingURL=update-testimonial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-testimonial.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-testimonial.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;EAqGlC,CAAC"}
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateTestimonialAction = 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
+ const client_1 = require("../common/client");
9
+ exports.updateTestimonialAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.trustAuth,
11
+ name: 'update_testimonial',
12
+ displayName: 'Update Testimonial',
13
+ description: 'Updates an existing testimonial in the system.',
14
+ props: {
15
+ testimonialId: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Testimonial ID',
17
+ description: 'The ID of the testimonial to update.',
18
+ required: true,
19
+ }),
20
+ firstname: pieces_framework_1.Property.ShortText({
21
+ displayName: 'First Name',
22
+ required: false,
23
+ }),
24
+ lastname: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Last Name',
26
+ required: false,
27
+ }),
28
+ email: pieces_framework_1.Property.ShortText({
29
+ displayName: 'Email',
30
+ description: 'Required by the Trust API to identify the testimonial.',
31
+ required: true,
32
+ }),
33
+ title: pieces_framework_1.Property.ShortText({
34
+ displayName: 'Job Title',
35
+ required: false,
36
+ }),
37
+ subtitle: pieces_framework_1.Property.ShortText({
38
+ displayName: 'Subtitle',
39
+ required: false,
40
+ }),
41
+ company: pieces_framework_1.Property.ShortText({
42
+ displayName: 'Company',
43
+ required: false,
44
+ }),
45
+ testimonialText: pieces_framework_1.Property.LongText({
46
+ displayName: 'Testimonial Text',
47
+ required: false,
48
+ }),
49
+ stars: pieces_framework_1.Property.Number({
50
+ displayName: 'Star Rating',
51
+ description: 'Rating from 1 to 5.',
52
+ required: false,
53
+ }),
54
+ imageUrl: pieces_framework_1.Property.ShortText({
55
+ displayName: 'Profile Image URL',
56
+ required: false,
57
+ }),
58
+ videoUrl: pieces_framework_1.Property.ShortText({
59
+ displayName: 'Video URL',
60
+ required: false,
61
+ }),
62
+ externalVideoHtml: pieces_framework_1.Property.LongText({
63
+ displayName: 'External Video HTML',
64
+ required: false,
65
+ }),
66
+ published: pieces_framework_1.Property.Checkbox({
67
+ displayName: 'Published',
68
+ required: false,
69
+ }),
70
+ gaveConsent: pieces_framework_1.Property.Checkbox({
71
+ displayName: 'Gave Consent',
72
+ required: false,
73
+ }),
74
+ consentDateTime: pieces_framework_1.Property.DateTime({
75
+ displayName: 'Consent Date & Time',
76
+ required: false,
77
+ }),
78
+ },
79
+ run(context) {
80
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
81
+ const { props } = context.auth;
82
+ const p = context.propsValue;
83
+ const body = {
84
+ workspaceId: props.workspace_id,
85
+ };
86
+ body['email'] = p.email;
87
+ if (p.firstname)
88
+ body['firstname'] = p.firstname;
89
+ if (p.lastname)
90
+ body['lastname'] = p.lastname;
91
+ if (p.title)
92
+ body['title'] = p.title;
93
+ if (p.subtitle)
94
+ body['subtitle'] = p.subtitle;
95
+ if (p.company)
96
+ body['company'] = p.company;
97
+ if (p.testimonialText)
98
+ body['testimonialText'] = p.testimonialText;
99
+ if (p.stars !== undefined && p.stars !== null)
100
+ body['stars'] = p.stars;
101
+ if (p.imageUrl)
102
+ body['imageUrl'] = p.imageUrl;
103
+ if (p.videoUrl)
104
+ body['videoUrl'] = p.videoUrl;
105
+ if (p.externalVideoHtml)
106
+ body['externalVideoHtml'] = p.externalVideoHtml;
107
+ if (p.published !== undefined)
108
+ body['published'] = p.published;
109
+ if (p.gaveConsent !== undefined)
110
+ body['gaveConsent'] = p.gaveConsent;
111
+ if (p.consentDateTime)
112
+ body['consentDateTime'] = p.consentDateTime;
113
+ const response = yield (0, client_1.trustApiRequest)({
114
+ apiKey: props.api_key,
115
+ method: pieces_common_1.HttpMethod.PUT,
116
+ path: `/testimonial/${p.testimonialId}`,
117
+ body,
118
+ });
119
+ return response.body;
120
+ });
121
+ },
122
+ });
123
+ //# sourceMappingURL=update-testimonial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-testimonial.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-testimonial.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAoC;AACpC,6CAAmD;AAEtC,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,wDAAwD;YACrE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YA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S;gBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC;YACrE,IAAI,CAAC,CAAC,eAAe;gBAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,eAAe,CAAC;YAEnE,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAC;gBACrC,MAAM,EAAE,KAAK,CAAC,OAAO;gBACrB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,gBAAgB,CAAC,CAAC,aAAa,EAAE;gBACvC,IAAI;aACL,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const uploadImageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ file: import("@activepieces/pieces-framework").FileProperty<true>;
6
+ }>;
7
+ //# sourceMappingURL=upload-image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-image.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/upload-image.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;EAkC5B,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadImageAction = 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 form_data_1 = tslib_1.__importDefault(require("form-data"));
8
+ const auth_1 = require("../auth");
9
+ exports.uploadImageAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.trustAuth,
11
+ name: 'upload_image',
12
+ displayName: 'Upload Image',
13
+ description: 'Uploads an image to the Trust media library.',
14
+ props: {
15
+ file: pieces_framework_1.Property.File({
16
+ displayName: 'Image File',
17
+ description: 'The image file to upload (JPEG, PNG, GIF, etc.).',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { props } = context.auth;
24
+ const file = context.propsValue.file;
25
+ const formData = new form_data_1.default();
26
+ formData.append('file', Buffer.from(file.base64, 'base64'), file.filename);
27
+ const response = yield pieces_common_1.httpClient.sendRequest({
28
+ method: pieces_common_1.HttpMethod.POST,
29
+ url: `https://api.usetrust.app/v1/media/upload-image/${props.workspace_id}`,
30
+ authentication: {
31
+ type: pieces_common_1.AuthenticationType.BASIC,
32
+ username: 'apikey',
33
+ password: props.api_key,
34
+ },
35
+ body: formData,
36
+ headers: {
37
+ 'Content-Type': 'multipart/form-data',
38
+ },
39
+ });
40
+ return response.body;
41
+ });
42
+ },
43
+ });
44
+ //# sourceMappingURL=upload-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-image.js","sourceRoot":"","sources":["../../../../src/lib/actions/upload-image.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,kEAAiC;AACjC,kCAAoC;AAEvB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,8CAA8C;IAC3D,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAErC,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAE3E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,kDAAkD,KAAK,CAAC,YAAY,EAAE;gBAC3E,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,KAAK;oBAC9B,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,KAAK,CAAC,OAAO;iBACxB;gBACD,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,qBAAqB;iBACtC;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const uploadSmallVideoAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ file: import("@activepieces/pieces-framework").FileProperty<true>;
6
+ }>;
7
+ //# sourceMappingURL=upload-small-video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-small-video.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/upload-small-video.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB;;;;;EAkCjC,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadSmallVideoAction = 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 form_data_1 = tslib_1.__importDefault(require("form-data"));
8
+ const auth_1 = require("../auth");
9
+ exports.uploadSmallVideoAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.trustAuth,
11
+ name: 'upload_small_video',
12
+ displayName: 'Upload Small Video',
13
+ description: 'Uploads a short video to the Trust media library.',
14
+ props: {
15
+ file: pieces_framework_1.Property.File({
16
+ displayName: 'Video File',
17
+ description: 'The short video file to upload. Best suited for brief clips under 30 seconds.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { props } = context.auth;
24
+ const file = context.propsValue.file;
25
+ const formData = new form_data_1.default();
26
+ formData.append('file', Buffer.from(file.base64, 'base64'), file.filename);
27
+ const response = yield pieces_common_1.httpClient.sendRequest({
28
+ method: pieces_common_1.HttpMethod.POST,
29
+ url: `https://api.usetrust.app/v1/media/upload-small-video/${props.workspace_id}`,
30
+ authentication: {
31
+ type: pieces_common_1.AuthenticationType.BASIC,
32
+ username: 'apikey',
33
+ password: props.api_key,
34
+ },
35
+ body: formData,
36
+ headers: {
37
+ 'Content-Type': 'multipart/form-data',
38
+ },
39
+ });
40
+ return response.body;
41
+ });
42
+ },
43
+ });
44
+ //# sourceMappingURL=upload-small-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-small-video.js","sourceRoot":"","sources":["../../../../src/lib/actions/upload-small-video.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,kEAAiC;AACjC,kCAAoC;AAEvB,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,mDAAmD;IAChE,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,+EAA+E;YAC5F,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAErC,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAE3E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,wDAAwD,KAAK,CAAC,YAAY,EAAE;gBACjF,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,KAAK;oBAC9B,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,KAAK,CAAC,OAAO;iBACxB;gBACD,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,qBAAqB;iBACtC;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const uploadVideoAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ file: import("@activepieces/pieces-framework").FileProperty<true>;
6
+ }>;
7
+ //# sourceMappingURL=upload-video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-video.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/upload-video.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;EAkC5B,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadVideoAction = 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 form_data_1 = tslib_1.__importDefault(require("form-data"));
8
+ const auth_1 = require("../auth");
9
+ exports.uploadVideoAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.trustAuth,
11
+ name: 'upload_video',
12
+ displayName: 'Upload Video',
13
+ description: 'Uploads a video to the Trust media library for use in testimonials.',
14
+ props: {
15
+ file: pieces_framework_1.Property.File({
16
+ displayName: 'Video File',
17
+ description: 'The video file to upload (MP4, MOV, AVI, etc.).',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { props } = context.auth;
24
+ const file = context.propsValue.file;
25
+ const formData = new form_data_1.default();
26
+ formData.append('file', Buffer.from(file.base64, 'base64'), file.filename);
27
+ const response = yield pieces_common_1.httpClient.sendRequest({
28
+ method: pieces_common_1.HttpMethod.POST,
29
+ url: `https://api.usetrust.app/v1/media/upload-video/${props.workspace_id}`,
30
+ authentication: {
31
+ type: pieces_common_1.AuthenticationType.BASIC,
32
+ username: 'apikey',
33
+ password: props.api_key,
34
+ },
35
+ body: formData,
36
+ headers: {
37
+ 'Content-Type': 'multipart/form-data',
38
+ },
39
+ });
40
+ return response.body;
41
+ });
42
+ },
43
+ });
44
+ //# sourceMappingURL=upload-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-video.js","sourceRoot":"","sources":["../../../../src/lib/actions/upload-video.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,kEAAiC;AACjC,kCAAoC;AAEvB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,qEAAqE;IAClF,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YAErC,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAE3E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,kDAAkD,KAAK,CAAC,YAAY,EAAE;gBAC3E,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,KAAK;oBAC9B,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,KAAK,CAAC,OAAO;iBACxB;gBACD,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,qBAAqB;iBACtC;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const trustAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>;
5
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;EAkCpB,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trustAuth = 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
+ exports.trustAuth = pieces_framework_1.PieceAuth.CustomAuth({
8
+ displayName: 'Connection',
9
+ description: 'Connect your Trust account using your Workspace ID and API key.',
10
+ required: true,
11
+ props: {
12
+ workspace_id: pieces_framework_1.Property.ShortText({
13
+ displayName: 'Workspace ID',
14
+ description: 'Your Trust workspace ID. Find it in your Trust dashboard URL: https://app.usetrust.io/workspace/{workspaceId}/...',
15
+ required: true,
16
+ }),
17
+ api_key: pieces_framework_1.PieceAuth.SecretText({
18
+ displayName: 'API Key',
19
+ description: 'Go to your Trust dashboard > Settings > API to generate an API key.',
20
+ required: true,
21
+ }),
22
+ },
23
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
24
+ try {
25
+ yield pieces_common_1.httpClient.sendRequest({
26
+ method: pieces_common_1.HttpMethod.GET,
27
+ url: 'https://api.usetrust.app/v1/workspaces',
28
+ authentication: {
29
+ type: pieces_common_1.AuthenticationType.BASIC,
30
+ username: 'apikey',
31
+ password: auth.api_key,
32
+ },
33
+ });
34
+ return { valid: true };
35
+ }
36
+ catch (_b) {
37
+ return { valid: false, error: 'Invalid API key. Please check your credentials and try again.' };
38
+ }
39
+ }),
40
+ });
41
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE,+DAAyF;AAE5E,QAAA,SAAS,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC5C,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,iEAAiE;IAC9E,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,mHAAmH;YACrH,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC5B,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,qEAAqE;YACvE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,wCAAwC;gBAC7C,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,KAAK;oBAC9B,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,IAAI,CAAC,OAAO;iBACvB;aACF,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,+DAA+D,EAAE,CAAC;QAClG,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { HttpMethod, HttpMessageBody, HttpResponse } from '@activepieces/pieces-common';
2
+ export declare function trustApiRequest<T extends HttpMessageBody>({ apiKey, method, path, body, queryParams, headers, }: {
3
+ apiKey: string;
4
+ method: HttpMethod;
5
+ path: string;
6
+ body?: unknown;
7
+ queryParams?: Record<string, string>;
8
+ headers?: Record<string, string>;
9
+ }): Promise<HttpResponse<T>>;
10
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,eAAe,EACf,YAAY,EACb,MAAM,6BAA6B,CAAC;AAIrC,wBAAsB,eAAe,CAAC,CAAC,SAAS,eAAe,EAAE,EAC/D,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAa3B"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trustApiRequest = trustApiRequest;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ const BASE_URL = 'https://api.usetrust.app/v1';
7
+ function trustApiRequest(_a) {
8
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ apiKey, method, path, body, queryParams, headers, }) {
9
+ return pieces_common_1.httpClient.sendRequest({
10
+ method,
11
+ url: `${BASE_URL}${path}`,
12
+ authentication: {
13
+ type: pieces_common_1.AuthenticationType.BASIC,
14
+ username: 'apikey',
15
+ password: apiKey,
16
+ },
17
+ body,
18
+ queryParams,
19
+ headers,
20
+ });
21
+ });
22
+ }
23
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":";;AAUA,0CA2BC;;AArCD,+DAMqC;AAErC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAE/C,SAAsB,eAAe;iEAA4B,EAC/D,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,OAAO,GAQR;QACC,OAAO,0BAAU,CAAC,WAAW,CAAI;YAC/B,MAAM;YACN,GAAG,EAAE,GAAG,QAAQ,GAAG,IAAI,EAAE;YACzB,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,KAAK;gBAC9B,QAAQ,EAAE,QAAQ;gBAClB,QAAQ,EAAE,MAAM;aACjB;YACD,IAAI;YACJ,WAAW;YACX,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CAAA"}
@@ -0,0 +1,15 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newTestimonialTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
12
+ workspace_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
+ }>, {}>;
15
+ //# sourceMappingURL=new-testimonial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-testimonial.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-testimonial.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAqCxC,eAAO,MAAM,qBAAqB;;;;;;;;;;;;OAkChC,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newTestimonialTrigger = 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
+ const client_1 = require("../common/client");
9
+ const polling = {
10
+ strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
11
+ items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
12
+ const { props } = auth;
13
+ const response = yield (0, client_1.trustApiRequest)({
14
+ apiKey: props.api_key,
15
+ method: pieces_common_1.HttpMethod.GET,
16
+ path: `/testimonial/all/${props.workspace_id}`,
17
+ });
18
+ const items = Array.isArray(response.body) ? response.body : [];
19
+ return items.map((item) => ({
20
+ epochMilliSeconds: new Date(item.created).getTime(),
21
+ data: item,
22
+ }));
23
+ }),
24
+ };
25
+ exports.newTestimonialTrigger = (0, pieces_framework_1.createTrigger)({
26
+ auth: auth_1.trustAuth,
27
+ name: 'new_testimonial',
28
+ displayName: 'New Testimonial Created',
29
+ description: 'Triggers when a new testimonial is created in your Trust workspace.',
30
+ props: {},
31
+ sampleData: {
32
+ id: 'testimonial_01abc123',
33
+ workspaceId: 'workspace_01xyz789',
34
+ created: '2024-01-15T10:30:00Z',
35
+ firstname: 'Jane',
36
+ lastname: 'Doe',
37
+ email: 'jane@example.com',
38
+ title: 'CEO',
39
+ company: 'Acme Corp',
40
+ testimonialText: 'This product has transformed the way we work.',
41
+ stars: 5,
42
+ published: true,
43
+ gaveConsent: true,
44
+ },
45
+ type: pieces_framework_1.TriggerStrategy.POLLING,
46
+ test(context) {
47
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
+ return yield pieces_common_1.pollingHelper.test(polling, context);
49
+ });
50
+ },
51
+ onEnable(context) {
52
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
53
+ yield pieces_common_1.pollingHelper.onEnable(polling, context);
54
+ });
55
+ },
56
+ onDisable(context) {
57
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
+ yield pieces_common_1.pollingHelper.onDisable(polling, context);
59
+ });
60
+ },
61
+ run(context) {
62
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
+ return yield pieces_common_1.pollingHelper.poll(polling, context);
64
+ });
65
+ },
66
+ });
67
+ //# sourceMappingURL=new-testimonial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-testimonial.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-testimonial.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,kCAAoC;AACpC,6CAAmD;AAQnD,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACpB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAoB;YACxD,MAAM,EAAE,KAAK,CAAC,OAAO;YACrB,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,oBAAoB,KAAK,CAAC,YAAY,EAAE;SAC/C,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,iBAAiB,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