@argos-ci/api-client 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -125,6 +125,46 @@ interface paths {
125
125
  patch?: never;
126
126
  trace?: never;
127
127
  };
128
+ "/auth/github-actions/oidc/exchange": {
129
+ parameters: {
130
+ query?: never;
131
+ header?: never;
132
+ path?: never;
133
+ cookie?: never;
134
+ };
135
+ get?: never;
136
+ put?: never;
137
+ /**
138
+ * Exchange a GitHub Actions OIDC token for an Argos token
139
+ * @description Called by GitHub Actions to exchange an OIDC token for a short-lived Argos project token.
140
+ */
141
+ post: operations["exchangeGitHubActionsOidcToken"];
142
+ delete?: never;
143
+ options?: never;
144
+ head?: never;
145
+ patch?: never;
146
+ trace?: never;
147
+ };
148
+ "/auth/github-actions/tokenless/exchange": {
149
+ parameters: {
150
+ query?: never;
151
+ header?: never;
152
+ path?: never;
153
+ cookie?: never;
154
+ };
155
+ get?: never;
156
+ put?: never;
157
+ /**
158
+ * Exchange a tokenless GitHub Actions token for an Argos token
159
+ * @description Called by GitHub Actions to exchange a tokenless bearer token for a short-lived Argos project token. The provided commit and branch must match the GitHub workflow run.
160
+ */
161
+ post: operations["exchangeGitHubActionsTokenlessToken"];
162
+ delete?: never;
163
+ options?: never;
164
+ head?: never;
165
+ patch?: never;
166
+ trace?: never;
167
+ };
128
168
  "/project": {
129
169
  parameters: {
130
170
  query?: never;
@@ -870,6 +910,9 @@ interface operations {
870
910
  content: {
871
911
  "application/json": {
872
912
  deploymentId: string;
913
+ projectId: string; /** @enum {string} */
914
+ environment: "preview" | "production"; /** @enum {string} */
915
+ visibility: "private" | "public";
873
916
  };
874
917
  };
875
918
  }; /** @description Invalid parameters */
@@ -1026,6 +1069,132 @@ interface operations {
1026
1069
  };
1027
1070
  };
1028
1071
  };
