@elumixor/notion-orm 2.1.2 → 2.1.3

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.
@@ -27,6 +27,10 @@ export declare function buildPropertyValueForAddPage(args: {
27
27
  phone_number: string;
28
28
  } | {
29
29
  url: string;
30
+ } | {
31
+ relation: {
32
+ id: string;
33
+ }[];
30
34
  } | {
31
35
  checkbox: boolean;
32
36
  } | {
package/dist/index.js CHANGED
@@ -1388,6 +1388,8 @@ function buildPropertyValueForAddPage(args) {
1388
1388
  return phoneNumberCall({ value });
1389
1389
  } else if (type === "url" && typeof value === "string") {
1390
1390
  return urlCall({ url: value });
1391
+ } else if (type === "relation" && Array.isArray(value)) {
1392
+ return relationCall({ ids: value });
1391
1393
  } else if (type === "checkbox" && typeof value === "boolean") {
1392
1394
  return checkboxCall({ checked: value });
1393
1395
  } else if (type === "title" && typeof value === "string") {
@@ -1463,6 +1465,9 @@ var emailCall = (args) => {
1463
1465
  const { value } = args;
1464
1466
  return { email: value };
1465
1467
  };
1468
+ var relationCall = (args) => {
1469
+ return { relation: args.ids.map((id) => ({ id })) };
1470
+ };
1466
1471
 
1467
1472
  // src/db-client/query.ts
1468
1473
  function buildQueryResponse(res, camelPropertyNameToNameAndTypeMap, validateSchema, meta) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elumixor/notion-orm",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "type": "module",
5
5
  "description": "Bring Notion database schemas/types to TypeScript",
6
6
  "main": "dist/index.js",