better-notion 1.8.0__tar.gz → 1.8.2__tar.gz
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.
- {better_notion-1.8.0 → better_notion-1.8.2}/PKG-INFO +1 -1
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents.py +11 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents_sdk/models.py +178 -100
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/workspace.py +11 -1
- {better_notion-1.8.0 → better_notion-1.8.2}/pyproject.toml +1 -1
- {better_notion-1.8.0 → better_notion-1.8.2}/.gitignore +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/LICENSE +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/README.md +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/client.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/collections/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/collections/blocks.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/collections/comments.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/collections/databases.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/collections/pages.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/collections/users.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/entities/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/entities/block.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/entities/comment.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/entities/database.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/entities/page.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/entities/user.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/errors.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/oauth.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/base.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/checkbox.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/date.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/email.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/number.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/phone.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/rich_text.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/select.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/title.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/properties/url.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/utils/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_api/utils/pagination.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/async_typer.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/auth.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/blocks.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/comments.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/config.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/databases.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/pages.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/plugins.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/search.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/update.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/users.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/commands/workspace.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/config.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/display.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/docs/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/docs/base.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/docs/formatters.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/docs/registry.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/errors.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/main.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/markdown.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/response.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_cli/utils/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/base/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/base/entity.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/cache/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/cache/cache.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/client.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/managers/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/managers/block_manager.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/managers/comment_manager.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/managers/database_manager.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/managers/page_manager.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/managers/user_manager.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/block.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/audio.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/bookmark.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/breadcrumb.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/bullet.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/callout.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/code.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/column.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/column_list.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/divider.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/embed.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/equation.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/file.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/heading.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/image.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/numbered.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/paragraph.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/pdf.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/quote.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/synced_block.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/table.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/table_row.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/template.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/todo.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/toggle.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/blocks/video.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/comment.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/database.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/page.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/models/user.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/parents/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/plugins.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/properties/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/properties/formula.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/properties/parsers.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/properties/relation.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/query/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/query/database_query.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/_sdk/query/filter_translator.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/base.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/loader.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents_cli.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents_schema.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents_sdk/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents_sdk/managers.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents_sdk/plugin.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/productivity.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/state.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/auth.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/dependency_resolver.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/metadata.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/project_context.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/rbac.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/schemas.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/agents/state_machine.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/helpers.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/retry.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/better_notion/utils/validators.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/base/test_entity.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/cache/test_cache.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/models/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/models/blocks/test_advanced_blocks.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/models/test_block.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/models/test_database.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/models/test_database_bug.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/models/test_page.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/models/test_user.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/properties/test_formula.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/properties/test_parsers.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/properties/test_relation.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/query/test_database_query.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/query/test_filter_translator.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/test_client.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/_sdk/test_comment.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_auth.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_dependency_resolver.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_plugin.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_project_context.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_rbac.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_schemas.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_state_machine.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/agents/test_workspace.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_async_typer.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_config.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_display.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_errors.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_main.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_pages_commands.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_response.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/cli/test_update.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/conftest.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/integration/conftest.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/integration/test_blocks.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/integration/test_databases.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/integration/test_pages.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/integration/test_search.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/integration/test_users.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_agents_cli.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_agents_sdk_integration.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_agents_sdk_managers.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_agents_sdk_models.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_base.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_loader.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_marketplace.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_plugin_commands_state.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_productivity_plugin.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/plugins/test_state.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/sdk/__init__.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/sdk/test_plugin_system.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/test_metadata.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/test_schema_command.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/unit/test_client.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/unit/test_collections.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/unit/test_entities.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/unit/test_errors.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/unit/test_helpers.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/unit/test_properties.py +0 -0
- {better_notion-1.8.0 → better_notion-1.8.2}/tests/utils/test_retry.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: better-notion
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.2
|
|
4
4
|
Summary: A high-level Python SDK for the Notion API with developer experience in mind.
|
|
5
5
|
Project-URL: Homepage, https://github.com/nesalia-inc/better-notion
|
|
6
6
|
Project-URL: Documentation, https://github.com/nesalia-inc/better-notion#readme
|
|
@@ -156,12 +156,23 @@ class AgentsPlugin(CombinedPluginInterface):
|
|
|
156
156
|
|
|
157
157
|
if existing:
|
|
158
158
|
database_ids = existing.get("database_ids", {})
|
|
159
|
+
|
|
160
|
+
# Save workspace config for subsequent commands
|
|
161
|
+
# This fixes the bug where --skip detected workspace but didn't save config,
|
|
162
|
+
# causing subsequent commands (agents orgs create, etc.) to fail
|
|
163
|
+
initializer._database_ids = database_ids
|
|
164
|
+
initializer._parent_page_id = parent_page_id
|
|
165
|
+
initializer._workspace_id = existing.get("workspace_id")
|
|
166
|
+
initializer._workspace_name = existing.get("workspace_name", workspace_name)
|
|
167
|
+
initializer.save_database_ids()
|
|
168
|
+
|
|
159
169
|
return format_success(
|
|
160
170
|
{
|
|
161
171
|
"message": "Workspace already exists, skipping initialization",
|
|
162
172
|
"workspace_id": existing.get("workspace_id"),
|
|
163
173
|
"databases_found": len(database_ids),
|
|
164
174
|
"database_ids": database_ids,
|
|
175
|
+
"config_saved": True,
|
|
165
176
|
},
|
|
166
177
|
meta={
|
|
167
178
|
"command": "agents init",
|
{better_notion-1.8.0 → better_notion-1.8.2}/better_notion/plugins/official/agents_sdk/models.py
RENAMED
|
@@ -199,22 +199,28 @@ class Organization(BaseEntity):
|
|
|
199
199
|
|
|
200
200
|
# Build properties
|
|
201
201
|
properties: dict[str, Any] = {
|
|
202
|
-
"Name": Title(name),
|
|
202
|
+
"Name": Title(content=name),
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
if slug:
|
|
206
|
-
properties["Slug"] = RichText(slug)
|
|
206
|
+
properties["Slug"] = RichText(name="Slug", content=slug)
|
|
207
207
|
if description:
|
|
208
|
-
properties["Description"] = RichText(description)
|
|
208
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
209
209
|
if repository_url:
|
|
210
|
-
properties["Repository URL"] = URL(repository_url)
|
|
210
|
+
properties["Repository URL"] = URL(name="Repository URL", url=repository_url)
|
|
211
211
|
if status:
|
|
212
|
-
properties["Status"] = Select(status)
|
|
212
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
213
|
+
|
|
214
|
+
# Convert Property objects to dicts for API
|
|
215
|
+
serialized_properties = {
|
|
216
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
217
|
+
for key, prop in properties.items()
|
|
218
|
+
}
|
|
213
219
|
|
|
214
220
|
# Create page
|
|
215
221
|
data = await client._api.pages.create(
|
|
216
222
|
parent={"database_id": database_id},
|
|
217
|
-
properties=
|
|
223
|
+
properties=serialized_properties,
|
|
218
224
|
)
|
|
219
225
|
|
|
220
226
|
org = cls(client, data)
|
|
@@ -257,20 +263,26 @@ class Organization(BaseEntity):
|
|
|
257
263
|
properties: dict[str, Any] = {}
|
|
258
264
|
|
|
259
265
|
if name is not None:
|
|
260
|
-
properties["Name"] = Title(name)
|
|
266
|
+
properties["Name"] = Title(content=name)
|
|
261
267
|
if slug is not None:
|
|
262
|
-
properties["Slug"] = RichText(slug)
|
|
268
|
+
properties["Slug"] = RichText(name="Slug", content=slug)
|
|
263
269
|
if description is not None:
|
|
264
|
-
properties["Description"] = RichText(description)
|
|
270
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
265
271
|
if repository_url is not None:
|
|
266
|
-
properties["Repository URL"] = URL(repository_url)
|
|
272
|
+
properties["Repository URL"] = URL(name="Repository URL", url=repository_url)
|
|
267
273
|
if status is not None:
|
|
268
|
-
properties["Status"] = Select(status)
|
|
274
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
275
|
+
|
|
276
|
+
# Convert Property objects to dicts for API
|
|
277
|
+
serialized_properties = {
|
|
278
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
279
|
+
for key, prop in properties.items()
|
|
280
|
+
}
|
|
269
281
|
|
|
270
282
|
# Update page
|
|
271
283
|
data = await self._client._api.pages.update(
|
|
272
284
|
page_id=self.id,
|
|
273
|
-
properties=
|
|
285
|
+
properties=serialized_properties,
|
|
274
286
|
)
|
|
275
287
|
|
|
276
288
|
# Update instance
|
|
@@ -488,26 +500,32 @@ class Project(BaseEntity):
|
|
|
488
500
|
|
|
489
501
|
# Build properties
|
|
490
502
|
properties: dict[str, Any] = {
|
|
491
|
-
"Name": Title(name),
|
|
503
|
+
"Name": Title(content=name),
|
|
492
504
|
"Organization": Relation([organization_id]),
|
|
493
|
-
"Role": Select(role),
|
|
505
|
+
"Role": Select(name="Role", value=role),
|
|
494
506
|
}
|
|
495
507
|
|
|
496
508
|
if slug:
|
|
497
|
-
properties["Slug"] = RichText(slug)
|
|
509
|
+
properties["Slug"] = RichText(name="Slug", content=slug)
|
|
498
510
|
if description:
|
|
499
|
-
properties["Description"] = RichText(description)
|
|
511
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
500
512
|
if repository:
|
|
501
|
-
properties["Repository"] = URL(repository)
|
|
513
|
+
properties["Repository"] = URL(name="Repository", url=repository)
|
|
502
514
|
if status:
|
|
503
|
-
properties["Status"] = Select(status)
|
|
515
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
504
516
|
if tech_stack:
|
|
505
|
-
properties["Tech Stack"] = MultiSelect(tech_stack)
|
|
517
|
+
properties["Tech Stack"] = MultiSelect(name="Tech Stack", values=tech_stack)
|
|
518
|
+
|
|
519
|
+
# Convert Property objects to dicts for API
|
|
520
|
+
serialized_properties = {
|
|
521
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
522
|
+
for key, prop in properties.items()
|
|
523
|
+
}
|
|
506
524
|
|
|
507
525
|
# Create page
|
|
508
526
|
data = await client._api.pages.create(
|
|
509
527
|
parent={"database_id": database_id},
|
|
510
|
-
properties=
|
|
528
|
+
properties=serialized_properties,
|
|
511
529
|
)
|
|
512
530
|
|
|
513
531
|
project = cls(client, data)
|
|
@@ -537,24 +555,30 @@ class Project(BaseEntity):
|
|
|
537
555
|
properties: dict[str, Any] = {}
|
|
538
556
|
|
|
539
557
|
if name is not None:
|
|
540
|
-
properties["Name"] = Title(name)
|
|
558
|
+
properties["Name"] = Title(content=name)
|
|
541
559
|
if slug is not None:
|
|
542
|
-
properties["Slug"] = RichText(slug)
|
|
560
|
+
properties["Slug"] = RichText(name="Slug", content=slug)
|
|
543
561
|
if description is not None:
|
|
544
|
-
properties["Description"] = RichText(description)
|
|
562
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
545
563
|
if repository is not None:
|
|
546
|
-
properties["Repository"] = URL(repository)
|
|
564
|
+
properties["Repository"] = URL(name="Repository", url=repository)
|
|
547
565
|
if status is not None:
|
|
548
|
-
properties["Status"] = Select(status)
|
|
566
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
549
567
|
if tech_stack is not None:
|
|
550
|
-
properties["Tech Stack"] = MultiSelect(tech_stack)
|
|
568
|
+
properties["Tech Stack"] = MultiSelect(name="Tech Stack", values=tech_stack)
|
|
551
569
|
if role is not None:
|
|
552
|
-
properties["Role"] = Select(role)
|
|
570
|
+
properties["Role"] = Select(name="Role", value=role)
|
|
571
|
+
|
|
572
|
+
# Convert Property objects to dicts for API
|
|
573
|
+
serialized_properties = {
|
|
574
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
575
|
+
for key, prop in properties.items()
|
|
576
|
+
}
|
|
553
577
|
|
|
554
578
|
# Update page
|
|
555
579
|
data = await self._client._api.pages.update(
|
|
556
580
|
page_id=self.id,
|
|
557
|
-
properties=
|
|
581
|
+
properties=serialized_properties,
|
|
558
582
|
)
|
|
559
583
|
|
|
560
584
|
# Update instance
|
|
@@ -734,15 +758,15 @@ class Version(BaseEntity):
|
|
|
734
758
|
|
|
735
759
|
# Build properties
|
|
736
760
|
properties: dict[str, Any] = {
|
|
737
|
-
"Version": Title(name),
|
|
761
|
+
"Version": Title(content=name),
|
|
738
762
|
"Project": Relation([project_id]),
|
|
739
|
-
"Status": Select(status),
|
|
740
|
-
"Type": Select(version_type),
|
|
741
|
-
"Progress": Number(progress),
|
|
763
|
+
"Status": Select(name="Status", value=status),
|
|
764
|
+
"Type": Select(name="Type", value=version_type),
|
|
765
|
+
"Progress": Number(name="Progress", value=progress),
|
|
742
766
|
}
|
|
743
767
|
|
|
744
768
|
if branch_name:
|
|
745
|
-
properties["Branch Name"] = RichText(branch_name)
|
|
769
|
+
properties["Branch Name"] = RichText(name="Branch Name", content=branch_name)
|
|
746
770
|
|
|
747
771
|
# Create page
|
|
748
772
|
data = await client._api.pages.create(
|
|
@@ -775,20 +799,26 @@ class Version(BaseEntity):
|
|
|
775
799
|
properties: dict[str, Any] = {}
|
|
776
800
|
|
|
777
801
|
if name is not None:
|
|
778
|
-
properties["Version"] = Title(name)
|
|
802
|
+
properties["Version"] = Title(content=name)
|
|
779
803
|
if status is not None:
|
|
780
|
-
properties["Status"] = Select(status)
|
|
804
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
781
805
|
if version_type is not None:
|
|
782
|
-
properties["Type"] = Select(version_type)
|
|
806
|
+
properties["Type"] = Select(name="Type", value=version_type)
|
|
783
807
|
if branch_name is not None:
|
|
784
|
-
properties["Branch Name"] = RichText(branch_name)
|
|
808
|
+
properties["Branch Name"] = RichText(name="Branch Name", content=branch_name)
|
|
785
809
|
if progress is not None:
|
|
786
|
-
properties["Progress"] = Number(progress)
|
|
810
|
+
properties["Progress"] = Number(name="Progress", value=progress)
|
|
811
|
+
|
|
812
|
+
# Convert Property objects to dicts for API
|
|
813
|
+
serialized_properties = {
|
|
814
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
815
|
+
for key, prop in properties.items()
|
|
816
|
+
}
|
|
787
817
|
|
|
788
818
|
# Update page
|
|
789
819
|
data = await self._client._api.pages.update(
|
|
790
820
|
page_id=self.id,
|
|
791
|
-
properties=
|
|
821
|
+
properties=serialized_properties,
|
|
792
822
|
)
|
|
793
823
|
|
|
794
824
|
# Update instance
|
|
@@ -989,22 +1019,28 @@ class Task(BaseEntity):
|
|
|
989
1019
|
|
|
990
1020
|
# Build properties
|
|
991
1021
|
properties: dict[str, Any] = {
|
|
992
|
-
"Title": Title(title),
|
|
1022
|
+
"Title": Title(content=title),
|
|
993
1023
|
"Version": Relation([version_id]),
|
|
994
|
-
"Status": Select(status),
|
|
995
|
-
"Type": Select(task_type),
|
|
996
|
-
"Priority": Select(priority),
|
|
1024
|
+
"Status": Select(name="Status", value=status),
|
|
1025
|
+
"Type": Select(name="Type", value=task_type),
|
|
1026
|
+
"Priority": Select(name="Priority", value=priority),
|
|
997
1027
|
}
|
|
998
1028
|
|
|
999
1029
|
if dependency_ids:
|
|
1000
1030
|
properties["Dependencies"] = Relation(dependency_ids)
|
|
1001
1031
|
if estimated_hours is not None:
|
|
1002
|
-
properties["Estimated Hours"] = Number(estimated_hours)
|
|
1032
|
+
properties["Estimated Hours"] = Number(name="Estimated Hours", value=estimated_hours)
|
|
1033
|
+
|
|
1034
|
+
# Convert Property objects to dicts for API
|
|
1035
|
+
serialized_properties = {
|
|
1036
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1037
|
+
for key, prop in properties.items()
|
|
1038
|
+
}
|
|
1003
1039
|
|
|
1004
1040
|
# Create page
|
|
1005
1041
|
data = await client._api.pages.create(
|
|
1006
1042
|
parent={"database_id": database_id},
|
|
1007
|
-
properties=
|
|
1043
|
+
properties=serialized_properties,
|
|
1008
1044
|
)
|
|
1009
1045
|
|
|
1010
1046
|
task = cls(client, data)
|
|
@@ -1034,24 +1070,30 @@ class Task(BaseEntity):
|
|
|
1034
1070
|
properties: dict[str, Any] = {}
|
|
1035
1071
|
|
|
1036
1072
|
if title is not None:
|
|
1037
|
-
properties["Title"] = Title(title)
|
|
1073
|
+
properties["Title"] = Title(content=title)
|
|
1038
1074
|
if status is not None:
|
|
1039
|
-
properties["Status"] = Select(status)
|
|
1075
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
1040
1076
|
if task_type is not None:
|
|
1041
|
-
properties["Type"] = Select(task_type)
|
|
1077
|
+
properties["Type"] = Select(name="Type", value=task_type)
|
|
1042
1078
|
if priority is not None:
|
|
1043
|
-
properties["Priority"] = Select(priority)
|
|
1079
|
+
properties["Priority"] = Select(name="Priority", value=priority)
|
|
1044
1080
|
if dependency_ids is not None:
|
|
1045
1081
|
properties["Dependencies"] = Relation(dependency_ids)
|
|
1046
1082
|
if estimated_hours is not None:
|
|
1047
|
-
properties["Estimated Hours"] = Number(estimated_hours)
|
|
1083
|
+
properties["Estimated Hours"] = Number(name="Estimated Hours", value=estimated_hours)
|
|
1048
1084
|
if actual_hours is not None:
|
|
1049
|
-
properties["Actual Hours"] = Number(actual_hours)
|
|
1085
|
+
properties["Actual Hours"] = Number(name="Actual Hours", value=actual_hours)
|
|
1086
|
+
|
|
1087
|
+
# Convert Property objects to dicts for API
|
|
1088
|
+
serialized_properties = {
|
|
1089
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1090
|
+
for key, prop in properties.items()
|
|
1091
|
+
}
|
|
1050
1092
|
|
|
1051
1093
|
# Update page
|
|
1052
1094
|
data = await self._client._api.pages.update(
|
|
1053
1095
|
page_id=self.id,
|
|
1054
|
-
properties=
|
|
1096
|
+
properties=serialized_properties,
|
|
1055
1097
|
)
|
|
1056
1098
|
|
|
1057
1099
|
# Update instance
|
|
@@ -1324,26 +1366,32 @@ class Idea(BaseEntity):
|
|
|
1324
1366
|
from better_notion._api.properties import Title, RichText, Select, Relation
|
|
1325
1367
|
|
|
1326
1368
|
properties: dict[str, Any] = {
|
|
1327
|
-
"Title": Title(title),
|
|
1328
|
-
"Category": Select(category),
|
|
1329
|
-
"Status": Select(status),
|
|
1330
|
-
"Effort Estimate": Select(effort_estimate),
|
|
1369
|
+
"Title": Title(content=title),
|
|
1370
|
+
"Category": Select(name="Category", value=category),
|
|
1371
|
+
"Status": Select(name="Status", value=status),
|
|
1372
|
+
"Effort Estimate": Select(name="Effort Estimate", value=effort_estimate),
|
|
1331
1373
|
}
|
|
1332
1374
|
|
|
1333
1375
|
if description:
|
|
1334
|
-
properties["Description"] = RichText(description)
|
|
1376
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1335
1377
|
if proposed_solution:
|
|
1336
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1378
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1337
1379
|
if benefits:
|
|
1338
|
-
properties["Benefits"] = RichText(benefits)
|
|
1380
|
+
properties["Benefits"] = RichText(name="Benefits", content=benefits)
|
|
1339
1381
|
if context:
|
|
1340
|
-
properties["Context"] = RichText(context)
|
|
1382
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1341
1383
|
if project_id:
|
|
1342
1384
|
properties["Project"] = Relation([project_id])
|
|
1343
1385
|
|
|
1386
|
+
# Convert Property objects to dicts for API
|
|
1387
|
+
serialized_properties = {
|
|
1388
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1389
|
+
for key, prop in properties.items()
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1344
1392
|
data = await client._api.pages.create(
|
|
1345
1393
|
parent={"database_id": database_id},
|
|
1346
|
-
properties=
|
|
1394
|
+
properties=serialized_properties,
|
|
1347
1395
|
)
|
|
1348
1396
|
|
|
1349
1397
|
idea = cls(client, data)
|
|
@@ -1372,25 +1420,31 @@ class Idea(BaseEntity):
|
|
|
1372
1420
|
properties: dict[str, Any] = {}
|
|
1373
1421
|
|
|
1374
1422
|
if title is not None:
|
|
1375
|
-
properties["Title"] = Title(title)
|
|
1423
|
+
properties["Title"] = Title(content=title)
|
|
1376
1424
|
if category is not None:
|
|
1377
|
-
properties["Category"] = Select(category)
|
|
1425
|
+
properties["Category"] = Select(name="Category", value=category)
|
|
1378
1426
|
if status is not None:
|
|
1379
|
-
properties["Status"] = Select(status)
|
|
1427
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
1380
1428
|
if description is not None:
|
|
1381
|
-
properties["Description"] = RichText(description)
|
|
1429
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1382
1430
|
if proposed_solution is not None:
|
|
1383
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1431
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1384
1432
|
if benefits is not None:
|
|
1385
|
-
properties["Benefits"] = RichText(benefits)
|
|
1433
|
+
properties["Benefits"] = RichText(name="Benefits", content=benefits)
|
|
1386
1434
|
if effort_estimate is not None:
|
|
1387
|
-
properties["Effort Estimate"] = Select(effort_estimate)
|
|
1435
|
+
properties["Effort Estimate"] = Select(name="Effort Estimate", value=effort_estimate)
|
|
1388
1436
|
if context is not None:
|
|
1389
|
-
properties["Context"] = RichText(context)
|
|
1437
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1438
|
+
|
|
1439
|
+
# Convert Property objects to dicts for API
|
|
1440
|
+
serialized_properties = {
|
|
1441
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1442
|
+
for key, prop in properties.items()
|
|
1443
|
+
}
|
|
1390
1444
|
|
|
1391
1445
|
data = await self._client._api.pages.update(
|
|
1392
1446
|
page_id=self.id,
|
|
1393
|
-
properties=
|
|
1447
|
+
properties=serialized_properties,
|
|
1394
1448
|
)
|
|
1395
1449
|
|
|
1396
1450
|
self._data = data
|
|
@@ -1700,25 +1754,31 @@ class WorkIssue(BaseEntity):
|
|
|
1700
1754
|
from better_notion._api.properties import Title, RichText, Select, Relation
|
|
1701
1755
|
|
|
1702
1756
|
properties: dict[str, Any] = {
|
|
1703
|
-
"Title": Title(title),
|
|
1757
|
+
"Title": Title(content=title),
|
|
1704
1758
|
"Project": Relation([project_id]),
|
|
1705
|
-
"Type": Select(type),
|
|
1706
|
-
"Severity": Select(severity),
|
|
1707
|
-
"Status": Select(status),
|
|
1759
|
+
"Type": Select(name="Type", value=type),
|
|
1760
|
+
"Severity": Select(name="Severity", value=severity),
|
|
1761
|
+
"Status": Select(name="Status", value=status),
|
|
1708
1762
|
}
|
|
1709
1763
|
|
|
1710
1764
|
if task_id:
|
|
1711
1765
|
properties["Task"] = Relation([task_id])
|
|
1712
1766
|
if description:
|
|
1713
|
-
properties["Description"] = RichText(description)
|
|
1767
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1714
1768
|
if context:
|
|
1715
|
-
properties["Context"] = RichText(context)
|
|
1769
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1716
1770
|
if proposed_solution:
|
|
1717
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1771
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1772
|
+
|
|
1773
|
+
# Convert Property objects to dicts for API
|
|
1774
|
+
serialized_properties = {
|
|
1775
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1776
|
+
for key, prop in properties.items()
|
|
1777
|
+
}
|
|
1718
1778
|
|
|
1719
1779
|
data = await client._api.pages.create(
|
|
1720
1780
|
parent={"database_id": database_id},
|
|
1721
|
-
properties=
|
|
1781
|
+
properties=serialized_properties,
|
|
1722
1782
|
)
|
|
1723
1783
|
|
|
1724
1784
|
issue = cls(client, data)
|
|
@@ -1746,23 +1806,29 @@ class WorkIssue(BaseEntity):
|
|
|
1746
1806
|
properties: dict[str, Any] = {}
|
|
1747
1807
|
|
|
1748
1808
|
if title is not None:
|
|
1749
|
-
properties["Title"] = Title(title)
|
|
1809
|
+
properties["Title"] = Title(content=title)
|
|
1750
1810
|
if type is not None:
|
|
1751
|
-
properties["Type"] = Select(type)
|
|
1811
|
+
properties["Type"] = Select(name="Type", value=type)
|
|
1752
1812
|
if severity is not None:
|
|
1753
|
-
properties["Severity"] = Select(severity)
|
|
1813
|
+
properties["Severity"] = Select(name="Severity", value=severity)
|
|
1754
1814
|
if status is not None:
|
|
1755
|
-
properties["Status"] = Select(status)
|
|
1815
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
1756
1816
|
if description is not None:
|
|
1757
|
-
properties["Description"] = RichText(description)
|
|
1817
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1758
1818
|
if context is not None:
|
|
1759
|
-
properties["Context"] = RichText(context)
|
|
1819
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1760
1820
|
if proposed_solution is not None:
|
|
1761
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1821
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1822
|
+
|
|
1823
|
+
# Convert Property objects to dicts for API
|
|
1824
|
+
serialized_properties = {
|
|
1825
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1826
|
+
for key, prop in properties.items()
|
|
1827
|
+
}
|
|
1762
1828
|
|
|
1763
1829
|
data = await self._client._api.pages.update(
|
|
1764
1830
|
page_id=self.id,
|
|
1765
|
-
properties=
|
|
1831
|
+
properties=serialized_properties,
|
|
1766
1832
|
)
|
|
1767
1833
|
|
|
1768
1834
|
self._data = data
|
|
@@ -2050,18 +2116,24 @@ class Incident(BaseEntity):
|
|
|
2050
2116
|
from better_notion._api.properties import Title, Date, Select, Relation
|
|
2051
2117
|
|
|
2052
2118
|
properties: dict[str, Any] = {
|
|
2053
|
-
"Title": Title(title),
|
|
2119
|
+
"Title": Title(content=title),
|
|
2054
2120
|
"Project": Relation([project_id]),
|
|
2055
2121
|
"Affected Version": Relation([affected_version_id]),
|
|
2056
|
-
"Severity": Select(severity),
|
|
2057
|
-
"Type": Select(type),
|
|
2058
|
-
"Status": Select(status),
|
|
2059
|
-
"Discovery Date": Date(discovery_date or datetime.now().isoformat()),
|
|
2122
|
+
"Severity": Select(name="Severity", value=severity),
|
|
2123
|
+
"Type": Select(name="Type", value=type),
|
|
2124
|
+
"Status": Select(name="Status", value=status),
|
|
2125
|
+
"Discovery Date": Date(name="Discovery Date", value=discovery_date or datetime.now().isoformat()),
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
# Convert Property objects to dicts for API
|
|
2129
|
+
serialized_properties = {
|
|
2130
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
2131
|
+
for key, prop in properties.items()
|
|
2060
2132
|
}
|
|
2061
2133
|
|
|
2062
2134
|
data = await client._api.pages.create(
|
|
2063
2135
|
parent={"database_id": database_id},
|
|
2064
|
-
properties=
|
|
2136
|
+
properties=serialized_properties,
|
|
2065
2137
|
)
|
|
2066
2138
|
|
|
2067
2139
|
incident = cls(client, data)
|
|
@@ -2087,19 +2159,25 @@ class Incident(BaseEntity):
|
|
|
2087
2159
|
properties: dict[str, Any] = {}
|
|
2088
2160
|
|
|
2089
2161
|
if title is not None:
|
|
2090
|
-
properties["Title"] = Title(title)
|
|
2162
|
+
properties["Title"] = Title(content=title)
|
|
2091
2163
|
if severity is not None:
|
|
2092
|
-
properties["Severity"] = Select(severity)
|
|
2164
|
+
properties["Severity"] = Select(name="Severity", value=severity)
|
|
2093
2165
|
if status is not None:
|
|
2094
|
-
properties["Status"] = Select(status)
|
|
2166
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
2095
2167
|
if root_cause is not None:
|
|
2096
|
-
properties["Root Cause"] = RichText(root_cause)
|
|
2168
|
+
properties["Root Cause"] = RichText(name="Root Cause", content=root_cause)
|
|
2097
2169
|
if resolved_date is not None:
|
|
2098
|
-
properties["Resolved Date"] = Date(resolved_date)
|
|
2170
|
+
properties["Resolved Date"] = Date(name="Resolved Date", value=resolved_date)
|
|
2171
|
+
|
|
2172
|
+
# Convert Property objects to dicts for API
|
|
2173
|
+
serialized_properties = {
|
|
2174
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
2175
|
+
for key, prop in properties.items()
|
|
2176
|
+
}
|
|
2099
2177
|
|
|
2100
2178
|
data = await self._client._api.pages.update(
|
|
2101
2179
|
page_id=self.id,
|
|
2102
|
-
properties=
|
|
2180
|
+
properties=serialized_properties,
|
|
2103
2181
|
)
|
|
2104
2182
|
|
|
2105
2183
|
self._data = data
|
|
@@ -2150,8 +2228,8 @@ class Incident(BaseEntity):
|
|
|
2150
2228
|
await self._client._api.pages.update(
|
|
2151
2229
|
page_id=self.id,
|
|
2152
2230
|
properties={
|
|
2153
|
-
"Fix Task": Relation([task_id]),
|
|
2154
|
-
"Status": Select("Fix in Progress"),
|
|
2231
|
+
"Fix Task": Relation([task_id]).to_dict(),
|
|
2232
|
+
"Status": Select(name="Status", value="Fix in Progress").to_dict(),
|
|
2155
2233
|
},
|
|
2156
2234
|
)
|
|
2157
2235
|
|
|
@@ -351,6 +351,9 @@ class WorkspaceInitializer:
|
|
|
351
351
|
def save_database_ids(self, path: Optional[Path] = None) -> None:
|
|
352
352
|
"""Save workspace metadata (database IDs and workspace info) to config file.
|
|
353
353
|
|
|
354
|
+
Saves database IDs at top level with capitalized keys (e.g., "Organizations", "Projects")
|
|
355
|
+
to match what SDK managers expect. Also saves under "database_ids" for compatibility.
|
|
356
|
+
|
|
354
357
|
Args:
|
|
355
358
|
path: Path to save config file (default: ~/.notion/workspace.json)
|
|
356
359
|
"""
|
|
@@ -359,14 +362,21 @@ class WorkspaceInitializer:
|
|
|
359
362
|
|
|
360
363
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
361
364
|
|
|
365
|
+
# Map lowercase keys to capitalized keys for SDK manager compatibility
|
|
366
|
+
database_ids_capitalized = {
|
|
367
|
+
key.capitalize(): value for key, value in self._database_ids.items()
|
|
368
|
+
}
|
|
369
|
+
|
|
362
370
|
# Save full workspace metadata
|
|
371
|
+
# Database IDs are saved at top level with capitalized keys for SDK managers
|
|
363
372
|
config = {
|
|
364
373
|
"workspace_id": self._workspace_id,
|
|
365
374
|
"workspace_name": self._workspace_name,
|
|
366
375
|
"parent_page": self._parent_page_id,
|
|
367
376
|
"initialized_at": datetime.now(timezone.utc).isoformat(),
|
|
368
377
|
"version": "1.5.4",
|
|
369
|
-
"
|
|
378
|
+
**database_ids_capitalized, # Save at top level: "Organizations", "Projects", etc.
|
|
379
|
+
"database_ids": self._database_ids, # Also save under database_ids for compatibility
|
|
370
380
|
}
|
|
371
381
|
|
|
372
382
|
with open(path, "w", encoding="utf-8") as f:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|