@s-hirano-ist/s-scripts 4.0.1 → 4.1.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/dist/{chunk-XG6LAGZO.js → chunk-2PZXXOYG.js} +2 -2
- package/dist/{chunk-6ADTNHCK.js → chunk-7XX57D7G.js} +1 -1
- package/dist/{chunk-M275YZQP.js → chunk-DIG75T3J.js} +7 -1
- package/dist/{chunk-TK456CR2.js → chunk-FVK44UTM.js} +1 -1
- package/dist/chunk-IYGLKY27.js +11 -0
- package/dist/{chunk-AUD3PD6K.js → chunk-MNBEFEFR.js} +1 -1
- package/dist/{chunk-Q6QUV5VR.js → chunk-OCEV2QX3.js} +1 -1
- package/dist/fetch-articles.js +1 -1
- package/dist/fetch-books.js +1 -1
- package/dist/fetch-images.js +1 -1
- package/dist/fetch-notes.js +1 -1
- package/dist/ingest-articles.js +6 -3
- package/dist/ingest-books.js +2 -2
- package/dist/ingest-images.js +2 -2
- package/dist/ingest-notes.js +2 -2
- package/dist/reset-articles.js +2 -2
- package/dist/reset-books.js +2 -2
- package/dist/reset-images.js +2 -2
- package/dist/reset-notes.js +2 -2
- package/dist/revert-articles.js +2 -2
- package/dist/revert-books.js +2 -2
- package/dist/revert-images.js +2 -2
- package/dist/revert-notes.js +2 -2
- package/dist/update-json-articles.js +4 -1
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import_generated,
|
|
19
19
|
makeId,
|
|
20
20
|
withTransactionRetry
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-DIG75T3J.js";
|
|
22
22
|
import {
|
|
23
23
|
createPushoverService
|
|
24
24
|
} from "./chunk-7PVU2Z32.js";
|
|
@@ -222,7 +222,7 @@ var Quote = z4.string().max(512, { message: "tooLong" }).nullable().optional().b
|
|
|
222
222
|
var Url = z4.url({ message: "invalidFormat" }).min(1, { message: "required" }).max(1024, { message: "tooLong" }).refine(isValidHttpUrl, { message: "invalidFormat" }).brand();
|
|
223
223
|
var OgTitle = z4.string().max(512, { message: "tooLong" }).nullable().optional().brand();
|
|
224
224
|
var OgDescription = z4.string().max(1024, { message: "tooLong" }).nullable().optional().brand();
|
|
225
|
-
var OgImageUrl = z4.string().max(
|
|
225
|
+
var OgImageUrl = z4.string().max(4096, { message: "tooLong" }).refine(isValidHttpUrl, { message: "invalidFormat" }).nullable().optional().brand();
|
|
226
226
|
var Base2 = z4.object({
|
|
227
227
|
id: Id,
|
|
228
228
|
userId: UserId,
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
2
2
|
import {
|
|
3
3
|
makeExportedAt,
|
|
4
4
|
withTransactionRetry
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DIG75T3J.js";
|
|
6
6
|
|
|
7
7
|
// ../application/dist/batch/notes-batch-service.js
|
|
8
8
|
var NotesBatchApplicationService = class {
|
|
@@ -7673,7 +7673,9 @@ function createPrismaClient(databaseUrl) {
|
|
|
7673
7673
|
max: 5,
|
|
7674
7674
|
idleTimeoutMillis: 3e4,
|
|
7675
7675
|
connectionTimeoutMillis: 1e4
|
|
7676
|
-
})
|
|
7676
|
+
}),
|
|
7677
|
+
// Allow cloud connection establishment to finish before acquisition times out.
|
|
7678
|
+
transactionOptions: { maxWait: 1e4 }
|
|
7677
7679
|
});
|
|
7678
7680
|
}
|
|
7679
7681
|
var SERIALIZATION_RETRY_CODES = /* @__PURE__ */ new Set(["40001", "P2034"]);
|
|
@@ -7685,6 +7687,10 @@ function isRetryableTransactionError(error) {
|
|
|
7685
7687
|
const wrapped = current;
|
|
7686
7688
|
if (typeof wrapped.code === "string" && SERIALIZATION_RETRY_CODES.has(wrapped.code))
|
|
7687
7689
|
return true;
|
|
7690
|
+
if (wrapped.code === "P2028" && typeof wrapped.message === "string" && wrapped.message.includes(
|
|
7691
|
+
"Transaction API error: Unable to start a transaction in the given time."
|
|
7692
|
+
))
|
|
7693
|
+
return true;
|
|
7688
7694
|
current = wrapped.cause;
|
|
7689
7695
|
}
|
|
7690
7696
|
return false;
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
2
2
|
import {
|
|
3
3
|
makeExportedAt,
|
|
4
4
|
withTransactionRetry
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DIG75T3J.js";
|
|
6
6
|
|
|
7
7
|
// ../application/dist/batch/images-batch-service.js
|
|
8
8
|
var ImagesBatchApplicationService = class {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __cliCreateRequire } from "node:module"; const require = __cliCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/lib/article-og-image-url.ts
|
|
4
|
+
function resolveArticleOgImageUrl(value, articleUrl) {
|
|
5
|
+
if (value === null || value === void 0 || value.trim() === "") return null;
|
|
6
|
+
return URL.canParse(value) ? value : new URL(value, articleUrl).href;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
resolveArticleOgImageUrl
|
|
11
|
+
};
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
2
2
|
import {
|
|
3
3
|
makeExportedAt,
|
|
4
4
|
withTransactionRetry
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DIG75T3J.js";
|
|
6
6
|
|
|
7
7
|
// ../application/dist/batch/books-batch-service.js
|
|
8
8
|
var BooksBatchApplicationService = class {
|
|
@@ -2,7 +2,7 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
2
2
|
import {
|
|
3
3
|
makeExportedAt,
|
|
4
4
|
withTransactionRetry
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DIG75T3J.js";
|
|
6
6
|
|
|
7
7
|
// ../application/dist/batch/articles-batch-service.js
|
|
8
8
|
var ArticlesBatchApplicationService = class {
|
package/dist/fetch-articles.js
CHANGED
package/dist/fetch-books.js
CHANGED
package/dist/fetch-images.js
CHANGED
package/dist/fetch-notes.js
CHANGED
package/dist/ingest-articles.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cliCreateRequire } from "node:module"; const require = __cliCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
resolveArticleOgImageUrl
|
|
5
|
+
} from "./chunk-IYGLKY27.js";
|
|
3
6
|
import {
|
|
4
7
|
runContentImport
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2PZXXOYG.js";
|
|
6
9
|
import "./chunk-KKZP7ZF3.js";
|
|
7
10
|
import "./chunk-F4J6JBR4.js";
|
|
8
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-DIG75T3J.js";
|
|
9
12
|
import "./chunk-7PVU2Z32.js";
|
|
10
13
|
import {
|
|
11
14
|
globPaths
|
|
@@ -25,7 +28,7 @@ async function* source(root) {
|
|
|
25
28
|
quote: item.quote ?? null,
|
|
26
29
|
ogTitle: item.ogTitle ?? null,
|
|
27
30
|
ogDescription: item.ogDescription ?? null,
|
|
28
|
-
ogImageUrl: item.ogImageUrl
|
|
31
|
+
ogImageUrl: resolveArticleOgImageUrl(item.ogImageUrl, item.url)
|
|
29
32
|
}
|
|
30
33
|
};
|
|
31
34
|
}
|
package/dist/ingest-books.js
CHANGED
|
@@ -3,10 +3,10 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
makeISBN,
|
|
5
5
|
runContentImport
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2PZXXOYG.js";
|
|
7
7
|
import "./chunk-KKZP7ZF3.js";
|
|
8
8
|
import "./chunk-F4J6JBR4.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-DIG75T3J.js";
|
|
10
10
|
import "./chunk-7PVU2Z32.js";
|
|
11
11
|
import {
|
|
12
12
|
parseMarkdownFrontmatter
|
package/dist/ingest-images.js
CHANGED
|
@@ -3,10 +3,10 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
runContentImport,
|
|
5
5
|
sharpImageProcessor
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2PZXXOYG.js";
|
|
7
7
|
import "./chunk-KKZP7ZF3.js";
|
|
8
8
|
import "./chunk-F4J6JBR4.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-DIG75T3J.js";
|
|
10
10
|
import "./chunk-7PVU2Z32.js";
|
|
11
11
|
import {
|
|
12
12
|
globPaths
|
package/dist/ingest-notes.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { createRequire as __cliCreateRequire } from "node:module"; const require = __cliCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
runContentImport
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2PZXXOYG.js";
|
|
6
6
|
import "./chunk-KKZP7ZF3.js";
|
|
7
7
|
import "./chunk-F4J6JBR4.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-DIG75T3J.js";
|
|
9
9
|
import "./chunk-7PVU2Z32.js";
|
|
10
10
|
import {
|
|
11
11
|
parseMarkdownFrontmatter
|
package/dist/reset-articles.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
ArticlesBatchApplicationService,
|
|
5
5
|
createArticlesCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OCEV2QX3.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
package/dist/reset-books.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
BooksBatchApplicationService,
|
|
5
5
|
createBooksCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MNBEFEFR.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
package/dist/reset-images.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
ImagesBatchApplicationService,
|
|
5
5
|
createImagesCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FVK44UTM.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
package/dist/reset-notes.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
NotesBatchApplicationService,
|
|
5
5
|
createNotesCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7XX57D7G.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
package/dist/revert-articles.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
ArticlesBatchApplicationService,
|
|
5
5
|
createArticlesCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OCEV2QX3.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
package/dist/revert-books.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
BooksBatchApplicationService,
|
|
5
5
|
createBooksCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MNBEFEFR.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
package/dist/revert-images.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
ImagesBatchApplicationService,
|
|
5
5
|
createImagesCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FVK44UTM.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
package/dist/revert-notes.js
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
NotesBatchApplicationService,
|
|
5
5
|
createNotesCommandRepository
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7XX57D7G.js";
|
|
7
7
|
import {
|
|
8
8
|
createPrismaClient,
|
|
9
9
|
makeUserId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DIG75T3J.js";
|
|
11
11
|
import {
|
|
12
12
|
createPushoverService
|
|
13
13
|
} from "./chunk-7PVU2Z32.js";
|
|
@@ -3,6 +3,9 @@ import { createRequire as __cliCreateRequire } from "node:module"; const require
|
|
|
3
3
|
import {
|
|
4
4
|
decodeHtml
|
|
5
5
|
} from "./chunk-UXGLXHQ6.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveArticleOgImageUrl
|
|
8
|
+
} from "./chunk-IYGLKY27.js";
|
|
6
9
|
import {
|
|
7
10
|
createPushoverService
|
|
8
11
|
} from "./chunk-7PVU2Z32.js";
|
|
@@ -35,7 +38,7 @@ async function getOgTags(url) {
|
|
|
35
38
|
ogTags[property] = content;
|
|
36
39
|
}
|
|
37
40
|
});
|
|
38
|
-
const ogImageUrl = ogTags["og:image"];
|
|
41
|
+
const ogImageUrl = resolveArticleOgImageUrl(ogTags["og:image"], response.url || url) ?? void 0;
|
|
39
42
|
const ogTitle = ogTags["og:title"];
|
|
40
43
|
const ogDescription = ogTags["og:description"];
|
|
41
44
|
return { ogImageUrl, ogTitle, ogDescription };
|