Skip to content

Commit

Permalink
misc: release 0.0.0-internal.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed Feb 15, 2024
1 parent 6574fcb commit 139c4c7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typed-notion-client",
"version": "0.0.0-internal.2",
"version": "0.0.0-internal.3",
"description": "Type-safe Notion API client",
"main": "./dist/main.js",
"module": "./dist/main.mjs",
Expand Down
5 changes: 5 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

pnpm publish --access public
git tag -a $1 -m "release $1"
git push origin $1
4 changes: 2 additions & 2 deletions src/notion/types/notion-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Test = [
Expect<ExpectExtends<PageProperties, PeopleProp>>,
Expect<ExpectExtends<PageProperties, UrlProp>>,
Expect<ExpectExtends<PageProperties, CreatedTimeProp>>,
Expect<ExpectExtends<PageProperties, LastEditedTimeProp>>,
Expect<ExpectExtends<PageProperties, LastEditedTimeProp>>
];

export type MapResponseToNotionType<T extends Record<string, PageProperties['type']>> = {
Expand All @@ -52,7 +52,7 @@ export type MapTypeToNotionType<T extends PageProperties['type']> = T extends Nu
: T extends PeopleProp['type']
? PeopleProp
: T extends UrlProp['type']
? UrlProp
? UrlProp
: T extends CreatedTimeProp['type']
? CreatedTimeProp
: T extends LastEditedTimeProp['type']
Expand Down
4 changes: 2 additions & 2 deletions src/notion/types/notion-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type MapTypeToNotionType<TType extends PageProperties['type']> = TType extends N
export type DatePropCreatePage = Extract<CreatePageProperties, { type?: 'date' }>;
export type NumberPropCreatePage = Extract<CreatePageProperties, { type?: 'number' }>;
export type TitlePropCreatePage = Extract<CreatePageProperties, { type?: 'title' }>;
export type RichTextProp = Extract<CreatePageProperties, { type?: 'rich_text' }>;
export type RichTextProp = Extract<CreatePageProperties, { type?: 'rich_text' }>;
export type SelectProp = Extract<CreatePageProperties, { type?: 'select' }>;
export type StatusProp = Extract<CreatePageProperties, { type?: 'status' }>;
export type PeopleProp = Extract<CreatePageProperties, { type?: 'people' }>;
Expand All @@ -61,5 +61,5 @@ type Test = [
Expect<ExpectExtends<CreatePageProperties, PeopleProp>>,
Expect<ExpectExtends<CreatePageProperties, UrlProp>>,
Expect<ExpectExtends<CreatePageProperties, CreatedTimeProp>>,
Expect<ExpectExtends<CreatePageProperties, LastEditedTimeProp>>,
Expect<ExpectExtends<CreatePageProperties, LastEditedTimeProp>>
];
12 changes: 9 additions & 3 deletions src/notion/types/notion-query-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ export type SelectPropFilter<TProp extends keyof any = string> = ExtractProperty
export type StatusPropFilter<TProp extends keyof any = string> = ExtractPropertyFilter<{ type?: 'status' }, TProp>;
export type PeoplePropFilter<TProp extends keyof any = string> = ExtractPropertyFilter<{ type?: 'people' }, TProp>;
export type UrlPropFilter<TProp extends keyof any = string> = ExtractPropertyFilter<{ type?: 'url' }, TProp>;
export type CreatedTimePropFilter<TProp extends keyof any = string> = ExtractPropertyFilter<{ type?: 'created_time' }, TProp>;
export type LastEditedTimePropFilter<TProp extends keyof any = string> = ExtractPropertyFilter<{ type?: 'last_edited_time' }, TProp>;
export type CreatedTimePropFilter<TProp extends keyof any = string> = ExtractPropertyFilter<
{ type?: 'created_time' },
TProp
>;
export type LastEditedTimePropFilter<TProp extends keyof any = string> = ExtractPropertyFilter<
{ type?: 'last_edited_time' },
TProp
>;

/**
* The redefined type is still matched the original type
Expand All @@ -76,5 +82,5 @@ type Test = [
Expect<ExpectExtends<QueryFilterArgs, PeoplePropFilter>>,
Expect<ExpectExtends<QueryFilterArgs, UrlPropFilter>>,
Expect<ExpectExtends<QueryFilterArgs, CreatedTimePropFilter>>,
Expect<ExpectExtends<QueryFilterArgs, LastEditedTimePropFilter>>,
Expect<ExpectExtends<QueryFilterArgs, LastEditedTimePropFilter>>
];

0 comments on commit 139c4c7

Please sign in to comment.