reposets 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/500.js +193 -78
- package/index.d.ts +8 -8
- package/package.json +2 -2
package/500.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Context, Data, Effect, Layer, Option, Ref, Schema } from "effect";
|
|
2
2
|
import { blake2b } from "blakejs";
|
|
3
3
|
import tweetnacl from "tweetnacl";
|
|
4
|
+
import { AppDirsConfig, ConfigError, ConfigFile, FirstMatch, Jsonifiable, TomlCodec, UpwardWalk, XdgConfig, XdgConfigLive, XdgSavePath, taplo, tombi } from "xdg-effect";
|
|
4
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
5
6
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
6
|
-
import { AppDirsConfig, ConfigError, ConfigFile, FirstMatch, TomlCodec, UpwardWalk, XdgConfig, XdgConfigLive, XdgSavePath } from "xdg-effect";
|
|
7
7
|
import { Octokit } from "@octokit/rest";
|
|
8
8
|
class ResolveError extends Data.TaggedError("ResolveError") {
|
|
9
9
|
}
|
|
@@ -34,9 +34,9 @@ const ResourceFileKind = Schema.Struct({
|
|
|
34
34
|
}).annotations({
|
|
35
35
|
title: "File entries",
|
|
36
36
|
description: "Named entries with file path values, resolved relative to config directory",
|
|
37
|
-
jsonSchema: {
|
|
38
|
-
|
|
39
|
-
}
|
|
37
|
+
jsonSchema: tombi({
|
|
38
|
+
additionalKeyLabel: "name"
|
|
39
|
+
})
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
42
|
const ResourceValueKind = Schema.Struct({
|
|
@@ -44,14 +44,14 @@ const ResourceValueKind = Schema.Struct({
|
|
|
44
44
|
key: Schema.String,
|
|
45
45
|
value: Schema.Union(Schema.String, Schema.Record({
|
|
46
46
|
key: Schema.String,
|
|
47
|
-
value:
|
|
47
|
+
value: Jsonifiable
|
|
48
48
|
}))
|
|
49
49
|
}).annotations({
|
|
50
50
|
title: "Value entries",
|
|
51
51
|
description: "Named entries with inline values. Strings used as-is, objects JSON-stringified.",
|
|
52
|
-
jsonSchema: {
|
|
53
|
-
|
|
54
|
-
}
|
|
52
|
+
jsonSchema: tombi({
|
|
53
|
+
additionalKeyLabel: "name"
|
|
54
|
+
})
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
const ResourceResolvedKind = Schema.Struct({
|
|
@@ -61,20 +61,30 @@ const ResourceResolvedKind = Schema.Struct({
|
|
|
61
61
|
}).annotations({
|
|
62
62
|
title: "Resolved entries",
|
|
63
63
|
description: "Named entries mapped to credential labels. Values come from the active credential profile.",
|
|
64
|
-
jsonSchema: {
|
|
65
|
-
|
|
66
|
-
}
|
|
64
|
+
jsonSchema: tombi({
|
|
65
|
+
additionalKeyLabel: "name"
|
|
66
|
+
})
|
|
67
67
|
})
|
|
68
68
|
});
|
|
69
69
|
const SecretGroupSchema = Schema.Union(ResourceFileKind, ResourceValueKind, ResourceResolvedKind).annotations({
|
|
70
70
|
identifier: "SecretGroup",
|
|
71
71
|
title: "Secret group",
|
|
72
|
-
description: "A group of secrets. Must be exactly one kind: file, value, or resolved."
|
|
72
|
+
description: "A group of secrets. Must be exactly one kind: file, value, or resolved.",
|
|
73
|
+
jsonSchema: taplo({
|
|
74
|
+
links: {
|
|
75
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/secrets-and-variables.md"
|
|
76
|
+
}
|
|
77
|
+
})
|
|
73
78
|
});
|
|
74
79
|
const VariableGroupSchema = Schema.Union(ResourceFileKind, ResourceValueKind, ResourceResolvedKind).annotations({
|
|
75
80
|
identifier: "VariableGroup",
|
|
76
81
|
title: "Variable group",
|
|
77
|
-
description: "A group of variables. Must be exactly one kind: file, value, or resolved."
|
|
82
|
+
description: "A group of variables. Must be exactly one kind: file, value, or resolved.",
|
|
83
|
+
jsonSchema: taplo({
|
|
84
|
+
links: {
|
|
85
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/secrets-and-variables.md"
|
|
86
|
+
}
|
|
87
|
+
})
|
|
78
88
|
});
|
|
79
89
|
const CleanupScopeSchema = Schema.Union(Schema.Boolean, Schema.Struct({
|
|
80
90
|
preserve: Schema.Array(Schema.String).annotations({
|
|
@@ -184,7 +194,12 @@ const CleanupSchema = Schema.Struct({
|
|
|
184
194
|
}).annotations({
|
|
185
195
|
identifier: "Cleanup",
|
|
186
196
|
title: "Cleanup configuration",
|
|
187
|
-
description: "Controls deletion of resources not declared in config. All disabled by default."
|
|
197
|
+
description: "Controls deletion of resources not declared in config. All disabled by default.",
|
|
198
|
+
jsonSchema: taplo({
|
|
199
|
+
links: {
|
|
200
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/cleanup.md"
|
|
201
|
+
}
|
|
202
|
+
})
|
|
188
203
|
});
|
|
189
204
|
const ReviewerTypeSchema = Schema.Literal("User", "Team").annotations({
|
|
190
205
|
title: "Reviewer type",
|
|
@@ -194,7 +209,7 @@ const ReviewerSchema = Schema.Struct({
|
|
|
194
209
|
type: ReviewerTypeSchema,
|
|
195
210
|
id: Schema.Int.annotations({
|
|
196
211
|
title: "Reviewer ID",
|
|
197
|
-
description: "The ID of the user or team"
|
|
212
|
+
description: "The numeric GitHub ID of the user or team"
|
|
198
213
|
})
|
|
199
214
|
}).annotations({
|
|
200
215
|
identifier: "Reviewer",
|
|
@@ -247,7 +262,14 @@ const EnvironmentSchema = Schema.Struct({
|
|
|
247
262
|
title: "Deployment environment",
|
|
248
263
|
description: "Configuration for a GitHub deployment environment",
|
|
249
264
|
jsonSchema: {
|
|
250
|
-
|
|
265
|
+
...tombi({
|
|
266
|
+
tableKeysOrder: "schema"
|
|
267
|
+
}),
|
|
268
|
+
...taplo({
|
|
269
|
+
links: {
|
|
270
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/environments.md"
|
|
271
|
+
}
|
|
272
|
+
})
|
|
251
273
|
}
|
|
252
274
|
});
|
|
253
275
|
const ResolvedRefSchema = Schema.Struct({
|
|
@@ -314,37 +336,48 @@ const RulesetConditionsSchema = Schema.Struct({
|
|
|
314
336
|
});
|
|
315
337
|
const RequiredReviewerSchema = Schema.Struct({
|
|
316
338
|
file_patterns: Schema.Array(Schema.String).annotations({
|
|
339
|
+
title: "File patterns",
|
|
317
340
|
description: "File patterns this reviewer must approve (fnmatch syntax)"
|
|
318
341
|
}),
|
|
319
342
|
minimum_approvals: Schema.Int.annotations({
|
|
343
|
+
title: "Minimum approvals",
|
|
320
344
|
description: "Minimum approvals required from this team (0 = optional)"
|
|
321
345
|
}),
|
|
322
346
|
reviewer: Schema.Struct({
|
|
323
347
|
id: Schema.Int.annotations({
|
|
348
|
+
title: "Team ID",
|
|
324
349
|
description: "Team ID"
|
|
325
350
|
}),
|
|
326
351
|
type: Schema.Literal("Team")
|
|
352
|
+
}).annotations({
|
|
353
|
+
title: "Reviewer team"
|
|
327
354
|
})
|
|
328
355
|
});
|
|
329
356
|
const StatusCheckSchema = Schema.Struct({
|
|
330
357
|
context: Schema.String.annotations({
|
|
358
|
+
title: "Context",
|
|
331
359
|
description: "The status check context name that must be present on the commit"
|
|
332
360
|
}),
|
|
333
361
|
integration_id: Schema.optional(Schema.Union(Schema.Int, ResolvedRefSchema).annotations({
|
|
362
|
+
title: "Integration ID",
|
|
334
363
|
description: "The integration ID, or a { resolved } reference to a credential label"
|
|
335
364
|
}))
|
|
336
365
|
});
|
|
337
366
|
const WorkflowFileSchema = Schema.Struct({
|
|
338
367
|
path: Schema.String.annotations({
|
|
368
|
+
title: "Workflow path",
|
|
339
369
|
description: "Path to the workflow file"
|
|
340
370
|
}),
|
|
341
371
|
ref: Schema.optional(Schema.String.annotations({
|
|
372
|
+
title: "Ref",
|
|
342
373
|
description: "Branch or tag of the workflow file"
|
|
343
374
|
})),
|
|
344
375
|
repository_id: Schema.Union(Schema.Int, ResolvedRefSchema).annotations({
|
|
376
|
+
title: "Repository ID",
|
|
345
377
|
description: "Repository ID, or a { resolved } reference to a credential label"
|
|
346
378
|
}),
|
|
347
379
|
sha: Schema.optional(Schema.String.annotations({
|
|
380
|
+
title: "SHA",
|
|
348
381
|
description: "Commit SHA of the workflow file"
|
|
349
382
|
}))
|
|
350
383
|
});
|
|
@@ -555,31 +588,31 @@ const sharedRulesetFields = {
|
|
|
555
588
|
conditions: Schema.optional(RulesetConditionsSchema),
|
|
556
589
|
bypass_actors: Schema.optional(Schema.Array(BypassActorSchema)),
|
|
557
590
|
creation: Schema.optional(Schema.Boolean.annotations({
|
|
558
|
-
title: "
|
|
591
|
+
title: "Restrict creation",
|
|
559
592
|
description: "When true, adds a creation rule"
|
|
560
593
|
})),
|
|
561
594
|
update: Schema.optional(Schema.Boolean.annotations({
|
|
562
|
-
title: "
|
|
595
|
+
title: "Restrict updates",
|
|
563
596
|
description: "When true, adds an update rule with update_allows_fetch_and_merge: true"
|
|
564
597
|
})),
|
|
565
598
|
deletion: Schema.optional(Schema.Boolean.annotations({
|
|
566
|
-
title: "
|
|
599
|
+
title: "Restrict deletion",
|
|
567
600
|
description: "When true, adds a deletion rule"
|
|
568
601
|
})),
|
|
569
602
|
required_linear_history: Schema.optional(Schema.Boolean.annotations({
|
|
570
|
-
title: "
|
|
603
|
+
title: "Require linear history",
|
|
571
604
|
description: "When true, adds a required_linear_history rule"
|
|
572
605
|
})),
|
|
573
606
|
required_signatures: Schema.optional(Schema.Boolean.annotations({
|
|
574
|
-
title: "
|
|
607
|
+
title: "Require signatures",
|
|
575
608
|
description: "When true, adds a required_signatures rule"
|
|
576
609
|
})),
|
|
577
610
|
non_fast_forward: Schema.optional(Schema.Boolean.annotations({
|
|
578
|
-
title: "
|
|
611
|
+
title: "Prevent non-fast-forward",
|
|
579
612
|
description: "When true, adds a non_fast_forward rule"
|
|
580
613
|
})),
|
|
581
614
|
deployments: Schema.optional(Schema.Array(Schema.String).annotations({
|
|
582
|
-
title: "
|
|
615
|
+
title: "Required deployments",
|
|
583
616
|
description: "Deployment environments that must succeed; converts to required_deployments rule"
|
|
584
617
|
})),
|
|
585
618
|
targets: Schema.optional(TargetsSchema),
|
|
@@ -620,7 +653,20 @@ const BranchRulesetSchema = Schema.Struct({
|
|
|
620
653
|
title: "Branch ruleset",
|
|
621
654
|
description: "A ruleset that applies to branches",
|
|
622
655
|
jsonSchema: {
|
|
623
|
-
|
|
656
|
+
...tombi({
|
|
657
|
+
tableKeysOrder: "schema"
|
|
658
|
+
}),
|
|
659
|
+
...taplo({
|
|
660
|
+
initKeys: [
|
|
661
|
+
"name",
|
|
662
|
+
"type",
|
|
663
|
+
"enforcement",
|
|
664
|
+
"targets"
|
|
665
|
+
],
|
|
666
|
+
links: {
|
|
667
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/rulesets.md"
|
|
668
|
+
}
|
|
669
|
+
})
|
|
624
670
|
}
|
|
625
671
|
});
|
|
626
672
|
const TagRulesetSchema = Schema.Struct({
|
|
@@ -638,7 +684,20 @@ const TagRulesetSchema = Schema.Struct({
|
|
|
638
684
|
title: "Tag ruleset",
|
|
639
685
|
description: "A ruleset that applies to tags",
|
|
640
686
|
jsonSchema: {
|
|
641
|
-
|
|
687
|
+
...tombi({
|
|
688
|
+
tableKeysOrder: "schema"
|
|
689
|
+
}),
|
|
690
|
+
...taplo({
|
|
691
|
+
initKeys: [
|
|
692
|
+
"name",
|
|
693
|
+
"type",
|
|
694
|
+
"enforcement",
|
|
695
|
+
"targets"
|
|
696
|
+
],
|
|
697
|
+
links: {
|
|
698
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/rulesets.md"
|
|
699
|
+
}
|
|
700
|
+
})
|
|
642
701
|
}
|
|
643
702
|
});
|
|
644
703
|
const RulesetSchema = Schema.Union(BranchRulesetSchema, TagRulesetSchema).annotations({
|
|
@@ -646,7 +705,14 @@ const RulesetSchema = Schema.Union(BranchRulesetSchema, TagRulesetSchema).annota
|
|
|
646
705
|
title: "Repository ruleset",
|
|
647
706
|
description: "A set of rules to apply when specified conditions are met",
|
|
648
707
|
jsonSchema: {
|
|
649
|
-
|
|
708
|
+
...tombi({
|
|
709
|
+
tableKeysOrder: "schema"
|
|
710
|
+
}),
|
|
711
|
+
...taplo({
|
|
712
|
+
links: {
|
|
713
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/rulesets.md"
|
|
714
|
+
}
|
|
715
|
+
})
|
|
650
716
|
}
|
|
651
717
|
});
|
|
652
718
|
function buildRulesetPayload(ruleset) {
|
|
@@ -878,9 +944,9 @@ const SecretScopesSchema = Schema.Struct({
|
|
|
878
944
|
}).annotations({
|
|
879
945
|
title: "Environment secret scopes",
|
|
880
946
|
description: "Map of environment names to secret group references",
|
|
881
|
-
jsonSchema: {
|
|
882
|
-
|
|
883
|
-
}
|
|
947
|
+
jsonSchema: tombi({
|
|
948
|
+
additionalKeyLabel: "environment_name"
|
|
949
|
+
})
|
|
884
950
|
}))
|
|
885
951
|
}).annotations({
|
|
886
952
|
identifier: "SecretScopes",
|
|
@@ -906,9 +972,9 @@ const VariableScopesSchema = Schema.Struct({
|
|
|
906
972
|
}).annotations({
|
|
907
973
|
title: "Environment variable scopes",
|
|
908
974
|
description: "Map of environment names to variable group references",
|
|
909
|
-
jsonSchema: {
|
|
910
|
-
|
|
911
|
-
}
|
|
975
|
+
jsonSchema: tombi({
|
|
976
|
+
additionalKeyLabel: "environment_name"
|
|
977
|
+
})
|
|
912
978
|
}))
|
|
913
979
|
}).annotations({
|
|
914
980
|
identifier: "VariableScopes",
|
|
@@ -933,9 +999,9 @@ const GroupSchema = Schema.Struct({
|
|
|
933
999
|
"repo-three"
|
|
934
1000
|
]
|
|
935
1001
|
],
|
|
936
|
-
jsonSchema: {
|
|
937
|
-
|
|
938
|
-
}
|
|
1002
|
+
jsonSchema: tombi({
|
|
1003
|
+
arrayValuesOrder: "ascending"
|
|
1004
|
+
})
|
|
939
1005
|
}),
|
|
940
1006
|
credentials: Schema.optional(Schema.String.annotations({
|
|
941
1007
|
title: "Credential profile",
|
|
@@ -982,7 +1048,17 @@ const GroupSchema = Schema.Struct({
|
|
|
982
1048
|
title: "Repository group",
|
|
983
1049
|
description: "A named group of repositories with their resource assignments",
|
|
984
1050
|
jsonSchema: {
|
|
985
|
-
|
|
1051
|
+
...tombi({
|
|
1052
|
+
tableKeysOrder: "schema"
|
|
1053
|
+
}),
|
|
1054
|
+
...taplo({
|
|
1055
|
+
initKeys: [
|
|
1056
|
+
"repos"
|
|
1057
|
+
],
|
|
1058
|
+
links: {
|
|
1059
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/configuration.md"
|
|
1060
|
+
}
|
|
1061
|
+
})
|
|
986
1062
|
}
|
|
987
1063
|
});
|
|
988
1064
|
const SquashMergeCommitTitleSchema = Schema.Literal("PR_TITLE", "COMMIT_OR_PR_TITLE").annotations({
|
|
@@ -1068,13 +1144,20 @@ const SettingsGroupSchema = Schema.Struct({
|
|
|
1068
1144
|
}))
|
|
1069
1145
|
}, {
|
|
1070
1146
|
key: Schema.String,
|
|
1071
|
-
value:
|
|
1147
|
+
value: Jsonifiable
|
|
1072
1148
|
}).annotations({
|
|
1073
1149
|
identifier: "SettingsGroup",
|
|
1074
1150
|
title: "Settings group",
|
|
1075
1151
|
description: "GitHub repository settings to apply. Known fields are typed; additional fields are passed through to the API.",
|
|
1076
1152
|
jsonSchema: {
|
|
1077
|
-
|
|
1153
|
+
...tombi({
|
|
1154
|
+
tableKeysOrder: "schema"
|
|
1155
|
+
}),
|
|
1156
|
+
...taplo({
|
|
1157
|
+
links: {
|
|
1158
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/configuration.md"
|
|
1159
|
+
}
|
|
1160
|
+
})
|
|
1078
1161
|
}
|
|
1079
1162
|
});
|
|
1080
1163
|
const LogLevelSchema = Schema.Literal("silent", "info", "verbose", "debug").annotations({
|
|
@@ -1102,10 +1185,10 @@ const ConfigSchema = Schema.Struct({
|
|
|
1102
1185
|
value: SettingsGroupSchema
|
|
1103
1186
|
}).annotations({
|
|
1104
1187
|
title: "Settings groups",
|
|
1105
|
-
description: "Named groups of GitHub repository settings
|
|
1106
|
-
jsonSchema: {
|
|
1107
|
-
|
|
1108
|
-
}
|
|
1188
|
+
description: "Named groups of GitHub repository settings to apply",
|
|
1189
|
+
jsonSchema: tombi({
|
|
1190
|
+
additionalKeyLabel: "setting_group"
|
|
1191
|
+
})
|
|
1109
1192
|
}), {
|
|
1110
1193
|
default: ()=>({})
|
|
1111
1194
|
}),
|
|
@@ -1115,9 +1198,9 @@ const ConfigSchema = Schema.Struct({
|
|
|
1115
1198
|
}).annotations({
|
|
1116
1199
|
title: "Secret groups",
|
|
1117
1200
|
description: "Named groups of secrets. Each group is one kind: file, value, or resolved.",
|
|
1118
|
-
jsonSchema: {
|
|
1119
|
-
|
|
1120
|
-
}
|
|
1201
|
+
jsonSchema: tombi({
|
|
1202
|
+
additionalKeyLabel: "secret_group"
|
|
1203
|
+
})
|
|
1121
1204
|
}), {
|
|
1122
1205
|
default: ()=>({})
|
|
1123
1206
|
}),
|
|
@@ -1127,9 +1210,9 @@ const ConfigSchema = Schema.Struct({
|
|
|
1127
1210
|
}).annotations({
|
|
1128
1211
|
title: "Variable groups",
|
|
1129
1212
|
description: "Named groups of variables. Each group is one kind: file, value, or resolved.",
|
|
1130
|
-
jsonSchema: {
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1213
|
+
jsonSchema: tombi({
|
|
1214
|
+
additionalKeyLabel: "variable_group"
|
|
1215
|
+
})
|
|
1133
1216
|
}), {
|
|
1134
1217
|
default: ()=>({})
|
|
1135
1218
|
}),
|
|
@@ -1138,10 +1221,10 @@ const ConfigSchema = Schema.Struct({
|
|
|
1138
1221
|
value: RulesetSchema
|
|
1139
1222
|
}).annotations({
|
|
1140
1223
|
title: "Rulesets",
|
|
1141
|
-
description: "Named rulesets defining branch
|
|
1142
|
-
jsonSchema: {
|
|
1143
|
-
|
|
1144
|
-
}
|
|
1224
|
+
description: "Named rulesets defining branch and tag protection rules",
|
|
1225
|
+
jsonSchema: tombi({
|
|
1226
|
+
additionalKeyLabel: "ruleset_name"
|
|
1227
|
+
})
|
|
1145
1228
|
}), {
|
|
1146
1229
|
default: ()=>({})
|
|
1147
1230
|
}),
|
|
@@ -1151,9 +1234,9 @@ const ConfigSchema = Schema.Struct({
|
|
|
1151
1234
|
}).annotations({
|
|
1152
1235
|
title: "Environments",
|
|
1153
1236
|
description: "Named deployment environment configurations",
|
|
1154
|
-
jsonSchema: {
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1237
|
+
jsonSchema: tombi({
|
|
1238
|
+
additionalKeyLabel: "environment_name"
|
|
1239
|
+
})
|
|
1157
1240
|
}), {
|
|
1158
1241
|
default: ()=>({})
|
|
1159
1242
|
}),
|
|
@@ -1162,17 +1245,28 @@ const ConfigSchema = Schema.Struct({
|
|
|
1162
1245
|
value: GroupSchema
|
|
1163
1246
|
}).annotations({
|
|
1164
1247
|
title: "Groups",
|
|
1165
|
-
description: "Named groups of repositories with their settings, secrets, variables, and
|
|
1166
|
-
jsonSchema: {
|
|
1167
|
-
|
|
1168
|
-
}
|
|
1248
|
+
description: "Named groups of repositories with their settings, secrets, variables, rulesets, and environment assignments",
|
|
1249
|
+
jsonSchema: tombi({
|
|
1250
|
+
additionalKeyLabel: "group_name"
|
|
1251
|
+
})
|
|
1169
1252
|
})
|
|
1170
1253
|
}).annotations({
|
|
1171
1254
|
identifier: "Config",
|
|
1172
1255
|
title: "reposets Configuration",
|
|
1173
|
-
description: "Configuration for syncing GitHub repository settings, secrets, variables, and
|
|
1256
|
+
description: "Configuration for syncing GitHub repository settings, secrets, variables, rulesets, and deployment environments",
|
|
1174
1257
|
jsonSchema: {
|
|
1175
|
-
|
|
1258
|
+
...tombi({
|
|
1259
|
+
tableKeysOrder: "schema"
|
|
1260
|
+
}),
|
|
1261
|
+
...taplo({
|
|
1262
|
+
initKeys: [
|
|
1263
|
+
"owner",
|
|
1264
|
+
"groups"
|
|
1265
|
+
],
|
|
1266
|
+
links: {
|
|
1267
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/configuration.md"
|
|
1268
|
+
}
|
|
1269
|
+
})
|
|
1176
1270
|
}
|
|
1177
1271
|
});
|
|
1178
1272
|
const ResolveSectionSchema = Schema.Struct({
|
|
@@ -1182,9 +1276,9 @@ const ResolveSectionSchema = Schema.Struct({
|
|
|
1182
1276
|
}).annotations({
|
|
1183
1277
|
title: "1Password references",
|
|
1184
1278
|
description: "Named values resolved via 1Password SDK. Values are op:// reference strings.",
|
|
1185
|
-
jsonSchema: {
|
|
1186
|
-
|
|
1187
|
-
}
|
|
1279
|
+
jsonSchema: tombi({
|
|
1280
|
+
additionalKeyLabel: "label"
|
|
1281
|
+
})
|
|
1188
1282
|
})),
|
|
1189
1283
|
file: Schema.optional(Schema.Record({
|
|
1190
1284
|
key: Schema.String,
|
|
@@ -1192,32 +1286,37 @@ const ResolveSectionSchema = Schema.Struct({
|
|
|
1192
1286
|
}).annotations({
|
|
1193
1287
|
title: "File references",
|
|
1194
1288
|
description: "Named values read from files. Values are file paths relative to the credentials directory.",
|
|
1195
|
-
jsonSchema: {
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1289
|
+
jsonSchema: tombi({
|
|
1290
|
+
additionalKeyLabel: "label"
|
|
1291
|
+
})
|
|
1198
1292
|
})),
|
|
1199
1293
|
value: Schema.optional(Schema.Record({
|
|
1200
1294
|
key: Schema.String,
|
|
1201
1295
|
value: Schema.Union(Schema.String, Schema.Record({
|
|
1202
1296
|
key: Schema.String,
|
|
1203
|
-
value:
|
|
1297
|
+
value: Jsonifiable
|
|
1204
1298
|
}))
|
|
1205
1299
|
}).annotations({
|
|
1206
1300
|
title: "Inline values",
|
|
1207
1301
|
description: "Named inline values. Strings are used as-is, objects are JSON-stringified.",
|
|
1208
|
-
jsonSchema: {
|
|
1209
|
-
|
|
1210
|
-
}
|
|
1302
|
+
jsonSchema: tombi({
|
|
1303
|
+
additionalKeyLabel: "label"
|
|
1304
|
+
})
|
|
1211
1305
|
}))
|
|
1212
1306
|
}).annotations({
|
|
1213
1307
|
identifier: "ResolveSection",
|
|
1214
1308
|
title: "Resolve section",
|
|
1215
|
-
description: "Named values resolved from 1Password, files, or inline. Referenced by
|
|
1309
|
+
description: "Named values resolved from 1Password, files, or inline. Referenced by resolved entries in secret and variable groups.",
|
|
1310
|
+
jsonSchema: taplo({
|
|
1311
|
+
links: {
|
|
1312
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/credentials.md"
|
|
1313
|
+
}
|
|
1314
|
+
})
|
|
1216
1315
|
});
|
|
1217
1316
|
const CredentialProfileSchema = Schema.Struct({
|
|
1218
1317
|
github_token: Schema.String.annotations({
|
|
1219
1318
|
title: "GitHub token",
|
|
1220
|
-
description: "A GitHub personal access token (fine-grained) with
|
|
1319
|
+
description: "A GitHub personal access token (fine-grained) with administration, secrets, variables, environments, and GPG keys permissions",
|
|
1221
1320
|
examples: [
|
|
1222
1321
|
"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
1223
1322
|
]
|
|
@@ -1233,7 +1332,15 @@ const CredentialProfileSchema = Schema.Struct({
|
|
|
1233
1332
|
}).annotations({
|
|
1234
1333
|
identifier: "CredentialProfile",
|
|
1235
1334
|
title: "Credential profile",
|
|
1236
|
-
description: "Authentication credentials for a GitHub account with optional
|
|
1335
|
+
description: "Authentication credentials for a GitHub account with optional named values for secret and variable resolution",
|
|
1336
|
+
jsonSchema: taplo({
|
|
1337
|
+
initKeys: [
|
|
1338
|
+
"github_token"
|
|
1339
|
+
],
|
|
1340
|
+
links: {
|
|
1341
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/credentials.md"
|
|
1342
|
+
}
|
|
1343
|
+
})
|
|
1237
1344
|
});
|
|
1238
1345
|
const CredentialsSchema = Schema.Struct({
|
|
1239
1346
|
profiles: Schema.optionalWith(Schema.Record({
|
|
@@ -1242,16 +1349,24 @@ const CredentialsSchema = Schema.Struct({
|
|
|
1242
1349
|
}).annotations({
|
|
1243
1350
|
title: "Credential profiles",
|
|
1244
1351
|
description: "Named credential profiles. If only one profile is defined, it is used automatically for all repo groups.",
|
|
1245
|
-
jsonSchema: {
|
|
1246
|
-
|
|
1247
|
-
}
|
|
1352
|
+
jsonSchema: tombi({
|
|
1353
|
+
additionalKeyLabel: "profile_name"
|
|
1354
|
+
})
|
|
1248
1355
|
}), {
|
|
1249
1356
|
default: ()=>({})
|
|
1250
1357
|
})
|
|
1251
1358
|
}).annotations({
|
|
1252
1359
|
identifier: "Credentials",
|
|
1253
1360
|
title: "reposets Credentials",
|
|
1254
|
-
description: "Authentication profiles for reposets. This file should be gitignored."
|
|
1361
|
+
description: "Authentication profiles for reposets. This file should be gitignored.",
|
|
1362
|
+
jsonSchema: taplo({
|
|
1363
|
+
initKeys: [
|
|
1364
|
+
"profiles"
|
|
1365
|
+
],
|
|
1366
|
+
links: {
|
|
1367
|
+
key: "https://github.com/spencerbeggs/reposets/blob/main/docs/credentials.md"
|
|
1368
|
+
}
|
|
1369
|
+
})
|
|
1255
1370
|
});
|
|
1256
1371
|
const CONFIG_FILENAME = "reposets.config.toml";
|
|
1257
1372
|
const CREDENTIALS_FILENAME = "reposets.credentials.toml";
|
package/index.d.ts
CHANGED
|
@@ -143,14 +143,14 @@ export declare const ConfigSchema: Schema.Struct<{
|
|
|
143
143
|
web_commit_signoff_required: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
144
144
|
}, readonly [{
|
|
145
145
|
readonly key: typeof Schema.String;
|
|
146
|
-
readonly value:
|
|
146
|
+
readonly value: Schema.SchemaClass<unknown, unknown, never>;
|
|
147
147
|
}]>>, {
|
|
148
148
|
default: () => {};
|
|
149
149
|
}>;
|
|
150
150
|
secrets: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
|
|
151
151
|
file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
152
152
|
}>, Schema.Struct<{
|
|
153
|
-
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String,
|
|
153
|
+
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, Schema.SchemaClass<unknown, unknown, never>>]>>;
|
|
154
154
|
}>, Schema.Struct<{
|
|
155
155
|
resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
156
156
|
}>]>>, {
|
|
@@ -159,7 +159,7 @@ export declare const ConfigSchema: Schema.Struct<{
|
|
|
159
159
|
variables: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
|
|
160
160
|
file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
161
161
|
}>, Schema.Struct<{
|
|
162
|
-
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String,
|
|
162
|
+
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, Schema.SchemaClass<unknown, unknown, never>>]>>;
|
|
163
163
|
}>, Schema.Struct<{
|
|
164
164
|
resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
165
165
|
}>]>>, {
|
|
@@ -469,7 +469,7 @@ export declare const CredentialProfileSchema: Schema.Struct<{
|
|
|
469
469
|
resolve: Schema.optional<Schema.Struct<{
|
|
470
470
|
op: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
471
471
|
file: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
472
|
-
value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String,
|
|
472
|
+
value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, Schema.SchemaClass<unknown, unknown, never>>]>>>;
|
|
473
473
|
}>>;
|
|
474
474
|
}>;
|
|
475
475
|
|
|
@@ -493,7 +493,7 @@ export declare const CredentialsSchema: Schema.Struct<{
|
|
|
493
493
|
resolve: Schema.optional<Schema.Struct<{
|
|
494
494
|
op: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
495
495
|
file: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
496
|
-
value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String,
|
|
496
|
+
value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, Schema.SchemaClass<unknown, unknown, never>>]>>>;
|
|
497
497
|
}>>;
|
|
498
498
|
}>>, {
|
|
499
499
|
default: () => {};
|
|
@@ -1370,7 +1370,7 @@ export declare type ResolveSection = typeof ResolveSectionSchema.Type;
|
|
|
1370
1370
|
export declare const ResolveSectionSchema: Schema.Struct<{
|
|
1371
1371
|
op: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
1372
1372
|
file: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
1373
|
-
value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String,
|
|
1373
|
+
value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, Schema.SchemaClass<unknown, unknown, never>>]>>>;
|
|
1374
1374
|
}>;
|
|
1375
1375
|
|
|
1376
1376
|
export declare type Ruleset = typeof RulesetSchema.Type;
|
|
@@ -1597,7 +1597,7 @@ export declare type SecretGroup = typeof SecretGroupSchema.Type;
|
|
|
1597
1597
|
export declare const SecretGroupSchema: Schema.Union<[Schema.Struct<{
|
|
1598
1598
|
file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
1599
1599
|
}>, Schema.Struct<{
|
|
1600
|
-
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String,
|
|
1600
|
+
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, Schema.SchemaClass<unknown, unknown, never>>]>>;
|
|
1601
1601
|
}>, Schema.Struct<{
|
|
1602
1602
|
resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
1603
1603
|
}>]>;
|
|
@@ -1666,7 +1666,7 @@ export declare type VariableGroup = typeof VariableGroupSchema.Type;
|
|
|
1666
1666
|
export declare const VariableGroupSchema: Schema.Union<[Schema.Struct<{
|
|
1667
1667
|
file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
1668
1668
|
}>, Schema.Struct<{
|
|
1669
|
-
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String,
|
|
1669
|
+
value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, Schema.SchemaClass<unknown, unknown, never>>]>>;
|
|
1670
1670
|
}>, Schema.Struct<{
|
|
1671
1671
|
resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
1672
1672
|
}>]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reposets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI tool to sync GitHub repo settings, secrets and rulesets across personal repositories",
|
|
6
6
|
"keywords": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"effect": "^3.21.1",
|
|
55
55
|
"smol-toml": ">=1.6.1",
|
|
56
56
|
"tweetnacl": "^1.0.3",
|
|
57
|
-
"xdg-effect": "^0.
|
|
57
|
+
"xdg-effect": "^0.3.1"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=20.0.0"
|