2022-07-28 17:18:51 +00:00
|
|
|
import { FieldError } from "api/errors"
|
2022-05-12 15:01:28 +00:00
|
|
|
import * as Types from "../api/types"
|
|
|
|
import * as TypesGen from "../api/typesGenerated"
|
|
|
|
|
2022-09-01 19:58:23 +00:00
|
|
|
export const MockTemplateDAUResponse: TypesGen.TemplateDAUsResponse = {
|
|
|
|
entries: [
|
|
|
|
{ date: "2022-08-27T00:00:00Z", amount: 1 },
|
|
|
|
{ date: "2022-08-29T00:00:00Z", amount: 2 },
|
|
|
|
{ date: "2022-08-30T00:00:00Z", amount: 1 },
|
|
|
|
],
|
|
|
|
}
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockSessionToken: TypesGen.LoginWithPasswordResponse = {
|
|
|
|
session_token: "my-session-token",
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockAPIKey: TypesGen.GenerateAPIKeyResponse = {
|
|
|
|
key: "my-api-key",
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockBuildInfo: TypesGen.BuildInfoResponse = {
|
2022-04-07 17:18:58 +00:00
|
|
|
external_url: "file:///mock-url",
|
|
|
|
version: "v99.999.9999+c9cdf14",
|
|
|
|
}
|
|
|
|
|
2022-08-16 15:39:42 +00:00
|
|
|
export const MockOwnerRole: TypesGen.Role = {
|
|
|
|
name: "owner",
|
|
|
|
display_name: "Owner",
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockUserAdminRole: TypesGen.Role = {
|
|
|
|
name: "user_admin",
|
|
|
|
display_name: "User Admin",
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockTemplateAdminRole: TypesGen.Role = {
|
|
|
|
name: "template_admin",
|
|
|
|
display_name: "Template Admin",
|
2022-05-10 19:13:07 +00:00
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockMemberRole: TypesGen.Role = {
|
2022-05-10 19:13:07 +00:00
|
|
|
name: "member",
|
|
|
|
display_name: "Member",
|
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockAuditorRole: TypesGen.Role = {
|
2022-05-10 19:13:07 +00:00
|
|
|
name: "auditor",
|
|
|
|
display_name: "Auditor",
|
|
|
|
}
|
|
|
|
|
2022-08-16 15:39:42 +00:00
|
|
|
export const MockSiteRoles = [MockUserAdminRole, MockAuditorRole]
|
|
|
|
|
|
|
|
// assignableRole takes a role and a boolean. The boolean implies if the
|
|
|
|
// actor can assign (add/remove) the role from other users.
|
2022-10-10 17:33:35 +00:00
|
|
|
export function assignableRole(
|
|
|
|
role: TypesGen.Role,
|
|
|
|
assignable: boolean,
|
|
|
|
): TypesGen.AssignableRoles {
|
2022-08-16 15:39:42 +00:00
|
|
|
return {
|
|
|
|
...role,
|
|
|
|
assignable: assignable,
|
|
|
|
}
|
|
|
|
}
|
2022-05-10 19:13:07 +00:00
|
|
|
|
2022-08-25 23:20:31 +00:00
|
|
|
export const MockMemberPermissions = {
|
|
|
|
viewAuditLog: false,
|
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockUser: TypesGen.User = {
|
2022-03-23 14:09:43 +00:00
|
|
|
id: "test-user",
|
2022-01-26 00:36:26 +00:00
|
|
|
username: "TestUser",
|
|
|
|
email: "test@coder.com",
|
|
|
|
created_at: "",
|
2022-04-28 20:32:23 +00:00
|
|
|
status: "active",
|
|
|
|
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
|
2022-08-16 15:39:42 +00:00
|
|
|
roles: [MockOwnerRole],
|
2022-09-04 16:44:27 +00:00
|
|
|
avatar_url: "https://github.com/coder.png",
|
2022-09-26 15:31:03 +00:00
|
|
|
last_seen_at: "",
|
2022-01-26 00:36:26 +00:00
|
|
|
}
|
|
|
|
|
2022-08-23 20:19:26 +00:00
|
|
|
export const MockUserAdmin: TypesGen.User = {
|
|
|
|
id: "test-user",
|
|
|
|
username: "TestUser",
|
|
|
|
email: "test@coder.com",
|
|
|
|
created_at: "",
|
|
|
|
status: "active",
|
|
|
|
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
|
|
|
|
roles: [MockUserAdminRole],
|
2022-09-04 16:44:27 +00:00
|
|
|
avatar_url: "",
|
2022-09-26 15:31:03 +00:00
|
|
|
last_seen_at: "",
|
2022-08-23 20:19:26 +00:00
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockUser2: TypesGen.User = {
|
2022-04-14 17:57:55 +00:00
|
|
|
id: "test-user-2",
|
|
|
|
username: "TestUser2",
|
|
|
|
email: "test2@coder.com",
|
|
|
|
created_at: "",
|
2022-04-28 20:32:23 +00:00
|
|
|
status: "active",
|
|
|
|
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
|
2022-06-02 13:46:06 +00:00
|
|
|
roles: [],
|
2022-09-04 16:44:27 +00:00
|
|
|
avatar_url: "",
|
2022-09-26 15:31:03 +00:00
|
|
|
last_seen_at: "2022-09-14T19:12:21Z",
|
2022-04-14 17:57:55 +00:00
|
|
|
}
|
|
|
|
|
2022-06-15 17:29:38 +00:00
|
|
|
export const SuspendedMockUser: TypesGen.User = {
|
|
|
|
id: "suspended-mock-user",
|
|
|
|
username: "SuspendedMockUser",
|
|
|
|
email: "iamsuspendedsad!@coder.com",
|
|
|
|
created_at: "",
|
|
|
|
status: "suspended",
|
|
|
|
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
|
|
|
|
roles: [],
|
2022-09-04 16:44:27 +00:00
|
|
|
avatar_url: "",
|
2022-09-26 15:31:03 +00:00
|
|
|
last_seen_at: "",
|
2022-06-15 17:29:38 +00:00
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockOrganization: TypesGen.Organization = {
|
2022-03-23 14:09:43 +00:00
|
|
|
id: "test-org",
|
|
|
|
name: "Test Organization",
|
2022-01-26 00:36:26 +00:00
|
|
|
created_at: "",
|
|
|
|
updated_at: "",
|
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockProvisioner: TypesGen.ProvisionerDaemon = {
|
|
|
|
created_at: "",
|
2022-01-26 00:36:26 +00:00
|
|
|
id: "test-provisioner",
|
|
|
|
name: "Test Provisioner",
|
2022-05-19 18:04:44 +00:00
|
|
|
provisioners: ["echo"],
|
2022-05-12 15:01:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const MockProvisionerJob: TypesGen.ProvisionerJob = {
|
|
|
|
created_at: "",
|
|
|
|
id: "test-provisioner-job",
|
|
|
|
status: "succeeded",
|
2022-06-15 17:42:43 +00:00
|
|
|
storage_source: "asdf",
|
2022-08-09 14:07:01 +00:00
|
|
|
completed_at: "2022-05-17T17:39:01.382927298Z",
|
2022-01-26 00:36:26 +00:00
|
|
|
}
|
2022-06-15 17:42:43 +00:00
|
|
|
|
2022-05-31 15:16:15 +00:00
|
|
|
export const MockFailedProvisionerJob: TypesGen.ProvisionerJob = {
|
|
|
|
...MockProvisionerJob,
|
|
|
|
status: "failed",
|
|
|
|
}
|
2022-09-06 17:07:00 +00:00
|
|
|
|
2022-05-31 15:16:15 +00:00
|
|
|
export const MockCancelingProvisionerJob: TypesGen.ProvisionerJob = {
|
|
|
|
...MockProvisionerJob,
|
|
|
|
status: "canceling",
|
|
|
|
}
|
|
|
|
export const MockCanceledProvisionerJob: TypesGen.ProvisionerJob = {
|
2022-05-16 16:34:22 +00:00
|
|
|
...MockProvisionerJob,
|
2022-05-31 15:16:15 +00:00
|
|
|
status: "canceled",
|
2022-05-16 16:34:22 +00:00
|
|
|
}
|
2022-05-31 15:16:15 +00:00
|
|
|
export const MockRunningProvisionerJob: TypesGen.ProvisionerJob = {
|
2022-05-24 00:04:38 +00:00
|
|
|
...MockProvisionerJob,
|
2022-05-31 15:16:15 +00:00
|
|
|
status: "running",
|
2022-05-24 00:04:38 +00:00
|
|
|
}
|
2022-07-22 19:18:52 +00:00
|
|
|
export const MockPendingProvisionerJob: TypesGen.ProvisionerJob = {
|
|
|
|
...MockProvisionerJob,
|
|
|
|
status: "pending",
|
|
|
|
}
|
2022-05-19 20:51:10 +00:00
|
|
|
export const MockTemplateVersion: TypesGen.TemplateVersion = {
|
|
|
|
id: "test-template-version",
|
2022-07-15 22:25:47 +00:00
|
|
|
created_at: "2022-05-17T17:39:01.382927298Z",
|
|
|
|
updated_at: "2022-05-17T17:39:01.382927298Z",
|
|
|
|
template_id: "test-template",
|
2022-05-19 20:51:10 +00:00
|
|
|
job: MockProvisionerJob,
|
|
|
|
name: "test-version",
|
2022-05-27 15:19:32 +00:00
|
|
|
readme: `---
|
|
|
|
name:Template test
|
|
|
|
---
|
|
|
|
## Instructions
|
|
|
|
You can add instructions here
|
|
|
|
|
|
|
|
[Some link info](https://coder.com)`,
|
2022-07-15 21:12:39 +00:00
|
|
|
created_by_id: "test-creator-id",
|
|
|
|
created_by_name: "test_creator",
|
2022-05-19 20:51:10 +00:00
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockTemplate: TypesGen.Template = {
|
2022-04-06 17:42:40 +00:00
|
|
|
id: "test-template",
|
2022-05-19 15:36:14 +00:00
|
|
|
created_at: "2022-05-17T17:39:01.382927298Z",
|
|
|
|
updated_at: "2022-05-18T17:39:01.382927298Z",
|
2022-03-23 14:09:43 +00:00
|
|
|
organization_id: MockOrganization.id,
|
2022-08-18 19:58:01 +00:00
|
|
|
name: "test-template",
|
2022-05-19 18:04:44 +00:00
|
|
|
provisioner: MockProvisioner.provisioners[0],
|
2022-05-19 20:51:10 +00:00
|
|
|
active_version_id: MockTemplateVersion.id,
|
2022-09-09 19:30:31 +00:00
|
|
|
workspace_owner_count: 2,
|
|
|
|
active_user_count: 1,
|
2022-05-16 20:56:11 +00:00
|
|
|
description: "This is a test description.",
|
2022-08-18 22:32:23 +00:00
|
|
|
max_ttl_ms: 24 * 60 * 60 * 1000,
|
|
|
|
min_autostart_interval_ms: 60 * 60 * 1000,
|
2022-06-10 19:24:21 +00:00
|
|
|
created_by_id: "test-creator-id",
|
|
|
|
created_by_name: "test_creator",
|
2022-08-19 13:17:35 +00:00
|
|
|
icon: "/icon/code.svg",
|
2022-01-26 00:36:26 +00:00
|
|
|
}
|
2022-01-26 03:50:31 +00:00
|
|
|
|
2022-10-03 21:01:13 +00:00
|
|
|
export const MockWorkspaceApp: TypesGen.WorkspaceApp = {
|
|
|
|
id: "test-app",
|
|
|
|
name: "test-app",
|
|
|
|
icon: "",
|
2022-10-05 19:23:01 +00:00
|
|
|
subdomain: false,
|
2022-10-03 21:01:13 +00:00
|
|
|
health: "disabled",
|
|
|
|
healthcheck: {
|
|
|
|
url: "",
|
|
|
|
interval: 0,
|
|
|
|
threshold: 0,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockWorkspaceAgent: TypesGen.WorkspaceAgent = {
|
|
|
|
apps: [MockWorkspaceApp],
|
|
|
|
architecture: "amd64",
|
|
|
|
created_at: "",
|
|
|
|
environment_variables: {},
|
|
|
|
id: "test-workspace-agent",
|
|
|
|
name: "a-workspace-agent",
|
|
|
|
operating_system: "linux",
|
|
|
|
resource_id: "",
|
|
|
|
status: "connected",
|
|
|
|
updated_at: "",
|
|
|
|
version: MockBuildInfo.version,
|
|
|
|
latency: {
|
|
|
|
"Coder Embedded DERP": {
|
|
|
|
latency_ms: 32.55,
|
|
|
|
preferred: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockWorkspaceAgentDisconnected: TypesGen.WorkspaceAgent = {
|
|
|
|
...MockWorkspaceAgent,
|
|
|
|
id: "test-workspace-agent-2",
|
|
|
|
name: "another-workspace-agent",
|
|
|
|
status: "disconnected",
|
|
|
|
version: "",
|
|
|
|
latency: {},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockWorkspaceAgentOutdated: TypesGen.WorkspaceAgent = {
|
|
|
|
...MockWorkspaceAgent,
|
|
|
|
id: "test-workspace-agent-3",
|
|
|
|
name: "an-outdated-workspace-agent",
|
|
|
|
version: "v99.999.9998+abcdef",
|
|
|
|
operating_system: "Windows",
|
|
|
|
latency: {
|
|
|
|
...MockWorkspaceAgent.latency,
|
|
|
|
Chicago: {
|
|
|
|
preferred: false,
|
|
|
|
latency_ms: 95.11,
|
|
|
|
},
|
|
|
|
"San Francisco": {
|
|
|
|
preferred: false,
|
|
|
|
latency_ms: 111.55,
|
|
|
|
},
|
|
|
|
Paris: {
|
|
|
|
preferred: false,
|
|
|
|
latency_ms: 221.66,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockWorkspaceAgentConnecting: TypesGen.WorkspaceAgent = {
|
|
|
|
...MockWorkspaceAgent,
|
|
|
|
id: "test-workspace-agent-connecting",
|
|
|
|
name: "another-workspace-agent",
|
|
|
|
status: "connecting",
|
|
|
|
version: "",
|
|
|
|
latency: {},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockWorkspaceResource: TypesGen.WorkspaceResource = {
|
2022-10-10 17:33:35 +00:00
|
|
|
agents: [
|
|
|
|
MockWorkspaceAgent,
|
|
|
|
MockWorkspaceAgentConnecting,
|
|
|
|
MockWorkspaceAgentOutdated,
|
|
|
|
],
|
2022-10-03 21:01:13 +00:00
|
|
|
created_at: "",
|
|
|
|
id: "test-workspace-resource",
|
|
|
|
job_id: "",
|
|
|
|
name: "a-workspace-resource",
|
|
|
|
type: "google_compute_disk",
|
|
|
|
workspace_transition: "start",
|
|
|
|
hide: false,
|
|
|
|
icon: "",
|
|
|
|
metadata: [
|
|
|
|
{ key: "type", value: "a-workspace-resource", sensitive: false },
|
|
|
|
{ key: "api_key", value: "12345678", sensitive: true },
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockWorkspaceResource2: TypesGen.WorkspaceResource = {
|
2022-10-10 17:33:35 +00:00
|
|
|
agents: [
|
|
|
|
MockWorkspaceAgent,
|
|
|
|
MockWorkspaceAgentDisconnected,
|
|
|
|
MockWorkspaceAgentOutdated,
|
|
|
|
],
|
2022-10-03 21:01:13 +00:00
|
|
|
created_at: "",
|
|
|
|
id: "test-workspace-resource-2",
|
|
|
|
job_id: "",
|
|
|
|
name: "another-workspace-resource",
|
|
|
|
type: "google_compute_disk",
|
|
|
|
workspace_transition: "start",
|
|
|
|
hide: false,
|
|
|
|
icon: "",
|
|
|
|
metadata: [
|
|
|
|
{ key: "type", value: "google_compute_disk", sensitive: false },
|
|
|
|
{ key: "size", value: "32GB", sensitive: false },
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockWorkspaceResource3: TypesGen.WorkspaceResource = {
|
2022-10-10 17:33:35 +00:00
|
|
|
agents: [
|
|
|
|
MockWorkspaceAgent,
|
|
|
|
MockWorkspaceAgentDisconnected,
|
|
|
|
MockWorkspaceAgentOutdated,
|
|
|
|
],
|
2022-10-03 21:01:13 +00:00
|
|
|
created_at: "",
|
|
|
|
id: "test-workspace-resource-3",
|
|
|
|
job_id: "",
|
|
|
|
name: "another-workspace-resource",
|
|
|
|
type: "google_compute_disk",
|
|
|
|
workspace_transition: "start",
|
|
|
|
hide: true,
|
|
|
|
icon: "",
|
|
|
|
metadata: [
|
|
|
|
{ key: "type", value: "google_compute_disk", sensitive: false },
|
|
|
|
{ key: "size", value: "32GB", sensitive: false },
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2022-10-10 17:33:35 +00:00
|
|
|
export const MockWorkspaceAutostartDisabled: TypesGen.UpdateWorkspaceAutostartRequest =
|
|
|
|
{
|
|
|
|
schedule: "",
|
|
|
|
}
|
2022-04-14 00:35:47 +00:00
|
|
|
|
2022-10-10 17:33:35 +00:00
|
|
|
export const MockWorkspaceAutostartEnabled: TypesGen.UpdateWorkspaceAutostartRequest =
|
|
|
|
{
|
|
|
|
// Runs at 9:30am Monday through Friday using Canada/Eastern
|
|
|
|
// (America/Toronto) time
|
|
|
|
schedule: "CRON_TZ=Canada/Eastern 30 9 * * 1-5",
|
|
|
|
}
|
2022-04-14 00:35:47 +00:00
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockWorkspaceBuild: TypesGen.WorkspaceBuild = {
|
2022-05-18 16:33:33 +00:00
|
|
|
build_number: 1,
|
2022-05-19 15:36:14 +00:00
|
|
|
created_at: "2022-05-17T17:39:01.382927298Z",
|
2022-05-18 13:54:06 +00:00
|
|
|
id: "1",
|
2022-06-17 17:41:11 +00:00
|
|
|
initiator_id: MockUser.id,
|
|
|
|
initiator_name: MockUser.username,
|
2022-05-12 15:01:28 +00:00
|
|
|
job: MockProvisionerJob,
|
|
|
|
template_version_id: "",
|
|
|
|
transition: "start",
|
2022-05-18 13:54:06 +00:00
|
|
|
updated_at: "2022-05-17T17:39:01.382927298Z",
|
2022-06-01 23:49:43 +00:00
|
|
|
workspace_name: "test-workspace",
|
2022-06-07 14:28:47 +00:00
|
|
|
workspace_owner_id: MockUser.id,
|
|
|
|
workspace_owner_name: MockUser.username,
|
2022-06-01 23:49:43 +00:00
|
|
|
workspace_id: "759f1d46-3174-453d-aa60-980a9c1442f3",
|
2022-05-26 17:08:11 +00:00
|
|
|
deadline: "2022-05-17T23:39:00.00Z",
|
2022-06-17 17:41:11 +00:00
|
|
|
reason: "initiator",
|
2022-10-03 21:01:13 +00:00
|
|
|
resources: [MockWorkspaceResource],
|
2022-10-03 16:43:11 +00:00
|
|
|
status: "running",
|
2022-05-12 15:01:28 +00:00
|
|
|
}
|
|
|
|
|
2022-09-06 17:07:00 +00:00
|
|
|
export const MockFailedWorkspaceBuild = (
|
|
|
|
transition: TypesGen.WorkspaceTransition = "start",
|
|
|
|
): TypesGen.WorkspaceBuild => ({
|
|
|
|
build_number: 1,
|
|
|
|
created_at: "2022-05-17T17:39:01.382927298Z",
|
|
|
|
id: "1",
|
|
|
|
initiator_id: MockUser.id,
|
|
|
|
initiator_name: MockUser.username,
|
|
|
|
job: MockFailedProvisionerJob,
|
|
|
|
template_version_id: "",
|
|
|
|
transition: transition,
|
|
|
|
updated_at: "2022-05-17T17:39:01.382927298Z",
|
|
|
|
workspace_name: "test-workspace",
|
|
|
|
workspace_owner_id: MockUser.id,
|
|
|
|
workspace_owner_name: MockUser.username,
|
|
|
|
workspace_id: "759f1d46-3174-453d-aa60-980a9c1442f3",
|
|
|
|
deadline: "2022-05-17T23:39:00.00Z",
|
|
|
|
reason: "initiator",
|
2022-09-16 18:54:23 +00:00
|
|
|
resources: [],
|
2022-10-03 16:43:11 +00:00
|
|
|
status: "running",
|
2022-09-06 17:07:00 +00:00
|
|
|
})
|
|
|
|
|
2022-05-19 18:04:44 +00:00
|
|
|
export const MockWorkspaceBuildStop: TypesGen.WorkspaceBuild = {
|
2022-05-16 16:34:22 +00:00
|
|
|
...MockWorkspaceBuild,
|
2022-05-18 13:54:06 +00:00
|
|
|
id: "2",
|
2022-05-16 16:34:22 +00:00
|
|
|
transition: "stop",
|
|
|
|
}
|
|
|
|
|
2022-05-19 18:04:44 +00:00
|
|
|
export const MockWorkspaceBuildDelete: TypesGen.WorkspaceBuild = {
|
2022-05-16 16:34:22 +00:00
|
|
|
...MockWorkspaceBuild,
|
2022-05-18 13:54:06 +00:00
|
|
|
id: "3",
|
2022-05-16 16:34:22 +00:00
|
|
|
transition: "delete",
|
|
|
|
}
|
|
|
|
|
2022-10-10 17:33:35 +00:00
|
|
|
export const MockBuilds = [
|
|
|
|
MockWorkspaceBuild,
|
|
|
|
MockWorkspaceBuildStop,
|
|
|
|
MockWorkspaceBuildDelete,
|
|
|
|
]
|
2022-05-18 13:54:06 +00:00
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockWorkspace: TypesGen.Workspace = {
|
2022-01-26 03:50:31 +00:00
|
|
|
id: "test-workspace",
|
|
|
|
name: "Test-Workspace",
|
|
|
|
created_at: "",
|
|
|
|
updated_at: "",
|
2022-04-06 17:42:40 +00:00
|
|
|
template_id: MockTemplate.id,
|
2022-05-12 15:01:28 +00:00
|
|
|
template_name: MockTemplate.name,
|
2022-08-22 14:42:11 +00:00
|
|
|
template_icon: MockTemplate.icon,
|
2022-05-12 15:01:28 +00:00
|
|
|
outdated: false,
|
2022-03-23 14:09:43 +00:00
|
|
|
owner_id: MockUser.id,
|
2022-05-14 01:41:21 +00:00
|
|
|
owner_name: MockUser.username,
|
2022-04-14 00:35:47 +00:00
|
|
|
autostart_schedule: MockWorkspaceAutostartEnabled.schedule,
|
2022-06-02 10:23:34 +00:00
|
|
|
ttl_ms: 2 * 60 * 60 * 1000, // 2 hours as milliseconds
|
2022-05-12 15:01:28 +00:00
|
|
|
latest_build: MockWorkspaceBuild,
|
2022-09-02 00:08:51 +00:00
|
|
|
last_used_at: "",
|
2022-04-29 22:30:10 +00:00
|
|
|
}
|
|
|
|
|
2022-05-31 19:50:03 +00:00
|
|
|
export const MockStoppedWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-10-05 20:20:29 +00:00
|
|
|
latest_build: { ...MockWorkspaceBuildStop, status: "stopped" },
|
2022-05-31 19:50:03 +00:00
|
|
|
}
|
2022-05-16 16:34:22 +00:00
|
|
|
export const MockStoppingWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-05-31 19:50:03 +00:00
|
|
|
latest_build: {
|
|
|
|
...MockWorkspaceBuildStop,
|
|
|
|
job: MockRunningProvisionerJob,
|
2022-10-05 20:20:29 +00:00
|
|
|
status: "stopping",
|
2022-05-31 19:50:03 +00:00
|
|
|
},
|
2022-05-16 16:34:22 +00:00
|
|
|
}
|
|
|
|
export const MockStartingWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-05-31 19:50:03 +00:00
|
|
|
latest_build: {
|
|
|
|
...MockWorkspaceBuild,
|
|
|
|
job: MockRunningProvisionerJob,
|
|
|
|
transition: "start",
|
2022-10-05 20:20:29 +00:00
|
|
|
status: "starting",
|
2022-05-31 19:50:03 +00:00
|
|
|
},
|
2022-05-16 16:34:22 +00:00
|
|
|
}
|
|
|
|
export const MockCancelingWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-10-10 17:33:35 +00:00
|
|
|
latest_build: {
|
|
|
|
...MockWorkspaceBuild,
|
|
|
|
job: MockCancelingProvisionerJob,
|
|
|
|
status: "canceling",
|
|
|
|
},
|
2022-05-16 16:34:22 +00:00
|
|
|
}
|
2022-05-24 00:04:38 +00:00
|
|
|
export const MockCanceledWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-10-10 17:33:35 +00:00
|
|
|
latest_build: {
|
|
|
|
...MockWorkspaceBuild,
|
|
|
|
job: MockCanceledProvisionerJob,
|
|
|
|
status: "canceled",
|
|
|
|
},
|
2022-05-24 00:04:38 +00:00
|
|
|
}
|
2022-05-16 16:34:22 +00:00
|
|
|
export const MockFailedWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-05-31 19:50:03 +00:00
|
|
|
latest_build: {
|
|
|
|
...MockWorkspaceBuild,
|
|
|
|
job: MockFailedProvisionerJob,
|
2022-10-05 20:20:29 +00:00
|
|
|
status: "failed",
|
2022-05-31 19:50:03 +00:00
|
|
|
},
|
2022-05-16 16:34:22 +00:00
|
|
|
}
|
|
|
|
export const MockDeletingWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-10-10 17:33:35 +00:00
|
|
|
latest_build: {
|
|
|
|
...MockWorkspaceBuildDelete,
|
|
|
|
job: MockRunningProvisionerJob,
|
|
|
|
status: "deleting",
|
|
|
|
},
|
2022-05-16 16:34:22 +00:00
|
|
|
}
|
2022-06-27 14:53:44 +00:00
|
|
|
export const MockDeletedWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockWorkspace,
|
2022-10-05 20:20:29 +00:00
|
|
|
latest_build: { ...MockWorkspaceBuildDelete, status: "deleted" },
|
2022-06-27 14:53:44 +00:00
|
|
|
}
|
2022-05-16 16:34:22 +00:00
|
|
|
|
2022-10-10 17:33:35 +00:00
|
|
|
export const MockOutdatedWorkspace: TypesGen.Workspace = {
|
|
|
|
...MockFailedWorkspace,
|
|
|
|
outdated: true,
|
|
|
|
}
|
2022-05-16 16:34:22 +00:00
|
|
|
|
2022-10-05 20:20:29 +00:00
|
|
|
export const MockPendingWorkspace: TypesGen.Workspace = {
|
2022-07-22 19:18:52 +00:00
|
|
|
...MockWorkspace,
|
|
|
|
latest_build: {
|
|
|
|
...MockWorkspaceBuild,
|
|
|
|
job: MockPendingProvisionerJob,
|
|
|
|
transition: "start",
|
2022-10-05 20:20:29 +00:00
|
|
|
status: "pending",
|
2022-07-22 19:18:52 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2022-09-29 18:32:38 +00:00
|
|
|
// requests the MockWorkspace
|
|
|
|
export const MockWorkspaceRequest: TypesGen.CreateWorkspaceRequest = {
|
|
|
|
name: "test",
|
|
|
|
parameter_values: [],
|
|
|
|
template_id: "test-template",
|
|
|
|
}
|
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockUserAgent: Types.UserAgent = {
|
2022-03-23 14:28:34 +00:00
|
|
|
browser: "Chrome 99.0.4844",
|
|
|
|
device: "Other",
|
|
|
|
ip_address: "11.22.33.44",
|
|
|
|
os: "Windows 10",
|
|
|
|
}
|
2022-04-23 22:58:57 +00:00
|
|
|
|
2022-05-12 15:01:28 +00:00
|
|
|
export const MockAuthMethods: TypesGen.AuthMethods = {
|
2022-04-23 22:58:57 +00:00
|
|
|
password: true,
|
|
|
|
github: false,
|
2022-08-01 04:05:35 +00:00
|
|
|
oidc: false,
|
2022-04-23 22:58:57 +00:00
|
|
|
}
|
2022-05-16 17:15:45 +00:00
|
|
|
|
|
|
|
export const MockGitSSHKey: TypesGen.GitSSHKey = {
|
|
|
|
user_id: "1fa0200f-7331-4524-a364-35770666caa7",
|
|
|
|
created_at: "2022-05-16T14:30:34.148205897Z",
|
|
|
|
updated_at: "2022-05-16T15:29:10.302441433Z",
|
2022-10-10 17:33:35 +00:00
|
|
|
public_key:
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFJOQRIM7kE30rOzrfy+/+R+nQGCk7S9pioihy+2ARbq",
|
2022-05-16 17:15:45 +00:00
|
|
|
}
|
2022-05-19 20:34:42 +00:00
|
|
|
|
|
|
|
export const MockWorkspaceBuildLogs: TypesGen.ProvisionerJobLog[] = [
|
|
|
|
{
|
|
|
|
id: "836f8ab6-5202-4711-afa5-293394ced011",
|
|
|
|
created_at: "2022-05-19T16:45:31.005Z",
|
|
|
|
log_source: "provisioner_daemon",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Setting up",
|
|
|
|
output: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "2db0ae92-b310-4a6e-8b1f-23380b70ac7f",
|
|
|
|
created_at: "2022-05-19T16:45:31.006Z",
|
|
|
|
log_source: "provisioner_daemon",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "37a5b7b1-b3eb-47cf-b80b-bd16e2e08a3d",
|
|
|
|
created_at: "2022-05-19T16:45:31.072Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "5e4e37a1-c217-48bc-84f5-7f1c3efbd042",
|
|
|
|
created_at: "2022-05-19T16:45:31.073Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "Initializing the backend...",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "060ed132-5d12-4584-9005-5c9557febe2f",
|
|
|
|
created_at: "2022-05-19T16:45:31.077Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "b2e70a1c-1943-4616-8ac9-25326c9f7e7b",
|
|
|
|
created_at: "2022-05-19T16:45:31.078Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "Initializing provider plugins...",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "993107fe-6dfb-42ec-912a-b32f50e60d62",
|
|
|
|
created_at: "2022-05-19T16:45:31.078Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: '- Finding hashicorp/google versions matching "~\u003e 4.15"...',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "2ad2e2a1-7a75-4827-8cb9-928acfc6fc07",
|
|
|
|
created_at: "2022-05-19T16:45:31.123Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: '- Finding coder/coder versions matching "0.3.4"...',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "7c723a90-0190-4c2f-9d97-ede39ef3d55f",
|
|
|
|
created_at: "2022-05-19T16:45:31.137Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "- Using hashicorp/google v4.21.0 from the shared cache directory",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "3910144b-411b-4a53-9900-88d406ed9bf4",
|
|
|
|
created_at: "2022-05-19T16:45:31.344Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "- Using coder/coder v0.3.4 from the shared cache directory",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "e3a02ad4-edc0-442f-8b9a-39d01d56b43b",
|
|
|
|
created_at: "2022-05-19T16:45:31.388Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "440cceb3-aabf-4838-979b-1fd37fe2d8d8",
|
|
|
|
created_at: "2022-05-19T16:45:31.388Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
2022-10-10 17:33:35 +00:00
|
|
|
output:
|
|
|
|
"Terraform has created a lock file .terraform.lock.hcl to record the provider",
|
2022-05-19 20:34:42 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "90e1f244-78ff-4d95-871e-b2bebcabc39a",
|
|
|
|
created_at: "2022-05-19T16:45:31.389Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
2022-10-10 17:33:35 +00:00
|
|
|
output:
|
|
|
|
"selections it made above. Include this file in your version control repository",
|
2022-05-19 20:34:42 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "e4527d6c-2412-452b-a946-5870787caf6b",
|
|
|
|
created_at: "2022-05-19T16:45:31.389Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
2022-10-10 17:33:35 +00:00
|
|
|
output:
|
|
|
|
"so that Terraform can guarantee to make the same selections by default when",
|
2022-05-19 20:34:42 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "02f96d19-d94b-4d0e-a1c4-313a0d2ff9e3",
|
|
|
|
created_at: "2022-05-19T16:45:31.39Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: 'you run "terraform init" in the future.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "667c03ca-1b24-4f36-a598-f0322cf3e2a1",
|
|
|
|
created_at: "2022-05-19T16:45:31.39Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "48039d6a-9b21-460f-9ca3-4b0e2becfd18",
|
|
|
|
created_at: "2022-05-19T16:45:31.391Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "debug",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "Terraform has been successfully initialized!",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "6fe4b64f-3aa6-4850-96e9-6db8478a53be",
|
|
|
|
created_at: "2022-05-19T16:45:31.42Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "Terraform 1.1.9",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "fa7b6321-7ecd-492d-a671-6366186fad08",
|
|
|
|
created_at: "2022-05-19T16:45:33.537Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "coder_agent.dev: Plan to create",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "e677e49f-c5ba-417c-8c9d-78bdad744ce1",
|
|
|
|
created_at: "2022-05-19T16:45:33.537Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "google_compute_disk.root: Plan to create",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "4b0e6168-29e4-4419-bf81-b57e31087666",
|
|
|
|
created_at: "2022-05-19T16:45:33.538Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "google_compute_instance.dev[0]: Plan to create",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "5902f89c-8acd-45e2-9bd6-de4d6fd8fc9c",
|
|
|
|
created_at: "2022-05-19T16:45:33.539Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "Plan: 3 to add, 0 to change, 0 to destroy.",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "a8107907-7c53-4aae-bb48-9a5f9759c7d5",
|
|
|
|
created_at: "2022-05-19T16:45:33.712Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "coder_agent.dev: Creating...",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "aaf13503-2f1a-4f6c-aced-b8fc48304dc1",
|
|
|
|
created_at: "2022-05-19T16:45:33.719Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
2022-10-10 17:33:35 +00:00
|
|
|
output:
|
|
|
|
"coder_agent.dev: Creation complete after 0s [id=d07f5bdc-4a8d-4919-9cdb-0ac6ba9e64d6]",
|
2022-05-19 20:34:42 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "4ada8886-f5b3-4fee-a1a3-72064b50d5ae",
|
|
|
|
created_at: "2022-05-19T16:45:34.139Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "google_compute_disk.root: Creating...",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "8ffc59e8-a4d0-4ffe-9bcc-cb84ca51cc22",
|
|
|
|
created_at: "2022-05-19T16:45:44.14Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "google_compute_disk.root: Still creating... [10s elapsed]",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "063189fd-75ad-415a-ac77-8c34b9e202b2",
|
|
|
|
created_at: "2022-05-19T16:45:47.106Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output:
|
|
|
|
"google_compute_disk.root: Creation complete after 13s [id=projects/bruno-coder-v2/zones/europe-west4-b/disks/coder-developer-bruno-dev-123-root]",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "6fd554a1-a7a2-439f-b8d8-369d6c1ead21",
|
|
|
|
created_at: "2022-05-19T16:45:47.118Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "google_compute_instance.dev[0]: Creating...",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "87388f7e-ab01-44b1-b35e-8e06636164d3",
|
|
|
|
created_at: "2022-05-19T16:45:57.122Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "google_compute_instance.dev[0]: Still creating... [10s elapsed]",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "baa40120-3f18-40d2-a35c-b11f421a1ce1",
|
|
|
|
created_at: "2022-05-19T16:46:00.837Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output:
|
|
|
|
"google_compute_instance.dev[0]: Creation complete after 14s [id=projects/bruno-coder-v2/zones/europe-west4-b/instances/coder-developer-bruno-dev-123]",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "00e18953-fba6-4b43-97a3-ecf376553c08",
|
|
|
|
created_at: "2022-05-19T16:46:00.846Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "Apply complete! Resources: 3 added, 0 changed, 0 destroyed.",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "431811da-b534-4d92-b6e5-44814548c812",
|
|
|
|
created_at: "2022-05-19T16:46:00.847Z",
|
|
|
|
log_source: "provisioner",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Starting workspace",
|
|
|
|
output: "Outputs: 0",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "70459334-4878-4bda-a546-98eee166c4c6",
|
|
|
|
created_at: "2022-05-19T16:46:02.283Z",
|
|
|
|
log_source: "provisioner_daemon",
|
|
|
|
log_level: "info",
|
|
|
|
stage: "Cleaning Up",
|
|
|
|
output: "",
|
|
|
|
},
|
|
|
|
]
|
2022-05-25 21:58:00 +00:00
|
|
|
|
|
|
|
export const MockCancellationMessage = {
|
|
|
|
message: "Job successfully canceled",
|
|
|
|
}
|
2022-07-28 17:18:51 +00:00
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
|
|
export const makeMockApiError = ({
|
|
|
|
message,
|
|
|
|
detail,
|
|
|
|
validations,
|
|
|
|
}: {
|
|
|
|
message?: string
|
|
|
|
detail?: string
|
|
|
|
validations?: FieldError[]
|
|
|
|
}) => ({
|
|
|
|
response: {
|
|
|
|
data: {
|
|
|
|
message: message ?? "Something went wrong.",
|
|
|
|
detail: detail ?? undefined,
|
|
|
|
validations: validations ?? undefined,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isAxiosError: true,
|
|
|
|
})
|
2022-08-23 15:26:22 +00:00
|
|
|
|
|
|
|
export const MockEntitlements: TypesGen.Entitlements = {
|
|
|
|
warnings: [],
|
|
|
|
has_license: false,
|
|
|
|
features: {},
|
2022-10-04 19:45:00 +00:00
|
|
|
experimental: false,
|
2022-10-07 00:28:22 +00:00
|
|
|
trial: false,
|
2022-08-23 15:26:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const MockEntitlementsWithWarnings: TypesGen.Entitlements = {
|
|
|
|
warnings: ["You are over your active user limit.", "And another thing."],
|
|
|
|
has_license: true,
|
2022-10-04 19:45:00 +00:00
|
|
|
experimental: false,
|
2022-10-07 00:28:22 +00:00
|
|
|
trial: false,
|
2022-08-23 15:26:22 +00:00
|
|
|
features: {
|
2022-08-25 23:20:31 +00:00
|
|
|
user_limit: {
|
2022-08-23 15:26:22 +00:00
|
|
|
enabled: true,
|
2022-08-25 23:20:31 +00:00
|
|
|
entitlement: "grace_period",
|
2022-08-23 15:26:22 +00:00
|
|
|
limit: 100,
|
|
|
|
actual: 102,
|
|
|
|
},
|
2022-08-25 23:20:31 +00:00
|
|
|
audit_log: {
|
|
|
|
enabled: true,
|
|
|
|
entitlement: "entitled",
|
|
|
|
},
|
2022-09-22 15:14:22 +00:00
|
|
|
browser_only: {
|
|
|
|
enabled: true,
|
|
|
|
entitlement: "entitled",
|
|
|
|
},
|
2022-08-25 23:20:31 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockEntitlementsWithAuditLog: TypesGen.Entitlements = {
|
|
|
|
warnings: [],
|
|
|
|
has_license: true,
|
2022-10-04 19:45:00 +00:00
|
|
|
experimental: false,
|
2022-10-07 00:28:22 +00:00
|
|
|
trial: false,
|
2022-08-25 23:20:31 +00:00
|
|
|
features: {
|
|
|
|
audit_log: {
|
|
|
|
enabled: true,
|
|
|
|
entitlement: "entitled",
|
|
|
|
},
|
2022-08-23 15:26:22 +00:00
|
|
|
},
|
|
|
|
}
|
2022-09-07 20:26:12 +00:00
|
|
|
|
|
|
|
export const MockAuditLog: TypesGen.AuditLog = {
|
|
|
|
id: "fbd2116a-8961-4954-87ae-e4575bd29ce0",
|
|
|
|
request_id: "53bded77-7b9d-4e82-8771-991a34d759f9",
|
|
|
|
time: "2022-05-19T16:45:57.122Z",
|
|
|
|
organization_id: "fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0",
|
|
|
|
ip: "127.0.0.1",
|
|
|
|
user_agent:
|
|
|
|
'"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"',
|
|
|
|
resource_type: "workspace",
|
|
|
|
resource_id: "ef8d1cf4-82de-4fd9-8980-047dad6d06b5",
|
|
|
|
resource_target: "bruno-dev",
|
|
|
|
resource_icon: "",
|
|
|
|
action: "create",
|
|
|
|
diff: {},
|
|
|
|
status_code: 200,
|
|
|
|
additional_fields: "",
|
2022-09-09 16:53:38 +00:00
|
|
|
description: "{user} updated workspace {target}",
|
2022-09-07 20:26:12 +00:00
|
|
|
user: MockUser,
|
|
|
|
}
|
|
|
|
|
|
|
|
export const MockAuditLog2: TypesGen.AuditLog = {
|
|
|
|
...MockAuditLog,
|
|
|
|
id: "53bded77-7b9d-4e82-8771-991a34d759f9",
|
|
|
|
action: "write",
|
|
|
|
diff: {
|
|
|
|
workspace_name: {
|
|
|
|
old: "old-workspace-name",
|
|
|
|
new: MockWorkspace.name,
|
|
|
|
secret: false,
|
|
|
|
},
|
|
|
|
workspace_auto_off: {
|
|
|
|
old: true,
|
|
|
|
new: false,
|
|
|
|
secret: false,
|
|
|
|
},
|
|
|
|
template_version_id: {
|
|
|
|
old: "fbd2116a-8961-4954-87ae-e4575bd29ce0",
|
|
|
|
new: "53bded77-7b9d-4e82-8771-991a34d759f9",
|
|
|
|
secret: false,
|
|
|
|
},
|
2022-09-09 16:53:38 +00:00
|
|
|
roles: {
|
|
|
|
old: null,
|
|
|
|
new: ["admin", "auditor"],
|
|
|
|
secret: false,
|
|
|
|
},
|
2022-09-07 20:26:12 +00:00
|
|
|
},
|
|
|
|
}
|
2022-09-30 18:01:20 +00:00
|
|
|
|
|
|
|
export const MockWorkspaceQuota: TypesGen.WorkspaceQuota = {
|
|
|
|
user_workspace_count: 0,
|
|
|
|
user_workspace_limit: 100,
|
|
|
|
}
|