@actions/artifact 1.1.2 → 2.0.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.
Files changed (125) hide show
  1. package/README.md +111 -174
  2. package/lib/artifact.d.ts +6 -0
  3. package/lib/artifact.js +23 -0
  4. package/lib/artifact.js.map +1 -0
  5. package/lib/generated/google/protobuf/timestamp.d.ts +145 -0
  6. package/lib/generated/google/protobuf/timestamp.js +136 -0
  7. package/lib/generated/google/protobuf/timestamp.js.map +1 -0
  8. package/lib/generated/google/protobuf/wrappers.d.ts +307 -0
  9. package/lib/generated/google/protobuf/wrappers.js +609 -0
  10. package/lib/generated/google/protobuf/wrappers.js.map +1 -0
  11. package/lib/generated/index.d.ts +4 -0
  12. package/lib/generated/index.js +21 -0
  13. package/lib/generated/index.js.map +1 -0
  14. package/lib/generated/results/api/v1/artifact.d.ts +286 -0
  15. package/lib/generated/results/api/v1/artifact.js +588 -0
  16. package/lib/generated/results/api/v1/artifact.js.map +1 -0
  17. package/lib/generated/results/api/v1/artifact.twirp.d.ts +43 -0
  18. package/lib/generated/results/api/v1/artifact.twirp.js +416 -0
  19. package/lib/generated/results/api/v1/artifact.twirp.js.map +1 -0
  20. package/lib/internal/client.d.ts +61 -0
  21. package/lib/internal/client.js +121 -0
  22. package/lib/internal/client.js.map +1 -0
  23. package/lib/internal/download/download-artifact.d.ts +3 -0
  24. package/lib/internal/download/download-artifact.js +168 -0
  25. package/lib/internal/download/download-artifact.js.map +1 -0
  26. package/lib/internal/find/get-artifact.d.ts +3 -0
  27. package/lib/internal/find/get-artifact.js +118 -0
  28. package/lib/internal/find/get-artifact.js.map +1 -0
  29. package/lib/internal/find/list-artifacts.d.ts +3 -0
  30. package/lib/internal/find/list-artifacts.js +139 -0
  31. package/lib/internal/find/list-artifacts.js.map +1 -0
  32. package/lib/internal/find/retry-options.d.ts +7 -0
  33. package/lib/internal/find/retry-options.js +50 -0
  34. package/lib/internal/find/retry-options.js.map +1 -0
  35. package/lib/internal/shared/artifact-twirp-client.d.ts +6 -0
  36. package/lib/internal/shared/artifact-twirp-client.js +153 -0
  37. package/lib/internal/shared/artifact-twirp-client.js.map +1 -0
  38. package/lib/internal/shared/config.d.ts +6 -0
  39. package/lib/internal/shared/config.js +55 -0
  40. package/lib/internal/shared/config.js.map +1 -0
  41. package/lib/internal/shared/errors.d.ts +22 -0
  42. package/lib/internal/shared/errors.js +70 -0
  43. package/lib/internal/shared/errors.js.map +1 -0
  44. package/lib/internal/shared/interfaces.d.ts +136 -0
  45. package/lib/internal/{contracts.js → shared/interfaces.js} +1 -1
  46. package/lib/internal/shared/interfaces.js.map +1 -0
  47. package/lib/internal/shared/user-agent.d.ts +4 -0
  48. package/lib/internal/shared/user-agent.js +13 -0
  49. package/lib/internal/shared/user-agent.js.map +1 -0
  50. package/lib/internal/shared/util.d.ts +5 -0
  51. package/lib/internal/shared/util.js +81 -0
  52. package/lib/internal/shared/util.js.map +1 -0
  53. package/lib/internal/upload/blob-upload.d.ts +12 -0
  54. package/lib/internal/upload/blob-upload.js +87 -0
  55. package/lib/internal/upload/blob-upload.js.map +1 -0
  56. package/lib/internal/upload/path-and-artifact-name-validation.d.ts +8 -0
  57. package/lib/internal/{path-and-artifact-name-validation.js → upload/path-and-artifact-name-validation.js} +11 -11
  58. package/lib/internal/upload/path-and-artifact-name-validation.js.map +1 -0
  59. package/lib/internal/upload/retention.d.ts +2 -0
  60. package/lib/internal/upload/retention.js +54 -0
  61. package/lib/internal/upload/retention.js.map +1 -0
  62. package/lib/internal/upload/upload-artifact.d.ts +2 -0
  63. package/lib/internal/upload/upload-artifact.js +103 -0
  64. package/lib/internal/upload/upload-artifact.js.map +1 -0
  65. package/lib/internal/upload/upload-zip-specification.d.ts +21 -0
  66. package/lib/internal/{upload-specification.js → upload/upload-zip-specification.js} +44 -36
  67. package/lib/internal/upload/upload-zip-specification.js.map +1 -0
  68. package/lib/internal/upload/zip.d.ts +9 -0
  69. package/lib/internal/upload/zip.js +113 -0
  70. package/lib/internal/upload/zip.js.map +1 -0
  71. package/package.json +25 -11
  72. package/lib/artifact-client.d.ts +0 -10
  73. package/lib/artifact-client.js +0 -12
  74. package/lib/artifact-client.js.map +0 -1
  75. package/lib/internal/artifact-client.d.ts +0 -41
  76. package/lib/internal/artifact-client.js +0 -182
  77. package/lib/internal/artifact-client.js.map +0 -1
  78. package/lib/internal/config-variables.d.ts +0 -12
  79. package/lib/internal/config-variables.js +0 -77
  80. package/lib/internal/config-variables.js.map +0 -1
  81. package/lib/internal/contracts.d.ts +0 -67
  82. package/lib/internal/contracts.js.map +0 -1
  83. package/lib/internal/crc64.d.ts +0 -21
  84. package/lib/internal/crc64.js +0 -303
  85. package/lib/internal/crc64.js.map +0 -1
  86. package/lib/internal/download-http-client.d.ts +0 -39
  87. package/lib/internal/download-http-client.js +0 -296
  88. package/lib/internal/download-http-client.js.map +0 -1
  89. package/lib/internal/download-options.d.ts +0 -7
  90. package/lib/internal/download-options.js +0 -3
  91. package/lib/internal/download-options.js.map +0 -1
  92. package/lib/internal/download-response.d.ts +0 -10
  93. package/lib/internal/download-response.js +0 -3
  94. package/lib/internal/download-response.js.map +0 -1
  95. package/lib/internal/download-specification.d.ts +0 -19
  96. package/lib/internal/download-specification.js +0 -78
  97. package/lib/internal/download-specification.js.map +0 -1
  98. package/lib/internal/http-manager.d.ts +0 -12
  99. package/lib/internal/http-manager.js +0 -32
  100. package/lib/internal/http-manager.js.map +0 -1
  101. package/lib/internal/path-and-artifact-name-validation.d.ts +0 -8
  102. package/lib/internal/path-and-artifact-name-validation.js.map +0 -1
  103. package/lib/internal/requestUtils.d.ts +0 -3
  104. package/lib/internal/requestUtils.js +0 -92
  105. package/lib/internal/requestUtils.js.map +0 -1
  106. package/lib/internal/status-reporter.d.ts +0 -21
  107. package/lib/internal/status-reporter.js +0 -52
  108. package/lib/internal/status-reporter.js.map +0 -1
  109. package/lib/internal/upload-gzip.d.ts +0 -14
  110. package/lib/internal/upload-gzip.js +0 -147
  111. package/lib/internal/upload-gzip.js.map +0 -1
  112. package/lib/internal/upload-http-client.d.ts +0 -48
  113. package/lib/internal/upload-http-client.js +0 -415
  114. package/lib/internal/upload-http-client.js.map +0 -1
  115. package/lib/internal/upload-options.d.ts +0 -34
  116. package/lib/internal/upload-options.js +0 -3
  117. package/lib/internal/upload-options.js.map +0 -1
  118. package/lib/internal/upload-response.d.ts +0 -19
  119. package/lib/internal/upload-response.js +0 -3
  120. package/lib/internal/upload-response.js.map +0 -1
  121. package/lib/internal/upload-specification.d.ts +0 -11
  122. package/lib/internal/upload-specification.js.map +0 -1
  123. package/lib/internal/utils.d.ts +0 -71
  124. package/lib/internal/utils.js +0 -292
  125. package/lib/internal/utils.js.map +0 -1
