@pierre/storage 1.0.0 → 1.0.2
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 +2 -0
- package/dist/index.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -8
- package/dist/index.d.ts +37 -8
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +7 -1
- package/src/schemas.ts +2 -0
- package/src/types.ts +3 -0
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -122,7 +122,9 @@ var diffFileRawSchema = zod.z.object({
|
|
|
122
122
|
old_path: zod.z.string().nullable().optional(),
|
|
123
123
|
raw: zod.z.string(),
|
|
124
124
|
bytes: zod.z.number(),
|
|
125
|
-
is_eof: zod.z.boolean()
|
|
125
|
+
is_eof: zod.z.boolean(),
|
|
126
|
+
additions: zod.z.number().optional(),
|
|
127
|
+
deletions: zod.z.number().optional()
|
|
126
128
|
});
|
|
127
129
|
var filteredFileRawSchema = zod.z.object({
|
|
128
130
|
path: zod.z.string(),
|
|
@@ -512,7 +514,7 @@ function concatChunks(a, b) {
|
|
|
512
514
|
|
|
513
515
|
// package.json
|
|
514
516
|
var package_default = {
|
|
515
|
-
version: "1.0.
|
|
517
|
+
version: "1.0.2"};
|
|
516
518
|
|
|
517
519
|
// src/version.ts
|
|
518
520
|
var PACKAGE_NAME = "code-storage-sdk";
|
|
@@ -1598,7 +1600,9 @@ function transformFileDiff(raw) {
|
|
|
1598
1600
|
oldPath: raw.old_path ?? void 0,
|
|
1599
1601
|
raw: raw.raw,
|
|
1600
1602
|
bytes: raw.bytes,
|
|
1601
|
-
isEof: raw.is_eof
|
|
1603
|
+
isEof: raw.is_eof,
|
|
1604
|
+
additions: raw.additions ?? 0,
|
|
1605
|
+
deletions: raw.deletions ?? 0
|
|
1602
1606
|
};
|
|
1603
1607
|
}
|
|
1604
1608
|
function transformFilteredFile(raw) {
|
|
@@ -1750,9 +1754,10 @@ async function parseNoteWriteResponse(response, method) {
|
|
|
1750
1754
|
});
|
|
1751
1755
|
}
|
|
1752
1756
|
var RepoImpl = class {
|
|
1753
|
-
constructor(id, defaultBranch, options, generateJWT) {
|
|
1757
|
+
constructor(id, defaultBranch, createdAt, options, generateJWT) {
|
|
1754
1758
|
this.id = id;
|
|
1755
1759
|
this.defaultBranch = defaultBranch;
|
|
1760
|
+
this.createdAt = createdAt;
|
|
1756
1761
|
this.options = options;
|
|
1757
1762
|
this.generateJWT = generateJWT;
|
|
1758
1763
|
this.api = getApiInstance(
|
|
@@ -2416,6 +2421,7 @@ var GitStorage = class _GitStorage {
|
|
|
2416
2421
|
return new RepoImpl(
|
|
2417
2422
|
repoId,
|
|
2418
2423
|
resolvedDefaultBranch ?? "main",
|
|
2424
|
+
(/* @__PURE__ */ new Date()).toISOString(),
|
|
2419
2425
|
this.options,
|
|
2420
2426
|
this.generateJWT.bind(this)
|
|
2421
2427
|
);
|
|
@@ -2463,9 +2469,11 @@ var GitStorage = class _GitStorage {
|
|
|
2463
2469
|
}
|
|
2464
2470
|
const body = await resp.json();
|
|
2465
2471
|
const defaultBranch = body.default_branch ?? "main";
|
|
2472
|
+
const createdAt = body.created_at ?? "";
|
|
2466
2473
|
return new RepoImpl(
|
|
2467
2474
|
options.id,
|
|
2468
2475
|
defaultBranch,
|
|
2476
|
+
createdAt,
|
|
2469
2477
|
this.options,
|
|
2470
2478
|
this.generateJWT.bind(this)
|
|
2471
2479
|
);
|