@speckle/shared
Version:
Shared code between various Speckle JS packages
200 lines • 8.53 kB
TypeScript
/**
* Speckle role constants
* - Stream - user roles in the context of a specific stream
* - Server - user roles in the context of the entire server
*/
export declare const Roles: Readonly<{
readonly Stream: {
readonly Owner: "stream:owner";
readonly Contributor: "stream:contributor";
readonly Reviewer: "stream:reviewer";
};
readonly Workspace: {
readonly Admin: "workspace:admin";
readonly Member: "workspace:member";
readonly Guest: "workspace:guest";
};
readonly Server: {
readonly Admin: "server:admin";
readonly User: "server:user";
readonly Guest: "server:guest";
readonly ArchivedUser: "server:archived-user";
};
}>;
export declare const RoleInfo: Readonly<{
readonly Stream: {
readonly "stream:owner": {
readonly title: "Owner";
readonly description: "Can edit project, including settings, collaborators and all models";
readonly weight: 1000;
};
readonly "stream:contributor": {
readonly title: "Can edit";
readonly description: "Can publish and load models from connectors and view and comment in the web viewer";
readonly weight: 500;
};
readonly "stream:reviewer": {
readonly title: "Can view";
readonly description: "Can view and comment on models in the web viewer";
readonly weight: 100;
};
};
readonly Server: {
readonly "server:admin": {
readonly title: "Admin";
readonly description: "Can edit server, including settings, users and all projects";
readonly weight: 1000;
};
readonly "server:user": {
readonly title: "User";
readonly description: "Can create and own projects";
readonly weight: 100;
};
readonly "server:guest": {
readonly title: "Guest";
readonly description: "Can contribute to projects they're invited to";
readonly weight: 50;
};
readonly "server:archived-user": {
readonly title: "Archived";
readonly description: "Can no longer access server";
readonly weight: 10;
};
};
readonly Workspace: {
readonly "workspace:admin": {
readonly title: "Admin";
readonly description: "Can edit workspace, including settings, members and all projects";
readonly weight: 1000;
};
readonly "workspace:member": {
readonly title: "Member";
readonly description: "Can create and own projects";
readonly weight: 100;
};
readonly "workspace:guest": {
readonly title: "Guest";
readonly description: "Can contribute to projects they're invited to";
readonly weight: 50;
};
};
}>;
export type ServerRoles = (typeof Roles)['Server'][keyof (typeof Roles)['Server']];
export type WorkspaceRoles = (typeof Roles)['Workspace'][keyof (typeof Roles)['Workspace']];
export type StreamRoles = (typeof Roles)['Stream'][keyof (typeof Roles)['Stream']];
export type AvailableRoles = ServerRoles | StreamRoles | WorkspaceRoles;
/**
* Workspace seat type constants
*/
export declare const SeatTypes: Readonly<{
readonly Editor: "editor";
readonly Viewer: "viewer";
}>;
export type WorkspaceSeatType = (typeof SeatTypes)[keyof typeof SeatTypes];
/**
* Speckle scope constants
* - Scopes define what kind of access has a user approved for a specific access token
*/
export declare const Scopes: Readonly<{
readonly Streams: {
readonly Read: "streams:read";
readonly Write: "streams:write";
};
readonly Profile: {
readonly Read: "profile:read";
readonly Write: "profile:write";
readonly Email: "profile:email";
readonly Delete: "profile:delete";
};
readonly Users: {
readonly Read: "users:read";
readonly Email: "users:email";
readonly Invite: "users:invite";
};
readonly Server: {
readonly Stats: "server:stats";
readonly Setup: "server:setup";
};
readonly Tokens: {
readonly Read: "tokens:read";
readonly Write: "tokens:write";
};
readonly Apps: {
readonly Read: "apps:read";
readonly Write: "apps:write";
};
readonly Automate: {
readonly ReportResults: "automate:report-results";
};
readonly AutomateFunctions: {
readonly Read: "automate-functions:read";
readonly Write: "automate-functions:write";
};
readonly Workspaces: {
readonly Create: "workspace:create";
readonly Read: "workspace:read";
readonly Update: "workspace:update";
readonly Delete: "workspace:delete";
};
readonly Gatekeeper: {
readonly WorkspaceBilling: "workspace:billing";
};
}>;
export type StreamScopes = (typeof Scopes)['Streams'][keyof (typeof Scopes)['Streams']];
export type ProfileScopes = (typeof Scopes)['Profile'][keyof (typeof Scopes)['Profile']];
export type UserScopes = (typeof Scopes)['Users'][keyof (typeof Scopes)['Users']];
export type ServerScopes = (typeof Scopes)['Server'][keyof (typeof Scopes)['Server']];
export type TokenScopes = (typeof Scopes)['Tokens'][keyof (typeof Scopes)['Tokens']];
export type AppScopes = (typeof Scopes)['Apps'][keyof (typeof Scopes)['Apps']];
export type AutomateScopes = (typeof Scopes)['Automate'][keyof (typeof Scopes)['Automate']];
export type AutomateFunctionScopes = (typeof Scopes)['AutomateFunctions'][keyof (typeof Scopes)['AutomateFunctions']];
export type WorkspaceScopes = (typeof Scopes)['Workspaces'][keyof (typeof Scopes)['Workspaces']];
export type GatekeeperScopes = (typeof Scopes)['Gatekeeper'][keyof (typeof Scopes)['Gatekeeper']];
export type AvailableScopes = StreamScopes | ProfileScopes | UserScopes | ServerScopes | TokenScopes | AppScopes | AutomateScopes | AutomateFunctionScopes | WorkspaceScopes;
/**
* All scopes
*/
export declare const AllScopes: ("streams:read" | "streams:write" | "profile:read" | "profile:write" | "profile:email" | "profile:delete" | "users:read" | "users:email" | "users:invite" | "server:stats" | "server:setup" | "tokens:read" | "tokens:write" | "apps:read" | "apps:write" | "automate:report-results" | "automate-functions:read" | "automate-functions:write" | "workspace:create" | "workspace:read" | "workspace:update" | "workspace:delete" | "workspace:billing")[];
export type ServerScope = (typeof AllScopes)[number];
export declare const isScope: (scope: unknown) => scope is ServerScope;
export declare const SourceAppNames: readonly ["Advance Steel", "Dynamo", "Revit", "AutoCAD", "Civil3D", "Blender", "Rhino", "Grasshopper", "GSA", "Excel", "Unity", "Unreal", "Python", ".NET", "IFC", "QGIS", "ArcGIS", "ETABS", "PowerBI", "SketchUp", "SAP2000", "CSiBridge", "SAFE", "Archicad", "Tekla Structures", "OpenRoads", "OpenRail", "OpenBuildings", "MicroStation", "Navisworks", "Speckle Automate", "TopSolid", "File Import", "Acc integration"];
export type SourceAppName = (typeof SourceAppNames)[number];
export type SourceAppDefinition = {
/**
* String to look for in input app names to match them to a specific source app
* this is an eqiuvalent of the connector slug
*/
searchKey: string;
/**
* Full name
*/
name: SourceAppName;
/**
* Shortened name
*/
short: string;
/**
* BG color hex code for badges
*/
bgColor: string;
};
export declare const SourceApps: SourceAppDefinition[];
export declare const WebhookTriggers: Readonly<{
readonly StreamUpdate: "stream_update";
readonly StreamDelete: "stream_delete";
readonly BranchCreate: "branch_create";
readonly BranchUpdate: "branch_update";
readonly BranchDelete: "branch_delete";
readonly CommitCreate: "commit_create";
readonly CommitUpdate: "commit_update";
readonly CommitReceive: "commit_receive";
readonly CommitDelete: "commit_delete";
readonly CommentCreated: "comment_created";
readonly CommentArchived: "comment_archived";
readonly CommentReplied: "comment_replied";
readonly StreamPermissionsAdd: "stream_permissions_add";
readonly StreamPermissionsRemove: "stream_permissions_remove";
}>;
export declare const blockedDomains: string[];
export declare const blockedSlugs: string[];
//# sourceMappingURL=constants.d.ts.map