@gitgov/core 2.1.2 → 2.3.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/README.md +70 -8
- package/dist/src/{agent_runner-ByOUWOt6.d.ts → agent_runner-D7JahEKk.d.ts} +8 -1198
- package/dist/src/fs.d.ts +34 -22
- package/dist/src/fs.js +66 -14
- package/dist/src/fs.js.map +1 -1
- package/dist/src/github.d.ts +473 -0
- package/dist/src/github.js +1281 -0
- package/dist/src/github.js.map +1 -0
- package/dist/src/{index--ahcnsG3.d.ts → index-Bhc341pf.d.ts} +6 -265
- package/dist/src/index.d.ts +54 -60
- package/dist/src/index.js +5048 -5047
- package/dist/src/index.js.map +1 -1
- package/dist/src/key_provider-CRpHFGjN.d.ts +227 -0
- package/dist/src/memory.d.ts +27 -5
- package/dist/src/memory.js +31 -2
- package/dist/src/memory.js.map +1 -1
- package/dist/src/{memory_file_lister-BkQ_C3ZU.d.ts → memory_file_lister-C978PA8g.d.ts} +2 -1
- package/dist/src/prisma.d.ts +71 -0
- package/dist/src/prisma.js +67 -0
- package/dist/src/prisma.js.map +1 -0
- package/dist/src/record_projection.types-B8AM7u8U.d.ts +1207 -0
- package/dist/src/record_store-BXKWqon5.d.ts +64 -0
- package/package.json +10 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { K as KeyProvider
|
|
1
|
+
import { K as KeyProvider } from './key_provider-CRpHFGjN.js';
|
|
2
|
+
import { g as FileLister, M as MemoryFileListerOptions, h as FileListOptions, i as FileStats } from './index-Bhc341pf.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* EnvKeyProvider - Environment variable-based KeyProvider implementation
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { a as IRecordProjection, b as IndexData, P as ProjectionContext } from './record_projection.types-B8AM7u8U.js';
|
|
2
|
+
import './record_store-BXKWqon5.js';
|
|
3
|
+
|
|
4
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
type ProjectionWhereUnique = {
|
|
8
|
+
repoId_projectionType: {
|
|
9
|
+
repoId: string;
|
|
10
|
+
projectionType: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type ProjectionRow = {
|
|
14
|
+
id: string;
|
|
15
|
+
repoId: string;
|
|
16
|
+
projectionType: string;
|
|
17
|
+
data: JsonValue;
|
|
18
|
+
lastCommitHash: string | null;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
};
|
|
22
|
+
type ProjectionDelegate = {
|
|
23
|
+
upsert(args: {
|
|
24
|
+
where: ProjectionWhereUnique;
|
|
25
|
+
create: {
|
|
26
|
+
repoId: string;
|
|
27
|
+
projectionType: string;
|
|
28
|
+
data: JsonValue;
|
|
29
|
+
lastCommitHash: string | null;
|
|
30
|
+
};
|
|
31
|
+
update: {
|
|
32
|
+
data: JsonValue;
|
|
33
|
+
lastCommitHash: string | null;
|
|
34
|
+
};
|
|
35
|
+
}): PromiseLike<unknown>;
|
|
36
|
+
findUnique(args: {
|
|
37
|
+
where: ProjectionWhereUnique;
|
|
38
|
+
select?: {
|
|
39
|
+
id: true;
|
|
40
|
+
};
|
|
41
|
+
}): PromiseLike<ProjectionRow | {
|
|
42
|
+
id: string;
|
|
43
|
+
} | null>;
|
|
44
|
+
deleteMany(args: {
|
|
45
|
+
where: {
|
|
46
|
+
repoId: string;
|
|
47
|
+
projectionType: string;
|
|
48
|
+
};
|
|
49
|
+
}): PromiseLike<unknown>;
|
|
50
|
+
};
|
|
51
|
+
type ProjectionClient = {
|
|
52
|
+
projection: ProjectionDelegate;
|
|
53
|
+
};
|
|
54
|
+
type PrismaRecordProjectionOptions = {
|
|
55
|
+
client: ProjectionClient;
|
|
56
|
+
repoId: string;
|
|
57
|
+
projectionType?: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare class PrismaRecordProjection implements IRecordProjection {
|
|
61
|
+
private readonly client;
|
|
62
|
+
private readonly repoId;
|
|
63
|
+
private readonly projectionType;
|
|
64
|
+
constructor(options: PrismaRecordProjectionOptions);
|
|
65
|
+
persist(data: IndexData, context: ProjectionContext): Promise<void>;
|
|
66
|
+
read(_context: ProjectionContext): Promise<IndexData | null>;
|
|
67
|
+
exists(_context: ProjectionContext): Promise<boolean>;
|
|
68
|
+
clear(_context: ProjectionContext): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { type JsonValue, PrismaRecordProjection, type PrismaRecordProjectionOptions, type ProjectionClient, type ProjectionDelegate };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/record_projection/prisma/prisma_record_projection.ts
|
|
2
|
+
var PrismaRecordProjection = class {
|
|
3
|
+
client;
|
|
4
|
+
repoId;
|
|
5
|
+
projectionType;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.client = options.client;
|
|
8
|
+
this.repoId = options.repoId;
|
|
9
|
+
this.projectionType = options.projectionType ?? "index";
|
|
10
|
+
}
|
|
11
|
+
async persist(data, context) {
|
|
12
|
+
await this.client.projection.upsert({
|
|
13
|
+
where: {
|
|
14
|
+
repoId_projectionType: {
|
|
15
|
+
repoId: this.repoId,
|
|
16
|
+
projectionType: this.projectionType
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
create: {
|
|
20
|
+
repoId: this.repoId,
|
|
21
|
+
projectionType: this.projectionType,
|
|
22
|
+
data: JSON.parse(JSON.stringify(data)),
|
|
23
|
+
lastCommitHash: context.lastCommitHash ?? null
|
|
24
|
+
},
|
|
25
|
+
update: {
|
|
26
|
+
data: JSON.parse(JSON.stringify(data)),
|
|
27
|
+
lastCommitHash: context.lastCommitHash ?? null
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async read(_context) {
|
|
32
|
+
const row = await this.client.projection.findUnique({
|
|
33
|
+
where: {
|
|
34
|
+
repoId_projectionType: {
|
|
35
|
+
repoId: this.repoId,
|
|
36
|
+
projectionType: this.projectionType
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
if (!row || !("data" in row)) return null;
|
|
41
|
+
return row.data;
|
|
42
|
+
}
|
|
43
|
+
async exists(_context) {
|
|
44
|
+
const row = await this.client.projection.findUnique({
|
|
45
|
+
where: {
|
|
46
|
+
repoId_projectionType: {
|
|
47
|
+
repoId: this.repoId,
|
|
48
|
+
projectionType: this.projectionType
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
select: { id: true }
|
|
52
|
+
});
|
|
53
|
+
return row !== null;
|
|
54
|
+
}
|
|
55
|
+
async clear(_context) {
|
|
56
|
+
await this.client.projection.deleteMany({
|
|
57
|
+
where: {
|
|
58
|
+
repoId: this.repoId,
|
|
59
|
+
projectionType: this.projectionType
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { PrismaRecordProjection };
|
|
66
|
+
//# sourceMappingURL=prisma.js.map
|
|
67
|
+
//# sourceMappingURL=prisma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/record_projection/prisma/prisma_record_projection.ts"],"names":[],"mappings":";AAGO,IAAM,yBAAN,MAA0D;AAAA,EAC9C,MAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EAEjB,YAAY,OAAA,EAAwC;AAClD,IAAA,IAAA,CAAK,SAAS,OAAA,CAAQ,MAAA;AACtB,IAAA,IAAA,CAAK,SAAS,OAAA,CAAQ,MAAA;AACtB,IAAA,IAAA,CAAK,cAAA,GAAiB,QAAQ,cAAA,IAAkB,OAAA;AAAA,EAClD;AAAA,EAEA,MAAM,OAAA,CAAQ,IAAA,EAAiB,OAAA,EAA2C;AACxE,IAAA,MAAM,IAAA,CAAK,MAAA,CAAO,UAAA,CAAW,MAAA,CAAO;AAAA,MAClC,KAAA,EAAO;AAAA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ACD,IAAA,OAAO,GAAA,KAAQ,IAAA;AAAA,EACjB;AAAA,EAEA,MAAM,MAAM,QAAA,EAA4C;AACtD,IAAA,MAAM,IAAA,CAAK,MAAA,CAAO,UAAA,CAAW,UAAA,CAAW;AAAA,MACtC,KAAA,EAAO;AAAA,QACL,QAAQ,IAAA,CAAK,MAAA;AAAA,QACb,gBAAgB,IAAA,CAAK;AAAA;AACvB,KACD,CAAA;AAAA,EACH;AACF","file":"prisma.js","sourcesContent":["import type { IRecordProjection, IndexData, ProjectionContext } from '../record_projection.types';\nimport type { JsonValue, ProjectionClient, PrismaRecordProjectionOptions } from './prisma_record_projection.types';\n\nexport class PrismaRecordProjection implements IRecordProjection {\n private readonly client: ProjectionClient;\n private readonly repoId: string;\n private readonly projectionType: string;\n\n constructor(options: PrismaRecordProjectionOptions) {\n this.client = options.client;\n this.repoId = options.repoId;\n this.projectionType = options.projectionType ?? 'index';\n }\n\n async persist(data: IndexData, context: ProjectionContext): Promise<void> {\n await this.client.projection.upsert({\n where: {\n repoId_projectionType: {\n repoId: this.repoId,\n projectionType: this.projectionType,\n },\n },\n create: {\n repoId: this.repoId,\n projectionType: this.projectionType,\n data: JSON.parse(JSON.stringify(data)) as JsonValue,\n lastCommitHash: context.lastCommitHash ?? null,\n },\n update: {\n data: JSON.parse(JSON.stringify(data)) as JsonValue,\n lastCommitHash: context.lastCommitHash ?? null,\n },\n });\n }\n\n async read(_context: ProjectionContext): Promise<IndexData | null> {\n const row = await this.client.projection.findUnique({\n where: {\n repoId_projectionType: {\n repoId: this.repoId,\n projectionType: this.projectionType,\n },\n },\n });\n if (!row || !('data' in row)) return null;\n return row.data as unknown as IndexData;\n }\n\n async exists(_context: ProjectionContext): Promise<boolean> {\n const row = await this.client.projection.findUnique({\n where: {\n repoId_projectionType: {\n repoId: this.repoId,\n projectionType: this.projectionType,\n },\n },\n select: { id: true },\n });\n return row !== null;\n }\n\n async clear(_context: ProjectionContext): Promise<void> {\n await this.client.projection.deleteMany({\n where: {\n repoId: this.repoId,\n projectionType: this.projectionType,\n },\n });\n }\n}\n"]}
|