1072
+ exchangeGitHubActionsOidcToken: {
1073
+ parameters: {
1074
+ query?: never;
1075
+ header?: never;
1076
+ path?: never;
1077
+ cookie?: never;
1078
+ };
1079
+ requestBody?: {
1080
+ content: {
1081
+ "application/json": {
1082
+ /** @description GitHub Actions OIDC token */oidcToken: string; /** @description GitHub repository in owner/name format */
1083
+ repository?: string; /** @description Expected commit SHA */
1084
+ commit?: components["schemas"]["Sha1Hash"]; /** @description Expected branch name */
1085
+ branch?: string; /** @description Expected pull request number */
1086
+ pullRequestNumber?: number;
1087
+ };
1088
+ };
1089
+ };
1090
+ responses: {
1091
+ /** @description Token exchange successful */200: {
1092
+ headers: {
1093
+ [name: string]: unknown;
1094
+ };
1095
+ content: {
1096
+ "application/json": {
1097
+ /** @description Short-lived Argos project token */token: string; /** @description Token expiration date as an ISO string */
1098
+ expiresAt: string;
1099
+ };
1100
+ };
1101
+ }; /** @description Invalid parameters */
1102
+ 400: {
1103
+ headers: {
1104
+ [name: string]: unknown;
1105
+ };
1106
+ content: {
1107
+ "application/json": components["schemas"]["Error"];
1108
+ };
1109
+ }; /** @description Unauthorized */
1110
+ 401: {
1111
+ headers: {
1112
+ [name: string]: unknown;
1113
+ };
1114
+ content: {
1115
+ "application/json": components["schemas"]["Error"];
1116
+ };
1117
+ }; /** @description Forbidden */
1118
+ 403: {
1119
+ headers: {
1120
+ [name: string]: unknown;
1121
+ };
1122
+ content: {
1123
+ "application/json": components["schemas"]["Error"];
1124
+ };
1125
+ }; /** @description Server error */
1126
+ 500: {
1127
+ headers: {
1128
+ [name: string]: unknown;
1129
+ };
1130
+ content: {
1131
+ "application/json": components["schemas"]["Error"];
1132
+ };
1133
+ };
1134
+ };
1135
+ };
1136
+ exchangeGitHubActionsTokenlessToken: {
1137
+ parameters: {
1138
+ query?: never;
1139
+ header?: never;
1140
+ path?: never;
1141
+ cookie?: never;
1142
+ };
1143
+ requestBody?: {
1144
+ content: {
1145
+ "application/json": {
1146
+ /** @description Argos tokenless GitHub Actions bearer token */tokenlessToken: string; /** @description Expected commit SHA */
1147
+ commit: components["schemas"]["Sha1Hash"]; /** @description Expected branch name */
1148
+ branch: string;
1149
+ };
1150
+ };
1151
+ };
1152
+ responses: {
1153
+ /** @description Token exchange successful */200: {
1154
+ headers: {
1155
+ [name: string]: unknown;
1156
+ };
1157
+ content: {
1158
+ "application/json": {
1159
+ /** @description Short-lived Argos project token */token: string; /** @description Token expiration date as an ISO string */
1160
+ expiresAt: string;
1161
+ };
1162
+ };
1163
+ }; /** @description Invalid parameters */
1164
+ 400: {
1165
+ headers: {
1166
+ [name: string]: unknown;
1167
+ };
1168
+ content: {
1169
+ "application/json": components["schemas"]["Error"];
1170
+ };
1171
+ }; /** @description Unauthorized */
1172
+ 401: {
1173
+ headers: {
1174
+ [name: string]: unknown;
1175
+ };
1176
+ content: {
1177
+ "application/json": components["schemas"]["Error"];
1178
+ };
1179
+ }; /** @description Forbidden */
1180
+ 403: {
1181
+ headers: {
1182
+ [name: string]: unknown;
1183
+ };
1184
+ content: {
1185
+ "application/json": components["schemas"]["Error"];
1186
+ };
1187
+ }; /** @description Server error */
1188
+ 500: {
1189
+ headers: {
1190
+ [name: string]: unknown;
1191
+ };
1192
+ content: {
1193
+ "application/json": components["schemas"]["Error"];
1194
+ };
1195
+ };
1196
+ };
1197
+ };
1029
1198
  getAuthProject: {
1030
1199
  parameters: {
1031
1200
  query?: never;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./chunk-CfYAbeIz.mjs";
2
2
  import createFetchClient from "openapi-fetch";
3
3
  import createDebug from "debug";
4
- //#region ../../node_modules/.pnpm/is-network-error@1.3.1/node_modules/is-network-error/index.js
4
+ //#region ../../node_modules/.pnpm/is-network-error@1.3.2/node_modules/is-network-error/index.js
5
5
  const objectToString = Object.prototype.toString;
6
6
  const isError = (value) => objectToString.call(value) === "[object Error]";
7
7
  const errorMessages = new Set([
@@ -17,7 +17,7 @@ const errorMessages = new Set([
17
17
  function isNetworkError(error) {
18
18
  if (!(error && isError(error) && error.name === "TypeError" && typeof error.message === "string")) return false;
19
19
  const { message, stack } = error;
20
- if (message === "Load failed") return stack === void 0 || "__sentry_captured__" in error;
20
+ if (message === "Load failed" || message.startsWith("Load failed (") && message.endsWith(")")) return stack === void 0 || "__sentry_captured__" in error;
21
21
  if (message.startsWith("error sending request for url")) return true;
22
22
  if (message === "Failed to fetch" || message.startsWith("Failed to fetch (") && message.endsWith(")")) return true;
23
23
  return errorMessages.has(message);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/api-client",
3
3
  "description": "Argos API Client library.",
4
- "version": "0.19.0",
4
+ "version": "0.20.0",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "types": "./dist/index.d.mts",
34
34
  "engines": {
35
- "node": ">=20.0.0"
35
+ "node": ">=22.0.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build-schema-types": "openapi-typescript https://api.argos-ci.com/v2/openapi.yaml -o src/schema.ts",
@@ -52,5 +52,5 @@
52
52
  "debug": "^4.4.3",
53
53
  "openapi-fetch": "^0.17.0"
54
54
  },
55
- "gitHead": "9ff7241b23dce530910d0fffd113db23e2fbe949"
55
+ "gitHead": "357c71173989a18d98767bb8811272cb46ecf937"
56
56
  }