channel-app 0.0.157a8__tar.gz → 0.0.157a10__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.
Files changed (108) hide show
  1. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/PKG-INFO +1 -1
  2. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/alembic.ini +3 -3
  3. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/database/migrations/env.py +2 -7
  4. channel_app-0.0.157a8/channel_app/database/migrations/versions/881a968ee603_add_step_and_exception_logs.py → channel_app-0.0.157a10/channel_app/database/migrations/versions/6d5ae5b9c541_create_initial_tables.py +19 -6
  5. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/logs/services.py +1 -1
  6. channel_app-0.0.157a10/channel_app/migrate.py +22 -0
  7. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app.egg-info/PKG-INFO +1 -1
  8. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app.egg-info/SOURCES.txt +2 -4
  9. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/setup.py +1 -1
  10. channel_app-0.0.157a8/channel_app/database/migrations/versions/6049560b1ecb_create_flow_logs.py +0 -43
  11. channel_app-0.0.157a8/channel_app/omnitron/commands/orders/__init__.py +0 -0
  12. channel_app-0.0.157a8/channel_app/omnitron/commands/tests/__init__.py +0 -0
  13. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/.gitignore +0 -0
  14. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/.vscode/settings.json +0 -0
  15. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/Makefile +0 -0
  16. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/Procfile-dist +0 -0
  17. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/README.md +0 -0
  18. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/akinon.json-dist +0 -0
  19. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/bitbucket-pipelines.yml +0 -0
  20. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/build.sh-dist +0 -0
  21. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/__init__.py +0 -0
  22. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/__init__.py +0 -0
  23. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/order/__init__.py +0 -0
  24. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/order/service.py +0 -0
  25. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product/__init__.py +0 -0
  26. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product/service.py +0 -0
  27. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product_image/__init__.py +0 -0
  28. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product_image/service.py +0 -0
  29. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product_price/__init__.py +0 -0
  30. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product_price/service.py +0 -0
  31. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product_stock/__init__.py +0 -0
  32. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/product_stock/service.py +0 -0
  33. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/setup/__init__.py +0 -0
  34. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/app/setup/service.py +0 -0
  35. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/__init__.py +0 -0
  36. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/__init__.py +0 -0
  37. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/orders/__init__.py +0 -0
  38. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/orders/orders.py +0 -0
  39. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/product_categories.py +0 -0
  40. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/product_images.py +0 -0
  41. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/product_prices.py +0 -0
  42. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/product_stocks.py +0 -0
  43. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/products.py +0 -0
  44. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/commands/setup.py +0 -0
  45. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/channel/integration.py +0 -0
  46. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/__init__.py +0 -0
  47. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/clients.py +0 -0
  48. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/commands.py +0 -0
  49. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/data.py +0 -0
  50. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/integration.py +0 -0
  51. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/products.py +0 -0
  52. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/settings.py +0 -0
  53. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/tests.py +0 -0
  54. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/core/utilities.py +0 -0
  55. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/database/__init__.py +0 -0
  56. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/database/migrations/README +0 -0
  57. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/database/migrations/script.py.mako +0 -0
  58. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/database/models.py +0 -0
  59. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/database/services.py +0 -0
  60. {channel_app-0.0.157a8/channel_app/database/migrations → channel_app-0.0.157a10/channel_app/logs}/__init__.py +0 -0
  61. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/logs/encoders.py +0 -0
  62. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/logs/enums.py +0 -0
  63. {channel_app-0.0.157a8/channel_app/database/migrations/versions → channel_app-0.0.157a10/channel_app/omnitron}/__init__.py +0 -0
  64. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/batch_request.py +0 -0
  65. {channel_app-0.0.157a8/channel_app/logs → channel_app-0.0.157a10/channel_app/omnitron/commands}/__init__.py +0 -0
  66. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/batch_requests.py +0 -0
  67. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/error_reports.py +0 -0
  68. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/integration_actions.py +0 -0
  69. {channel_app-0.0.157a8/channel_app/omnitron → channel_app-0.0.157a10/channel_app/omnitron/commands/orders}/__init__.py +0 -0
  70. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/orders/addresses.py +0 -0
  71. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/orders/cargo_companies.py +0 -0
  72. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/orders/customers.py +0 -0
  73. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/orders/orders.py +0 -0
  74. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/product_categories.py +0 -0
  75. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/product_images.py +0 -0
  76. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/product_prices.py +0 -0
  77. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/product_stocks.py +0 -0
  78. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/products.py +0 -0
  79. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/setup.py +0 -0
  80. {channel_app-0.0.157a8/channel_app/omnitron/commands → channel_app-0.0.157a10/channel_app/omnitron/commands/tests}/__init__.py +0 -0
  81. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/tests/test_orders.py +0 -0
  82. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/tests/test_product_images.py +0 -0
  83. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/tests/test_product_prices.py +0 -0
  84. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/tests/test_product_stocks.py +0 -0
  85. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/commands/tests/test_products.py +0 -0
  86. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/constants.py +0 -0
  87. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/exceptions.py +0 -0
  88. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app/omnitron/integration.py +0 -0
  89. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app.egg-info/dependency_links.txt +0 -0
  90. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app.egg-info/requires.txt +0 -0
  91. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/channel_app.egg-info/top_level.txt +0 -0
  92. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/Makefile +0 -0
  93. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/make.bat +0 -0
  94. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/requirements.txt +0 -0
  95. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/architecture.rst +0 -0
  96. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/command_reference.rst +0 -0
  97. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/conf.py +0 -0
  98. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/flows.rst +0 -0
  99. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/images/async.png +0 -0
  100. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/images/batch_request_state_machine.png +0 -0
  101. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/images/sync.png +0 -0
  102. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/index.rst +0 -0
  103. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/installation_and_usage.rst +0 -0
  104. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/docs/source/terminology.rst +0 -0
  105. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/requirements-dev.txt +0 -0
  106. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/requirements.txt +0 -0
  107. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/setup.cfg +0 -0
  108. {channel_app-0.0.157a8 → channel_app-0.0.157a10}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: channel_app
