@hibira-io/piece-hibira 0.1.1 → 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.
Files changed (35) hide show
  1. package/README.md +2 -0
  2. package/dist/src/i18n/translation.json +59 -2
  3. package/dist/src/index.d.ts.map +1 -1
  4. package/dist/src/index.js +14 -0
  5. package/dist/src/lib/actions/admit-waiting-room.d.ts +12 -0
  6. package/dist/src/lib/actions/admit-waiting-room.d.ts.map +1 -0
  7. package/dist/src/lib/actions/admit-waiting-room.js +29 -0
  8. package/dist/src/lib/actions/delete-waiting-room.d.ts +11 -0
  9. package/dist/src/lib/actions/delete-waiting-room.d.ts.map +1 -0
  10. package/dist/src/lib/actions/delete-waiting-room.js +20 -0
  11. package/dist/src/lib/actions/get-approval.d.ts +12 -0
  12. package/dist/src/lib/actions/get-approval.d.ts.map +1 -0
  13. package/dist/src/lib/actions/get-approval.js +33 -0
  14. package/dist/src/lib/actions/get-waiting-room.d.ts +11 -0
  15. package/dist/src/lib/actions/get-waiting-room.d.ts.map +1 -0
  16. package/dist/src/lib/actions/get-waiting-room.js +19 -0
  17. package/dist/src/lib/actions/request-approval.d.ts +19 -0
  18. package/dist/src/lib/actions/request-approval.d.ts.map +1 -0
  19. package/dist/src/lib/actions/request-approval.js +85 -0
  20. package/dist/src/lib/actions/update-waiting-room.d.ts +18 -0
  21. package/dist/src/lib/actions/update-waiting-room.d.ts.map +1 -0
  22. package/dist/src/lib/actions/update-waiting-room.js +77 -0
  23. package/dist/src/lib/actions/verify-waiting-room-pass.d.ts +12 -0
  24. package/dist/src/lib/actions/verify-waiting-room-pass.d.ts.map +1 -0
  25. package/dist/src/lib/actions/verify-waiting-room-pass.js +29 -0
  26. package/dist/src/lib/common/approvals.d.ts +18 -0
  27. package/dist/src/lib/common/approvals.d.ts.map +1 -0
  28. package/dist/src/lib/common/approvals.js +30 -0
  29. package/dist/src/lib/common/client.d.ts +2 -1
  30. package/dist/src/lib/common/client.d.ts.map +1 -1
  31. package/dist/src/lib/common/client.js +2 -1
  32. package/dist/src/lib/common/waiting-room.d.ts +19 -0
  33. package/dist/src/lib/common/waiting-room.d.ts.map +1 -0
  34. package/dist/src/lib/common/waiting-room.js +14 -0
  35. package/package.json +2 -2
package/README.md CHANGED
@@ -30,6 +30,8 @@ The connection is checked with a signed request when you save it.
30
30
  - **List Occupied Channels**, **Get Channel**, **Get Users in Presence Channel** (pages through `presence-large-` channels).
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
+ - **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.
33
35
 
34
36
  ## Trigger
35
37
 
@@ -67,5 +67,62 @@
67
67
  "Starts the flow when a channel is occupied or vacated, a presence member joins or leaves, a client sends an event, and more.": "Starts the flow when a channel is occupied or vacated, a presence member joins or leaves, a client sends an event, and more.",
68
68
  "Events": "Events",
69
69
  "Channel Prefix": "Channel Prefix",
