@stacksjs/ts-cloud 0.9.3 → 0.9.4
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/aws/index.js +1 -269
- package/dist/bin/chunk-00kg80qg.js +1 -0
- package/dist/bin/{chunk-hzqw8xm5.js → chunk-1k5kszjp.js} +1 -1
- package/dist/bin/{chunk-9v39615t.js → chunk-21e0mavm.js} +1 -1
- package/dist/bin/{chunk-waayf9ay.js → chunk-2empps47.js} +1 -1
- package/dist/bin/{chunk-14cwr6eh.js → chunk-3vqfexc4.js} +1 -1
- package/dist/bin/chunk-5ectjq0b.js +1 -0
- package/dist/bin/{chunk-b5gd39s8.js → chunk-5erkxpt7.js} +4 -4
- package/dist/bin/{chunk-41x17hw1.js → chunk-5mrtzemj.js} +1 -1
- package/dist/bin/{chunk-p8q9bq9g.js → chunk-5n9fmabb.js} +1 -1
- package/dist/bin/{chunk-gqf6jsmy.js → chunk-9knpg30y.js} +1 -1
- package/dist/bin/{chunk-r3kv0vm9.js → chunk-ddk4rt4j.js} +1 -1
- package/dist/bin/{chunk-avm7tnwe.js → chunk-e0rkrq70.js} +1 -1
- package/dist/bin/{chunk-ry030a6b.js → chunk-etrb03mt.js} +1 -1
- package/dist/bin/{chunk-8v7ddyvf.js → chunk-k9t9wvms.js} +1 -1
- package/dist/bin/{chunk-92mea34a.js → chunk-m7dgskt1.js} +1 -1
- package/dist/bin/{chunk-3r4fb59r.js → chunk-mz0wbbsj.js} +1 -1
- package/dist/bin/{chunk-b9qbp8j1.js → chunk-qk9qgepa.js} +1 -1
- package/dist/bin/chunk-rxcvf10f.js +7364 -0
- package/dist/bin/{chunk-r9hjwcj9.js → chunk-tga3hhwk.js} +1 -1
- package/dist/bin/{chunk-ynjvbphf.js → chunk-tx0tqq2k.js} +1 -1
- package/dist/bin/{chunk-57y1zxbf.js → chunk-vm3q5gf2.js} +1 -1
- package/dist/bin/{chunk-bz828v8q.js → chunk-y7s5r8y6.js} +1 -1
- package/dist/bin/{chunk-sgyffpgm.js → chunk-zmegvjp8.js} +1 -1
- package/dist/bin/cli.js +14 -14
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/chunk-0ccta6z6.js +6 -0
- package/dist/chunk-0k1cs6pp.js +1 -0
- package/dist/chunk-1egjn203.js +704 -0
- package/dist/chunk-2wx29qga.js +5 -0
- package/dist/chunk-5m5rqmv7.js +1 -0
- package/dist/chunk-8ea5022g.js +114 -0
- package/dist/chunk-8xqn3c0w.js +2 -0
- package/dist/chunk-b4esxhmw.js +2 -0
- package/dist/chunk-b8e5wzwn.js +44 -0
- package/dist/chunk-bggt4n6e.js +2 -0
- package/dist/chunk-cwkg37rs.js +37 -0
- package/dist/chunk-dskvqt67.js +7355 -0
- package/dist/chunk-gahsdmxf.js +1617 -0
- package/dist/chunk-gnv3r2jg.js +1 -0
- package/dist/chunk-hg3c48cp.js +34 -0
- package/dist/chunk-m5azeva3.js +2 -0
- package/dist/chunk-r3qf56b3.js +92 -0
- package/dist/chunk-sdqa9ghv.js +141 -0
- package/dist/chunk-svrvvcm7.js +1 -0
- package/dist/chunk-v0p3hpc3.js +60 -0
- package/dist/chunk-wdzjbecg.js +50 -0
- package/dist/chunk-ww8k3g7j.js +1 -0
- package/dist/chunk-xmqfc62w.js +1 -0
- package/dist/chunk-xrebj679.js +435 -0
- package/dist/chunk-xt3s24vr.js +2 -0
- package/dist/chunk-y21zk0pn.js +4 -0
- package/dist/deploy/index.js +1 -168
- package/dist/dns/index.js +1 -41
- package/dist/drivers/index.js +1 -154
- package/dist/index.js +100 -6129
- package/dist/protection/index.js +1 -89
- package/dist/push/index.js +1 -509
- package/dist/spend/index.js +1 -173
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +6 -6
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +5 -5
- package/dist/ui/data/services.html +5 -5
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +5 -5
- package/dist/ui/integrations.html +1 -1
- package/dist/ui/operations/alerts.html +5 -5
- package/dist/ui/operations/configuration.html +5 -5
- package/dist/ui/operations/jobs.html +5 -5
- package/dist/ui/operations/maintenance.html +5 -5
- package/dist/ui/operations/observability.html +6 -6
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +6 -6
- package/dist/ui/operations/regions.html +6 -6
- package/dist/ui/operations/releases.html +6 -6
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +1 -1
- package/dist/ui/server/actions.html +5 -5
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +6 -6
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +6 -6
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +6 -6
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +1 -1
- package/dist/ui/server/sites.html +6 -6
- package/dist/ui/server/ssh-keys.html +6 -6
- package/dist/ui/server/team.html +6 -6
- package/dist/ui/server/terminal.html +1 -1
- package/dist/ui/serverless/alarms.html +5 -5
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +1 -1
- package/dist/ui/serverless/data.html +6 -6
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +6 -6
- package/dist/ui/serverless/logs.html +6 -6
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +6 -6
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +5 -5
- package/package.json +3 -3
- package/dist/bin/chunk-jpjamjey.js +0 -6935
- package/dist/bin/chunk-m2zwtapr.js +0 -1
- package/dist/bin/chunk-rtczra13.js +0 -1
- package/dist/chunk-01d86gt1.js +0 -1324
- package/dist/chunk-050r7ycy.js +0 -46516
- package/dist/chunk-1c8dbv57.js +0 -7278
- package/dist/chunk-29rse4p1.js +0 -12203
- package/dist/chunk-32e7ya18.js +0 -642
- package/dist/chunk-4cjrg98a.js +0 -597
- package/dist/chunk-50jpda9q.js +0 -371
- package/dist/chunk-6a1t7fnq.js +0 -12121
- package/dist/chunk-728jvrr0.js +0 -1701
- package/dist/chunk-7m60qnc8.js +0 -1762
- package/dist/chunk-aa2dkn7b.js +0 -205
- package/dist/chunk-d48vtdj4.js +0 -433
- package/dist/chunk-f55nkpvb.js +0 -8
- package/dist/chunk-fgk8cqew.js +0 -152
- package/dist/chunk-he9a874b.js +0 -769
- package/dist/chunk-k2yyatfw.js +0 -10
- package/dist/chunk-k4px0bnv.js +0 -23
- package/dist/chunk-nsgqsmrh.js +0 -1779
- package/dist/chunk-q0st3se8.js +0 -42033
- package/dist/chunk-qr803fye.js +0 -2122
- package/dist/chunk-rds0sy87.js +0 -1771
- package/dist/chunk-ttz2ra5j.js +0 -12
- package/dist/chunk-v0bahtg2.js +0 -4
- package/dist/chunk-va2yd85b.js +0 -200
- package/dist/chunk-x9s0cqfx.js +0 -13
- package/dist/chunk-zqtpg06c.js +0 -1752
package/dist/chunk-50jpda9q.js
DELETED
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AWSClient
|
|
3
|
-
} from "./chunk-zqtpg06c.js";
|
|
4
|
-
|
|
5
|
-
// src/aws/ecr.ts
|
|
6
|
-
class ECRClient {
|
|
7
|
-
client;
|
|
8
|
-
region;
|
|
9
|
-
constructor(region = "us-east-1", profile) {
|
|
10
|
-
this.region = region;
|
|
11
|
-
this.client = new AWSClient(undefined, { profile });
|
|
12
|
-
}
|
|
13
|
-
async createRepository(options) {
|
|
14
|
-
const params = {
|
|
15
|
-
repositoryName: options.repositoryName
|
|
16
|
-
};
|
|
17
|
-
if (options.imageTagMutability) {
|
|
18
|
-
params.imageTagMutability = options.imageTagMutability;
|
|
19
|
-
}
|
|
20
|
-
if (options.imageScanningConfiguration) {
|
|
21
|
-
params.imageScanningConfiguration = options.imageScanningConfiguration;
|
|
22
|
-
}
|
|
23
|
-
if (options.encryptionConfiguration) {
|
|
24
|
-
params.encryptionConfiguration = options.encryptionConfiguration;
|
|
25
|
-
}
|
|
26
|
-
if (options.tags && options.tags.length > 0) {
|
|
27
|
-
params.tags = options.tags;
|
|
28
|
-
}
|
|
29
|
-
const result = await this.client.request({
|
|
30
|
-
service: "ecr",
|
|
31
|
-
region: this.region,
|
|
32
|
-
method: "POST",
|
|
33
|
-
path: "/",
|
|
34
|
-
headers: {
|
|
35
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.CreateRepository",
|
|
36
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
37
|
-
},
|
|
38
|
-
body: JSON.stringify(params)
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
repository: result.repository ? this.parseRepository(result.repository) : undefined
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
async describeRepositories(options) {
|
|
45
|
-
const params = {};
|
|
46
|
-
if (options?.repositoryNames && options.repositoryNames.length > 0) {
|
|
47
|
-
params.repositoryNames = options.repositoryNames;
|
|
48
|
-
}
|
|
49
|
-
if (options?.registryId) {
|
|
50
|
-
params.registryId = options.registryId;
|
|
51
|
-
}
|
|
52
|
-
if (options?.maxResults) {
|
|
53
|
-
params.maxResults = options.maxResults;
|
|
54
|
-
}
|
|
55
|
-
if (options?.nextToken) {
|
|
56
|
-
params.nextToken = options.nextToken;
|
|
57
|
-
}
|
|
58
|
-
const result = await this.client.request({
|
|
59
|
-
service: "ecr",
|
|
60
|
-
region: this.region,
|
|
61
|
-
method: "POST",
|
|
62
|
-
path: "/",
|
|
63
|
-
headers: {
|
|
64
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DescribeRepositories",
|
|
65
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
66
|
-
},
|
|
67
|
-
body: JSON.stringify(params)
|
|
68
|
-
});
|
|
69
|
-
return {
|
|
70
|
-
repositories: result.repositories?.map((repo) => this.parseRepository(repo)),
|
|
71
|
-
nextToken: result.nextToken
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
async getAuthorizationToken(registryIds) {
|
|
75
|
-
const params = {};
|
|
76
|
-
if (registryIds && registryIds.length > 0) {
|
|
77
|
-
params.registryIds = registryIds;
|
|
78
|
-
}
|
|
79
|
-
const result = await this.client.request({
|
|
80
|
-
service: "ecr",
|
|
81
|
-
region: this.region,
|
|
82
|
-
method: "POST",
|
|
83
|
-
path: "/",
|
|
84
|
-
headers: {
|
|
85
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken",
|
|
86
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
87
|
-
},
|
|
88
|
-
body: JSON.stringify(params)
|
|
89
|
-
});
|
|
90
|
-
return {
|
|
91
|
-
authorizationData: result.authorizationData?.map((auth) => ({
|
|
92
|
-
authorizationToken: auth.authorizationToken,
|
|
93
|
-
expiresAt: auth.expiresAt,
|
|
94
|
-
proxyEndpoint: auth.proxyEndpoint
|
|
95
|
-
}))
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
async deleteRepository(options) {
|
|
99
|
-
const params = {
|
|
100
|
-
repositoryName: options.repositoryName
|
|
101
|
-
};
|
|
102
|
-
if (options.registryId) {
|
|
103
|
-
params.registryId = options.registryId;
|
|
104
|
-
}
|
|
105
|
-
if (options.force !== undefined) {
|
|
106
|
-
params.force = options.force;
|
|
107
|
-
}
|
|
108
|
-
const result = await this.client.request({
|
|
109
|
-
service: "ecr",
|
|
110
|
-
region: this.region,
|
|
111
|
-
method: "POST",
|
|
112
|
-
path: "/",
|
|
113
|
-
headers: {
|
|
114
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DeleteRepository",
|
|
115
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
116
|
-
},
|
|
117
|
-
body: JSON.stringify(params)
|
|
118
|
-
});
|
|
119
|
-
return {
|
|
120
|
-
repository: result.repository ? this.parseRepository(result.repository) : undefined
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
async describeImages(options) {
|
|
124
|
-
const params = {
|
|
125
|
-
repositoryName: options.repositoryName
|
|
126
|
-
};
|
|
127
|
-
if (options.registryId) {
|
|
128
|
-
params.registryId = options.registryId;
|
|
129
|
-
}
|
|
130
|
-
if (options.imageIds && options.imageIds.length > 0) {
|
|
131
|
-
params.imageIds = options.imageIds;
|
|
132
|
-
}
|
|
133
|
-
if (options.filter) {
|
|
134
|
-
params.filter = options.filter;
|
|
135
|
-
}
|
|
136
|
-
if (options.maxResults) {
|
|
137
|
-
params.maxResults = options.maxResults;
|
|
138
|
-
}
|
|
139
|
-
if (options.nextToken) {
|
|
140
|
-
params.nextToken = options.nextToken;
|
|
141
|
-
}
|
|
142
|
-
const result = await this.client.request({
|
|
143
|
-
service: "ecr",
|
|
144
|
-
region: this.region,
|
|
145
|
-
method: "POST",
|
|
146
|
-
path: "/",
|
|
147
|
-
headers: {
|
|
148
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DescribeImages",
|
|
149
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
150
|
-
},
|
|
151
|
-
body: JSON.stringify(params)
|
|
152
|
-
});
|
|
153
|
-
return {
|
|
154
|
-
imageDetails: result.imageDetails?.map((img) => this.parseImageDetail(img)),
|
|
155
|
-
nextToken: result.nextToken
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
async batchDeleteImage(options) {
|
|
159
|
-
const params = {
|
|
160
|
-
repositoryName: options.repositoryName,
|
|
161
|
-
imageIds: options.imageIds
|
|
162
|
-
};
|
|
163
|
-
if (options.registryId) {
|
|
164
|
-
params.registryId = options.registryId;
|
|
165
|
-
}
|
|
166
|
-
const result = await this.client.request({
|
|
167
|
-
service: "ecr",
|
|
168
|
-
region: this.region,
|
|
169
|
-
method: "POST",
|
|
170
|
-
path: "/",
|
|
171
|
-
headers: {
|
|
172
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage",
|
|
173
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
174
|
-
},
|
|
175
|
-
body: JSON.stringify(params)
|
|
176
|
-
});
|
|
177
|
-
return {
|
|
178
|
-
imageIds: result.imageIds,
|
|
179
|
-
failures: result.failures
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
async putLifecyclePolicy(options) {
|
|
183
|
-
const params = {
|
|
184
|
-
repositoryName: options.repositoryName,
|
|
185
|
-
lifecyclePolicyText: options.lifecyclePolicyText
|
|
186
|
-
};
|
|
187
|
-
if (options.registryId) {
|
|
188
|
-
params.registryId = options.registryId;
|
|
189
|
-
}
|
|
190
|
-
const result = await this.client.request({
|
|
191
|
-
service: "ecr",
|
|
192
|
-
region: this.region,
|
|
193
|
-
method: "POST",
|
|
194
|
-
path: "/",
|
|
195
|
-
headers: {
|
|
196
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy",
|
|
197
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
198
|
-
},
|
|
199
|
-
body: JSON.stringify(params)
|
|
200
|
-
});
|
|
201
|
-
return {
|
|
202
|
-
registryId: result.registryId,
|
|
203
|
-
repositoryName: result.repositoryName,
|
|
204
|
-
lifecyclePolicyText: result.lifecyclePolicyText
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
async getLifecyclePolicy(options) {
|
|
208
|
-
const params = {
|
|
209
|
-
repositoryName: options.repositoryName
|
|
210
|
-
};
|
|
211
|
-
if (options.registryId) {
|
|
212
|
-
params.registryId = options.registryId;
|
|
213
|
-
}
|
|
214
|
-
const result = await this.client.request({
|
|
215
|
-
service: "ecr",
|
|
216
|
-
region: this.region,
|
|
217
|
-
method: "POST",
|
|
218
|
-
path: "/",
|
|
219
|
-
headers: {
|
|
220
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy",
|
|
221
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
222
|
-
},
|
|
223
|
-
body: JSON.stringify(params)
|
|
224
|
-
});
|
|
225
|
-
return {
|
|
226
|
-
registryId: result.registryId,
|
|
227
|
-
repositoryName: result.repositoryName,
|
|
228
|
-
lifecyclePolicyText: result.lifecyclePolicyText,
|
|
229
|
-
lastEvaluatedAt: result.lastEvaluatedAt
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
async setRepositoryPolicy(options) {
|
|
233
|
-
const params = {
|
|
234
|
-
repositoryName: options.repositoryName,
|
|
235
|
-
policyText: options.policyText
|
|
236
|
-
};
|
|
237
|
-
if (options.registryId) {
|
|
238
|
-
params.registryId = options.registryId;
|
|
239
|
-
}
|
|
240
|
-
if (options.force !== undefined) {
|
|
241
|
-
params.force = options.force;
|
|
242
|
-
}
|
|
243
|
-
const result = await this.client.request({
|
|
244
|
-
service: "ecr",
|
|
245
|
-
region: this.region,
|
|
246
|
-
method: "POST",
|
|
247
|
-
path: "/",
|
|
248
|
-
headers: {
|
|
249
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy",
|
|
250
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
251
|
-
},
|
|
252
|
-
body: JSON.stringify(params)
|
|
253
|
-
});
|
|
254
|
-
return {
|
|
255
|
-
registryId: result.registryId,
|
|
256
|
-
repositoryName: result.repositoryName,
|
|
257
|
-
policyText: result.policyText
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
async getRepositoryPolicy(options) {
|
|
261
|
-
const params = {
|
|
262
|
-
repositoryName: options.repositoryName
|
|
263
|
-
};
|
|
264
|
-
if (options.registryId) {
|
|
265
|
-
params.registryId = options.registryId;
|
|
266
|
-
}
|
|
267
|
-
const result = await this.client.request({
|
|
268
|
-
service: "ecr",
|
|
269
|
-
region: this.region,
|
|
270
|
-
method: "POST",
|
|
271
|
-
path: "/",
|
|
272
|
-
headers: {
|
|
273
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy",
|
|
274
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
275
|
-
},
|
|
276
|
-
body: JSON.stringify(params)
|
|
277
|
-
});
|
|
278
|
-
return {
|
|
279
|
-
registryId: result.registryId,
|
|
280
|
-
repositoryName: result.repositoryName,
|
|
281
|
-
policyText: result.policyText
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
async tagResource(options) {
|
|
285
|
-
const params = {
|
|
286
|
-
resourceArn: options.resourceArn,
|
|
287
|
-
tags: options.tags
|
|
288
|
-
};
|
|
289
|
-
await this.client.request({
|
|
290
|
-
service: "ecr",
|
|
291
|
-
region: this.region,
|
|
292
|
-
method: "POST",
|
|
293
|
-
path: "/",
|
|
294
|
-
headers: {
|
|
295
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.TagResource",
|
|
296
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
297
|
-
},
|
|
298
|
-
body: JSON.stringify(params)
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
async listTagsForResource(resourceArn) {
|
|
302
|
-
const params = {
|
|
303
|
-
resourceArn
|
|
304
|
-
};
|
|
305
|
-
const result = await this.client.request({
|
|
306
|
-
service: "ecr",
|
|
307
|
-
region: this.region,
|
|
308
|
-
method: "POST",
|
|
309
|
-
path: "/",
|
|
310
|
-
headers: {
|
|
311
|
-
"X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.ListTagsForResource",
|
|
312
|
-
"Content-Type": "application/x-amz-json-1.1"
|
|
313
|
-
},
|
|
314
|
-
body: JSON.stringify(params)
|
|
315
|
-
});
|
|
316
|
-
return {
|
|
317
|
-
tags: result.tags
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
createLifecyclePolicyText(rules) {
|
|
321
|
-
return JSON.stringify({
|
|
322
|
-
rules: rules.map((rule) => ({
|
|
323
|
-
rulePriority: rule.rulePriority,
|
|
324
|
-
description: rule.description,
|
|
325
|
-
selection: rule.selection,
|
|
326
|
-
action: rule.action
|
|
327
|
-
}))
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
async getDockerLoginCommand() {
|
|
331
|
-
const authResult = await this.getAuthorizationToken();
|
|
332
|
-
if (!authResult.authorizationData?.[0]) {
|
|
333
|
-
throw new Error("Failed to get authorization token");
|
|
334
|
-
}
|
|
335
|
-
const auth = authResult.authorizationData[0];
|
|
336
|
-
const token = auth.authorizationToken || "";
|
|
337
|
-
const endpoint = auth.proxyEndpoint || "";
|
|
338
|
-
const decoded = Buffer.from(token, "base64").toString("utf8");
|
|
339
|
-
const password = decoded.split(":")[1];
|
|
340
|
-
return `echo "${password}" | docker login --username AWS --password-stdin ${endpoint}`;
|
|
341
|
-
}
|
|
342
|
-
getRegistryUri(accountId) {
|
|
343
|
-
return `${accountId}.dkr.ecr.${this.region}.amazonaws.com`;
|
|
344
|
-
}
|
|
345
|
-
parseRepository(repo) {
|
|
346
|
-
return {
|
|
347
|
-
repositoryArn: repo.repositoryArn,
|
|
348
|
-
registryId: repo.registryId,
|
|
349
|
-
repositoryName: repo.repositoryName,
|
|
350
|
-
repositoryUri: repo.repositoryUri,
|
|
351
|
-
createdAt: repo.createdAt,
|
|
352
|
-
imageTagMutability: repo.imageTagMutability,
|
|
353
|
-
imageScanningConfiguration: repo.imageScanningConfiguration,
|
|
354
|
-
encryptionConfiguration: repo.encryptionConfiguration
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
parseImageDetail(img) {
|
|
358
|
-
return {
|
|
359
|
-
registryId: img.registryId,
|
|
360
|
-
repositoryName: img.repositoryName,
|
|
361
|
-
imageDigest: img.imageDigest,
|
|
362
|
-
imageTags: img.imageTags,
|
|
363
|
-
imageSizeInBytes: img.imageSizeInBytes,
|
|
364
|
-
imagePushedAt: img.imagePushedAt,
|
|
365
|
-
imageScanStatus: img.imageScanStatus,
|
|
366
|
-
imageScanFindingsSummary: img.imageScanFindingsSummary
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export { ECRClient };
|