@@ -0,0 +1,43 @@
1
+ /// <reference types="node" />
2
+ import { TwirpContext, TwirpServer } from "twirp-ts";
3
+ import { CreateArtifactRequest, CreateArtifactResponse, FinalizeArtifactRequest, FinalizeArtifactResponse, ListArtifactsRequest, ListArtifactsResponse, GetSignedArtifactURLRequest, GetSignedArtifactURLResponse } from "./artifact";
4
+ interface Rpc {
5
+ request(service: string, method: string, contentType: "application/json" | "application/protobuf", data: object | Uint8Array): Promise<object | Uint8Array>;
6
+ }
7
+ export interface ArtifactServiceClient {
8
+ CreateArtifact(request: CreateArtifactRequest): Promise<CreateArtifactResponse>;
9
+ FinalizeArtifact(request: FinalizeArtifactRequest): Promise<FinalizeArtifactResponse>;
10
+ ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse>;
11
+ GetSignedArtifactURL(request: GetSignedArtifactURLRequest): Promise<GetSignedArtifactURLResponse>;
12
+ }
13
+ export declare class ArtifactServiceClientJSON implements ArtifactServiceClient {
14
+ private readonly rpc;
15
+ constructor(rpc: Rpc);
16
+ CreateArtifact(request: CreateArtifactRequest): Promise<CreateArtifactResponse>;
17
+ FinalizeArtifact(request: FinalizeArtifactRequest): Promise<FinalizeArtifactResponse>;
18
+ ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse>;
19
+ GetSignedArtifactURL(request: GetSignedArtifactURLRequest): Promise<GetSignedArtifactURLResponse>;
20
+ }
21
+ export declare class ArtifactServiceClientProtobuf implements ArtifactServiceClient {
22
+ private readonly rpc;
23
+ constructor(rpc: Rpc);
24
+ CreateArtifact(request: CreateArtifactRequest): Promise<CreateArtifactResponse>;
25
+ FinalizeArtifact(request: FinalizeArtifactRequest): Promise<FinalizeArtifactResponse>;
26
+ ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse>;
27
+ GetSignedArtifactURL(request: GetSignedArtifactURLRequest): Promise<GetSignedArtifactURLResponse>;
28
+ }
29
+ export interface ArtifactServiceTwirp<T extends TwirpContext = TwirpContext> {
30
+ CreateArtifact(ctx: T, request: CreateArtifactRequest): Promise<CreateArtifactResponse>;
31
+ FinalizeArtifact(ctx: T, request: FinalizeArtifactRequest): Promise<FinalizeArtifactResponse>;
32
+ ListArtifacts(ctx: T, request: ListArtifactsRequest): Promise<ListArtifactsResponse>;
33
+ GetSignedArtifactURL(ctx: T, request: GetSignedArtifactURLRequest): Promise<GetSignedArtifactURLResponse>;
34
+ }
35
+ export declare enum ArtifactServiceMethod {
36
+ CreateArtifact = "CreateArtifact",
37
+ FinalizeArtifact = "FinalizeArtifact",
38
+ ListArtifacts = "ListArtifacts",
39
+ GetSignedArtifactURL = "GetSignedArtifactURL"
40
+ }
41
+ export declare const ArtifactServiceMethodList: ArtifactServiceMethod[];
42
+ export declare function createArtifactServiceServer<T extends TwirpContext = TwirpContext>(service: ArtifactServiceTwirp<T>): TwirpServer<ArtifactServiceTwirp<TwirpContext<import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>>>, T>;
43
+ export {};
@@ -0,0 +1,416 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.createArtifactServiceServer = exports.ArtifactServiceMethodList = exports.ArtifactServiceMethod = exports.ArtifactServiceClientProtobuf = exports.ArtifactServiceClientJSON = void 0;
13
+ const twirp_ts_1 = require("twirp-ts");
14
+ const artifact_1 = require("./artifact");
15
+ class ArtifactServiceClientJSON {
16
+ constructor(rpc) {
17
+ this.rpc = rpc;
18
+ this.CreateArtifact.bind(this);
19
+ this.FinalizeArtifact.bind(this);
20
+ this.ListArtifacts.bind(this);
21
+ this.GetSignedArtifactURL.bind(this);
22
+ }
23
+ CreateArtifact(request) {
24
+ const data = artifact_1.CreateArtifactRequest.toJson(request, {
25
+ useProtoFieldName: true,
26
+ emitDefaultValues: false,
27
+ });
28
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "CreateArtifact", "application/json", data);
29
+ return promise.then((data) => artifact_1.CreateArtifactResponse.fromJson(data, {
30
+ ignoreUnknownFields: true,
31
+ }));
32
+ }
33
+ FinalizeArtifact(request) {
34
+ const data = artifact_1.FinalizeArtifactRequest.toJson(request, {
35
+ useProtoFieldName: true,
36
+ emitDefaultValues: false,
37
+ });
38
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "FinalizeArtifact", "application/json", data);
39
+ return promise.then((data) => artifact_1.FinalizeArtifactResponse.fromJson(data, {
40
+ ignoreUnknownFields: true,
41
+ }));
42
+ }
43
+ ListArtifacts(request) {
44
+ const data = artifact_1.ListArtifactsRequest.toJson(request, {
45
+ useProtoFieldName: true,
46
+ emitDefaultValues: false,
47
+ });
48
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "ListArtifacts", "application/json", data);
49
+ return promise.then((data) => artifact_1.ListArtifactsResponse.fromJson(data, { ignoreUnknownFields: true }));
50
+ }
51
+ GetSignedArtifactURL(request) {
52
+ const data = artifact_1.GetSignedArtifactURLRequest.toJson(request, {
53
+ useProtoFieldName: true,
54
+ emitDefaultValues: false,
55
+ });
56
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "GetSignedArtifactURL", "application/json", data);
57
+ return promise.then((data) => artifact_1.GetSignedArtifactURLResponse.fromJson(data, {
58
+ ignoreUnknownFields: true,
59
+ }));
60
+ }
61
+ }
62
+ exports.ArtifactServiceClientJSON = ArtifactServiceClientJSON;
63
+ class ArtifactServiceClientProtobuf {
64
+ constructor(rpc) {
65
+ this.rpc = rpc;
66
+ this.CreateArtifact.bind(this);
67
+ this.FinalizeArtifact.bind(this);
68
+ this.ListArtifacts.bind(this);
69
+ this.GetSignedArtifactURL.bind(this);
70
+ }
71
+ CreateArtifact(request) {
72
+ const data = artifact_1.CreateArtifactRequest.toBinary(request);
73
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "CreateArtifact", "application/protobuf", data);
74
+ return promise.then((data) => artifact_1.CreateArtifactResponse.fromBinary(data));
75
+ }
76
+ FinalizeArtifact(request) {
77
+ const data = artifact_1.FinalizeArtifactRequest.toBinary(request);
78
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "FinalizeArtifact", "application/protobuf", data);
79
+ return promise.then((data) => artifact_1.FinalizeArtifactResponse.fromBinary(data));
80
+ }
81
+ ListArtifacts(request) {
82
+ const data = artifact_1.ListArtifactsRequest.toBinary(request);
83
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "ListArtifacts", "application/protobuf", data);
84
+ return promise.then((data) => artifact_1.ListArtifactsResponse.fromBinary(data));
85
+ }
86
+ GetSignedArtifactURL(request) {
87
+ const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request);
88
+ const promise = this.rpc.request("github.actions.results.api.v1.ArtifactService", "GetSignedArtifactURL", "application/protobuf", data);
89
+ return promise.then((data) => artifact_1.GetSignedArtifactURLResponse.fromBinary(data));
90
+ }
91
+ }
92
+ exports.ArtifactServiceClientProtobuf = ArtifactServiceClientProtobuf;
93
+ var ArtifactServiceMethod;
94
+ (function (ArtifactServiceMethod) {
95
+ ArtifactServiceMethod["CreateArtifact"] = "CreateArtifact";
96
+ ArtifactServiceMethod["FinalizeArtifact"] = "FinalizeArtifact";
97
+ ArtifactServiceMethod["ListArtifacts"] = "ListArtifacts";
98
+ ArtifactServiceMethod["GetSignedArtifactURL"] = "GetSignedArtifactURL";
99
+ })(ArtifactServiceMethod || (exports.ArtifactServiceMethod = ArtifactServiceMethod = {}));
100
+ exports.ArtifactServiceMethodList = [
101
+ ArtifactServiceMethod.CreateArtifact,
102
+ ArtifactServiceMethod.FinalizeArtifact,
103
+ ArtifactServiceMethod.ListArtifacts,
104
+ ArtifactServiceMethod.GetSignedArtifactURL,
105
+ ];
106
+ function createArtifactServiceServer(service) {
107
+ return new twirp_ts_1.TwirpServer({
108
+ service,
109
+ packageName: "github.actions.results.api.v1",
110
+ serviceName: "ArtifactService",
111
+ methodList: exports.ArtifactServiceMethodList,
112
+ matchRoute: matchArtifactServiceRoute,
113
+ });
114
+ }
115
+ exports.createArtifactServiceServer = createArtifactServiceServer;
116
+ function matchArtifactServiceRoute(method, events) {
117
+ switch (method) {
118
+ case "CreateArtifact":
119
+ return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () {
120
+ ctx = Object.assign(Object.assign({}, ctx), { methodName: "CreateArtifact" });
121
+ yield events.onMatch(ctx);
122
+ return handleArtifactServiceCreateArtifactRequest(ctx, service, data, interceptors);
123
+ });
124
+ case "FinalizeArtifact":
125
+ return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () {
126
+ ctx = Object.assign(Object.assign({}, ctx), { methodName: "FinalizeArtifact" });
127
+ yield events.onMatch(ctx);
128
+ return handleArtifactServiceFinalizeArtifactRequest(ctx, service, data, interceptors);
129
+ });
130
+ case "ListArtifacts":
131
+ return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () {
132
+ ctx = Object.assign(Object.assign({}, ctx), { methodName: "ListArtifacts" });
133
+ yield events.onMatch(ctx);
134
+ return handleArtifactServiceListArtifactsRequest(ctx, service, data, interceptors);
135
+ });
136
+ case "GetSignedArtifactURL":
137
+ return (ctx, service, data, interceptors) => __awaiter(this, void 0, void 0, function* () {
138
+ ctx = Object.assign(Object.assign({}, ctx), { methodName: "GetSignedArtifactURL" });
139
+ yield events.onMatch(ctx);
140
+ return handleArtifactServiceGetSignedArtifactURLRequest(ctx, service, data, interceptors);
141
+ });
142
+ default:
143
+ events.onNotFound();
144
+ const msg = `no handler found`;
145
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg);
146
+ }
147
+ }
148
+ function handleArtifactServiceCreateArtifactRequest(ctx, service, data, interceptors) {
149
+ switch (ctx.contentType) {
150
+ case twirp_ts_1.TwirpContentType.JSON:
151
+ return handleArtifactServiceCreateArtifactJSON(ctx, service, data, interceptors);
152
+ case twirp_ts_1.TwirpContentType.Protobuf:
153
+ return handleArtifactServiceCreateArtifactProtobuf(ctx, service, data, interceptors);
154
+ default:
155
+ const msg = "unexpected Content-Type";
156
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg);
157
+ }
158
+ }
159
+ function handleArtifactServiceFinalizeArtifactRequest(ctx, service, data, interceptors) {
160
+ switch (ctx.contentType) {
161
+ case twirp_ts_1.TwirpContentType.JSON:
162
+ return handleArtifactServiceFinalizeArtifactJSON(ctx, service, data, interceptors);
163
+ case twirp_ts_1.TwirpContentType.Protobuf:
164
+ return handleArtifactServiceFinalizeArtifactProtobuf(ctx, service, data, interceptors);
165
+ default:
166
+ const msg = "unexpected Content-Type";
167
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg);
168
+ }
169
+ }
170
+ function handleArtifactServiceListArtifactsRequest(ctx, service, data, interceptors) {
171
+ switch (ctx.contentType) {
172
+ case twirp_ts_1.TwirpContentType.JSON:
173
+ return handleArtifactServiceListArtifactsJSON(ctx, service, data, interceptors);
174
+ case twirp_ts_1.TwirpContentType.Protobuf:
175
+ return handleArtifactServiceListArtifactsProtobuf(ctx, service, data, interceptors);
176
+ default:
177
+ const msg = "unexpected Content-Type";
178
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg);
179
+ }
180
+ }
181
+ function handleArtifactServiceGetSignedArtifactURLRequest(ctx, service, data, interceptors) {
182
+ switch (ctx.contentType) {
183
+ case twirp_ts_1.TwirpContentType.JSON:
184
+ return handleArtifactServiceGetSignedArtifactURLJSON(ctx, service, data, interceptors);
185
+ case twirp_ts_1.TwirpContentType.Protobuf:
186
+ return handleArtifactServiceGetSignedArtifactURLProtobuf(ctx, service, data, interceptors);
187
+ default:
188
+ const msg = "unexpected Content-Type";
189
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.BadRoute, msg);
190
+ }
191
+ }
192
+ function handleArtifactServiceCreateArtifactJSON(ctx, service, data, interceptors) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ let request;
195
+ let response;
196
+ try {
197
+ const body = JSON.parse(data.toString() || "{}");
198
+ request = artifact_1.CreateArtifactRequest.fromJson(body, {
199
+ ignoreUnknownFields: true,
200
+ });
201
+ }
202
+ catch (e) {
203
+ if (e instanceof Error) {
204
+ const msg = "the json request could not be decoded";
205
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
206
+ }
207
+ }
208
+ if (interceptors && interceptors.length > 0) {
209
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
210
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
211
+ return service.CreateArtifact(ctx, inputReq);
212
+ });
213
+ }
214
+ else {
215
+ response = yield service.CreateArtifact(ctx, request);
216
+ }
217
+ return JSON.stringify(artifact_1.CreateArtifactResponse.toJson(response, {
218
+ useProtoFieldName: true,
219
+ emitDefaultValues: false,
220
+ }));
221
+ });
222
+ }
223
+ function handleArtifactServiceFinalizeArtifactJSON(ctx, service, data, interceptors) {
224
+ return __awaiter(this, void 0, void 0, function* () {
225
+ let request;
226
+ let response;
227
+ try {
228
+ const body = JSON.parse(data.toString() || "{}");
229
+ request = artifact_1.FinalizeArtifactRequest.fromJson(body, {
230
+ ignoreUnknownFields: true,
231
+ });
232
+ }
233
+ catch (e) {
234
+ if (e instanceof Error) {
235
+ const msg = "the json request could not be decoded";
236
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
237
+ }
238
+ }
239
+ if (interceptors && interceptors.length > 0) {
240
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
241
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
242
+ return service.FinalizeArtifact(ctx, inputReq);
243
+ });
244
+ }
245
+ else {
246
+ response = yield service.FinalizeArtifact(ctx, request);
247
+ }
248
+ return JSON.stringify(artifact_1.FinalizeArtifactResponse.toJson(response, {
249
+ useProtoFieldName: true,
250
+ emitDefaultValues: false,
251
+ }));
252
+ });
253
+ }
254
+ function handleArtifactServiceListArtifactsJSON(ctx, service, data, interceptors) {
255
+ return __awaiter(this, void 0, void 0, function* () {
256
+ let request;
257
+ let response;
258
+ try {
259
+ const body = JSON.parse(data.toString() || "{}");
260
+ request = artifact_1.ListArtifactsRequest.fromJson(body, {
261
+ ignoreUnknownFields: true,
262
+ });
263
+ }
264
+ catch (e) {
265
+ if (e instanceof Error) {
266
+ const msg = "the json request could not be decoded";
267
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
268
+ }
269
+ }
270
+ if (interceptors && interceptors.length > 0) {
271
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
272
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
273
+ return service.ListArtifacts(ctx, inputReq);
274
+ });
275
+ }
276
+ else {
277
+ response = yield service.ListArtifacts(ctx, request);
278
+ }
279
+ return JSON.stringify(artifact_1.ListArtifactsResponse.toJson(response, {
280
+ useProtoFieldName: true,
281
+ emitDefaultValues: false,
282
+ }));
283
+ });
284
+ }
285
+ function handleArtifactServiceGetSignedArtifactURLJSON(ctx, service, data, interceptors) {
286
+ return __awaiter(this, void 0, void 0, function* () {
287
+ let request;
288
+ let response;
289
+ try {
290
+ const body = JSON.parse(data.toString() || "{}");
291
+ request = artifact_1.GetSignedArtifactURLRequest.fromJson(body, {
292
+ ignoreUnknownFields: true,
293
+ });
294
+ }
295
+ catch (e) {
296
+ if (e instanceof Error) {
297
+ const msg = "the json request could not be decoded";
298
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
299
+ }
300
+ }
301
+ if (interceptors && interceptors.length > 0) {
302
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
303
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
304
+ return service.GetSignedArtifactURL(ctx, inputReq);
305
+ });
306
+ }
307
+ else {
308
+ response = yield service.GetSignedArtifactURL(ctx, request);
309
+ }
310
+ return JSON.stringify(artifact_1.GetSignedArtifactURLResponse.toJson(response, {
311
+ useProtoFieldName: true,
312
+ emitDefaultValues: false,
313
+ }));
314
+ });
315
+ }
316
+ function handleArtifactServiceCreateArtifactProtobuf(ctx, service, data, interceptors) {
317
+ return __awaiter(this, void 0, void 0, function* () {
318
+ let request;
319
+ let response;
320
+ try {
321
+ request = artifact_1.CreateArtifactRequest.fromBinary(data);
322
+ }
323
+ catch (e) {
324
+ if (e instanceof Error) {
325
+ const msg = "the protobuf request could not be decoded";
326
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
327
+ }
328
+ }
329
+ if (interceptors && interceptors.length > 0) {
330
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
331
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
332
+ return service.CreateArtifact(ctx, inputReq);
333
+ });
334
+ }
335
+ else {
336
+ response = yield service.CreateArtifact(ctx, request);
337
+ }
338
+ return Buffer.from(artifact_1.CreateArtifactResponse.toBinary(response));
339
+ });
340
+ }
341
+ function handleArtifactServiceFinalizeArtifactProtobuf(ctx, service, data, interceptors) {
342
+ return __awaiter(this, void 0, void 0, function* () {
343
+ let request;
344
+ let response;
345
+ try {
346
+ request = artifact_1.FinalizeArtifactRequest.fromBinary(data);
347
+ }
348
+ catch (e) {
349
+ if (e instanceof Error) {
350
+ const msg = "the protobuf request could not be decoded";
351
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
352
+ }
353
+ }
354
+ if (interceptors && interceptors.length > 0) {
355
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
356
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
357
+ return service.FinalizeArtifact(ctx, inputReq);
358
+ });
359
+ }
360
+ else {
361
+ response = yield service.FinalizeArtifact(ctx, request);
362
+ }
363
+ return Buffer.from(artifact_1.FinalizeArtifactResponse.toBinary(response));
364
+ });
365
+ }
366
+ function handleArtifactServiceListArtifactsProtobuf(ctx, service, data, interceptors) {
367
+ return __awaiter(this, void 0, void 0, function* () {
368
+ let request;
369
+ let response;
370
+ try {
371
+ request = artifact_1.ListArtifactsRequest.fromBinary(data);
372
+ }
373
+ catch (e) {
374
+ if (e instanceof Error) {
375
+ const msg = "the protobuf request could not be decoded";
376
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
377
+ }
378
+ }
379
+ if (interceptors && interceptors.length > 0) {
380
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
381
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
382
+ return service.ListArtifacts(ctx, inputReq);
383
+ });
384
+ }
385
+ else {
386
+ response = yield service.ListArtifacts(ctx, request);
387
+ }
388
+ return Buffer.from(artifact_1.ListArtifactsResponse.toBinary(response));
389
+ });
390
+ }
391
+ function handleArtifactServiceGetSignedArtifactURLProtobuf(ctx, service, data, interceptors) {
392
+ return __awaiter(this, void 0, void 0, function* () {
393
+ let request;
394
+ let response;
395
+ try {
396
+ request = artifact_1.GetSignedArtifactURLRequest.fromBinary(data);
397
+ }
398
+ catch (e) {
399
+ if (e instanceof Error) {
400
+ const msg = "the protobuf request could not be decoded";
401
+ throw new twirp_ts_1.TwirpError(twirp_ts_1.TwirpErrorCode.Malformed, msg).withCause(e, true);
402
+ }
403
+ }
404
+ if (interceptors && interceptors.length > 0) {
405
+ const interceptor = (0, twirp_ts_1.chainInterceptors)(...interceptors);
406
+ response = yield interceptor(ctx, request, (ctx, inputReq) => {
407
+ return service.GetSignedArtifactURL(ctx, inputReq);
408
+ });
409
+ }
410
+ else {
411
+ response = yield service.GetSignedArtifactURL(ctx, request);
412
+ }
413
+ return Buffer.from(artifact_1.GetSignedArtifactURLResponse.toBinary(response));
414
+ });
415
+ }
416
+ //# sourceMappingURL=artifact.twirp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.twirp.js","sourceRoot":"","sources":["../../../../../src/generated/results/api/v1/artifact.twirp.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCASkB;AAClB,yCASoB;AA4BpB,MAAa,yBAAyB;IAEpC,YAAY,GAAQ;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CA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61 @@
1
+ import { UploadArtifactOptions, UploadArtifactResponse, DownloadArtifactOptions, GetArtifactResponse, ListArtifactsOptions, ListArtifactsResponse, DownloadArtifactResponse, FindOptions } from './shared/interfaces';
2
+ /**
3
+ * Generic interface for the artifact client.
4
+ */
5
+ export interface ArtifactClient {
6
+ /**
7
+ * Uploads an artifact.
8
+ *
9
+ * @param name The name of the artifact, required
10
+ * @param files A list of absolute or relative paths that denote what files should be uploaded
11
+ * @param rootDirectory An absolute or relative file path that denotes the root parent directory of the files being uploaded
12
+ * @param options Extra options for customizing the upload behavior
13
+ * @returns single UploadArtifactResponse object
14
+ */
15
+ uploadArtifact(name: string, files: string[], rootDirectory: string, options?: UploadArtifactOptions): Promise<UploadArtifactResponse>;
16
+ /**
17
+ * Lists all artifacts that are part of the current workflow run.
18
+ * This function will return at most 1000 artifacts per workflow run.
19
+ *
20
+ * If `options.findBy` is specified, this will call the public List-Artifacts API which can list from other runs.
21
+ * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts
22
+ *
23
+ * @param options Extra options that allow for the customization of the list behavior
24
+ * @returns ListArtifactResponse object
25
+ */
26
+ listArtifacts(options?: ListArtifactsOptions & FindOptions): Promise<ListArtifactsResponse>;
27
+ /**
28
+ * Finds an artifact by name.
29
+ * If there are multiple artifacts with the same name in the same workflow run, this will return the latest.
30
+ * If the artifact is not found, it will throw.
31
+ *
32
+ * If `options.findBy` is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs.
33
+ * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts
34
+ * `@actions/artifact` v2+ does not allow for creating multiple artifacts with the same name in the same workflow run.
35
+ * It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2 or it is a rerun.
36
+ * If there are multiple artifacts with the same name in the same workflow run this function will return the first artifact that matches the name.
37
+ *
38
+ * @param artifactName The name of the artifact to find
39
+ * @param options Extra options that allow for the customization of the get behavior
40
+ */
41
+ getArtifact(artifactName: string, options?: FindOptions): Promise<GetArtifactResponse>;
42
+ /**
43
+ * Downloads an artifact and unzips the content.
44
+ *
45
+ * If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact
46
+ *
47
+ * @param artifactId The name of the artifact to download
48
+ * @param options Extra options that allow for the customization of the download behavior
49
+ * @returns single DownloadArtifactResponse object
50
+ */
51
+ downloadArtifact(artifactId: number, options?: DownloadArtifactOptions & FindOptions): Promise<DownloadArtifactResponse>;
52
+ }
53
+ /**
54
+ * The default artifact client that is used by the artifact action(s).
55
+ */
56
+ export declare class DefaultArtifactClient implements ArtifactClient {
57
+ uploadArtifact(name: string, files: string[], rootDirectory: string, options?: UploadArtifactOptions): Promise<UploadArtifactResponse>;
58
+ downloadArtifact(artifactId: number, options?: DownloadArtifactOptions & FindOptions): Promise<DownloadArtifactResponse>;
59
+ listArtifacts(options?: ListArtifactsOptions & FindOptions): Promise<ListArtifactsResponse>;
60
+ getArtifact(artifactName: string, options?: FindOptions): Promise<GetArtifactResponse>;
61
+ }