@scarn/sdk 0.0.0 → 0.8.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/{chunk-4361gxk0.js → chunk-0y2fy5en.js} +7 -7
- 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-rq3q8vg7.js → chunk-yjtaq94c.js} +69 -69
- 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/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,33 +1,33 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
jsonPointer
|
|
4
|
+
} from "./chunk-p7yrcmqm.js";
|
|
5
|
+
import {
|
|
5
6
|
AuthoringError,
|
|
7
|
+
PipelineBuildError,
|
|
8
|
+
bareStepHandle,
|
|
9
|
+
captureSite,
|
|
10
|
+
chainOf,
|
|
11
|
+
eachOf,
|
|
12
|
+
nodeOf,
|
|
6
13
|
pendingChains,
|
|
14
|
+
registerEach,
|
|
7
15
|
registerNode,
|
|
8
16
|
registerTarget,
|
|
9
|
-
registerEach,
|
|
10
|
-
nodeOf,
|
|
11
|
-
targetOf,
|
|
12
|
-
eachOf,
|
|
13
|
-
chainOf,
|
|
14
17
|
requireNode,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
jsonPointer2
|
|
20
|
-
} from "./chunk-4vehh3dq.js";
|
|
18
|
+
targetOf,
|
|
19
|
+
waitHandle
|
|
20
|
+
} from "./chunk-mz53r914.js";
|
|
21
21
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from "./chunk-
|
|
22
|
+
CONVERSATION_RESULT_SCHEMA,
|
|
23
|
+
ERROR_SCHEMA,
|
|
24
|
+
REPLY_INPUT_SCHEMA,
|
|
25
|
+
REPLY_RESULT_SCHEMA,
|
|
26
|
+
decisionResultSchema
|
|
27
|
+
} from "./chunk-dp86pa6m.js";
|
|
28
28
|
import {
|
|
29
29
|
toJSONSchema
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-skzxcba3.js";
|
|
31
31
|
|
|
32
32
|
// src/pipelines/refs.ts
|
|
33
33
|
var REF = Symbol("scarn.ref");
|
|
@@ -392,17 +392,17 @@ function newState() {
|
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
394
|
function issue(state, site, pointer, message) {
|
|
395
|
-
state.issues.push({ site, pointer:
|
|
395
|
+
state.issues.push({ site, pointer: jsonPointer(pointer), message });
|
|
396
396
|
}
|
|
397
397
|
function mapSource(state, pointer, site) {
|
|
398
|
-
const key =
|
|
398
|
+
const key = jsonPointer(pointer);
|
|
399
399
|
if (site !== null && state.sourceMap[key] === undefined) {
|
|
400
400
|
state.sourceMap[key] = site;
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
function attempt(state, pointer, site, run) {
|
|
404
404
|
const previous = state.tracker.pointer;
|
|
405
|
-
setTrackerPointer(
|
|
405
|
+
setTrackerPointer(jsonPointer(pointer));
|
|
406
406
|
try {
|
|
407
407
|
return run();
|
|
408
408
|
} catch (error) {
|
|
@@ -439,7 +439,7 @@ function place(state, def, site, pointer) {
|
|
|
439
439
|
function schemaOf(node, source) {
|
|
440
440
|
if (node.kind === "step") {
|
|
441
441
|
if (source === "result" && node.conversation) {
|
|
442
|
-
return
|
|
442
|
+
return CONVERSATION_RESULT_SCHEMA;
|
|
443
443
|
}
|
|
444
444
|
return (source === "result" ? node.resultSchema : node.inputSchema) ?? undefined;
|
|
445
445
|
}
|
|
@@ -475,7 +475,7 @@ function makeContext(node, kind) {
|
|
|
475
475
|
});
|
|
476
476
|
} else {
|
|
477
477
|
Object.defineProperties(context, {
|
|
478
|
-
error: owned("error",
|
|
478
|
+
error: owned("error", ERROR_SCHEMA),
|
|
479
479
|
input: owned("input", schemaOf(node, "input"))
|
|
480
480
|
});
|
|
481
481
|
}
|
|
@@ -611,8 +611,8 @@ function wireBody(state, chain, json) {
|
|
|
611
611
|
}
|
|
612
612
|
const catches = chain.catch.map((entry, index) => {
|
|
613
613
|
const pointer = ["nodes", id, "catch", index];
|
|
614
|
-
const
|
|
615
|
-
const target = compileTransition(state, entry.target,
|
|
614
|
+
const context2 = makeContext(chain.node, "catch");
|
|
615
|
+
const target = compileTransition(state, entry.target, context2, pointer, entry.site, "catch");
|
|
616
616
|
return { on: [...entry.on], ...target };
|
|
617
617
|
});
|
|
618
618
|
if (catches.length > 0) {
|
|
@@ -627,9 +627,9 @@ function wireBody(state, chain, json) {
|
|
|
627
627
|
mapSource(state, pointer, next.site);
|
|
628
628
|
const entry = {};
|
|
629
629
|
if (when !== undefined) {
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
entry["when"] =
|
|
630
|
+
const compiled2 = attempt(state, [...pointer, "when"], next.site, () => withOwners([context], () => compileCondition(conditionData(when(context)))));
|
|
631
|
+
if (compiled2 !== undefined) {
|
|
632
|
+
entry["when"] = compiled2;
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
const compiled = compileTransition(state, target, context, pointer, next.site, "next");
|
|
@@ -817,7 +817,7 @@ function compile(config, site) {
|
|
|
817
817
|
const fields = workItemFields(state);
|
|
818
818
|
const warnings = unusedChainWarnings(state);
|
|
819
819
|
if (state.issues.length > 0 || start === undefined) {
|
|
820
|
-
throw new
|
|
820
|
+
throw new PipelineBuildError(config.key, state.issues);
|
|
821
821
|
}
|
|
822
822
|
const nodes = {};
|
|
823
823
|
for (const [id, placed] of orderedNodes(state)) {
|
|
@@ -843,14 +843,14 @@ function compile(config, site) {
|
|
|
843
843
|
warnings
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function definePipeline(config) {
|
|
847
847
|
return compile(config, captureSite());
|
|
848
848
|
}
|
|
849
849
|
// src/pipelines/nodes.ts
|
|
850
850
|
function inputSchemaJson(input) {
|
|
851
851
|
return input === undefined ? null : toJSONSchema(input);
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function decision(id, options) {
|
|
854
854
|
const actions = Object.entries(options.actions).map(([key, action]) => ({
|
|
855
855
|
key,
|
|
856
856
|
label: action.label,
|
|
@@ -862,11 +862,11 @@ function decision2(id, options) {
|
|
|
862
862
|
for: "decision",
|
|
863
863
|
actions,
|
|
864
864
|
inputSchema: inputSchemaJson(options.input),
|
|
865
|
-
resultSchema:
|
|
865
|
+
resultSchema: decisionResultSchema(actions),
|
|
866
866
|
site: captureSite()
|
|
867
867
|
});
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function reply(id) {
|
|
870
870
|
return waitHandle({
|
|
871
871
|
kind: "wait",
|
|
872
872
|
id,
|
|
@@ -874,10 +874,10 @@ function reply2(id) {
|
|
|
874
874
|
actions: null,
|
|
875
875
|
inputSchema: {
|
|
876
876
|
type: "object",
|
|
877
|
-
properties: { questions:
|
|
877
|
+
properties: { questions: REPLY_INPUT_SCHEMA },
|
|
878
878
|
required: ["questions"]
|
|
879
879
|
},
|
|
880
|
-
resultSchema:
|
|
880
|
+
resultSchema: REPLY_RESULT_SCHEMA,
|
|
881
881
|
site: captureSite()
|
|
882
882
|
});
|
|
883
883
|
}
|
|
@@ -891,7 +891,7 @@ function terminal(node) {
|
|
|
891
891
|
site: node.site
|
|
892
892
|
});
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function succeed(id, options = {}) {
|
|
895
895
|
return terminal({
|
|
896
896
|
kind: "succeed",
|
|
897
897
|
id,
|
|
@@ -900,7 +900,7 @@ function succeed2(id, options = {}) {
|
|
|
900
900
|
site: captureSite()
|
|
901
901
|
});
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function fail(id, options = {}) {
|
|
904
904
|
return terminal({
|
|
905
905
|
kind: "fail",
|
|
906
906
|
id,
|
|
@@ -911,23 +911,23 @@ function fail2(id, options = {}) {
|
|
|
911
911
|
site: captureSite()
|
|
912
912
|
});
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function stepRef(key) {
|
|
915
915
|
return bareStepHandle({ key, inputSchemaJson: null, resultSchemaJson: null, errors: [] }, false);
|
|
916
916
|
}
|
|
917
|
-
var
|
|
917
|
+
var workItem = {
|
|
918
918
|
get title() {
|
|
919
919
|
return rootPlaceholder("workItem.title", {
|
|
920
920
|
type: "string"
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
923
|
};
|
|
924
|
-
function
|
|
924
|
+
function workItemField(alias, label) {
|
|
925
925
|
return rootPlaceholder(`workItem.fields.${alias}`, undefined, {
|
|
926
926
|
field: { alias, label }
|
|
927
927
|
});
|
|
928
928
|
}
|
|
929
929
|
// src/pipelines/each.ts
|
|
930
|
-
function
|
|
930
|
+
function each(over, second, third) {
|
|
931
931
|
const data = refData(over);
|
|
932
932
|
if (data === undefined) {
|
|
933
933
|
throw new AuthoringError("each needs an array reference to iterate over");
|
|
@@ -975,55 +975,55 @@ function compare(op, left, value) {
|
|
|
975
975
|
right: value === NO_RIGHT ? { kind: "none" } : right(value)
|
|
976
976
|
}));
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function equal(left, value) {
|
|
979
979
|
return compare("equal", left, value);
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function notEqual(left, value) {
|
|
982
982
|
return compare("notEqual", left, value);
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function lessThan(left, value) {
|
|
985
985
|
return compare("lessThan", left, value);
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function lessThanInclusive(left, value) {
|
|
988
988
|
return compare("lessThanInclusive", left, value);
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function greaterThan(left, value) {
|
|
991
991
|
return compare("greaterThan", left, value);
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function greaterThanInclusive(left, value) {
|
|
994
994
|
return compare("greaterThanInclusive", left, value);
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function exists(left) {
|
|
997
997
|
return compare("exists", left, NO_RIGHT);
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function isEmpty(left) {
|
|
1000
1000
|
return compare("isEmpty", left, NO_RIGHT);
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function contains(left, value) {
|
|
1003
1003
|
return compare("contains", left, value);
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function startsWith(left, value) {
|
|
1006
1006
|
return compare("startsWith", left, value);
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function endsWith(left, value) {
|
|
1009
1009
|
return compare("endsWith", left, value);
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function matches(left, pattern) {
|
|
1012
1012
|
return compare("matches", left, pattern);
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function before(left, date) {
|
|
1015
1015
|
return compare("before", left, date);
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function after(left, date) {
|
|
1018
1018
|
return compare("after", left, date);
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1020
|
+
function all(...conditions) {
|
|
1021
1021
|
return toCondition(new ConditionData({ kind: "all", items: conditions.map(conditionData) }));
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function any(...conditions) {
|
|
1024
1024
|
return toCondition(new ConditionData({ kind: "any", items: conditions.map(conditionData) }));
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function not(condition) {
|
|
1027
1027
|
return toCondition(new ConditionData({ kind: "not", item: conditionData(condition) }));
|
|
1028
1028
|
}
|
|
1029
1029
|
function element(list) {
|
|
@@ -1043,13 +1043,13 @@ function list(op, over, where) {
|
|
|
1043
1043
|
where: conditionData(where(item))
|
|
1044
1044
|
}));
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function some(over, where) {
|
|
1047
1047
|
return list("some", over, where);
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function every(over, where) {
|
|
1050
1050
|
return list("every", over, where);
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function none(over, where) {
|
|
1053
1053
|
return list("none", over, where);
|
|
1054
1054
|
}
|
|
1055
1055
|
function reduce(fn, source, field, weights) {
|
|
@@ -1067,19 +1067,19 @@ function reduce(fn, source, field, weights) {
|
|
|
1067
1067
|
field: requireRef(select(field, element(data)), `the field of "${fn}"`)
|
|
1068
1068
|
}));
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function sum(source, field) {
|
|
1071
1071
|
return reduce("sum", source, field);
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function avg(source, second) {
|
|
1074
1074
|
return typeof second === "function" ? reduce("avg", source, second) : reduce("avg", source, undefined, second?.weights);
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function min(source, field) {
|
|
1077
1077
|
return reduce("min", source, field);
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function max(source, field) {
|
|
1080
1080
|
return reduce("max", source, field);
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function count(source, where) {
|
|
1083
1083
|
if (Array.isArray(source)) {
|
|
1084
1084
|
const refs = source.map((value) => requireRef(value, 'each value of "count"'));
|
|
1085
1085
|
return toComputed(new ComputedData({ fn: "count", refs }));
|
|
@@ -1091,4 +1091,4 @@ function count2(source, where) {
|
|
|
1091
1091
|
where: conditionData(select(where, element(data)))
|
|
1092
1092
|
}));
|
|
1093
1093
|
}
|
|
1094
|
-
export {
|
|
1094
|
+
export { definePipeline, decision, reply, succeed, fail, stepRef, workItem, workItemField, each, equal, notEqual, lessThan, lessThanInclusive, greaterThan, greaterThanInclusive, exists, isEmpty, contains, startsWith, endsWith, matches, before, after, all, any, not, some, every, none, sum, avg, min, max, count };
|
|
@@ -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
|
};
|