Open olgabot opened 2 years ago
(EDIT: hit enter too soon)
Update:
The articles:sync
command seems to somewhat work, but gives the validation error Authors is expected to be relation
.
First, I see an error that both the field "Title" doesn't exist and Authors is expected to be relation
:
But the Authors
property is a relation! So I am very confused.
I stopped that process with Ctrl-C to try authors:sync
and got the same error message of: Error: You don't have an Authors database. Exiting.
(paperpile-notion)
✘ Mon 17 Oct - 11:27 ~/code/sync-paperpile-to-notion origin ☊ main 1●
paperpile-notion authors:sync references.bib -c .config/paperpile-notion/config.js
Found 4960 entries
› Error: You don't have an Authors database. Exiting.
And then I try to clean the articles
database and I think it's assuming the Authors
relation is multi_select
instead of relation
! So how is it both? I'm very confused...
(paperpile-notion)
✘ Mon 17 Oct - 11:32 ~/code/sync-paperpile-to-notion origin ☊ main ↓1 1●
paperpile-notion articles:sync references.bib -c .config/paperpile-notion/config.js
Found 4960 entries
^C
(paperpile-notion) $(aws_prompt_info)
(paperpile-notion) paperpile-notion articles:clean references.bib -c .config/paperpile-notion/config.js $(aws_prompt_info)
Found 4960 entries
Removing Articles with no Authors.
APIResponseError: The property type in the database does not match the property type of the filter provided: database property relation does not match
filter multi_select
Code: validation_error
Hello, Hope you're doing well. I got some help from a typescript-y friend on how to install the code locally. For those interested, I did:
(paperpile-notion)
♥ 97% Mon 17 Oct - 20:13 ~/code/jmuchovej--paperpile-notion origin ☊ main 3●
npm i -g yarn
added 1 package, and audited 2 packages in 2s
found 0 vulnerabilities
yarn
to install the package(paperpile-notion)
♥ 97% Mon 17 Oct - 20:13 ~/code/jmuchovej--paperpile-notion origin ☊ main 3●
yarn install
zsh: correct 'yarn' to 'tar' [nyae]? n
yarn install v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
[3/5] 🚚 Fetching packages...
error https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz: Integrity check failed for "whatwg-url" (computed integrity doesn't match our records, got "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== sha1-lmRU6HZUYuN2RNNib2dCzotwll0=")
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Then if you edit the code, you will need to recompile with yarn build
(paperpile-notion)
Tue 18 Oct - 20:23 ~/code/jmuchovej--paperpile-notion origin ☊ main 4●
yarn build
yarn run v1.22.19
$ shx rm -rf dist && tsc -b
✨ Done in 5.01s.
Authors
database isn't workingHere's the code in config.ts
with a lot more print statements. What I'm really confused is that the type of authors
and articles
is both object
and yet _.isString
only seems to be true for Articles
for me?
console.log("Authors:")
console.log(authors)
console.log(typeof authors)
console.log("Articles:")
console.log(articles)
if (_.isString(authors)) {
console.log("Authors is string")
let dbID: string = isValidPageID(authors) ?? await getDBbyName(notion, authors)
databases.authors = <AuthorsDB>{
databaseID: <string>dbID,
articleRef: "Articles",
primaryKey: "name",
}
}
if (_.isString(articles)) {
let dbID: string = isValidPageID(articles) ?? await getDBbyName(notion, articles)
databases.articles = <ArticlesDB>{
databaseID: <string>dbID,
authorRef: "Authors",
primaryKey: "ID",
}
}
console.log("_.isString(databases.articles)")
console.log(_.isString(databases.articles))
console.log("_.isString(databases.authors)")
console.log(_.isString(databases.authors))
This is the output I get:
(paperpile-notion)
✘ ♥ 83% Mon 17 Oct - 20:30 ~/code/sync-paperpile-to-notion origin ☊ main ↓8 3☀ 1●
~/code/jmuchovej--paperpile-notion/bin/run authors:sync references.bib -c .config/paperpile-notion/config.js
Authors:
{
databaseID: 'e099196d94ab4ff1913a597fff33e8a2',
articleRef: 'Articles'
}
object
Articles:
{
databaseID: 'bf32a3bfe5474dc7895a6bf4dacf1a11',
authorRef: 'Authors'
}
_.isString(databases.articles)
false
_.isString(databases.authors)
false
Found 4960 entries
› Error: You don't have an Authors database. Exiting.
What is even MORE confusing now is that now somehow after adding console.log(typeof articles)
, authors:sync
is working?
(paperpile-notion)
✘ Tue 18 Oct - 20:23 ~/code/sync-paperpile-to-notion origin ☊ main ↓8 3☀ 1●
~/code/jmuchovej--paperpile-notion/bin/run authors:sync references.bib -c .config/paperpile-notion/config.js
Authors:
{
databaseID: 'e099196d94ab4ff1913a597fff33e8a2',
articleRef: 'Articles'
}
object
Articles:
{
databaseID: 'bf32a3bfe5474dc7895a6bf4dacf1a11',
authorRef: 'Authors'
}
object
_.isString(databases.articles)
false
_.isString(databases.authors)
false
Found 4960 entries
But I'm not seeing my test string of "Authors is string" getting printed.
Let me know if you have any updates! Thank you so much. Warmest, Olga
Hello, Hope you are doing well! I am having trouble getting the
databases
configuration right, and I'm not sure what I'm doing wrong.Any
paperpile-notion
command causes the error,You don't have an Authors database
:Here is my config:
Here is the Authors database in Notion:
![image](https://user-images.githubusercontent.com/806256/196249758-b71d35ae-88d1-40e2-bfca-0cf6446c3154.png)And here is the Articles database in Notion:
![image](https://user-images.githubusercontent.com/806256/196249869-c49759f5-d095-465b-809a-d9a7de36decb.png)Both have the Paperpile jmuchovej/paperpile-notion connection/integration:
![image](https://user-images.githubusercontent.com/806256/196250376-dfb81c0e-aa15-4259-af71-df6719cb04fb.png)Looking at
setupDBs
here: https://github.com/jmuchovej/paperpile-notion/blob/b7338b68b18f7fc4e6503665f689b03fa157380e/src/config.ts#L122What I see is that some assumptions are made about the "Authors" and "Articles" databases. For example, it seems that
name
is the primary key for Authors, while mine uses title caseName
. Changing toname
in the Authors database creates the same error. I'm not able to understand what is invalid about my Authors database.Is there a way to run only the config script to understand how the tool is interpreting the configuration, and validating it? And/or could you provide empty Notion templates of example
Authors
andArticles
databases to get started?Thank you! Warmest, Olga
EDIT: even if I make the databases publicly viewable, the same "You don't have an Authors database" error occurs