declastruct-github 1.1.1 → 1.2.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/access/daos/DeclaredGithubAppDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubAppInstallationDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubBranchDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubBranchProtectionDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubOrgDao.d.ts +10 -0
- package/dist/access/daos/DeclaredGithubOrgDao.js +44 -0
- package/dist/access/daos/DeclaredGithubOrgDao.js.map +1 -0
- package/dist/access/daos/DeclaredGithubOrgMemberPrivilegesDao.d.ts +10 -0
- package/dist/access/daos/DeclaredGithubOrgMemberPrivilegesDao.js +44 -0
- package/dist/access/daos/DeclaredGithubOrgMemberPrivilegesDao.js.map +1 -0
- package/dist/access/daos/DeclaredGithubOrgSecretDao.d.ts +10 -0
- package/dist/access/daos/DeclaredGithubOrgSecretDao.js +47 -0
- package/dist/access/daos/DeclaredGithubOrgSecretDao.js.map +1 -0
- package/dist/access/daos/DeclaredGithubOrgVariableDao.d.ts +9 -0
- package/dist/access/daos/DeclaredGithubOrgVariableDao.js +46 -0
- package/dist/access/daos/DeclaredGithubOrgVariableDao.js.map +1 -0
- package/dist/access/daos/DeclaredGithubRepoConfigDao.js.map +1 -1
- package/dist/access/daos/DeclaredGithubRepoDao.js.map +1 -1
- package/dist/contract/sdks/index.d.ts +4 -0
- package/dist/contract/sdks/index.js +10 -1
- package/dist/contract/sdks/index.js.map +1 -1
- package/dist/domain.objects/DeclaredGithubApp.js.map +1 -1
- package/dist/domain.objects/DeclaredGithubAppPermissions.d.ts +6 -2
- package/dist/domain.objects/DeclaredGithubAppPermissions.js.map +1 -1
- package/dist/domain.objects/DeclaredGithubOrg.d.ts +59 -0
- package/dist/domain.objects/DeclaredGithubOrg.js +15 -0
- package/dist/domain.objects/DeclaredGithubOrg.js.map +1 -0
- package/dist/domain.objects/DeclaredGithubOrgMemberPrivileges.d.ts +85 -0
- package/dist/domain.objects/DeclaredGithubOrgMemberPrivileges.js +13 -0
- package/dist/domain.objects/DeclaredGithubOrgMemberPrivileges.js.map +1 -0
- package/dist/domain.objects/DeclaredGithubOrgSecret.d.ts +63 -0
- package/dist/domain.objects/DeclaredGithubOrgSecret.js +14 -0
- package/dist/domain.objects/DeclaredGithubOrgSecret.js.map +1 -0
- package/dist/domain.objects/DeclaredGithubOrgVariable.d.ts +54 -0
- package/dist/domain.objects/DeclaredGithubOrgVariable.js +13 -0
- package/dist/domain.objects/DeclaredGithubOrgVariable.js.map +1 -0
- package/dist/domain.objects/DeclaredGithubRepo.d.ts +1 -0
- package/dist/domain.objects/DeclaredGithubRepo.js +1 -0
- package/dist/domain.objects/DeclaredGithubRepo.js.map +1 -1
- package/dist/domain.objects/DeclastructGithubProvider.d.ts +8 -0
- package/dist/domain.operations/app/castToDeclaredGithubApp.js +2 -1
- package/dist/domain.operations/app/castToDeclaredGithubApp.js.map +1 -1
- package/dist/domain.operations/app/getOneApp.js +2 -2
- package/dist/domain.operations/app/getOneApp.js.map +1 -1
- package/dist/domain.operations/app/setApp.js.map +1 -1
- package/dist/domain.operations/appInstallation/castToDeclaredGithubAppInstallation.js.map +1 -1
- package/dist/domain.operations/appInstallation/getOneAppInstallation.js +2 -2
- package/dist/domain.operations/appInstallation/getOneAppInstallation.js.map +1 -1
- package/dist/domain.operations/appInstallation/setAppInstallation.js.map +1 -1
- package/dist/domain.operations/branch/castToDeclaredGithubBranch.js.map +1 -1
- package/dist/domain.operations/branch/getBranch.js.map +1 -1
- package/dist/domain.operations/branch/getBranchCommitShaByRepoDefault.js.map +1 -1
- package/dist/domain.operations/branch/getBranches.js.map +1 -1
- package/dist/domain.operations/branch/setBranch.js.map +1 -1
- package/dist/domain.operations/branchProtection/castToDeclaredGithubBranchProtection.js.map +1 -1
- package/dist/domain.operations/branchProtection/getBranchProtection.js.map +1 -1
- package/dist/domain.operations/branchProtection/setBranchProtection.js.map +1 -1
- package/dist/domain.operations/org/castToDeclaredGithubOrg.d.ts +12 -0
- package/dist/domain.operations/org/castToDeclaredGithubOrg.js +29 -0
- package/dist/domain.operations/org/castToDeclaredGithubOrg.js.map +1 -0
- package/dist/domain.operations/org/getOneOrg.d.ts +14 -0
- package/dist/domain.operations/org/getOneOrg.js +31 -0
- package/dist/domain.operations/org/getOneOrg.js.map +1 -0
- package/dist/domain.operations/org/setOrg.d.ts +17 -0
- package/dist/domain.operations/org/setOrg.js +50 -0
- package/dist/domain.operations/org/setOrg.js.map +1 -0
- package/dist/domain.operations/orgMemberPrivileges/castToDeclaredGithubOrgMemberPrivileges.d.ts +15 -0
- package/dist/domain.operations/orgMemberPrivileges/castToDeclaredGithubOrgMemberPrivileges.js +47 -0
- package/dist/domain.operations/orgMemberPrivileges/castToDeclaredGithubOrgMemberPrivileges.js.map +1 -0
- package/dist/domain.operations/orgMemberPrivileges/getOneOrgMemberPrivileges.d.ts +14 -0
- package/dist/domain.operations/orgMemberPrivileges/getOneOrgMemberPrivileges.js +36 -0
- package/dist/domain.operations/orgMemberPrivileges/getOneOrgMemberPrivileges.js.map +1 -0
- package/dist/domain.operations/orgMemberPrivileges/setOrgMemberPrivileges.d.ts +16 -0
- package/dist/domain.operations/orgMemberPrivileges/setOrgMemberPrivileges.js +64 -0
- package/dist/domain.operations/orgMemberPrivileges/setOrgMemberPrivileges.js.map +1 -0
- package/dist/domain.operations/orgSecret/castToDeclaredGithubOrgSecret.d.ts +17 -0
- package/dist/domain.operations/orgSecret/castToDeclaredGithubOrgSecret.js +28 -0
- package/dist/domain.operations/orgSecret/castToDeclaredGithubOrgSecret.js.map +1 -0
- package/dist/domain.operations/orgSecret/delOrgSecret.d.ts +11 -0
- package/dist/domain.operations/orgSecret/delOrgSecret.js +27 -0
- package/dist/domain.operations/orgSecret/delOrgSecret.js.map +1 -0
- package/dist/domain.operations/orgSecret/getAllOrgSecrets.d.ts +14 -0
- package/dist/domain.operations/orgSecret/getAllOrgSecrets.js +27 -0
- package/dist/domain.operations/orgSecret/getAllOrgSecrets.js.map +1 -0
- package/dist/domain.operations/orgSecret/getOneOrgSecret.d.ts +15 -0
- package/dist/domain.operations/orgSecret/getOneOrgSecret.js +35 -0
- package/dist/domain.operations/orgSecret/getOneOrgSecret.js.map +1 -0
- package/dist/domain.operations/orgSecret/setOrgSecret.d.ts +17 -0
- package/dist/domain.operations/orgSecret/setOrgSecret.js +123 -0
- package/dist/domain.operations/orgSecret/setOrgSecret.js.map +1 -0
- package/dist/domain.operations/orgVariable/castToDeclaredGithubOrgVariable.d.ts +16 -0
- package/dist/domain.operations/orgVariable/castToDeclaredGithubOrgVariable.js +26 -0
- package/dist/domain.operations/orgVariable/castToDeclaredGithubOrgVariable.js.map +1 -0
- package/dist/domain.operations/orgVariable/delOrgVariable.d.ts +11 -0
- package/dist/domain.operations/orgVariable/delOrgVariable.js +27 -0
- package/dist/domain.operations/orgVariable/delOrgVariable.js.map +1 -0
- package/dist/domain.operations/orgVariable/getAllOrgVariables.d.ts +13 -0
- package/dist/domain.operations/orgVariable/getAllOrgVariables.js +28 -0
- package/dist/domain.operations/orgVariable/getAllOrgVariables.js.map +1 -0
- package/dist/domain.operations/orgVariable/getOneOrgVariable.d.ts +14 -0
- package/dist/domain.operations/orgVariable/getOneOrgVariable.js +34 -0
- package/dist/domain.operations/orgVariable/getOneOrgVariable.js.map +1 -0
- package/dist/domain.operations/orgVariable/setOrgVariable.d.ts +12 -0
- package/dist/domain.operations/orgVariable/setOrgVariable.js +69 -0
- package/dist/domain.operations/orgVariable/setOrgVariable.js.map +1 -0
- package/dist/domain.operations/provider/getDeclastructGithubProvider.js +9 -0
- package/dist/domain.operations/provider/getDeclastructGithubProvider.js.map +1 -1
- package/dist/domain.operations/repo/castToDeclaredGithubRepo.js.map +1 -1
- package/dist/domain.operations/repo/getRepo.js.map +1 -1
- package/dist/domain.operations/repo/getRepos.js +2 -2
- package/dist/domain.operations/repo/getRepos.js.map +1 -1
- package/dist/domain.operations/repo/setRepo.js.map +1 -1
- package/dist/domain.operations/repoConfig/castToDeclaredGithubRepoConfig.js.map +1 -1
- package/dist/domain.operations/repoConfig/getRepoConfig.js.map +1 -1
- package/dist/domain.operations/repoConfig/setRepoConfig.js.map +1 -1
- package/package.json +16 -13
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.delOrgVariable = void 0;
|
|
4
|
+
const as_procedure_1 = require("as-procedure");
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
|
+
const getGithubClient_1 = require("../../access/sdks/getGithubClient");
|
|
7
|
+
/**
|
|
8
|
+
* .what = deletes a GitHub Organization variable
|
|
9
|
+
* .why = enables declarative management of org-level variables
|
|
10
|
+
*/
|
|
11
|
+
exports.delOrgVariable = (0, as_procedure_1.asProcedure)(async (input, context) => {
|
|
12
|
+
const github = (0, getGithubClient_1.getGithubClient)({}, context);
|
|
13
|
+
// extract unique key fields
|
|
14
|
+
const variable = input.variable;
|
|
15
|
+
try {
|
|
16
|
+
await github.actions.deleteOrgVariable({
|
|
17
|
+
org: variable.org.login,
|
|
18
|
+
name: variable.name,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
if (!(error instanceof Error))
|
|
23
|
+
throw error;
|
|
24
|
+
throw new helpful_errors_1.HelpfulError('github.delOrgVariable error', { cause: error });
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=delOrgVariable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delOrgVariable.js","sourceRoot":"","sources":["../../../src/domain.operations/orgVariable/delOrgVariable.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,mDAA8C;AAG9C,sEAAmE;AAInE;;;GAGG;AACU,QAAA,cAAc,GAAG,IAAA,0BAAW,EACvC,KAAK,EACH,KAA0D,EAC1D,OAA6C,EAC9B,EAAE;IACjB,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,4BAA4B;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAoD,CAAC;IAE5E,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC;YACrC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK;YACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,MAAM,IAAI,6BAAY,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RefByUnique } from 'domain-objects';
|
|
2
|
+
import type { HasMetadata } from 'type-fns';
|
|
3
|
+
import type { VisualogicContext } from 'visualogic';
|
|
4
|
+
import type { ContextGithubApi } from '../../domain.objects/ContextGithubApi';
|
|
5
|
+
import type { DeclaredGithubOrg } from '../../domain.objects/DeclaredGithubOrg';
|
|
6
|
+
import type { DeclaredGithubOrgVariable } from '../../domain.objects/DeclaredGithubOrgVariable';
|
|
7
|
+
/**
|
|
8
|
+
* .what = gets all GitHub Organization variables
|
|
9
|
+
* .why = retrieves current state for declarative management
|
|
10
|
+
*/
|
|
11
|
+
export declare const getAllOrgVariables: (input: {
|
|
12
|
+
org: RefByUnique<typeof DeclaredGithubOrg>;
|
|
13
|
+
}, context: ContextGithubApi & VisualogicContext) => Promise<HasMetadata<DeclaredGithubOrgVariable>[]>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAllOrgVariables = void 0;
|
|
4
|
+
const as_procedure_1 = require("as-procedure");
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
|
+
const getGithubClient_1 = require("../../access/sdks/getGithubClient");
|
|
7
|
+
const castToDeclaredGithubOrgVariable_1 = require("./castToDeclaredGithubOrgVariable");
|
|
8
|
+
/**
|
|
9
|
+
* .what = gets all GitHub Organization variables
|
|
10
|
+
* .why = retrieves current state for declarative management
|
|
11
|
+
*/
|
|
12
|
+
exports.getAllOrgVariables = (0, as_procedure_1.asProcedure)(async (input, context) => {
|
|
13
|
+
const github = (0, getGithubClient_1.getGithubClient)({}, context);
|
|
14
|
+
try {
|
|
15
|
+
const response = await github.actions.listOrgVariables({
|
|
16
|
+
org: input.org.login,
|
|
17
|
+
});
|
|
18
|
+
return response.data.variables.map((v) => (0, castToDeclaredGithubOrgVariable_1.castToDeclaredGithubOrgVariable)({ data: v, org: input.org }));
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (!(error instanceof Error))
|
|
22
|
+
throw error;
|
|
23
|
+
throw new helpful_errors_1.HelpfulError('github.getAllOrgVariables error', {
|
|
24
|
+
cause: error,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=getAllOrgVariables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllOrgVariables.js","sourceRoot":"","sources":["../../../src/domain.operations/orgVariable/getAllOrgVariables.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,mDAA8C;AAI9C,sEAAmE;AAKnE,uFAAoF;AAEpF;;;GAGG;AACU,QAAA,kBAAkB,GAAG,IAAA,0BAAW,EAC3C,KAAK,EACH,KAAqD,EACrD,OAA6C,EACM,EAAE;IACrD,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;YACrD,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK;SACrB,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACvC,IAAA,iEAA+B,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAC7D,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,MAAM,IAAI,6BAAY,CAAC,iCAAiC,EAAE;YACxD,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RefByUnique } from 'domain-objects';
|
|
2
|
+
import type { HasMetadata, PickOne } from 'type-fns';
|
|
3
|
+
import type { VisualogicContext } from 'visualogic';
|
|
4
|
+
import type { ContextGithubApi } from '../../domain.objects/ContextGithubApi';
|
|
5
|
+
import type { DeclaredGithubOrgVariable } from '../../domain.objects/DeclaredGithubOrgVariable';
|
|
6
|
+
/**
|
|
7
|
+
* .what = gets a GitHub Organization variable
|
|
8
|
+
* .why = retrieves current state for declarative management
|
|
9
|
+
*/
|
|
10
|
+
export declare const getOneOrgVariable: (input: {
|
|
11
|
+
by: PickOne<{
|
|
12
|
+
unique: RefByUnique<typeof DeclaredGithubOrgVariable>;
|
|
13
|
+
}>;
|
|
14
|
+
}, context: ContextGithubApi & VisualogicContext) => Promise<HasMetadata<DeclaredGithubOrgVariable> | null>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOneOrgVariable = void 0;
|
|
4
|
+
const as_procedure_1 = require("as-procedure");
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
|
+
const getGithubClient_1 = require("../../access/sdks/getGithubClient");
|
|
7
|
+
const castToDeclaredGithubOrgVariable_1 = require("./castToDeclaredGithubOrgVariable");
|
|
8
|
+
/**
|
|
9
|
+
* .what = gets a GitHub Organization variable
|
|
10
|
+
* .why = retrieves current state for declarative management
|
|
11
|
+
*/
|
|
12
|
+
exports.getOneOrgVariable = (0, as_procedure_1.asProcedure)(async (input, context) => {
|
|
13
|
+
const github = (0, getGithubClient_1.getGithubClient)({}, context);
|
|
14
|
+
const { org, name } = (() => {
|
|
15
|
+
if (input.by.unique)
|
|
16
|
+
return { org: input.by.unique.org, name: input.by.unique.name };
|
|
17
|
+
helpful_errors_1.UnexpectedCodePathError.throw('not referenced by unique', { input });
|
|
18
|
+
})();
|
|
19
|
+
try {
|
|
20
|
+
const response = await github.actions.getOrgVariable({
|
|
21
|
+
org: org.login,
|
|
22
|
+
name,
|
|
23
|
+
});
|
|
24
|
+
return (0, castToDeclaredGithubOrgVariable_1.castToDeclaredGithubOrgVariable)({ data: response.data, org });
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
if (!(error instanceof Error))
|
|
28
|
+
throw error;
|
|
29
|
+
if (error.message.includes('Not Found'))
|
|
30
|
+
return null;
|
|
31
|
+
throw new helpful_errors_1.HelpfulError('github.getOrgVariable error', { cause: error });
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=getOneOrgVariable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOneOrgVariable.js","sourceRoot":"","sources":["../../../src/domain.operations/orgVariable/getOneOrgVariable.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,mDAAuE;AAIvE,sEAAmE;AAInE,uFAAoF;AAEpF;;;GAGG;AACU,QAAA,iBAAiB,GAAG,IAAA,0BAAW,EAC1C,KAAK,EACH,KAIC,EACD,OAA6C,EACW,EAAE;IAC1D,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE;QAC1B,IAAI,KAAK,CAAC,EAAE,CAAC,MAAM;YACjB,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAClE,wCAAuB,CAAC,KAAK,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC,CAAC,EAAE,CAAC;IAEL,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;YACnD,GAAG,EAAE,GAAG,CAAC,KAAK;YACd,IAAI;SACL,CAAC,CAAC;QACH,OAAO,IAAA,iEAA+B,EAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,IAAI,CAAC;QACrD,MAAM,IAAI,6BAAY,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HasMetadata, PickOne } from 'type-fns';
|
|
2
|
+
import type { VisualogicContext } from 'visualogic';
|
|
3
|
+
import type { ContextGithubApi } from '../../domain.objects/ContextGithubApi';
|
|
4
|
+
import type { DeclaredGithubOrgVariable } from '../../domain.objects/DeclaredGithubOrgVariable';
|
|
5
|
+
/**
|
|
6
|
+
* .what = sets a GitHub Organization variable
|
|
7
|
+
* .why = enables declarative management of org-level variables
|
|
8
|
+
*/
|
|
9
|
+
export declare const setOrgVariable: (input: PickOne<{
|
|
10
|
+
finsert: DeclaredGithubOrgVariable;
|
|
11
|
+
upsert: DeclaredGithubOrgVariable;
|
|
12
|
+
}>, context: ContextGithubApi & VisualogicContext) => Promise<HasMetadata<DeclaredGithubOrgVariable>>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setOrgVariable = void 0;
|
|
4
|
+
const as_procedure_1 = require("as-procedure");
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
|
+
const getGithubClient_1 = require("../../access/sdks/getGithubClient");
|
|
7
|
+
const getRepo_1 = require("../../domain.operations/repo/getRepo");
|
|
8
|
+
const getOneOrgVariable_1 = require("./getOneOrgVariable");
|
|
9
|
+
/**
|
|
10
|
+
* .what = sets a GitHub Organization variable
|
|
11
|
+
* .why = enables declarative management of org-level variables
|
|
12
|
+
*/
|
|
13
|
+
exports.setOrgVariable = (0, as_procedure_1.asProcedure)(async (input, context) => {
|
|
14
|
+
const desired = input.finsert ?? input.upsert;
|
|
15
|
+
const github = (0, getGithubClient_1.getGithubClient)({}, context);
|
|
16
|
+
// Check if variable exists
|
|
17
|
+
const before = await (0, getOneOrgVariable_1.getOneOrgVariable)({ by: { unique: { org: desired.org, name: desired.name } } }, context);
|
|
18
|
+
// Resolve repo IDs if visibility is 'selected'
|
|
19
|
+
const selectedRepositoryIds = desired.visibility === 'selected' && desired.selectedRepositoryNames
|
|
20
|
+
? await Promise.all(desired.selectedRepositoryNames.map(async (name) => {
|
|
21
|
+
const repo = await (0, getRepo_1.getRepo)({ by: { unique: { owner: desired.org.login, name } } }, context);
|
|
22
|
+
if (!repo)
|
|
23
|
+
throw new helpful_errors_1.HelpfulError(`Repository not found: ${desired.org.login}/${name}`);
|
|
24
|
+
return repo.id;
|
|
25
|
+
}))
|
|
26
|
+
: undefined;
|
|
27
|
+
// If finsert and found, return as-is
|
|
28
|
+
if (before && input.finsert)
|
|
29
|
+
return before;
|
|
30
|
+
// If exists, update
|
|
31
|
+
if (before && input.upsert) {
|
|
32
|
+
try {
|
|
33
|
+
await github.actions.updateOrgVariable({
|
|
34
|
+
org: desired.org.login,
|
|
35
|
+
name: desired.name,
|
|
36
|
+
value: desired.value,
|
|
37
|
+
visibility: desired.visibility,
|
|
38
|
+
selected_repository_ids: selectedRepositoryIds,
|
|
39
|
+
});
|
|
40
|
+
return (await (0, getOneOrgVariable_1.getOneOrgVariable)({ by: { unique: { org: desired.org, name: desired.name } } }, context));
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (!(error instanceof Error))
|
|
44
|
+
throw error;
|
|
45
|
+
throw new helpful_errors_1.HelpfulError('github.setOrgVariable.update error', {
|
|
46
|
+
cause: error,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Create new variable
|
|
51
|
+
try {
|
|
52
|
+
await github.actions.createOrgVariable({
|
|
53
|
+
org: desired.org.login,
|
|
54
|
+
name: desired.name,
|
|
55
|
+
value: desired.value,
|
|
56
|
+
visibility: desired.visibility,
|
|
57
|
+
selected_repository_ids: selectedRepositoryIds,
|
|
58
|
+
});
|
|
59
|
+
return (await (0, getOneOrgVariable_1.getOneOrgVariable)({ by: { unique: { org: desired.org, name: desired.name } } }, context));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (!(error instanceof Error))
|
|
63
|
+
throw error;
|
|
64
|
+
throw new helpful_errors_1.HelpfulError('github.setOrgVariable.create error', {
|
|
65
|
+
cause: error,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=setOrgVariable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setOrgVariable.js","sourceRoot":"","sources":["../../../src/domain.operations/orgVariable/setOrgVariable.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,mDAA8C;AAI9C,sEAAmE;AAGnE,iEAA8D;AAE9D,2DAAwD;AAExD;;;GAGG;AACU,QAAA,cAAc,GAAG,IAAA,0BAAW,EACvC,KAAK,EACH,KAGE,EACF,OAA6C,EACI,EAAE;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,2BAA2B;IAC3B,MAAM,MAAM,GAAG,MAAM,IAAA,qCAAiB,EACpC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,EAC5D,OAAO,CACR,CAAC;IAEF,+CAA+C;IAC/C,MAAM,qBAAqB,GACzB,OAAO,CAAC,UAAU,KAAK,UAAU,IAAI,OAAO,CAAC,uBAAuB;QAClE,CAAC,CAAC,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACjD,MAAM,IAAI,GAAG,MAAM,IAAA,iBAAO,EACxB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,EACtD,OAAO,CACR,CAAC;YACF,IAAI,CAAC,IAAI;gBACP,MAAM,IAAI,6BAAY,CACpB,yBAAyB,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,EAAE,CACrD,CAAC;YACJ,OAAO,IAAI,CAAC,EAAG,CAAC;QAClB,CAAC,CAAC,CACH;QACH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E,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,EAC5D,OAAO,CACR,CAAE,CAAC;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,MAAM,IAAI,6BAAY,CAAC,oCAAoC,EAAE;YAC3D,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CACF,CAAC"}
|
|
@@ -6,6 +6,10 @@ const DeclaredGithubAppDao_1 = require("../../access/daos/DeclaredGithubAppDao")
|
|
|
6
6
|
const DeclaredGithubAppInstallationDao_1 = require("../../access/daos/DeclaredGithubAppInstallationDao");
|
|
7
7
|
const DeclaredGithubBranchDao_1 = require("../../access/daos/DeclaredGithubBranchDao");
|
|
8
8
|
const DeclaredGithubBranchProtectionDao_1 = require("../../access/daos/DeclaredGithubBranchProtectionDao");
|
|
9
|
+
const DeclaredGithubOrgDao_1 = require("../../access/daos/DeclaredGithubOrgDao");
|
|
10
|
+
const DeclaredGithubOrgMemberPrivilegesDao_1 = require("../../access/daos/DeclaredGithubOrgMemberPrivilegesDao");
|
|
11
|
+
const DeclaredGithubOrgSecretDao_1 = require("../../access/daos/DeclaredGithubOrgSecretDao");
|
|
12
|
+
const DeclaredGithubOrgVariableDao_1 = require("../../access/daos/DeclaredGithubOrgVariableDao");
|
|
9
13
|
const DeclaredGithubRepoConfigDao_1 = require("../../access/daos/DeclaredGithubRepoConfigDao");
|
|
10
14
|
const DeclaredGithubRepoDao_1 = require("../../access/daos/DeclaredGithubRepoDao");
|
|
11
15
|
/**
|
|
@@ -28,6 +32,11 @@ const getDeclastructGithubProvider = (input, context) => {
|
|
|
28
32
|
DeclaredGithubBranchProtection: DeclaredGithubBranchProtectionDao_1.DeclaredGithubBranchProtectionDao,
|
|
29
33
|
DeclaredGithubApp: DeclaredGithubAppDao_1.DeclaredGithubAppDao,
|
|
30
34
|
DeclaredGithubAppInstallation: DeclaredGithubAppInstallationDao_1.DeclaredGithubAppInstallationDao,
|
|
35
|
+
// Organization resources
|
|
36
|
+
DeclaredGithubOrg: DeclaredGithubOrgDao_1.DeclaredGithubOrgDao,
|
|
37
|
+
DeclaredGithubOrgMemberPrivileges: DeclaredGithubOrgMemberPrivilegesDao_1.DeclaredGithubOrgMemberPrivilegesDao,
|
|
38
|
+
DeclaredGithubOrgVariable: DeclaredGithubOrgVariableDao_1.DeclaredGithubOrgVariableDao,
|
|
39
|
+
DeclaredGithubOrgSecret: DeclaredGithubOrgSecretDao_1.DeclaredGithubOrgSecretDao,
|
|
31
40
|
};
|
|
32
41
|
// return provider with all required properties
|
|
33
42
|
return new declastruct_1.DeclastructProvider({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeclastructGithubProvider.js","sourceRoot":"","sources":["../../../src/domain.operations/provider/getDeclastructGithubProvider.ts"],"names":[],"mappings":";;;AAAA,6CAAkD;AAGlD,
|
|
1
|
+
{"version":3,"file":"getDeclastructGithubProvider.js","sourceRoot":"","sources":["../../../src/domain.operations/provider/getDeclastructGithubProvider.ts"],"names":[],"mappings":";;;AAAA,6CAAkD;AAGlD,gFAA6E;AAC7E,wGAAqG;AACrG,sFAAmF;AACnF,0GAAuG;AACvG,gFAA6E;AAC7E,gHAA6G;AAC7G,4FAAyF;AACzF,gGAA6F;AAC7F,8FAA2F;AAC3F,kFAA+E;AAI/E;;;GAGG;AACI,MAAM,4BAA4B,GAAG,CAC1C,KAIC,EACD,OAAwB,EACG,EAAE;IAC7B,+CAA+C;IAC/C,MAAM,eAAe,GAAuC;QAC1D,GAAG,OAAO;QACV,MAAM,EAAE;YACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK;SAC/B;KACF,CAAC;IAEF,8CAA8C;IAC9C,MAAM,IAAI,GAAG;QACX,kBAAkB,EAAE,6CAAqB;QACzC,oBAAoB,EAAE,iDAAuB;QAC7C,wBAAwB,EAAE,yDAA2B;QACrD,8BAA8B,EAAE,qEAAiC;QACjE,iBAAiB,EAAE,2CAAoB;QACvC,6BAA6B,EAAE,mEAAgC;QAC/D,yBAAyB;QACzB,iBAAiB,EAAE,2CAAoB;QACvC,iCAAiC,EAAE,2EAAoC;QACvE,yBAAyB,EAAE,2DAA4B;QACvD,uBAAuB,EAAE,uDAA0B;KACpD,CAAC;IAEF,+CAA+C;IAC/C,OAAO,IAAI,iCAAmB,CAAC;QAC7B,IAAI,EAAE,QAAQ;QACd,IAAI;QACJ,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE;YACL,SAAS,EAAE,KAAK,IAAI,EAAE;gBACpB,sCAAsC;YACxC,CAAC;YACD,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACnB,yCAAyC;YAC3C,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AA7CW,QAAA,4BAA4B,gCA6CvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"castToDeclaredGithubRepo.js","sourceRoot":"","sources":["../../../src/domain.operations/repo/castToDeclaredGithubRepo.ts"],"names":[],"mappings":";;;AAAA,iDAAmD;AAEnD,mDAAyD;AACzD,uCAA+E;AAE/E
|
|
1
|
+
{"version":3,"file":"castToDeclaredGithubRepo.js","sourceRoot":"","sources":["../../../src/domain.operations/repo/castToDeclaredGithubRepo.ts"],"names":[],"mappings":";;;AAAA,iDAAmD;AAEnD,mDAAyD;AACzD,uCAA+E;AAE/E,+EAA4E;AAE5E;;;GAGG;AACH,MAAM,UAAU,GAAG,CACjB,GAAM,EACN,GAAM,EACc,EAAE;IACtB,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IAEvB,kCAAkC;IAClC,IAAI,IAAA,yBAAc,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAExC,uBAAuB;IACvB,wCAAuB,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,wBAAwB,EAAE;QACpE,KAAK,EAAE,GAAG;QACV,GAAG;KACJ,CAAC,CAAC;AACL,CAAC,CAAC;AAOF;;;GAGG;AACI,MAAM,wBAAwB,GAAG,CACtC,KAAyB,EACQ,EAAE;IACnC,MAAM,UAAU,GACb,KAAK,CAAC,UAAgD,IAAI,QAAQ,CAAC;IAEtE,OAAO,uCAAkB,CAAC,EAAE,CAAC;QAC3B,EAAE,EAAE,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;QAC3B,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QACtD,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC;QAC/B,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,IAAI;QACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,IAAI;QAChC,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,UAAU,KAAK,QAAQ;QACjD,UAAU;QACV,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK;QACjC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,wBAAa,EAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;QACzE,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,wBAAa,EAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;KAC1E,CAAoC,CAAC;AACxC,CAAC,CAAC;AAlBW,QAAA,wBAAwB,4BAkBnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepo.js","sourceRoot":"","sources":["../../../src/domain.operations/repo/getRepo.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,mDAAuE;AAIvE,
|
|
1
|
+
{"version":3,"file":"getRepo.js","sourceRoot":"","sources":["../../../src/dom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 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getRepos = void 0;
|
|
4
4
|
const helpful_errors_1 = require("helpful-errors");
|
|
5
5
|
const getGithubClient_1 = require("../../access/sdks/getGithubClient");
|
|
6
|
-
const hasContextWithAppToken_1 = require("
|
|
7
|
-
const hasContextWithPatToken_1 = require("
|
|
6
|
+
const hasContextWithAppToken_1 = require("../../domain.operations/context/hasContextWithAppToken");
|
|
7
|
+
const hasContextWithPatToken_1 = require("../../domain.operations/context/hasContextWithPatToken");
|
|
8
8
|
const castToDeclaredGithubRepo_1 = require("./castToDeclaredGithubRepo");
|
|
9
9
|
/**
|
|
10
10
|
* .what = lists GitHub repositories
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepos.js","sourceRoot":"","sources":["../../../src/domain.operations/repo/getRepos.ts"],"names":[],"mappings":";;;AAAA,mDAAuE;AAIvE,
|
|
1
|
+
{"version":3,"file":"getRepos.js","sourceRoot":"","sources":["../../../src/domain.operations/repo/getRepos.ts"],"names":[],"mappings":";;;AAAA,mDAAuE;AAIvE,sEAAmE;AAGnE,kGAA+F;AAC/F,kGAA+F;AAE/F,yEAAsE;AAEtE;;;GAGG;AACI,MAAM,QAAQ,GAAG,KAAK,EAC3B,KAQC,EACD,OAA6C,EACD,EAAE;IAC9C,2BAA2B;IAC3B,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,sDAAsD;IACtD,MAAM,UAAU,GAAG,IAAA,+CAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,IAAA,+CAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEpD,8BAA8B;IAC9B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE;YACjC,sDAAsD;YACtD,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,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f,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,MAAM,IAAI,6BAAY,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC,CAAC;AA3DW,QAAA,QAAQ,YA2DnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setRepo.js","sourceRoot":"","sources":["../../../src/domain.operations/repo/setRepo.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,mDAA8C;AAI9C,
|
|
1
|
+
{"version":3,"file":"setRepo.js","sourceRoot":"","sources":["../../../src/domain.operations/repo/setRepo.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,mDAA8C;AAI9C,sEAAmE;AAInE,yEAAsE;AACtE,uCAAoC;AAEpC;;;GAGG;AACU,QAAA,OAAO,GAAG,IAAA,0BAAW,EAChC,KAAK,EACH,KAGE,EACF,OAA6C,EACH,EAAE;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAE9C,qCAAqC;IACrC,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC;IACjD,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,QAAQ,CAAC;IAC1E,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC;IAElD,2BAA2B;IAC3B,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,kCAAkC;IAClC,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAO,EAC1B;QACE,EAAE,EAAE;YACF,MAAM,EAAE;gBACN,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB;SACF;KACF,EACD,OAAO,CACR,CAAC;I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AAC,CAAC,CAAC,OAAO,CAAC,UAAU;SACrE,CAAC,CAAC;QAEH,OAAO,IAAA,mDAAwB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,MAAM,IAAI,6BAAY,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"castToDeclaredGithubRepoConfig.js","sourceRoot":"","sources":["../../../src/domain.operations/repoConfig/castToDeclaredGithubRepoConfig.ts"],"names":[],"mappings":";;;AACA,mDAA+D;AAG/D
|
|
1
|
+
{"version":3,"file":"castToDeclaredGithubRepoConfig.js","sourceRoot":"","sources":["../../../src/domain.operations/repoConfig/castToDeclaredGithubRepoConfig.ts"],"names":[],"mappings":";;;AACA,mDAA+D;AAG/D,+EAA4E;AAC5E,2FAAwF;AAKxF;;;GAGG;AACI,MAAM,8BAA8B,GAAG,CAAC,KAG9C,EAAyC,EAAE;IAC1C,OAAO,mDAAwB,CAAC,EAAE,CAAC;QACjC,IAAI,EACF,KAAK,CAAC,IAAI,YAAY,uCAAkB;YACtC,CAAC,CAAC,IAAA,4BAAW,EAA4B,KAAK,CAAC,IAAI,CAAC;YACpD,CAAC,CAAC,KAAK,CAAC,IAAI;QAChB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;QACpC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY;QACxC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ;QAChC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW;QACtC,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,cAAc;QAC5C,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB;QACnD,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB;QACnD,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB;QACnD,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,gBAAgB;QAC/C,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,sBAAsB;QAC1D,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,mBAAmB;QACrD,sBAAsB,EAAE,KAAK,CAAC,QAAQ,CAAC,yBAG1B;QACb,wBAAwB,EAAE,KAAK,CAAC,QAAQ,CAAC,2BAI5B;QACb,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAGpB;QACb,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,oBAItB;QACb,wBAAwB,EAAE,KAAK,CAAC,QAAQ,CAAC,2BAA2B;KACrE,CAA0C,CAAC;AAC9C,CAAC,CAAC;AAxCW,QAAA,8BAA8B,kCAwCzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepoConfig.js","sourceRoot":"","sources":["../../../src/domain.operations/repoConfig/getRepoConfig.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,mDAAuE;AAIvE,
|
|
1
|
+
{"version":3,"file":"getRepoConfig.js","sourceRoot":"","sources":["../../../src/domain.operations/repoConfig/getRepoConfig.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,mDAAuE;AAIvE,sEAAmE;AAInE,qFAAkF;AAElF;;;GAGG;AACU,QAAA,aAAa,GAAG,IAAA,0BAAW,EACtC,KAAK,EACH,KAIC,EACD,OAA6C,EACU,EAAE;IACzD,2BAA2B;IAC3B,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE5C,2CAA2C;IAC3C,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE;QACrB,IAAI,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;YACpB,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI;aAC3B,CAAC;QACJ,CAAC;QAED,wCAAuB,CAAC,KAAK,CAAC,oCAAoC,EAAE;YAClE,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,EAAE,CAAC;IAEL,8BAA8B;IAC9B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;YACtC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;QACH,OAAO,IAAA,+DAA8B,EAAC;YACpC,QAAQ,EAAE,QAAQ,CAAC,IAAI;YACvB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAE3C,gCAAgC;QAChC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,IAAI,CAAC;QAErD,6CAA6C;QAC7C,MAAM,IAAI,6BAAY,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setRepoConfig.js","sourceRoot":"","sources":["../../../src/domain.operations/repoConfig/setRepoConfig.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,mDAA8C;AAI9C,
|
|
1
|
+
{"version":3,"file":"setRepoConfig.js","sourceRoot":"","sources":["../../../src/domain.operations/repoConfig/setRepoConfig.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,mDAA8C;AAI9C,sEAAmE;AAInE,qFAAkF;AAClF,mDAAgD;AAEhD;;;GAGG;AACU,QAA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AAkB,EAAE,OAAO,CAAC,gBAAgB;YAC5C,oBAAoB,EAAE,OAAO,CAAC,kBAAkB;YAChD,2BAA2B,EAAE,OAAO,CAAC,wBAAwB;SAC9D,CAAC,CAAC;QAEH,OAAO,IAAA,+DAA8B,EAAC;YACpC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC3C,MAAM,IAAI,6BAAY,CAAC,mCAAmC,EAAE;YAC1D,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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.
|
|
5
|
+
"version": "1.2.1",
|
|
6
6
|
"repository": "ehmpathy/declastruct-github",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/declastruct-github",
|
|
8
8
|
"keywords": [
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build:ts": "tsc -p ./tsconfig.build.json",
|
|
28
28
|
"commit:with-cli": "npx cz",
|
|
29
|
-
"fix:format:biome": "biome check --write
|
|
29
|
+
"fix:format:biome": "biome check --write",
|
|
30
30
|
"fix:format": "npm run fix:format:biome",
|
|
31
|
-
"fix:lint": "biome check --write
|
|
31
|
+
"fix:lint": "biome check --write",
|
|
32
32
|
"fix": "npm run fix:format && npm run fix:lint",
|
|
33
33
|
"build:clean": "rm dist/ -rf",
|
|
34
|
-
"build:compile": "tsc -p ./tsconfig.build.json",
|
|
35
|
-
"build": "npm run build:clean && npm run build:compile",
|
|
34
|
+
"build:compile": "tsc -p ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
|
|
35
|
+
"build": "npm run build:clean && npm run build:compile && npm run build:complete --if-present",
|
|
36
36
|
"test:commits": "LAST_TAG=$(git describe --tags --abbrev=0 @^ 2> /dev/null || git rev-list --max-parents=0 HEAD) && npx commitlint --from $LAST_TAG --to HEAD --verbose",
|
|
37
|
-
"test:types": "
|
|
37
|
+
"test:types": "tsc -p ./tsconfig.json --noEmit",
|
|
38
38
|
"test:format": "npm run test:format:biome",
|
|
39
39
|
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
40
|
-
"test:format:biome": "biome format
|
|
41
|
-
"test:lint:biome": "biome check
|
|
42
|
-
"test:lint:biome:all": "biome check
|
|
40
|
+
"test:format:biome": "biome format",
|
|
41
|
+
"test:lint:biome": "biome check --diagnostic-level=error",
|
|
42
|
+
"test:lint:biome:all": "biome check",
|
|
43
43
|
"test:lint": "npm run test:lint:biome && npm run test:lint:deps",
|
|
44
44
|
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
45
45
|
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
@@ -57,8 +57,9 @@
|
|
|
57
57
|
"@ehmpathy/uni-time": "1.7.4",
|
|
58
58
|
"@octokit/rest": "^21.0.0",
|
|
59
59
|
"as-procedure": "1.1.1",
|
|
60
|
-
"domain-objects": "0.31.
|
|
60
|
+
"domain-objects": "0.31.7",
|
|
61
61
|
"helpful-errors": "1.5.3",
|
|
62
|
+
"libsodium-wrappers": "^0.7.15",
|
|
62
63
|
"simple-in-memory-cache": "0.4.0",
|
|
63
64
|
"type-fns": "1.21.0",
|
|
64
65
|
"visualogic": "1.3.2",
|
|
@@ -74,12 +75,13 @@
|
|
|
74
75
|
"@tsconfig/node20": "20.1.5",
|
|
75
76
|
"@tsconfig/strictest": "2.0.5",
|
|
76
77
|
"@types/jest": "30.0.0",
|
|
78
|
+
"@types/libsodium-wrappers": "^0.7.14",
|
|
77
79
|
"@types/node": "22.15.21",
|
|
78
80
|
"cz-conventional-changelog": "3.3.0",
|
|
79
|
-
"declapract": "0.13.
|
|
80
|
-
"declapract-typescript-ehmpathy": "0.
|
|
81
|
+
"declapract": "0.13.1",
|
|
82
|
+
"declapract-typescript-ehmpathy": "0.45.5",
|
|
81
83
|
"declastruct": "1.7.0",
|
|
82
|
-
"declastruct-github": "1.0.
|
|
84
|
+
"declastruct-github": "1.0.7",
|
|
83
85
|
"depcheck": "1.4.3",
|
|
84
86
|
"esbuild-register": "3.6.0",
|
|
85
87
|
"husky": "8.0.3",
|
|
@@ -88,6 +90,7 @@
|
|
|
88
90
|
"rhachet-roles-ehmpathy": "1.13.3",
|
|
89
91
|
"simple-log-methods": "0.6.2",
|
|
90
92
|
"test-fns": "1.5.0",
|
|
93
|
+
"tsc-alias": "1.8.10",
|
|
91
94
|
"tsx": "4.20.6",
|
|
92
95
|
"typescript": "5.4.5"
|
|
93
96
|
},
|