@invect/version-control 0.0.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/LICENSE +21 -0
- package/dist/backend/flow-serializer.d.ts +38 -0
- package/dist/backend/flow-serializer.d.ts.map +1 -0
- package/dist/backend/git-provider.d.ts +77 -0
- package/dist/backend/git-provider.d.ts.map +1 -0
- package/dist/backend/github-provider.d.ts +14 -0
- package/dist/backend/github-provider.d.ts.map +1 -0
- package/dist/backend/index.cjs +1045 -0
- package/dist/backend/index.cjs.map +1 -0
- package/dist/backend/index.d.cts +51 -0
- package/dist/backend/index.d.cts.map +1 -0
- package/dist/backend/index.d.mts +51 -0
- package/dist/backend/index.d.mts.map +1 -0
- package/dist/backend/index.d.ts +5 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.mjs +1043 -0
- package/dist/backend/index.mjs.map +1 -0
- package/dist/backend/plugin.d.ts +24 -0
- package/dist/backend/plugin.d.ts.map +1 -0
- package/dist/backend/schema.d.ts +3 -0
- package/dist/backend/schema.d.ts.map +1 -0
- package/dist/backend/sync-service.d.ts +47 -0
- package/dist/backend/sync-service.d.ts.map +1 -0
- package/dist/backend/types.d.ts +20 -0
- package/dist/backend/types.d.ts.map +1 -0
- package/dist/frontend/index.cjs +0 -0
- package/dist/frontend/index.d.cts +2 -0
- package/dist/frontend/index.d.mts +2 -0
- package/dist/frontend/index.d.ts +2 -0
- package/dist/frontend/index.d.ts.map +1 -0
- package/dist/frontend/index.mjs +1 -0
- package/dist/git-provider-BD8MMEXB.d.mts +80 -0
- package/dist/git-provider-BD8MMEXB.d.mts.map +1 -0
- package/dist/git-provider-CjMtpb86.d.cts +80 -0
- package/dist/git-provider-CjMtpb86.d.cts.map +1 -0
- package/dist/providers/github.cjs +191 -0
- package/dist/providers/github.cjs.map +1 -0
- package/dist/providers/github.d.cts +17 -0
- package/dist/providers/github.d.cts.map +1 -0
- package/dist/providers/github.d.mts +17 -0
- package/dist/providers/github.d.mts.map +1 -0
- package/dist/providers/github.d.ts +2 -0
- package/dist/providers/github.d.ts.map +1 -0
- package/dist/providers/github.mjs +190 -0
- package/dist/providers/github.mjs.map +1 -0
- package/dist/shared/types.cjs +0 -0
- package/dist/shared/types.d.cts +2 -0
- package/dist/shared/types.d.mts +2 -0
- package/dist/shared/types.d.ts +77 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.mjs +1 -0
- package/dist/types-B32wGtx7.d.cts +80 -0
- package/dist/types-B32wGtx7.d.cts.map +1 -0
- package/dist/types-B7fFBAOX.d.mts +80 -0
- package/dist/types-B7fFBAOX.d.mts.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 @robase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializes an InvectDefinition to a readable .flow.ts file.
|
|
3
|
+
*
|
|
4
|
+
* The output uses the Option A (declarative) format from the SDK plan:
|
|
5
|
+
* defineFlow({ name, nodes: [...], edges: [...] })
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This is a standalone serializer — it doesn't depend on the SDK being
|
|
8
|
+
* implemented yet. It generates the .flow.ts text directly from the definition JSON.
|
|
9
|
+
* When the SDK ships, this will import the actual helpers instead.
|
|
10
|
+
*/
|
|
11
|
+
export declare function serializeFlowToTs(definition: FlowDefinitionJson, metadata: {
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
tags?: string[];
|
|
15
|
+
}): string;
|
|
16
|
+
interface FlowDefinitionJson {
|
|
17
|
+
nodes: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
type: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
referenceId?: string;
|
|
22
|
+
position?: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
params: Record<string, unknown>;
|
|
27
|
+
mapper?: Record<string, unknown>;
|
|
28
|
+
}>;
|
|
29
|
+
edges: Array<{
|
|
30
|
+
id: string;
|
|
31
|
+
source: string;
|
|
32
|
+
target: string;
|
|
33
|
+
sourceHandle?: string;
|
|
34
|
+
targetHandle?: string;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=flow-serializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-serializer.d.ts","sourceRoot":"","sources":["../../src/backend/flow-serializer.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,kBAAkB,EAC9B,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAChE,MAAM,CA0ER;AAMD,UAAU,kBAAkB;IAC1B,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,CAAC,CAAC;IACH,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** Result of fetching a file from the remote */
|
|
2
|
+
export interface GitFileContent {
|
|
3
|
+
content: string;
|
|
4
|
+
sha: string;
|
|
5
|
+
}
|
|
6
|
+
/** Result of creating/updating a file on the remote */
|
|
7
|
+
export interface GitCommitResult {
|
|
8
|
+
commitSha: string;
|
|
9
|
+
}
|
|
10
|
+
/** Branch info */
|
|
11
|
+
export interface GitBranchInfo {
|
|
12
|
+
sha: string;
|
|
13
|
+
}
|
|
14
|
+
/** Pull request / merge request creation options */
|
|
15
|
+
export interface CreatePullRequestOptions {
|
|
16
|
+
title: string;
|
|
17
|
+
body: string;
|
|
18
|
+
head: string;
|
|
19
|
+
base: string;
|
|
20
|
+
draft?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Pull request / merge request result */
|
|
23
|
+
export interface GitPullRequestResult {
|
|
24
|
+
number: number;
|
|
25
|
+
url: string;
|
|
26
|
+
}
|
|
27
|
+
/** Pull request / merge request info */
|
|
28
|
+
export interface GitPullRequestInfo {
|
|
29
|
+
state: 'open' | 'closed' | 'merged';
|
|
30
|
+
mergedAt?: string;
|
|
31
|
+
}
|
|
32
|
+
/** File update options */
|
|
33
|
+
export interface GitFileUpdateOptions {
|
|
34
|
+
branch: string;
|
|
35
|
+
sha?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Abstraction over a Git hosting provider (GitHub, GitLab, Bitbucket).
|
|
39
|
+
*
|
|
40
|
+
* All methods operate on a specific repo (owner/name string).
|
|
41
|
+
* The provider handles authentication internally.
|
|
42
|
+
*/
|
|
43
|
+
export interface GitProvider {
|
|
44
|
+
/** Provider identifier, e.g. 'github', 'gitlab', 'bitbucket' */
|
|
45
|
+
readonly id: string;
|
|
46
|
+
/** Human-readable name */
|
|
47
|
+
readonly name: string;
|
|
48
|
+
/** Get file content at a specific ref (branch/SHA). Returns null if file doesn't exist. */
|
|
49
|
+
getFileContent(repo: string, path: string, ref?: string): Promise<GitFileContent | null>;
|
|
50
|
+
/** Create or update a file. If sha is provided, it's an update (must match current SHA for conflict detection). */
|
|
51
|
+
createOrUpdateFile(repo: string, path: string, content: string, message: string, opts: GitFileUpdateOptions): Promise<GitCommitResult>;
|
|
52
|
+
/** Delete a file from the repo. */
|
|
53
|
+
deleteFile(repo: string, path: string, message: string, opts: {
|
|
54
|
+
branch: string;
|
|
55
|
+
sha: string;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
/** Create a new branch from a ref (branch name or SHA). */
|
|
58
|
+
createBranch(repo: string, branch: string, fromRef: string): Promise<void>;
|
|
59
|
+
/** Delete a branch. */
|
|
60
|
+
deleteBranch(repo: string, branch: string): Promise<void>;
|
|
61
|
+
/** Get branch info. Returns null if branch doesn't exist. */
|
|
62
|
+
getBranch(repo: string, branch: string): Promise<GitBranchInfo | null>;
|
|
63
|
+
/** Create a PR/MR. */
|
|
64
|
+
createPullRequest(repo: string, opts: CreatePullRequestOptions): Promise<GitPullRequestResult>;
|
|
65
|
+
/** Update an existing PR/MR title/body. */
|
|
66
|
+
updatePullRequest(repo: string, number: number, opts: {
|
|
67
|
+
title?: string;
|
|
68
|
+
body?: string;
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
/** Get PR/MR status. */
|
|
71
|
+
getPullRequest(repo: string, number: number): Promise<GitPullRequestInfo>;
|
|
72
|
+
/** Close a PR/MR with an optional comment. */
|
|
73
|
+
closePullRequest(repo: string, number: number, comment?: string): Promise<void>;
|
|
74
|
+
/** Verify a webhook signature. Returns true if valid. */
|
|
75
|
+
verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=git-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-provider.d.ts","sourceRoot":"","sources":["../../src/backend/git-provider.ts"],"names":[],"mappings":"AAIA,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,kBAAkB;AAClB,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC,MAAM,E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G,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D,6DAA6D;IAC7D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAIvE,sBAAsB;IACtB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE/F,2CAA2C;IAC3C,iBAAiB,CACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GACtC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,wBAAwB;IACxB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE1E,8CAA8C;IAC9C,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAIhF,yDAAyD;IACzD,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACrF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GitProvider } from './git-provider';
|
|
2
|
+
import type { GitProviderAuth } from '../shared/types';
|
|
3
|
+
interface GitHubProviderOptions {
|
|
4
|
+
auth: GitProviderAuth;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Create a GitHub provider instance.
|
|
8
|
+
*
|
|
9
|
+
* Uses the GitHub REST API directly (no Octokit dependency).
|
|
10
|
+
* Supports PAT, GitHub App, and Invect credential-based auth.
|
|
11
|
+
*/
|
|
12
|
+
export declare function githubProvider(options: GitHubProviderOptions): GitProvider;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=github-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-provider.d.ts","sourceRoot":"","sources":["../../src/backend/github-provider.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAMV,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CA0S1E"}
|