@elumixor/notion-orm 0.1.1 → 2.0.2
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/README.md +112 -210
- package/dist/ast/constants.d.ts +12 -13
- package/dist/cli.js +5409 -2038
- package/dist/config/helpers.d.ts +3 -1
- package/dist/db-client/add.d.ts +1 -1
- package/dist/db-client/client.d.ts +169 -0
- package/dist/db-client/query.d.ts +2 -2
- package/dist/db-client/{queryTypes.d.ts → types.d.ts} +25 -8
- package/dist/index.js +168 -94
- package/dist/public-api.d.ts +2 -2
- package/package.json +2 -1
- package/dist/db-client/DatabaseClient.d.ts +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elumixor/notion-orm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bring Notion database schemas/types to TypeScript",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@notionhq/client": "5.3.0",
|
|
32
|
+
"ora": "^9.3.0",
|
|
32
33
|
"typescript": "^5.6.3",
|
|
33
34
|
"zod": "^3.23.8"
|
|
34
35
|
},
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { CreatePageParameters, CreatePageResponse, UpdatePageParameters } from "@notionhq/client/build/src/api-endpoints";
|
|
2
|
-
import type { ZodTypeAny } from "zod";
|
|
3
|
-
import type { Query, QueryFilter, QueryResultType, SupportedNotionColumnType } from "./queryTypes";
|
|
4
|
-
export type camelPropertyNameToNameAndTypeMapType = Record<string, {
|
|
5
|
-
columnName: string;
|
|
6
|
-
type: SupportedNotionColumnType;
|
|
7
|
-
}>;
|
|
8
|
-
export declare class DatabaseClient<DatabaseSchemaType extends Record<string, any>, ColumnNameToColumnType extends Record<keyof DatabaseSchemaType, SupportedNotionColumnType>> {
|
|
9
|
-
private client;
|
|
10
|
-
private id;
|
|
11
|
-
private camelPropertyNameToNameAndTypeMap;
|
|
12
|
-
private schema;
|
|
13
|
-
name: string;
|
|
14
|
-
private loggedSchemaValidationIssues;
|
|
15
|
-
constructor(args: {
|
|
16
|
-
id: string;
|
|
17
|
-
camelPropertyNameToNameAndTypeMap: camelPropertyNameToNameAndTypeMapType;
|
|
18
|
-
auth: string;
|
|
19
|
-
name: string;
|
|
20
|
-
schema: ZodTypeAny;
|
|
21
|
-
});
|
|
22
|
-
add(args: {
|
|
23
|
-
properties: DatabaseSchemaType;
|
|
24
|
-
icon?: CreatePageParameters["icon"];
|
|
25
|
-
}): Promise<CreatePageParameters | CreatePageResponse>;
|
|
26
|
-
update(id: string, properties: Partial<DatabaseSchemaType>, icon?: UpdatePageParameters["icon"]): Promise<void>;
|
|
27
|
-
delete(id: string): Promise<void>;
|
|
28
|
-
upsert(args: {
|
|
29
|
-
where: QueryFilter<DatabaseSchemaType, ColumnNameToColumnType>;
|
|
30
|
-
properties: DatabaseSchemaType;
|
|
31
|
-
icon?: CreatePageParameters["icon"];
|
|
32
|
-
}): Promise<{
|
|
33
|
-
created: boolean;
|
|
34
|
-
id: string;
|
|
35
|
-
}>;
|
|
36
|
-
query<Args extends Query<DatabaseSchemaType, ColumnNameToColumnType> & {
|
|
37
|
-
pagination: {
|
|
38
|
-
pageSize: number;
|
|
39
|
-
};
|
|
40
|
-
}>(query: Args): AsyncIterable<QueryResultType<DatabaseSchemaType, Args>>;
|
|
41
|
-
query<Args extends Omit<Query<DatabaseSchemaType, ColumnNameToColumnType>, "pagination">>(query: Args): Promise<QueryResultType<DatabaseSchemaType, Args>[]>;
|
|
42
|
-
private buildQueryCall;
|
|
43
|
-
private fetchAllPages;
|
|
44
|
-
private paginatedIterable;
|
|
45
|
-
private applySelectOmit;
|
|
46
|
-
private validateDatabaseSchema;
|
|
47
|
-
}
|