@sparted/shared-library 1.0.8-alpha.3 → 1.0.8-alpha.4
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/github/github.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CreateGitTree, CreateGitBlob, CreateGitCommit, GetTreeByCommitSha, GetShaLastCommitOfBranch, RunNewCommitProcess } from './commit';
|
|
2
2
|
import { GetFileContent } from './content/get-file-content';
|
|
3
3
|
import { CreateBranch, UpdateBranch } from './branch';
|
|
4
|
+
import { CreateMergeRequest } from './merge';
|
|
4
5
|
export declare type GithubSdkArgs = {
|
|
5
6
|
owner: string;
|
|
6
7
|
repo: string;
|
|
@@ -16,6 +17,7 @@ export declare type GithubSdkInstance = {
|
|
|
16
17
|
getFileContent: GetFileContent;
|
|
17
18
|
createBranch: CreateBranch;
|
|
18
19
|
updateBranch: UpdateBranch;
|
|
20
|
+
createMergeRequest: CreateMergeRequest;
|
|
19
21
|
};
|
|
20
22
|
export declare type GithubSdk = (args: GithubSdkArgs) => GithubSdkInstance;
|
|
21
23
|
export declare const githubSdk: GithubSdk;
|
package/dist/github/github.js
CHANGED
|
@@ -12,6 +12,7 @@ var runNewCommitProcess = require('./commit/run-new-commit-process.js');
|
|
|
12
12
|
var getFileContent = require('./content/get-file-content.js');
|
|
13
13
|
var createBranch = require('./branch/create-branch.js');
|
|
14
14
|
var updateBranch = require('./branch/update-branch.js');
|
|
15
|
+
var createMergeRequest = require('./merge/create-merge-request.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
@@ -42,6 +43,7 @@ const githubSdk = (args) => {
|
|
|
42
43
|
});
|
|
43
44
|
const createBranch$1 = createBranch.createBranchFactory(instance);
|
|
44
45
|
const updateBranch$1 = updateBranch.updateBranchFactory(instance);
|
|
46
|
+
const createMergeRequest$1 = createMergeRequest.createMergeRequestFactory(instance);
|
|
45
47
|
return {
|
|
46
48
|
createGitBlob: createGitBlob$1,
|
|
47
49
|
createGitCommit: createGitCommit$1,
|
|
@@ -52,6 +54,7 @@ const githubSdk = (args) => {
|
|
|
52
54
|
getFileContent: getFileContent$1,
|
|
53
55
|
createBranch: createBranch$1,
|
|
54
56
|
updateBranch: updateBranch$1,
|
|
57
|
+
createMergeRequest: createMergeRequest$1,
|
|
55
58
|
};
|
|
56
59
|
};
|
|
57
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.js","sources":["../../src/github/github.ts"],"sourcesContent":["import axios from 'axios';\n\nimport {\n createGitBlobFactory,\n createGitCommitFactory,\n createGitTreeFactory,\n getShaLastCommitOfBranchFactory,\n getTreeByCommitShaFactory,\n runNewCommitProcessFactory,\n} from './commit';\nimport type {\n CreateGitTree,\n CreateGitBlob,\n CreateGitCommit,\n GetTreeByCommitSha,\n GetShaLastCommitOfBranch,\n RunNewCommitProcess,\n} from './commit';\nimport { GetFileContent, getFileContentFactory } from './content/get-file-content';\nimport { CreateBranch, UpdateBranch, createBranchFactory, updateBranchFactory } from './branch';\n\nexport type GithubSdkArgs = {\n owner: string;\n repo: string;\n token: string;\n};\n\nexport type GithubSdkInstance = {\n createGitBlob: CreateGitBlob;\n createGitCommit: CreateGitCommit;\n createGitTree: CreateGitTree;\n getShaLastCommitOfBranch: GetShaLastCommitOfBranch;\n getTreeByCommitSha: GetTreeByCommitSha;\n runNewCommitProcess: RunNewCommitProcess;\n getFileContent: GetFileContent;\n createBranch: CreateBranch;\n updateBranch: UpdateBranch;\n};\n\nexport type GithubSdk = (args: GithubSdkArgs) => GithubSdkInstance;\n\nexport const githubSdk: GithubSdk = (args) => {\n const { owner, repo, token } = args;\n\n const instance = axios.create({\n baseURL: `https://api.github.com/repos/${owner}/${repo}`,\n headers: {\n Accept: 'application/vnd.github+json',\n Authorization: `Bearer ${token}`,\n 'X-GitHub-Api-Version': '2022-11-28',\n },\n });\n\n const createGitBlob = createGitBlobFactory(instance);\n const createGitCommit = createGitCommitFactory(instance);\n const createGitTree = createGitTreeFactory(instance);\n const getShaLastCommitOfBranch = getShaLastCommitOfBranchFactory(instance);\n const getTreeByCommitSha = getTreeByCommitShaFactory(instance);\n\n const getFileContent = getFileContentFactory(instance);\n\n const runNewCommitProcess = runNewCommitProcessFactory({\n createGitBlob,\n createGitCommit,\n createGitTree,\n getShaLastCommitOfBranch,\n getTreeByCommitSha,\n });\n\n const createBranch = createBranchFactory(instance);\n const updateBranch = updateBranchFactory(instance);\n\n return {\n createGitBlob,\n createGitCommit,\n createGitTree,\n getShaLastCommitOfBranch,\n getTreeByCommitSha,\n runNewCommitProcess,\n getFileContent,\n createBranch,\n updateBranch,\n };\n};\n"],"names":["axios","createGitBlob","createGitBlobFactory","createGitCommit","createGitCommitFactory","createGitTree","createGitTreeFactory","getShaLastCommitOfBranch","getShaLastCommitOfBranchFactory","getTreeByCommitSha","getTreeByCommitShaFactory","getFileContent","getFileContentFactory","runNewCommitProcess","runNewCommitProcessFactory","createBranch","createBranchFactory","updateBranch","updateBranchFactory"],"mappings":"
|
|
1
|
+
{"version":3,"file":"github.js","sources":["../../src/github/github.ts"],"sourcesContent":["import axios from 'axios';\n\nimport {\n createGitBlobFactory,\n createGitCommitFactory,\n createGitTreeFactory,\n getShaLastCommitOfBranchFactory,\n getTreeByCommitShaFactory,\n runNewCommitProcessFactory,\n} from './commit';\nimport type {\n CreateGitTree,\n CreateGitBlob,\n CreateGitCommit,\n GetTreeByCommitSha,\n GetShaLastCommitOfBranch,\n RunNewCommitProcess,\n} from './commit';\nimport { GetFileContent, getFileContentFactory } from './content/get-file-content';\nimport { CreateBranch, UpdateBranch, createBranchFactory, updateBranchFactory } from './branch';\nimport { CreateMergeRequest, createMergeRequestFactory } from './merge';\n\nexport type GithubSdkArgs = {\n owner: string;\n repo: string;\n token: string;\n};\n\nexport type GithubSdkInstance = {\n createGitBlob: CreateGitBlob;\n createGitCommit: CreateGitCommit;\n createGitTree: CreateGitTree;\n getShaLastCommitOfBranch: GetShaLastCommitOfBranch;\n getTreeByCommitSha: GetTreeByCommitSha;\n runNewCommitProcess: RunNewCommitProcess;\n getFileContent: GetFileContent;\n createBranch: CreateBranch;\n updateBranch: UpdateBranch;\n createMergeRequest: CreateMergeRequest;\n};\n\nexport type GithubSdk = (args: GithubSdkArgs) => GithubSdkInstance;\n\nexport const githubSdk: GithubSdk = (args) => {\n const { owner, repo, token } = args;\n\n const instance = axios.create({\n baseURL: `https://api.github.com/repos/${owner}/${repo}`,\n headers: {\n Accept: 'application/vnd.github+json',\n Authorization: `Bearer ${token}`,\n 'X-GitHub-Api-Version': '2022-11-28',\n },\n });\n\n const createGitBlob = createGitBlobFactory(instance);\n const createGitCommit = createGitCommitFactory(instance);\n const createGitTree = createGitTreeFactory(instance);\n const getShaLastCommitOfBranch = getShaLastCommitOfBranchFactory(instance);\n const getTreeByCommitSha = getTreeByCommitShaFactory(instance);\n\n const getFileContent = getFileContentFactory(instance);\n\n const runNewCommitProcess = runNewCommitProcessFactory({\n createGitBlob,\n createGitCommit,\n createGitTree,\n getShaLastCommitOfBranch,\n getTreeByCommitSha,\n });\n\n const createBranch = createBranchFactory(instance);\n const updateBranch = updateBranchFactory(instance);\n\n const createMergeRequest = createMergeRequestFactory(instance);\n\n return {\n createGitBlob,\n createGitCommit,\n createGitTree,\n getShaLastCommitOfBranch,\n getTreeByCommitSha,\n runNewCommitProcess,\n getFileContent,\n createBranch,\n updateBranch,\n createMergeRequest,\n };\n};\n"],"names":["axios","createGitBlob","createGitBlobFactory","createGitCommit","createGitCommitFactory","createGitTree","createGitTreeFactory","getShaLastCommitOfBranch","getShaLastCommitOfBranchFactory","getTreeByCommitSha","getTreeByCommitShaFactory","getFileContent","getFileContentFactory","runNewCommitProcess","runNewCommitProcessFactory","createBranch","createBranchFactory","updateBranch","updateBranchFactory","createMergeRequest","createMergeRequestFactory"],"mappings":";;;;;;;;;;;;;;;;;;;;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Ae;uBACfE,eAAa;kCACbE,0BAAwB;4BACxBE,oBAAkB;6BAClBI,qBAAmB;wBACnBF,gBAAc;sBACdI,cAAY;sBACZE,cAAY;4BACZE,oBAAkB;KACnB,CAAC;AACJ;;;;"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
package/src/github/github.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
} from './commit';
|
|
19
19
|
import { GetFileContent, getFileContentFactory } from './content/get-file-content';
|
|
20
20
|
import { CreateBranch, UpdateBranch, createBranchFactory, updateBranchFactory } from './branch';
|
|
21
|
+
import { CreateMergeRequest, createMergeRequestFactory } from './merge';
|
|
21
22
|
|
|
22
23
|
export type GithubSdkArgs = {
|
|
23
24
|
owner: string;
|
|
@@ -35,6 +36,7 @@ export type GithubSdkInstance = {
|
|
|
35
36
|
getFileContent: GetFileContent;
|
|
36
37
|
createBranch: CreateBranch;
|
|
37
38
|
updateBranch: UpdateBranch;
|
|
39
|
+
createMergeRequest: CreateMergeRequest;
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export type GithubSdk = (args: GithubSdkArgs) => GithubSdkInstance;
|
|
@@ -70,6 +72,8 @@ export const githubSdk: GithubSdk = (args) => {
|
|
|
70
72
|
const createBranch = createBranchFactory(instance);
|
|
71
73
|
const updateBranch = updateBranchFactory(instance);
|
|
72
74
|
|
|
75
|
+
const createMergeRequest = createMergeRequestFactory(instance);
|
|
76
|
+
|
|
73
77
|
return {
|
|
74
78
|
createGitBlob,
|
|
75
79
|
createGitCommit,
|
|
@@ -80,5 +84,6 @@ export const githubSdk: GithubSdk = (args) => {
|
|
|
80
84
|
getFileContent,
|
|
81
85
|
createBranch,
|
|
82
86
|
updateBranch,
|
|
87
|
+
createMergeRequest,
|
|
83
88
|
};
|
|
84
89
|
};
|