notionary 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl
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.
- notionary/__init__.py +14 -2
- notionary/blocks/enums.py +27 -6
- notionary/blocks/schemas.py +32 -78
- notionary/comments/client.py +6 -9
- notionary/comments/schemas.py +2 -29
- notionary/data_source/http/data_source_instance_client.py +4 -4
- notionary/data_source/properties/schemas.py +128 -107
- notionary/data_source/query/__init__.py +9 -0
- notionary/data_source/query/builder.py +12 -3
- notionary/data_source/query/schema.py +5 -0
- notionary/data_source/schemas.py +2 -2
- notionary/data_source/service.py +43 -132
- notionary/database/schemas.py +2 -2
- notionary/database/service.py +19 -63
- notionary/exceptions/__init__.py +10 -2
- notionary/exceptions/api.py +2 -2
- notionary/exceptions/base.py +1 -1
- notionary/exceptions/block_parsing.py +24 -3
- notionary/exceptions/data_source/builder.py +2 -2
- notionary/exceptions/data_source/properties.py +3 -3
- notionary/exceptions/file_upload.py +67 -0
- notionary/exceptions/properties.py +4 -4
- notionary/exceptions/search.py +4 -4
- notionary/file_upload/__init__.py +4 -0
- notionary/file_upload/client.py +124 -210
- notionary/file_upload/config/__init__.py +17 -0
- notionary/file_upload/config/config.py +32 -0
- notionary/file_upload/config/constants.py +16 -0
- notionary/file_upload/file/reader.py +28 -0
- notionary/file_upload/query/__init__.py +7 -0
- notionary/file_upload/query/builder.py +54 -0
- notionary/file_upload/query/models.py +37 -0
- notionary/file_upload/schemas.py +78 -0
- notionary/file_upload/service.py +152 -289
- notionary/file_upload/validation/factory.py +64 -0
- notionary/file_upload/validation/impl/file_name_length.py +23 -0
- notionary/file_upload/validation/models.py +124 -0
- notionary/file_upload/validation/port.py +7 -0
- notionary/file_upload/validation/service.py +17 -0
- notionary/file_upload/validation/validators/__init__.py +11 -0
- notionary/file_upload/validation/validators/file_exists.py +15 -0
- notionary/file_upload/validation/validators/file_extension.py +122 -0
- notionary/file_upload/validation/validators/file_name_length.py +21 -0
- notionary/file_upload/validation/validators/upload_limit.py +31 -0
- notionary/http/client.py +7 -23
- notionary/page/content/factory.py +2 -0
- notionary/page/content/parser/factory.py +8 -5
- notionary/page/content/parser/parsers/audio.py +8 -33
- notionary/page/content/parser/parsers/embed.py +0 -2
- notionary/page/content/parser/parsers/file.py +8 -35
- notionary/page/content/parser/parsers/file_like_block.py +89 -0
- notionary/page/content/parser/parsers/image.py +8 -35
- notionary/page/content/parser/parsers/pdf.py +8 -35
- notionary/page/content/parser/parsers/video.py +8 -35
- notionary/page/content/parser/pre_processsing/handlers/__init__.py +2 -0
- notionary/page/content/parser/pre_processsing/handlers/column_syntax.py +12 -8
- notionary/page/content/parser/pre_processsing/handlers/indentation.py +2 -0
- notionary/page/content/parser/pre_processsing/handlers/video_syntax.py +66 -0
- notionary/page/content/parser/pre_processsing/handlers/whitespace.py +2 -0
- notionary/page/content/renderer/renderers/audio.py +9 -21
- notionary/page/content/renderer/renderers/file.py +9 -21
- notionary/page/content/renderer/renderers/file_like_block.py +43 -0
- notionary/page/content/renderer/renderers/image.py +9 -21
- notionary/page/content/renderer/renderers/pdf.py +9 -21
- notionary/page/content/renderer/renderers/video.py +9 -21
- notionary/page/content/syntax/__init__.py +2 -1
- notionary/page/content/syntax/registry.py +38 -60
- notionary/page/properties/client.py +3 -3
- notionary/page/properties/{models.py → schemas.py} +93 -107
- notionary/page/properties/service.py +15 -4
- notionary/page/schemas.py +3 -3
- notionary/page/service.py +18 -79
- notionary/shared/entity/dto_parsers.py +1 -36
- notionary/shared/entity/entity_metadata_update_client.py +18 -4
- notionary/shared/entity/schemas.py +6 -6
- notionary/shared/entity/service.py +121 -40
- notionary/shared/models/file.py +34 -6
- notionary/shared/models/icon.py +5 -12
- notionary/user/bot.py +12 -12
- notionary/utils/decorators.py +8 -8
- notionary/utils/pagination.py +36 -32
- notionary/workspace/__init__.py +2 -2
- notionary/workspace/client.py +2 -0
- notionary/workspace/query/__init__.py +3 -2
- notionary/workspace/query/builder.py +25 -1
- notionary/workspace/query/models.py +9 -1
- notionary/workspace/query/service.py +15 -11
- notionary/workspace/service.py +46 -36
- {notionary-0.3.0.dist-info → notionary-0.4.0.dist-info}/METADATA +9 -5
- {notionary-0.3.0.dist-info → notionary-0.4.0.dist-info}/RECORD +92 -71
- notionary/file_upload/models.py +0 -69
- notionary/page/page_context.py +0 -50
- notionary/shared/models/cover.py +0 -20
- {notionary-0.3.0.dist-info → notionary-0.4.0.dist-info}/WHEEL +0 -0
- {notionary-0.3.0.dist-info → notionary-0.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
notionary/__init__.py,sha256=
|
|
1
|
+
notionary/__init__.py,sha256=kF7j3rTACgHt3IN4ODIceLE50Uxn8GvKbjqgD1dCdbE,660
|
|
2
2
|
notionary/blocks/__init__.py,sha256=LsVUgSsDYlLy-bwLqnukcr4uB8ZcCLMz3fGd4HsNXDY,99
|
|
3
3
|
notionary/blocks/client.py,sha256=zYy_eFz6NKFGqsESDddiUUZZfV6ybWWyzseThZEdIvI,5551
|
|
4
|
-
notionary/blocks/enums.py,sha256=
|
|
5
|
-
notionary/blocks/schemas.py,sha256=
|
|
4
|
+
notionary/blocks/enums.py,sha256=Y_la49porLNRMI72n8Ucl_CDjo2xuH-RNwx3BesxHig,4663
|
|
5
|
+
notionary/blocks/schemas.py,sha256=ahXn6DQTvEkTDCIEzEZlUQPkysI3moDs0GdUhuQsNDw,19969
|
|
6
6
|
notionary/blocks/rich_text/markdown_rich_text_converter.py,sha256=kZyCwKgv4BMTswmIPTyDVrLs4OQ9JQn9O-Qb0rxea1k,11642
|
|
7
7
|
notionary/blocks/rich_text/models.py,sha256=0aNsB_gpFiqBXAATL4yVMyOy4-zbN0WKB3rEaFQeTKs,4863
|
|
8
8
|
notionary/blocks/rich_text/rich_text_markdown_converter.py,sha256=oKqh8vK5JTehiYC-y0m4bfRSkt5bq1gTpWZib7NIvoo,5512
|
|
@@ -14,47 +14,66 @@ notionary/blocks/rich_text/name_id_resolver/page.py,sha256=DfjXyBLdkYl5UfoU2UGSl
|
|
|
14
14
|
notionary/blocks/rich_text/name_id_resolver/person.py,sha256=lhDBhJXL0VRoOu8eJc-uOcqXB78os8V6VePagBboKs8,1301
|
|
15
15
|
notionary/blocks/rich_text/name_id_resolver/port.py,sha256=VtTavK6rHL-_qTIjFMsO25cgh_oUHNS-qEM_mONOaS0,259
|
|
16
16
|
notionary/comments/__init__.py,sha256=1LfujehhvWqJmNKft6QvcbwhLlJOGq7cH1uTb4IUR2w,63
|
|
17
|
-
notionary/comments/client.py,sha256=
|
|
17
|
+
notionary/comments/client.py,sha256=43raXEooa_kA-iYlUSEFqtQuA9gJ1kHPLsbC0K0H_bE,2593
|
|
18
18
|
notionary/comments/factory.py,sha256=OmE1CBY5elpbvuSj64EmBfSlmED9VAYIQ65J5jKM15s,1511
|
|
19
19
|
notionary/comments/models.py,sha256=g-WTDSel8nhyRa60rN0U5FuccU0KVnsnJBi6Uqz7NVw,107
|
|
20
|
-
notionary/comments/schemas.py,sha256=
|
|
20
|
+
notionary/comments/schemas.py,sha256=MURN2gNIj_tkSQIEXMDFeDb1Z0DfvEiHIlOZ4H8GEyU,5340
|
|
21
21
|
notionary/comments/service.py,sha256=qRCwTTzjdSD2vgqCJCBPbSO3gyajyUD3JWV3qgiMFe0,1652
|
|
22
|
-
notionary/data_source/schemas.py,sha256=
|
|
23
|
-
notionary/data_source/service.py,sha256=
|
|
22
|
+
notionary/data_source/schemas.py,sha256=xfKxy51zWlpXiLRZfRZWzFvIFwqw3hy69ydh-LJJzn0,829
|
|
23
|
+
notionary/data_source/service.py,sha256=hZygzOgqpIYgcEGB3FvJCRIZ5NpNIoQYkupyzlUbQDw,11446
|
|
24
24
|
notionary/data_source/http/client.py,sha256=wvaBOIT5OtGdE0QjbcDUsuDnZ0TZ-CyIifBHp6OYTqE,445
|
|
25
|
-
notionary/data_source/http/data_source_instance_client.py,sha256=
|
|
26
|
-
notionary/data_source/properties/schemas.py,sha256=
|
|
27
|
-
notionary/data_source/query/
|
|
25
|
+
notionary/data_source/http/data_source_instance_client.py,sha256=S2cDnUw3ISn7cM7vhdX6PGpAarneZri5NRlILlcBV_s,5006
|
|
26
|
+
notionary/data_source/properties/schemas.py,sha256=oBuAAr3ESFIvQLP-o0tYKYHXMKg2o6KTy6-xcA3Yd9Q,12964
|
|
27
|
+
notionary/data_source/query/__init__.py,sha256=Q3uQf6r0xHYV_i5kn-Gdwf68QKJMnV_7vS_gO4I3kG8,226
|
|
28
|
+
notionary/data_source/query/builder.py,sha256=6oyTtcbs7TiJtitzXDiIk_tCaA3G6uvf_KXIQEJByGU,18740
|
|
28
29
|
notionary/data_source/query/resolver.py,sha256=zkV-ra2vvKdXAIcDO7zEzjvd_79YKLz6umczK6U8fpo,4370
|
|
29
|
-
notionary/data_source/query/schema.py,sha256=
|
|
30
|
+
notionary/data_source/query/schema.py,sha256=PdoboG_b8MDhRw5gfWAnVJpdUJc9b-jcWQs-EUGG8vk,9573
|
|
30
31
|
notionary/data_source/query/validator.py,sha256=wO0oT2i8d-Vl6ul_4ilXFyOxnOvM64HXdCRJPyu-xdE,3309
|
|
31
32
|
notionary/data_source/schema/registry.py,sha256=ageQvLYOnU1g65JcZ9cmQWfj0Sv7petNWUBl5eH-eFo,5185
|
|
32
33
|
notionary/data_source/schema/service.py,sha256=AFkHsOnTOSpf36pr2XHgw16Kna5hzw0GduAdLAh7bMQ,5977
|
|
33
34
|
notionary/database/client.py,sha256=oLl8iRPkNC7Fuu9tAhXg3iX5n6z_35Nvl-JN8i0aSd4,2213
|
|
34
35
|
notionary/database/database_metadata_update_client.py,sha256=LryhjGxDgLbRvuOUVvViZCogI0-Op4QkOlQUW4z8Tmg,905
|
|
35
|
-
notionary/database/schemas.py,sha256=
|
|
36
|
-
notionary/database/service.py,sha256=
|
|
37
|
-
notionary/exceptions/__init__.py,sha256=
|
|
38
|
-
notionary/exceptions/api.py,sha256=
|
|
39
|
-
notionary/exceptions/base.py,sha256=
|
|
40
|
-
notionary/exceptions/block_parsing.py,sha256=
|
|
41
|
-
notionary/exceptions/
|
|
42
|
-
notionary/exceptions/
|
|
36
|
+
notionary/database/schemas.py,sha256=gzihLqe4YjGExWZ4X_s9yU-lm5Ezr1YFjviNCyxW1HE,838
|
|
37
|
+
notionary/database/service.py,sha256=uHNxQUxcGxASUXMGGn2CfQZMhyo-w7xawHkRTcdtgcA,4414
|
|
38
|
+
notionary/exceptions/__init__.py,sha256=sYBYDhqbO5f930wZaOgnwJYnVm8rX3O9OXEJ8VNLpzI,1484
|
|
39
|
+
notionary/exceptions/api.py,sha256=TxDAKh9-DXX3eYis-S_zE07WB0-UcyQsxBjIKKoFBT8,798
|
|
40
|
+
notionary/exceptions/base.py,sha256=Ey5rEWO9x9GIQOcGrgQcLz0pehPXGPQdEm8MIpV7Uq4,48
|
|
41
|
+
notionary/exceptions/block_parsing.py,sha256=5prPAkbN4bs8EyHLQrAvpFrZMilKJgGAqJdd6s1ukao,1487
|
|
42
|
+
notionary/exceptions/file_upload.py,sha256=79oB903eJdD91MO4E1IHapyU-129_fexFQDxu9CBVLs,2816
|
|
43
|
+
notionary/exceptions/properties.py,sha256=I-LFWS_xVJFy4FmZQqPrQstuudfvEvBjndQlJtxVRcY,2215
|
|
44
|
+
notionary/exceptions/search.py,sha256=VhxVcrlvkCHNC3HBAICXraFBaEKLlZVvb1m82O82Fo8,2176
|
|
43
45
|
notionary/exceptions/data_source/__init__.py,sha256=Xs4I-zVxVQiVhfTclJX7GuGVO5fMYQIWqiqFnh_O67M,170
|
|
44
|
-
notionary/exceptions/data_source/builder.py,sha256=
|
|
45
|
-
notionary/exceptions/data_source/properties.py,sha256=
|
|
46
|
-
notionary/file_upload/
|
|
47
|
-
notionary/file_upload/
|
|
48
|
-
notionary/file_upload/
|
|
49
|
-
notionary/
|
|
46
|
+
notionary/exceptions/data_source/builder.py,sha256=lnU636VBGRV37_Ht53iUuIbx8CneRNwzCw9BYQA37MM,6023
|
|
47
|
+
notionary/exceptions/data_source/properties.py,sha256=LX_JTeMjlJY3_s70mFvDaDn3DfNgfNtzfC-6aC1_3Ug,1248
|
|
48
|
+
notionary/file_upload/__init__.py,sha256=MeOzKCT9RVNvikespbjE9cucfMgsh9R0JwoUfhRTjVQ,178
|
|
49
|
+
notionary/file_upload/client.py,sha256=OhLf89C8QI7Om1jMUJSFSxrdRFZr3WvQovMfHitRR-w,5370
|
|
50
|
+
notionary/file_upload/schemas.py,sha256=1JH-jJonWgW3HyB7pI7MMTM51jaAuwxf8-NFVMlU0Rc,2272
|
|
51
|
+
notionary/file_upload/service.py,sha256=vBBNt8u8YDaykUcwMXuYyK9B9giEdii8hXtR1I-XBbQ,8483
|
|
52
|
+
notionary/file_upload/config/__init__.py,sha256=BS6sI4ElRMUyxro4ohw6ll7OvIzc46Ss7jjHaJCrLfY,480
|
|
53
|
+
notionary/file_upload/config/config.py,sha256=oYeiffnTvEFvzRn4LReyx6ikw9tXhTfJk1p9Naq6_CY,1100
|
|
54
|
+
notionary/file_upload/config/constants.py,sha256=KoWJLrPPaTiELKyqrV9-Cng2nq6Y-v0MTxQJPyMnWUI,452
|
|
55
|
+
notionary/file_upload/file/reader.py,sha256=I4FmXdPU2dpBiIULfiVnhdiEwlLBMqa9iIO_IbzlLKw,1036
|
|
56
|
+
notionary/file_upload/query/__init__.py,sha256=9ZpH2HV-m7YmdKrQ5kDUC9FmcB1zjegUSK_0CTxX1Ho,155
|
|
57
|
+
notionary/file_upload/query/builder.py,sha256=n8ReTdkq2PAtXyzDuSlJDX1coAUW6VSLabUrrwb5frY,1922
|
|
58
|
+
notionary/file_upload/query/models.py,sha256=c5XIq7WkfjmESMAj47OYFnuheT_jqP68bmYWrNHIq0E,1069
|
|
59
|
+
notionary/file_upload/validation/factory.py,sha256=Z27Bv_pjyYiq6mOBvtsXTARBr9Hv13lpI-Fqp6jVfg4,2298
|
|
60
|
+
notionary/file_upload/validation/models.py,sha256=PZ5egEjQBePMQ0sFpMuk6IXWbKiskzz-vvrmAMG1-vQ,2906
|
|
61
|
+
notionary/file_upload/validation/port.py,sha256=S__YHYXLDlz2deCNNp5mv4fr6abmFyTfFGoftHB-_ZI,148
|
|
62
|
+
notionary/file_upload/validation/service.py,sha256=quTdUXCtGFHddqyIplF8SKaXSQ6zTh-Xw_jMq9jAvzI,681
|
|
63
|
+
notionary/file_upload/validation/impl/file_name_length.py,sha256=sTJvm4f3kg3Arl5TxVfC9kaVIBor9cRAs8of9reBqEo,955
|
|
64
|
+
notionary/file_upload/validation/validators/__init__.py,sha256=UAQGLrDgr4Fv4ESPU0f0nEEY2FNm3VcpB8EZ3nKdDDo,347
|
|
65
|
+
notionary/file_upload/validation/validators/file_exists.py,sha256=nL1M9KK2N0YCo3JABSHZioPg0m0R3MJGDMemyL_EduY,486
|
|
66
|
+
notionary/file_upload/validation/validators/file_extension.py,sha256=T2ZPJdYGugEEbp4lpWZ02ijrynPEx0hq6P-t75BZCSI,5326
|
|
67
|
+
notionary/file_upload/validation/validators/file_name_length.py,sha256=xdZTzw3XUUHd8I6_T6_oD7NdG2t6defLEZAB-QKsvoI,830
|
|
68
|
+
notionary/file_upload/validation/validators/upload_limit.py,sha256=UdhDsh57HPPNPQ3kcEAffVnm2CgBF77Fa2G47OmLs7Q,1146
|
|
69
|
+
notionary/http/client.py,sha256=HXvSjj8FWkX9AniLqSrVB8l1TXKNB4BzbvzRFjrz-0k,7123
|
|
50
70
|
notionary/http/models.py,sha256=fvjKAGX-b6JcJ-W7V3DEt4v3SnsdikMa6N0c4aolslY,1352
|
|
51
|
-
notionary/page/page_context.py,sha256=dMxGuzNerfcfy6boRPrcEwxCsuNNeFwzQZg-BdeDgec,1506
|
|
52
71
|
notionary/page/page_http_client.py,sha256=YQdXkfMGu2wuJpALJBIsKKwoHv316n_sMjne-iqJYHc,445
|
|
53
72
|
notionary/page/page_metadata_update_client.py,sha256=jJc3SMFnt98YBAb9ie_OxQBXAiXpeCzslOcRRRGwVks,865
|
|
54
|
-
notionary/page/schemas.py,sha256=
|
|
55
|
-
notionary/page/service.py,sha256=
|
|
73
|
+
notionary/page/schemas.py,sha256=uodDbDQDL8b-qvvjnvRXrliFoM7o6tzmLziRBmjVhTE,359
|
|
74
|
+
notionary/page/service.py,sha256=KN1rIuYBfmEq_cfZ5dWvcdXA7Ru9QcYqNAp3B_T-3Tg,6186
|
|
56
75
|
notionary/page/blocks/client.py,sha256=2ukLeaYdFJCGzpQr-3eIZRFG2potXS-3MdKLoRha9bc,19
|
|
57
|
-
notionary/page/content/factory.py,sha256=
|
|
76
|
+
notionary/page/content/factory.py,sha256=MRrHgHIruOVJ1Atew4eF4thPTj2L73QVCbfc9YdYFEM,3760
|
|
58
77
|
notionary/page/content/service.py,sha256=5beyQrQMyjo5Mq6c0uaj3nfbKSA3ujU1aaKiKJN7r3U,2973
|
|
59
78
|
notionary/page/content/markdown/__init__.py,sha256=dhBiNIbiyG38eppjXC0fkZk3NVXzRGC8xqoE89jWHG0,80
|
|
60
79
|
notionary/page/content/markdown/builder.py,sha256=1t4_0mWedf9OM2V1DdDbtHxte8LWsgt8kCx3OkIVFR8,9008
|
|
@@ -87,10 +106,10 @@ notionary/page/content/markdown/nodes/video.py,sha256=COmRavqXIoD7_Y8k1ha6b36gbB
|
|
|
87
106
|
notionary/page/content/markdown/nodes/mixins/__init__.py,sha256=KVWvxbgwrbfXt495N4xkIu4s8tD-miwVTcXa2fc9Kvc,98
|
|
88
107
|
notionary/page/content/markdown/nodes/mixins/caption.py,sha256=05tHz2RzNzyN6ggKk5gCR4iWWmM9ILwSCgfAxhgo9Bk,436
|
|
89
108
|
notionary/page/content/parser/context.py,sha256=oboLkBQCeUehYtgooycOJ0Vs830Jhx0HIPXBKPWdaaM,4750
|
|
90
|
-
notionary/page/content/parser/factory.py,sha256=
|
|
109
|
+
notionary/page/content/parser/factory.py,sha256=ic2g9F9RIl_b4LCw-jKqyY5Q7ViSRgoyRLV1OzkRAaA,8142
|
|
91
110
|
notionary/page/content/parser/service.py,sha256=gHonMPByZhNjUwMNJGPsNTZyfxIZp0Yaza6Z-huO6A8,2891
|
|
92
111
|
notionary/page/content/parser/parsers/__init__.py,sha256=cHGTAs7XZEHPmFHhlnno5J7nmLlfYwuTXtOtWvjWAD4,1637
|
|
93
|
-
notionary/page/content/parser/parsers/audio.py,sha256=
|
|
112
|
+
notionary/page/content/parser/parsers/audio.py,sha256=HZFPg3Gaw61Upccehx59N-6WpnsRsNVloIZcSH4yBzg,637
|
|
94
113
|
notionary/page/content/parser/parsers/base.py,sha256=do1z_YLjQg1qdExtPaH1negInx3HLXz6kDBaGoCxGcM,988
|
|
95
114
|
notionary/page/content/parser/parsers/bookmark.py,sha256=OPHcQo4XVBNuV--IRarxgnnjDiStgxtUJvJ2WP_EQoA,1233
|
|
96
115
|
notionary/page/content/parser/parsers/breadcrumb.py,sha256=xkPj0dzQrpk349ruB0ysZ2g-7ezWAyrdEhQD3uC5A2s,1190
|
|
@@ -101,32 +120,34 @@ notionary/page/content/parser/parsers/code.py,sha256=A--JUlsjiudnULzKpAU_PkXusP4
|
|
|
101
120
|
notionary/page/content/parser/parsers/column.py,sha256=8Y4pyg4rfk8lAR4AAstzXzD-UQayF3KC4JB7fokQUUM,2914
|
|
102
121
|
notionary/page/content/parser/parsers/column_list.py,sha256=utyOZLO6jEVNUFxDG_yMRKlvewVWCTsfa02w_pWz87g,3474
|
|
103
122
|
notionary/page/content/parser/parsers/divider.py,sha256=j9nuuViHAeXddWg-qt-IYLqnbpRu0tB--ll2nYPnUak,1148
|
|
104
|
-
notionary/page/content/parser/parsers/embed.py,sha256=
|
|
123
|
+
notionary/page/content/parser/parsers/embed.py,sha256=sNxydRUCeRpN4M0c6CA_2agpyl4bQwaAjeWPXc4BwUw,1169
|
|
105
124
|
notionary/page/content/parser/parsers/equation.py,sha256=hJL4PbJkiBrfphgBCV_a9LRvVHMcUU1_O1lAHDELs5o,2333
|
|
106
|
-
notionary/page/content/parser/parsers/file.py,sha256=
|
|
125
|
+
notionary/page/content/parser/parsers/file.py,sha256=JU20LN03LrKaqlsmBO14ztCLzMV1MTGlsqigCsSJdFo,630
|
|
126
|
+
notionary/page/content/parser/parsers/file_like_block.py,sha256=0BwAnlih5Qy9zpBu2Vqcd8qsd6jJyFx49jEsebvNeSk,3829
|
|
107
127
|
notionary/page/content/parser/parsers/heading.py,sha256=MO3XpTlhO18F36rI-u5XQ7TXx739FmntCpvwcoi02N4,4524
|
|
108
|
-
notionary/page/content/parser/parsers/image.py,sha256=
|
|
128
|
+
notionary/page/content/parser/parsers/image.py,sha256=WNuv0Cbx4IvZPT0gqdZY1bbC2gWRBeEvmFPf37jAbu0,637
|
|
109
129
|
notionary/page/content/parser/parsers/numbered_list.py,sha256=ouebkdw3dhbsERdqQLJlbvBP9cw9yJHoUg1r0wrGBrg,3623
|
|
110
130
|
notionary/page/content/parser/parsers/paragraph.py,sha256=GDzGxAQOBFgZPSdzZiK-OruSE3yVIZwyVMPn064NHmU,1359
|
|
111
|
-
notionary/page/content/parser/parsers/pdf.py,sha256=
|
|
131
|
+
notionary/page/content/parser/parsers/pdf.py,sha256=MPosXCpfSJxJpVdq7K4pjHURYVr0b5Cd4SYfzuY80K8,623
|
|
112
132
|
notionary/page/content/parser/parsers/quote.py,sha256=--zTyGPfg_V42yfShWQjYgD5x6pHIRqoMCqGl1QnVC0,5078
|
|
113
133
|
notionary/page/content/parser/parsers/space.py,sha256=BJ7IOXrpKO_Xjsb2GWzESW97Tju89VnddB5pkmq7pD4,1569
|
|
114
134
|
notionary/page/content/parser/parsers/table.py,sha256=eyrCdEEGyxmro4mHxKx6APnBHZAfLtWiD6Hlv_MwZvU,5479
|
|
115
135
|
notionary/page/content/parser/parsers/table_of_contents.py,sha256=f8JVQmBvV2ptrUYw5LPY5j844nbFlhU8K-3mfT7GMjk,1205
|
|
116
136
|
notionary/page/content/parser/parsers/todo.py,sha256=iv0WD8T2Y8DxJ3k0khLiyDHPhDJIe2veExu1Aco_a3E,3838
|
|
117
137
|
notionary/page/content/parser/parsers/toggle.py,sha256=x42I5ABN6SyoFxmeliZsToUwiZAtg1JEWTRuWZ6jIe8,2883
|
|
118
|
-
notionary/page/content/parser/parsers/video.py,sha256=
|
|
138
|
+
notionary/page/content/parser/parsers/video.py,sha256=p_SgliZbHJfRABQY_CLjyoYSPUTow9fgzxg7CJM92vc,637
|
|
119
139
|
notionary/page/content/parser/post_processing/port.py,sha256=ZjTz9pIrk3R8Hy_NdRWmYTYrGScNyWyqgzcSUk_1BkI,248
|
|
120
140
|
notionary/page/content/parser/post_processing/service.py,sha256=Wp_30iCcqtB7qZdO__E6f_WjNKhkaOQML6q4dW33bJM,608
|
|
121
141
|
notionary/page/content/parser/post_processing/handlers/__init__.py,sha256=Io7Qw_bR6lDXCCuFWUZqR5QmmZwqKG-icE1hRoRivIk,144
|
|
122
142
|
notionary/page/content/parser/post_processing/handlers/rich_text_length.py,sha256=mFiKqq-dPHzUnjXHrWmHRXeU5WUCdGk7HplDxvCCbaE,3571
|
|
123
143
|
notionary/page/content/parser/post_processing/handlers/rich_text_length_truncation.py,sha256=UZhH3ifJtiJrV22jBAQqnTAWWJCAhmp0F4n0gY1RAE0,4143
|
|
124
144
|
notionary/page/content/parser/pre_processsing/service.py,sha256=moa5sHuNvzUQCVGe-4IvqrCEWtIaEMD6M7FMjLXENcM,507
|
|
125
|
-
notionary/page/content/parser/pre_processsing/handlers/__init__.py,sha256=
|
|
126
|
-
notionary/page/content/parser/pre_processsing/handlers/column_syntax.py,sha256=
|
|
127
|
-
notionary/page/content/parser/pre_processsing/handlers/indentation.py,sha256=
|
|
145
|
+
notionary/page/content/parser/pre_processsing/handlers/__init__.py,sha256=RX6VC1Q9tJAAjtt92hjOy20fcT7yFZP6PvNBjsp79sE,397
|
|
146
|
+
notionary/page/content/parser/pre_processsing/handlers/column_syntax.py,sha256=pd4uFYCriDZWZmM8Ma7nUZMcPh0DExQO0J37Gfpn1Jo,5456
|
|
147
|
+
notionary/page/content/parser/pre_processsing/handlers/indentation.py,sha256=RconFOfl0VR4_RHa4Kqcv9vmbK5xiXSUEXjoMPf1RJU,3324
|
|
128
148
|
notionary/page/content/parser/pre_processsing/handlers/port.py,sha256=Gm_GRGl1eGo1C8AM5CUfFdYAofe4Y0gAPScU2O1EcJo,153
|
|
129
|
-
notionary/page/content/parser/pre_processsing/handlers/
|
|
149
|
+
notionary/page/content/parser/pre_processsing/handlers/video_syntax.py,sha256=O4AA8Gea81NBJklGD-JE4IAeb-IEeWTE2wLTm8BXP1E,2731
|
|
150
|
+
notionary/page/content/parser/pre_processsing/handlers/whitespace.py,sha256=GknAlc4bm2T13MwPz3F-ZP_T_En6-KCQXneqToc2l5I,2685
|
|
130
151
|
notionary/page/content/renderer/context.py,sha256=yiEl0zHWrvfdqXm3tV7IQkuYhoIKaWv3s_PKCNyhRZ8,2015
|
|
131
152
|
notionary/page/content/renderer/factory.py,sha256=YUV0FQ55sPYwTpvDg1n-WoBio4UNUTj3cFg7IGzauzk,8901
|
|
132
153
|
notionary/page/content/renderer/service.py,sha256=llgxgijk6_rYGMLvYW9OdgcpLSk8xxg2mEELRK54CY0,1916
|
|
@@ -135,7 +156,7 @@ notionary/page/content/renderer/post_processing/service.py,sha256=dCc6GRRDkT3NmV
|
|
|
135
156
|
notionary/page/content/renderer/post_processing/handlers/__init__.py,sha256=LurntAvtz38tBpm3KAfd_Z-EyaxfG6WS_JPrytfc32M,144
|
|
136
157
|
notionary/page/content/renderer/post_processing/handlers/numbered_list.py,sha256=Ry7RpKa-VSp9VWShvu9KzoWgvyVGeJ3iy5z05o47mdk,5825
|
|
137
158
|
notionary/page/content/renderer/renderers/__init__.py,sha256=YinHG6qfAPRTLD2-fts0gnuDuxQW9ZMBXflxoEfQ16o,1636
|
|
138
|
-
notionary/page/content/renderer/renderers/audio.py,sha256=
|
|
159
|
+
notionary/page/content/renderer/renderers/audio.py,sha256=pUvs8FxgnjzggR3LQx33AwaJwH0EvAMNq-Lkp2p_HIY,729
|
|
139
160
|
notionary/page/content/renderer/renderers/base.py,sha256=2y8pnPmk-Kf2eA_MKVsGsnt9oKuefaRx5C_ZWsrRa7c,1071
|
|
140
161
|
notionary/page/content/renderer/renderers/bookmark.py,sha256=rpd1SBDNO2uoCCRynGGHeqgudMzDXXNra-hTt3vxJdY,815
|
|
141
162
|
notionary/page/content/renderer/renderers/breadcrumb.py,sha256=M_Qlu73LmSwcCzsF1IJywZIekzOVBP1rd8md51dvfq8,782
|
|
@@ -149,61 +170,61 @@ notionary/page/content/renderer/renderers/divider.py,sha256=S6XvueUgihBC5I5y7_WH
|
|
|
149
170
|
notionary/page/content/renderer/renderers/embed.py,sha256=v5Ycztt4koB-uboAn0b9hrvkM0SohBSQMFw_z75_cGw,794
|
|
150
171
|
notionary/page/content/renderer/renderers/equation.py,sha256=lLZ82s2y_K_0avrp6eX8LLvWXTnPX_9kI6bwhGFKe-g,1363
|
|
151
172
|
notionary/page/content/renderer/renderers/fallback.py,sha256=R-w6k5N3EmTQ5ytSzPNykpNwm9tq3dW71Xffchj4qXA,918
|
|
152
|
-
notionary/page/content/renderer/renderers/file.py,sha256=
|
|
173
|
+
notionary/page/content/renderer/renderers/file.py,sha256=3TUc_UFfyjIwSsqiaKKYrXawGxZsdJXBTE2Yh_AeiVY,928
|
|
174
|
+
notionary/page/content/renderer/renderers/file_like_block.py,sha256=FqmhxO9SgzZrzVK0YIgS83hnB0FBOtUOaQ_0VYmc8zQ,1295
|
|
153
175
|
notionary/page/content/renderer/renderers/heading.py,sha256=6F1imJeTsn8b7YNtySv-YWbl7XgGxn7SauXaM15tbWo,3770
|
|
154
|
-
notionary/page/content/renderer/renderers/image.py,sha256=
|
|
176
|
+
notionary/page/content/renderer/renderers/image.py,sha256=xMgrnTteISZPRA31juo3BDt4hcZdtL4ddE4OA8KgfpE,729
|
|
155
177
|
notionary/page/content/renderer/renderers/numbered_list.py,sha256=QVzpozfROnuutjbjV-U1qB_VpwpX7m8viSfqE-J_J8s,1818
|
|
156
178
|
notionary/page/content/renderer/renderers/paragraph.py,sha256=srwCP13H9V22wM1Ned0UODWmYrSYlcn4FJgoPb1B4fM,1620
|
|
157
|
-
notionary/page/content/renderer/renderers/pdf.py,sha256=
|
|
179
|
+
notionary/page/content/renderer/renderers/pdf.py,sha256=ZSbMT0yno0sEDWxIa3Kfeow4SL2Gpjy6eR2oUx3l5N8,721
|
|
158
180
|
notionary/page/content/renderer/renderers/quote.py,sha256=oBYP3kPzzxIRcqj-F1FAqOemG70V95nHm3NBxOOX4os,1987
|
|
159
181
|
notionary/page/content/renderer/renderers/table.py,sha256=CqmV9ii6MVbd8YJvJ18HXBPWXEaSM0i2ufgKJIbJlCo,4619
|
|
160
182
|
notionary/page/content/renderer/renderers/table_of_contents.py,sha256=pWlkz-jQ2jviI-it0XxJQsZ0G5I2ZtxZkC7pBSWnRBg,988
|
|
161
183
|
notionary/page/content/renderer/renderers/table_row.py,sha256=Zs1yFsU4hKIZizg4rGo8THGZ0VKrb3KNUQOT9ehmzFk,623
|
|
162
184
|
notionary/page/content/renderer/renderers/todo.py,sha256=J0hwarEEBhwlDvgSR5jwlJ_cvMw3dpi_UYaWZHCCYEc,2137
|
|
163
185
|
notionary/page/content/renderer/renderers/toggle.py,sha256=BGGvDlQMCaZxUQw-kmv5M5RZq86UZAWvBLLPkagKVtc,2045
|
|
164
|
-
notionary/page/content/renderer/renderers/video.py,sha256=
|
|
165
|
-
notionary/page/content/syntax/__init__.py,sha256=
|
|
186
|
+
notionary/page/content/renderer/renderers/video.py,sha256=h6YK0xjuOhkOs75C7sQtEAPlW554N83hgL9QcuBVEuo,729
|
|
187
|
+
notionary/page/content/syntax/__init__.py,sha256=jnZ5N8xwnJaPED326yf0meyejd7_XQqc-w4Uh7SpDM0,185
|
|
166
188
|
notionary/page/content/syntax/grammar.py,sha256=vWJ1rgtekcRH4uIb94q83kYaBxmDD0E5YS7oGQR_1Aw,252
|
|
167
189
|
notionary/page/content/syntax/models.py,sha256=pkFoQVMu4eg6xIyi9JYkeRgegrB-QUAw7wlRrIKGIXE,1830
|
|
168
|
-
notionary/page/content/syntax/registry.py,sha256=
|
|
169
|
-
notionary/page/properties/client.py,sha256=
|
|
190
|
+
notionary/page/content/syntax/registry.py,sha256=6aAejkA1Snyr5z3hRdO_M1eLZLaSCGd1uixsmMycBRE,15208
|
|
191
|
+
notionary/page/properties/client.py,sha256=Dr2EpVWUFpdnA1bsKC7P-Mozyo2YurufJ5xOumcTjVc,6750
|
|
170
192
|
notionary/page/properties/factory.py,sha256=YnVWZ98RGYpV9iEY4Ufk7InIoeP9vWwMn5sSvcbSQ2k,1248
|
|
171
|
-
notionary/page/properties/
|
|
172
|
-
notionary/page/properties/service.py,sha256=
|
|
193
|
+
notionary/page/properties/schemas.py,sha256=0QOgbtJYsAI8oVnp6ZNgHhiJqRHWRRDpD8B8oYPCUKo,8548
|
|
194
|
+
notionary/page/properties/service.py,sha256=l9Yk8VTSQoGIFZIf3Zgein5cqWsuPFebRpEtmjcMZo8,13179
|
|
173
195
|
notionary/shared/typings.py,sha256=LKg_NJvqi0ZuyB6I995zg4XCyijGKY0T_bW90YiI5_g,58
|
|
174
196
|
notionary/shared/entity/client.py,sha256=knblCIKwUHgoxJ_z7QtrRES9E8P9keHQTvr6CMc69gA,1181
|
|
175
|
-
notionary/shared/entity/dto_parsers.py,sha256=
|
|
176
|
-
notionary/shared/entity/entity_metadata_update_client.py,sha256=
|
|
177
|
-
notionary/shared/entity/schemas.py,sha256
|
|
178
|
-
notionary/shared/entity/service.py,sha256=
|
|
179
|
-
notionary/shared/models/
|
|
180
|
-
notionary/shared/models/
|
|
181
|
-
notionary/shared/models/icon.py,sha256=f1NVijUb4B_HhcGA7GtVsS1izycb8u8R7A3uy5qAu0o,603
|
|
197
|
+
notionary/shared/entity/dto_parsers.py,sha256=XR0I0YiQ5bPASM8_QG09WAyEIYwEV6TmAOkiAlbq79c,601
|
|
198
|
+
notionary/shared/entity/entity_metadata_update_client.py,sha256=t1shao5GEtHb1E-dixgZcQ1Ap-q0ntytQaQwEUaAJxY,2408
|
|
199
|
+
notionary/shared/entity/schemas.py,sha256=SpcpWnNYmhjsVhR66bRCst68YU7IJk52f9x66L_V0Ic,1072
|
|
200
|
+
notionary/shared/entity/service.py,sha256=T5TGMYpQYaTapugtK8-AqtoYpHAoGdtRRkCVCkhy3TM,9793
|
|
201
|
+
notionary/shared/models/file.py,sha256=P0BDebYAr7iyU_th2HLLcmze8RWpd5cULqdIrhG6x4o,1146
|
|
202
|
+
notionary/shared/models/icon.py,sha256=XGkNmMA13iDkLeMo0cpz2t7JwxEnXfxEeSvJs3OisJo,402
|
|
182
203
|
notionary/shared/models/parent.py,sha256=fptJhWHot35jN9IH9BhsXNMZfNClc8av1G2TR6SqRmY,888
|
|
183
204
|
notionary/shared/properties/type.py,sha256=04KNeWGzphJ2hN6AbVhfDfF89XxtSGzcmnatcPHkEQI,780
|
|
184
205
|
notionary/user/__init__.py,sha256=O1sa9EPnJKZgpEAARJhzgh0ULqmwB-JNIgoPUCwDGMo,111
|
|
185
206
|
notionary/user/base.py,sha256=M2psGOJt6YLKFMw_iWEYave67sfoBa2_0Sij00Zen5M,4362
|
|
186
|
-
notionary/user/bot.py,sha256=
|
|
207
|
+
notionary/user/bot.py,sha256=fibcqxOL2Mfq6YXwzplqr1ZLTrpwDsHC6B6Xwmd_sYg,2585
|
|
187
208
|
notionary/user/client.py,sha256=CDevJlHfNnrfPE2OaaLWXeNro72J4ezCfwgdM_SJeAg,1410
|
|
188
209
|
notionary/user/factory.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
189
210
|
notionary/user/person.py,sha256=8w0xMNVLen8xx2DSff-3Y9H7x9A0B3FLZUZJQZ_qe4g,1144
|
|
190
211
|
notionary/user/schemas.py,sha256=ZPKopqd6OepGFPnbK3B13PgNH6l4hLCGMxpk0eWe41s,1432
|
|
191
212
|
notionary/user/service.py,sha256=20DaDC4Eozfzr2sf0VP3z6sORRKmfb5PdtGG02rJews,2565
|
|
192
213
|
notionary/utils/date.py,sha256=HPwqmZoylTFKkyI8q4BJXT3q9B39nE55uVZAyG4JnDw,1729
|
|
193
|
-
notionary/utils/decorators.py,sha256=
|
|
214
|
+
notionary/utils/decorators.py,sha256=QGn3k26dOASlb8uADyMflhHEZwfwaAQsRh-vAqu0Xos,3736
|
|
194
215
|
notionary/utils/fuzzy.py,sha256=k_D48yHbSd_ecFo3QlrxF5-5c3Bd8gR3bq-_W2J2ZyE,1783
|
|
195
|
-
notionary/utils/pagination.py,sha256=
|
|
216
|
+
notionary/utils/pagination.py,sha256=6h1ZZpgn5YFBBUCGAVntZ45wCeFiQRJhW0JqPPtN9Ws,3343
|
|
196
217
|
notionary/utils/uuid_utils.py,sha256=ygTQdiKmdtyb2iY7d9kuYbo8uGSeuhiHH2PhUza6ZUw,579
|
|
197
218
|
notionary/utils/mixins/logging.py,sha256=fCkHFYhNYeVfppCjD5WLKxY7Sr3FHlJ5UhNd7KzrvsM,1662
|
|
198
|
-
notionary/workspace/__init__.py,sha256=
|
|
199
|
-
notionary/workspace/client.py,sha256=
|
|
219
|
+
notionary/workspace/__init__.py,sha256=UBnuTDa4QO1Ne3OksVXVw-r7Eorv2tm66AfRGGALRrA,208
|
|
220
|
+
notionary/workspace/client.py,sha256=yChqszwc1FZeuWboqDSEMSkBPNhDO5buOGpdWqJDxLM,2447
|
|
200
221
|
notionary/workspace/schemas.py,sha256=uITRJpqHZD7LF7wOqZ6Cdx51a4Uk9rWZ110ib9EbIrA,562
|
|
201
|
-
notionary/workspace/service.py,sha256=
|
|
202
|
-
notionary/workspace/query/__init__.py,sha256=
|
|
203
|
-
notionary/workspace/query/builder.py,sha256=
|
|
204
|
-
notionary/workspace/query/models.py,sha256=
|
|
205
|
-
notionary/workspace/query/service.py,sha256
|
|
206
|
-
notionary-0.
|
|
207
|
-
notionary-0.
|
|
208
|
-
notionary-0.
|
|
209
|
-
notionary-0.
|
|
222
|
+
notionary/workspace/service.py,sha256=NDoUe-uSUDiv7FJFanWxDnFcjTVVtVWXStbQYnptoIQ,5412
|
|
223
|
+
notionary/workspace/query/__init__.py,sha256=qK-D7DVUpAeil6hQBJ0Cyi2m-nCcz5TA5qso70eyDw4,173
|
|
224
|
+
notionary/workspace/query/builder.py,sha256=0QV0OHAWIU0O5tXOeTQFKKNNmwaC81nLk_ecHrxdokE,2887
|
|
225
|
+
notionary/workspace/query/models.py,sha256=isebZ9wyvj75C65nhw3VsuJygyZmgZBNX8D5VOf3TAM,1851
|
|
226
|
+
notionary/workspace/query/service.py,sha256=I3ZlKoeOKeRfHuvtozzWSDOxETZAlsGpaNcvu2kZjto,4781
|
|
227
|
+
notionary-0.4.0.dist-info/METADATA,sha256=f-PuuABbfGoF4YGOl5Lni7OZCmEU3FrheIjb3irFNjk,6493
|
|
228
|
+
notionary-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
229
|
+
notionary-0.4.0.dist-info/licenses/LICENSE,sha256=FLNy3l12swSnCggq3zOW_3gh4uaZ12DGZL1tR6Bc5Sk,1102
|
|
230
|
+
notionary-0.4.0.dist-info/RECORD,,
|
notionary/file_upload/models.py
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
from typing import Literal
|
|
3
|
-
|
|
4
|
-
from pydantic import BaseModel
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class UploadMode(str, Enum):
|
|
8
|
-
"""Enum for file upload modes."""
|
|
9
|
-
|
|
10
|
-
SINGLE_PART = "single_part"
|
|
11
|
-
MULTI_PART = "multi_part"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class FileUploadResponse(BaseModel):
|
|
15
|
-
"""
|
|
16
|
-
Represents a Notion file upload object as returned by the File Upload API.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
object: Literal["file_upload"]
|
|
20
|
-
id: str
|
|
21
|
-
created_time: str
|
|
22
|
-
last_edited_time: str
|
|
23
|
-
expiry_time: str
|
|
24
|
-
upload_url: str
|
|
25
|
-
archived: bool
|
|
26
|
-
status: str # "pending", "uploaded", "failed", etc.
|
|
27
|
-
filename: str | None = None
|
|
28
|
-
content_type: str | None = None
|
|
29
|
-
content_length: int | None = None
|
|
30
|
-
request_id: str
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class FileUploadListResponse(BaseModel):
|
|
34
|
-
"""
|
|
35
|
-
Response model for listing file uploads from /v1/file_uploads endpoint.
|
|
36
|
-
"""
|
|
37
|
-
|
|
38
|
-
object: Literal["list"]
|
|
39
|
-
results: list[FileUploadResponse]
|
|
40
|
-
next_cursor: str | None = None
|
|
41
|
-
has_more: bool
|
|
42
|
-
type: Literal["file_upload"]
|
|
43
|
-
file_upload: dict = {}
|
|
44
|
-
request_id: str
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class FileUploadCreateRequest(BaseModel):
|
|
48
|
-
"""
|
|
49
|
-
Request model for creating a file upload.
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
filename: str
|
|
53
|
-
content_type: str | None = None
|
|
54
|
-
content_length: int | None = None
|
|
55
|
-
mode: UploadMode = UploadMode.SINGLE_PART
|
|
56
|
-
|
|
57
|
-
def model_dump(self, **kwargs):
|
|
58
|
-
"""Override to exclude None values"""
|
|
59
|
-
data = super().model_dump(**kwargs)
|
|
60
|
-
return {k: v for k, v in data.items() if v is not None}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class FileUploadCompleteRequest(BaseModel):
|
|
64
|
-
"""
|
|
65
|
-
Request model for completing a multi-part file upload.
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
# Usually empty for complete requests, but keeping for future extensibility
|
|
69
|
-
pass
|
notionary/page/page_context.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from contextvars import ContextVar
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
from typing import TYPE_CHECKING
|
|
6
|
-
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from notionary.file_upload import FileUploadHttpClient
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@dataclass(frozen=True)
|
|
12
|
-
class PageContextProvider:
|
|
13
|
-
"""Context object that provides dependencies for block conversion operations."""
|
|
14
|
-
|
|
15
|
-
page_id: str
|
|
16
|
-
file_upload_client: FileUploadHttpClient
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Context variable
|
|
20
|
-
_page_context: ContextVar[PageContextProvider | None] = ContextVar("page_context", default=None)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def get_page_context() -> PageContextProvider:
|
|
24
|
-
"""Get current page context or raise if not available."""
|
|
25
|
-
context = _page_context.get()
|
|
26
|
-
if context is None:
|
|
27
|
-
raise RuntimeError("No page context available. Use 'async with page_context(...)'")
|
|
28
|
-
return context
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class page_context:
|
|
32
|
-
def __init__(self, provider: PageContextProvider) -> None:
|
|
33
|
-
self.provider = provider
|
|
34
|
-
self._token = None
|
|
35
|
-
|
|
36
|
-
def _set_context(self) -> PageContextProvider:
|
|
37
|
-
self._token = _page_context.set(self.provider)
|
|
38
|
-
return self.provider
|
|
39
|
-
|
|
40
|
-
def _reset_context(self) -> None:
|
|
41
|
-
"""Helper to reset context."""
|
|
42
|
-
if self._token is not None:
|
|
43
|
-
_page_context.reset(self._token)
|
|
44
|
-
|
|
45
|
-
async def __aenter__(self) -> PageContextProvider:
|
|
46
|
-
return self._set_context()
|
|
47
|
-
|
|
48
|
-
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
49
|
-
self._reset_context()
|
|
50
|
-
return False
|
notionary/shared/models/cover.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
from enum import StrEnum
|
|
2
|
-
from typing import Literal, Self
|
|
3
|
-
|
|
4
|
-
from pydantic import BaseModel
|
|
5
|
-
|
|
6
|
-
from notionary.shared.models.file import ExternalFile
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class CoverType(StrEnum):
|
|
10
|
-
EXTERNAL = "external"
|
|
11
|
-
FILE = "file"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class NotionCover(BaseModel):
|
|
15
|
-
type: Literal[CoverType.EXTERNAL, CoverType.FILE] = CoverType.EXTERNAL
|
|
16
|
-
external: ExternalFile | None = None
|
|
17
|
-
|
|
18
|
-
@classmethod
|
|
19
|
-
def from_url(cls, url: str) -> Self:
|
|
20
|
-
return cls(external=ExternalFile(url=url))
|
|
File without changes
|
|
File without changes
|