70
- "Only events of channels whose name starts with this text, for example presence-.": "Only events of channels whose name starts with this text, for example presence-."
71
- }
70
+ "Only events of channels whose name starts with this text, for example presence-.": "Only events of channels whose name starts with this text, for example presence-.",
71
+ "Request Approval": "Request Approval",
72
+ "Asks a person to approve or choose through a Hibira-hosted answer link, and can wait for the answer.": "Asks a person to approve or choose through a Hibira-hosted answer link, and can wait for the answer.",
73
+ "Question": "Question",
74
+ "What needs a decision, as a short question (at most 200 characters), such as \"Refund order #1042 for $89?\".": "What needs a decision, as a short question (at most 200 characters), such as \"Refund order #1042 for $89?\".",
75
+ "Choices": "Choices",
76
+ "2 to 4 choices, separated by commas. The first one approves; any other rejects.": "2 to 4 choices, separated by commas. The first one approves; any other rejects.",
77
+ "Details": "Details",
78
+ "Context shown to the person: what will happen and why (at most 4000 characters).": "Context shown to the person: what will happen and why (at most 4000 characters).",
79
+ "Wait for Answer": "Wait for Answer",
80
+ "Keep the flow at this step until the person answers, for up to 9 minutes. Otherwise the step returns the link at once; check later with Get Approval.": "Keep the flow at this step until the person answers, for up to 9 minutes. Otherwise the step returns the link at once; check later with Get Approval.",
81
+ "Max Wait (Minutes)": "Max Wait (Minutes)",
82
+ "Stop waiting after this long (1 to 9) and return the request as still pending.": "Stop waiting after this long (1 to 9) and return the request as still pending.",
83
+ "Expires In (Minutes)": "Expires In (Minutes)",
84
+ "How long the link can be answered (default 60, at most 10080 = 7 days).": "How long the link can be answered (default 60, at most 10080 = 7 days).",
85
+ "Channel to announce the request and its answer on, for the @hibira-io/approvals inbox components.": "Channel to announce the request and its answer on, for the @hibira-io/approvals inbox components.",
86
+ "Push to Interests": "Push to Interests",
87
+ "Send the link as a push notification to these interests, separated by commas (the app needs Push enabled).": "Send the link as a push notification to these interests, separated by commas (the app needs Push enabled).",
88
+ "Push to User IDs": "Push to User IDs",
89
+ "Send the link as a push notification to these user IDs instead of interests.": "Send the link as a push notification to these user IDs instead of interests.",
90
+ "Get Approval": "Get Approval",
91
+ "Gets the status (pending, approved, rejected or expired) and answer of an approval request.": "Gets the status (pending, approved, rejected or expired) and answer of an approval request.",
92
+ "Approval ID": "Approval ID",
93
+ "The approval_id returned by Request Approval (apr_...).": "The approval_id returned by Request Approval (apr_...).",
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.",
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."
128
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAWxC,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,eAAO,MAAM,MAAM;;;;;;;GAmBjB,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
@@ -6,13 +6,20 @@ const shared_1 = require("@activepieces/shared");
6
6
  const auth_1 = require("./lib/auth");
7
7
  Object.defineProperty(exports, "hibiraAuth", { enumerable: true, get: function () { return auth_1.hibiraAuth; } });
8
8
  const delete_push_user_1 = require("./lib/actions/delete-push-user");
9
+ const get_approval_1 = require("./lib/actions/get-approval");
9
10
  const get_channel_1 = require("./lib/actions/get-channel");
10
11
  const get_presence_users_1 = require("./lib/actions/get-presence-users");
11
12
  const list_channels_1 = require("./lib/actions/list-channels");
12
13
  const publish_to_interests_1 = require("./lib/actions/publish-to-interests");
13
14
  const publish_to_users_1 = require("./lib/actions/publish-to-users");
15
+ const request_approval_1 = require("./lib/actions/request-approval");
14
16
  const terminate_user_connections_1 = require("./lib/actions/terminate-user-connections");
15
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");
16
23
  const new_webhook_event_1 = require("./lib/triggers/new-webhook-event");
