@hibira-io/piece-hibira 0.2.0 → 0.3.0
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/README.md +1 -0
- package/dist/src/i18n/translation.json +33 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -0
- package/dist/src/lib/actions/admit-waiting-room.d.ts +12 -0
- package/dist/src/lib/actions/admit-waiting-room.d.ts.map +1 -0
- package/dist/src/lib/actions/admit-waiting-room.js +29 -0
- package/dist/src/lib/actions/delete-waiting-room.d.ts +11 -0
- package/dist/src/lib/actions/delete-waiting-room.d.ts.map +1 -0
- package/dist/src/lib/actions/delete-waiting-room.js +20 -0
- package/dist/src/lib/actions/get-waiting-room.d.ts +11 -0
- package/dist/src/lib/actions/get-waiting-room.d.ts.map +1 -0
- package/dist/src/lib/actions/get-waiting-room.js +19 -0
- package/dist/src/lib/actions/update-waiting-room.d.ts +18 -0
- package/dist/src/lib/actions/update-waiting-room.d.ts.map +1 -0
- package/dist/src/lib/actions/update-waiting-room.js +77 -0
- package/dist/src/lib/actions/verify-waiting-room-pass.d.ts +12 -0
- package/dist/src/lib/actions/verify-waiting-room-pass.d.ts.map +1 -0
- package/dist/src/lib/actions/verify-waiting-room-pass.js +29 -0
- package/dist/src/lib/common/waiting-room.d.ts +19 -0
- package/dist/src/lib/common/waiting-room.d.ts.map +1 -0
- package/dist/src/lib/common/waiting-room.js +14 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ The connection is checked with a signed request when you save it.
|
|
|
31
31
|
- **Disconnect User**: close every connection of a signed-in user.
|
|
32
32
|
- **Send Push Notification to Interests**, **Send Push Notification to Users**, **Delete Push User**.
|
|
33
33
|
- **Request Approval**, **Get Approval**: ask a person to approve or choose (2 to 4 choices, the first approves) through a Hibira-hosted answer link, optionally delivered by push or announced on a channel for the `@hibira-io/approvals` inbox. Request Approval can wait up to 9 minutes for the answer and returns `status` (`approved`, `rejected`, `pending`, `expired`) and `choice`; for longer waits, send the link and check later with Get Approval. Needs an app in a Hibira account.
|
|
34
|
+
- **Get Waiting Room**, **Create or Update Waiting Room**, **Admit Visitors**, **Verify Waiting Room Pass**, **Delete Waiting Room**: run a Hibira waiting room from a flow. Open or pause a room on a schedule, admit a batch when a sale starts, or check a visitor's pass (`hibira_pass` or the `hibira_wr_<room>` cookie) from a checkout webhook; record `ticket_id` to allow one checkout per place in line. Empty fields in Create or Update keep their current values. Needs the waiting room add-on.
|
|
34
35
|
|
|
35
36
|
## Trigger
|
|
36
37
|
|
|
@@ -92,5 +92,37 @@
|
|
|
92
92
|
"Approval ID": "Approval ID",
|
|
93
93
|
"The approval_id returned by Request Approval (apr_...).": "The approval_id returned by Request Approval (apr_...).",
|
|
94
94
|
"Wait (Minutes)": "Wait (Minutes)",
|
|
95
|
-
"Wait up to this long (0 to 9) for a pending request to be answered. 0 returns at once.": "Wait up to this long (0 to 9) for a pending request to be answered. 0 returns at once."
|
|
95
|
+
"Wait up to this long (0 to 9) for a pending request to be answered. 0 returns at once.": "Wait up to this long (0 to 9) for a pending request to be answered. 0 returns at once.",
|
|
96
|
+
"Room": "Room",
|
|
97
|
+
"The waiting room's name: 1 to 64 letters, digits, '-' or '_', such as presale.": "The waiting room's name: 1 to 64 letters, digits, '-' or '_', such as presale.",
|
|
98
|
+
"Create or Update Waiting Room": "Create or Update Waiting Room",
|
|
99
|
+
"Creates a waiting room, or changes its state, admission rate, start time or other settings.": "Creates a waiting room, or changes its state, admission rate, start time or other settings.",
|
|
100
|
+
"Admit per Minute": "Admit per Minute",
|
|
101
|
+
"How many visitors to let through each minute. Required when the room is new; leave empty to keep the current rate.": "How many visitors to let through each minute. Required when the room is new; leave empty to keep the current rate.",
|
|
102
|
+
"State": "State",
|
|
103
|
+
"Leave empty to keep the current state. A new room opens.": "Leave empty to keep the current state. A new room opens.",
|
|
104
|
+
"Open": "Open",
|
|
105
|
+
"Paused (visitors can join, nobody is admitted)": "Paused (visitors can join, nobody is admitted)",
|
|
106
|
+
"Closed (nobody can join)": "Closed (nobody can join)",
|
|
107
|
+
"Starts At": "Starts At",
|
|
108
|
+
"When admission starts. Visitors can join the queue before then.": "When admission starts. Visitors can join the queue before then.",
|
|
109
|
+
"Shown on the waiting page, at most 120 characters.": "Shown on the waiting page, at most 120 characters.",
|
|
110
|
+
"Burst": "Burst",
|
|
111
|
+
"How many visitors may be admitted at once when the queue starts moving.": "How many visitors may be admitted at once when the queue starts moving.",
|
|
112
|
+
"Pass Lifetime (Seconds)": "Pass Lifetime (Seconds)",
|
|
113
|
+
"How long an admitted visitor stays in: 60 to 86400. Default 1800.": "How long an admitted visitor stays in: 60 to 86400. Default 1800.",
|
|
114
|
+
"Return URLs": "Return URLs",
|
|
115
|
+
"Comma or newline separated https addresses visitors may be sent back to (http only for localhost). Up to 10.": "Comma or newline separated https addresses visitors may be sent back to (http only for localhost). Up to 10.",
|
|
116
|
+
"Admit Visitors": "Admit Visitors",
|
|
117
|
+
"Lets the next visitors in a waiting room through now, on top of the steady rate.": "Lets the next visitors in a waiting room through now, on top of the steady rate.",
|
|
118
|
+
"Visitors": "Visitors",
|
|
119
|
+
"How many of the next visitors to admit.": "How many of the next visitors to admit.",
|
|
120
|
+
"Verify Waiting Room Pass": "Verify Waiting Room Pass",
|
|
121
|
+
"Checks a pass a visitor brought back from the waiting room. Record ticket_id to allow one checkout per place in line.": "Checks a pass a visitor brought back from the waiting room. Record ticket_id to allow one checkout per place in line.",
|
|
122
|
+
"Pass": "Pass",
|
|
123
|
+
"The hibira_pass query parameter, or the hibira_wr_<room> cookie value.": "The hibira_pass query parameter, or the hibira_wr_<room> cookie value.",
|
|
124
|
+
"Get Waiting Room": "Get Waiting Room",
|
|
125
|
+
"Gets a waiting room's settings and how many visitors are waiting and admitted.": "Gets a waiting room's settings and how many visitors are waiting and admitted.",
|
|
126
|
+
"Delete Waiting Room": "Delete Waiting Room",
|
|
127
|
+
"Deletes a waiting room and its queue.": "Deletes a waiting room and its queue."
|
|
96
128
|
}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAkBxC,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,eAAO,MAAM,MAAM;;;;;;;GA0BjB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -15,6 +15,11 @@ const publish_to_users_1 = require("./lib/actions/publish-to-users");
|
|
|
15
15
|
const request_approval_1 = require("./lib/actions/request-approval");
|
|
16
16
|
const terminate_user_connections_1 = require("./lib/actions/terminate-user-connections");
|
|
17
17
|
const trigger_event_1 = require("./lib/actions/trigger-event");
|
|
18
|
+
const admit_waiting_room_1 = require("./lib/actions/admit-waiting-room");
|
|
19
|
+
const delete_waiting_room_1 = require("./lib/actions/delete-waiting-room");
|
|
20
|
+
const get_waiting_room_1 = require("./lib/actions/get-waiting-room");
|
|
21
|
+
const update_waiting_room_1 = require("./lib/actions/update-waiting-room");
|
|
22
|
+
const verify_waiting_room_pass_1 = require("./lib/actions/verify-waiting-room-pass");
|
|
18
23
|
const new_webhook_event_1 = require("./lib/triggers/new-webhook-event");
|
|
19
24
|
exports.hibira = (0, pieces_framework_1.createPiece)({
|
|
20
25
|
displayName: 'Hibira',
|
|
@@ -35,6 +40,11 @@ exports.hibira = (0, pieces_framework_1.createPiece)({
|
|
|
35
40
|
delete_push_user_1.deletePushUser,
|
|
36
41
|
request_approval_1.requestApproval,
|
|
37
42
|
get_approval_1.getApproval,
|
|
43
|
+
get_waiting_room_1.getWaitingRoom,
|
|
44
|
+
update_waiting_room_1.updateWaitingRoom,
|
|
45
|
+
admit_waiting_room_1.admitWaitingRoom,
|
|
46
|
+
verify_waiting_room_pass_1.verifyWaitingRoomPass,
|
|
47
|
+
delete_waiting_room_1.deleteWaitingRoom,
|
|
38
48
|
],
|
|
39
49
|
triggers: [new_webhook_event_1.newWebhookEvent],
|
|
40
50
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const admitWaitingRoom: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
appId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
secret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
pushInstanceId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
pushSecretKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
7
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
}>, {
|
|
9
|
+
room: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
count: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=admit-waiting-room.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admit-waiting-room.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/admit-waiting-room.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;EAqB3B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.admitWaitingRoom = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
|
+
const client_1 = require("../common/client");
|
|
7
|
+
const waiting_room_1 = require("../common/waiting-room");
|
|
8
|
+
exports.admitWaitingRoom = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: auth_1.hibiraAuth,
|
|
10
|
+
name: 'admit_waiting_room',
|
|
11
|
+
displayName: 'Admit Visitors',
|
|
12
|
+
description: 'Lets the next visitors in a waiting room through now, on top of the steady rate.',
|
|
13
|
+
props: {
|
|
14
|
+
room: waiting_room_1.roomProp,
|
|
15
|
+
count: pieces_framework_1.Property.Number({
|
|
16
|
+
displayName: 'Visitors',
|
|
17
|
+
description: 'How many of the next visitors to admit.',
|
|
18
|
+
required: true,
|
|
19
|
+
defaultValue: 100,
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
async run({ auth, propsValue }) {
|
|
23
|
+
return client_1.hibiraClient.channels(auth, {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
path: (0, waiting_room_1.roomPath)(propsValue.room, '/admit'),
|
|
26
|
+
body: { count: propsValue.count },
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const deleteWaitingRoom: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
appId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
secret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
pushInstanceId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
pushSecretKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
7
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
}>, {
|
|
9
|
+
room: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=delete-waiting-room.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-waiting-room.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-waiting-room.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;;;;;EAY5B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteWaitingRoom = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
|
+
const client_1 = require("../common/client");
|
|
7
|
+
const waiting_room_1 = require("../common/waiting-room");
|
|
8
|
+
exports.deleteWaitingRoom = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: auth_1.hibiraAuth,
|
|
10
|
+
name: 'delete_waiting_room',
|
|
11
|
+
displayName: 'Delete Waiting Room',
|
|
12
|
+
description: 'Deletes a waiting room and its queue.',
|
|
13
|
+
props: {
|
|
14
|
+
room: waiting_room_1.roomProp,
|
|
15
|
+
},
|
|
16
|
+
async run({ auth, propsValue }) {
|
|
17
|
+
const result = await client_1.hibiraClient.channels(auth, { method: 'DELETE', path: (0, waiting_room_1.roomPath)(propsValue.room) });
|
|
18
|
+
return { room: propsValue.room.trim(), ...result };
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const getWaitingRoom: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
appId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
secret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
pushInstanceId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
pushSecretKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
7
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
}>, {
|
|
9
|
+
room: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=get-waiting-room.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-waiting-room.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-waiting-room.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;;;;;;;EAWzB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWaitingRoom = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
|
+
const client_1 = require("../common/client");
|
|
7
|
+
const waiting_room_1 = require("../common/waiting-room");
|
|
8
|
+
exports.getWaitingRoom = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: auth_1.hibiraAuth,
|
|
10
|
+
name: 'get_waiting_room',
|
|
11
|
+
displayName: 'Get Waiting Room',
|
|
12
|
+
description: "Gets a waiting room's settings and how many visitors are waiting and admitted.",
|
|
13
|
+
props: {
|
|
14
|
+
room: waiting_room_1.roomProp,
|
|
15
|
+
},
|
|
16
|
+
async run({ auth, propsValue }) {
|
|
17
|
+
return client_1.hibiraClient.channels(auth, { method: 'GET', path: (0, waiting_room_1.roomPath)(propsValue.room) });
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const updateWaitingRoom: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
appId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
secret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
pushInstanceId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
pushSecretKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
7
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
}>, {
|
|
9
|
+
room: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
admitPerMinute: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
11
|
+
state: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
12
|
+
startsAt: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
13
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
14
|
+
burst: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
15
|
+
passTtlSeconds: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
16
|
+
returnUrls: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=update-waiting-room.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-waiting-room.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-waiting-room.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;EA8D5B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateWaitingRoom = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
|
+
const client_1 = require("../common/client");
|
|
7
|
+
const waiting_room_1 = require("../common/waiting-room");
|
|
8
|
+
exports.updateWaitingRoom = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: auth_1.hibiraAuth,
|
|
10
|
+
name: 'update_waiting_room',
|
|
11
|
+
displayName: 'Create or Update Waiting Room',
|
|
12
|
+
description: 'Creates a waiting room, or changes its state, admission rate, start time or other settings.',
|
|
13
|
+
props: {
|
|
14
|
+
room: waiting_room_1.roomProp,
|
|
15
|
+
admitPerMinute: pieces_framework_1.Property.Number({
|
|
16
|
+
displayName: 'Admit per Minute',
|
|
17
|
+
description: 'How many visitors to let through each minute. Required when the room is new; leave empty to keep the current rate.',
|
|
18
|
+
required: false,
|
|
19
|
+
}),
|
|
20
|
+
state: pieces_framework_1.Property.StaticDropdown({
|
|
21
|
+
displayName: 'State',
|
|
22
|
+
description: 'Leave empty to keep the current state. A new room opens.',
|
|
23
|
+
required: false,
|
|
24
|
+
options: {
|
|
25
|
+
options: [
|
|
26
|
+
{ label: 'Open', value: 'open' },
|
|
27
|
+
{ label: 'Paused (visitors can join, nobody is admitted)', value: 'paused' },
|
|
28
|
+
{ label: 'Closed (nobody can join)', value: 'closed' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
startsAt: pieces_framework_1.Property.DateTime({
|
|
33
|
+
displayName: 'Starts At',
|
|
34
|
+
description: 'When admission starts. Visitors can join the queue before then.',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
title: pieces_framework_1.Property.ShortText({
|
|
38
|
+
displayName: 'Title',
|
|
39
|
+
description: 'Shown on the waiting page, at most 120 characters.',
|
|
40
|
+
required: false,
|
|
41
|
+
}),
|
|
42
|
+
burst: pieces_framework_1.Property.Number({
|
|
43
|
+
displayName: 'Burst',
|
|
44
|
+
description: 'How many visitors may be admitted at once when the queue starts moving.',
|
|
45
|
+
required: false,
|
|
46
|
+
}),
|
|
47
|
+
passTtlSeconds: pieces_framework_1.Property.Number({
|
|
48
|
+
displayName: 'Pass Lifetime (Seconds)',
|
|
49
|
+
description: 'How long an admitted visitor stays in: 60 to 86400. Default 1800.',
|
|
50
|
+
required: false,
|
|
51
|
+
}),
|
|
52
|
+
returnUrls: pieces_framework_1.Property.LongText({
|
|
53
|
+
displayName: 'Return URLs',
|
|
54
|
+
description: 'Comma or newline separated https addresses visitors may be sent back to (http only for localhost). Up to 10.',
|
|
55
|
+
required: false,
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
async run({ auth, propsValue }) {
|
|
59
|
+
const p = propsValue;
|
|
60
|
+
const body = {};
|
|
61
|
+
if (p.admitPerMinute)
|
|
62
|
+
body['admit_per_minute'] = p.admitPerMinute;
|
|
63
|
+
if (p.state)
|
|
64
|
+
body['state'] = p.state;
|
|
65
|
+
if (p.startsAt)
|
|
66
|
+
body['starts_at'] = new Date(p.startsAt).toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
67
|
+
if (p.title)
|
|
68
|
+
body['title'] = p.title;
|
|
69
|
+
if (p.burst)
|
|
70
|
+
body['burst'] = p.burst;
|
|
71
|
+
if (p.passTtlSeconds)
|
|
72
|
+
body['pass_ttl_seconds'] = p.passTtlSeconds;
|
|
73
|
+
if (p.returnUrls)
|
|
74
|
+
body['return_urls'] = (0, client_1.splitList)(p.returnUrls);
|
|
75
|
+
return client_1.hibiraClient.channels(auth, { method: 'POST', path: (0, waiting_room_1.roomPath)(p.room), body });
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const verifyWaitingRoomPass: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
appId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
secret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
pushInstanceId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
pushSecretKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
7
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
}>, {
|
|
9
|
+
room: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
pass: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=verify-waiting-room-pass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-waiting-room-pass.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/verify-waiting-room-pass.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB;;;;;;;;;;EAqBhC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyWaitingRoomPass = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
|
+
const client_1 = require("../common/client");
|
|
7
|
+
const waiting_room_1 = require("../common/waiting-room");
|
|
8
|
+
exports.verifyWaitingRoomPass = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: auth_1.hibiraAuth,
|
|
10
|
+
name: 'verify_waiting_room_pass',
|
|
11
|
+
displayName: 'Verify Waiting Room Pass',
|
|
12
|
+
description: 'Checks a pass a visitor brought back from the waiting room. Record ticket_id to allow one checkout per place in line.',
|
|
13
|
+
props: {
|
|
14
|
+
room: waiting_room_1.roomProp,
|
|
15
|
+
pass: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Pass',
|
|
17
|
+
description: 'The hibira_pass query parameter, or the hibira_wr_<room> cookie value.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
async run({ auth, propsValue }) {
|
|
22
|
+
const result = await client_1.hibiraClient.channels(auth, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
path: (0, waiting_room_1.roomPath)(propsValue.room, '/verify'),
|
|
25
|
+
body: { pass: propsValue.pass.trim() },
|
|
26
|
+
});
|
|
27
|
+
return { room: propsValue.room.trim(), ...result };
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const roomProp: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
2
|
+
/** The path of a room in the signed waiting room API. */
|
|
3
|
+
export declare function roomPath(room: string, action?: string): string;
|
|
4
|
+
export type WaitingRoom = {
|
|
5
|
+
room: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
state: 'open' | 'paused' | 'closed';
|
|
8
|
+
admitted: number;
|
|
9
|
+
issued: number;
|
|
10
|
+
waiting: number;
|
|
11
|
+
admit_per_minute: number;
|
|
12
|
+
starts_at?: string;
|
|
13
|
+
channel: string;
|
|
14
|
+
burst: number;
|
|
15
|
+
pass_ttl_seconds: number;
|
|
16
|
+
return_urls: string[];
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=waiting-room.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waiting-room.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/waiting-room.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,kEAInB,CAAC;AAEH,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,CAE1D;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.roomProp = void 0;
|
|
4
|
+
exports.roomPath = roomPath;
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
exports.roomProp = pieces_framework_1.Property.ShortText({
|
|
7
|
+
displayName: 'Room',
|
|
8
|
+
description: "The waiting room's name: 1 to 64 letters, digits, '-' or '_', such as presale.",
|
|
9
|
+
required: true,
|
|
10
|
+
});
|
|
11
|
+
/** The path of a room in the signed waiting room API. */
|
|
12
|
+
function roomPath(room, action = '') {
|
|
13
|
+
return `/waiting_rooms/${encodeURIComponent(room.trim())}${action}`;
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hibira-io/piece-hibira",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Hibira piece for Activepieces: realtime events, presence, push notifications and a webhook trigger",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Hibira piece for Activepieces: realtime events, presence, push notifications, approvals, waiting rooms and a webhook trigger",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"activepieces",
|
|
7
7
|
"activepieces-piece",
|