@activepieces/piece-qwilr 0.1.5 → 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 +16 -47
- 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-page.d.ts +0 -11
- package/src/lib/actions/create-page.d.ts.map +0 -1
- package/src/lib/actions/create-page.js +0 -92
- package/src/lib/actions/create-page.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 -13
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/triggers/page-accepted.d.ts +0 -3
- package/src/lib/triggers/page-accepted.d.ts.map +0 -1
- package/src/lib/triggers/page-accepted.js +0 -74
- package/src/lib/triggers/page-accepted.js.map +0 -1
- package/src/lib/triggers/page-first-viewed.d.ts +0 -3
- package/src/lib/triggers/page-first-viewed.d.ts.map +0 -1
- package/src/lib/triggers/page-first-viewed.js +0 -74
- package/src/lib/triggers/page-first-viewed.js.map +0 -1
- package/src/lib/triggers/page-partially-accepted.d.ts +0 -3
- package/src/lib/triggers/page-partially-accepted.d.ts.map +0 -1
- package/src/lib/triggers/page-partially-accepted.js +0 -74
- package/src/lib/triggers/page-partially-accepted.js.map +0 -1
- package/src/lib/triggers/page-preview-accepted.d.ts +0 -3
- package/src/lib/triggers/page-preview-accepted.d.ts.map +0 -1
- package/src/lib/triggers/page-preview-accepted.js +0 -74
- package/src/lib/triggers/page-preview-accepted.js.map +0 -1
- package/src/lib/triggers/page-revived-live.d.ts +0 -3
- package/src/lib/triggers/page-revived-live.d.ts.map +0 -1
- package/src/lib/triggers/page-revived-live.js +0 -74
- package/src/lib/triggers/page-revived-live.js.map +0 -1
- package/src/lib/triggers/page-set-live.d.ts +0 -3
- package/src/lib/triggers/page-set-live.d.ts.map +0 -1
- package/src/lib/triggers/page-set-live.js +0 -74
- package/src/lib/triggers/page-set-live.js.map +0 -1
- package/src/lib/triggers/page-viewed.d.ts +0 -3
- package/src/lib/triggers/page-viewed.d.ts.map +0 -1
- package/src/lib/triggers/page-viewed.js +0 -74
- package/src/lib/triggers/page-viewed.js.map +0 -1
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pageAcceptedTrigger = 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("../../lib/common/auth");
|
|
8
|
-
const subscribeWebhook = (auth, event, targetUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
11
|
-
url: 'https://api.qwilr.com/v1/webhooks',
|
|
12
|
-
headers: {
|
|
13
|
-
'Authorization': `Bearer ${auth}`,
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
event,
|
|
18
|
-
targetUrl
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
const unsubscribeWebhook = (auth, subscriptionId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
25
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
26
|
-
url: `https://api.qwilr.com/v1/webhooks/${subscriptionId}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Authorization': `Bearer ${auth}`
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
exports.pageAcceptedTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
|
-
auth: auth_1.qwilrAuth,
|
|
34
|
-
name: 'page_accepted',
|
|
35
|
-
displayName: 'Page Accepted',
|
|
36
|
-
description: 'Triggers when a Qwilr page is accepted',
|
|
37
|
-
aiMetadata: {
|
|
38
|
-
description: 'Fires when a recipient fully accepts a Qwilr page (all accept blocks signed off), signaling the proposal or quote has been agreed to. Use to kick off downstream deal-won workflows such as invoicing or CRM updates.',
|
|
39
|
-
},
|
|
40
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
41
|
-
props: {},
|
|
42
|
-
onEnable(context) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const webhookData = yield subscribeWebhook(context.auth.secret_text, 'pageAccepted', context.webhookUrl);
|
|
46
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_accepted_trigger', {
|
|
47
|
-
subscriptionId: webhookData.id,
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
onDisable(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_page_accepted_trigger'));
|
|
55
|
-
if (response !== null && response !== undefined) {
|
|
56
|
-
yield unsubscribeWebhook(context.auth.secret_text, response.subscriptionId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
run(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return [context.payload.body];
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
sampleData: {
|
|
66
|
-
event: 'pageAccepted',
|
|
67
|
-
idempotencyKey: 'b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0',
|
|
68
|
-
page: {
|
|
69
|
-
id: '6ee0f841f3cc8900090d82dc',
|
|
70
|
-
metadata: {}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=page-accepted.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-accepted.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-accepted.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAqE;AACrE,gDAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAO,IAAY,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;QACvB,GAAG,EAAE,mCAAmC;QACxC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE;YACJ,KAAK;YACL,SAAS;SACV;KACF,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAA,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAO,IAAY,EAAE,cAAsB,EAAE,EAAE;IACxE,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC3B,MAAM,EAAE,0BAAU,CAAC,MAAM;QACzB,GAAG,EAAE,qCAAqC,cAAc,EAAE;QAC1D,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;SAClC;KACF,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,mBAAmB,GAAG,IAAA,gCAAa,EAAC;IAC/C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,wCAAwC;IACrD,UAAU,EAAE;QACV,WAAW,EAAE,uNAAuN;KACrO;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE,EAAE;IACH,QAAQ,CAAC,OAAO;;;YACpB,MAAM,WAAW,GAAG,MAAM,gBAAgB,CACxC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,cAAc,EACd,OAAO,CAAC,UAAU,CACnB,CAAC;YAEF,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,wBAAwB,EAAE;gBACjD,cAAc,EAAE,WAAW,CAAC,EAAE;aAC/B,CAAC,CAAA,CAAC;QACL,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;;YACrB,MAAM,QAAQ,GAAsC,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,wBAAwB,CAAC,CAAA,CAAC;YAEvG,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAChD,MAAM,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;IACD,UAAU,EAAE;QACV,KAAK,EAAE,cAAc;QACrB,cAAc,EAAE,kEAAkE;QAClF,IAAI,EAAE;YACJ,EAAE,EAAE,0BAA0B;YAC9B,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const pageFirstViewedTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
-
//# sourceMappingURL=page-first-viewed.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-first-viewed.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/page-first-viewed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA8BhF,eAAO,MAAM,sBAAsB,klBAuCjC,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pageFirstViewedTrigger = 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("../../lib/common/auth");
|
|
8
|
-
const subscribeWebhook = (auth, event, targetUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
11
|
-
url: 'https://api.qwilr.com/v1/webhooks',
|
|
12
|
-
headers: {
|
|
13
|
-
'Authorization': `Bearer ${auth}`,
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
event,
|
|
18
|
-
targetUrl
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
const unsubscribeWebhook = (auth, subscriptionId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
25
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
26
|
-
url: `https://api.qwilr.com/v1/webhooks/${subscriptionId}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Authorization': `Bearer ${auth}`
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
exports.pageFirstViewedTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
|
-
auth: auth_1.qwilrAuth,
|
|
34
|
-
name: 'page_first_viewed',
|
|
35
|
-
displayName: 'Page First Viewed',
|
|
36
|
-
description: 'Triggers when a Qwilr page is viewed for the first time',
|
|
37
|
-
aiMetadata: {
|
|
38
|
-
description: 'Fires only on the first time a Qwilr page is opened by a viewer, marking initial engagement with a sent proposal. Use to react once to a recipient first opening the document; for all subsequent opens use the Page Viewed trigger.',
|
|
39
|
-
},
|
|
40
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
41
|
-
props: {},
|
|
42
|
-
onEnable(context) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const webhookData = yield subscribeWebhook(context.auth.secret_text, 'pageFirstViewed', context.webhookUrl);
|
|
46
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_first_viewed_trigger', {
|
|
47
|
-
subscriptionId: webhookData.id,
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
onDisable(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_page_first_viewed_trigger'));
|
|
55
|
-
if (response !== null && response !== undefined) {
|
|
56
|
-
yield unsubscribeWebhook(context.auth.secret_text, response.subscriptionId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
run(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return [context.payload.body];
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
sampleData: {
|
|
66
|
-
event: 'pageFirstViewed',
|
|
67
|
-
idempotencyKey: 'b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0',
|
|
68
|
-
page: {
|
|
69
|
-
id: '6ee0f841f3cc8900090d82dc',
|
|
70
|
-
metadata: {}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=page-first-viewed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-first-viewed.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-first-viewed.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAqE;AACrE,gDAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAO,IAAY,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;QACvB,GAAG,EAAE,mCAAmC;QACxC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE;YACJ,KAAK;YACL,SAAS;SACV;KACF,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAA,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAO,IAAY,EAAE,cAAsB,EAAE,EAAE;IACxE,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC3B,MAAM,EAAE,0BAAU,CAAC,MAAM;QACzB,GAAG,EAAE,qCAAqC,cAAc,EAAE;QAC1D,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;SAClC;KACF,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,sBAAsB,GAAG,IAAA,gCAAa,EAAC;IAClD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,yDAAyD;IACtE,UAAU,EAAE;QACV,WAAW,EAAE,sOAAsO;KACpP;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE,EAAE;IACH,QAAQ,CAAC,OAAO;;;YACpB,MAAM,WAAW,GAAG,MAAM,gBAAgB,CACxC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,iBAAiB,EACjB,OAAO,CAAC,UAAU,CACnB,CAAC;YAEF,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,4BAA4B,EAAE;gBACrD,cAAc,EAAE,WAAW,CAAC,EAAE;aAC/B,CAAC,CAAA,CAAC;QACL,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;;YACrB,MAAM,QAAQ,GAAsC,MAAM,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAC,4BAA4B,CAAC,CAAA,CAAC;YAE3G,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAChD,MAAM,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;IACD,UAAU,EAAE;QACV,KAAK,EAAE,iBAAiB;QACxB,cAAc,EAAE,kEAAkE;QAClF,IAAI,EAAE;YACJ,EAAE,EAAE,0BAA0B;YAC9B,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const pagePartiallyAcceptedTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
-
//# sourceMappingURL=page-partially-accepted.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-partially-accepted.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/page-partially-accepted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA8BhF,eAAO,MAAM,4BAA4B,klBAuCvC,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pagePartiallyAcceptedTrigger = 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("../../lib/common/auth");
|
|
8
|
-
const subscribeWebhook = (auth, event, targetUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
11
|
-
url: 'https://api.qwilr.com/v1/webhooks',
|
|
12
|
-
headers: {
|
|
13
|
-
'Authorization': `Bearer ${auth}`,
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
event,
|
|
18
|
-
targetUrl
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
const unsubscribeWebhook = (auth, subscriptionId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
25
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
26
|
-
url: `https://api.qwilr.com/v1/webhooks/${subscriptionId}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Authorization': `Bearer ${auth}`
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
exports.pagePartiallyAcceptedTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
|
-
auth: auth_1.qwilrAuth,
|
|
34
|
-
name: 'page_partially_accepted',
|
|
35
|
-
displayName: 'Page Partially Accepted',
|
|
36
|
-
description: 'Triggers when a Qwilr page is partially accepted',
|
|
37
|
-
aiMetadata: {
|
|
38
|
-
description: 'Fires when a recipient partially accepts a Qwilr page (some but not all accept blocks completed), indicating partial agreement on a multi-option proposal. Use to track in-progress deals or nudge for full acceptance.',
|
|
39
|
-
},
|
|
40
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
41
|
-
props: {},
|
|
42
|
-
onEnable(context) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const webhookData = yield subscribeWebhook(context.auth.secret_text, 'pagePartiallyAccepted', context.webhookUrl);
|
|
46
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_partially_accepted_trigger', {
|
|
47
|
-
subscriptionId: webhookData.id,
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
onDisable(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_page_partially_accepted_trigger'));
|
|
55
|
-
if (response !== null && response !== undefined) {
|
|
56
|
-
yield unsubscribeWebhook(context.auth.secret_text, response.subscriptionId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
run(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return [context.payload.body];
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
sampleData: {
|
|
66
|
-
event: 'pagePartiallyAccepted',
|
|
67
|
-
idempotencyKey: 'b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0',
|
|
68
|
-
page: {
|
|
69
|
-
id: '6ee0f841f3cc8900090d82dc',
|
|
70
|
-
metadata: {}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=page-partially-accepted.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-partially-accepted.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-partially-accepted.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAqE;AACrE,gDAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAO,IAAY,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;QACvB,GAAG,EAAE,mCAAmC;QACxC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE;YACJ,KAAK;YACL,SAAS;SACV;KACF,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAA,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAO,IAAY,EAAE,cAAsB,EAAE,EAAE;IACxE,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC3B,MAAM,EAAE,0BAAU,CAAC,MAAM;QACzB,GAAG,EAAE,qCAAqC,cAAc,EAAE;QAC1D,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;SAClC;KACF,CAAC,CAAC;AACL,CAAC,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} from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const pagePreviewAcceptedTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
-
//# sourceMappingURL=page-preview-accepted.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-preview-accepted.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/page-preview-accepted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA8BhF,eAAO,MAAM,0BAA0B,klBAuCrC,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pagePreviewAcceptedTrigger = 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("../../lib/common/auth");
|
|
8
|
-
const subscribeWebhook = (auth, event, targetUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
11
|
-
url: 'https://api.qwilr.com/v1/webhooks',
|
|
12
|
-
headers: {
|
|
13
|
-
'Authorization': `Bearer ${auth}`,
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
event,
|
|
18
|
-
targetUrl
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
const unsubscribeWebhook = (auth, subscriptionId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
25
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
26
|
-
url: `https://api.qwilr.com/v1/webhooks/${subscriptionId}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Authorization': `Bearer ${auth}`
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
exports.pagePreviewAcceptedTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
|
-
auth: auth_1.qwilrAuth,
|
|
34
|
-
name: 'page_preview_accepted',
|
|
35
|
-
displayName: 'Page Preview Accepted',
|
|
36
|
-
description: 'Triggers when a Qwilr page preview is accepted',
|
|
37
|
-
aiMetadata: {
|
|
38
|
-
description: 'Fires when a page is accepted while in preview (test) mode rather than as a live recipient acceptance. Use to validate acceptance workflows during testing without reacting to a real signed proposal.',
|
|
39
|
-
},
|
|
40
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
41
|
-
props: {},
|
|
42
|
-
onEnable(context) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const webhookData = yield subscribeWebhook(context.auth.secret_text, 'pagePreviewAccepted', context.webhookUrl);
|
|
46
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_preview_accepted_trigger', {
|
|
47
|
-
subscriptionId: webhookData.id,
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
onDisable(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_page_preview_accepted_trigger'));
|
|
55
|
-
if (response !== null && response !== undefined) {
|
|
56
|
-
yield unsubscribeWebhook(context.auth.secret_text, response.subscriptionId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
run(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return [context.payload.body];
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
sampleData: {
|
|
66
|
-
event: 'pagePreviewAccepted',
|
|
67
|
-
idempotencyKey: 'b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0',
|
|
68
|
-
page: {
|
|
69
|
-
id: '6ee0f841f3cc8900090d82dc',
|
|
70
|
-
metadata: {}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=page-preview-accepted.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-preview-accepted.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-preview-accepted.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAqE;AACrE,gDAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAO,IAAY,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;QACvB,GAAG,EAAE,mCAAmC;QACxC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE;YACJ,KAAK;YACL,SAAS;SACV;KACF,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAA,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAO,IAAY,EAAE,cAAsB,EAAE,EAAE;IACxE,MAAM,0BAAU,CAAC,WAA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,cAAc,EAAE,kEAAkE;QAClF,IAAI,EAAE;YACJ,EAAE,EAAE,0BAA0B;YAC9B,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const pageRevivedLiveTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
-
//# sourceMappingURL=page-revived-live.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-revived-live.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/page-revived-live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA8BhF,eAAO,MAAM,sBAAsB,klBAuCjC,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pageRevivedLiveTrigger = 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("../../lib/common/auth");
|
|
8
|
-
const subscribeWebhook = (auth, event, targetUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
11
|
-
url: 'https://api.qwilr.com/v1/webhooks',
|
|
12
|
-
headers: {
|
|
13
|
-
'Authorization': `Bearer ${auth}`,
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
event,
|
|
18
|
-
targetUrl
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
const unsubscribeWebhook = (auth, subscriptionId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
25
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
26
|
-
url: `https://api.qwilr.com/v1/webhooks/${subscriptionId}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Authorization': `Bearer ${auth}`
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
exports.pageRevivedLiveTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
|
-
auth: auth_1.qwilrAuth,
|
|
34
|
-
name: 'page_revived_live',
|
|
35
|
-
displayName: 'Page Revived Live',
|
|
36
|
-
description: 'Triggers when a Qwilr page is revived to live status',
|
|
37
|
-
aiMetadata: {
|
|
38
|
-
description: 'Fires when a previously disabled or expired Qwilr page is revived back to live status, making it accessible again. Use to react when an old proposal is reactivated for a recipient.',
|
|
39
|
-
},
|
|
40
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
41
|
-
props: {},
|
|
42
|
-
onEnable(context) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const webhookData = yield subscribeWebhook(context.auth.secret_text, 'pageRevivedLive', context.webhookUrl);
|
|
46
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_revived_live_trigger', {
|
|
47
|
-
subscriptionId: webhookData.id,
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
onDisable(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_page_revived_live_trigger'));
|
|
55
|
-
if (response !== null && response !== undefined) {
|
|
56
|
-
yield unsubscribeWebhook(context.auth.secret_text, response.subscriptionId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
run(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return [context.payload.body];
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
sampleData: {
|
|
66
|
-
event: 'pageRevivedLive',
|
|
67
|
-
idempotencyKey: 'b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0',
|
|
68
|
-
page: {
|
|
69
|
-
id: '6ee0f841f3cc8900090d82dc',
|
|
70
|
-
metadata: {}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=page-revived-live.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-revived-live.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-revived-live.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAqE;AACrE,gDAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAO,IAAY,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;QACvB,GAAG,EAAE,mCAAmC;QACxC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE;YACJ,KAAK;YACL,SAAS;SACV;KACF,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,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;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;IACD,UAAU,EAAE;QACV,KAAK,EAAE,iBAAiB;QACxB,cAAc,EAAE,kEAAkE;QAClF,IAAI,EAAE;YACJ,EAAE,EAAE,0BAA0B;YAC9B,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const pageSetLiveTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
-
//# sourceMappingURL=page-set-live.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-set-live.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/page-set-live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA8BhF,eAAO,MAAM,kBAAkB,klBAuC7B,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pageSetLiveTrigger = 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("../../lib/common/auth");
|
|
8
|
-
const subscribeWebhook = (auth, event, targetUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
11
|
-
url: 'https://api.qwilr.com/v1/webhooks',
|
|
12
|
-
headers: {
|
|
13
|
-
'Authorization': `Bearer ${auth}`,
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
event,
|
|
18
|
-
targetUrl
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
const unsubscribeWebhook = (auth, subscriptionId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
25
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
26
|
-
url: `https://api.qwilr.com/v1/webhooks/${subscriptionId}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Authorization': `Bearer ${auth}`
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
exports.pageSetLiveTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
|
-
auth: auth_1.qwilrAuth,
|
|
34
|
-
name: 'page_set_live',
|
|
35
|
-
displayName: 'Page Set Live',
|
|
36
|
-
description: 'Triggers when a Qwilr page is set to live',
|
|
37
|
-
aiMetadata: {
|
|
38
|
-
description: 'Fires when a Qwilr page is published and set to live (made publicly accessible), transitioning out of draft status. Use to react when a proposal becomes ready to share with a recipient.',
|
|
39
|
-
},
|
|
40
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
41
|
-
props: {},
|
|
42
|
-
onEnable(context) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const webhookData = yield subscribeWebhook(context.auth.secret_text, 'pageSetLive', context.webhookUrl);
|
|
46
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_set_live_trigger', {
|
|
47
|
-
subscriptionId: webhookData.id,
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
onDisable(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_page_set_live_trigger'));
|
|
55
|
-
if (response !== null && response !== undefined) {
|
|
56
|
-
yield unsubscribeWebhook(context.auth.secret_text, response.subscriptionId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
run(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return [context.payload.body];
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
sampleData: {
|
|
66
|
-
event: 'pageSetLive',
|
|
67
|
-
idempotencyKey: 'b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0',
|
|
68
|
-
page: {
|
|
69
|
-
id: '6ee0f841f3cc8900090d82dc',
|
|
70
|
-
metadata: {}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=page-set-live.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-set-live.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-set-live.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAqE;AACrE,gDAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAO,IAAY,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;QACvB,GAAG,EAAE,mCAAmC;QACxC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,IAAI,EAAE;YACjC,cAAc,EAA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WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;IACD,UAAU,EAAE;QACV,KAAK,EAAE,aAAa;QACpB,cAAc,EAAE,kEAAkE;QAClF,IAAI,EAAE;YACJ,EAAE,EAAE,0BAA0B;YAC9B,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const pageViewedTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
-
//# sourceMappingURL=page-viewed.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-viewed.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/page-viewed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AA8BhF,eAAO,MAAM,iBAAiB,klBAuC5B,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pageViewedTrigger = 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("../../lib/common/auth");
|
|
8
|
-
const subscribeWebhook = (auth, event, targetUrl) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
11
|
-
url: 'https://api.qwilr.com/v1/webhooks',
|
|
12
|
-
headers: {
|
|
13
|
-
'Authorization': `Bearer ${auth}`,
|
|
14
|
-
'Content-Type': 'application/json'
|
|
15
|
-
},
|
|
16
|
-
body: {
|
|
17
|
-
event,
|
|
18
|
-
targetUrl
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
const unsubscribeWebhook = (auth, subscriptionId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
25
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
26
|
-
url: `https://api.qwilr.com/v1/webhooks/${subscriptionId}`,
|
|
27
|
-
headers: {
|
|
28
|
-
'Authorization': `Bearer ${auth}`
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
exports.pageViewedTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
|
-
auth: auth_1.qwilrAuth,
|
|
34
|
-
name: 'page_viewed',
|
|
35
|
-
displayName: 'Page Viewed',
|
|
36
|
-
description: 'Triggers when a Qwilr page is viewed',
|
|
37
|
-
aiMetadata: {
|
|
38
|
-
description: 'Fires every time a Qwilr page is opened by a viewer, including repeat views. Use to track engagement on a sent proposal; for only the very first open use the Page First Viewed trigger instead.',
|
|
39
|
-
},
|
|
40
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
41
|
-
props: {},
|
|
42
|
-
onEnable(context) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const webhookData = yield subscribeWebhook(context.auth.secret_text, 'pageViewed', context.webhookUrl);
|
|
46
|
-
yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.put('_page_viewed_trigger', {
|
|
47
|
-
subscriptionId: webhookData.id,
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
onDisable(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
var _a;
|
|
54
|
-
const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_page_viewed_trigger'));
|
|
55
|
-
if (response !== null && response !== undefined) {
|
|
56
|
-
yield unsubscribeWebhook(context.auth.secret_text, response.subscriptionId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
run(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return [context.payload.body];
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
sampleData: {
|
|
66
|
-
event: 'pageViewed',
|
|
67
|
-
idempotencyKey: 'b1c51b5b4844a81f7c3745002dbbd871fdda6cabe019961bcc79f972d924a2b0',
|
|
68
|
-
page: {
|
|
69
|
-
id: '6ee0f841f3cc8900090d82dc',
|
|
70
|
-
metadata: {}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=page-viewed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-viewed.js","sourceRoot":"","sources":["../../../../src/lib/triggers/page-viewed.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAqE;AACrE,gDAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAO,IAAY,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;QAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;QACvB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