17
24
  exports.hibira = (0, pieces_framework_1.createPiece)({
18
25
  displayName: 'Hibira',
@@ -31,6 +38,13 @@ exports.hibira = (0, pieces_framework_1.createPiece)({
31
38
  publish_to_interests_1.publishToInterests,
32
39
  publish_to_users_1.publishToUsers,
33
40
  delete_push_user_1.deletePushUser,
41
+ request_approval_1.requestApproval,
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,
34
48
  ],
35
49
  triggers: [new_webhook_event_1.newWebhookEvent],
36
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,12 @@
1
+ export declare const getApproval: 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
+ approvalId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ maxWaitMinutes: import("@activepieces/pieces-framework").NumberProperty<false>;
11
+ }>;
12
+ //# sourceMappingURL=get-approval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-approval.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-approval.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;;;;;;;;;EAyBtB,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getApproval = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ const auth_1 = require("../auth");
6
+ const approvals_1 = require("../common/approvals");
7
+ const client_1 = require("../common/client");
8
+ exports.getApproval = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.hibiraAuth,
10
+ name: 'get_approval',
11
+ displayName: 'Get Approval',
12
+ description: 'Gets the status (pending, approved, rejected or expired) and answer of an approval request.',
13
+ props: {
14
+ approvalId: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Approval ID',
16
+ description: 'The approval_id returned by Request Approval (apr_...).',
17
+ required: true,
18
+ }),
19
+ maxWaitMinutes: pieces_framework_1.Property.Number({
20
+ displayName: 'Wait (Minutes)',
21
+ description: `Wait up to this long (0 to ${approvals_1.MAX_WAIT_MINUTES}) for a pending request to be answered. 0 returns at once.`,
22
+ required: false,
23
+ defaultValue: 0,
24
+ }),
25
+ },
26
+ async run({ auth, propsValue }) {
27
+ const current = await client_1.hibiraClient.channels(auth, {
28
+ method: 'GET',
29
+ path: `/approvals/${encodeURIComponent(propsValue.approvalId.trim())}`,
30
+ });
31
+ return (0, approvals_1.waitForApproval)(auth, current, propsValue.maxWaitMinutes ?? 0);
32
+ },
33
+ });
@@ -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,19 @@
1
+ export declare const requestApproval: 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
+ title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ options: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ details: import("@activepieces/pieces-framework").LongTextProperty<false>;
12
+ waitForAnswer: import("@activepieces/pieces-framework").CheckboxProperty<false>;
13
+ maxWaitMinutes: import("@activepieces/pieces-framework").NumberProperty<false>;
14
+ expiresInMinutes: import("@activepieces/pieces-framework").NumberProperty<false>;
15
+ channel: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
+ pushInterests: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
+ pushUsers: import("@activepieces/pieces-framework").ShortTextProperty<false>;
18
+ }>;
19
+ //# sourceMappingURL=request-approval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-approval.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/request-approval.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;EAuE1B,CAAC"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requestApproval = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ const auth_1 = require("../auth");
6
+ const approvals_1 = require("../common/approvals");
7
+ const client_1 = require("../common/client");
8
+ exports.requestApproval = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.hibiraAuth,
10
+ name: 'request_approval',
11
+ displayName: 'Request Approval',
12
+ description: 'Asks a person to approve or choose through a Hibira-hosted answer link, and can wait for the answer.',
13
+ props: {
14
+ title: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Question',
16
+ description: 'What needs a decision, as a short question (at most 200 characters), such as "Refund order #1042 for $89?".',
17
+ required: true,
18
+ }),
19
+ options: pieces_framework_1.Property.ShortText({
20
+ displayName: 'Choices',
21
+ description: '2 to 4 choices, separated by commas. The first one approves; any other rejects.',
22
+ required: false,
23
+ defaultValue: 'Approve, Reject',
24
+ }),
25
+ details: pieces_framework_1.Property.LongText({
26
+ displayName: 'Details',
27
+ description: 'Context shown to the person: what will happen and why (at most 4000 characters).',
28
+ required: false,
29
+ }),
30
+ waitForAnswer: pieces_framework_1.Property.Checkbox({
31
+ displayName: 'Wait for Answer',
32
+ description: `Keep the flow at this step until the person answers, for up to ${approvals_1.MAX_WAIT_MINUTES} minutes. Otherwise the step returns the link at once; check later with Get Approval.`,
33
+ required: false,
34
+ defaultValue: true,
35
+ }),
36
+ maxWaitMinutes: pieces_framework_1.Property.Number({
37
+ displayName: 'Max Wait (Minutes)',
38
+ description: `Stop waiting after this long (1 to ${approvals_1.MAX_WAIT_MINUTES}) and return the request as still pending.`,
39
+ required: false,
40
+ defaultValue: 5,
41
+ }),
42
+ expiresInMinutes: pieces_framework_1.Property.Number({
43
+ displayName: 'Expires In (Minutes)',
44
+ description: 'How long the link can be answered (default 60, at most 10080 = 7 days).',
45
+ required: false,
46
+ }),
47
+ channel: pieces_framework_1.Property.ShortText({
48
+ displayName: 'Channel',
49
+ description: 'Channel to announce the request and its answer on, for the @hibira-io/approvals inbox components.',
50
+ required: false,
51
+ }),
52
+ pushInterests: pieces_framework_1.Property.ShortText({
53
+ displayName: 'Push to Interests',
54
+ description: 'Send the link as a push notification to these interests, separated by commas (the app needs Push enabled).',
55
+ required: false,
56
+ }),
57
+ pushUsers: pieces_framework_1.Property.ShortText({
58
+ displayName: 'Push to User IDs',
59
+ description: 'Send the link as a push notification to these user IDs instead of interests.',
60
+ required: false,
61
+ }),
62
+ },
63
+ async run({ auth, propsValue }) {
64
+ const body = { title: propsValue.title, agent: 'Activepieces' };
65
+ const options = (0, client_1.splitList)(propsValue.options);
66
+ if (options.length > 0)
67
+ body['options'] = options;
68
+ if (propsValue.details)
69
+ body['details'] = propsValue.details;
70
+ if (propsValue.expiresInMinutes)
71
+ body['expires_in_minutes'] = propsValue.expiresInMinutes;
72
+ if (propsValue.channel)
73
+ body['channel'] = propsValue.channel;
74
+ const interests = (0, client_1.splitList)(propsValue.pushInterests);
75
+ const users = (0, client_1.splitList)(propsValue.pushUsers);
76
+ if (interests.length > 0)
77
+ body['push_interests'] = interests;
78
+ if (users.length > 0)
79
+ body['push_users'] = users;
80
+ const created = await client_1.hibiraClient.channels(auth, { method: 'POST', path: '/approvals', body });
81
+ if (propsValue.waitForAnswer === false)
82
+ return created;
83
+ return (0, approvals_1.waitForApproval)(auth, created, propsValue.maxWaitMinutes ?? 5);
84
+ },
85
+ });
@@ -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,18 @@
1
+ import { HibiraAuthProps } from './client';
2
+ export type Approval = {
3
+ approval_id: string;
4
+ status: 'pending' | 'approved' | 'rejected' | 'expired';
5
+ url?: string;
6
+ [key: string]: unknown;
7
+ };
8
+ /** Longest wait a step may hold a flow (Activepieces stops steps after 10 minutes). */
9
+ export declare const MAX_WAIT_MINUTES = 9;
10
+ /**
11
+ * Long-polls an approval (25 s per request, no timers) until it is answered
12
+ * or expires, or maxWaitMinutes runs out. Keeps the answer link of the
13
+ * request in the result.
14
+ */
15
+ export declare function waitForApproval(auth: {
16
+ props: HibiraAuthProps;
17
+ } | HibiraAuthProps, approval: Approval, maxWaitMinutes: number): Promise<Approval>;
18
+ //# sourceMappingURL=approvals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,UAAU,CAAC;AAEzD,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE;IAAE,KAAK,EAAE,eAAe,CAAA;CAAE,GAAG,eAAe,EAClD,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,QAAQ,CAAC,CAgBnB"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_WAIT_MINUTES = void 0;
4
+ exports.waitForApproval = waitForApproval;
5
+ const client_1 = require("./client");
6
+ /** Longest wait a step may hold a flow (Activepieces stops steps after 10 minutes). */
7
+ exports.MAX_WAIT_MINUTES = 9;
8
+ /**
9
+ * Long-polls an approval (25 s per request, no timers) until it is answered
10
+ * or expires, or maxWaitMinutes runs out. Keeps the answer link of the
11
+ * request in the result.
12
+ */
13
+ async function waitForApproval(auth, approval, maxWaitMinutes) {
14
+ const minutes = Math.min(Math.max(maxWaitMinutes, 0), exports.MAX_WAIT_MINUTES);
15
+ const deadline = Date.now() + minutes * 60_000;
16
+ let current = approval;
17
+ while (current.status === 'pending') {
18
+ const left = Math.floor((deadline - Date.now()) / 1000);
19
+ if (left <= 0)
20
+ break;
21
+ const next = await client_1.hibiraClient.channels(auth, {
22
+ method: 'GET',
23
+ path: `/approvals/${encodeURIComponent(approval.approval_id)}`,
24
+ query: { wait: String(Math.min(25, left)) },
25
+ timeout: 40_000,
26
+ });
27
+ current = approval.url === undefined ? next : { ...next, url: approval.url };
28
+ }
29
+ return current;
30
+ }
@@ -13,11 +13,12 @@ type AuthValue = {
13
13
  export declare function splitList(value: string | string[] | undefined): string[];
14
14
  export declare const hibiraClient: {
15
15
  /** Signed request to the app's Channels HTTP API (/apps/{appId}{path}). */
16
- channels<T = Record<string, unknown>>(auth: AuthValue, { method, path, query, body, }: {
16
+ channels<T = Record<string, unknown>>(auth: AuthValue, { method, path, query, body, timeout, }: {
17
17
  method: "GET" | "POST" | "DELETE";
18
18
  path: string;
19
19
  query?: Record<string, string>;
20
20
  body?: unknown;
21
+ timeout?: number;
21
22
  }): Promise<T>;
22
23
  /** Request to the Beams-compatible push API, with {instance} filled in. */
23
24
  push<T = Record<string, unknown>>(auth: AuthValue, { method, path, body }: {
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,KAAK,EAAE,eAAe,CAAA;CAAE,GAAG,eAAe,CAAC;AAU9D,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAGxE;AAED,eAAO,MAAM,YAAY;IACvB,2EAA2E;aAC5D,CAAC,kCACR,SAAS,kCAMZ;QAAE,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GACrG,OAAO,CAAC,CAAC,CAAC;IAeb,2EAA2E;SAChE,CAAC,kCACJ,SAAS,0BACS;QAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAClF,OAAO,CAAC,CAAC,CAAC;CAad,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,KAAK,EAAE,eAAe,CAAA;CAAE,GAAG,eAAe,CAAC;AAU9D,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAGxE;AAED,eAAO,MAAM,YAAY;IACvB,2EAA2E;aAC5D,CAAC,kCACR,SAAS,2CAOZ;QACD,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;QAClC,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GACA,OAAO,CAAC,CAAC,CAAC;IAgBb,2EAA2E;SAChE,CAAC,kCACJ,SAAS,0BACS;QAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAClF,OAAO,CAAC,CAAC,CAAC;CAad,CAAC"}
@@ -17,7 +17,7 @@ function splitList(value) {
17
17
  }
18
18
  exports.hibiraClient = {
19
19
  /** Signed request to the app's Channels HTTP API (/apps/{appId}{path}). */
20
- async channels(auth, { method, path, query = {}, body, }) {
20
+ async channels(auth, { method, path, query = {}, body, timeout, }) {
21
21
  const a = props(auth);
22
22
  const fullPath = `/apps/${encodeURIComponent(a.appId)}${path}`;
23
23
  const raw = body === undefined ? undefined : JSON.stringify(body);
@@ -28,6 +28,7 @@ exports.hibiraClient = {
28
28
  queryParams,
29
29
  headers: raw === undefined ? {} : { 'Content-Type': 'application/json' },
30
30
  body: raw,
31
+ ...(timeout === undefined ? {} : { timeout }),
31
32
  });
32
33
  return response.body;
33
34
  },
@@ -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.1.1",
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",