prism-models 0.6.5__tar.gz → 0.7.3__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 (78) hide show
  1. {prism_models-0.6.5 → prism_models-0.7.3}/PKG-INFO +1 -1
  2. prism_models-0.7.3/README.md +154 -0
  3. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/__init__.py +10 -1
  4. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/agent_profile.py +31 -0
  5. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/chat.py +14 -8
  6. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py +1 -1
  7. prism_models-0.7.3/prism_models/migration/versions/2026_01_14_1742_147509a82af8_changed_user_role_enums.py +54 -0
  8. prism_models-0.7.3/prism_models/migration/versions/2026_01_15_1010_3b7d0b2e9f5a_add_contact_profile_table.py +71 -0
  9. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models.egg-info/PKG-INFO +1 -1
  10. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models.egg-info/SOURCES.txt +3 -1
  11. {prism_models-0.6.5 → prism_models-0.7.3}/pyproject.toml +12 -1
  12. prism_models-0.6.5/README.md +0 -0
  13. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/base.py +0 -0
  14. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/config.py +0 -0
  15. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/content.py +0 -0
  16. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/feedback.py +0 -0
  17. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/README +0 -0
  18. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/__init__.py +0 -0
  19. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/env.py +0 -0
  20. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/script.py.mako +0 -0
  21. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_11_1516_161f8829d93f_initial_schema.py +0 -0
  22. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_11_1558_5e011849ea76_changes_for_feedback.py +0 -0
  23. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_14_2243_059af231c2b2_profile_entities.py +0 -0
  24. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_15_1646_3219fec0bb10_agent_changes.py +0 -0
  25. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_16_1627_f2013b08daac_rename_metadata_to_additional_data.py +0 -0
  26. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_17_1147_327febbf555f_display_name_added.py +0 -0
  27. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_18_1106_b0bcb7ca1dc9_add_support_for_profile_on_create_convo.py +0 -0
  28. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_18_1511_bbc1955191e6_preview_mode.py +0 -0
  29. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_26_1115_6eb70e848451_added_publish_status_to_document.py +0 -0
  30. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_26_1240_f8b0ea2e743c_drop_unique_title_version_on_document.py +0 -0
  31. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_26_1505_07dc8c2589e0_added_chunk_id_and_vector_embeddings_to_.py +0 -0
  32. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_29_1220_46ba2693b883_add_markdown_markdown_file_path_s3_.py +0 -0
  33. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_02_1520_bf1472a9b021_removed_doc_id_from_config_table_and_.py +0 -0
  34. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_02_1525_6c0e63e0fef8_removed_doc_id_from_config_table_.py +0 -0
  35. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_02_1608_1b3eb48f5017_config_id_on_delete_will_be_set_to_null.py +0 -0
  36. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_03_1109_ac85b606d8a4_added_docling_hybrid_to_chunkstrategy.py +0 -0
  37. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_03_1204_7d1cb343a63f_added_s3_bucket_and_s3_dir_in_source_.py +0 -0
  38. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_03_1452_f9c750ec2a0b_1_to_1_relationship_between_collection_.py +0 -0
  39. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_07_1722_5cfa0c462948_added_travel_advisory_enum.py +0 -0
  40. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_08_1304_c91eb8e38cc7_added_destination_report_and_event_.py +0 -0
  41. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_09_1308_796b720ea35f_added_qa_id_to_vovetor.py +0 -0
  42. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_16_1611_663c66268631_added_sharepoint_drive_item_id_as_an_.py +0 -0
  43. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_23_1228_919d07a93f83_added_sharepoint_directory_in_source.py +0 -0
  44. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_27_1331_ff3be2c4311f_added_agentcollectionaccess_table.py +0 -0
  45. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_28_1333_b789e61df26a_ad_enum_and_field_added.py +0 -0
  46. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_03_1633_cc27b20a106e_removed_collection_from_source_.py +0 -0
  47. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_03_1653_bf5c2ce928e3_removed_collection_from_source_.py +0 -0
  48. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_03_1738_b733b48d78b5_remove_source.py +0 -0
  49. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1450_8a7e56260eba_added_collection_ids_sync_enabled_and_.py +0 -0
  50. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1626_4c4148ac2d21_removed_qna_related_columns_from_.py +0 -0
  51. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1648_b228888a01ee_added_chunk_config_to_source.py +0 -0
  52. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1656_7d0982bae4db_added_chunk_config_to_source_again_last_.py +0 -0
  53. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1727_b9663951b5c1_removed_un_used_fields_from_feedback.py +0 -0
  54. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1749_3d37806383a2_simplified_feedback.py +0 -0
  55. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1838_8c3c862b565e_removed_is_upvoted_from_message.py +0 -0
  56. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1841_54a2f12a1573_added_vote_field.py +0 -0
  57. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_13_1215_fa00286fe6cd_add_type_column_to_chunk_table.py +0 -0
  58. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_14_1216_2c62317520f9_add_rerieved_and_created_chunks_and_.py +0 -0
  59. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_17_1259_a3bc4e4c08a0_agent_and_profile_entity_changes.py +0 -0
  60. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_17_1325_df5b1cdc2c36_agentprofile_contact_entity_changes.py +0 -0
  61. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_17_1716_ed91cdf82ef3_adding_feedback_enum.py +0 -0
  62. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_20_0008_80f5954656f0_feedback_chunk_entity_added.py +0 -0
  63. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_20_0109_58be389d0ed7_feedback_chunks_changes.py +0 -0
  64. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_20_0158_98eb0c87e65e_feedback_chunk_chnages.py +0 -0
  65. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1207_bbee88729aae_add_feedback_columns.py +0 -0
  66. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1625_8c50f64287fe_added_sequence_column_to_chunk_table_.py +0 -0
  67. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1654_e7ae98ce2121_removed_sync_enabled.py +0 -0
  68. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1758_24b3f480777b_refactor_feedback_analysis_for_unified_.py +0 -0
  69. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1801_5a52fb845dc0_refactor_feedback_analysis_for_unified_.py +0 -0
  70. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_24_1124_dc57fb290621_added_conversation_context_to_.py +0 -0
  71. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_25_1847_c6c36663acd5_added_user_preferences_table.py +0 -0
  72. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_12_07_2236_88f01df468f2_added_sparse_embeddings_field_in_vector_.py +0 -0
  73. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/migration/versions/2025_12_09_1146_6abdd3f001ab_adding_orchestrator_model_to_profile_.py +0 -0
  74. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models/qdrant.py +0 -0
  75. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models.egg-info/dependency_links.txt +0 -0
  76. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models.egg-info/requires.txt +0 -0
  77. {prism_models-0.6.5 → prism_models-0.7.3}/prism_models.egg-info/top_level.txt +0 -0
  78. {prism_models-0.6.5 → prism_models-0.7.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prism-models
3
- Version: 0.6.5
3
+ Version: 0.7.3
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: sqlalchemy[asyncio]>=2.0.0
6
6
  Requires-Dist: alembic>=1.16.0
@@ -0,0 +1,154 @@
1
+ # Installing prism-models from AWS CodeArtifact
2
+
3
+ This package is published to AWS CodeArtifact. Projects that depend on it need to configure their environment to authenticate with the private registry.
4
+
5
+ ## Configuration
6
+
7
+ ### AWS CodeArtifact Details
8
+
9
+ - **Domain**: `globalrescue`
10
+ - **Domain Owner**: `687144405948`
11
+ - **Region**: `us-east-2`
12
+ - **Repository URL**: `https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/`
13
+
14
+ ---
15
+
16
+ ## For Projects Using `uv`
17
+
18
+ ### 1. Add the index to `pyproject.toml`
19
+
20
+ ```toml
21
+ [[tool.uv.index]]
22
+ name = "private"
23
+ url = "https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/"
24
+ default = true
25
+
26
+ [[tool.uv.index]]
27
+ name = "pypi"
28
+ url = "https://pypi.org/simple"
29
+ ```
30
+
31
+ ### 2. Authenticate before installing
32
+
33
+ **Local development (SSO):**
34
+ ```bash
35
+ aws sso login --profile <your-profile>
36
+ export AWS_PROFILE=<your-profile>
37
+
38
+ # Get token and set it
39
+ export UV_INDEX_PRIVATE_PASSWORD=$(aws codeartifact get-authorization-token \
40
+ --domain globalrescue \
41
+ --domain-owner 687144405948 \
42
+ --region us-east-2 \
43
+ --query authorizationToken \
44
+ --output text)
45
+
46
+ # Now install
47
+ uv sync
48
+ ```
49
+
50
+ **CI/CD (with IAM role):**
51
+ ```bash
52
+ export UV_INDEX_PRIVATE_PASSWORD=$(aws codeartifact get-authorization-token \
53
+ --domain globalrescue \
54
+ --domain-owner 687144405948 \
55
+ --region us-east-2 \
56
+ --query authorizationToken \
57
+ --output text)
58
+
59
+ uv sync
60
+ ```
61
+
62
+ ---
63
+
64
+ ## For Projects Using `pip`
65
+
66
+ ### 1. Get the repository URL with credentials
67
+
68
+ ```bash
69
+ aws codeartifact login --tool pip \
70
+ --domain globalrescue \
71
+ --domain-owner 687144405948 \
72
+ --region us-east-2 \
73
+ --repository pypi
74
+ ```
75
+
76
+ This automatically configures pip to use CodeArtifact for the session.
77
+
78
+ ### 2. Or manually configure pip
79
+
80
+ ```bash
81
+ # Get the token
82
+ TOKEN=$(aws codeartifact get-authorization-token \
83
+ --domain globalrescue \
84
+ --domain-owner 687144405948 \
85
+ --region us-east-2 \
86
+ --query authorizationToken \
87
+ --output text)
88
+
89
+ # Install with extra index
90
+ pip install prism-models \
91
+ --index-url https://aws:${TOKEN}@globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/ \
92
+ --extra-index-url https://pypi.org/simple/
93
+ ```
94
+
95
+ ---
96
+
97
+ ## GitLab CI/CD Example
98
+
99
+ ```yaml
100
+ install-dependencies:
101
+ script:
102
+ - |
103
+ export UV_INDEX_PRIVATE_PASSWORD=$(aws codeartifact get-authorization-token \
104
+ --domain globalrescue \
105
+ --domain-owner 687144405948 \
106
+ --region us-east-2 \
107
+ --query authorizationToken \
108
+ --output text)
109
+ - uv sync
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Required AWS Permissions
115
+
116
+ The IAM user/role needs these permissions:
117
+
118
+ ```json
119
+ {
120
+ "Version": "2012-10-17",
121
+ "Statement": [
122
+ {
123
+ "Effect": "Allow",
124
+ "Action": [
125
+ "codeartifact:GetAuthorizationToken",
126
+ "codeartifact:GetRepositoryEndpoint",
127
+ "codeartifact:ReadFromRepository"
128
+ ],
129
+ "Resource": "*"
130
+ },
131
+ {
132
+ "Effect": "Allow",
133
+ "Action": "sts:GetServiceBearerToken",
134
+ "Resource": "*",
135
+ "Condition": {
136
+ "StringEquals": {
137
+ "sts:AWSServiceName": "codeartifact.amazonaws.com"
138
+ }
139
+ }
140
+ }
141
+ ]
142
+ }
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Troubleshooting
148
+
149
+ | Error | Solution |
150
+ |-------|----------|
151
+ | `401 Unauthorized` | Token expired - run `aws codeartifact get-authorization-token` again |
152
+ | `ExpiredTokenException` | Run `aws sso login` again (tokens last 12 hours by default) |
153
+ | `Could not find a version` | Check the package name and that it's published to CodeArtifact |
154
+ | `Access Denied` | Check IAM permissions for CodeArtifact access |
@@ -3,7 +3,15 @@
3
3
  __version__ = "0.1.0"
4
4
 
5
5
 
6
- from prism_models.agent_profile import Agent, AgentCollectionAccess, AgentProfile, AgentProfileStatus, Profile, ProfileCollectionAccess
6
+ from prism_models.agent_profile import (
7
+ Agent,
8
+ AgentCollectionAccess,
9
+ AgentProfile,
10
+ AgentProfileStatus,
11
+ ContactProfile,
12
+ Profile,
13
+ ProfileCollectionAccess,
14
+ )
7
15
  from prism_models.base import POSTGRES_NAMING_CONVENTION, Base, BaseModel, TimestampMixin
8
16
  from prism_models.chat import Contact, Conversation, ConversationMessage, ConversationMessageMetadata, UserPreferences
9
17
  from prism_models.content import Chunk, ChunkConfig, Collection, CollectionDocument, Document, IntegrationConfig, Source, Vector
@@ -24,6 +32,7 @@ __all__ = [
24
32
  "Collection",
25
33
  "CollectionDocument",
26
34
  "Contact",
35
+ "ContactProfile",
27
36
  "Conversation",
28
37
  "ConversationMessage",
29
38
  "ConversationMessageMetadata",
@@ -42,6 +42,37 @@ class Profile(BaseModel):
42
42
  def __repr__(self) -> str:
43
43
  return f"<Profile(id={self.id}, name='{self.name}', active={self.is_active})>"
44
44
 
45
+
46
+ class ContactProfile(BaseModel):
47
+ """Association between Contact and Profile."""
48
+
49
+ contact_id: Mapped[int] = mapped_column(
50
+ Integer,
51
+ ForeignKey("contact.id", ondelete="CASCADE"),
52
+ nullable=False,
53
+ index=True,
54
+ )
55
+ profile_id: Mapped[int] = mapped_column(
56
+ Integer,
57
+ ForeignKey("profile.id", ondelete="CASCADE"),
58
+ nullable=False,
59
+ index=True,
60
+ )
61
+ assigned_by_contact_id: Mapped[int | None] = mapped_column(
62
+ Integer,
63
+ ForeignKey("contact.id", ondelete="SET NULL"),
64
+ nullable=True,
65
+ index=True,
66
+ )
67
+
68
+ contact: Mapped["Contact"] = relationship(foreign_keys=[contact_id], back_populates="contact_profiles")
69
+ profile: Mapped["Profile"] = relationship()
70
+ assigned_by_contact: Mapped["Contact"] = relationship(foreign_keys=[assigned_by_contact_id])
71
+
72
+ __table_args__ = (
73
+ UniqueConstraint("contact_id", "profile_id", name="uq_contact_profile"),
74
+ )
75
+
45
76
  class AgentType(str, Enum):
46
77
  ORCHESTRATOR_AGENT = "ORCHESTRATOR"
47
78
  DOMAIN_AGENT = "DOMAIN"
@@ -32,15 +32,14 @@ class ContactRole(PyEnum):
32
32
  Hierarchical permission roles for contacts.
33
33
 
34
34
  Permission hierarchy (highest to lowest):
35
- - ADMIN: Full access to all contacts in the system
36
- - ACCOUNT_ADMIN: Full access to contacts within their account
37
- - MANAGER: Can view/edit contacts in their team (direct reports)
38
- - VIEWER: Read-only access to own data and limited team visibility
35
+ - ADMIN: To manage user roles, Docs, Collections and profiles
36
+ - MANAGER: To provide feedback to GR-ACE
37
+ - USER: Ability to chat with GR-ACE
39
38
  """
40
39
  ADMIN = "ADMIN"
41
- ACCOUNT_ADMIN = "ACCOUNT_ADMIN"
42
40
  MANAGER = "MANAGER"
43
- VIEWER = "VIEWER"
41
+ USER = "USER"
42
+
44
43
 
45
44
 
46
45
  class ConversationType(PyEnum):
@@ -82,6 +81,7 @@ class Contact(ChatSchemaMixin, BaseModel):
82
81
  Relationships:
83
82
  - conversations: One-to-many relationship with Conversation model
84
83
  - user_preferences: One-to-one relationship with UserPreferences model
84
+ - contact_profiles: One-to-many relationship with ContactProfile model
85
85
  """
86
86
 
87
87
  email = Column(String(300), nullable=True)
@@ -110,9 +110,9 @@ class Contact(ChatSchemaMixin, BaseModel):
110
110
  # Hierarchical permission system
111
111
  contact_role: Mapped[ContactRole] = mapped_column(
112
112
  Enum(ContactRole),
113
- default=ContactRole.VIEWER,
113
+ default=ContactRole.USER,
114
114
  nullable=False,
115
- server_default="VIEWER"
115
+ server_default="USER"
116
116
  )
117
117
  manager_contact_id = Column(
118
118
  Integer,
@@ -138,6 +138,12 @@ class Contact(ChatSchemaMixin, BaseModel):
138
138
  cascade="all, delete-orphan",
139
139
  uselist=False # One-to-one relationship
140
140
  )
141
+ contact_profiles: Mapped[list["ContactProfile"]] = relationship(
142
+ "ContactProfile",
143
+ back_populates="contact",
144
+ cascade="all, delete-orphan",
145
+ foreign_keys="ContactProfile.contact_id",
146
+ )
141
147
 
142
148
 
143
149
  class UserPreferences(BaseModel):
@@ -37,7 +37,7 @@ def upgrade() -> None:
37
37
  op.add_column('contact', sa.Column('manager_contact_id', sa.Integer(), nullable=True))
38
38
  op.create_index(op.f('contact_manager_contact_id_idx'), 'contact', ['manager_contact_id'], unique=False)
39
39
  op.create_foreign_key(op.f('contact_manager_contact_id_fkey'), 'contact', 'contact', ['manager_contact_id'], ['id'], ondelete='SET NULL')
40
- op.drop_index(op.f('idx_document_title_trgm'), table_name='document', postgresql_ops={'title': 'gin_trgm_ops'}, postgresql_using='gin')
40
+ op.drop_index(op.f('idx_document_title_trgm'), table_name='document', postgresql_ops={'title': 'gin_trgm_ops'}, postgresql_using='gin', if_exists=True)
41
41
  # ### end Alembic commands ###
42
42
 
43
43
 
@@ -0,0 +1,54 @@
1
+ """Changed user role enums
2
+
3
+ Revision ID: 147509a82af8
4
+ Revises: 4d9291a3acb1
5
+ Create Date: 2026-01-14 17:42:10.143289
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 = '147509a82af8'
16
+ down_revision: Union[str, Sequence[str], None] = '4d9291a3acb1'
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.execute("CREATE TYPE contactrole_new AS ENUM ('ADMIN', 'MANAGER', 'USER')")
25
+ op.execute("ALTER TABLE contact ALTER COLUMN contact_role DROP DEFAULT")
26
+ op.execute(
27
+ "ALTER TABLE contact ALTER COLUMN contact_role TYPE contactrole_new "
28
+ "USING (CASE "
29
+ "WHEN contact_role::text IN ('ADMIN', 'MANAGER') THEN contact_role::text "
30
+ "ELSE 'USER' "
31
+ "END)::contactrole_new"
32
+ )
33
+ op.execute("ALTER TABLE contact ALTER COLUMN contact_role SET DEFAULT 'USER'")
34
+ op.execute("DROP TYPE contactrole")
35
+ op.execute("ALTER TYPE contactrole_new RENAME TO contactrole")
36
+ # ### end Alembic commands ###
37
+
38
+
39
+ def downgrade() -> None:
40
+ """Downgrade schema."""
41
+ # ### commands auto generated by Alembic - please adjust! ###
42
+ op.execute("CREATE TYPE contactrole_old AS ENUM ('ADMIN', 'ACCOUNT_ADMIN', 'MANAGER', 'VIEWER')")
43
+ op.execute("ALTER TABLE contact ALTER COLUMN contact_role DROP DEFAULT")
44
+ op.execute(
45
+ "ALTER TABLE contact ALTER COLUMN contact_role TYPE contactrole_old "
46
+ "USING (CASE "
47
+ "WHEN contact_role::text IN ('ADMIN', 'MANAGER') THEN contact_role::text "
48
+ "ELSE 'VIEWER' "
49
+ "END)::contactrole_old"
50
+ )
51
+ op.execute("ALTER TABLE contact ALTER COLUMN contact_role SET DEFAULT 'VIEWER'")
52
+ op.execute("DROP TYPE contactrole")
53
+ op.execute("ALTER TYPE contactrole_old RENAME TO contactrole")
54
+ # ### end Alembic commands ###
@@ -0,0 +1,71 @@
1
+ """Add contact_profile table
2
+
3
+ Revision ID: 3b7d0b2e9f5a
4
+ Revises: 147509a82af8
5
+ Create Date: 2026-01-15 10:10:00.000000
6
+
7
+ """
8
+
9
+ from typing import Sequence, Union
10
+
11
+ import sqlalchemy as sa
12
+ from alembic import op
13
+
14
+
15
+ # revision identifiers, used by Alembic.
16
+ revision: str = "3b7d0b2e9f5a"
17
+ down_revision: Union[str, Sequence[str], None] = "147509a82af8"
18
+ branch_labels: Union[str, Sequence[str], None] = None
19
+ depends_on: Union[str, Sequence[str], None] = None
20
+
21
+
22
+ def upgrade() -> None:
23
+ """Upgrade schema."""
24
+ op.create_table(
25
+ "contact_profile",
26
+ sa.Column("contact_id", sa.Integer(), nullable=False),
27
+ sa.Column("profile_id", sa.Integer(), nullable=False),
28
+ sa.Column("assigned_by_contact_id", sa.Integer(), nullable=True),
29
+ sa.Column("id", sa.Integer(), nullable=False),
30
+ sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),
31
+ sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),
32
+ sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=True),
33
+ sa.ForeignKeyConstraint(
34
+ ["assigned_by_contact_id"],
35
+ ["contact.id"],
36
+ name=op.f("contact_profile_assigned_by_contact_id_fkey"),
37
+ ondelete="SET NULL",
38
+ ),
39
+ sa.ForeignKeyConstraint(
40
+ ["contact_id"],
41
+ ["contact.id"],
42
+ name=op.f("contact_profile_contact_id_fkey"),
43
+ ondelete="CASCADE",
44
+ ),
45
+ sa.ForeignKeyConstraint(
46
+ ["profile_id"],
47
+ ["profile.id"],
48
+ name=op.f("contact_profile_profile_id_fkey"),
49
+ ondelete="CASCADE",
50
+ ),
51
+ sa.PrimaryKeyConstraint("id", name=op.f("contact_profile_pkey")),
52
+ sa.UniqueConstraint("contact_id", "profile_id", name="uq_contact_profile"),
53
+ )
54
+ op.create_index(
55
+ op.f("contact_profile_assigned_by_contact_id_idx"),
56
+ "contact_profile",
57
+ ["assigned_by_contact_id"],
58
+ unique=False,
59
+ )
60
+ op.create_index(op.f("contact_profile_contact_id_idx"), "contact_profile", ["contact_id"], unique=False)
61
+ op.create_index(op.f("contact_profile_id_idx"), "contact_profile", ["id"], unique=False)
62
+ op.create_index(op.f("contact_profile_profile_id_idx"), "contact_profile", ["profile_id"], unique=False)
63
+
64
+
65
+ def downgrade() -> None:
66
+ """Downgrade schema."""
67
+ op.drop_index(op.f("contact_profile_profile_id_idx"), table_name="contact_profile")
68
+ op.drop_index(op.f("contact_profile_id_idx"), table_name="contact_profile")
69
+ op.drop_index(op.f("contact_profile_contact_id_idx"), table_name="contact_profile")
70
+ op.drop_index(op.f("contact_profile_assigned_by_contact_id_idx"), table_name="contact_profile")
71
+ op.drop_table("contact_profile")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prism-models
3
- Version: 0.6.5
3
+ Version: 0.7.3
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: sqlalchemy[asyncio]>=2.0.0
6
6
  Requires-Dist: alembic>=1.16.0
@@ -70,4 +70,6 @@ prism_models/migration/versions/2025_11_24_1124_dc57fb290621_added_conversation_
70
70
  prism_models/migration/versions/2025_11_25_1847_c6c36663acd5_added_user_preferences_table.py
71
71
  prism_models/migration/versions/2025_12_07_2236_88f01df468f2_added_sparse_embeddings_field_in_vector_.py
72
72
  prism_models/migration/versions/2025_12_09_1146_6abdd3f001ab_adding_orchestrator_model_to_profile_.py
73
- prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py
73
+ prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py
74
+ prism_models/migration/versions/2026_01_14_1742_147509a82af8_changed_user_role_enums.py
75
+ prism_models/migration/versions/2026_01_15_1010_3b7d0b2e9f5a_add_contact_profile_table.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "prism-models"
7
- version = "0.6.5"
7
+ version = "0.7.3"
8
8
  requires-python = ">=3.12"
9
9
  dependencies = [
10
10
  "sqlalchemy[asyncio]>=2.0.0",
@@ -20,3 +20,14 @@ packages = ["prism_models"]
20
20
 
21
21
  [tool.setuptools.package-data]
22
22
  prism_models = ["migration/*", "migration/versions/*"]
23
+
24
+ [[tool.uv.index]]
25
+ name = "private"
26
+ url = "https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/"
27
+ publish-url = "https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/"
28
+ default = true
29
+
30
+ [[tool.uv.index]]
31
+ name = "pypi"
32
+ url = "https://pypi.org/simple"
33
+
File without changes
File without changes