declastruct-github 1.0.5 → 1.0.7
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/access/daos/DeclaredGithubBranchDao.d.ts +1 -1
- package/dist/access/daos/DeclaredGithubBranchDao.js +15 -6
- package/dist/access/daos/DeclaredGithubBranchDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubBranchProtectionDao.d.ts +1 -1
- package/dist/access/daos/DeclaredGithubBranchProtectionDao.js +15 -6
- package/dist/access/daos/DeclaredGithubBranchProtectionDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubRepoConfigDao.d.ts +1 -1
- package/dist/access/daos/DeclaredGithubRepoConfigDao.js +15 -6
- package/dist/access/daos/DeclaredGithubRepoConfigDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubRepoDao.d.ts +1 -1
- package/dist/access/daos/DeclaredGithubRepoDao.js +15 -6
- package/dist/access/daos/DeclaredGithubRepoDao.js.map +1 -1
- package/dist/domain.objects/DeclastructGithubProvider.d.ts +4 -4
- package/dist/domain.operations/branch/setBranch.js +7 -12
- package/dist/domain.operations/branch/setBranch.js.map +1 -1
- package/package.json +8 -7
|
@@ -7,4 +7,4 @@ import { DeclaredGithubBranch } from '../../domain.objects/DeclaredGithubBranch'
|
|
|
7
7
|
* .why = wraps existing branch operations to conform to declastruct interface
|
|
8
8
|
* .note = upsert allows updating the branch's commit SHA
|
|
9
9
|
*/
|
|
10
|
-
export declare const DeclaredGithubBranchDao: DeclastructDao<
|
|
10
|
+
export declare const DeclaredGithubBranchDao: DeclastructDao<typeof DeclaredGithubBranch, ContextGithubApi & ContextLogTrail>;
|
|
@@ -13,14 +13,22 @@ const setBranch_1 = require("../../domain.operations/branch/setBranch");
|
|
|
13
13
|
* .note = upsert allows updating the branch's commit SHA
|
|
14
14
|
*/
|
|
15
15
|
exports.DeclaredGithubBranchDao = new declastruct_1.DeclastructDao({
|
|
16
|
+
dobj: DeclaredGithubBranch_1.DeclaredGithubBranch,
|
|
16
17
|
get: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
byRef: async (input, context) => {
|
|
21
|
-
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubBranch_1.DeclaredGithubBranch })(input))
|
|
18
|
+
one: {
|
|
19
|
+
byUnique: async (input, context) => {
|
|
22
20
|
return (0, getBranch_1.getBranch)({ by: { unique: input } }, context);
|
|
23
|
-
|
|
21
|
+
},
|
|
22
|
+
byPrimary: null,
|
|
23
|
+
byRef: async (input, context) => {
|
|
24
|
+
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubBranch_1.DeclaredGithubBranch })(input))
|
|
25
|
+
return (0, getBranch_1.getBranch)({ by: { unique: input } }, context);
|
|
26
|
+
helpful_errors_1.UnexpectedCodePathError.throw('unsupported ref type', { input });
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
ref: {
|
|
30
|
+
byPrimary: null,
|
|
31
|
+
byUnique: null,
|
|
24
32
|
},
|
|
25
33
|
},
|
|
26
34
|
set: {
|
|
@@ -30,6 +38,7 @@ exports.DeclaredGithubBranchDao = new declastruct_1.DeclastructDao({
|
|
|
30
38
|
upsert: async (input, context) => {
|
|
31
39
|
return (0, setBranch_1.setBranch)({ upsert: input }, context);
|
|
32
40
|
},
|
|
41
|
+
delete: null,
|
|
33
42
|
},
|
|
34
43
|
});
|
|
35
44
|
//# sourceMappingURL=DeclaredGithubBranchDao.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclaredGithubBranchDao.js","sourceRoot":"","sources":["../../../src/access/daos/DeclaredGithubBranchDao.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,mDAA+C;AAC/C,mDAAyD;AAIzD,oFAAiF;AACjF,wEAAqE;AACrE,wEAAqE;AAErE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,IAAI,4BAAc,
|
|
1
|
+
{"version":3,"file":"DeclaredGithubB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,CAAC;QAC/C,CAAC;QACD,MAAM,EAAE,IAAI;KACb;CACF,CAAC,CAAC"}
|
|
@@ -6,4 +6,4 @@ import { DeclaredGithubBranchProtection } from '../../domain.objects/DeclaredGit
|
|
|
6
6
|
* .what = declastruct DAO for github branch protection resources
|
|
7
7
|
* .why = wraps existing branch protection operations to conform to declastruct interface
|
|
8
8
|
*/
|
|
9
|
-
export declare const DeclaredGithubBranchProtectionDao: DeclastructDao<
|
|
9
|
+
export declare const DeclaredGithubBranchProtectionDao: DeclastructDao<typeof DeclaredGithubBranchProtection, ContextGithubApi & ContextLogTrail>;
|
|
@@ -12,14 +12,22 @@ const setBranchProtection_1 = require("../../domain.operations/branchProtection/
|
|
|
12
12
|
* .why = wraps existing branch protection operations to conform to declastruct interface
|
|
13
13
|
*/
|
|
14
14
|
exports.DeclaredGithubBranchProtectionDao = new declastruct_1.DeclastructDao({
|
|
15
|
+
dobj: DeclaredGithubBranchProtection_1.DeclaredGithubBranchProtection,
|
|
15
16
|
get: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
byRef: async (input, context) => {
|
|
20
|
-
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubBranchProtection_1.DeclaredGithubBranchProtection })(input))
|
|
17
|
+
one: {
|
|
18
|
+
byUnique: async (input, context) => {
|
|
21
19
|
return (0, getBranchProtection_1.getBranchProtection)({ by: { unique: input } }, context);
|
|
22
|
-
|
|
20
|
+
},
|
|
21
|
+
byPrimary: null,
|
|
22
|
+
byRef: async (input, context) => {
|
|
23
|
+
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubBranchProtection_1.DeclaredGithubBranchProtection })(input))
|
|
24
|
+
return (0, getBranchProtection_1.getBranchProtection)({ by: { unique: input } }, context);
|
|
25
|
+
helpful_errors_1.UnexpectedCodePathError.throw('unsupported ref type', { input });
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
ref: {
|
|
29
|
+
byPrimary: null,
|
|
30
|
+
byUnique: null,
|
|
23
31
|
},
|
|
24
32
|
},
|
|
25
33
|
set: {
|
|
@@ -29,6 +37,7 @@ exports.DeclaredGithubBranchProtectionDao = new declastruct_1.DeclastructDao({
|
|
|
29
37
|
upsert: async (input, context) => {
|
|
30
38
|
return (0, setBranchProtection_1.setBranchProtection)({ upsert: input }, context);
|
|
31
39
|
},
|
|
40
|
+
delete: null,
|
|
32
41
|
},
|
|
33
42
|
});
|
|
34
43
|
//# sourceMappingURL=DeclaredGithubBranchProtectionDao.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclaredGithubBranchProtectionDao.js","sourceRoot":"","sources":["../../../src/access/daos/DeclaredGithubBranchProtectionDao.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,mDAA+C;AAC/C,mDAAyD;AAIzD,wGAAqG;AACrG,sGAAmG;AACnG,sGAAmG;AAEnG;;;GAGG;AACU,QAAA,iCAAiC,GAAG,IAAI,4BAAc,
|
|
1
|
+
{"version":3,"file":"DeclaredGithubBranchProtectionDao.js","sourceRoot":"","sources":["../../../src/access/daos/DeclaredGithubBranchProtectionDao.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,mDAA+C;AAC/C,mDAAyD;AAIzD,wGAAqG;AACrG,sGAAmG;AACnG,sGAAmG;AAEnG;;;GAGG;AACU,QAAA,iCAAiC,GAAG,IAAI,4BAAc,CAGjE;IACA,IAAI,EAAE,+DAA8B;IACpC,GAAG,EAAE;QACH,GAAG,EAAE;YACH,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBACjC,OAAO,IAAA,yCAAmB,EAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACjE,CAAC;YACD,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC9B,IAAI,IAAA,8BAAa,EAAC,EAAE,EAAE,EAAE,+DAA8B,EAAE,CAAC,CAAC,KAAK,CAAC;oBAC9D,OAAO,IAAA,yCAAmB,EAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;gBACjE,wCAAuB,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YACnE,CAAC;SACF;QACD,GAAG,EAAE;YACH,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;SACf;KACF;IACD,GAAG,EAAE;QACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAChC,OAAO,IAAA,yCAAmB,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1D,CAAC;QACD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC/B,OAAO,IAAA,yCAAmB,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,EAAE,IAAI;KACb;CACF,CAAC,CAAC"}
|
|
@@ -6,4 +6,4 @@ import { DeclaredGithubRepoConfig } from '../../domain.objects/DeclaredGithubRep
|
|
|
6
6
|
* .what = declastruct DAO for github repository configuration resources
|
|
7
7
|
* .why = wraps existing repo config operations to conform to declastruct interface
|
|
8
8
|
*/
|
|
9
|
-
export declare const DeclaredGithubRepoConfigDao: DeclastructDao<
|
|
9
|
+
export declare const DeclaredGithubRepoConfigDao: DeclastructDao<typeof DeclaredGithubRepoConfig, ContextGithubApi & ContextLogTrail>;
|
|
@@ -12,14 +12,22 @@ const setRepoConfig_1 = require("../../domain.operations/repoConfig/setRepoConfi
|
|
|
12
12
|
* .why = wraps existing repo config operations to conform to declastruct interface
|
|
13
13
|
*/
|
|
14
14
|
exports.DeclaredGithubRepoConfigDao = new declastruct_1.DeclastructDao({
|
|
15
|
+
dobj: DeclaredGithubRepoConfig_1.DeclaredGithubRepoConfig,
|
|
15
16
|
get: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
byRef: async (input, context) => {
|
|
20
|
-
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubRepoConfig_1.DeclaredGithubRepoConfig })(input))
|
|
17
|
+
one: {
|
|
18
|
+
byUnique: async (input, context) => {
|
|
21
19
|
return (0, getRepoConfig_1.getRepoConfig)({ by: { unique: input } }, context);
|
|
22
|
-
|
|
20
|
+
},
|
|
21
|
+
byPrimary: null,
|
|
22
|
+
byRef: async (input, context) => {
|
|
23
|
+
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubRepoConfig_1.DeclaredGithubRepoConfig })(input))
|
|
24
|
+
return (0, getRepoConfig_1.getRepoConfig)({ by: { unique: input } }, context);
|
|
25
|
+
helpful_errors_1.UnexpectedCodePathError.throw('unsupported ref type', { input });
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
ref: {
|
|
29
|
+
byPrimary: null,
|
|
30
|
+
byUnique: null,
|
|
23
31
|
},
|
|
24
32
|
},
|
|
25
33
|
set: {
|
|
@@ -29,6 +37,7 @@ exports.DeclaredGithubRepoConfigDao = new declastruct_1.DeclastructDao({
|
|
|
29
37
|
upsert: async (input, context) => {
|
|
30
38
|
return (0, setRepoConfig_1.setRepoConfig)({ upsert: input }, context);
|
|
31
39
|
},
|
|
40
|
+
delete: null,
|
|
32
41
|
},
|
|
33
42
|
});
|
|
34
43
|
//# sourceMappingURL=DeclaredGithubRepoConfigDao.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclaredGithubRepoConfigDao.js","sourceRoot":"","sources":["../../../src/access/daos/DeclaredGithubRepoConfigDao.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,mDAA+C;AAC/C,mDAAyD;AAIzD,4FAAyF;AACzF,oFAAiF;AACjF,oFAAiF;AAEjF;;;GAG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,EAAE;YAC/B,OAAO,IAAA,6BAAa,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,EAAE,IAAI;KACb;CACF,CAAC,CAAC"}
|
|
@@ -6,4 +6,4 @@ import { DeclaredGithubRepo } from '../../domain.objects/DeclaredGithubRepo';
|
|
|
6
6
|
* .what = declastruct DAO for github repository resources
|
|
7
7
|
* .why = wraps existing repo operations to conform to declastruct interface
|
|
8
8
|
*/
|
|
9
|
-
export declare const DeclaredGithubRepoDao: DeclastructDao<
|
|
9
|
+
export declare const DeclaredGithubRepoDao: DeclastructDao<typeof DeclaredGithubRepo, ContextGithubApi & ContextLogTrail>;
|
|
@@ -12,14 +12,22 @@ const setRepo_1 = require("../../domain.operations/repo/setRepo");
|
|
|
12
12
|
* .why = wraps existing repo operations to conform to declastruct interface
|
|
13
13
|
*/
|
|
14
14
|
exports.DeclaredGithubRepoDao = new declastruct_1.DeclastructDao({
|
|
15
|
+
dobj: DeclaredGithubRepo_1.DeclaredGithubRepo,
|
|
15
16
|
get: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
byRef: async (input, context) => {
|
|
20
|
-
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubRepo_1.DeclaredGithubRepo })(input))
|
|
17
|
+
one: {
|
|
18
|
+
byUnique: async (input, context) => {
|
|
21
19
|
return (0, getRepo_1.getRepo)({ by: { unique: input } }, context);
|
|
22
|
-
|
|
20
|
+
},
|
|
21
|
+
byPrimary: null,
|
|
22
|
+
byRef: async (input, context) => {
|
|
23
|
+
if ((0, domain_objects_1.isRefByUnique)({ of: DeclaredGithubRepo_1.DeclaredGithubRepo })(input))
|
|
24
|
+
return (0, getRepo_1.getRepo)({ by: { unique: input } }, context);
|
|
25
|
+
helpful_errors_1.UnexpectedCodePathError.throw('unsupported ref type', { input });
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
ref: {
|
|
29
|
+
byPrimary: null,
|
|
30
|
+
byUnique: null,
|
|
23
31
|
},
|
|
24
32
|
},
|
|
25
33
|
set: {
|
|
@@ -29,6 +37,7 @@ exports.DeclaredGithubRepoDao = new declastruct_1.DeclastructDao({
|
|
|
29
37
|
upsert: async (input, context) => {
|
|
30
38
|
return (0, setRepo_1.setRepo)({ upsert: input }, context);
|
|
31
39
|
},
|
|
40
|
+
delete: null,
|
|
32
41
|
},
|
|
33
42
|
});
|
|
34
43
|
//# sourceMappingURL=DeclaredGithubRepoDao.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclaredGithubRepoDao.js","sourceRoot":"","sources":["../../../src/access/daos/DeclaredGithubRepoDao.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,mDAA+C;AAC/C,mDAAyD;AAIzD,gFAA6E;AAC7E,kEAA+D;AAC/D,kEAA+D;AAE/D;;;GAGG;AACU,QAAA,qBAAqB,GAAG,IAAI,4BAAc,
|
|
1
|
+
{"version":3,"file":"DeclaredGithubRepoDao.js","sourceRoot":"","sources":["../../../src/access/daos/DeclaredGithubRepoDao.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,mDAA+C;AAC/C,mDAAyD;AAIzD,gFAA6E;AAC7E,kEAA+D;AAC/D,kEAA+D;AAE/D;;;GAGG;AACU,QAAA,qBAAqB,GAAG,IAAI,4BAAc,CAGrD;IACA,IAAI,EAAE,uCAAkB;IACxB,GAAG,EAAE;QACH,GAAG,EAAE;YACH,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBACjC,OAAO,IAAA,iBAAO,EAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACrD,CAAC;YACD,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC9B,IAAI,IAAA,8BAAa,EAAC,EAAE,EAAE,EAAE,uCAAkB,EAAE,CAAC,CAAC,KAAK,CAAC;oBAClD,OAAO,IAAA,iBAAO,EAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;gBACrD,wCAAuB,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YACnE,CAAC;SACF;QACD,GAAG,EAAE;YACH,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;SACf;KACF;IACD,GAAG,EAAE;QACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAChC,OAAO,IAAA,iBAAO,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;QACD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC/B,OAAO,IAAA,iBAAO,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,EAAE,IAAI;KACb;CACF,CAAC,CAAC"}
|
|
@@ -10,8 +10,8 @@ import type { DeclaredGithubRepoConfig } from './DeclaredGithubRepoConfig';
|
|
|
10
10
|
* .why = provides type safety and reusability for the github provider
|
|
11
11
|
*/
|
|
12
12
|
export type DeclastructGithubProvider = DeclastructProvider<{
|
|
13
|
-
DeclaredGithubRepo: DeclastructDao<
|
|
14
|
-
DeclaredGithubBranch: DeclastructDao<
|
|
15
|
-
DeclaredGithubRepoConfig: DeclastructDao<
|
|
16
|
-
DeclaredGithubBranchProtection: DeclastructDao<
|
|
13
|
+
DeclaredGithubRepo: DeclastructDao<typeof DeclaredGithubRepo, ContextGithubApi & ContextLogTrail>;
|
|
14
|
+
DeclaredGithubBranch: DeclastructDao<typeof DeclaredGithubBranch, ContextGithubApi & ContextLogTrail>;
|
|
15
|
+
DeclaredGithubRepoConfig: DeclastructDao<typeof DeclaredGithubRepoConfig, ContextGithubApi & ContextLogTrail>;
|
|
16
|
+
DeclaredGithubBranchProtection: DeclastructDao<typeof DeclaredGithubBranchProtection, ContextGithubApi & ContextLogTrail>;
|
|
17
17
|
}, ContextGithubApi & ContextLogTrail>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setBranch = void 0;
|
|
4
|
+
const uni_time_1 = require("@ehmpathy/uni-time");
|
|
4
5
|
const as_procedure_1 = require("as-procedure");
|
|
5
6
|
const helpful_errors_1 = require("helpful-errors");
|
|
6
7
|
const getGithubClient_1 = require("../../access/sdks/getGithubClient");
|
|
@@ -41,18 +42,15 @@ exports.setBranch = (0, as_procedure_1.asProcedure)(async (input, context) => {
|
|
|
41
42
|
sha: desired.commit.sha,
|
|
42
43
|
force: false, // don't force update - fail if not fast-forward
|
|
43
44
|
});
|
|
44
|
-
// fetch the updated branch to return full metadata
|
|
45
|
-
return ((await (0, getBranch_1.getBranch)({
|
|
45
|
+
// fetch the updated branch to return full metadata (with retry for eventual consistency)
|
|
46
|
+
return await (0, uni_time_1.waitFor)(async () => (await (0, getBranch_1.getBranch)({
|
|
46
47
|
by: {
|
|
47
48
|
unique: {
|
|
48
49
|
repo: desired.repo,
|
|
49
50
|
name: desired.name,
|
|
50
51
|
},
|
|
51
52
|
},
|
|
52
|
-
}, context)) ??
|
|
53
|
-
helpful_errors_1.UnexpectedCodePathError.throw('updated branch not found', {
|
|
54
|
-
name: desired.name,
|
|
55
|
-
}));
|
|
53
|
+
}, context)) ?? undefined, { timeout: { seconds: 3 } });
|
|
56
54
|
}
|
|
57
55
|
catch (error) {
|
|
58
56
|
if (!(error instanceof Error))
|
|
@@ -76,18 +74,15 @@ exports.setBranch = (0, as_procedure_1.asProcedure)(async (input, context) => {
|
|
|
76
74
|
ref: `refs/heads/${desired.name}`,
|
|
77
75
|
sha: commitSha,
|
|
78
76
|
});
|
|
79
|
-
// fetch the created branch to return full metadata
|
|
80
|
-
return ((await (0, getBranch_1.getBranch)({
|
|
77
|
+
// fetch the created branch to return full metadata (with retry for eventual consistency)
|
|
78
|
+
return await (0, uni_time_1.waitFor)(async () => (await (0, getBranch_1.getBranch)({
|
|
81
79
|
by: {
|
|
82
80
|
unique: {
|
|
83
81
|
repo: desired.repo,
|
|
84
82
|
name: desired.name,
|
|
85
83
|
},
|
|
86
84
|
},
|
|
87
|
-
}, context)) ??
|
|
88
|
-
helpful_errors_1.UnexpectedCodePathError.throw('created branch not found', {
|
|
89
|
-
name: desired.name,
|
|
90
|
-
}));
|
|
85
|
+
}, context)) ?? undefined, { timeout: { seconds: 3 } });
|
|
91
86
|
}
|
|
92
87
|
catch (error) {
|
|
93
88
|
if (!(error instanceof Error))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setBranch.js","sourceRoot":"","sources":["../../../src/domain.operations/branch/setBranch.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"setBranch.js","sourceRoot":"","sources":["../../../src/domain.operations/branch/setBranch.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAC7C,+CAA2C;AAC3C,mDAA8C;AAI9C,uEAAoE;AAGpE,2CAAwC;AACxC,uFAAoF;AAEpF;;;GAGG;AACU,QAAA,SAAS,GAAG,IAAA,0BAAW,EAClC,KAAK,EACH,KAGE,EACF,OAA6C,EACD,EAAE;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAE9C,2BAA2B;IAC3B,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,sCAAsC;IACtC,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAC5B;QACE,EAAE,EAAE;YACF,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,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
|
|
|
2
2
|
"name": "declastruct-github",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "declarative control of GitHub constructs via declastruct - manage repos, branches, and protection rules",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.7",
|
|
6
6
|
"repository": "ehmpathy/declastruct-github",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/declastruct-github",
|
|
8
8
|
"keywords": [
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"fix:format:biome": "biome check --write src",
|
|
30
30
|
"fix:format": "npm run fix:format:biome",
|
|
31
31
|
"fix:lint": "biome check --write src",
|
|
32
|
+
"fix": "npm run fix:format && npm run fix:lint",
|
|
32
33
|
"build:clean": "rm dist/ -rf",
|
|
33
34
|
"build:compile": "tsc -p ./tsconfig.build.json",
|
|
34
35
|
"build": "npm run build:clean && npm run build:compile",
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
"preversion": "npm run prepush",
|
|
51
52
|
"postversion": "git push origin HEAD --tags --no-verify",
|
|
52
53
|
"prepare:husky": "npx husky install && chmod ug+x .husky/*",
|
|
53
|
-
"prepare": "[ -
|
|
54
|
+
"prepare": "[ -e .git ] && npm run prepare:husky || exit 0"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
57
|
"@ehmpathy/uni-time": "1.7.4",
|
|
@@ -76,15 +77,15 @@
|
|
|
76
77
|
"@types/node": "22.15.21",
|
|
77
78
|
"cz-conventional-changelog": "3.3.0",
|
|
78
79
|
"declapract": "0.13.0",
|
|
79
|
-
"declapract-typescript-ehmpathy": "0.43.
|
|
80
|
-
"declastruct": "
|
|
81
|
-
"declastruct-github": "
|
|
80
|
+
"declapract-typescript-ehmpathy": "0.43.11",
|
|
81
|
+
"declastruct": "1.5.1",
|
|
82
|
+
"declastruct-github": "1.0.6",
|
|
82
83
|
"depcheck": "1.4.3",
|
|
83
84
|
"esbuild-register": "3.6.0",
|
|
84
85
|
"husky": "8.0.3",
|
|
85
86
|
"jest": "30.2.0",
|
|
86
|
-
"rhachet": "1.12.
|
|
87
|
-
"rhachet-roles-ehmpathy": "1.
|
|
87
|
+
"rhachet": "1.12.3",
|
|
88
|
+
"rhachet-roles-ehmpathy": "1.12.1",
|
|
88
89
|
"simple-log-methods": "0.6.2",
|
|
89
90
|
"test-fns": "1.5.0",
|
|
90
91
|
"tsx": "4.20.6",
|