From 56c63d2b9185af120ba39e37a9a5bb2516cf33d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 11:58:28 +0000 Subject: [PATCH 1/3] feat(api): manual updates (#38) --- .stats.yml | 2 +- .../environments/automations/services.ts | 89 +--- src/resources/environments/environments.ts | 438 ++---------------- .../organizations/domain-verifications.ts | 94 ++++ src/resources/projects/projects.ts | 8 +- src/resources/runners/runners.ts | 307 ++---------- src/resources/secrets.ts | 7 +- src/resources/shared.ts | 356 +------------- src/resources/users/users.ts | 89 +--- 9 files changed, 169 insertions(+), 1221 deletions(-) diff --git a/.stats.yml b/.stats.yml index d0c635d..2c4d8ac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-064a191bc556bcab46bb5d612c844437e1a4aef5981a4a99ab7f825a96ede4fa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3655d5ad0ac3e228c1519af70dbf3d0bfa3c47a2d06d4cac92a650da051b49a6.yml diff --git a/src/resources/environments/automations/services.ts b/src/resources/environments/automations/services.ts index b190b05..4089844 100644 --- a/src/resources/environments/automations/services.ts +++ b/src/resources/environments/automations/services.ts @@ -268,94 +268,7 @@ export interface Service { export interface ServiceMetadata { /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * created_at is the time the service was created. */ createdAt?: string; diff --git a/src/resources/environments/environments.ts b/src/resources/environments/environments.ts index 626b729..ee1390b 100644 --- a/src/resources/environments/environments.ts +++ b/src/resources/environments/environments.ts @@ -409,19 +409,19 @@ export interface Environment { id: string; /** - * EnvironmentMetadata is data associated with an environment that's required for - * other parts of the system to function + * Metadata is data associated with this environment that's required for other + * parts of Gitpod to function */ metadata?: EnvironmentMetadata; /** - * EnvironmentSpec specifies the configuration of an environment for an environment - * start + * Spec is the configuration of the environment that's required for the runner to + * start the environment */ spec?: EnvironmentSpec; /** - * EnvironmentStatus describes an environment status + * Status is the current status of the environment */ status?: EnvironmentStatus; } @@ -438,94 +438,8 @@ export interface EnvironmentActivitySignal { source?: string; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * timestamp of when the activity was observed by the source. Only reported every 5 + * minutes. Zero value means no activity was observed. */ timestamp?: string; } @@ -542,94 +456,7 @@ export interface EnvironmentMetadata { annotations?: Record; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * Time when the Environment was created. */ createdAt?: string; @@ -639,94 +466,8 @@ export interface EnvironmentMetadata { creator?: Shared.Subject; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * Time when the Environment was last started (i.e. CreateEnvironment or + * StartEnvironment were called). */ lastStartedAt?: string; @@ -775,7 +516,7 @@ export type EnvironmentPhase = */ export interface EnvironmentSpec { /** - * Admission level describes who can access an environment instance and its ports. + * admission controlls who can access the environment and its ports. */ admission?: AdmissionLevel; @@ -866,7 +607,7 @@ export namespace EnvironmentSpec { gitUsername?: string; /** - * EnvironmentInitializer specifies how an environment is to be initialized + * initializer configures how the environment is to be initialized */ initializer?: ProjectsAPI.EnvironmentInitializer; @@ -904,20 +645,6 @@ export namespace EnvironmentSpec { * URL of a dotfiles Git repository (e.g. https://github.com/owner/repository) */ repository: string; - - /** - * install_command is the command to run after cloning the dotfiles repository. - * Defaults to run the first file of `install.sh`, `install`, `bootstrap.sh`, - * `bootstrap`, `setup.sh` and `setup` found in the dotfiles repository's root - * folder. - */ - installCommand?: string; - - /** - * target_path is the path to clone the dotfiles repository to. Defaults to - * `~/dotfiles`. - */ - targetPath?: string; } } @@ -935,7 +662,7 @@ export namespace EnvironmentSpec { export interface Port { /** - * Admission level describes who can access an environment instance and its ports. + * policy of this port */ admission?: EnvironmentsAPI.AdmissionLevel; @@ -1005,63 +732,8 @@ export namespace EnvironmentSpec { */ export interface Timeout { /** - * A Duration represents a signed, fixed-length span of time represented as a count - * of seconds and fractions of seconds at nanosecond resolution. It is independent - * of any calendar and concepts like "day" or "month". It is related to Timestamp - * in that the difference between two Timestamp values is a Duration and it can be - * added or subtracted from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an object, - * where the string ends in the suffix "s" (indicating seconds) and is preceded by - * the number of seconds, with nanoseconds expressed as fractional seconds. For - * example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - * while 3 seconds and 1 nanosecond should be expressed in JSON format as - * "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - * format as "3.000001s". + * inacitivity is the maximum time of disconnection before the environment is + * stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. */ disconnected?: string; } @@ -1072,7 +744,7 @@ export namespace EnvironmentSpec { */ export interface EnvironmentStatus { /** - * EnvironmentActivitySignal used to signal activity for an environment. + * activity_signal is the last activity signal for the environment. */ activitySignal?: EnvironmentActivitySignal; @@ -1116,7 +788,7 @@ export interface EnvironmentStatus { phase?: EnvironmentPhase; /** - * RunnerACK is the acknowledgement from the runner that is has received the + * runner_ack contains the acknowledgement from the runner that is has received the * environment spec. */ runnerAck?: EnvironmentStatus.RunnerAck; @@ -1474,7 +1146,7 @@ export namespace EnvironmentStatus { } /** - * RunnerACK is the acknowledgement from the runner that is has received the + * runner_ack contains the acknowledgement from the runner that is has received the * environment spec. */ export interface RunnerAck { @@ -1576,8 +1248,8 @@ export type EnvironmentStopResponse = unknown; export interface EnvironmentCreateParams { /** - * EnvironmentSpec specifies the configuration of an environment for an environment - * start + * spec is the configuration of the environment that's required for the to start + * the environment */ spec?: EnvironmentSpec; } @@ -1661,7 +1333,7 @@ export namespace EnvironmentUpdateParams { gitUsername?: string | null; /** - * EnvironmentInitializer specifies how an environment is to be initialized + * initializer configures how the environment is to be initialized */ initializer?: ProjectsAPI.EnvironmentInitializer | null; @@ -1690,7 +1362,7 @@ export namespace EnvironmentUpdateParams { export interface Port { /** - * Admission level describes who can access an environment instance and its ports. + * policy of this port */ admission?: EnvironmentsAPI.AdmissionLevel; @@ -1723,63 +1395,8 @@ export namespace EnvironmentUpdateParams { */ export interface Timeout { /** - * A Duration represents a signed, fixed-length span of time represented as a count - * of seconds and fractions of seconds at nanosecond resolution. It is independent - * of any calendar and concepts like "day" or "month". It is related to Timestamp - * in that the difference between two Timestamp values is a Duration and it can be - * added or subtracted from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an object, - * where the string ends in the suffix "s" (indicating seconds) and is preceded by - * the number of seconds, with nanoseconds expressed as fractional seconds. For - * example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", - * while 3 seconds and 1 nanosecond should be expressed in JSON format as - * "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON - * format as "3.000001s". + * inacitivity is the maximum time of disconnection before the environment is + * stopped or paused. Minimum duration is 30 minutes. Set to 0 to disable. */ disconnected?: string | null; } @@ -1869,8 +1486,9 @@ export interface EnvironmentCreateFromProjectParams { projectId?: string; /** - * EnvironmentSpec specifies the configuration of an environment for an environment - * start + * Spec is the configuration of the environment that's required for the runner to + * start the environment Configuration already defined in the Project will override + * parts of the spec, if set */ spec?: EnvironmentSpec; } @@ -1887,7 +1505,7 @@ export interface EnvironmentCreateLogsTokenParams { export interface EnvironmentMarkActiveParams { /** - * EnvironmentActivitySignal used to signal activity for an environment. + * activity_signal specifies the activity. */ activitySignal?: EnvironmentActivitySignal; diff --git a/src/resources/organizations/domain-verifications.ts b/src/resources/organizations/domain-verifications.ts index 3f6428a..8fcb6a9 100644 --- a/src/resources/organizations/domain-verifications.ts +++ b/src/resources/organizations/domain-verifications.ts @@ -175,6 +175,100 @@ export interface DomainVerification { state: DomainVerificationState; + /** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at nanosecond + * resolution. The count is relative to an epoch at UTC midnight on January 1, + * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar + * backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a + * [24-hour linear smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always + * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are + * zero-padded to two digits each. The fractional seconds, which can go up to 9 + * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix + * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON + * serializer should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC and + * other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted to + * this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the + * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the + * Joda Time's + * [`ISODateTimeFormat.dateTime()`]() + * to obtain a formatter capable of generating timestamps in this format. + */ + createdAt?: string; + + verificationToken?: string; + /** * A Timestamp represents a point in time independent of any time zone or local * calendar, encoded as a count of seconds and fractions of seconds at nanosecond diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index 66105af..7ca91c8 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -249,7 +249,7 @@ export namespace EnvironmentInitializer { remoteUri?: string; /** - * CloneTargetMode is the target state in which we want to leave a GitEnvironment + * the target mode determines what gets checked out */ targetMode?: | 'CLONE_TARGET_MODE_UNSPECIFIED' @@ -287,7 +287,7 @@ export interface Project { devcontainerFilePath?: string; /** - * EnvironmentInitializer specifies how an environment is to be initialized + * initializer is the content initializer */ initializer?: EnvironmentInitializer; @@ -547,7 +547,7 @@ export interface ProjectCreateParams { environmentClass: ProjectEnvironmentClass; /** - * EnvironmentInitializer specifies how an environment is to be initialized + * initializer is the content initializer */ initializer: EnvironmentInitializer; @@ -605,7 +605,7 @@ export interface ProjectUpdateParams { environmentClass?: ProjectEnvironmentClass | null; /** - * EnvironmentInitializer specifies how an environment is to be initialized + * initializer is the content initializer */ initializer?: EnvironmentInitializer | null; diff --git a/src/resources/runners/runners.ts b/src/resources/runners/runners.ts index 092e0b8e..4efa8a4 100644 --- a/src/resources/runners/runners.ts +++ b/src/resources/runners/runners.ts @@ -290,94 +290,7 @@ export type RunnersRunnersPage = RunnersPage; export interface Runner { /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * Time when the Runner was created. */ createdAt?: string; @@ -387,7 +300,7 @@ export interface Runner { creator?: Shared.Subject; /** - * RunnerKind represents the kind of a runner + * The runner's kind */ kind?: RunnerKind; @@ -397,9 +310,7 @@ export interface Runner { name?: string; /** - * RunnerProvider identifies the specific implementation type of a runner. Each - * provider maps to a specific kind of runner (local or remote), as specified below - * for each provider. + * The runner's provider */ provider?: RunnerProvider; @@ -411,99 +322,12 @@ export interface Runner { spec?: RunnerSpec; /** - * RunnerStatus represents the status of a runner + * The runner's status */ status?: RunnerStatus; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * Time when the Runner was last udpated. */ updatedAt?: string; } @@ -605,7 +429,7 @@ export interface RunnerStatus { message?: string; /** - * RunnerPhase represents the phase a runner is in + * The runner's reported phase */ phase?: RunnerPhase; @@ -617,94 +441,7 @@ export interface RunnerStatus { systemDetails?: string; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * Time when the status was last udpated. */ updatedAt?: string; @@ -715,7 +452,7 @@ export interface RunnerCreateResponse { runner: Runner; /** - * deprecated, will be removed. Use exchange_token instead. + * @deprecated deprecated, will be removed. Use exchange_token instead. */ accessToken?: string; @@ -738,8 +475,14 @@ export type RunnerDeleteResponse = unknown; export interface RunnerCheckAuthenticationForHostResponse { authenticated?: boolean; + /** + * @deprecated + */ authenticationUrl?: string; + /** + * @deprecated + */ patSupported?: boolean; /** @@ -811,7 +554,7 @@ export namespace RunnerCheckAuthenticationForHostResponse { export interface RunnerCreateRunnerTokenResponse { /** - * deprecated, will be removed. Use exchange_token instead. + * @deprecated deprecated, will be removed. Use exchange_token instead. */ accessToken?: string; @@ -849,7 +592,9 @@ export namespace RunnerParseContextURLResponse { export interface RunnerCreateParams { /** - * RunnerKind represents the kind of a runner + * The runner's kind This field is optional and here for backwards-compatibility. + * Use the provider field instead. If provider is set, the runner's kind will be + * deduced from the provider. Only one of kind and provider must be set. */ kind?: RunnerKind; @@ -859,9 +604,9 @@ export interface RunnerCreateParams { name?: string; /** - * RunnerProvider identifies the specific implementation type of a runner. Each - * provider maps to a specific kind of runner (local or remote), as specified below - * for each provider. + * The specific implementation type of the runner This field is optional for + * backwards compatibility but will be required in the future. When specified, kind + * must not be specified (will be deduced from provider) */ provider?: RunnerProvider; @@ -893,7 +638,15 @@ export namespace RunnerUpdateParams { configuration?: Spec.Configuration | null; /** - * RunnerPhase represents the phase a runner is in + * desired_phase can currently only be updated on local-configuration runners, to + * toggle whether local runners are allowed for running environments in the + * organization. Set to: + * + * - ACTIVE to enable local runners. + * - INACTIVE to disable all local runners. Existing local runners and their + * environments will stop, and cannot be started again until the desired_phase is + * set to ACTIVE. Use this carefully, as it will affect all users in the + * organization who use local runners. */ desiredPhase?: RunnersAPI.RunnerPhase | null; } diff --git a/src/resources/secrets.ts b/src/resources/secrets.ts index f7473fe..845d02e 100644 --- a/src/resources/secrets.ts +++ b/src/resources/secrets.ts @@ -392,7 +392,12 @@ export type SecretUpdateValueResponse = unknown; export interface SecretCreateParams { /** * secret will be mounted as a docker config in the environment VM, mount will have - * the docker registry host + * the docker registry host value must be a valid registry host (e.g. + * registry.docker.com, https://registry.docker.com, ghcr.io:5050): + * + * ``` + * this.matches('^[a-zA-Z0-9.-/:]+(:[0-9]+)?$') + * ``` */ containerRegistryBasicAuthHost?: string; diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 048dc03..e6c63f1 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -143,186 +143,12 @@ export interface TaskExecution { export interface TaskExecutionMetadata { /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * completed_at is the time the task execution was done. */ completedAt?: string; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * created_at is the time the task was created. */ createdAt?: string; @@ -337,94 +163,7 @@ export interface TaskExecutionMetadata { environmentId?: string; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * started_at is the time the task execution actually started to run. */ startedAt?: string; @@ -550,94 +289,7 @@ export namespace TaskExecutionStatus { export interface TaskMetadata { /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * created_at is the time the task was created. */ createdAt?: string; diff --git a/src/resources/users/users.ts b/src/resources/users/users.ts index 0e6be07..63c3f75 100644 --- a/src/resources/users/users.ts +++ b/src/resources/users/users.ts @@ -92,94 +92,7 @@ export interface User { avatarUrl?: string; /** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at nanosecond - * resolution. The count is relative to an epoch at UTC midnight on January 1, - * 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar - * backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a - * [24-hour linear smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is - * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always - * expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are - * zero-padded to two digits each. The fractional seconds, which can go up to 9 - * digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix - * indicates the timezone ("UTC"); the timezone is required. A proto3 JSON - * serializer should always use UTC (as indicated by "Z") when printing the - * Timestamp type and a proto3 JSON parser should be able to accept both UTC and - * other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on - * January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the - * time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the - * Joda Time's - * [`ISODateTimeFormat.dateTime()`]() - * to obtain a formatter capable of generating timestamps in this format. + * created_at is the creation time */ createdAt?: string; From 65d2c1f8660acb73bcf781ced4729f969cd31296 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 12:08:52 +0000 Subject: [PATCH 2/3] feat(client): improve logging (#40) --- README.md | 76 +++++++++++----- src/client.ts | 172 +++++++++++++++++++++++++++-------- src/internal/errors.ts | 11 +++ src/internal/parse.ts | 67 ++++++++------ src/internal/shims.ts | 18 ++++ src/internal/utils/log.ts | 93 ++++++++++++++----- src/internal/utils/values.ts | 2 +- tests/index.test.ts | 52 ++++++++++- 8 files changed, 378 insertions(+), 113 deletions(-) diff --git a/README.md b/README.md index 5628d24..e071c46 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,59 @@ console.log(raw.headers.get('X-My-Header')); console.log(response.organizationId); ``` +### Logging + +> [!IMPORTANT] +> All log messages are intended for debugging only. The format and content of log messages +> may change between releases. + +#### Log levels + +The log level can be configured in two ways: + +1. Via the `GITPOD_LOG` environment variable +2. Using the `logLevel` client option (overrides the environment variable if set) + +```ts +import Gitpod from '@gitpod/sdk'; + +const client = new Gitpod({ + logLevel: 'debug', // Show all log messages +}); +``` + +Available log levels, from most to least verbose: + +- `'debug'` - Show debug messages, info, warnings, and errors +- `'info'` - Show info messages, warnings, and errors +- `'warn'` - Show warnings and errors (default) +- `'error'` - Show only errors +- `'off'` - Disable all logging + +At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies. +Some authentication-related headers are redacted, but sensitive data in request and response bodies +may still be visible. + +#### Custom logger + +By default, this library logs to `globalThis.console`. You can also provide a custom logger. +Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue. + +When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages +below the configured level will not be sent to your logger. + +```ts +import Gitpod from '@gitpod/sdk'; +import pino from 'pino'; + +const logger = pino(); + +const client = new Gitpod({ + logger: logger.child({ name: 'Gitpod' }), + logLevel: 'debug', // Send all messages to pino, allowing it to filter +}); +``` + ### Making custom/undocumented requests This library is typed for convenient access to the documented API. If you need to access undocumented @@ -246,33 +299,12 @@ globalThis.fetch = fetch; Or pass it to the client: ```ts +import Gitpod from '@gitpod/sdk'; import fetch from 'my-fetch'; const client = new Gitpod({ fetch }); ``` -### Logging and middleware - -You may also provide a custom `fetch` function when instantiating the client, -which can be used to inspect or alter the `Request` or `Response` before/after each request: - -```ts -import { fetch } from 'undici'; // as one example -import Gitpod from '@gitpod/sdk'; - -const client = new Gitpod({ - fetch: async (url: RequestInfo, init?: RequestInit): Promise => { - console.log('About to make a request', url, init); - const response = await fetch(url, init); - console.log('Got response', response); - return response; - }, -}); -``` - -Note that if given a `GITPOD_LOG=debug` environment variable, this library will log all requests and responses automatically. -This is intended for debugging purposes only and may change in the future without notice. - ### Fetch options If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.) diff --git a/src/client.ts b/src/client.ts index c300e85..9836801 100644 --- a/src/client.ts +++ b/src/client.ts @@ -3,7 +3,7 @@ import type { RequestInit, RequestInfo, BodyInit } from './internal/builtin-types'; import type { HTTPMethod, PromiseOrValue, MergedRequestInit } from './internal/types'; import { uuid4 } from './internal/utils/uuid'; -import { validatePositiveInteger, isAbsoluteURL } from './internal/utils/values'; +import { validatePositiveInteger, isAbsoluteURL, hasOwn } from './internal/utils/values'; import { sleep } from './internal/utils/sleep'; import { castToError, isAbortError } from './internal/errors'; import type { APIResponseProps } from './internal/parse'; @@ -122,7 +122,7 @@ import { SecretsSecretsPage, } from './resources/secrets'; import { readEnv } from './internal/utils/env'; -import { logger } from './internal/utils/log'; +import { formatRequestDetails, loggerFor } from './internal/utils/log'; import { isEmptyObj } from './internal/utils/values'; import { AdmissionLevel, @@ -251,7 +251,14 @@ export type Logger = { debug: LogFn; }; export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug'; -const isLogLevel = (key: string | undefined): key is LogLevel => { +const parseLogLevel = ( + maybeLevel: string | undefined, + sourceName: string, + client: Gitpod, +): LogLevel | undefined => { + if (!maybeLevel) { + return undefined; + } const levels: Record = { off: true, error: true, @@ -259,7 +266,15 @@ const isLogLevel = (key: string | undefined): key is LogLevel => { info: true, debug: true, }; - return key! in levels; + if (hasOwn(levels, maybeLevel)) { + return maybeLevel; + } + loggerFor(client).warn( + `${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify( + Object.keys(levels), + )}`, + ); + return undefined; }; export interface ClientOptions { @@ -323,16 +338,16 @@ export interface ClientOptions { /** * Set the log level. * - * Defaults to process.env['GITPOD_LOG']. + * Defaults to process.env['GITPOD_LOG'] or 'warn' if it isn't set. */ - logLevel?: LogLevel | undefined | null; + logLevel?: LogLevel | undefined; /** * Set the logger. * * Defaults to globalThis.console. */ - logger?: Logger | undefined | null; + logger?: Logger | undefined; } type FinalizedRequestInit = RequestInit & { headers: Headers }; @@ -387,14 +402,13 @@ export class Gitpod { this.baseURL = options.baseURL!; this.timeout = options.timeout ?? Gitpod.DEFAULT_TIMEOUT /* 1 minute */; this.logger = options.logger ?? console; - if (options.logLevel != null) { - this.logLevel = options.logLevel; - } else { - const envLevel = readEnv('GITPOD_LOG'); - if (isLogLevel(envLevel)) { - this.logLevel = envLevel; - } - } + const defaultLogLevel = 'warn'; + // Set default logLevel early so that we can log a warning in parseLogLevel. + this.logLevel = defaultLogLevel; + this.logLevel = + parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ?? + parseLogLevel(readEnv('GITPOD_LOG'), "process.env['GITPOD_LOG']", this) ?? + defaultLogLevel; this.fetchOptions = options.fetchOptions; this.maxRetries = options.maxRetries ?? 2; this.fetch = options.fetch ?? Shims.getDefaultFetch(); @@ -524,12 +538,13 @@ export class Gitpod { options: PromiseOrValue, remainingRetries: number | null = null, ): APIPromise { - return new APIPromise(this, this.makeRequest(options, remainingRetries)); + return new APIPromise(this, this.makeRequest(options, remainingRetries, undefined)); } private async makeRequest( optionsInput: PromiseOrValue, retriesRemaining: number | null, + retryOfRequestLogID: string | undefined, ): Promise { const options = await optionsInput; const maxRetries = options.maxRetries ?? this.maxRetries; @@ -543,7 +558,21 @@ export class Gitpod { await this.prepareRequest(req, { url, options }); - logger(this).debug('request', url, options, req.headers); + /** Not an API request ID, just for correlating local log entries. */ + const requestLogID = 'log_' + ((Math.random() * (1 << 24)) | 0).toString(16).padStart(6, '0'); + const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`; + const startTime = Date.now(); + + loggerFor(this).debug( + `[${requestLogID}] sending request`, + formatRequestDetails({ + retryOfRequestLogID, + method: options.method, + url, + options, + headers: req.headers, + }), + ); if (options.signal?.aborted) { throw new Errors.APIUserAbortError(); @@ -551,52 +580,120 @@ export class Gitpod { const controller = new AbortController(); const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError); + const headersTime = Date.now(); if (response instanceof Error) { + const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; if (options.signal?.aborted) { throw new Errors.APIUserAbortError(); } - if (retriesRemaining) { - return this.retryRequest(options, retriesRemaining); - } - if (isAbortError(response)) { - throw new Errors.APIConnectionTimeoutError(); - } // detect native connection timeout errors // deno throws "TypeError: error sending request for url (https://example/): client error (Connect): tcp connect error: Operation timed out (os error 60): Operation timed out (os error 60)" // undici throws "TypeError: fetch failed" with cause "ConnectTimeoutError: Connect Timeout Error (attempted address: example:443, timeout: 1ms)" // others do not provide enough information to distinguish timeouts from other connection errors - if (/timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : ''))) { + const isTimeout = + isAbortError(response) || + /timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : '')); + if (retriesRemaining) { + loggerFor(this).info( + `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - ${retryMessage}`, + ); + loggerFor(this).debug( + `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (${retryMessage})`, + formatRequestDetails({ + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message, + }), + ); + return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); + } + loggerFor(this).info( + `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`, + ); + loggerFor(this).debug( + `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (error; no more retries left)`, + formatRequestDetails({ + retryOfRequestLogID, + url, + durationMs: headersTime - startTime, + message: response.message, + }), + ); + if (isTimeout) { throw new Errors.APIConnectionTimeoutError(); } throw new Errors.APIConnectionError({ cause: response }); } + const responseInfo = `[${requestLogID}${retryLogStr}] ${req.method} ${url} ${ + response.ok ? 'succeeded' : 'failed' + } with status ${response.status} in ${headersTime - startTime}ms`; + if (!response.ok) { - if (retriesRemaining && this.shouldRetry(response)) { + const shouldRetry = this.shouldRetry(response); + if (retriesRemaining && shouldRetry) { const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; - logger(this).debug(`response (error; ${retryMessage})`, response.status, url, response.headers); - return this.retryRequest(options, retriesRemaining, response.headers); + + // We don't need the body of this response. + await Shims.CancelReadableStream(response.body); + loggerFor(this).info(`${responseInfo} - ${retryMessage}`); + loggerFor(this).debug( + `[${requestLogID}] response error (${retryMessage})`, + formatRequestDetails({ + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime, + }), + ); + return this.retryRequest( + options, + retriesRemaining, + retryOfRequestLogID ?? requestLogID, + response.headers, + ); } + const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`; + + loggerFor(this).info(`${responseInfo} - ${retryMessage}`); + const errText = await response.text().catch((err: any) => castToError(err).message); const errJSON = safeJSON(errText); const errMessage = errJSON ? undefined : errText; - const retryMessage = retriesRemaining ? `(error; no more retries left)` : `(error; not retryable)`; - logger(this).debug( - `response (error; ${retryMessage})`, - response.status, - url, - response.headers, - errMessage, + loggerFor(this).debug( + `[${requestLogID}] response error (${retryMessage})`, + formatRequestDetails({ + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + message: errMessage, + durationMs: Date.now() - startTime, + }), ); const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers); throw err; } - return { response, options, controller }; + loggerFor(this).info(responseInfo); + loggerFor(this).debug( + `[${requestLogID}] response start`, + formatRequestDetails({ + retryOfRequestLogID, + url: response.url, + status: response.status, + headers: response.headers, + durationMs: headersTime - startTime, + }), + ); + + return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; } getAPIList = Pagination.AbstractPage>( @@ -614,7 +711,7 @@ export class Gitpod { Page: new (...args: ConstructorParameters) => PageClass, options: FinalRequestOptions, ): Pagination.PagePromise { - const request = this.makeRequest(options, null); + const request = this.makeRequest(options, null, undefined); return new Pagination.PagePromise(this as any as Gitpod, request, Page); } @@ -677,6 +774,7 @@ export class Gitpod { private async retryRequest( options: FinalRequestOptions, retriesRemaining: number, + requestLogID: string, responseHeaders?: Headers | undefined, ): Promise { let timeoutMillis: number | undefined; @@ -709,7 +807,7 @@ export class Gitpod { } await sleep(timeoutMillis); - return this.makeRequest(options, retriesRemaining - 1); + return this.makeRequest(options, retriesRemaining - 1, requestLogID); } private calculateDefaultRetryTimeoutMillis(retriesRemaining: number, maxRetries: number): number { diff --git a/src/internal/errors.ts b/src/internal/errors.ts index 2e625bd..653a6ec 100644 --- a/src/internal/errors.ts +++ b/src/internal/errors.ts @@ -14,6 +14,17 @@ export function isAbortError(err: unknown) { export const castToError = (err: any): Error => { if (err instanceof Error) return err; if (typeof err === 'object' && err !== null) { + try { + if (Object.prototype.toString.call(err) === '[object Error]') { + // @ts-ignore - not all envs have native support for cause yet + const error = new Error(err.message, err.cause ? { cause: err.cause } : {}); + if (err.stack) error.stack = err.stack; + // @ts-ignore - not all envs have native support for cause yet + if (err.cause && !error.cause) error.cause = err.cause; + if (err.name) error.name = err.name; + throw error; + } + } catch {} try { return new Error(JSON.stringify(err)); } catch {} diff --git a/src/internal/parse.ts b/src/internal/parse.ts index 90b4df7..799b71c 100644 --- a/src/internal/parse.ts +++ b/src/internal/parse.ts @@ -2,40 +2,51 @@ import type { FinalRequestOptions } from './request-options'; import { type Gitpod } from '../client'; -import { logger } from './utils/log'; +import { formatRequestDetails, loggerFor } from './utils/log'; export type APIResponseProps = { response: Response; options: FinalRequestOptions; controller: AbortController; + requestLogID: string; + retryOfRequestLogID: string | undefined; + startTime: number; }; export async function defaultParseResponse(client: Gitpod, props: APIResponseProps): Promise { - const { response } = props; - - // fetch refuses to read the body when the status code is 204. - if (response.status === 204) { - return null as T; - } - - if (props.options.__binaryResponse) { - return response as unknown as T; - } - - const contentType = response.headers.get('content-type'); - const isJSON = - contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); - if (isJSON) { - const json = await response.json(); - - logger(client).debug('response', response.status, response.url, response.headers, json); - - return json as T; - } - - const text = await response.text(); - logger(client).debug('response', response.status, response.url, response.headers, text); - - // TODO handle blob, arraybuffer, other content types, etc. - return text as unknown as T; + const { response, requestLogID, retryOfRequestLogID, startTime } = props; + const body = await (async () => { + // fetch refuses to read the body when the status code is 204. + if (response.status === 204) { + return null as T; + } + + if (props.options.__binaryResponse) { + return response as unknown as T; + } + + const contentType = response.headers.get('content-type'); + const isJSON = + contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); + if (isJSON) { + const json = await response.json(); + return json as T; + } + + const text = await response.text(); + + // TODO handle blob, arraybuffer, other content types, etc. + return text as unknown as T; + })(); + loggerFor(client).debug( + `[${requestLogID}] response parsed`, + formatRequestDetails({ + retryOfRequestLogID, + url: response.url, + status: response.status, + body, + durationMs: Date.now() - startTime, + }), + ); + return body; } diff --git a/src/internal/shims.ts b/src/internal/shims.ts index e8a0151..cb91e94 100644 --- a/src/internal/shims.ts +++ b/src/internal/shims.ts @@ -143,3 +143,21 @@ export function ReadableStreamToAsyncIterable(stream: any): AsyncIterableIter }, }; } + +/** + * Cancels a ReadableStream we don't need to consume. + * See https://undici.nodejs.org/#/?id=garbage-collection + */ +export async function CancelReadableStream(stream: any): Promise { + if (stream === null || typeof stream !== 'object') return; + + if (stream[Symbol.asyncIterator]) { + await stream[Symbol.asyncIterator]().return?.(); + return; + } + + const reader = stream.getReader(); + const cancelPromise = reader.cancel(); + reader.releaseLock(); + await cancelPromise; +} diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts index 85292b1..e446d4c 100644 --- a/src/internal/utils/log.ts +++ b/src/internal/utils/log.ts @@ -2,6 +2,7 @@ import type { LogLevel, Logger } from '../../client'; import { type Gitpod } from '../../client'; +import { RequestOptions } from '../request-options'; const levelNumbers = { off: 0, @@ -13,37 +14,85 @@ const levelNumbers = { function noop() {} -function logFn(logger: Logger | undefined, clientLevel: LogLevel | undefined, level: keyof Logger) { - if (!logger || levelNumbers[level] > levelNumbers[clientLevel!]!) { +function makeLogFn(fnLevel: keyof Logger, logger: Logger | undefined, logLevel: LogLevel) { + if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) { return noop; } else { // Don't wrap logger functions, we want the stacktrace intact! - return logger[level].bind(logger); + return logger[fnLevel].bind(logger); } } -let lastLogger: { deref(): Logger } | undefined; -let lastLevel: LogLevel | undefined; -let lastLevelLogger: Logger; +const noopLogger = { + error: noop, + warn: noop, + info: noop, + debug: noop, +}; + +let cachedLoggers = new WeakMap(); + +export function loggerFor(client: Gitpod): Logger { + const logger = client.logger; + const logLevel = client.logLevel ?? 'off'; + if (!logger) { + return noopLogger; + } -export function logger(client: Gitpod): Logger { - let { logger, logLevel: clientLevel } = client; - if (lastLevel === clientLevel && (logger === lastLogger || logger === lastLogger?.deref())) { - return lastLevelLogger; + const cachedLogger = cachedLoggers.get(logger); + if (cachedLogger && cachedLogger[0] === logLevel) { + return cachedLogger[1]; } + const levelLogger = { - error: logFn(logger, clientLevel, 'error'), - warn: logFn(logger, clientLevel, 'warn'), - info: logFn(logger, clientLevel, 'info'), - debug: logFn(logger, clientLevel, 'debug'), + error: makeLogFn('error', logger, logLevel), + warn: makeLogFn('warn', logger, logLevel), + info: makeLogFn('info', logger, logLevel), + debug: makeLogFn('debug', logger, logLevel), }; - const { WeakRef } = globalThis as any; - lastLogger = - logger ? - WeakRef ? new WeakRef(logger) - : { deref: () => logger } - : undefined; - lastLevel = clientLevel; - lastLevelLogger = levelLogger; + + cachedLoggers.set(logger, [logLevel, levelLogger]); + return levelLogger; } + +export const formatRequestDetails = (details: { + options?: RequestOptions | undefined; + headers?: Headers | Record | undefined; + retryOfRequestLogID?: string | undefined; + retryOf?: string | undefined; + url?: string | undefined; + status?: number | undefined; + method?: string | undefined; + durationMs?: number | undefined; + message?: unknown; + body?: unknown; +}) => { + if (details.options) { + details.options = { ...details.options }; + delete details.options['headers']; // redundant + leaks internals + } + if (details.headers) { + details.headers = Object.fromEntries( + (details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map( + ([name, value]) => [ + name, + ( + name.toLowerCase() === 'authorization' || + name.toLowerCase() === 'cookie' || + name.toLowerCase() === 'set-cookie' + ) ? + '***' + : value, + ], + ), + ); + } + if ('retryOfRequestLogID' in details) { + if (details.retryOfRequestLogID) { + details.retryOf = details.retryOfRequestLogID; + } + delete details.retryOfRequestLogID; + } + return details; +}; diff --git a/src/internal/utils/values.ts b/src/internal/utils/values.ts index ca59125..86e3eda 100644 --- a/src/internal/utils/values.ts +++ b/src/internal/utils/values.ts @@ -26,7 +26,7 @@ export function isEmptyObj(obj: Object | null | undefined): boolean { } // https://eslint.org/docs/latest/rules/no-prototype-builtins -export function hasOwn(obj: Object, key: string): boolean { +export function hasOwn(obj: T, key: PropertyKey): key is keyof T { return Object.prototype.hasOwnProperty.call(obj, key); } diff --git a/tests/index.test.ts b/tests/index.test.ts index fd1bbf0..24fd099 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -13,8 +13,6 @@ describe('instantiate client', () => { beforeEach(() => { jest.resetModules(); process.env = { ...env }; - - console.warn = jest.fn(); }); afterEach(() => { @@ -52,16 +50,26 @@ describe('instantiate client', () => { }); }); describe('logging', () => { - afterEach(() => { + const env = process.env; + + beforeEach(() => { + process.env = { ...env }; process.env['GITPOD_LOG'] = undefined; }); + afterEach(() => { + process.env = env; + }); + const forceAPIResponseForClient = async (client: Gitpod) => { await new APIPromise( client, Promise.resolve({ response: new Response(), controller: new AbortController(), + requestLogID: 'log_000000', + retryOfRequestLogID: undefined, + startTime: Date.now(), options: { method: 'get', path: '/', @@ -85,6 +93,11 @@ describe('instantiate client', () => { expect(debugMock).toHaveBeenCalled(); }); + test('default logLevel is warn', async () => { + const client = new Gitpod({ bearerToken: 'My Bearer Token' }); + expect(client.logLevel).toBe('warn'); + }); + test('debug logs are skipped when log level is info', async () => { const debugMock = jest.fn(); const logger = { @@ -111,11 +124,29 @@ describe('instantiate client', () => { process.env['GITPOD_LOG'] = 'debug'; const client = new Gitpod({ logger: logger, bearerToken: 'My Bearer Token' }); + expect(client.logLevel).toBe('debug'); await forceAPIResponseForClient(client); expect(debugMock).toHaveBeenCalled(); }); + test('warn when env var level is invalid', async () => { + const warnMock = jest.fn(); + const logger = { + debug: jest.fn(), + info: jest.fn(), + warn: warnMock, + error: jest.fn(), + }; + + process.env['GITPOD_LOG'] = 'not a log level'; + const client = new Gitpod({ logger: logger, bearerToken: 'My Bearer Token' }); + expect(client.logLevel).toBe('warn'); + expect(warnMock).toHaveBeenCalledWith( + 'process.env[\'GITPOD_LOG\'] was set to "not a log level", expected one of ["off","error","warn","info","debug"]', + ); + }); + test('client log level overrides env var', async () => { const debugMock = jest.fn(); const logger = { @@ -131,6 +162,21 @@ describe('instantiate client', () => { await forceAPIResponseForClient(client); expect(debugMock).not.toHaveBeenCalled(); }); + + test('no warning logged for invalid env var level + valid client level', async () => { + const warnMock = jest.fn(); + const logger = { + debug: jest.fn(), + info: jest.fn(), + warn: warnMock, + error: jest.fn(), + }; + + process.env['GITPOD_LOG'] = 'not a log level'; + const client = new Gitpod({ logger: logger, logLevel: 'debug', bearerToken: 'My Bearer Token' }); + expect(client.logLevel).toBe('debug'); + expect(warnMock).not.toHaveBeenCalled(); + }); }); describe('defaultQuery', () => { From fdae3808e93b8e827443e55feedbac3fb729e043 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 12:09:09 +0000 Subject: [PATCH 3/3] release: 0.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2537c1f..f1c1e58 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.5.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cf33c5..b82eb11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.5.0 (2025-02-21) + +Full Changelog: [v0.4.0...v0.5.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.4.0...v0.5.0) + +### Features + +* **api:** manual updates ([#38](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/38)) ([56c63d2](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/56c63d2b9185af120ba39e37a9a5bb2516cf33d6)) +* **client:** improve logging ([#40](https://github.com/gitpod-io/gitpod-sdk-typescript/issues/40)) ([65d2c1f](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/65d2c1f8660acb73bcf781ced4729f969cd31296)) + ## 0.4.0 (2025-02-21) Full Changelog: [v0.3.1...v0.4.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.3.1...v0.4.0) diff --git a/package.json b/package.json index 404019c..d59480b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gitpod/sdk", - "version": "0.4.0", + "version": "0.5.0", "description": "The official TypeScript library for the Gitpod API", "author": "Gitpod ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 4e7f788..1f5d158 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.4.0'; // x-release-please-version +export const VERSION = '0.5.0'; // x-release-please-version