@proofline/sdk 3.1.0 → 3.2.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.
@@ -17,6 +17,8 @@ export type RequestPatchReviewBody = NonNullable<paths["/api/v1/organizations/{o
17
17
  export type RequestReviewParameters = paths["/api/v1/organizations/{org_id}/repositories/{repo_id}/pull-requests/{number}/review"]["post"]["parameters"];
18
18
  export type RequestReviewBody = NonNullable<paths["/api/v1/organizations/{org_id}/repositories/{repo_id}/pull-requests/{number}/review"]["post"]["requestBody"]>["content"]["application/json"];
19
19
  export type GetReviewGuidanceParameters = paths["/api/v1/organizations/{org_id}/repositories/{repo_id}/review-guidance"]["get"]["parameters"];
20
+ export type RequestScanParameters = paths["/api/v1/organizations/{org_id}/repositories/{repo_id}/scans"]["post"]["parameters"];
21
+ export type RequestScanBody = NonNullable<paths["/api/v1/organizations/{org_id}/repositories/{repo_id}/scans"]["post"]["requestBody"]>["content"]["application/json"];
20
22
  export type ListRepositoriesParameters = paths["/api/v1/organizations/{org_id}/repository-names"]["get"]["parameters"];
21
23
  export type ListReviewsParameters = paths["/api/v1/organizations/{org_id}/reviews"]["get"]["parameters"];
22
24
  export type GetDeploymentReviewParameters = paths["/api/v1/organizations/{org_id}/reviews/deployments/{public_key}"]["get"]["parameters"];
@@ -41,6 +43,7 @@ export declare class Operations {
41
43
  requestPatchReview(parameters: RequestPatchReviewParameters, body: RequestPatchReviewBody): Promise<components["schemas"]["PatchReviewResponse"]>;
42
44
  requestReview(parameters: RequestReviewParameters, body?: RequestReviewBody): Promise<components["schemas"]["RunNowResponse"]>;
43
45
  getReviewGuidance(parameters: GetReviewGuidanceParameters): Promise<components["schemas"]["RepositoryGuidance"]>;
46
+ requestScan(parameters: RequestScanParameters, body: RequestScanBody): Promise<components["schemas"]["ScanResponse"]>;
44
47
  listRepositories(parameters: ListRepositoriesParameters): Promise<components["schemas"]["RepositoryNames"]>;
45
48
  listReviews(parameters: ListReviewsParameters): Promise<components["schemas"]["ReviewPage"]>;
46
49
  getDeploymentReview(parameters: GetDeploymentReviewParameters): Promise<components["schemas"]["CustomerReviewDetail"]>;
@@ -36,6 +36,9 @@ export class Operations {
36
36
  getReviewGuidance(parameters) {
37
37
  return this.invoke("GET", "/api/v1/organizations/{org_id}/repositories/{repo_id}/review-guidance", parameters);
38
38
  }
39
+ requestScan(parameters, body) {
40
+ return this.invoke("POST", "/api/v1/organizations/{org_id}/repositories/{repo_id}/scans", parameters, body);
41
+ }
39
42
  listRepositories(parameters) {
40
43
  return this.invoke("GET", "/api/v1/organizations/{org_id}/repository-names", parameters);
41
44
  }
package/dist/schema.d.ts CHANGED
@@ -244,6 +244,26 @@ export interface paths {
244
244
  patch?: never;
245
245
  trace?: never;
246
246
  };
247
+ "/api/v1/organizations/{org_id}/repositories/{repo_id}/scans": {
248
+ parameters: {
249
+ query?: never;
250
+ header?: never;
251
+ path?: never;
252
+ cookie?: never;
253
+ };
254
+ get?: never;
255
+ put?: never;
256
+ /**
257
+ * Scan a repository revision
258
+ * @description Scans the whole repository at one commit, resolved once from `ref` or named by `commit_sha`, and records that resolution. Requires live GitHub write access, and `budget_credits` at most the organization's on-demand scan limit; a limit of 0 turns on-demand scans off. Sending the same `request_id` again returns the first resolution. Results remain in Proofline and are never posted to GitHub.
259
+ */
260
+ post: operations["request_scan"];
261
+ delete?: never;
262
+ options?: never;
263
+ head?: never;
264
+ patch?: never;
265
+ trace?: never;
266
+ };
247
267
  "/api/v1/organizations/{org_id}/repository-names": {
248
268
  parameters: {
249
269
  query?: never;
@@ -1400,8 +1420,9 @@ export interface components {
1400
1420
  /**
1401
1421
  * @description `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes
1402
1422
  * sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,
1403
- * complete selected files at one pushed commit, or `MERGE_GROUP`, the
1404
- * commit GitHub's merge queue built for a group of pull requests.
1423
+ * complete selected files at one pushed commit, `MERGE_GROUP`, the
1424
+ * commit GitHub's merge queue built for a group of pull requests, or
1425
+ * `REVISION_SCAN`, a scan of one captured commit.
1405
1426
  */
1406
1427
  kind: string;
1407
1428
  /**
@@ -2802,8 +2823,9 @@ export interface components {
2802
2823
  /**
2803
2824
  * @description `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes
2804
2825
  * sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,
2805
- * complete selected files at one pushed commit, or `MERGE_GROUP`, the
2806
- * commit GitHub's merge queue built for a group of pull requests.
2826
+ * complete selected files at one pushed commit, `MERGE_GROUP`, the
2827
+ * commit GitHub's merge queue built for a group of pull requests, or
2828
+ * `REVISION_SCAN`, a scan of one captured commit.
2807
2829
  */
2808
2830
  kind: string;
2809
2831
  /**
@@ -3123,6 +3145,44 @@ export interface components {
3123
3145
  */
3124
3146
  run_number: number;
3125
3147
  };
3148
+ /** @description One request to scan a ref or an exact commit of the repository. */
3149
+ ScanRequestBody: {
3150
+ /**
3151
+ * Format: int64
3152
+ * @description The credits the whole scan may spend, at most the organization's
3153
+ * on-demand ceiling.
3154
+ */
3155
+ budget_credits: number;
3156
+ /** @description An exact commit. Name it or `ref`. */
3157
+ commit_sha?: string | null;
3158
+ /** @description A ref, resolved once when the request arrives. Name it or `commit_sha`. */
3159
+ ref?: string | null;
3160
+ /**
3161
+ * Format: uuid
3162
+ * @description The caller's identity for this request. Sending it again returns the
3163
+ * first resolution instead of scanning again.
3164
+ */
3165
+ request_id: string;
3166
+ };
3167
+ /** @description What a scan request resolved to. */
3168
+ ScanResponse: {
3169
+ /**
3170
+ * @description `CREATED`, `EXISTING` when this request id was already resolved, or
3171
+ * `REPOSITORY_UNAVAILABLE` when GitHub could not resolve it.
3172
+ */
3173
+ outcome: string;
3174
+ /**
3175
+ * Format: uuid
3176
+ * @description The request's one resolution receipt.
3177
+ */
3178
+ resolution_id: string;
3179
+ /**
3180
+ * Format: uuid
3181
+ * @description The scan review, readable through the review routes. Absent when
3182
+ * GitHub could not resolve the request.
3183
+ */
3184
+ review_id?: string | null;
3185
+ };
3126
3186
  /** @enum {string} */
3127
3187
  SpendAccountKind: "DEPLOYMENT" | "TENANT_CREDENTIAL" | "UNATTRIBUTED";
3128
3188
  /** @description UTC daily debit totals using only the account and transport recorded at charge time. */
@@ -3935,6 +3995,61 @@ export interface operations {
3935
3995
  };
3936
3996
  };
3937
3997
  };
3998
+ request_scan: {
3999
+ parameters: {
4000
+ query?: never;
4001
+ header?: never;
4002
+ path: {
4003
+ org_id: string;
4004
+ repo_id: string;
4005
+ };
4006
+ cookie?: never;
4007
+ };
4008
+ /** @description One request to scan a ref or an exact commit of the repository. */
4009
+ requestBody: {
4010
+ content: {
4011
+ "application/json": components["schemas"]["ScanRequestBody"];
4012
+ };
4013
+ };
4014
+ responses: {
4015
+ /** @description What a scan request resolved to. */
4016
+ 200: {
4017
+ headers: {
4018
+ [name: string]: unknown;
4019
+ };
4020
+ content: {
4021
+ "application/json": components["schemas"]["ScanResponse"];
4022
+ };
4023
+ };
4024
+ /**
4025
+ * @description A run-now request that created nothing, as the 400 it is answered with.
4026
+ *
4027
+ * The refusal is a configuration fact, not a failure, and it is still sent
4028
+ * as an RFC 9457 problem: `title`, `status` and `detail` are what a client
4029
+ * that knows only problems shows, and `repository_name` and `refusal` are
4030
+ * the extension members a client that knows refusals links from. During a
4031
+ * rollout a page loaded from the previous bundle keeps working against
4032
+ * this server, because a refusal was a 400 with a `detail` before too.
4033
+ */
4034
+ 400: {
4035
+ headers: {
4036
+ [name: string]: unknown;
4037
+ };
4038
+ content: {
4039
+ "application/json": components["schemas"]["RunNowRefused"];
4040
+ };
4041
+ };
4042
+ /** @description An RFC 9457 problem; the HTTP status remains authoritative. */
4043
+ default: {
4044
+ headers: {
4045
+ [name: string]: unknown;
4046
+ };
4047
+ content: {
4048
+ "application/problem+json": components["schemas"]["Problem"];
4049
+ };
4050
+ };
4051
+ };
4052
+ };
3938
4053
  list_repositories: {
3939
4054
  parameters: {
3940
4055
  query?: never;
package/dist/transport.js CHANGED
@@ -1,4 +1,4 @@
1
- const VERSION = "3.1.0";
1
+ const VERSION = "3.2.0";
2
2
  const MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
3
3
  const MAX_RETRIES = 3;
4
4
  const MAX_RETRY_SECONDS = 60;
@@ -1755,7 +1755,7 @@
1755
1755
  "type": "boolean"
1756
1756
  },
1757
1757
  "kind": {
1758
- "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,\n complete selected files at one pushed commit, or `MERGE_GROUP`, the\n commit GitHub's merge queue built for a group of pull requests.",
1758
+ "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,\n complete selected files at one pushed commit, `MERGE_GROUP`, the\n commit GitHub's merge queue built for a group of pull requests, or\n `REVISION_SCAN`, a scan of one captured commit.",
1759
1759
  "type": "string"
1760
1760
  },
1761
1761
  "local_reverifications": {
@@ -4570,7 +4570,7 @@
4570
4570
  "type": "string"
4571
4571
  },
4572
4572
  "kind": {
4573
- "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,\n complete selected files at one pushed commit, or `MERGE_GROUP`, the\n commit GitHub's merge queue built for a group of pull requests.",
4573
+ "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,\n complete selected files at one pushed commit, `MERGE_GROUP`, the\n commit GitHub's merge queue built for a group of pull requests, or\n `REVISION_SCAN`, a scan of one captured commit.",
4574
4574
  "type": "string"
4575
4575
  },
4576
4576
  "merge_group_pull_request_numbers": {
@@ -5236,6 +5236,68 @@
5236
5236
  ],
5237
5237
  "type": "object"
5238
5238
  },
5239
+ "ScanRequestBody": {
5240
+ "additionalProperties": false,
5241
+ "description": "One request to scan a ref or an exact commit of the repository.",
5242
+ "properties": {
5243
+ "budget_credits": {
5244
+ "description": "The credits the whole scan may spend, at most the organization's\n on-demand ceiling.",
5245
+ "format": "int64",
5246
+ "type": "integer"
5247
+ },
5248
+ "commit_sha": {
5249
+ "description": "An exact commit. Name it or `ref`.",
5250
+ "type": [
5251
+ "string",
5252
+ "null"
5253
+ ]
5254
+ },
5255
+ "ref": {
5256
+ "description": "A ref, resolved once when the request arrives. Name it or `commit_sha`.",
5257
+ "type": [
5258
+ "string",
5259
+ "null"
5260
+ ]
5261
+ },
5262
+ "request_id": {
5263
+ "description": "The caller's identity for this request. Sending it again returns the\n first resolution instead of scanning again.",
5264
+ "format": "uuid",
5265
+ "type": "string"
5266
+ }
5267
+ },
5268
+ "required": [
5269
+ "request_id",
5270
+ "budget_credits"
5271
+ ],
5272
+ "type": "object"
5273
+ },
5274
+ "ScanResponse": {
5275
+ "description": "What a scan request resolved to.",
5276
+ "properties": {
5277
+ "outcome": {
5278
+ "description": "`CREATED`, `EXISTING` when this request id was already resolved, or\n `REPOSITORY_UNAVAILABLE` when GitHub could not resolve it.",
5279
+ "type": "string"
5280
+ },
5281
+ "resolution_id": {
5282
+ "description": "The request's one resolution receipt.",
5283
+ "format": "uuid",
5284
+ "type": "string"
5285
+ },
5286
+ "review_id": {
5287
+ "description": "The scan review, readable through the review routes. Absent when\n GitHub could not resolve the request.",
5288
+ "format": "uuid",
5289
+ "type": [
5290
+ "string",
5291
+ "null"
5292
+ ]
5293
+ }
5294
+ },
5295
+ "required": [
5296
+ "resolution_id",
5297
+ "outcome"
5298
+ ],
5299
+ "type": "object"
5300
+ },
5239
5301
  "SpendAccountKind": {
5240
5302
  "enum": [
5241
5303
  "DEPLOYMENT",
@@ -5769,7 +5831,7 @@
5769
5831
  },
5770
5832
  "info": {
5771
5833
  "title": "Proofline Review API",
5772
- "version": "3.1.0"
5834
+ "version": "3.2.0"
5773
5835
  },
5774
5836
  "openapi": "3.1.0",
5775
5837
  "paths": {
@@ -6697,6 +6759,84 @@
6697
6759
  "x-proofline-token-scope": "guidance:read"
6698
6760
  }
6699
6761
  },
6762
+ "/api/v1/organizations/{org_id}/repositories/{repo_id}/scans": {
6763
+ "post": {
6764
+ "description": "Scans the whole repository at one commit, resolved once from `ref` or named by `commit_sha`, and records that resolution. Requires live GitHub write access, and `budget_credits` at most the organization's on-demand scan limit; a limit of 0 turns on-demand scans off. Sending the same `request_id` again returns the first resolution. Results remain in Proofline and are never posted to GitHub.",
6765
+ "operationId": "request_scan",
6766
+ "parameters": [
6767
+ {
6768
+ "in": "path",
6769
+ "name": "org_id",
6770
+ "required": true,
6771
+ "schema": {
6772
+ "format": "uuid",
6773
+ "type": "string"
6774
+ },
6775
+ "style": "simple"
6776
+ },
6777
+ {
6778
+ "in": "path",
6779
+ "name": "repo_id",
6780
+ "required": true,
6781
+ "schema": {
6782
+ "format": "uuid",
6783
+ "type": "string"
6784
+ },
6785
+ "style": "simple"
6786
+ }
6787
+ ],
6788
+ "requestBody": {
6789
+ "content": {
6790
+ "application/json": {
6791
+ "schema": {
6792
+ "$ref": "#/components/schemas/ScanRequestBody"
6793
+ }
6794
+ }
6795
+ },
6796
+ "description": "One request to scan a ref or an exact commit of the repository.",
6797
+ "required": true
6798
+ },
6799
+ "responses": {
6800
+ "200": {
6801
+ "content": {
6802
+ "application/json": {
6803
+ "schema": {
6804
+ "$ref": "#/components/schemas/ScanResponse"
6805
+ }
6806
+ }
6807
+ },
6808
+ "description": "What a scan request resolved to."
6809
+ },
6810
+ "400": {
6811
+ "content": {
6812
+ "application/json": {
6813
+ "schema": {
6814
+ "$ref": "#/components/schemas/RunNowRefused"
6815
+ }
6816
+ }
6817
+ },
6818
+ "description": "A run-now request that created nothing, as the 400 it is answered with.\n\n The refusal is a configuration fact, not a failure, and it is still sent\n as an RFC 9457 problem: `title`, `status` and `detail` are what a client\n that knows only problems shows, and `repository_name` and `refusal` are\n the extension members a client that knows refusals links from. During a\n rollout a page loaded from the previous bundle keeps working against\n this server, because a refusal was a 400 with a `detail` before too."
6819
+ },
6820
+ "default": {
6821
+ "content": {
6822
+ "application/problem+json": {
6823
+ "schema": {
6824
+ "$ref": "#/components/schemas/Problem"
6825
+ }
6826
+ }
6827
+ },
6828
+ "description": "An RFC 9457 problem; the HTTP status remains authoritative."
6829
+ }
6830
+ },
6831
+ "security": [
6832
+ {
6833
+ "bearerAuth": []
6834
+ }
6835
+ ],
6836
+ "summary": "Scan a repository revision",
6837
+ "x-proofline-token-scope": "scans:request"
6838
+ }
6839
+ },
6700
6840
  "/api/v1/organizations/{org_id}/repository-names": {
6701
6841
  "get": {
6702
6842
  "description": "Returns the ID and full name of each connected repository inside the token's repository restriction, including repositories with no review, so a client can resolve `owner/name` to an ID.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proofline/sdk",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Typed clients for the token-scoped Proofline review API",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",