3
- Version: 0.0.157a8
3
+ Version: 0.0.157a10
4
4
  Summary: Channel app for Sales Channels
5
5
  Home-page: https://github.com/akinon/channel_app
6
6
  Author: akinonteam
@@ -36,10 +36,10 @@ prepend_sys_path = .
36
36
  # sourceless = false
37
37
 
38
38
  # version location specification; This defaults
39
- # to migrations/versions. When using multiple version
39
+ # to alembic/versions. When using multiple version
40
40
  # directories, initial revisions must be specified with --version-path.
41
41
  # The path separator used here should be the separator specified by "version_path_separator" below.
42
- # version_locations = %(here)s/bar:%(here)s/bat:migrations/versions
42
+ # version_locations = %(here)s/bar:%(here)s/bat:alembic/versions
43
43
 
44
44
  # version path separator; As mentioned above, this is the character used to split
45
45
  # version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
@@ -63,7 +63,7 @@ version_path_separator = os
63
63
  # are written from script.py.mako
64
64
  # output_encoding = utf-8
65
65
 
66
- sqlalchemy.url = postgresql+psycopg2://postgres:12345@127.0.0.1/sales_channel_logs
66
+ sqlalchemy.url = driver://user:pass@localhost/dbname
67
67
 
68
68
 
69
69
  [post_write_hooks]
@@ -1,11 +1,9 @@
1
- import os
2
1
  from logging.config import fileConfig
3
2
 
4
3
  from sqlalchemy import engine_from_config
5
4
  from sqlalchemy import pool
6
5
 
7
6
  from alembic import context
8
-
9
7
  from channel_app.core import settings
10
8
  from channel_app.database.models import Base as BaseModel
11
9
 
@@ -30,7 +28,7 @@ target_metadata = BaseModel.metadata
30
28
  # ... etc.
31
29
 
32
30
  DATABASE_URL = f"postgresql+psycopg2://{settings.DB_USER}:{settings.DB_PASSWORD}@{settings.DB_HOST}:{settings.DB_PORT}/{settings.DB_NAME}"
33
- url = config.set_main_option("sqlalchemy.url", DATABASE_URL)
31
+ config.set_main_option("sqlalchemy.url", DATABASE_URL)
34
32
 
35
33
 
36
34
  def run_migrations_offline() -> None:
