nippotion 0.1.0 → 0.1.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/dist/cli.js +5 -5
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -124,7 +124,7 @@ var t = i18next.t.bind(i18next);
|
|
|
124
124
|
var i18n_default = i18next;
|
|
125
125
|
|
|
126
126
|
// src/main.ts
|
|
127
|
-
import
|
|
127
|
+
import notion2 from "@notionhq/client";
|
|
128
128
|
import { WebClient } from "@slack/web-api";
|
|
129
129
|
import dayjs from "dayjs";
|
|
130
130
|
import utc from "dayjs/plugin/utc.js";
|
|
@@ -304,7 +304,7 @@ var loadConfig = (filePath) => {
|
|
|
304
304
|
var resolveConfigPath = () => resolve(process.cwd(), process.env.NIPPOTION_CONFIG ?? "nippotion.json");
|
|
305
305
|
|
|
306
306
|
// src/notion.ts
|
|
307
|
-
import
|
|
307
|
+
import notion from "@notionhq/client";
|
|
308
308
|
|
|
309
309
|
// src/retry.ts
|
|
310
310
|
import pRetry from "p-retry";
|
|
@@ -394,7 +394,7 @@ var getDatabaseInfo = async (client, dataSourceId, requiredProperties) => withRe
|
|
|
394
394
|
};
|
|
395
395
|
});
|
|
396
396
|
var getAllPages = async (client, dataSourceId, filter, filterProperties) => {
|
|
397
|
-
const results = await collectPaginatedAPI(
|
|
397
|
+
const results = await notion.collectPaginatedAPI(
|
|
398
398
|
(args) => withRetry(() => client.dataSources.query(args)),
|
|
399
399
|
{
|
|
400
400
|
data_source_id: dataSourceId,
|
|
@@ -402,7 +402,7 @@ var getAllPages = async (client, dataSourceId, filter, filterProperties) => {
|
|
|
402
402
|
filter_properties: filterProperties
|
|
403
403
|
}
|
|
404
404
|
);
|
|
405
|
-
return results.filter(isFullPage);
|
|
405
|
+
return results.filter(notion.isFullPage);
|
|
406
406
|
};
|
|
407
407
|
var editGapMs = (page) => {
|
|
408
408
|
const gap = Date.parse(page.last_edited_time) - Date.parse(page.created_time);
|
|
@@ -583,7 +583,7 @@ var main = async () => {
|
|
|
583
583
|
if (config.language) await i18n_default.changeLanguage(config.language);
|
|
584
584
|
const today = config.timezone ? dayjs().tz(config.timezone) : dayjs();
|
|
585
585
|
if (isWeekendOrHoliday(today, config.holidays)) return;
|
|
586
|
-
const client = new
|
|
586
|
+
const client = new notion2.Client({
|
|
587
587
|
auth: process.env.NOTION_API_TOKEN,
|
|
588
588
|
timeoutMs: 12e4
|
|
589
589
|
// extended from the 60s default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nippotion",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Deliver daily reports written in Notion to Slack channels based on their labels",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@eslint/js": "10.0.1",
|
|
27
27
|
"@types/node": "^26.1.1",
|
|
28
|
-
"eslint": "10.
|
|
28
|
+
"eslint": "10.11.0",
|
|
29
29
|
"tsup": "8.5.1",
|
|
30
30
|
"tsx": "^4.22.4",
|
|
31
31
|
"typescript": "^6.0.3",
|
|
32
|
-
"typescript-eslint": "8.
|
|
33
|
-
"vitest": "^
|
|
32
|
+
"typescript-eslint": "8.70.1",
|
|
33
|
+
"vitest": "^5.0.0"
|
|
34
34
|
},
|
|
35
35
|
"overrides": {
|
|
36
36
|
"brace-expansion@1": "^5.0.8",
|