@scarn/sdk 0.0.0 → 0.8.1
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/{chunk-4361gxk0.js → chunk-0y2fy5en.js} +7 -7
- package/dist/{chunk-rq3q8vg7.js → chunk-102vfpw4.js} +74 -69
- package/dist/{chunk-91p9vzcs.js → chunk-3ctaaseb.js} +405 -402
- package/dist/{chunk-9s07v9r1.js → chunk-4ggr8af6.js} +8 -8
- package/dist/chunk-5zsavw98.js +91 -0
- package/dist/chunk-63f90zky.js +39 -0
- package/dist/{chunk-tfm5hjzm.js → chunk-700xe701.js} +9 -9
- package/dist/{chunk-njd6npf0.js → chunk-ar6hcj1r.js} +6 -6
- package/dist/chunk-cdanncng.js +74 -0
- package/dist/chunk-dp86pa6m.js +68 -0
- package/dist/chunk-e1h021kq.js +86 -0
- package/dist/{chunk-ny07ncb9.js → chunk-gds7w7zh.js} +35 -35
- package/dist/chunk-k4y5qt4y.js +14 -0
- package/dist/{chunk-eg1hcvhb.js → chunk-mz53r914.js} +16 -16
- package/dist/{chunk-631ffb6r.js → chunk-ngy1fdcx.js} +10 -10
- package/dist/chunk-p7yrcmqm.js +322 -0
- package/dist/{chunk-h9yxx0hd.js → chunk-rt9tq4j6.js} +7 -7
- package/dist/{chunk-dnn39qt4.js → chunk-skzxcba3.js} +2960 -2217
- package/dist/{chunk-ynk2bjae.js → chunk-vfeytkqx.js} +89 -88
- package/dist/{chunk-56e4kp0a.js → chunk-y2pv8d6a.js} +19 -19
- package/dist/chunk-y64skrwp.js +17 -0
- package/dist/{chunk-qpw5wt1p.js → chunk-zm72ksz0.js} +26 -27
- package/dist/client.js +53 -52
- package/dist/contracts/artifact-markers.js +12 -11
- package/dist/contracts/artifacts.js +23 -21
- package/dist/contracts/pipeline-document/index.js +94 -92
- package/dist/contracts/step-artifact-submissions.js +17 -20
- package/dist/defaults/index.js +140 -139
- package/dist/definitions/pipelines/index.js +22 -20
- package/dist/definitions/steps/index.js +70 -67
- package/dist/definitions/validation/index.js +15 -13
- package/dist/devcontainer-config-path.js +11 -9
- package/dist/env-vars.js +33 -31
- package/dist/eslint.js +2 -0
- package/dist/generated/types.gen.d.ts +7 -0
- package/dist/git-url/git-repo-identity.js +2 -0
- package/dist/health-checks.js +17 -15
- package/dist/index.js +280 -277
- package/dist/jsonc.js +8 -7
- package/dist/managed-runtimes.js +11 -9
- package/dist/opencode-mcp.js +27 -25
- package/dist/pipelines/index.js +78 -75
- package/dist/pipelines/nodes.d.ts +1 -0
- package/dist/push/code-step-lookup.js +8 -7
- package/dist/push/index.js +51 -52
- package/dist/repo-config.js +21 -19
- package/dist/scarn-config-parser.js +6 -5
- package/package.json +1 -1
- package/dist/chunk-4vehh3dq.js +0 -333
- package/dist/chunk-5mmj03ah.js +0 -1074
- package/dist/chunk-b21233rt.js +0 -78
- package/dist/chunk-g0rdnn0r.js +0 -95
- package/dist/chunk-p6kc9wq8.js +0 -97
- package/dist/chunk-s0gap8r8.js +0 -14
- package/dist/chunk-zpqyjgb4.js +0 -49
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
3
|
+
PipelineDefinitions,
|
|
4
|
+
createClient
|
|
5
|
+
} from "./chunk-vfeytkqx.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "./chunk-dnn39qt4.js";
|
|
7
|
+
exports_external
|
|
8
|
+
} from "./chunk-skzxcba3.js";
|
|
10
9
|
|
|
11
10
|
// src/definitions/pipelines/pipeline-definitions-client.ts
|
|
12
|
-
var pipelineDocumentIssueSchema = object({
|
|
13
|
-
code: string(),
|
|
14
|
-
path: string(),
|
|
15
|
-
message: string(),
|
|
16
|
-
hint: string().optional()
|
|
11
|
+
var pipelineDocumentIssueSchema = exports_external.object({
|
|
12
|
+
code: exports_external.string(),
|
|
13
|
+
path: exports_external.string(),
|
|
14
|
+
message: exports_external.string(),
|
|
15
|
+
hint: exports_external.string().optional()
|
|
17
16
|
});
|
|
18
17
|
|
|
19
|
-
class
|
|
18
|
+
class PipelineDefinitionsApiError extends Error {
|
|
20
19
|
code;
|
|
21
20
|
issues;
|
|
22
21
|
constructor(error) {
|
|
@@ -37,13 +36,13 @@ function documentIssuesOf(meta) {
|
|
|
37
36
|
}
|
|
38
37
|
function unwrap(result) {
|
|
39
38
|
if (result.error !== undefined) {
|
|
40
|
-
throw new
|
|
39
|
+
throw new PipelineDefinitionsApiError(result.error);
|
|
41
40
|
}
|
|
42
41
|
return result.data;
|
|
43
42
|
}
|
|
44
|
-
function
|
|
43
|
+
function createPipelineDefinitionsClient(baseUrl) {
|
|
45
44
|
const client = createClient({ baseUrl });
|
|
46
|
-
return buildPipelineDefinitionsClient(new
|
|
45
|
+
return buildPipelineDefinitionsClient(new PipelineDefinitions({ client }));
|
|
47
46
|
}
|
|
48
47
|
var buildPipelineDefinitionsClient = (pipelineDefinitions) => ({
|
|
49
48
|
listByProjectId: async (projectId, options) => unwrap(await pipelineDefinitions.listPipelineDefinitions({
|
|
@@ -77,7 +76,7 @@ var buildPipelineDefinitionsClient = (pipelineDefinitions) => ({
|
|
|
77
76
|
}))
|
|
78
77
|
});
|
|
79
78
|
// src/definitions/pipelines/work-item-fields.ts
|
|
80
|
-
var
|
|
79
|
+
var WORK_ITEM_TOP_LEVEL_FIELDS = [
|
|
81
80
|
"id",
|
|
82
81
|
"projectId",
|
|
83
82
|
"platform",
|
|
@@ -93,13 +92,13 @@ var WORK_ITEM_TOP_LEVEL_FIELDS2 = [
|
|
|
93
92
|
"createdAt",
|
|
94
93
|
"updatedAt"
|
|
95
94
|
];
|
|
96
|
-
var
|
|
97
|
-
function
|
|
95
|
+
var WORK_ITEM_FIELDS_PATH_PREFIX = "fields.";
|
|
96
|
+
function resolveWorkItemFieldPath(record, path) {
|
|
98
97
|
if (typeof record !== "object" || record === null)
|
|
99
98
|
return;
|
|
100
99
|
const asRecord = record;
|
|
101
|
-
if (path.startsWith(
|
|
102
|
-
const fieldName = path.slice(
|
|
100
|
+
if (path.startsWith(WORK_ITEM_FIELDS_PATH_PREFIX)) {
|
|
101
|
+
const fieldName = path.slice(WORK_ITEM_FIELDS_PATH_PREFIX.length);
|
|
103
102
|
const fields = asRecord["fields"];
|
|
104
103
|
if (typeof fields !== "object" || fields === null)
|
|
105
104
|
return;
|
|
@@ -109,7 +108,7 @@ function resolveWorkItemFieldPath2(record, path) {
|
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
// src/definitions/pipelines/define-default-pipeline-assignment.ts
|
|
112
|
-
var
|
|
111
|
+
var DEFAULT_PIPELINE_ASSIGNMENT_FILENAME = "default-pipeline-assignment.ts";
|
|
113
112
|
function makeLeaf(fact, path, operator, value) {
|
|
114
113
|
const condition = {
|
|
115
114
|
_tag: "leaf",
|
|
@@ -147,9 +146,9 @@ function makeFieldRef(fact, path) {
|
|
|
147
146
|
}
|
|
148
147
|
function buildWorkItemAccessor() {
|
|
149
148
|
const accessor = {
|
|
150
|
-
field: (name) => makeFieldRef("workItem", `$.${
|
|
149
|
+
field: (name) => makeFieldRef("workItem", `$.${WORK_ITEM_FIELDS_PATH_PREFIX}${name}`)
|
|
151
150
|
};
|
|
152
|
-
for (const key of
|
|
151
|
+
for (const key of WORK_ITEM_TOP_LEVEL_FIELDS) {
|
|
153
152
|
accessor[key] = makeFieldRef("workItem", `$.${key}`);
|
|
154
153
|
}
|
|
155
154
|
return accessor;
|
|
@@ -186,7 +185,7 @@ function buildCtx() {
|
|
|
186
185
|
any: (...refs) => makeGroup("any", refs)
|
|
187
186
|
};
|
|
188
187
|
}
|
|
189
|
-
function
|
|
188
|
+
function defaultPipelineAssignment(callback) {
|
|
190
189
|
const input = callback(buildCtx());
|
|
191
190
|
return {
|
|
192
191
|
_tag: "default_pipeline_assignment",
|
|
@@ -220,7 +219,7 @@ function serializeAssignmentRule(rule) {
|
|
|
220
219
|
event: { type, ...params ? { params } : {} }
|
|
221
220
|
};
|
|
222
221
|
}
|
|
223
|
-
function
|
|
222
|
+
function serializeDefaultPipelineAssignment(spec) {
|
|
224
223
|
let primaryKey = null;
|
|
225
224
|
if (spec.default._tag === "assign") {
|
|
226
225
|
primaryKey = spec.default.pipelineKey;
|
|
@@ -249,9 +248,9 @@ function serializeDefaultPipelineAssignment2(spec) {
|
|
|
249
248
|
allowedEventTypes: [...outcomeSet]
|
|
250
249
|
};
|
|
251
250
|
}
|
|
252
|
-
function
|
|
251
|
+
function isDefaultPipelineAssignmentSpec(value) {
|
|
253
252
|
if (typeof value !== "object" || value === null)
|
|
254
253
|
return false;
|
|
255
254
|
return value["_tag"] === "default_pipeline_assignment";
|
|
256
255
|
}
|
|
257
|
-
export {
|
|
256
|
+
export { PipelineDefinitionsApiError, createPipelineDefinitionsClient, WORK_ITEM_TOP_LEVEL_FIELDS, WORK_ITEM_FIELDS_PATH_PREFIX, resolveWorkItemFieldPath, DEFAULT_PIPELINE_ASSIGNMENT_FILENAME, defaultPipelineAssignment, serializeDefaultPipelineAssignment, isDefaultPipelineAssignmentSpec };
|
package/dist/client.js
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
3
|
+
createScarnClient,
|
|
4
|
+
createTaskPlaneClient
|
|
5
|
+
} from "./chunk-700xe701.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
7
|
+
Api,
|
|
8
|
+
Billing,
|
|
9
|
+
Conversations,
|
|
10
|
+
GitHubIntegrations,
|
|
11
|
+
NotificationRules,
|
|
12
|
+
PipelineDefinitions,
|
|
13
|
+
PipelineExecutions,
|
|
14
|
+
ProjectArtifacts,
|
|
15
|
+
ProjectIntegrations,
|
|
16
|
+
ProjectInvites,
|
|
17
|
+
Projects,
|
|
18
|
+
ScarnClient,
|
|
19
|
+
Secrets,
|
|
20
|
+
StepDefinitionTemplates,
|
|
21
|
+
StepDefinitions,
|
|
22
|
+
TaskRuns,
|
|
23
|
+
Tasks,
|
|
24
|
+
UserNotifications,
|
|
25
|
+
Username,
|
|
26
|
+
WorkItemBlocks,
|
|
27
|
+
WorkItemCommentDrafts,
|
|
28
|
+
WorkItemComments,
|
|
29
|
+
WorkItems
|
|
30
|
+
} from "./chunk-vfeytkqx.js";
|
|
31
|
+
import"./chunk-y64skrwp.js";
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
33
|
+
Api,
|
|
34
|
+
Billing,
|
|
35
|
+
Conversations,
|
|
36
|
+
GitHubIntegrations,
|
|
37
|
+
NotificationRules,
|
|
38
|
+
PipelineDefinitions,
|
|
39
|
+
PipelineExecutions,
|
|
40
|
+
ProjectArtifacts,
|
|
41
|
+
ProjectIntegrations,
|
|
42
|
+
ProjectInvites,
|
|
43
|
+
Projects,
|
|
44
|
+
ScarnClient,
|
|
45
|
+
Secrets,
|
|
46
|
+
StepDefinitionTemplates,
|
|
47
|
+
StepDefinitions,
|
|
48
|
+
TaskRuns,
|
|
49
|
+
Tasks,
|
|
50
|
+
UserNotifications,
|
|
51
|
+
Username,
|
|
52
|
+
WorkItemBlocks,
|
|
53
|
+
WorkItemCommentDrafts,
|
|
54
|
+
WorkItemComments,
|
|
55
|
+
WorkItems,
|
|
56
|
+
createScarnClient,
|
|
57
|
+
createTaskPlaneClient
|
|
57
58
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "../chunk-
|
|
3
|
+
ARTIFACT_MARKER_SCHEME,
|
|
4
|
+
buildArtifactMarker,
|
|
5
|
+
findArtifactMarkers,
|
|
6
|
+
formatArtifactMarkerRef,
|
|
7
|
+
parseArtifactMarkerRef
|
|
8
|
+
} from "../chunk-ngy1fdcx.js";
|
|
9
|
+
import"../chunk-y64skrwp.js";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
ARTIFACT_MARKER_SCHEME,
|
|
12
|
+
buildArtifactMarker,
|
|
13
|
+
findArtifactMarkers,
|
|
14
|
+
formatArtifactMarkerRef,
|
|
15
|
+
parseArtifactMarkerRef
|
|
15
16
|
};
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "../chunk-
|
|
3
|
+
ARTIFACT_SCHEMA_KEYWORD,
|
|
4
|
+
EMBEDDABLE_ARTIFACT_EXTENSIONS,
|
|
5
|
+
artifactAcceptsFile,
|
|
6
|
+
artifactFileExtension,
|
|
7
|
+
artifactKindSchema,
|
|
8
|
+
artifactPlatforms,
|
|
9
|
+
findArtifactFields,
|
|
10
|
+
isEmbeddableArtifactExtension,
|
|
11
|
+
matchArtifactNode,
|
|
12
|
+
readArtifactKeyword
|
|
13
|
+
} from "../chunk-y2pv8d6a.js";
|
|
14
|
+
import"../chunk-skzxcba3.js";
|
|
15
|
+
import"../chunk-y64skrwp.js";
|
|
14
16
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
ARTIFACT_SCHEMA_KEYWORD,
|
|
18
|
+
EMBEDDABLE_ARTIFACT_EXTENSIONS,
|
|
19
|
+
artifactAcceptsFile,
|
|
20
|
+
artifactFileExtension,
|
|
21
|
+
artifactKindSchema,
|
|
22
|
+
artifactPlatforms,
|
|
23
|
+
findArtifactFields,
|
|
24
|
+
isEmbeddableArtifactExtension,
|
|
25
|
+
matchArtifactNode,
|
|
26
|
+
readArtifactKeyword
|
|
25
27
|
};
|
|
@@ -1,97 +1,99 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} from "../../chunk-
|
|
3
|
+
ALIAS_PATTERN,
|
|
4
|
+
COMPARISON_OPERATORS,
|
|
5
|
+
COMPUTED_FUNCTIONS,
|
|
6
|
+
CONDITION_OPERATORS,
|
|
7
|
+
DATE_OPERATORS,
|
|
8
|
+
DECISION_BODY_MODES,
|
|
9
|
+
DEFAULT_MAX_TURNS,
|
|
10
|
+
LIST_OPERATORS,
|
|
11
|
+
MATCH_MODES,
|
|
12
|
+
NODE_ID_PATTERN,
|
|
13
|
+
ORDERING_OPERATORS,
|
|
14
|
+
STRING_OPERATORS,
|
|
15
|
+
argValueSchema,
|
|
16
|
+
catchSchema,
|
|
17
|
+
computedSourceSchema,
|
|
18
|
+
conditionSchema,
|
|
19
|
+
decisionActionSchema,
|
|
20
|
+
deepEqual,
|
|
21
|
+
eachSchema,
|
|
22
|
+
failNodeSchema,
|
|
23
|
+
isJsonObject,
|
|
24
|
+
jsonPointer,
|
|
25
|
+
listSchema,
|
|
26
|
+
literalSchema,
|
|
27
|
+
nextSchema,
|
|
28
|
+
nodeSchema,
|
|
29
|
+
otherwiseSchema,
|
|
30
|
+
pipelineDocumentJsonSchema,
|
|
31
|
+
pipelineDocumentSchema,
|
|
32
|
+
retrySchema,
|
|
33
|
+
routeAt,
|
|
34
|
+
routeEntries,
|
|
35
|
+
routeSchema,
|
|
36
|
+
startSchema,
|
|
37
|
+
stepNodeSchema,
|
|
38
|
+
succeedNodeSchema,
|
|
39
|
+
toleratedFailuresSchema,
|
|
40
|
+
waitNodeSchema
|
|
41
|
+
} from "../../chunk-p7yrcmqm.js";
|
|
42
42
|
import {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} from "../../chunk-
|
|
43
|
+
BUILT_IN_ERRORS,
|
|
44
|
+
CONVERSATION_RESULT_SCHEMA,
|
|
45
|
+
ERROR_SCHEMA,
|
|
46
|
+
REPLY_INPUT_SCHEMA,
|
|
47
|
+
REPLY_RESULT_SCHEMA,
|
|
48
|
+
WAIT_ERRORS,
|
|
49
|
+
decisionResultSchema
|
|
50
|
+
} from "../../chunk-dp86pa6m.js";
|
|
51
|
+
import"../../chunk-skzxcba3.js";
|
|
52
|
+
import"../../chunk-y64skrwp.js";
|
|
51
53
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
54
|
+
ALIAS_PATTERN,
|
|
55
|
+
BUILT_IN_ERRORS,
|
|
56
|
+
COMPARISON_OPERATORS,
|
|
57
|
+
COMPUTED_FUNCTIONS,
|
|
58
|
+
CONDITION_OPERATORS,
|
|
59
|
+
CONVERSATION_RESULT_SCHEMA,
|
|
60
|
+
DATE_OPERATORS,
|
|
61
|
+
DECISION_BODY_MODES,
|
|
62
|
+
DEFAULT_MAX_TURNS,
|
|
63
|
+
ERROR_SCHEMA,
|
|
64
|
+
LIST_OPERATORS,
|
|
65
|
+
MATCH_MODES,
|
|
66
|
+
NODE_ID_PATTERN,
|
|
67
|
+
ORDERING_OPERATORS,
|
|
68
|
+
REPLY_INPUT_SCHEMA,
|
|
69
|
+
REPLY_RESULT_SCHEMA,
|
|
70
|
+
STRING_OPERATORS,
|
|
71
|
+
WAIT_ERRORS,
|
|
72
|
+
argValueSchema,
|
|
73
|
+
catchSchema,
|
|
74
|
+
computedSourceSchema,
|
|
75
|
+
conditionSchema,
|
|
76
|
+
decisionActionSchema,
|
|
77
|
+
decisionResultSchema,
|
|
78
|
+
deepEqual,
|
|
79
|
+
eachSchema,
|
|
80
|
+
failNodeSchema,
|
|
81
|
+
isJsonObject,
|
|
82
|
+
jsonPointer,
|
|
83
|
+
listSchema,
|
|
84
|
+
literalSchema,
|
|
85
|
+
nextSchema,
|
|
86
|
+
nodeSchema,
|
|
87
|
+
otherwiseSchema,
|
|
88
|
+
pipelineDocumentJsonSchema,
|
|
89
|
+
pipelineDocumentSchema,
|
|
90
|
+
retrySchema,
|
|
91
|
+
routeAt,
|
|
92
|
+
routeEntries,
|
|
93
|
+
routeSchema,
|
|
94
|
+
startSchema,
|
|
95
|
+
stepNodeSchema,
|
|
96
|
+
succeedNodeSchema,
|
|
97
|
+
toleratedFailuresSchema,
|
|
98
|
+
waitNodeSchema
|
|
97
99
|
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "../chunk-
|
|
3
|
+
artifactAcceptsFile,
|
|
4
|
+
artifactFileExtension,
|
|
5
|
+
findArtifactFields
|
|
6
|
+
} from "../chunk-y2pv8d6a.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
object,
|
|
12
|
-
record
|
|
13
|
-
} from "../chunk-dnn39qt4.js";
|
|
8
|
+
exports_external
|
|
9
|
+
} from "../chunk-skzxcba3.js";
|
|
10
|
+
import"../chunk-y64skrwp.js";
|
|
14
11
|
|
|
15
12
|
// src/contracts/step-artifact-submissions.ts
|
|
16
13
|
import { mkdir, readFile, stat, writeFile } from "fs/promises";
|
|
@@ -22,16 +19,16 @@ var EMPTY_STEP_ARTIFACT_SUBMISSIONS = {
|
|
|
22
19
|
extra: []
|
|
23
20
|
};
|
|
24
21
|
function findSubmittableArtifactFields(schema) {
|
|
25
|
-
return
|
|
22
|
+
return findArtifactFields(schema).filter((field) => !field.inArray);
|
|
26
23
|
}
|
|
27
|
-
var submittedArtifactSchema = object({
|
|
28
|
-
stored: string().min(1),
|
|
29
|
-
sourcePath: string(),
|
|
30
|
-
sizeBytes: number()
|
|
24
|
+
var submittedArtifactSchema = exports_external.object({
|
|
25
|
+
stored: exports_external.string().min(1),
|
|
26
|
+
sourcePath: exports_external.string(),
|
|
27
|
+
sizeBytes: exports_external.number()
|
|
31
28
|
});
|
|
32
|
-
var stepArtifactSubmissionsSchema = object({
|
|
33
|
-
fields: record(string(), submittedArtifactSchema),
|
|
34
|
-
extra: array(submittedArtifactSchema)
|
|
29
|
+
var stepArtifactSubmissionsSchema = exports_external.object({
|
|
30
|
+
fields: exports_external.record(exports_external.string(), submittedArtifactSchema),
|
|
31
|
+
extra: exports_external.array(submittedArtifactSchema)
|
|
35
32
|
});
|
|
36
33
|
function buildStepArtifactsDir(workspacePath) {
|
|
37
34
|
return path.join(workspacePath, STEP_ARTIFACTS_RELATIVE_DIR);
|
|
@@ -153,8 +150,8 @@ async function checkReturnedArtifactPaths(input) {
|
|
|
153
150
|
problems.push(`\`${field.path}\` is ${value}, but ${path.posix.join(STEP_ARTIFACTS_RELATIVE_DIR, value)} is missing or empty.`);
|
|
154
151
|
continue;
|
|
155
152
|
}
|
|
156
|
-
if (!
|
|
157
|
-
problems.push(`\`${field.path}\` accepts ${field.accept.join(", ")}, but ${value} has ${
|
|
153
|
+
if (!artifactAcceptsFile(field.accept, value)) {
|
|
154
|
+
problems.push(`\`${field.path}\` accepts ${field.accept.join(", ")}, but ${value} has ${artifactFileExtension(value) || "no extension"}.`);
|
|
158
155
|
}
|
|
159
156
|
}
|
|
160
157
|
return problems;
|