@@ -45,11 +43,8 @@ def run_migrations_offline() -> None:
45
43
  script output.
46
44
 
47
45
  """
48
- url = config.get_main_option("sqlalchemy.url")
49
-
50
- DATABASE_URL = f"postgresql+psycopg2://{settings.DB_USER}:{settings.DB_PASSWORD}@{settings.DB_HOST}:{settings.DB_PORT}/{settings.DB_NAME}"
51
46
  url = config.set_main_option("sqlalchemy.url", DATABASE_URL)
52
-
47
+
53
48
  context.configure(
54
49
  url=url,
55
50
  target_metadata=target_metadata,
@@ -1,8 +1,8 @@
1
- """add step and exception logs
1
+ """create initial tables
2
2
 
3
- Revision ID: 881a968ee603
4
- Revises: 6049560b1ecb
5
- Create Date: 2025-04-24 11:58:59.377131
3
+ Revision ID: 6d5ae5b9c541
4
+ Revises:
5
+ Create Date: 2025-05-07 19:10:39.137004
6
6
 
7
7
  """
8
8
  from typing import Sequence, Union
@@ -12,8 +12,8 @@ import sqlalchemy as sa
12
12
 
13
13
 
14
14
  # revision identifiers, used by Alembic.
15
- revision: str = '881a968ee603'
16
- down_revision: Union[str, None] = '6049560b1ecb'
15
+ revision: str = '6d5ae5b9c541'
16
+ down_revision: Union[str, None] = None
17
17
  branch_labels: Union[str, Sequence[str], None] = None
18
18
  depends_on: Union[str, Sequence[str], None] = None
19
19
 
@@ -21,6 +21,18 @@ depends_on: Union[str, Sequence[str], None] = None
21
21
  def upgrade() -> None:
22
22
  """Upgrade schema."""
23
23
  # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('log_flows',
25
+ sa.Column('id', sa.UUID(), nullable=False),
26
+ sa.Column('transaction_id', sa.UUID(), nullable=False),
27
+ sa.Column('flow_name', sa.String(length=255), nullable=False),
28
+ sa.Column('flow_author', sa.Enum('user', 'system', name='logflowauthor'), nullable=False),
29
+ sa.Column('started_at', sa.DateTime(timezone=True), nullable=False),
30
+ sa.Column('ended_at', sa.DateTime(timezone=True), nullable=True),
31
+ sa.Column('status', sa.Enum('in_progress', 'success', 'failure', name='logstepstatus'), nullable=True),
32
+ sa.Column('s3_key', sa.Text(), nullable=True),
33
+ sa.PrimaryKeyConstraint('id'),
34
+ sa.UniqueConstraint('transaction_id')
35
+ )
24
36
  op.create_table('log_steps',
25
37
  sa.Column('id', sa.UUID(), nullable=False),
26
38
  sa.Column('flow_id', sa.UUID(), nullable=False),
@@ -52,4 +64,5 @@ def downgrade() -> None:
52
64
  # ### commands auto generated by Alembic - please adjust! ###
53
65
  op.drop_table('log_step_exceptions')
54
66
  op.drop_table('log_steps')
67
+ op.drop_table('log_flows')
55
68
  # ### end Alembic commands ###
@@ -182,7 +182,7 @@ class S3Client:
182
182
  "AWS_ACCESS_KEY_ID": os.getenv("AWS_ACCESS_KEY_ID"),
183
183
  "AWS_SECRET_ACCESS_KEY": os.getenv("AWS_SECRET_ACCESS_KEY"),
184
184
  "AWS_REGION": os.getenv("S3_REGION_NAME"),
185
- "LOGGING_S3_BUCKET": os.getenv("S3_BUCKET_NAME"),
185
+ "S3_BUCKET_NAME": os.getenv("S3_BUCKET_NAME"),
186
186
  }
187
187
 
