2023-09-12 16:54:05 +00:00
import {
withDefaultFeatures ,
2023-10-13 16:39:20 +00:00
type GetLicensesResponse ,
type DeploymentConfig ,
2023-09-12 16:54:05 +00:00
} from "api/api" ;
2023-09-06 18:59:26 +00:00
import { FieldError } from "api/errors" ;
2024-01-29 13:39:31 +00:00
import * as TypesGen from "api/typesGenerated" ;
2023-09-06 18:59:26 +00:00
import range from "lodash/range" ;
2024-01-22 17:43:32 +00:00
import type { Permissions } from "contexts/auth/permissions" ;
2023-09-06 18:59:26 +00:00
import { TemplateVersionFiles } from "utils/templateVersion" ;
import { FileTree } from "utils/filetree" ;
import { ProxyLatencyReport } from "contexts/useProxyLatency" ;
2022-05-12 15:01:28 +00:00
2023-03-06 18:36:19 +00:00
export const MockOrganization : TypesGen.Organization = {
id : "fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0" ,
name : "Test Organization" ,
created_at : "" ,
updated_at : "" ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-06 18:36:19 +00:00
2023-05-30 17:18:27 +00:00
export const MockTemplateDAUResponse : TypesGen.DAUsResponse = {
tz_hour_offset : 0 ,
2022-09-01 19:58:23 +00:00
entries : [
2024-01-31 22:01:50 +00:00
{ date : "2022-08-27" , amount : 1 } ,
{ date : "2022-08-29" , amount : 2 } ,
{ date : "2022-08-30" , amount : 1 } ,
2022-09-01 19:58:23 +00:00
] ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-30 17:18:27 +00:00
export const MockDeploymentDAUResponse : TypesGen.DAUsResponse = {
tz_hour_offset : 0 ,
2023-01-26 01:03:47 +00:00
entries : [
2024-01-31 22:01:50 +00:00
{ date : "2022-08-27" , amount : 10 } ,
{ date : "2022-08-29" , amount : 22 } ,
{ date : "2022-08-30" , amount : 14 } ,
2023-01-26 01:03:47 +00:00
] ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-12 15:01:28 +00:00
export const MockSessionToken : TypesGen.LoginWithPasswordResponse = {
session_token : "my-session-token" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-12 15:01:28 +00:00
export const MockAPIKey : TypesGen.GenerateAPIKeyResponse = {
key : "my-api-key" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-12 15:01:28 +00:00
2023-03-17 17:29:51 +00:00
export const MockToken : TypesGen.APIKeyWithOwner = {
id : "tBoVE3dqLl" ,
user_id : "f9ee61d8-1d84-4410-ab6e-c1ec1a641e0b" ,
last_used : "0001-01-01T00:00:00Z" ,
expires_at : "2023-01-15T20:10:45.637438Z" ,
created_at : "2022-12-16T20:10:45.637452Z" ,
updated_at : "2022-12-16T20:10:45.637452Z" ,
login_type : "token" ,
scope : "all" ,
lifetime_seconds : 2592000 ,
token_name : "token-one" ,
username : "admin" ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-17 17:29:51 +00:00
export const MockTokens : TypesGen.APIKeyWithOwner [ ] = [
MockToken ,
2023-01-13 17:20:03 +00:00
{
id : "tBoVE3dqLl" ,
user_id : "f9ee61d8-1d84-4410-ab6e-c1ec1a641e0b" ,
last_used : "0001-01-01T00:00:00Z" ,
expires_at : "2023-01-15T20:10:45.637438Z" ,
created_at : "2022-12-16T20:10:45.637452Z" ,
updated_at : "2022-12-16T20:10:45.637452Z" ,
login_type : "token" ,
scope : "all" ,
lifetime_seconds : 2592000 ,
2023-03-02 17:39:38 +00:00
token_name : "token-two" ,
2023-03-17 17:29:51 +00:00
username : "admin" ,
2023-01-13 17:20:03 +00:00
} ,
2023-09-06 18:59:26 +00:00
] ;
2023-01-13 17:20:03 +00:00
2023-06-30 15:32:35 +00:00
export const MockPrimaryWorkspaceProxy : TypesGen.WorkspaceProxy = {
2023-04-28 21:04:52 +00:00
id : "4aa23000-526a-481f-a007-0f20b98b1e12" ,
name : "primary" ,
display_name : "Default" ,
icon_url : "/emojis/1f60e.png" ,
healthy : true ,
path_app_url : "https://coder.com" ,
wildcard_hostname : "*.coder.com" ,
2023-07-26 16:21:04 +00:00
derp_enabled : true ,
2023-08-02 14:35:06 +00:00
derp_only : false ,
2023-06-30 15:32:35 +00:00
created_at : new Date ( ) . toISOString ( ) ,
updated_at : new Date ( ) . toISOString ( ) ,
2023-11-21 11:21:25 +00:00
version : "v2.34.5-test+primary" ,
2023-06-30 15:32:35 +00:00
deleted : false ,
status : {
status : "ok" ,
checked_at : new Date ( ) . toISOString ( ) ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-04-28 21:04:52 +00:00
2023-06-30 15:32:35 +00:00
export const MockHealthyWildWorkspaceProxy : TypesGen.WorkspaceProxy = {
2023-04-28 21:04:52 +00:00
id : "5e2c1ab7-479b-41a9-92ce-aa85625de52c" ,
name : "haswildcard" ,
display_name : "Subdomain Supported" ,
icon_url : "/emojis/1f319.png" ,
healthy : true ,
path_app_url : "https://external.com" ,
wildcard_hostname : "*.external.com" ,
2023-07-26 16:21:04 +00:00
derp_enabled : true ,
2023-08-02 14:35:06 +00:00
derp_only : false ,
2023-06-30 15:32:35 +00:00
created_at : new Date ( ) . toISOString ( ) ,
updated_at : new Date ( ) . toISOString ( ) ,
deleted : false ,
2023-11-21 11:21:25 +00:00
version : "v2.34.5-test+haswildcard" ,
2023-06-30 15:32:35 +00:00
status : {
status : "ok" ,
checked_at : new Date ( ) . toISOString ( ) ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-04-28 21:04:52 +00:00
2023-06-30 15:32:35 +00:00
export const MockUnhealthyWildWorkspaceProxy : TypesGen.WorkspaceProxy = {
2023-05-10 18:10:06 +00:00
id : "8444931c-0247-4171-842a-569d9f9cbadb" ,
name : "unhealthy" ,
display_name : "Unhealthy" ,
icon_url : "/emojis/1f92e.png" ,
healthy : false ,
path_app_url : "https://unhealthy.coder.com" ,
wildcard_hostname : "*unhealthy..coder.com" ,
2023-07-26 16:21:04 +00:00
derp_enabled : true ,
2023-08-02 14:35:06 +00:00
derp_only : true ,
2023-06-30 15:32:35 +00:00
created_at : new Date ( ) . toISOString ( ) ,
updated_at : new Date ( ) . toISOString ( ) ,
2023-11-21 11:21:25 +00:00
version : "v2.34.5-test+unhealthy" ,
2023-06-30 15:32:35 +00:00
deleted : false ,
status : {
status : "unhealthy" ,
report : {
errors : [ "This workspace proxy is manually marked as unhealthy." ] ,
warnings : [ "This is a manual warning for this workspace proxy." ] ,
} ,
checked_at : new Date ( ) . toISOString ( ) ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-10 18:10:06 +00:00
2023-06-30 15:32:35 +00:00
export const MockWorkspaceProxies : TypesGen.WorkspaceProxy [ ] = [
2023-04-28 21:04:52 +00:00
MockPrimaryWorkspaceProxy ,
MockHealthyWildWorkspaceProxy ,
2023-05-10 18:10:06 +00:00
MockUnhealthyWildWorkspaceProxy ,
2023-04-28 21:04:52 +00:00
{
id : "26e84c16-db24-4636-a62d-aa1a4232b858" ,
name : "nowildcard" ,
display_name : "No wildcard" ,
icon_url : "/emojis/1f920.png" ,
healthy : true ,
path_app_url : "https://cowboy.coder.com" ,
wildcard_hostname : "" ,
2023-07-26 16:21:04 +00:00
derp_enabled : false ,
2023-08-02 14:35:06 +00:00
derp_only : false ,
2023-06-30 15:32:35 +00:00
created_at : new Date ( ) . toISOString ( ) ,
updated_at : new Date ( ) . toISOString ( ) ,
deleted : false ,
2023-11-21 11:21:25 +00:00
version : "v2.34.5-test+nowildcard" ,
2023-06-30 15:32:35 +00:00
status : {
status : "ok" ,
checked_at : new Date ( ) . toISOString ( ) ,
} ,
2023-04-28 21:04:52 +00:00
} ,
2023-09-06 18:59:26 +00:00
] ;
2023-04-28 21:04:52 +00:00
2023-05-11 20:42:30 +00:00
export const MockProxyLatencies : Record < string , ProxyLatencyReport > = {
2023-07-13 11:44:12 +00:00
. . . MockWorkspaceProxies . reduce (
( acc , proxy ) = > {
if ( ! proxy . healthy ) {
2023-09-06 18:59:26 +00:00
return acc ;
2023-07-13 11:44:12 +00:00
}
acc [ proxy . id ] = {
// Make one of them inaccurate.
accurate : proxy.id !== "26e84c16-db24-4636-a62d-aa1a4232b858" ,
// This is a deterministic way to generate a latency to for each proxy.
// It will be the same for each run as long as the IDs don't change.
latencyMS :
( Number (
Array . from ( proxy . id ) . reduce (
// Multiply each char code by some large prime number to increase the
// size of the number and allow use to get some decimal points.
( acc , char ) = > acc + char . charCodeAt ( 0 ) * 37 ,
0 ,
) ,
) /
// Cap at 250ms
100 ) %
250 ,
at : new Date ( ) ,
2023-09-06 18:59:26 +00:00
} ;
return acc ;
2023-07-13 11:44:12 +00:00
} ,
{ } as Record < string , ProxyLatencyReport > ,
) ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-11 20:42:30 +00:00
2022-05-12 15:01:28 +00:00
export const MockBuildInfo : TypesGen.BuildInfoResponse = {
2023-12-08 16:20:44 +00:00
agent_api_version : "1.0" ,
2022-04-07 17:18:58 +00:00
external_url : "file:///mock-url" ,
version : "v99.999.9999+c9cdf14" ,
2023-04-28 21:04:52 +00:00
dashboard_url : "https:///mock-url" ,
workspace_proxy : false ,
2024-01-30 23:11:37 +00:00
upgrade_message : "My custom upgrade message" ,
2023-09-06 18:59:26 +00:00
} ;
2022-04-07 17:18:58 +00:00
2023-02-27 08:25:04 +00:00
export const MockSupportLinks : TypesGen.LinkConfig [ ] = [
{
name : "First link" ,
target : "http://first-link" ,
icon : "chat" ,
} ,
{
name : "Second link" ,
target : "http://second-link" ,
icon : "docs" ,
} ,
{
name : "Third link" ,
target :
"https://github.com/coder/coder/issues/new?labels=needs+grooming&body={CODER_BUILD_INFO}" ,
icon : "" ,
} ,
2023-09-06 18:59:26 +00:00
] ;
2023-02-27 08:25:04 +00:00
2022-12-01 17:43:28 +00:00
export const MockUpdateCheck : TypesGen.UpdateCheckResponse = {
current : true ,
url : "file:///mock-url" ,
version : "v99.999.9999+c9cdf14" ,
2023-09-06 18:59:26 +00:00
} ;
2022-12-01 17:43:28 +00:00
2022-08-16 15:39:42 +00:00
export const MockOwnerRole : TypesGen.Role = {
name : "owner" ,
display_name : "Owner" ,
2023-09-06 18:59:26 +00:00
} ;
2022-08-16 15:39:42 +00:00
export const MockUserAdminRole : TypesGen.Role = {
name : "user_admin" ,
display_name : "User Admin" ,
2023-09-06 18:59:26 +00:00
} ;
2022-08-16 15:39:42 +00:00
export const MockTemplateAdminRole : TypesGen.Role = {
name : "template_admin" ,
display_name : "Template Admin" ,
2023-09-06 18:59:26 +00:00
} ;
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" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-10 19:13:07 +00:00
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" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-10 19:13:07 +00:00
2022-08-16 15:39:42 +00:00
// 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 ,
2023-09-06 18:59:26 +00:00
} ;
2022-08-16 15:39:42 +00:00
}
2022-05-10 19:13:07 +00:00
2023-09-06 18:59:26 +00:00
export const MockSiteRoles = [ MockUserAdminRole , MockAuditorRole ] ;
2022-10-28 19:43:10 +00:00
export const MockAssignableSiteRoles = [
assignableRole ( MockUserAdminRole , true ) ,
assignableRole ( MockAuditorRole , true ) ,
2023-09-06 18:59:26 +00:00
] ;
2022-10-28 19:43:10 +00:00
2022-08-25 23:20:31 +00:00
export const MockMemberPermissions = {
viewAuditLog : false ,
2023-09-06 18:59:26 +00:00
} ;
2022-08-25 23:20:31 +00:00
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" ,
2023-03-06 18:36:19 +00:00
organization_ids : [ MockOrganization . id ] ,
2022-08-16 15:39:42 +00:00
roles : [ MockOwnerRole ] ,
2022-10-11 14:39:03 +00:00
avatar_url : "https://avatars.githubusercontent.com/u/95932066?s=200&v=4" ,
2022-09-26 15:31:03 +00:00
last_seen_at : "" ,
2023-07-24 12:34:24 +00:00
login_type : "password" ,
2023-12-14 17:38:44 +00:00
theme_preference : "" ,
2024-01-17 12:20:45 +00:00
name : "" ,
2023-09-06 18:59:26 +00:00
} ;
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" ,
2023-03-06 18:36:19 +00:00
organization_ids : [ MockOrganization . id ] ,
2022-08-23 20:19:26 +00:00
roles : [ MockUserAdminRole ] ,
2022-09-04 16:44:27 +00:00
avatar_url : "" ,
2022-09-26 15:31:03 +00:00
last_seen_at : "" ,
2023-07-24 12:34:24 +00:00
login_type : "password" ,
2023-12-14 17:38:44 +00:00
theme_preference : "" ,
2024-01-17 12:20:45 +00:00
name : "" ,
2023-09-06 18:59:26 +00:00
} ;
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" ,
2023-03-06 18:36:19 +00:00
organization_ids : [ MockOrganization . id ] ,
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" ,
2023-07-24 12:34:24 +00:00
login_type : "oidc" ,
2023-12-14 17:38:44 +00:00
theme_preference : "" ,
2024-01-18 11:32:01 +00:00
name : "Mock User The Second" ,
2023-09-06 18:59:26 +00:00
} ;
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" ,
2023-03-06 18:36:19 +00:00
organization_ids : [ MockOrganization . id ] ,
2022-06-15 17:29:38 +00:00
roles : [ ] ,
2022-09-04 16:44:27 +00:00
avatar_url : "" ,
2022-09-26 15:31:03 +00:00
last_seen_at : "" ,
2023-07-24 12:34:24 +00:00
login_type : "password" ,
2023-12-14 17:38:44 +00:00
theme_preference : "" ,
2024-01-17 12:20:45 +00:00
name : "" ,
2023-09-06 18:59:26 +00:00
} ;
2022-06-15 17:29:38 +00:00
2022-05-12 15:01:28 +00:00
export const MockProvisioner : TypesGen.ProvisionerDaemon = {
2023-12-05 13:54:38 +00:00
created_at : "2022-05-17T17:39:01.382927298Z" ,
2022-01-26 00:36:26 +00:00
id : "test-provisioner" ,
name : "Test Provisioner" ,
2022-05-19 18:04:44 +00:00
provisioners : [ "echo" ] ,
2023-12-12 13:03:37 +00:00
tags : { scope : "organization" } ,
version : "v2.34.5" ,
2024-01-03 09:01:57 +00:00
api_version : "1.0" ,
2023-12-12 13:03:37 +00:00
} ;
export const MockUserProvisioner : TypesGen.ProvisionerDaemon = {
created_at : "2022-05-17T17:39:01.382927298Z" ,
id : "test-user-provisioner" ,
name : "Test User Provisioner" ,
provisioners : [ "echo" ] ,
tags : { scope : "user" , owner : "12345678-abcd-1234-abcd-1234567890abcd" } ,
2023-12-05 13:54:38 +00:00
version : "v2.34.5" ,
2024-01-03 09:01:57 +00:00
api_version : "1.0" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-12 15:01:28 +00:00
export const MockProvisionerJob : TypesGen.ProvisionerJob = {
created_at : "" ,
id : "test-provisioner-job" ,
status : "succeeded" ,
2023-03-06 18:36:19 +00:00
file_id : MockOrganization.id ,
2022-08-09 14:07:01 +00:00
completed_at : "2022-05-17T17:39:01.382927298Z" ,
2024-01-18 22:35:20 +00:00
tags : {
scope : "organization" ,
owner : "" ,
wowzers : "whatatag" ,
isCapable : "false" ,
department : "engineering" ,
dreaming : "true" ,
} ,
2023-06-20 20:07:18 +00:00
queue_position : 0 ,
queue_size : 0 ,
2023-09-06 18:59: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" ,
2023-09-06 18:59:26 +00:00
} ;
2022-09-06 17:07:00 +00:00
2022-05-31 15:16:15 +00:00
export const MockCancelingProvisionerJob : TypesGen.ProvisionerJob = {
. . . MockProvisionerJob ,
status : "canceling" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-31 15:16:15 +00:00
export const MockCanceledProvisionerJob : TypesGen.ProvisionerJob = {
2022-05-16 16:34:22 +00:00
. . . MockProvisionerJob ,
2022-05-31 15:16:15 +00:00
status : "canceled" ,
2023-09-06 18:59:26 +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" ,
2023-09-06 18:59:26 +00:00
} ;
2022-07-22 19:18:52 +00:00
export const MockPendingProvisionerJob : TypesGen.ProvisionerJob = {
. . . MockProvisionerJob ,
status : "pending" ,
2023-06-28 12:48:58 +00:00
queue_position : 2 ,
queue_size : 4 ,
2023-09-06 18:59:26 +00:00
} ;
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" ,
2023-07-11 10:11:08 +00:00
message : "first 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-10-31 16:38:07 +00:00
created_by : MockUser ,
2023-10-11 14:26:22 +00:00
archived : false ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-19 20:51:10 +00:00
2022-11-24 13:36:50 +00:00
export const MockTemplateVersion2 : TypesGen.TemplateVersion = {
id : "test-template-version-2" ,
created_at : "2022-05-17T17:39:01.382927298Z" ,
updated_at : "2022-05-17T17:39:01.382927298Z" ,
template_id : "test-template" ,
job : MockProvisionerJob ,
name : "test-version-2" ,
2023-07-11 10:11:08 +00:00
message : "first version" ,
2022-11-24 13:36:50 +00:00
readme : ` ---
name :Template test 2
-- -
# # Instructions
You can add instructions here
[ Some link info ] ( https : //coder.com)`,
created_by : MockUser ,
2023-10-11 14:26:22 +00:00
archived : false ,
2023-09-06 18:59:26 +00:00
} ;
2022-11-24 13:36:50 +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-11-10 20:51:09 +00:00
display_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
active_user_count : 1 ,
2022-10-17 04:34:03 +00:00
build_time_stats : {
2022-11-17 16:56:56 +00:00
start : {
P50 : 1000 ,
P95 : 1500 ,
} ,
stop : {
P50 : 1000 ,
P95 : 1500 ,
} ,
delete : {
P50 : 1000 ,
P95 : 1500 ,
} ,
2022-10-17 04:34:03 +00:00
} ,
2022-05-16 20:56:11 +00:00
description : "This is a test description." ,
2022-11-09 19:36:25 +00:00
default_ttl_ms : 24 * 60 * 60 * 1000 ,
2024-02-13 07:00:35 +00:00
activity_bump_ms : 1 * 60 * 60 * 1000 ,
2023-12-15 08:27:56 +00:00
use_max_ttl : false ,
max_ttl_ms : 0 ,
2023-08-29 18:35:05 +00:00
autostop_requirement : {
2023-12-15 08:27:56 +00:00
days_of_week : [ "sunday" ] ,
2023-07-20 13:35:41 +00:00
weeks : 1 ,
} ,
2023-10-13 16:57:18 +00:00
autostart_requirement : {
days_of_week : [
"monday" ,
"tuesday" ,
"wednesday" ,
"thursday" ,
"friday" ,
"saturday" ,
"sunday" ,
] ,
} ,
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-11-21 10:43:53 +00:00
allow_user_cancel_workspace_jobs : true ,
2023-05-05 15:19:26 +00:00
failure_ttl_ms : 0 ,
2023-08-24 18:25:54 +00:00
time_til_dormant_ms : 0 ,
time_til_dormant_autodelete_ms : 0 ,
2023-10-04 18:00:09 +00:00
allow_user_autostart : true ,
allow_user_autostop : true ,
2023-10-18 22:07:21 +00:00
require_active_version : false ,
2023-11-20 19:16:18 +00:00
deprecated : false ,
deprecation_message : "" ,
2024-02-13 14:31:20 +00:00
max_port_share_level : "owner" ,
2023-09-06 18:59:26 +00:00
} ;
2022-01-26 03:50:31 +00:00
2023-02-07 01:24:04 +00:00
export const MockTemplateVersionFiles : TemplateVersionFiles = {
"README.md" : "# Example\n\nThis is an example template." ,
"main.tf" : ` // Provides info about the workspace.
data "coder_workspace" "me" { }
// Provides the startup script used to download
// the agent and communicate with Coder.
resource "coder_agent" "dev" {
os = "linux"
arch = "amd64"
}
resource "kubernetes_pod" "main" {
// Ensures that the Pod dies when the workspace shuts down!
count = data . coder_workspace . me . start_count
metadata {
name = "dev-\${data.coder_workspace.me.id}"
}
spec {
container {
image = "ubuntu"
command = [ "sh" , "-c" , coder_agent . main . init_script ]
env {
name = "CODER_AGENT_TOKEN"
value = coder_agent . main . token
}
}
}
}
` ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-07 01:24:04 +00:00
2023-02-10 16:22:20 +00:00
export const MockTemplateVersionFileTree : FileTree = {
"README.md" : "# Example\n\nThis is an example template." ,
"main.tf" : ` // Provides info about the workspace.
data "coder_workspace" "me" { }
// Provides the startup script used to download
// the agent and communicate with Coder.
resource "coder_agent" "dev" {
os = "linux"
arch = "amd64"
}
resource "kubernetes_pod" "main" {
// Ensures that the Pod dies when the workspace shuts down!
count = data . coder_workspace . me . start_count
metadata {
name = "dev-\${data.coder_workspace.me.id}"
}
spec {
container {
image = "ubuntu"
command = [ "sh" , "-c" , coder_agent . main . init_script ]
env {
name = "CODER_AGENT_TOKEN"
value = coder_agent . main . token
}
}
}
}
` ,
images : {
"java.Dockerfile" : "FROM eclipse-temurin:17-jdk-jammy" ,
"python.Dockerfile" : "FROM python:3.8-slim-buster" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-10 16:22:20 +00:00
2022-10-03 21:01:13 +00:00
export const MockWorkspaceApp : TypesGen.WorkspaceApp = {
id : "test-app" ,
2022-10-28 17:41:31 +00:00
slug : "test-app" ,
display_name : "Test App" ,
2022-10-03 21:01:13 +00:00
icon : "" ,
2022-10-05 19:23:01 +00:00
subdomain : false ,
2022-10-03 21:01:13 +00:00
health : "disabled" ,
2022-12-14 21:54:18 +00:00
external : false ,
url : "" ,
2022-10-14 16:46:38 +00:00
sharing_level : "owner" ,
2022-10-03 21:01:13 +00:00
healthcheck : {
url : "" ,
interval : 0 ,
threshold : 0 ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
2023-09-25 21:47:17 +00:00
export const MockWorkspaceAgentLogSource : TypesGen.WorkspaceAgentLogSource = {
created_at : "2023-05-04T11:30:41.402072Z" ,
id : "dc790496-eaec-4f88-a53f-8ce1f61a1fff" ,
display_name : "Startup Script" ,
icon : "" ,
workspace_agent_id : "" ,
} ;
export const MockWorkspaceAgentScript : TypesGen.WorkspaceAgentScript = {
log_source_id : MockWorkspaceAgentLogSource.id ,
cron : "" ,
log_path : "" ,
run_on_start : true ,
run_on_stop : false ,
script : "echo 'hello world'" ,
start_blocks_login : false ,
timeout : 0 ,
} ;
2022-10-03 21:01:13 +00:00
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 ,
2023-10-31 06:08:43 +00:00
api_version : "1.0" ,
2022-10-03 21:01:13 +00:00
latency : {
"Coder Embedded DERP" : {
latency_ms : 32.55 ,
preferred : true ,
} ,
} ,
2022-11-09 15:27:05 +00:00
connection_timeout_seconds : 120 ,
troubleshooting_url : "https://coder.com/troubleshoot" ,
2023-01-24 12:24:27 +00:00
lifecycle_state : "starting" ,
2023-07-28 15:57:23 +00:00
logs_length : 0 ,
logs_overflowed : false ,
2023-09-25 21:47:17 +00:00
log_sources : [ MockWorkspaceAgentLogSource ] ,
scripts : [ MockWorkspaceAgentScript ] ,
startup_script_behavior : "non-blocking" ,
2023-08-09 05:10:28 +00:00
subsystems : [ "envbox" , "exectrace" ] ,
2023-07-10 09:40:11 +00:00
health : {
healthy : true ,
} ,
2023-08-30 19:53:42 +00:00
display_apps : [
"ssh_helper" ,
"port_forwarding_helper" ,
"vscode" ,
"vscode_insiders" ,
"web_terminal" ,
] ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
export const MockWorkspaceAgentDisconnected : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-2" ,
name : "another-workspace-agent" ,
status : "disconnected" ,
version : "" ,
latency : { } ,
2023-01-24 12:24:27 +00:00
lifecycle_state : "ready" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : false ,
reason : "agent is not connected" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
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 ,
} ,
} ,
2023-01-24 12:24:27 +00:00
lifecycle_state : "ready" ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
2023-12-08 16:20:44 +00:00
export const MockWorkspaceAgentDeprecated : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-3" ,
name : "an-outdated-workspace-agent" ,
version : "v99.999.9998+abcdef" ,
api_version : "1.99" ,
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 ,
} ,
} ,
lifecycle_state : "ready" ,
} ;
2022-10-03 21:01:13 +00:00
export const MockWorkspaceAgentConnecting : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-connecting" ,
name : "another-workspace-agent" ,
status : "connecting" ,
version : "" ,
latency : { } ,
2023-01-24 12:24:27 +00:00
lifecycle_state : "created" ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
2022-11-09 15:27:05 +00:00
export const MockWorkspaceAgentTimeout : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-timeout" ,
name : "a-timed-out-workspace-agent" ,
status : "timeout" ,
version : "" ,
latency : { } ,
2023-01-24 12:24:27 +00:00
lifecycle_state : "created" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : false ,
reason : "agent is taking too long to connect" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-01-24 12:24:27 +00:00
export const MockWorkspaceAgentStarting : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-starting" ,
name : "a-starting-workspace-agent" ,
lifecycle_state : "starting" ,
2023-09-06 18:59:26 +00:00
} ;
2023-01-24 12:24:27 +00:00
2023-03-23 19:09:13 +00:00
export const MockWorkspaceAgentReady : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-ready" ,
name : "a-ready-workspace-agent" ,
lifecycle_state : "ready" ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-23 19:09:13 +00:00
2023-01-24 12:24:27 +00:00
export const MockWorkspaceAgentStartTimeout : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-start-timeout" ,
name : "a-workspace-agent-timed-out-while-running-startup-script" ,
lifecycle_state : "start_timeout" ,
2023-09-06 18:59:26 +00:00
} ;
2023-01-24 12:24:27 +00:00
export const MockWorkspaceAgentStartError : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-start-error" ,
name : "a-workspace-agent-errored-while-running-startup-script" ,
lifecycle_state : "start_error" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : false ,
reason : "agent startup script failed" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-11-09 15:27:05 +00:00
2023-03-06 19:34:00 +00:00
export const MockWorkspaceAgentShuttingDown : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-shutting-down" ,
name : "a-shutting-down-workspace-agent" ,
lifecycle_state : "shutting_down" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : false ,
reason : "agent is shutting down" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-06 19:34:00 +00:00
export const MockWorkspaceAgentShutdownTimeout : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-shutdown-timeout" ,
name : "a-workspace-agent-timed-out-while-running-shutdownup-script" ,
lifecycle_state : "shutdown_timeout" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : false ,
reason : "agent is shutting down" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-06 19:34:00 +00:00
export const MockWorkspaceAgentShutdownError : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-shutdown-error" ,
name : "a-workspace-agent-errored-while-running-shutdownup-script" ,
lifecycle_state : "shutdown_error" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : false ,
reason : "agent is shutting down" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-06 19:34:00 +00:00
export const MockWorkspaceAgentOff : TypesGen.WorkspaceAgent = {
. . . MockWorkspaceAgent ,
id : "test-workspace-agent-off" ,
name : "a-workspace-agent-is-shut-down" ,
lifecycle_state : "off" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : false ,
reason : "agent is shutting down" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-06 19:34:00 +00:00
2022-10-03 21:01:13 +00:00
export const MockWorkspaceResource : TypesGen.WorkspaceResource = {
id : "test-workspace-resource" ,
name : "a-workspace-resource" ,
2023-09-25 15:40:51 +00:00
agents : [ MockWorkspaceAgent ] ,
created_at : "" ,
job_id : "" ,
2022-10-03 21:01:13 +00:00
type : "google_compute_disk" ,
workspace_transition : "start" ,
hide : false ,
icon : "" ,
2023-09-25 15:40:51 +00:00
metadata : [ { key : "size" , value : "32GB" , sensitive : false } ] ,
2022-11-14 17:57:33 +00:00
daily_cost : 10 ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
2023-09-25 15:40:51 +00:00
export const MockWorkspaceResourceSensitive : TypesGen.WorkspaceResource = {
. . . MockWorkspaceResource ,
id : "test-workspace-resource-sensitive" ,
name : "workspace-resource-sensitive" ,
metadata : [ { key : "api_key" , value : "12345678" , sensitive : true } ] ,
} ;
export const MockWorkspaceResourceMultipleAgents : TypesGen.WorkspaceResource = {
. . . MockWorkspaceResource ,
id : "test-workspace-resource-multiple-agents" ,
name : "workspace-resource-multiple-agents" ,
2022-10-10 17:33:35 +00:00
agents : [
MockWorkspaceAgent ,
MockWorkspaceAgentDisconnected ,
MockWorkspaceAgentOutdated ,
] ,
2023-09-25 15:40:51 +00:00
} ;
export const MockWorkspaceResourceHidden : TypesGen.WorkspaceResource = {
. . . MockWorkspaceResource ,
id : "test-workspace-resource-hidden" ,
name : "workspace-resource-hidden" ,
hide : true ,
} ;
export const MockWorkspaceVolumeResource : TypesGen.WorkspaceResource = {
id : "test-workspace-volume-resource" ,
2022-10-03 21:01:13 +00:00
created_at : "" ,
job_id : "" ,
workspace_transition : "start" ,
2023-09-25 15:40:51 +00:00
type : "docker_volume" ,
name : "home_volume" ,
2022-10-03 21:01:13 +00:00
hide : false ,
icon : "" ,
2023-09-25 15:40:51 +00:00
daily_cost : 0 ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
2023-09-25 15:40:51 +00:00
export const MockWorkspaceImageResource : TypesGen.WorkspaceResource = {
id : "test-workspace-image-resource" ,
2022-10-03 21:01:13 +00:00
created_at : "" ,
job_id : "" ,
workspace_transition : "start" ,
2023-09-25 15:40:51 +00:00
type : "docker_image" ,
name : "main" ,
hide : false ,
2022-10-03 21:01:13 +00:00
icon : "" ,
2023-09-25 15:40:51 +00:00
daily_cost : 0 ,
} ;
export const MockWorkspaceContainerResource : TypesGen.WorkspaceResource = {
id : "test-workspace-container-resource" ,
created_at : "" ,
job_id : "" ,
workspace_transition : "start" ,
type : "docker_container" ,
name : "workspace" ,
hide : false ,
icon : "" ,
daily_cost : 0 ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-03 21:01:13 +00:00
2022-10-10 17:33:35 +00:00
export const MockWorkspaceAutostartDisabled : TypesGen.UpdateWorkspaceAutostartRequest =
{
schedule : "" ,
2023-09-06 18:59:26 +00:00
} ;
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" ,
2023-09-06 18:59:26 +00:00
} ;
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 ,
2022-11-24 13:36:50 +00:00
template_version_id : MockTemplateVersion.id ,
2022-11-28 19:53:56 +00:00
template_version_name : MockTemplateVersion.name ,
2022-05-12 15:01:28 +00:00
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 ,
2024-01-30 17:07:06 +00:00
workspace_owner_avatar_url : MockUser.avatar_url ,
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-11-14 17:57:33 +00:00
daily_cost : 20 ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-12 15:01:28 +00:00
2023-09-12 21:29:39 +00:00
export const MockWorkspaceBuildAutostart : TypesGen.WorkspaceBuild = {
build_number : 1 ,
created_at : "2022-05-17T17:39:01.382927298Z" ,
id : "1" ,
initiator_id : MockUser.id ,
initiator_name : MockUser.username ,
job : MockProvisionerJob ,
template_version_id : MockTemplateVersion.id ,
template_version_name : MockTemplateVersion.name ,
transition : "start" ,
updated_at : "2022-05-17T17:39:01.382927298Z" ,
workspace_name : "test-workspace" ,
workspace_owner_id : MockUser.id ,
workspace_owner_name : MockUser.username ,
2024-01-30 17:07:06 +00:00
workspace_owner_avatar_url : MockUser.avatar_url ,
2023-09-12 21:29:39 +00:00
workspace_id : "759f1d46-3174-453d-aa60-980a9c1442f3" ,
deadline : "2022-05-17T23:39:00.00Z" ,
reason : "autostart" ,
resources : [ MockWorkspaceResource ] ,
status : "running" ,
daily_cost : 20 ,
} ;
export const MockWorkspaceBuildAutostop : TypesGen.WorkspaceBuild = {
build_number : 1 ,
created_at : "2022-05-17T17:39:01.382927298Z" ,
id : "1" ,
initiator_id : MockUser.id ,
initiator_name : MockUser.username ,
job : MockProvisionerJob ,
template_version_id : MockTemplateVersion.id ,
template_version_name : MockTemplateVersion.name ,
transition : "start" ,
updated_at : "2022-05-17T17:39:01.382927298Z" ,
workspace_name : "test-workspace" ,
workspace_owner_id : MockUser.id ,
workspace_owner_name : MockUser.username ,
2024-01-30 17:07:06 +00:00
workspace_owner_avatar_url : MockUser.avatar_url ,
2023-09-12 21:29:39 +00:00
workspace_id : "759f1d46-3174-453d-aa60-980a9c1442f3" ,
deadline : "2022-05-17T23:39:00.00Z" ,
reason : "autostop" ,
resources : [ MockWorkspaceResource ] ,
status : "running" ,
daily_cost : 20 ,
} ;
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 ,
2022-11-24 13:36:50 +00:00
template_version_id : MockTemplateVersion.id ,
2022-11-28 19:53:56 +00:00
template_version_name : MockTemplateVersion.name ,
2022-09-06 17:07:00 +00:00
transition : transition ,
updated_at : "2022-05-17T17:39:01.382927298Z" ,
workspace_name : "test-workspace" ,
workspace_owner_id : MockUser.id ,
workspace_owner_name : MockUser.username ,
2024-01-30 17:07:06 +00:00
workspace_owner_avatar_url : MockUser.avatar_url ,
2022-09-06 17:07:00 +00:00
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 : [ ] ,
2023-08-17 21:59:26 +00:00
status : "failed" ,
2022-11-14 17:57:33 +00:00
daily_cost : 20 ,
2023-09-06 18:59:26 +00:00
} ) ;
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" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
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" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
2022-10-10 17:33:35 +00:00
export const MockBuilds = [
MockWorkspaceBuild ,
2023-09-12 21:29:39 +00:00
MockWorkspaceBuildAutostart ,
MockWorkspaceBuildAutostop ,
2022-10-10 17:33:35 +00:00
MockWorkspaceBuildStop ,
MockWorkspaceBuildDelete ,
2023-09-06 18:59:26 +00:00
] ;
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-11-16 14:50:32 +00:00
template_display_name : MockTemplate.display_name ,
2022-11-21 10:43:53 +00:00
template_allow_user_cancel_workspace_jobs :
MockTemplate . allow_user_cancel_workspace_jobs ,
2023-08-27 16:26:20 +00:00
template_active_version_id : MockTemplate.active_version_id ,
2023-10-19 23:21:52 +00:00
template_require_active_version : MockTemplate.require_active_version ,
2022-05-12 15:01:28 +00:00
outdated : false ,
2022-03-23 14:09:43 +00:00
owner_id : MockUser.id ,
2023-03-23 19:09:13 +00:00
organization_id : MockOrganization.id ,
2022-05-14 01:41:21 +00:00
owner_name : MockUser.username ,
2024-01-30 17:07:06 +00:00
owner_avatar_url : "https://avatars.githubusercontent.com/u/7122116?v=4" ,
2022-04-14 00:35:47 +00:00
autostart_schedule : MockWorkspaceAutostartEnabled.schedule ,
2023-03-23 19:43:12 +00:00
ttl_ms : 2 * 60 * 60 * 1000 ,
2022-05-12 15:01:28 +00:00
latest_build : MockWorkspaceBuild ,
2023-03-27 17:26:57 +00:00
last_used_at : "2022-05-16T15:29:10.302441433Z" ,
2023-07-10 09:40:11 +00:00
health : {
healthy : true ,
failing_agents : [ ] ,
} ,
2023-10-06 09:27:12 +00:00
automatic_updates : "never" ,
2023-12-15 18:38:47 +00:00
allow_renames : true ,
2024-01-29 13:39:31 +00:00
favorite : false ,
} ;
export const MockFavoriteWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
id : "test-favorite-workspace" ,
2024-01-24 13:39:19 +00:00
favorite : true ,
2023-09-06 18:59:26 +00:00
} ;
2022-04-29 22:30:10 +00:00
2022-05-31 19:50:03 +00:00
export const MockStoppedWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-stopped-workspace" ,
2022-10-05 20:20:29 +00:00
latest_build : { . . . MockWorkspaceBuildStop , status : "stopped" } ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
export const MockStoppingWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-stopping-workspace" ,
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
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
export const MockStartingWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-starting-workspace" ,
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
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
export const MockCancelingWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-canceling-workspace" ,
2022-10-10 17:33:35 +00:00
latest_build : {
. . . MockWorkspaceBuild ,
job : MockCancelingProvisionerJob ,
status : "canceling" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-24 00:04:38 +00:00
export const MockCanceledWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-canceled-workspace" ,
2022-10-10 17:33:35 +00:00
latest_build : {
. . . MockWorkspaceBuild ,
job : MockCanceledProvisionerJob ,
status : "canceled" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
export const MockFailedWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-failed-workspace" ,
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
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
export const MockDeletingWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-deleting-workspace" ,
2022-10-10 17:33:35 +00:00
latest_build : {
. . . MockWorkspaceBuildDelete ,
job : MockRunningProvisionerJob ,
status : "deleting" ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-16 14:01:22 +00:00
export const MockWorkspaceWithDeletion = {
2023-05-18 18:08:55 +00:00
. . . MockStoppedWorkspace ,
2023-05-16 14:01:22 +00:00
deleting_at : new Date ( ) . toISOString ( ) ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-16 14:01:22 +00:00
2022-06-27 14:53:44 +00:00
export const MockDeletedWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-deleted-workspace" ,
2022-10-05 20:20:29 +00:00
latest_build : { . . . MockWorkspaceBuildDelete , status : "deleted" } ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
2022-10-10 17:33:35 +00:00
export const MockOutdatedWorkspace : TypesGen.Workspace = {
. . . MockFailedWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-outdated-workspace" ,
2022-10-10 17:33:35 +00:00
outdated : true ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-16 16:34:22 +00:00
2024-01-18 22:14:25 +00:00
export const MockRunningOutdatedWorkspace : TypesGen.Workspace = {
. . . MockWorkspace ,
id : "test-running-outdated-workspace" ,
outdated : true ,
} ;
export const MockDormantWorkspace : TypesGen.Workspace = {
. . . MockStoppedWorkspace ,
id : "test-dormant-workspace" ,
dormant_at : new Date ( ) . toISOString ( ) ,
} ;
export const MockDormantOutdatedWorkspace : TypesGen.Workspace = {
. . . MockStoppedWorkspace ,
id : "test-dormant-outdated-workspace" ,
name : "Dormant-Workspace" ,
outdated : true ,
dormant_at : new Date ( ) . toISOString ( ) ,
} ;
2023-10-19 23:21:52 +00:00
export const MockOutdatedRunningWorkspaceRequireActiveVersion : TypesGen.Workspace =
{
. . . MockWorkspace ,
id : "test-outdated-workspace-require-active-version" ,
outdated : true ,
template_require_active_version : true ,
latest_build : {
. . . MockWorkspaceBuild ,
status : "running" ,
} ,
} ;
2023-11-22 00:06:30 +00:00
export const MockOutdatedRunningWorkspaceAlwaysUpdate : TypesGen.Workspace = {
. . . MockWorkspace ,
id : "test-outdated-workspace-always-update" ,
outdated : true ,
automatic_updates : "always" ,
latest_build : {
. . . MockWorkspaceBuild ,
status : "running" ,
} ,
} ;
2023-10-19 23:21:52 +00:00
export const MockOutdatedStoppedWorkspaceRequireActiveVersion : TypesGen.Workspace =
{
. . . MockOutdatedRunningWorkspaceRequireActiveVersion ,
latest_build : {
. . . MockWorkspaceBuild ,
status : "stopped" ,
} ,
} ;
2023-11-22 00:06:30 +00:00
export const MockOutdatedStoppedWorkspaceAlwaysUpdate : TypesGen.Workspace = {
. . . MockOutdatedRunningWorkspaceAlwaysUpdate ,
latest_build : {
. . . MockWorkspaceBuild ,
status : "stopped" ,
} ,
} ;
2022-10-05 20:20:29 +00:00
export const MockPendingWorkspace : TypesGen.Workspace = {
2022-07-22 19:18:52 +00:00
. . . MockWorkspace ,
2022-10-20 17:23:14 +00:00
id : "test-pending-workspace" ,
2022-07-22 19:18:52 +00:00
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
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-07-22 19:18:52 +00:00
2022-11-10 18:25:46 +00:00
// just over one page of workspaces
export const MockWorkspacesResponse : TypesGen.WorkspacesResponse = {
workspaces : range ( 1 , 27 ) . map ( ( id : number ) = > ( {
. . . MockWorkspace ,
id : id.toString ( ) ,
name : ` ${ MockWorkspace . name } ${ id } ` ,
} ) ) ,
count : 26 ,
2023-09-06 18:59:26 +00:00
} ;
2022-11-10 18:25:46 +00:00
2023-05-16 14:01:22 +00:00
export const MockWorkspacesResponseWithDeletions = {
workspaces : [ . . . MockWorkspacesResponse . workspaces , MockWorkspaceWithDeletion ] ,
count : MockWorkspacesResponse.count + 1 ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-16 14:01:22 +00:00
2023-02-01 17:13:11 +00:00
export const MockTemplateVersionParameter1 : TypesGen.TemplateVersionParameter =
{
name : "first_parameter" ,
type : "string" ,
description : "This is first parameter" ,
2023-02-08 11:57:12 +00:00
description_plaintext : "Markdown: This is first parameter" ,
2023-02-01 17:13:11 +00:00
default_value : "abc" ,
mutable : true ,
icon : "/icon/folder.svg" ,
options : [ ] ,
2023-03-07 15:38:31 +00:00
required : true ,
2023-07-10 11:44:03 +00:00
ephemeral : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-01 17:13:11 +00:00
export const MockTemplateVersionParameter2 : TypesGen.TemplateVersionParameter =
{
name : "second_parameter" ,
type : "number" ,
description : "This is second parameter" ,
2023-02-08 11:57:12 +00:00
description_plaintext : "Markdown: This is second parameter" ,
2023-02-01 17:13:11 +00:00
default_value : "2" ,
mutable : true ,
icon : "/icon/folder.svg" ,
options : [ ] ,
validation_min : 1 ,
validation_max : 3 ,
2023-02-07 08:36:13 +00:00
validation_monotonic : "increasing" ,
2023-03-07 15:38:31 +00:00
required : true ,
2023-07-10 11:44:03 +00:00
ephemeral : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-01 17:13:11 +00:00
export const MockTemplateVersionParameter3 : TypesGen.TemplateVersionParameter =
{
name : "third_parameter" ,
type : "string" ,
description : "This is third parameter" ,
2023-02-08 11:57:12 +00:00
description_plaintext : "Markdown: This is third parameter" ,
2023-02-01 17:13:11 +00:00
default_value : "aaa" ,
mutable : true ,
icon : "/icon/database.svg" ,
options : [ ] ,
validation_error : "No way!" ,
validation_regex : "^[a-z]{3}$" ,
2023-03-07 15:38:31 +00:00
required : true ,
2023-07-10 11:44:03 +00:00
ephemeral : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-01 17:13:11 +00:00
export const MockTemplateVersionParameter4 : TypesGen.TemplateVersionParameter =
{
name : "fourth_parameter" ,
type : "string" ,
description : "This is fourth parameter" ,
2023-02-08 11:57:12 +00:00
description_plaintext : "Markdown: This is fourth parameter" ,
2023-02-01 17:13:11 +00:00
default_value : "def" ,
mutable : false ,
icon : "/icon/database.svg" ,
options : [ ] ,
2023-03-07 15:38:31 +00:00
required : true ,
2023-07-10 11:44:03 +00:00
ephemeral : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-07 08:36:13 +00:00
export const MockTemplateVersionParameter5 : TypesGen.TemplateVersionParameter =
{
name : "fifth_parameter" ,
type : "number" ,
description : "This is fifth parameter" ,
2023-02-08 11:57:12 +00:00
description_plaintext : "Markdown: This is fifth parameter" ,
2023-02-07 08:36:13 +00:00
default_value : "5" ,
mutable : true ,
icon : "/icon/folder.svg" ,
options : [ ] ,
validation_min : 1 ,
validation_max : 10 ,
validation_monotonic : "decreasing" ,
2023-03-07 15:38:31 +00:00
required : true ,
2023-07-10 11:44:03 +00:00
ephemeral : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-01 17:13:11 +00:00
2023-03-02 13:11:16 +00:00
export const MockTemplateVersionVariable1 : TypesGen.TemplateVersionVariable = {
name : "first_variable" ,
description : "This is first variable." ,
type : "string" ,
value : "" ,
default_value : "abc" ,
required : false ,
sensitive : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-02 13:11:16 +00:00
export const MockTemplateVersionVariable2 : TypesGen.TemplateVersionVariable = {
name : "second_variable" ,
description : "This is second variable." ,
type : "number" ,
value : "5" ,
default_value : "3" ,
required : false ,
sensitive : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-02 13:11:16 +00:00
export const MockTemplateVersionVariable3 : TypesGen.TemplateVersionVariable = {
name : "third_variable" ,
description : "This is third variable." ,
type : "bool" ,
value : "" ,
default_value : "false" ,
required : false ,
sensitive : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-02 13:11:16 +00:00
export const MockTemplateVersionVariable4 : TypesGen.TemplateVersionVariable = {
name : "fourth_variable" ,
description : "This is fourth variable." ,
type : "string" ,
value : "defghijk" ,
default_value : "" ,
required : true ,
sensitive : true ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-02 13:11:16 +00:00
export const MockTemplateVersionVariable5 : TypesGen.TemplateVersionVariable = {
name : "fifth_variable" ,
description : "This is fifth variable." ,
type : "string" ,
value : "" ,
default_value : "" ,
required : true ,
sensitive : false ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-02 13:11:16 +00:00
2022-09-29 18:32:38 +00:00
export const MockWorkspaceRequest : TypesGen.CreateWorkspaceRequest = {
name : "test" ,
2023-09-26 17:39:07 +00:00
template_version_id : "test-template-version" ,
rich_parameter_values : [ ] ,
2023-09-06 18:59:26 +00:00
} ;
2022-09-29 18:32:38 +00:00
2023-09-26 17:39:07 +00:00
export const MockWorkspaceRichParametersRequest : TypesGen.CreateWorkspaceRequest =
{
name : "test" ,
template_version_id : "test-template-version" ,
rich_parameter_values : [
{
name : MockTemplateVersionParameter1.name ,
value : MockTemplateVersionParameter1.default_value ,
} ,
] ,
} ;
2023-09-12 16:54:05 +00:00
export const MockUserAgent = {
2022-03-23 14:28:34 +00:00
browser : "Chrome 99.0.4844" ,
device : "Other" ,
ip_address : "11.22.33.44" ,
os : "Windows 10" ,
2023-09-06 18:59:26 +00:00
} ;
2022-04-23 22:58:57 +00:00
2023-11-02 17:51:23 +00:00
export const MockAuthMethodsPasswordOnly : TypesGen.AuthMethods = {
2023-01-31 18:33:25 +00:00
password : { enabled : true } ,
github : { enabled : false } ,
oidc : { enabled : false , signInText : "" , iconUrl : "" } ,
2023-09-06 18:59:26 +00:00
} ;
2023-06-30 12:38:48 +00:00
2023-11-02 17:51:23 +00:00
export const MockAuthMethodsExternal : TypesGen.AuthMethods = {
password : { enabled : false } ,
2023-06-30 12:38:48 +00:00
github : { enabled : true } ,
2023-11-02 17:51:23 +00:00
oidc : {
enabled : true ,
signInText : "Google" ,
iconUrl : "/icon/google.svg" ,
} ,
} ;
export const MockAuthMethodsAll : TypesGen.AuthMethods = {
password : { enabled : true } ,
github : { enabled : true } ,
oidc : {
enabled : true ,
signInText : "Google" ,
iconUrl : "/icon/google.svg" ,
} ,
2023-09-06 18:59:26 +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" ,
2023-09-06 18:59:26 +00:00
} ;
2022-05-19 20:34:42 +00:00
export const MockWorkspaceBuildLogs : TypesGen.ProvisionerJobLog [ ] = [
{
2022-11-07 02:50:34 +00:00
id : 1 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.005Z" ,
log_source : "provisioner_daemon" ,
log_level : "info" ,
stage : "Setting up" ,
output : "" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 2 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.006Z" ,
log_source : "provisioner_daemon" ,
log_level : "info" ,
stage : "Starting workspace" ,
output : "" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 3 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.072Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Starting workspace" ,
output : "" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 4 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.073Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Starting workspace" ,
output : "Initializing the backend..." ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 5 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.077Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Starting workspace" ,
output : "" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 6 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.078Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Starting workspace" ,
output : "Initializing provider plugins..." ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 7 ,
2022-05-19 20:34:42 +00:00
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"...' ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 8 ,
2022-05-19 20:34:42 +00:00
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"...' ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 9 ,
2022-05-19 20:34:42 +00:00
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" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 10 ,
2022-05-19 20:34:42 +00:00
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" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 11 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.388Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Starting workspace" ,
output : "" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 12 ,
2022-05-19 20:34:42 +00:00
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
} ,
{
2022-11-07 02:50:34 +00:00
id : 13 ,
2022-05-19 20:34:42 +00:00
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
} ,
{
2022-11-07 02:50:34 +00:00
id : 14 ,
2022-05-19 20:34:42 +00:00
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
} ,
{
2022-11-07 02:50:34 +00:00
id : 15 ,
2022-05-19 20:34:42 +00:00
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.' ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 16 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.39Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Starting workspace" ,
output : "" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 17 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.391Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Starting workspace" ,
output : "Terraform has been successfully initialized!" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 18 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:31.42Z" ,
log_source : "provisioner" ,
log_level : "info" ,
stage : "Starting workspace" ,
output : "Terraform 1.1.9" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 19 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:33.537Z" ,
log_source : "provisioner" ,
log_level : "info" ,
stage : "Starting workspace" ,
output : "coder_agent.dev: Plan to create" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 20 ,
2022-05-19 20:34:42 +00:00
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" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 21 ,
2022-05-19 20:34:42 +00:00
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" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 22 ,
2022-05-19 20:34:42 +00:00
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." ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 23 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:33.712Z" ,
log_source : "provisioner" ,
log_level : "info" ,
stage : "Starting workspace" ,
output : "coder_agent.dev: Creating..." ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 24 ,
2022-05-19 20:34:42 +00:00
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
} ,
{
2022-11-07 02:50:34 +00:00
id : 25 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:34.139Z" ,
log_source : "provisioner" ,
log_level : "info" ,
stage : "Starting workspace" ,
output : "google_compute_disk.root: Creating..." ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 26 ,
2022-05-19 20:34:42 +00:00
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]" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 27 ,
2022-05-19 20:34:42 +00:00
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]" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 28 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:45:47.118Z" ,
log_source : "provisioner" ,
log_level : "info" ,
stage : "Starting workspace" ,
output : "google_compute_instance.dev[0]: Creating..." ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 29 ,
2022-05-19 20:34:42 +00:00
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]" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 30 ,
2022-05-19 20:34:42 +00:00
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]" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 31 ,
2022-05-19 20:34:42 +00:00
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." ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 32 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:46:00.847Z" ,
log_source : "provisioner" ,
log_level : "info" ,
stage : "Starting workspace" ,
output : "Outputs: 0" ,
} ,
{
2022-11-07 02:50:34 +00:00
id : 33 ,
2022-05-19 20:34:42 +00:00
created_at : "2022-05-19T16:46:02.283Z" ,
log_source : "provisioner_daemon" ,
log_level : "info" ,
stage : "Cleaning Up" ,
output : "" ,
} ,
2023-09-06 18:59:26 +00:00
] ;
2022-05-25 21:58:00 +00:00
2023-08-28 17:27:51 +00:00
export const MockWorkspaceExtendedBuildLogs : TypesGen.ProvisionerJobLog [ ] = [
{
id : 938494 ,
created_at : "2023-08-25T19:07:43.331Z" ,
log_source : "provisioner_daemon" ,
log_level : "info" ,
stage : "Setting up" ,
output : "" ,
} ,
{
id : 938495 ,
created_at : "2023-08-25T19:07:43.331Z" ,
log_source : "provisioner_daemon" ,
log_level : "info" ,
stage : "Parsing template parameters" ,
output : "" ,
} ,
{
id : 938496 ,
created_at : "2023-08-25T19:07:43.339Z" ,
log_source : "provisioner_daemon" ,
log_level : "info" ,
stage : "Detecting persistent resources" ,
output : "" ,
} ,
{
id : 938497 ,
created_at : "2023-08-25T19:07:44.15Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : "Initializing the backend..." ,
} ,
{
id : 938498 ,
created_at : "2023-08-25T19:07:44.215Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : "Initializing provider plugins..." ,
} ,
{
id : 938499 ,
created_at : "2023-08-25T19:07:44.216Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : '- Finding coder/coder versions matching "~> 0.11.0"...' ,
} ,
{
id : 938500 ,
created_at : "2023-08-25T19:07:44.668Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : '- Finding kreuzwerker/docker versions matching "~> 3.0.1"...' ,
} ,
{
id : 938501 ,
created_at : "2023-08-25T19:07:44.722Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : "- Using coder/coder v0.11.1 from the shared cache directory" ,
} ,
{
id : 938502 ,
created_at : "2023-08-25T19:07:44.857Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : "- Using kreuzwerker/docker v3.0.2 from the shared cache directory" ,
} ,
{
id : 938503 ,
created_at : "2023-08-25T19:07:45.081Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output :
"Terraform has created a lock file .terraform.lock.hcl to record the provider" ,
} ,
{
id : 938504 ,
created_at : "2023-08-25T19:07:45.081Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output :
"selections it made above. Include this file in your version control repository" ,
} ,
{
id : 938505 ,
created_at : "2023-08-25T19:07:45.081Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output :
"so that Terraform can guarantee to make the same selections by default when" ,
} ,
{
id : 938506 ,
created_at : "2023-08-25T19:07:45.082Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : 'you run "terraform init" in the future.' ,
} ,
{
id : 938507 ,
created_at : "2023-08-25T19:07:45.083Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : "Terraform has been successfully initialized!" ,
} ,
{
id : 938508 ,
created_at : "2023-08-25T19:07:45.084Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output :
'You may now begin working with Terraform. Try running "terraform plan" to see' ,
} ,
{
id : 938509 ,
created_at : "2023-08-25T19:07:45.084Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output :
"any changes that are required for your infrastructure. All Terraform commands" ,
} ,
{
id : 938510 ,
created_at : "2023-08-25T19:07:45.084Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : "should now work." ,
} ,
{
id : 938511 ,
created_at : "2023-08-25T19:07:45.084Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output :
"If you ever set or change modules or backend configuration for Terraform," ,
} ,
{
id : 938512 ,
created_at : "2023-08-25T19:07:45.084Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output :
"rerun this command to reinitialize your working directory. If you forget, other" ,
} ,
{
id : 938513 ,
created_at : "2023-08-25T19:07:45.084Z" ,
log_source : "provisioner" ,
log_level : "debug" ,
stage : "Detecting persistent resources" ,
output : "commands will detect it and remind you to do so if necessary." ,
} ,
{
id : 938514 ,
created_at : "2023-08-25T19:07:45.143Z" ,
log_source : "provisioner" ,
log_level : "info" ,
stage : "Detecting persistent resources" ,
output : "Terraform 1.1.9" ,
} ,
{
id : 938515 ,
created_at : "2023-08-25T19:07:46.297Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : "Warning: Argument is deprecated" ,
} ,
{
id : 938516 ,
created_at : "2023-08-25T19:07:46.297Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : 'on devcontainer-on-docker.tf line 15, in provider "coder":' ,
} ,
{
id : 938517 ,
created_at : "2023-08-25T19:07:46.297Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : " 15: feature_use_managed_variables = true" ,
} ,
{
id : 938518 ,
created_at : "2023-08-25T19:07:46.297Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : "" ,
} ,
{
id : 938519 ,
created_at : "2023-08-25T19:07:46.297Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output :
"Terraform variables are now exclusively utilized for template-wide variables after the removal of support for legacy parameters." ,
} ,
{
id : 938520 ,
created_at : "2023-08-25T19:07:46.3Z" ,
log_source : "provisioner" ,
log_level : "error" ,
stage : "Detecting persistent resources" ,
output : "Error: ephemeral parameter requires the default property" ,
} ,
{
id : 938521 ,
created_at : "2023-08-25T19:07:46.3Z" ,
log_source : "provisioner" ,
log_level : "error" ,
stage : "Detecting persistent resources" ,
output :
'on devcontainer-on-docker.tf line 27, in data "coder_parameter" "another_one":' ,
} ,
{
id : 938522 ,
created_at : "2023-08-25T19:07:46.3Z" ,
log_source : "provisioner" ,
log_level : "error" ,
stage : "Detecting persistent resources" ,
output : ' 27: data "coder_parameter" "another_one" {' ,
} ,
{
id : 938523 ,
created_at : "2023-08-25T19:07:46.301Z" ,
log_source : "provisioner" ,
log_level : "error" ,
stage : "Detecting persistent resources" ,
output : "" ,
} ,
{
id : 938524 ,
created_at : "2023-08-25T19:07:46.301Z" ,
log_source : "provisioner" ,
log_level : "error" ,
stage : "Detecting persistent resources" ,
output : "" ,
} ,
{
id : 938525 ,
created_at : "2023-08-25T19:07:46.303Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : "Warning: Argument is deprecated" ,
} ,
{
id : 938526 ,
created_at : "2023-08-25T19:07:46.303Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : 'on devcontainer-on-docker.tf line 15, in provider "coder":' ,
} ,
{
id : 938527 ,
created_at : "2023-08-25T19:07:46.303Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : " 15: feature_use_managed_variables = true" ,
} ,
{
id : 938528 ,
created_at : "2023-08-25T19:07:46.303Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output : "" ,
} ,
{
id : 938529 ,
created_at : "2023-08-25T19:07:46.303Z" ,
log_source : "provisioner" ,
log_level : "warn" ,
stage : "Detecting persistent resources" ,
output :
"Terraform variables are now exclusively utilized for template-wide variables after the removal of support for legacy parameters." ,
} ,
{
id : 938530 ,
created_at : "2023-08-25T19:07:46.311Z" ,
log_source : "provisioner_daemon" ,
log_level : "info" ,
stage : "Cleaning Up" ,
output : "" ,
} ,
2023-09-06 18:59:26 +00:00
] ;
2023-08-28 17:27:51 +00:00
2022-05-25 21:58:00 +00:00
export const MockCancellationMessage = {
message : "Job successfully canceled" ,
2023-09-06 18:59:26 +00:00
} ;
2022-07-28 17:18:51 +00:00
2022-10-25 00:55:44 +00:00
type MockAPIInput = {
2023-09-06 18:59:26 +00:00
message? : string ;
detail? : string ;
validations? : FieldError [ ] ;
} ;
2022-10-25 00:55:44 +00:00
type MockAPIOutput = {
2023-09-06 18:59:26 +00:00
isAxiosError : true ;
2022-10-25 00:55:44 +00:00
response : {
data : {
2023-09-06 18:59:26 +00:00
message : string ;
detail : string | undefined ;
validations : FieldError [ ] | undefined ;
} ;
} ;
} ;
2022-10-25 00:55:44 +00:00
2023-05-04 17:30:48 +00:00
export const mockApiError = ( {
2024-01-12 23:06:02 +00:00
message = "Something went wrong." ,
2022-10-25 00:55:44 +00:00
detail ,
validations ,
2023-05-04 17:30:48 +00:00
} : MockAPIInput ) : MockAPIOutput = > ( {
// This is how axios can check if it is an axios error when calling isAxiosError
isAxiosError : true ,
2022-07-28 17:18:51 +00:00
response : {
data : {
2024-01-12 23:06:02 +00:00
message ,
detail ,
validations ,
2022-07-28 17:18:51 +00:00
} ,
} ,
2023-09-06 18:59:26 +00:00
} ) ;
2022-08-23 15:26:22 +00:00
export const MockEntitlements : TypesGen.Entitlements = {
2022-10-17 13:43:30 +00:00
errors : [ ] ,
2022-08-23 15:26:22 +00:00
warnings : [ ] ,
has_license : false ,
2023-08-30 13:08:42 +00:00
features : withDefaultFeatures ( {
workspace_batch_actions : {
enabled : true ,
entitlement : "entitled" ,
} ,
} ) ,
2023-02-14 20:26:47 +00:00
require_telemetry : false ,
2022-10-07 00:28:22 +00:00
trial : false ,
2023-08-22 14:26:43 +00:00
refreshed_at : "2022-05-20T16:45:57.122Z" ,
2023-09-06 18:59:26 +00:00
} ;
2022-08-23 15:26:22 +00:00
export const MockEntitlementsWithWarnings : TypesGen.Entitlements = {
2022-10-17 13:43:30 +00:00
errors : [ ] ,
2022-08-23 15:26:22 +00:00
warnings : [ "You are over your active user limit." , "And another thing." ] ,
has_license : true ,
2022-10-07 00:28:22 +00:00
trial : false ,
2023-02-14 20:26:47 +00:00
require_telemetry : false ,
2023-08-22 14:26:43 +00:00
refreshed_at : "2022-05-20T16:45:57.122Z" ,
2023-01-17 23:04:29 +00:00
features : withDefaultFeatures ( {
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" ,
} ,
2023-01-17 23:04:29 +00:00
} ) ,
2023-09-06 18:59:26 +00:00
} ;
2022-08-25 23:20:31 +00:00
export const MockEntitlementsWithAuditLog : TypesGen.Entitlements = {
2022-10-17 13:43:30 +00:00
errors : [ ] ,
2022-08-25 23:20:31 +00:00
warnings : [ ] ,
has_license : true ,
2023-02-14 20:26:47 +00:00
require_telemetry : false ,
2022-10-07 00:28:22 +00:00
trial : false ,
2023-08-22 14:26:43 +00:00
refreshed_at : "2022-05-20T16:45:57.122Z" ,
2023-01-17 23:04:29 +00:00
features : withDefaultFeatures ( {
2022-08-25 23:20:31 +00:00
audit_log : {
enabled : true ,
entitlement : "entitled" ,
} ,
2023-01-17 23:04:29 +00:00
} ) ,
2023-09-06 18:59:26 +00:00
} ;
2022-09-07 20:26:12 +00:00
2023-03-23 19:43:12 +00:00
export const MockEntitlementsWithScheduling : TypesGen.Entitlements = {
errors : [ ] ,
warnings : [ ] ,
has_license : true ,
require_telemetry : false ,
trial : false ,
2023-08-22 14:26:43 +00:00
refreshed_at : "2022-05-20T16:45:57.122Z" ,
2023-03-23 19:43:12 +00:00
features : withDefaultFeatures ( {
advanced_template_scheduling : {
enabled : true ,
entitlement : "entitled" ,
} ,
} ) ,
2023-09-06 18:59:26 +00:00
} ;
2023-03-23 19:43:12 +00:00
2023-10-09 11:38:41 +00:00
export const MockEntitlementsWithUserLimit : TypesGen.Entitlements = {
errors : [ ] ,
warnings : [ ] ,
has_license : true ,
require_telemetry : false ,
trial : false ,
refreshed_at : "2022-05-20T16:45:57.122Z" ,
features : withDefaultFeatures ( {
user_limit : {
enabled : true ,
entitlement : "entitled" ,
limit : 25 ,
} ,
} ) ,
} ;
2024-01-11 21:03:10 +00:00
export const MockExperiments : TypesGen.Experiment [ ] = [ ] ;
2023-01-18 19:12:53 +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" ,
2023-03-06 18:36:19 +00:00
organization_id : MockOrganization.id ,
2022-09-07 20:26:12 +00:00
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" ,
2022-10-14 18:39:20 +00:00
diff : {
ttl : {
old : 0 ,
new : 3600000000000 ,
secret : false ,
} ,
} ,
2022-09-07 20:26:12 +00:00
status_code : 200 ,
2022-10-27 19:57:41 +00:00
additional_fields : { } ,
2022-11-21 16:30:41 +00:00
description : "{user} created workspace {target}" ,
2022-09-07 20:26:12 +00:00
user : MockUser ,
2022-12-02 20:14:45 +00:00
resource_link : "/@admin/bruno-dev" ,
is_deleted : false ,
2023-09-06 18:59:26 +00:00
} ;
2022-09-07 20:26:12 +00:00
export const MockAuditLog2 : TypesGen.AuditLog = {
. . . MockAuditLog ,
id : "53bded77-7b9d-4e82-8771-991a34d759f9" ,
action : "write" ,
2022-11-21 16:30:41 +00:00
time : "2022-05-20T16:45:57.122Z" ,
description : "{user} updated workspace {target}" ,
2022-09-07 20:26:12 +00:00
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
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-09-30 18:01:20 +00:00
2022-12-09 17:19:30 +00:00
export const MockWorkspaceCreateAuditLogForDifferentOwner = {
. . . MockAuditLog ,
additional_fields : {
2023-01-30 18:43:29 +00:00
workspace_owner : "Member" ,
2022-12-09 17:19:30 +00:00
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-12-09 17:19:30 +00:00
2022-10-27 19:57:41 +00:00
export const MockAuditLogWithWorkspaceBuild : TypesGen.AuditLog = {
. . . MockAuditLog ,
id : "f90995bf-4a2b-4089-b597-e66e025e523e" ,
request_id : "61555889-2875-475c-8494-f7693dd5d75b" ,
action : "stop" ,
resource_type : "workspace_build" ,
2022-12-02 20:14:45 +00:00
description : "{user} stopped build for workspace {target}" ,
2022-10-27 19:57:41 +00:00
additional_fields : {
2023-01-30 18:43:29 +00:00
workspace_name : "test2" ,
2022-10-27 19:57:41 +00:00
} ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-27 19:57:41 +00:00
2022-12-02 20:14:45 +00:00
export const MockAuditLogWithDeletedResource : TypesGen.AuditLog = {
. . . MockAuditLog ,
is_deleted : true ,
2023-09-06 18:59:26 +00:00
} ;
2022-12-02 20:14:45 +00:00
2023-01-19 22:47:53 +00:00
export const MockAuditLogGitSSH : TypesGen.AuditLog = {
. . . MockAuditLog ,
diff : {
private_key : {
old : "" ,
new : "" ,
secret : true ,
} ,
public_key : {
old : "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINRUPjBSNtOAnL22+r07OSu9t3Lnm8/5OX8bRHECKS9g\n" ,
new : "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEwoUPJPMekuSzMZyV0rA82TGGNzw/Uj/dhLbwiczTpV\n" ,
secret : false ,
} ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-01-19 22:47:53 +00:00
2023-06-30 12:38:48 +00:00
export const MockAuditOauthConvert : TypesGen.AuditLog = {
. . . MockAuditLog ,
resource_type : "convert_login" ,
resource_target : "oidc" ,
action : "create" ,
status_code : 201 ,
description : "{user} created login type conversion to {target}}" ,
diff : {
created_at : {
old : "0001-01-01T00:00:00Z" ,
new : "2023-06-20T20:44:54.243019Z" ,
secret : false ,
} ,
expires_at : {
old : "0001-01-01T00:00:00Z" ,
new : "2023-06-20T20:49:54.243019Z" ,
secret : false ,
} ,
state_string : {
old : "" ,
new : "" ,
secret : true ,
} ,
to_type : {
old : "" ,
new : "oidc" ,
secret : false ,
} ,
user_id : {
old : "" ,
new : "dc790496-eaec-4f88-a53f-8ce1f61a1fff" ,
secret : false ,
} ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-06-30 12:38:48 +00:00
2023-02-06 20:12:50 +00:00
export const MockAuditLogSuccessfulLogin : TypesGen.AuditLog = {
. . . MockAuditLog ,
resource_type : "api_key" ,
resource_target : "" ,
action : "login" ,
status_code : 201 ,
description : "{user} logged in" ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-06 20:12:50 +00:00
export const MockAuditLogUnsuccessfulLoginKnownUser : TypesGen.AuditLog = {
. . . MockAuditLogSuccessfulLogin ,
status_code : 401 ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-06 20:12:50 +00:00
2022-09-30 18:01:20 +00:00
export const MockWorkspaceQuota : TypesGen.WorkspaceQuota = {
2022-11-14 17:57:33 +00:00
credits_consumed : 0 ,
budget : 100 ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-10 20:37:06 +00:00
export const MockGroup : TypesGen.Group = {
id : "fbd2116a-8961-4954-87ae-e4575bd29ce0" ,
name : "Front-End" ,
2023-08-02 15:53:06 +00:00
display_name : "Front-End" ,
2022-10-17 22:46:01 +00:00
avatar_url : "https://example.com" ,
2022-10-10 20:37:06 +00:00
organization_id : MockOrganization.id ,
members : [ MockUser , MockUser2 ] ,
2022-11-14 17:57:33 +00:00
quota_allowance : 5 ,
2023-08-08 16:37:49 +00:00
source : "user" ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-10 20:37:06 +00:00
2023-10-20 12:33:07 +00:00
const everyOneGroup = ( organizationId : string ) : TypesGen . Group = > ( {
id : organizationId ,
name : "Everyone" ,
display_name : "" ,
organization_id : organizationId ,
members : [ ] ,
avatar_url : "" ,
quota_allowance : 0 ,
source : "user" ,
} ) ;
2022-10-10 20:37:06 +00:00
export const MockTemplateACL : TypesGen.TemplateACL = {
2022-10-11 18:17:19 +00:00
group : [
2022-10-12 19:33:21 +00:00
{ . . . everyOneGroup ( MockOrganization . id ) , role : "use" } ,
2022-10-11 18:17:19 +00:00
{ . . . MockGroup , role : "admin" } ,
] ,
2022-10-12 19:33:21 +00:00
users : [ { . . . MockUser , role : "use" } ] ,
2023-09-06 18:59:26 +00:00
} ;
2022-10-10 20:37:06 +00:00
export const MockTemplateACLEmpty : TypesGen.TemplateACL = {
group : [ ] ,
users : [ ] ,
2023-09-06 18:59:26 +00:00
} ;
2022-12-21 21:07:00 +00:00
export const MockTemplateExample : TypesGen.TemplateExample = {
id : "aws-windows" ,
url : "https://github.com/coder/coder/tree/main/examples/templates/aws-windows" ,
name : "Develop in an ECS-hosted container" ,
description : "Get started with Linux development on AWS ECS." ,
markdown :
"\n# aws-ecs\n\nThis is a sample template for running a Coder workspace on ECS. It assumes there\nis a pre-existing ECS cluster with EC2-based compute to host the workspace.\n\n## Architecture\n\nThis workspace is built using the following AWS resources:\n\n- Task definition - the container definition, includes the image, command, volume(s)\n- ECS service - manages the task definition\n\n## code-server\n\n`code-server` is installed via the `startup_script` argument in the `coder_agent`\nresource block. The `coder_app` resource is defined to access `code-server` through\nthe dashboard UI over `localhost:13337`.\n" ,
2024-01-08 21:12:40 +00:00
icon : "/icon/aws.svg" ,
2022-12-21 21:07:00 +00:00
tags : [ "aws" , "cloud" ] ,
2023-09-06 18:59:26 +00:00
} ;
2022-12-21 21:07:00 +00:00
export const MockTemplateExample2 : TypesGen.TemplateExample = {
id : "aws-linux" ,
url : "https://github.com/coder/coder/tree/main/examples/templates/aws-linux" ,
name : "Develop in Linux on AWS EC2" ,
description : "Get started with Linux development on AWS EC2." ,
markdown :
'\n# aws-linux\n\nTo get started, run `coder templates init`. When prompted, select this template.\nFollow the on-screen instructions to proceed.\n\n## Authentication\n\nThis template assumes that coderd is run in an environment that is authenticated\nwith AWS. For example, run `aws configure import` to import credentials on the\nsystem and user running coderd. For other ways to authenticate [consult the\nTerraform docs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#authentication-and-configuration).\n\n## Required permissions / policy\n\nThe following sample policy allows Coder to create EC2 instances and modify\ninstances provisioned by Coder:\n\n```json\n{\n "Version": "2012-10-17",\n "Statement": [\n {\n "Sid": "VisualEditor0",\n "Effect": "Allow",\n "Action": [\n "ec2:GetDefaultCreditSpecification",\n "ec2:DescribeIamInstanceProfileAssociations",\n "ec2:DescribeTags",\n "ec2:CreateTags",\n "ec2:RunInstances",\n "ec2:DescribeInstanceCreditSpecifications",\n "ec2:DescribeImages",\n "ec2:ModifyDefaultCreditSpecification",\n "ec2:DescribeVolumes"\n ],\n "Resource": "*"\n },\n {\n "Sid": "CoderResources",\n "Effect": "Allow",\n "Action": [\n "ec2:DescribeInstances",\n "ec2:DescribeInstanceAttribute",\n "ec2:UnmonitorInstances",\n "ec2:TerminateInstances",\n "ec2:StartInstances",\n "ec2:StopInstances",\n "ec2:DeleteTags",\n "ec2:MonitorInstances",\n "ec2:CreateTags",\n "ec2:RunInstances",\n "ec2:ModifyInstanceAttribute",\n "ec2:ModifyInstanceCreditSpecification"\n ],\n "Resource": "arn:aws:ec2:*:*:instance/*",\n "Condition": {\n "StringEquals": {\n "aws:ResourceTag/Coder_Provisioned": "true"\n }\n }\n }\n ]\n}\n```\n\n## code-server\n\n`code-server` is installed via the `startup_script` argument in the `coder_agent`\nresource block. The `coder_app` resource is defined to access `code-server` through\nthe dashboard UI over `localhost:13337`.\n' ,
2024-01-08 21:12:40 +00:00
icon : "/icon/aws.svg" ,
2022-12-21 21:07:00 +00:00
tags : [ "aws" , "cloud" ] ,
2023-09-06 18:59:26 +00:00
} ;
2022-12-21 21:07:00 +00:00
export const MockPermissions : Permissions = {
createGroup : true ,
createTemplates : true ,
createUser : true ,
deleteTemplates : true ,
2023-09-25 20:54:19 +00:00
updateTemplates : true ,
2022-12-21 21:07:00 +00:00
readAllUsers : true ,
updateUsers : true ,
viewAuditLog : true ,
2023-03-07 21:10:01 +00:00
viewDeploymentValues : true ,
2023-01-13 16:48:45 +00:00
viewUpdateCheck : true ,
2023-03-09 03:05:45 +00:00
viewDeploymentStats : true ,
2023-09-30 19:30:01 +00:00
viewExternalAuthConfig : true ,
2023-06-30 15:32:35 +00:00
editWorkspaceProxies : true ,
2023-09-06 18:59:26 +00:00
} ;
2023-01-04 21:31:45 +00:00
2023-09-12 16:54:05 +00:00
export const MockDeploymentConfig : DeploymentConfig = {
2023-06-29 13:22:21 +00:00
config : {
enable_terraform_debug_mode : true ,
} ,
options : [ ] ,
2023-09-06 18:59:26 +00:00
} ;
2023-06-29 13:22:21 +00:00
2023-09-14 22:35:03 +00:00
export const MockAppearanceConfig : TypesGen.AppearanceConfig = {
2023-09-27 15:02:18 +00:00
application_name : "" ,
2023-01-04 21:31:45 +00:00
logo_url : "" ,
service_banner : {
enabled : false ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-01-17 22:56:29 +00:00
2023-02-01 17:13:11 +00:00
export const MockWorkspaceBuildParameter1 : TypesGen.WorkspaceBuildParameter = {
name : MockTemplateVersionParameter1.name ,
value : "mock-abc" ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-01 17:13:11 +00:00
export const MockWorkspaceBuildParameter2 : TypesGen.WorkspaceBuildParameter = {
name : MockTemplateVersionParameter2.name ,
value : "3" ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-01 17:13:11 +00:00
2023-05-03 17:40:47 +00:00
export const MockWorkspaceBuildParameter3 : TypesGen.WorkspaceBuildParameter = {
name : MockTemplateVersionParameter3.name ,
value : "my-database" ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-03 17:40:47 +00:00
2023-09-04 00:56:25 +00:00
export const MockWorkspaceBuildParameter4 : TypesGen.WorkspaceBuildParameter = {
name : MockTemplateVersionParameter4.name ,
value : "immutable-value" ,
2023-09-06 18:59:26 +00:00
} ;
2023-09-04 00:56:25 +00:00
2023-02-07 08:36:13 +00:00
export const MockWorkspaceBuildParameter5 : TypesGen.WorkspaceBuildParameter = {
name : MockTemplateVersionParameter5.name ,
value : "5" ,
2023-09-06 18:59:26 +00:00
} ;
2023-02-07 08:36:13 +00:00
2023-09-29 19:13:20 +00:00
export const MockTemplateVersionExternalAuthGithub : TypesGen.TemplateVersionExternalAuth =
{
id : "github" ,
type : "github" ,
2023-10-03 14:04:39 +00:00
authenticate_url : "https://example.com/external-auth/github" ,
2023-09-29 19:13:20 +00:00
authenticated : false ,
2023-10-03 14:04:39 +00:00
display_icon : "/icon/github.svg" ,
display_name : "GitHub" ,
2023-09-29 19:13:20 +00:00
} ;
2023-03-09 03:05:45 +00:00
2023-09-29 19:13:20 +00:00
export const MockTemplateVersionExternalAuthGithubAuthenticated : TypesGen.TemplateVersionExternalAuth =
2023-09-26 17:39:07 +00:00
{
id : "github" ,
type : "github" ,
2023-10-03 14:04:39 +00:00
authenticate_url : "https://example.com/external-auth/github" ,
2023-09-26 17:39:07 +00:00
authenticated : true ,
2023-10-03 14:04:39 +00:00
display_icon : "/icon/github.svg" ,
display_name : "GitHub" ,
2023-09-26 17:39:07 +00:00
} ;
2023-03-09 03:05:45 +00:00
export const MockDeploymentStats : TypesGen.DeploymentStats = {
aggregated_from : "2023-03-06T19:08:55.211625Z" ,
collected_at : "2023-03-06T19:12:55.211625Z" ,
next_update_at : "2023-03-06T19:20:55.211625Z" ,
session_count : {
vscode : 128 ,
jetbrains : 5 ,
ssh : 32 ,
reconnecting_pty : 15 ,
} ,
workspaces : {
building : 15 ,
failed : 12 ,
pending : 5 ,
running : 32 ,
stopped : 16 ,
connection_latency_ms : {
P50 : 32.56 ,
P95 : 15.23 ,
} ,
rx_bytes : 15613513253 ,
tx_bytes : 36113513253 ,
} ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-04 18:40:41 +00:00
export const MockDeploymentSSH : TypesGen.SSHConfigResponse = {
hostname_prefix : " coder." ,
ssh_config_options : { } ,
2023-09-06 18:59:26 +00:00
} ;
2023-05-04 18:40:41 +00:00
2023-07-28 15:57:23 +00:00
export const MockWorkspaceAgentLogs : TypesGen.WorkspaceAgentLog [ ] = [
2023-05-04 18:40:41 +00:00
{
id : 166663 ,
created_at : "2023-05-04T11:30:41.402072Z" ,
output : "+ curl -fsSL https://code-server.dev/install.sh" ,
level : "info" ,
2023-09-25 21:47:17 +00:00
source_id : MockWorkspaceAgentLogSource.id ,
2023-05-04 18:40:41 +00:00
} ,
{
id : 166664 ,
created_at : "2023-05-04T11:30:41.40228Z" ,
output :
"+ sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.8.3" ,
level : "info" ,
2023-09-25 21:47:17 +00:00
source_id : MockWorkspaceAgentLogSource.id ,
2023-05-04 18:40:41 +00:00
} ,
{
id : 166665 ,
created_at : "2023-05-04T11:30:42.590731Z" ,
output : "Ubuntu 22.04.2 LTS" ,
level : "info" ,
2023-09-25 21:47:17 +00:00
source_id : MockWorkspaceAgentLogSource.id ,
2023-05-04 18:40:41 +00:00
} ,
{
id : 166666 ,
created_at : "2023-05-04T11:30:42.593686Z" ,
output : "Installing v4.8.3 of the amd64 release from GitHub." ,
level : "info" ,
2023-09-25 21:47:17 +00:00
source_id : MockWorkspaceAgentLogSource.id ,
2023-05-04 18:40:41 +00:00
} ,
2023-09-06 18:59:26 +00:00
] ;
2023-05-25 18:37:51 +00:00
export const MockLicenseResponse : GetLicensesResponse [ ] = [
{
id : 1 ,
uploaded_at : "1660104000" ,
expires_at : "3420244800" , // expires on 5/20/2078
uuid : "1" ,
claims : {
trial : false ,
all_features : true ,
version : 1 ,
features : { } ,
license_expires : 3420244800 ,
} ,
} ,
{
id : 1 ,
uploaded_at : "1660104000" ,
expires_at : "1660104000" , // expired on 8/10/2022
uuid : "1" ,
claims : {
trial : false ,
all_features : true ,
version : 1 ,
features : { } ,
license_expires : 1660104000 ,
} ,
} ,
{
id : 1 ,
uploaded_at : "1682346425" ,
expires_at : "1682346425" , // expired on 4/24/2023
uuid : "1" ,
claims : {
trial : false ,
all_features : true ,
version : 1 ,
features : { } ,
license_expires : 1682346425 ,
} ,
} ,
2023-09-06 18:59:26 +00:00
] ;
2023-08-02 17:49:24 +00:00
2023-11-13 14:58:57 +00:00
export const MockHealth : TypesGen.HealthcheckReport = {
2023-08-02 17:49:24 +00:00
time : "2023-08-01T16:51:03.29792825Z" ,
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-13 14:58:57 +00:00
failing_sections : [ ] ,
2023-08-02 17:49:24 +00:00
derp : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-08-02 17:49:24 +00:00
regions : {
"999" : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
region : {
EmbeddedRelay : true ,
RegionID : 999 ,
RegionCode : "coder" ,
RegionName : "Council Bluffs, Iowa" ,
Nodes : [
{
Name : "999stun0" ,
RegionID : 999 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
{
Name : "999b" ,
RegionID : 999 ,
HostName : "dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
] ,
} ,
node_reports : [
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "999stun0" ,
RegionID : 999 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : false ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "0" ,
round_trip_ping_ms : 0 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [ ] ,
client_errs : [ ] ,
stun : {
Enabled : true ,
CanSTUN : true ,
} ,
} ,
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "999b" ,
RegionID : 999 ,
HostName : "dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : true ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "7674330" ,
round_trip_ping_ms : 7674330 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [
[
"derphttp.Client.Connect: connecting to https://dev.coder.com/derp" ,
] ,
[
"derphttp.Client.Connect: connecting to https://dev.coder.com/derp" ,
] ,
] ,
client_errs : [ [ ] , [ ] ] ,
stun : {
Enabled : false ,
CanSTUN : false ,
} ,
} ,
] ,
} ,
"10007" : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
region : {
EmbeddedRelay : false ,
RegionID : 10007 ,
RegionCode : "coder_sydney" ,
RegionName : "sydney" ,
Nodes : [
{
Name : "10007stun0" ,
RegionID : 10007 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
{
Name : "10007a" ,
RegionID : 10007 ,
HostName : "sydney.dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
] ,
} ,
node_reports : [
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "10007stun0" ,
RegionID : 10007 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : false ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "0" ,
round_trip_ping_ms : 0 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [ ] ,
client_errs : [ ] ,
stun : {
Enabled : true ,
CanSTUN : true ,
} ,
} ,
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "10007a" ,
RegionID : 10007 ,
HostName : "sydney.dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : true ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "170527034" ,
round_trip_ping_ms : 170527034 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [
[
"derphttp.Client.Connect: connecting to https://sydney.dev.coder.com/derp" ,
] ,
[
"derphttp.Client.Connect: connecting to https://sydney.dev.coder.com/derp" ,
] ,
] ,
client_errs : [ [ ] , [ ] ] ,
stun : {
Enabled : false ,
CanSTUN : false ,
} ,
} ,
] ,
} ,
"10008" : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
region : {
EmbeddedRelay : false ,
RegionID : 10008 ,
RegionCode : "coder_europe-frankfurt" ,
RegionName : "europe-frankfurt" ,
Nodes : [
{
Name : "10008stun0" ,
RegionID : 10008 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
{
Name : "10008a" ,
RegionID : 10008 ,
HostName : "europe.dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
] ,
} ,
node_reports : [
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "10008stun0" ,
RegionID : 10008 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : false ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "0" ,
round_trip_ping_ms : 0 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [ ] ,
client_errs : [ ] ,
stun : {
Enabled : true ,
CanSTUN : true ,
} ,
} ,
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "10008a" ,
RegionID : 10008 ,
HostName : "europe.dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : true ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "111329690" ,
round_trip_ping_ms : 111329690 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [
[
"derphttp.Client.Connect: connecting to https://europe.dev.coder.com/derp" ,
] ,
[
"derphttp.Client.Connect: connecting to https://europe.dev.coder.com/derp" ,
] ,
] ,
client_errs : [ [ ] , [ ] ] ,
stun : {
Enabled : false ,
CanSTUN : false ,
} ,
} ,
] ,
} ,
"10009" : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
region : {
EmbeddedRelay : false ,
RegionID : 10009 ,
RegionCode : "coder_brazil-saopaulo" ,
RegionName : "brazil-saopaulo" ,
Nodes : [
{
Name : "10009stun0" ,
RegionID : 10009 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
{
Name : "10009a" ,
RegionID : 10009 ,
HostName : "brazil.dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
] ,
} ,
node_reports : [
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "10009stun0" ,
RegionID : 10009 ,
HostName : "stun.l.google.com" ,
STUNPort : 19302 ,
STUNOnly : true ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : false ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "0" ,
round_trip_ping_ms : 0 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [ ] ,
client_errs : [ ] ,
stun : {
Enabled : true ,
CanSTUN : true ,
} ,
} ,
{
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-08-02 17:49:24 +00:00
node : {
Name : "10009a" ,
RegionID : 10009 ,
HostName : "brazil.dev.coder.com" ,
STUNPort : - 1 ,
DERPPort : 443 ,
} ,
node_info : {
TokenBucketBytesPerSecond : 0 ,
TokenBucketBytesBurst : 0 ,
} ,
can_exchange_messages : true ,
2023-11-13 14:58:57 +00:00
round_trip_ping : "138185506" ,
round_trip_ping_ms : 138185506 ,
2023-08-02 17:49:24 +00:00
uses_websocket : false ,
client_logs : [
[
"derphttp.Client.Connect: connecting to https://brazil.dev.coder.com/derp" ,
] ,
[
"derphttp.Client.Connect: connecting to https://brazil.dev.coder.com/derp" ,
] ,
] ,
client_errs : [ [ ] , [ ] ] ,
stun : {
Enabled : false ,
CanSTUN : false ,
} ,
} ,
] ,
} ,
} ,
netcheck : {
UDP : true ,
IPv6 : false ,
IPv4 : true ,
IPv6CanSend : false ,
IPv4CanSend : true ,
OSHasIPv6 : true ,
ICMPv4 : false ,
MappingVariesByDestIP : false ,
HairPinning : null ,
UPnP : false ,
PMP : false ,
PCP : false ,
PreferredDERP : 999 ,
RegionLatency : {
"999" : 1638180 ,
"10007" : 174853022 ,
"10008" : 112142029 ,
"10009" : 138855606 ,
} ,
RegionV4Latency : {
"999" : 1638180 ,
"10007" : 174853022 ,
"10008" : 112142029 ,
"10009" : 138855606 ,
} ,
RegionV6Latency : { } ,
GlobalV4 : "34.71.26.24:55368" ,
GlobalV6 : "" ,
CaptivePortal : null ,
} ,
netcheck_logs : [
"netcheck: netcheck.runProbe: got STUN response for 10007stun0 from 34.71.26.24:55368 (9b07930007da49dd7df79bc7) in 1.791799ms" ,
"netcheck: netcheck.runProbe: got STUN response for 999stun0 from 34.71.26.24:55368 (7397fec097f1d5b01364566b) in 1.791529ms" ,
"netcheck: netcheck.runProbe: got STUN response for 10008stun0 from 34.71.26.24:55368 (1fdaaa016ca386485f097f68) in 2.192899ms" ,
"netcheck: netcheck.runProbe: got STUN response for 10009stun0 from 34.71.26.24:55368 (2596fe60895fbd9542823a76) in 2.146459ms" ,
"netcheck: netcheck.runProbe: got STUN response for 10007stun0 from 34.71.26.24:55368 (19ec320f3b76e8b027b06d3e) in 2.139619ms" ,
"netcheck: netcheck.runProbe: got STUN response for 999stun0 from 34.71.26.24:55368 (a17973bc57c35e606c0f46f5) in 2.131089ms" ,
"netcheck: netcheck.runProbe: got STUN response for 10008stun0 from 34.71.26.24:55368 (c958e15209d139a6e410f13a) in 2.127549ms" ,
"netcheck: netcheck.runProbe: got STUN response for 10009stun0 from 34.71.26.24:55368 (284a1b64dff22f40a3514524) in 2.107549ms" ,
"netcheck: [v1] measureAllICMPLatency: listen ip4:icmp 0.0.0.0: socket: operation not permitted" ,
"netcheck: [v1] report: udp=true v6=false v6os=true mapvarydest=false hair= portmap= v4a=34.71.26.24:55368 derp=999 derpdist=999v4:2ms,10007v4:175ms,10008v4:112ms,10009v4:139ms" ,
] ,
} ,
access_url : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-11-17 15:00:49 +00:00
access_url : "https://dev.coder.com" ,
2023-08-02 17:49:24 +00:00
reachable : true ,
status_code : 200 ,
healthz_response : "OK" ,
} ,
websocket : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-11-13 14:58:57 +00:00
body : "" ,
code : 101 ,
2023-08-02 17:49:24 +00:00
} ,
database : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-08-02 17:49:24 +00:00
reachable : true ,
2023-11-13 14:58:57 +00:00
latency : "92570" ,
latency_ms : 92570 ,
2023-11-13 16:28:20 +00:00
threshold_ms : 92570 ,
2023-08-02 17:49:24 +00:00
} ,
2023-11-24 15:06:51 +00:00
workspace_proxy : {
healthy : true ,
2023-12-05 16:58:51 +00:00
severity : "warning" ,
warnings : [
{
code : "EWP04" ,
message :
'unhealthy: request to proxy failed: Get "http://127.0.0.1:3001/healthz-report": dial tcp 127.0.0.1:3001: connect: connection refused' ,
} ,
] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-12-05 16:58:51 +00:00
error : undefined ,
2023-11-24 15:06:51 +00:00
workspace_proxies : {
2023-12-05 16:58:51 +00:00
regions : [
{
id : "1a3e5eb8-d785-4f7d-9188-2eeab140cd06" ,
name : "primary" ,
display_name : "Council Bluffs, Iowa" ,
icon_url : "/emojis/1f3e1.png" ,
healthy : true ,
path_app_url : "https://dev.coder.com" ,
wildcard_hostname : "*--apps.dev.coder.com" ,
derp_enabled : false ,
derp_only : false ,
status : {
status : "ok" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.829032482Z" ,
} ,
created_at : "0001-01-01T00:00:00Z" ,
updated_at : "0001-01-01T00:00:00Z" ,
deleted : false ,
version : "" ,
} ,
{
id : "2876ab4d-bcee-4643-944f-d86323642840" ,
name : "sydney" ,
display_name : "Sydney GCP" ,
icon_url : "/emojis/1f1e6-1f1fa.png" ,
healthy : true ,
path_app_url : "https://sydney.dev.coder.com" ,
wildcard_hostname : "*--apps.sydney.dev.coder.com" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "ok" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-05-01T19:15:56.606593Z" ,
updated_at : "2023-12-05T14:13:36.647535Z" ,
deleted : false ,
2023-12-20 00:03:00 +00:00
version : "v2.5.0-devel+5fad61102" ,
2023-12-05 16:58:51 +00:00
} ,
{
id : "9d786ce0-55b1-4ace-8acc-a4672ff8d41f" ,
name : "europe-frankfurt" ,
display_name : "Europe GCP (Frankfurt)" ,
icon_url : "/emojis/1f1e9-1f1ea.png" ,
healthy : true ,
path_app_url : "https://europe.dev.coder.com" ,
wildcard_hostname : "*--apps.europe.dev.coder.com" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "ok" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-05-01T20:34:11.114005Z" ,
updated_at : "2023-12-05T14:13:45.941716Z" ,
deleted : false ,
2023-12-20 00:03:00 +00:00
version : "v2.5.0-devel+5fad61102" ,
2023-12-05 16:58:51 +00:00
} ,
{
id : "2e209786-73b1-4838-ba78-e01c9334450a" ,
name : "brazil-saopaulo" ,
display_name : "Brazil GCP (Sao Paulo)" ,
icon_url : "/emojis/1f1e7-1f1f7.png" ,
healthy : true ,
path_app_url : "https://brazil.dev.coder.com" ,
wildcard_hostname : "*--apps.brazil.dev.coder.com" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "ok" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-05-01T20:41:02.76448Z" ,
updated_at : "2023-12-05T14:13:41.968568Z" ,
deleted : false ,
2023-12-20 00:03:00 +00:00
version : "v2.5.0-devel+5fad61102" ,
2023-12-05 16:58:51 +00:00
} ,
{
id : "c272e80c-0cce-49d6-9782-1b5cf90398e8" ,
name : "unregistered" ,
display_name : "UnregisteredProxy" ,
icon_url : "/emojis/274c.png" ,
healthy : false ,
path_app_url : "" ,
wildcard_hostname : "" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "unregistered" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-07-10T14:51:11.539222Z" ,
updated_at : "2023-07-10T14:51:11.539223Z" ,
deleted : false ,
version : "" ,
} ,
{
id : "a3efbff1-587b-4677-80a4-dc4f892fed3e" ,
name : "unhealthy" ,
display_name : "Unhealthy" ,
icon_url : "/emojis/1f92e.png" ,
healthy : false ,
path_app_url : "http://127.0.0.1:3001" ,
wildcard_hostname : "" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "unreachable" ,
report : {
errors : [
'request to proxy failed: Get "http://127.0.0.1:3001/healthz-report": dial tcp 127.0.0.1:3001: connect: connection refused' ,
] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-07-10T14:51:48.407017Z" ,
updated_at : "2023-07-10T14:51:57.993682Z" ,
deleted : false ,
version : "" ,
} ,
{
id : "b6cefb69-cb6f-46e2-9c9c-39c089fb7e42" ,
name : "paris-coder" ,
display_name : "Europe (Paris)" ,
icon_url : "/emojis/1f1eb-1f1f7.png" ,
healthy : true ,
path_app_url : "https://paris-coder.fly.dev" ,
wildcard_hostname : "" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "ok" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-12-01T09:21:15.996267Z" ,
updated_at : "2023-12-05T14:13:59.663174Z" ,
deleted : false ,
2023-12-20 00:03:00 +00:00
version : "v2.5.0-devel+5fad61102" ,
2023-12-05 16:58:51 +00:00
} ,
{
id : "72649dc9-03c7-46a8-bc95-96775e93ddc1" ,
name : "sydney-coder" ,
display_name : "Australia (Sydney)" ,
icon_url : "/emojis/1f1e6-1f1fa.png" ,
healthy : true ,
path_app_url : "https://sydney-coder.fly.dev" ,
wildcard_hostname : "" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "ok" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-12-01T09:23:44.505529Z" ,
updated_at : "2023-12-05T14:13:55.769058Z" ,
deleted : false ,
2023-12-20 00:03:00 +00:00
version : "v2.5.0-devel+5fad61102" ,
2023-12-05 16:58:51 +00:00
} ,
{
id : "1f78398f-e5ae-4c38-aa89-30222181d443" ,
name : "sao-paulo-coder" ,
display_name : "Brazil (Sau Paulo)" ,
icon_url : "/emojis/1f1e7-1f1f7.png" ,
healthy : true ,
path_app_url : "https://sao-paulo-coder.fly.dev" ,
wildcard_hostname : "" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "ok" ,
report : {
errors : [ ] ,
warnings : [ ] ,
} ,
checked_at : "2023-12-05T14:14:05.250322277Z" ,
} ,
created_at : "2023-12-01T09:36:00.231252Z" ,
updated_at : "2023-12-05T14:13:47.015031Z" ,
deleted : false ,
2023-12-20 00:03:00 +00:00
version : "v2.5.0-devel+5fad61102" ,
2023-12-05 16:58:51 +00:00
} ,
] ,
2023-11-24 15:06:51 +00:00
} ,
} ,
2024-01-08 09:29:04 +00:00
provisioner_daemons : {
severity : "ok" ,
2024-01-08 17:14:09 +00:00
warnings : [
{
message : "Something is wrong!" ,
code : "EUNKNOWN" ,
} ,
{
message : "This is also bad." ,
code : "EPD01" ,
} ,
] ,
2024-01-08 09:29:04 +00:00
dismissed : false ,
2024-01-08 13:55:00 +00:00
items : [
2024-01-08 09:29:04 +00:00
{
2024-01-08 13:55:00 +00:00
provisioner_daemon : {
id : "e455b582-ac04-4323-9ad6-ab71301fa006" ,
created_at : "2024-01-04T15:53:03.21563Z" ,
last_seen_at : "2024-01-04T16:05:03.967551Z" ,
2024-01-08 17:14:09 +00:00
name : "ok" ,
version : "v2.3.4-devel+abcd1234" ,
2024-01-08 13:55:00 +00:00
api_version : "1.0" ,
provisioners : [ "echo" , "terraform" ] ,
tags : {
owner : "" ,
scope : "organization" ,
2024-01-11 17:42:21 +00:00
tag_value : "value" ,
tag_true : "true" ,
tag_1 : "1" ,
tag_yes : "yes" ,
} ,
} ,
warnings : [ ] ,
} ,
{
provisioner_daemon : {
id : "00000000-0000-0000-000000000000" ,
created_at : "2024-01-04T15:53:03.21563Z" ,
last_seen_at : "2024-01-04T16:05:03.967551Z" ,
name : "user-scoped" ,
version : "v2.34-devel+abcd1234" ,
api_version : "1.0" ,
provisioners : [ "echo" , "terraform" ] ,
tags : {
owner : "12345678-1234-1234-1234-12345678abcd" ,
scope : "user" ,
tag_VALUE : "VALUE" ,
tag_TRUE : "TRUE" ,
tag_1 : "1" ,
tag_YES : "YES" ,
2024-01-08 13:55:00 +00:00
} ,
2024-01-08 09:29:04 +00:00
} ,
2024-01-08 13:55:00 +00:00
warnings : [ ] ,
2024-01-08 09:29:04 +00:00
} ,
2024-01-08 17:14:09 +00:00
{
provisioner_daemon : {
id : "e455b582-ac04-4323-9ad6-ab71301fa006" ,
created_at : "2024-01-04T15:53:03.21563Z" ,
last_seen_at : "2024-01-04T16:05:03.967551Z" ,
name : "unhappy" ,
version : "v0.0.1" ,
api_version : "0.1" ,
provisioners : [ "echo" , "terraform" ] ,
tags : {
owner : "" ,
scope : "organization" ,
2024-01-11 17:42:21 +00:00
tag_string : "value" ,
tag_false : "false" ,
tag_0 : "0" ,
tag_no : "no" ,
2024-01-08 17:14:09 +00:00
} ,
} ,
warnings : [
{
message : "Something specific is wrong with this daemon." ,
code : "EUNKNOWN" ,
} ,
{
message : "And now for something completely different." ,
code : "EUNKNOWN" ,
} ,
] ,
} ,
2024-01-08 09:29:04 +00:00
] ,
} ,
2023-12-20 00:03:00 +00:00
coder_version : "v2.5.0-devel+5fad61102" ,
2023-09-06 18:59:26 +00:00
} ;
2023-08-04 14:55:33 +00:00
export const MockListeningPortsResponse : TypesGen.WorkspaceAgentListeningPortsResponse =
{
ports : [
{ process_name : "web" , network : "" , port : 3000 } ,
{ process_name : "go" , network : "" , port : 8080 } ,
{ process_name : "" , network : "" , port : 8081 } ,
] ,
2023-09-06 18:59:26 +00:00
} ;
2023-10-13 16:39:20 +00:00
2023-11-13 14:58:57 +00:00
export const DeploymentHealthUnhealthy : TypesGen.HealthcheckReport = {
2023-10-13 16:39:20 +00:00
healthy : false ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-13 14:58:57 +00:00
failing_sections : [ ] , // apparently this property is not used at all?
2023-10-13 16:39:20 +00:00
time : "2023-10-12T23:15:00.000000000Z" ,
coder_version : "v2.3.0-devel+8cca4915a" ,
2023-11-13 14:58:57 +00:00
access_url : {
healthy : true ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-11-13 14:58:57 +00:00
access_url : "" ,
healthz_response : "" ,
reachable : true ,
status_code : 0 ,
} ,
database : {
healthy : false ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-11-13 14:58:57 +00:00
latency : "" ,
latency_ms : 0 ,
reachable : true ,
2023-11-13 16:28:20 +00:00
threshold_ms : 92570 ,
2023-11-13 14:58:57 +00:00
} ,
derp : {
healthy : false ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-11-13 14:58:57 +00:00
regions : [ ] ,
netcheck_logs : [ ] ,
} ,
websocket : {
healthy : false ,
2023-11-23 15:08:41 +00:00
severity : "ok" ,
2023-11-17 15:00:49 +00:00
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-11-13 14:58:57 +00:00
body : "" ,
code : 0 ,
} ,
2023-11-24 15:06:51 +00:00
workspace_proxy : {
healthy : false ,
error : "some error" ,
severity : "error" ,
warnings : [ ] ,
2023-11-29 16:37:40 +00:00
dismissed : false ,
2023-11-24 15:06:51 +00:00
workspace_proxies : {
regions : [
{
id : "df7e4b2b-2d40-47e5-a021-e5d08b219c77" ,
name : "unhealthy" ,
display_name : "unhealthy" ,
icon_url : "/emojis/1f5fa.png" ,
healthy : false ,
path_app_url : "http://127.0.0.1:3001" ,
wildcard_hostname : "" ,
derp_enabled : true ,
derp_only : false ,
status : {
status : "unreachable" ,
report : {
errors : [ "some error" ] ,
warnings : [ ] ,
} ,
checked_at : "2023-11-24T12:14:05.743303497Z" ,
} ,
created_at : "2023-11-23T15:37:25.513213Z" ,
updated_at : "2023-11-23T18:09:19.734747Z" ,
deleted : false ,
2023-12-20 00:03:00 +00:00
version : "v2.5.0-devel+89bae7eff" ,
2023-11-24 15:06:51 +00:00
} ,
] ,
} ,
} ,
2024-01-08 09:29:04 +00:00
provisioner_daemons : {
severity : "error" ,
2024-01-08 13:55:00 +00:00
error : "something went wrong" ,
warnings : [
{
message : "this is a message" ,
code : "EUNKNOWN" ,
} ,
] ,
2024-01-08 09:29:04 +00:00
dismissed : false ,
2024-01-08 13:55:00 +00:00
items : [
{
provisioner_daemon : {
id : "e455b582-ac04-4323-9ad6-ab71301fa006" ,
created_at : "2024-01-04T15:53:03.21563Z" ,
last_seen_at : "2024-01-04T16:05:03.967551Z" ,
name : "vvuurrkk-2" ,
version : "v2.6.0-devel+965ad5e96" ,
api_version : "1.0" ,
provisioners : [ "echo" , "terraform" ] ,
tags : {
owner : "" ,
scope : "organization" ,
} ,
} ,
warnings : [
{
message : "this is a specific message for this thing" ,
code : "EUNKNOWN" ,
} ,
] ,
} ,
] ,
2024-01-08 09:29:04 +00:00
} ,
2023-10-13 16:39:20 +00:00
} ;
2023-12-06 14:41:45 +00:00
2023-12-06 15:50:35 +00:00
export const MockHealthSettings : TypesGen.HealthSettings = {
dismissed_healthchecks : [ ] ,
} ;
2023-12-06 14:41:45 +00:00
export const MockGithubExternalProvider : TypesGen.ExternalAuthLinkProvider = {
id : "github" ,
type : "github" ,
device : false ,
display_icon : "/icon/github.svg" ,
display_name : "GitHub" ,
allow_refresh : true ,
allow_validate : true ,
} ;
export const MockGithubAuthLink : TypesGen.ExternalAuthLink = {
provider_id : "github" ,
created_at : "" ,
updated_at : "" ,
has_refresh_token : true ,
expires : "" ,
authenticated : true ,
validate_error : "" ,
} ;
2023-12-21 21:38:42 +00:00
export const MockOAuth2ProviderApps : TypesGen.OAuth2ProviderApp [ ] = [
{
id : "1" ,
name : "foo" ,
callback_url : "http://localhost:3001" ,
icon : "/icon/github.svg" ,
2024-01-22 22:25:25 +00:00
endpoints : {
authorization : "http://localhost:3001/login/oauth2/authorize" ,
token : "http://localhost:3001/login/oauth2/token" ,
device_authorization : "" ,
} ,
2023-12-21 21:38:42 +00:00
} ,
] ;
export const MockOAuth2ProviderAppSecrets : TypesGen.OAuth2ProviderAppSecret [ ] =
[
{
id : "1" ,
client_secret_truncated : "foo" ,
} ,
{
id : "1" ,
last_used_at : "2022-12-16T20:10:45.637452Z" ,
client_secret_truncated : "foo" ,
} ,
] ;