aboutsummaryrefslogtreecommitdiff
path: root/src/models/properties.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/properties.rs')
-rw-r--r--src/models/properties.rs83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/models/properties.rs b/src/models/properties.rs
index 37c1a4e..4139712 100644
--- a/src/models/properties.rs
+++ b/src/models/properties.rs
@@ -1,3 +1,4 @@
+use crate::models::DatabaseId;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
@@ -55,6 +56,62 @@ pub struct Select {
}
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
+pub struct Formula {
+ /// Formula to evaluate for this property
+ expression: String,
+}
+
+#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
+pub struct Relation {
+ /// The database this relation refers to.
+ /// New linked pages must belong to this database in order to be valid.
+ database_id: DatabaseId,
+ /// By default, relations are formed as two synced properties across databases:
+ /// if you make a change to one property, it updates the synced property at the same time.
+ /// `synced_property_name` refers to the name of the property in the related database.
+ synced_property_name: Option<String>,
+ /// By default, relations are formed as two synced properties across databases:
+ /// if you make a change to one property, it updates the synced property at the same time.
+ /// `synced_property_id` refers to the id of the property in the related database.
+ /// This is usually a short string of random letters and symbols.
+ synced_property_id: Option<PropertyId>,
+}
+
+#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
+#[serde(rename_all = "snake_case")]
+pub enum RollupFunction {
+ CountAll,
+ CountValues,
+ CountUniqueValues,
+ CountEmpty,
+ CountNotEmpty,
+ PercentEmpty,
+ PercentNotEmpty,
+ Sum,
+ Average,
+ Median,
+ Min,
+ Max,
+ Range,
+}
+
+#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
+pub struct Rollup {
+ /// The name of the relation property this property is responsible for rolling up.
+ relation_property_name: String,
+ /// The id of the relation property this property is responsible for rolling up.
+ relation_property_id: PropertyId,
+ /// The name of the property of the pages in the related database
+ /// that is used as an input to `function`.
+ rollup_property_name: String,
+ /// The id of the property of the pages in the related database
+ /// that is used as an input to `function`.
+ rollup_property_id: String,
+ /// The function that is evaluated for every page in the relation of the rollup.
+ function: RollupFunction,
+}
+
+#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
#[serde(tag = "type")]
#[serde(rename_all = "snake_case")]
pub enum PropertyConfiguration {
@@ -82,4 +139,30 @@ pub enum PropertyConfiguration {
/// See https://developers.notion.com/reference/database#file-configuration
/// Documentation issue: docs claim type name is `file` but it's is in fact `files`
Files { id: PropertyId },
+ /// Represents a Checkbox Property
+ /// See https://developers.notion.com/reference/database#checkbox-configuration
+ Checkbox { id: PropertyId },
+ /// Represents a URL Property
+ /// See https://developers.notion.com/reference/database#url-configuration
+ URL { id: PropertyId },
+ /// Represents a Email Property
+ /// See https://developers.notion.com/reference/database#email-configuration
+ Email { id: PropertyId },
+ /// Represents a Phone number Property
+ /// See https://developers.notion.com/reference/database#phone-number-configuration
+ PhoneNumber { id: PropertyId },
+ /// See https://developers.notion.com/reference/database#formula-configuration
+ Formula { id: PropertyId, formula: Formula },
+ /// See https://developers.notion.com/reference/database#relation-configuration
+ Relation { id: PropertyId, relation: Relation },
+ /// See https://developers.notion.com/reference/database#rollup-configuration
+ Rollup { id: PropertyId, rollup: Rollup },
+ /// See https://developers.notion.com/reference/database#created-time-configuration
+ CreatedTime { id: PropertyId },
+ /// See https://developers.notion.com/reference/database#created-by-configuration
+ CreatedBy { id: PropertyId },
+ /// See https://developers.notion.com/reference/database#last-edited-time-configuration
+ LastEditTime { id: PropertyId },
+ /// See https://developers.notion.com/reference/database#last-edited-by-configuration
+ LastEditBy { id: PropertyId },
}
es/readable-stream-default Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/spawn.node.mjs (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-01-05BumpGravatar Jarred Sumner 1-1/+1
2023-01-05fix `onConnectError()` error propagation (#1730)Gravatar Alex Lam S.L 1-2/+2
2023-01-05Update tcp-echo.bun.tsGravatar Jarred Sumner 1-13/+15
2023-01-05Really fix #1722Gravatar Jarred Sumner 2-3/+41
2023-01-05improve `.toThrow()` compatibility with Jest (#1728)Gravatar Alex Lam S.L 2-17/+33
2023-01-04Fix Bun.serve typings (#1714)Gravatar u9g 1-2/+2
2023-01-04implement `expect().toThrow()` (#1727)Gravatar Alex Lam S.L 5-130/+370
2023-01-04Add `SharedBuffer` from WebKit to make it easier to import more WebCore stuffGravatar Jarred Sumner 2-0/+1111
2023-01-04Fix default export for streamGravatar Jarred Sumner 1-11/+4
2023-01-04Fixes #1722Gravatar Jarred Sumner 1-1/+2
2023-01-04split server/client for tcp echo benchmark to better measure net.Socket perfGravatar Jarred Sumner 2-58/+60
2023-01-04buffer list clean-ups (#1721)Gravatar Alex Lam S.L 1-37/+68
2023-01-04Support non-classes in node:net (#1712)Gravatar Jarred Sumner 1-198/+216
2023-01-04Fixes #1716Gravatar Jarred Sumner 1-2/+2
2023-01-0410x faster `new Buffer` (#1717)Gravatar Jarred Sumner 19-520/+480
2023-01-03Update README.mdGravatar Jarred Sumner 1-2/+2
2023-01-03Add sqlite to vendorGravatar Jarred Sumner 1-4/+8
2023-01-03Fixes https://github.com/oven-sh/bun/issues/1695Gravatar Jarred Sumner 1-1/+1
2023-01-03Remove usages of std.xGravatar Jarred Sumner 7-98/+75
2023-01-03[streams] speed up `Readable` in some cases (#1708)Gravatar Alex Lam S.L 3-14/+140
2023-01-03Fix crash in BufferListGravatar Jarred Sumner 1-2/+2