188
188
  missing_vars = [
@@ -0,0 +1,22 @@
1
+ import os
2
+ import sys
3
+ from alembic.config import Config
4
+ from alembic import command
5
+
6
+ def migrate():
7
+ base_dir = os.path.dirname(os.path.abspath(__file__))
8
+ ini_path = os.path.join(base_dir, 'alembic.ini')
9
+
10
+ alembic_cfg = Config(ini_path)
11
+ alembic_cfg.set_main_option("script_location", os.path.join(base_dir, "database", "migrations"))
12
+
13
+ command.upgrade(alembic_cfg, "head")
14
+
15
+
16
+ if __name__ == "__main__":
17
+ try:
18
+ migrate()
19
+ except Exception as e:
20
+ print(f"Migration failed: {e}")
21
+
22
+ sys.exit(1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: channel-app
3
- Version: 0.0.157a8
3
+ Version: 0.0.157a10
4
4
  Summary: Channel app for Sales Channels
5
5
  Home-page: https://github.com/akinon/channel_app
6
6
  Author: akinonteam
@@ -12,6 +12,7 @@ tox.ini
12
12
  .vscode/settings.json
13
13
  channel_app/__init__.py
14
14
  channel_app/alembic.ini
15
+ channel_app/migrate.py
15
16
  channel_app.egg-info/PKG-INFO
16
17
  channel_app.egg-info/SOURCES.txt
17
18
  channel_app.egg-info/dependency_links.txt
@@ -54,12 +55,9 @@ channel_app/database/__init__.py
54
55
  channel_app/database/models.py
55
56
  channel_app/database/services.py
56
57
  channel_app/database/migrations/README
57
- channel_app/database/migrations/__init__.py
58
58
  channel_app/database/migrations/env.py
59
59
  channel_app/database/migrations/script.py.mako
60
- channel_app/database/migrations/versions/6049560b1ecb_create_flow_logs.py
61
- channel_app/database/migrations/versions/881a968ee603_add_step_and_exception_logs.py
62
- channel_app/database/migrations/versions/__init__.py
60
+ channel_app/database/migrations/versions/6d5ae5b9c541_create_initial_tables.py
63
61
  channel_app/logs/__init__.py
64
62
  channel_app/logs/encoders.py
65
63
  channel_app/logs/enums.py
@@ -5,7 +5,7 @@ with open("README.md") as f:
5
5
 
6
6
  setup(
7
7
  name="channel_app",
8
- version="0.0.157a8", # alpha prerelease
8
+ version="0.0.157a10", # alpha prerelease
9
9
  packages=find_packages(),
10
10
  url="https://github.com/akinon/channel_app",
11
11
  description="Channel app for Sales Channels",
@@ -1,43 +0,0 @@
1
- """create flow_logs
2
-
3
- Revision ID: 6049560b1ecb
4
- Revises:
5
- Create Date: 2025-04-22 15:53:37.986109
6
-
7
- """
8
- from typing import Sequence, Union
9
-
10
- from alembic import op
11
- import sqlalchemy as sa
12
-
13
-
14
- # revision identifiers, used by Alembic.
15
- revision: str = '6049560b1ecb'
16
- down_revision: Union[str, None] = None
17
- branch_labels: Union[str, Sequence[str], None] = None
18
- depends_on: Union[str, Sequence[str], None] = None
19
-
20
-
21
- def upgrade() -> None:
22
- """Upgrade schema."""
23
- # ### commands auto generated by Alembic - please adjust! ###
24
- op.create_table('log_flows',
25
- sa.Column('id', sa.UUID(), nullable=False),
26
- sa.Column('transaction_id', sa.UUID(), nullable=False),
27
- sa.Column('flow_name', sa.String(length=255), nullable=False),
28
- sa.Column('flow_author', sa.Enum('user', 'system', name='logflowauthor'), nullable=False),
29
- sa.Column('started_at', sa.DateTime(timezone=True), nullable=False),
30
- sa.Column('ended_at', sa.DateTime(timezone=True), nullable=True),
31
- sa.Column('status', sa.Enum('in_progress', 'success', 'failure', name='logstepstatus'), nullable=True),
32
- sa.Column('s3_key', sa.Text(), nullable=True),
33
- sa.PrimaryKeyConstraint('id'),
34
- sa.UniqueConstraint('transaction_id')
35
- )
36
- # ### end Alembic commands ###
37
-
38
-
39
- def downgrade() -> None:
40
- """Downgrade schema."""
41
- # ### commands auto generated by Alembic - please adjust! ###
42
- op.drop_table('log_flows')
43
- # ### end Alembic commands ###