Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@ export default {
key: "livekit-create-ingress-from-url",
name: "Create Ingress From URL",
description: "Create a new ingress from url in LiveKit. [See the documentation](https://docs.livekit.io/home/ingress/overview/#url-input-example).",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
name: {
type: "string",
label: "Ingress Name",
description: "The name of the ingress",
optional: true,
},
roomName: {
description: "The name of the room to send media to",
propDefinition: [
app,
"room",
],
},
url: {
type: "string",
label: "URL",
description: "URL of the media to pull for ingresses of type URL",
},
participantIdentity: {
type: "string",
label: "Participant Identity",
Expand All @@ -39,6 +38,12 @@ export default {
description: "Metadata to attach to the participant",
optional: true,
},
name: {
type: "string",
label: "Ingress Name",
description: "The name of the ingress",
optional: true,
},
bypassTranscoding: {
type: "boolean",
label: "Bypass Transcoding",
Expand All @@ -51,11 +56,6 @@ export default {
description: "Whether to enable transcoding or forward the input media directly. Transcoding is required for all input types except WHIP. For WHIP, the default is to not transcode.",
optional: true,
},
url: {
type: "string",
label: "URL",
description: "URL of the media to pull for ingresses of type URL",
},
},
async run({ $ }) {
const {
Expand Down
2 changes: 1 addition & 1 deletion components/livekit/actions/create-room/create-room.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "livekit-create-room",
name: "Create Room",
description: "Create a new room in LiveKit. [See the documentation](https://docs.livekit.io/home/server/managing-rooms/#create-a-room).",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
2 changes: 1 addition & 1 deletion components/livekit/actions/delete-room/delete-room.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "livekit-delete-room",
name: "Delete Room",
description: "Delete a room in LiveKit. [See the documentation](https://docs.livekit.io/home/server/managing-rooms/#delete-a-room)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
import app from "../../livekit.app.mjs";

export default {
key: "livekit-generate-access-token",
name: "Generate Access Token",
description: "Generate an access token for a participant to join a LiveKit room. [See the documentation](https://github.com/livekit/node-sdks/tree/main/packages/livekit-server-sdk).",
version: "0.0.1",
type: "action",
props: {
app,
room: {
description: "The name of the room to join",
optional: true,
propDefinition: [
app,
"room",
],
},
ttl: {
type: "integer",
label: "Token TTL (seconds)",
description: "How long the access token should be valid for (in seconds)",
optional: true,
},
name: {
type: "string",
label: "Participant Name",
description: "Display name for the participant",
optional: true,
},
identity: {
type: "string",
label: "Participant Identity",
description: "Unique identity for the participant joining the call",
},
metadata: {
type: "string",
label: "Participant Metadata",
description: "Optional metadata to attach to the participant",
optional: true,
},
canPublish: {
type: "boolean",
label: "Can Publish",
description: "Whether the participant can publish audio/video tracks",
optional: true,
},
canSubscribe: {
type: "boolean",
label: "Can Subscribe",
description: "Whether the participant can subscribe to other participants' tracks",
optional: true,
},
canPublishData: {
type: "boolean",
label: "Can Publish Data",
description: "Whether the participant can publish data messages",
optional: true,
},
hidden: {
type: "boolean",
label: "Hidden Participant",
description: "Whether the participant should be hidden from other participants",
optional: true,
},
roomCreate: {
type: "boolean",
label: "Room Create Permission",
description: "Permission to create rooms",
optional: true,
},
roomList: {
type: "boolean",
label: "Room List Permission",
description: "Permission to list rooms",
optional: true,
},
roomRecord: {
type: "boolean",
label: "Room Record Permission",
description: "Permission to start a recording",
optional: true,
},
roomAdmin: {
type: "boolean",
label: "Room Admin Permission",
description: "Permission to control the specific room",
optional: true,
},
ingressAdmin: {
type: "boolean",
label: "Ingress Admin Permission",
description: "Permission to control ingress, not specific to any room or ingress",
optional: true,
},
canUpdateOwnMetadata: {
type: "boolean",
label: "Can Update Own Metadata",
description: "Allow participant to update its own metadata",
optional: true,
},
recorder: {
type: "boolean",
label: "Recorder",
description: "Participant is recording the room, allows room to indicate it's being recorded",
optional: true,
},
agent: {
type: "boolean",
label: "Agent",
description: "Participant allowed to connect to LiveKit as Agent Framework worker",
optional: true,
},
canSubscribeMetrics: {
type: "boolean",
label: "Can Subscribe Metrics",
description: "Allow participant to subscribe to metrics",
optional: true,
},
destinationRoom: {
type: "string",
label: "Destination Room",
description: "Destination room which this participant can forward to",
optional: true,
},
createRoomIfNotExists: {
type: "boolean",
label: "Create Room If Not Exists",
description: "Whether to create the room if it doesn't exist",
optional: true,
},
},
async run({ $ }) {
const {
app,
ttl,
identity,
name,
metadata,
room,
createRoomIfNotExists,
canPublish,
canSubscribe,
canPublishData,
hidden,
roomCreate,
roomList,
roomRecord,
roomAdmin,
ingressAdmin,
canUpdateOwnMetadata,
recorder,
agent,
canSubscribeMetrics,
destinationRoom,
} = this;

// Create room if it doesn't exist and option is enabled
if (createRoomIfNotExists) {
await app.createRoom({
name: room,
});
}

// Create access token for the participant
const response = await app.createAccessToken({
identity,
name,
metadata,
ttl,
grant: {
roomJoin: true,
room,
roomCreate,
roomList,
roomRecord,
roomAdmin,
ingressAdmin,
canPublish,
canSubscribe,
canPublishData,
canUpdateOwnMetadata,
hidden,
recorder,
agent,
canSubscribeMetrics,
destinationRoom,
},
});

$.export("$summary", "Successfully generated access token for participant to join the call.");

return response;
},
};
2 changes: 1 addition & 1 deletion components/livekit/actions/list-rooms/list-rooms.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "livekit-list-rooms",
name: "List Rooms",
description: "List all rooms with LiveKit. [See the documentation](https://docs.livekit.io/home/server/managing-rooms/#list-rooms).",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import app from "../../livekit.app.mjs";

export default {
key: "livekit-remove-participants",
name: "Remove Participants",
description: "Remove specific participants from a LiveKit room. [See the documentation](https://github.com/livekit/node-sdks/tree/main/packages/livekit-server-sdk).",
version: "0.0.1",
type: "action",
props: {
app,
room: {
propDefinition: [
app,
"room",
],
},
identities: {
type: "string[]",
label: "Participant Identities",
description: "Identities of participants to remove from the room",
propDefinition: [
app,
"identity",
({ room }) => ({
room,
}),
],
},
},
async run({ $ }) {
const {
app,
room,
identities,
} = this;

const results = await Promise.all(
identities.map(async (identity) => {
await app.removeParticipant(room, identity);
return identity;
}),
);

$.export("$summary", `Successfully removed \`${identities.length}\` participant(s) from room: \`${room}\``);

return {
room,
removedParticipants: results,
};
},
};
7 changes: 0 additions & 7 deletions components/livekit/common/constants.mjs

This file was deleted.

Loading
Loading