@happyvertical/smrt-messages 0.60.13 → 0.60.15
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.
- package/AGENTS.md +13 -0
- package/agents/notification-outbox.md +125 -2
- package/agents/profile-recipients.md +32 -0
- package/agents/scoped-attachment-test-matrix.md +46 -0
- package/dist/chunks/{AccountCollection-B7Nen_TO.js → AccountCollection-DBEG6nR7.js} +6 -7
- package/dist/chunks/AccountCollection-DBEG6nR7.js.map +1 -0
- package/dist/chunks/{Email-CnlwhWa0.js → Email-p5qIyMC5.js} +3 -3
- package/dist/chunks/{Email-CnlwhWa0.js.map → Email-p5qIyMC5.js.map} +1 -1
- package/dist/chunks/{EmailFolder-ukdMVI0c.js → EmailFolder-Dk4hxikK.js} +3 -3
- package/dist/chunks/EmailFolder-Dk4hxikK.js.map +1 -0
- package/dist/chunks/{Message-CinnTgyw.js → Message-hIwx07Kt.js} +72 -11
- package/dist/chunks/Message-hIwx07Kt.js.map +1 -0
- package/dist/chunks/{MessageCollection-BquAmxgU.js → MessageCollection-BwnE4a_L.js} +3 -3
- package/dist/chunks/MessageCollection-BwnE4a_L.js.map +1 -0
- package/dist/chunks/__smrt-register__-D3kBjvML.js +6 -0
- package/dist/chunks/__smrt-register__-D3kBjvML.js.map +1 -0
- package/dist/chunks/protected-notification-handoff-mvaEZVp7.js +358 -0
- package/dist/chunks/protected-notification-handoff-mvaEZVp7.js.map +1 -0
- package/dist/host.browser.d.ts +18 -0
- package/dist/host.browser.d.ts.map +1 -0
- package/dist/host.browser.js +27 -0
- package/dist/host.browser.js.map +1 -0
- package/dist/host.d.ts +19 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +35 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +589 -67
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +317 -14
- package/dist/migrations/profileRecipients.d.ts +17 -0
- package/dist/migrations/profileRecipients.d.ts.map +1 -0
- package/dist/models/Account.d.ts.map +1 -1
- package/dist/models/Message.d.ts +7 -0
- package/dist/models/Message.d.ts.map +1 -1
- package/dist/models/NotificationDelivery.d.ts +20 -3
- package/dist/models/NotificationDelivery.d.ts.map +1 -1
- package/dist/notification-recipient-identity.d.ts +17 -0
- package/dist/notification-recipient-identity.d.ts.map +1 -0
- package/dist/permissions.d.ts +1 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/protected-notification-handoff.d.ts +31 -0
- package/dist/protected-notification-handoff.d.ts.map +1 -0
- package/dist/recipes.d.ts +1 -1
- package/dist/senders/EmailSender.d.ts.map +1 -1
- package/dist/services/NotificationOutboxService.d.ts +51 -3
- package/dist/services/NotificationOutboxService.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +184 -12
- package/dist/smrt-knowledge.okf.md +7 -2
- package/package.json +13 -9
- package/dist/chunks/AccountCollection-B7Nen_TO.js.map +0 -1
- package/dist/chunks/EmailFolder-ukdMVI0c.js.map +0 -1
- package/dist/chunks/Message-CinnTgyw.js.map +0 -1
- package/dist/chunks/MessageCollection-BquAmxgU.js.map +0 -1
- package/dist/chunks/__smrt-register__-Dz163WBB.js +0 -6
- package/dist/chunks/__smrt-register__-Dz163WBB.js.map +0 -1
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-messages",
|
|
5
|
-
"packageVersion": "0.60.
|
|
5
|
+
"packageVersion": "0.60.15",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-messages:AccountCollection": {
|
|
8
8
|
"name": "accountcollection",
|
|
@@ -3522,7 +3522,7 @@
|
|
|
3522
3522
|
],
|
|
3523
3523
|
"schema": {
|
|
3524
3524
|
"tableName": "notification_deliveries",
|
|
3525
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"notification_deliveries\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"recipient_user_id\" UUID NOT NULL,\n \"channel\" TEXT NOT NULL DEFAULT 'email',\n \"source_ref\" TEXT NOT NULL,\n \"kind\" TEXT NOT NULL,\n \"subject\" TEXT NOT NULL,\n \"text_body\" TEXT NOT NULL,\n \"href\" TEXT NOT NULL,\n \"recipient_address\" TEXT NOT NULL,\n \"recipient_name\" TEXT,\n \"account_id\" UUID,\n \"message_id\" UUID,\n \"status\" TEXT DEFAULT 'pending',\n \"state_version\" INTEGER NOT NULL DEFAULT 0,\n \"transition_id\" TEXT,\n \"attempts\" INTEGER NOT NULL DEFAULT 0,\n \"max_attempts\" INTEGER NOT NULL DEFAULT 5,\n \"next_attempt_at\" TEXT,\n \"lease_token\" TEXT,\n \"lease_expires_at\" TIMESTAMP,\n \"handed_off_at\" TIMESTAMP,\n \"delivered_at\" TIMESTAMP,\n \"provider_message_id\" TEXT,\n \"last_error\" TEXT\n);",
|
|
3525
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"notification_deliveries\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"recipient_user_id\" UUID,\n \"recipient_profile_id\" UUID,\n \"recipient_kind\" TEXT NOT NULL DEFAULT 'user',\n \"channel\" TEXT NOT NULL DEFAULT 'email',\n \"source_ref\" TEXT NOT NULL,\n \"kind\" TEXT NOT NULL,\n \"required_dispatch_policy\" TEXT,\n \"dispatch_policy_binding\" JSON,\n \"subject\" TEXT NOT NULL,\n \"text_body\" TEXT NOT NULL,\n \"href\" TEXT NOT NULL,\n \"recipient_address\" TEXT NOT NULL,\n \"recipient_name\" TEXT,\n \"account_id\" UUID,\n \"message_id\" UUID,\n \"status\" TEXT DEFAULT 'pending',\n \"state_version\" INTEGER NOT NULL DEFAULT 0,\n \"transition_id\" TEXT,\n \"attempts\" INTEGER NOT NULL DEFAULT 0,\n \"max_attempts\" INTEGER NOT NULL DEFAULT 5,\n \"next_attempt_at\" TEXT,\n \"lease_token\" TEXT,\n \"lease_expires_at\" TIMESTAMP,\n \"handed_off_at\" TIMESTAMP,\n \"delivered_at\" TIMESTAMP,\n \"provider_message_id\" TEXT,\n \"last_error\" TEXT\n);",
|
|
3526
3526
|
"columns": {
|
|
3527
3527
|
"_sync_origin_device_id": {
|
|
3528
3528
|
"type": "TEXT"
|
|
@@ -3564,9 +3564,21 @@
|
|
|
3564
3564
|
"recipient_user_id": {
|
|
3565
3565
|
"type": "UUID",
|
|
3566
3566
|
"referenceKind": "crossPackageRef",
|
|
3567
|
-
"notNull":
|
|
3567
|
+
"notNull": false,
|
|
3568
|
+
"unique": false
|
|
3569
|
+
},
|
|
3570
|
+
"recipient_profile_id": {
|
|
3571
|
+
"type": "UUID",
|
|
3572
|
+
"referenceKind": "crossPackageRef",
|
|
3573
|
+
"notNull": false,
|
|
3568
3574
|
"unique": false
|
|
3569
3575
|
},
|
|
3576
|
+
"recipient_kind": {
|
|
3577
|
+
"type": "TEXT",
|
|
3578
|
+
"notNull": true,
|
|
3579
|
+
"unique": false,
|
|
3580
|
+
"default": "user"
|
|
3581
|
+
},
|
|
3570
3582
|
"channel": {
|
|
3571
3583
|
"type": "TEXT",
|
|
3572
3584
|
"notNull": true,
|
|
@@ -3583,6 +3595,16 @@
|
|
|
3583
3595
|
"notNull": true,
|
|
3584
3596
|
"unique": false
|
|
3585
3597
|
},
|
|
3598
|
+
"required_dispatch_policy": {
|
|
3599
|
+
"type": "TEXT",
|
|
3600
|
+
"notNull": false,
|
|
3601
|
+
"unique": false
|
|
3602
|
+
},
|
|
3603
|
+
"dispatch_policy_binding": {
|
|
3604
|
+
"type": "JSON",
|
|
3605
|
+
"notNull": false,
|
|
3606
|
+
"unique": false
|
|
3607
|
+
},
|
|
3586
3608
|
"subject": {
|
|
3587
3609
|
"type": "TEXT",
|
|
3588
3610
|
"notNull": true,
|
|
@@ -3699,14 +3721,17 @@
|
|
|
3699
3721
|
},
|
|
3700
3722
|
"indexes": [
|
|
3701
3723
|
{
|
|
3702
|
-
"name": "
|
|
3724
|
+
"name": "notification_deliveries_tenant_id_recipient_kind_idx",
|
|
3703
3725
|
"columns": [
|
|
3704
3726
|
"tenant_id",
|
|
3727
|
+
"recipient_kind",
|
|
3705
3728
|
"recipient_user_id",
|
|
3729
|
+
"recipient_profile_id",
|
|
3706
3730
|
"channel",
|
|
3707
3731
|
"source_ref"
|
|
3708
3732
|
],
|
|
3709
|
-
"unique": true
|
|
3733
|
+
"unique": true,
|
|
3734
|
+
"nullsNotDistinct": true
|
|
3710
3735
|
},
|
|
3711
3736
|
{
|
|
3712
3737
|
"name": "notification_deliveries_slug_context_idx",
|
|
@@ -3715,6 +3740,26 @@
|
|
|
3715
3740
|
"context"
|
|
3716
3741
|
]
|
|
3717
3742
|
},
|
|
3743
|
+
{
|
|
3744
|
+
"name": "notification_deliveries_user_identity",
|
|
3745
|
+
"columns": [
|
|
3746
|
+
"tenant_id",
|
|
3747
|
+
"recipient_user_id",
|
|
3748
|
+
"channel",
|
|
3749
|
+
"source_ref"
|
|
3750
|
+
],
|
|
3751
|
+
"unique": true
|
|
3752
|
+
},
|
|
3753
|
+
{
|
|
3754
|
+
"name": "notification_deliveries_profile_identity",
|
|
3755
|
+
"columns": [
|
|
3756
|
+
"tenant_id",
|
|
3757
|
+
"recipient_profile_id",
|
|
3758
|
+
"channel",
|
|
3759
|
+
"source_ref"
|
|
3760
|
+
],
|
|
3761
|
+
"unique": true
|
|
3762
|
+
},
|
|
3718
3763
|
{
|
|
3719
3764
|
"name": "notification_deliveries_due_idx",
|
|
3720
3765
|
"columns": [
|
|
@@ -3742,6 +3787,12 @@
|
|
|
3742
3787
|
"recipient_user_id"
|
|
3743
3788
|
]
|
|
3744
3789
|
},
|
|
3790
|
+
{
|
|
3791
|
+
"name": "notification_deliveries_recipient_profile_id_idx",
|
|
3792
|
+
"columns": [
|
|
3793
|
+
"recipient_profile_id"
|
|
3794
|
+
]
|
|
3795
|
+
},
|
|
3745
3796
|
{
|
|
3746
3797
|
"name": "notification_deliveries_account_id_idx",
|
|
3747
3798
|
"columns": [
|
|
@@ -3755,7 +3806,7 @@
|
|
|
3755
3806
|
]
|
|
3756
3807
|
}
|
|
3757
3808
|
],
|
|
3758
|
-
"version": "
|
|
3809
|
+
"version": "ebf79064"
|
|
3759
3810
|
},
|
|
3760
3811
|
"importPath": "@happyvertical/smrt-messages"
|
|
3761
3812
|
},
|
|
@@ -5665,6 +5716,37 @@
|
|
|
5665
5716
|
}
|
|
5666
5717
|
},
|
|
5667
5718
|
"methods": {
|
|
5719
|
+
"save": {
|
|
5720
|
+
"name": "save",
|
|
5721
|
+
"async": true,
|
|
5722
|
+
"parameters": [
|
|
5723
|
+
{
|
|
5724
|
+
"name": "options",
|
|
5725
|
+
"type": "SmrtSaveOptions",
|
|
5726
|
+
"optional": true
|
|
5727
|
+
}
|
|
5728
|
+
],
|
|
5729
|
+
"returnType": "Promise<this>",
|
|
5730
|
+
"isStatic": false,
|
|
5731
|
+
"isPublic": true
|
|
5732
|
+
},
|
|
5733
|
+
"delete": {
|
|
5734
|
+
"name": "delete",
|
|
5735
|
+
"async": true,
|
|
5736
|
+
"parameters": [
|
|
5737
|
+
{
|
|
5738
|
+
"name": "options",
|
|
5739
|
+
"type": "object",
|
|
5740
|
+
"optional": true,
|
|
5741
|
+
"memberTypes": [
|
|
5742
|
+
"Date | string"
|
|
5743
|
+
]
|
|
5744
|
+
}
|
|
5745
|
+
],
|
|
5746
|
+
"returnType": "Promise<void>",
|
|
5747
|
+
"isStatic": false,
|
|
5748
|
+
"isPublic": true
|
|
5749
|
+
},
|
|
5668
5750
|
"getToAddresses": {
|
|
5669
5751
|
"name": "getToAddresses",
|
|
5670
5752
|
"async": false,
|
|
@@ -7692,6 +7774,37 @@
|
|
|
7692
7774
|
}
|
|
7693
7775
|
},
|
|
7694
7776
|
"methods": {
|
|
7777
|
+
"save": {
|
|
7778
|
+
"name": "save",
|
|
7779
|
+
"async": true,
|
|
7780
|
+
"parameters": [
|
|
7781
|
+
{
|
|
7782
|
+
"name": "options",
|
|
7783
|
+
"type": "SmrtSaveOptions",
|
|
7784
|
+
"optional": true
|
|
7785
|
+
}
|
|
7786
|
+
],
|
|
7787
|
+
"returnType": "Promise<this>",
|
|
7788
|
+
"isStatic": false,
|
|
7789
|
+
"isPublic": true
|
|
7790
|
+
},
|
|
7791
|
+
"delete": {
|
|
7792
|
+
"name": "delete",
|
|
7793
|
+
"async": true,
|
|
7794
|
+
"parameters": [
|
|
7795
|
+
{
|
|
7796
|
+
"name": "options",
|
|
7797
|
+
"type": "object",
|
|
7798
|
+
"optional": true,
|
|
7799
|
+
"memberTypes": [
|
|
7800
|
+
"Date | string"
|
|
7801
|
+
]
|
|
7802
|
+
}
|
|
7803
|
+
],
|
|
7804
|
+
"returnType": "Promise<void>",
|
|
7805
|
+
"isStatic": false,
|
|
7806
|
+
"isPublic": true
|
|
7807
|
+
},
|
|
7695
7808
|
"getToAddresses": {
|
|
7696
7809
|
"name": "getToAddresses",
|
|
7697
7810
|
"async": false,
|
|
@@ -8619,8 +8732,31 @@
|
|
|
8619
8732
|
},
|
|
8620
8733
|
"recipientUserId": {
|
|
8621
8734
|
"type": "crossPackageRef",
|
|
8735
|
+
"required": false,
|
|
8736
|
+
"related": "@happyvertical/smrt-users:User",
|
|
8737
|
+
"_meta": {
|
|
8738
|
+
"nullable": true
|
|
8739
|
+
}
|
|
8740
|
+
},
|
|
8741
|
+
"recipientProfileId": {
|
|
8742
|
+
"type": "crossPackageRef",
|
|
8743
|
+
"required": false,
|
|
8744
|
+
"related": "@happyvertical/smrt-profiles:Profile",
|
|
8745
|
+
"_meta": {
|
|
8746
|
+
"nullable": true
|
|
8747
|
+
}
|
|
8748
|
+
},
|
|
8749
|
+
"recipientKind": {
|
|
8750
|
+
"type": "text",
|
|
8622
8751
|
"required": true,
|
|
8623
|
-
"
|
|
8752
|
+
"default": "user",
|
|
8753
|
+
"_meta": {
|
|
8754
|
+
"required": true
|
|
8755
|
+
},
|
|
8756
|
+
"enum": [
|
|
8757
|
+
"user",
|
|
8758
|
+
"profile"
|
|
8759
|
+
]
|
|
8624
8760
|
},
|
|
8625
8761
|
"channel": {
|
|
8626
8762
|
"type": "text",
|
|
@@ -8647,6 +8783,15 @@
|
|
|
8647
8783
|
"required": true
|
|
8648
8784
|
}
|
|
8649
8785
|
},
|
|
8786
|
+
"requiredDispatchPolicy": {
|
|
8787
|
+
"type": "text",
|
|
8788
|
+
"required": false
|
|
8789
|
+
},
|
|
8790
|
+
"dispatchPolicyBinding": {
|
|
8791
|
+
"type": "json",
|
|
8792
|
+
"required": false,
|
|
8793
|
+
"_meta": {}
|
|
8794
|
+
},
|
|
8650
8795
|
"subject": {
|
|
8651
8796
|
"type": "text",
|
|
8652
8797
|
"required": true,
|
|
@@ -8751,6 +8896,28 @@
|
|
|
8751
8896
|
}
|
|
8752
8897
|
},
|
|
8753
8898
|
"methods": {
|
|
8899
|
+
"save": {
|
|
8900
|
+
"name": "save",
|
|
8901
|
+
"async": true,
|
|
8902
|
+
"parameters": [
|
|
8903
|
+
{
|
|
8904
|
+
"name": "options",
|
|
8905
|
+
"type": "SmrtSaveOptions",
|
|
8906
|
+
"optional": true
|
|
8907
|
+
}
|
|
8908
|
+
],
|
|
8909
|
+
"returnType": "Promise<this>",
|
|
8910
|
+
"isStatic": false,
|
|
8911
|
+
"isPublic": true
|
|
8912
|
+
},
|
|
8913
|
+
"delete": {
|
|
8914
|
+
"name": "delete",
|
|
8915
|
+
"async": true,
|
|
8916
|
+
"parameters": [],
|
|
8917
|
+
"returnType": "Promise<void>",
|
|
8918
|
+
"isStatic": false,
|
|
8919
|
+
"isPublic": true
|
|
8920
|
+
},
|
|
8754
8921
|
"transition": {
|
|
8755
8922
|
"name": "transition",
|
|
8756
8923
|
"async": true,
|
|
@@ -8782,11 +8949,33 @@
|
|
|
8782
8949
|
"cli": false,
|
|
8783
8950
|
"conflictColumns": [
|
|
8784
8951
|
"tenant_id",
|
|
8952
|
+
"recipient_kind",
|
|
8785
8953
|
"recipient_user_id",
|
|
8954
|
+
"recipient_profile_id",
|
|
8786
8955
|
"channel",
|
|
8787
8956
|
"source_ref"
|
|
8788
8957
|
],
|
|
8789
8958
|
"indexes": [
|
|
8959
|
+
{
|
|
8960
|
+
"name": "notification_deliveries_user_identity",
|
|
8961
|
+
"columns": [
|
|
8962
|
+
"tenantId",
|
|
8963
|
+
"recipientUserId",
|
|
8964
|
+
"channel",
|
|
8965
|
+
"sourceRef"
|
|
8966
|
+
],
|
|
8967
|
+
"unique": true
|
|
8968
|
+
},
|
|
8969
|
+
{
|
|
8970
|
+
"name": "notification_deliveries_profile_identity",
|
|
8971
|
+
"columns": [
|
|
8972
|
+
"tenantId",
|
|
8973
|
+
"recipientProfileId",
|
|
8974
|
+
"channel",
|
|
8975
|
+
"sourceRef"
|
|
8976
|
+
],
|
|
8977
|
+
"unique": true
|
|
8978
|
+
},
|
|
8790
8979
|
{
|
|
8791
8980
|
"name": "notification_deliveries_due_idx",
|
|
8792
8981
|
"columns": [
|
|
@@ -8811,9 +9000,9 @@
|
|
|
8811
9000
|
"collectionExportName": "NotificationDeliveryCollection",
|
|
8812
9001
|
"validationRules": [
|
|
8813
9002
|
{
|
|
8814
|
-
"field": "
|
|
9003
|
+
"field": "recipientKind",
|
|
8815
9004
|
"rule": "required",
|
|
8816
|
-
"fieldType": "
|
|
9005
|
+
"fieldType": "text"
|
|
8817
9006
|
},
|
|
8818
9007
|
{
|
|
8819
9008
|
"field": "channel",
|
|
@@ -8868,7 +9057,7 @@
|
|
|
8868
9057
|
],
|
|
8869
9058
|
"schema": {
|
|
8870
9059
|
"tableName": "notification_deliveries",
|
|
8871
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"notification_deliveries\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"recipient_user_id\" UUID NOT NULL,\n \"channel\" TEXT NOT NULL DEFAULT 'email',\n \"source_ref\" TEXT NOT NULL,\n \"kind\" TEXT NOT NULL,\n \"subject\" TEXT NOT NULL,\n \"text_body\" TEXT NOT NULL,\n \"href\" TEXT NOT NULL,\n \"recipient_address\" TEXT NOT NULL,\n \"recipient_name\" TEXT,\n \"account_id\" UUID,\n \"message_id\" UUID,\n \"status\" TEXT DEFAULT 'pending',\n \"state_version\" INTEGER NOT NULL DEFAULT 0,\n \"transition_id\" TEXT,\n \"attempts\" INTEGER NOT NULL DEFAULT 0,\n \"max_attempts\" INTEGER NOT NULL DEFAULT 5,\n \"next_attempt_at\" TEXT,\n \"lease_token\" TEXT,\n \"lease_expires_at\" TIMESTAMP,\n \"handed_off_at\" TIMESTAMP,\n \"delivered_at\" TIMESTAMP,\n \"provider_message_id\" TEXT,\n \"last_error\" TEXT\n);",
|
|
9060
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"notification_deliveries\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"recipient_user_id\" UUID,\n \"recipient_profile_id\" UUID,\n \"recipient_kind\" TEXT NOT NULL DEFAULT 'user',\n \"channel\" TEXT NOT NULL DEFAULT 'email',\n \"source_ref\" TEXT NOT NULL,\n \"kind\" TEXT NOT NULL,\n \"required_dispatch_policy\" TEXT,\n \"dispatch_policy_binding\" JSON,\n \"subject\" TEXT NOT NULL,\n \"text_body\" TEXT NOT NULL,\n \"href\" TEXT NOT NULL,\n \"recipient_address\" TEXT NOT NULL,\n \"recipient_name\" TEXT,\n \"account_id\" UUID,\n \"message_id\" UUID,\n \"status\" TEXT DEFAULT 'pending',\n \"state_version\" INTEGER NOT NULL DEFAULT 0,\n \"transition_id\" TEXT,\n \"attempts\" INTEGER NOT NULL DEFAULT 0,\n \"max_attempts\" INTEGER NOT NULL DEFAULT 5,\n \"next_attempt_at\" TEXT,\n \"lease_token\" TEXT,\n \"lease_expires_at\" TIMESTAMP,\n \"handed_off_at\" TIMESTAMP,\n \"delivered_at\" TIMESTAMP,\n \"provider_message_id\" TEXT,\n \"last_error\" TEXT\n);",
|
|
8872
9061
|
"columns": {
|
|
8873
9062
|
"_sync_origin_device_id": {
|
|
8874
9063
|
"type": "TEXT"
|
|
@@ -8910,9 +9099,21 @@
|
|
|
8910
9099
|
"recipient_user_id": {
|
|
8911
9100
|
"type": "UUID",
|
|
8912
9101
|
"referenceKind": "crossPackageRef",
|
|
8913
|
-
"notNull":
|
|
9102
|
+
"notNull": false,
|
|
9103
|
+
"unique": false
|
|
9104
|
+
},
|
|
9105
|
+
"recipient_profile_id": {
|
|
9106
|
+
"type": "UUID",
|
|
9107
|
+
"referenceKind": "crossPackageRef",
|
|
9108
|
+
"notNull": false,
|
|
8914
9109
|
"unique": false
|
|
8915
9110
|
},
|
|
9111
|
+
"recipient_kind": {
|
|
9112
|
+
"type": "TEXT",
|
|
9113
|
+
"notNull": true,
|
|
9114
|
+
"unique": false,
|
|
9115
|
+
"default": "user"
|
|
9116
|
+
},
|
|
8916
9117
|
"channel": {
|
|
8917
9118
|
"type": "TEXT",
|
|
8918
9119
|
"notNull": true,
|
|
@@ -8929,6 +9130,16 @@
|
|
|
8929
9130
|
"notNull": true,
|
|
8930
9131
|
"unique": false
|
|
8931
9132
|
},
|
|
9133
|
+
"required_dispatch_policy": {
|
|
9134
|
+
"type": "TEXT",
|
|
9135
|
+
"notNull": false,
|
|
9136
|
+
"unique": false
|
|
9137
|
+
},
|
|
9138
|
+
"dispatch_policy_binding": {
|
|
9139
|
+
"type": "JSON",
|
|
9140
|
+
"notNull": false,
|
|
9141
|
+
"unique": false
|
|
9142
|
+
},
|
|
8932
9143
|
"subject": {
|
|
8933
9144
|
"type": "TEXT",
|
|
8934
9145
|
"notNull": true,
|
|
@@ -9045,14 +9256,17 @@
|
|
|
9045
9256
|
},
|
|
9046
9257
|
"indexes": [
|
|
9047
9258
|
{
|
|
9048
|
-
"name": "
|
|
9259
|
+
"name": "notification_deliveries_tenant_id_recipient_kind_idx",
|
|
9049
9260
|
"columns": [
|
|
9050
9261
|
"tenant_id",
|
|
9262
|
+
"recipient_kind",
|
|
9051
9263
|
"recipient_user_id",
|
|
9264
|
+
"recipient_profile_id",
|
|
9052
9265
|
"channel",
|
|
9053
9266
|
"source_ref"
|
|
9054
9267
|
],
|
|
9055
|
-
"unique": true
|
|
9268
|
+
"unique": true,
|
|
9269
|
+
"nullsNotDistinct": true
|
|
9056
9270
|
},
|
|
9057
9271
|
{
|
|
9058
9272
|
"name": "notification_deliveries_slug_context_idx",
|
|
@@ -9061,6 +9275,26 @@
|
|
|
9061
9275
|
"context"
|
|
9062
9276
|
]
|
|
9063
9277
|
},
|
|
9278
|
+
{
|
|
9279
|
+
"name": "notification_deliveries_user_identity",
|
|
9280
|
+
"columns": [
|
|
9281
|
+
"tenant_id",
|
|
9282
|
+
"recipient_user_id",
|
|
9283
|
+
"channel",
|
|
9284
|
+
"source_ref"
|
|
9285
|
+
],
|
|
9286
|
+
"unique": true
|
|
9287
|
+
},
|
|
9288
|
+
{
|
|
9289
|
+
"name": "notification_deliveries_profile_identity",
|
|
9290
|
+
"columns": [
|
|
9291
|
+
"tenant_id",
|
|
9292
|
+
"recipient_profile_id",
|
|
9293
|
+
"channel",
|
|
9294
|
+
"source_ref"
|
|
9295
|
+
],
|
|
9296
|
+
"unique": true
|
|
9297
|
+
},
|
|
9064
9298
|
{
|
|
9065
9299
|
"name": "notification_deliveries_due_idx",
|
|
9066
9300
|
"columns": [
|
|
@@ -9088,6 +9322,12 @@
|
|
|
9088
9322
|
"recipient_user_id"
|
|
9089
9323
|
]
|
|
9090
9324
|
},
|
|
9325
|
+
{
|
|
9326
|
+
"name": "notification_deliveries_recipient_profile_id_idx",
|
|
9327
|
+
"columns": [
|
|
9328
|
+
"recipient_profile_id"
|
|
9329
|
+
]
|
|
9330
|
+
},
|
|
9091
9331
|
{
|
|
9092
9332
|
"name": "notification_deliveries_account_id_idx",
|
|
9093
9333
|
"columns": [
|
|
@@ -9101,7 +9341,7 @@
|
|
|
9101
9341
|
]
|
|
9102
9342
|
}
|
|
9103
9343
|
],
|
|
9104
|
-
"version": "
|
|
9344
|
+
"version": "ebf79064"
|
|
9105
9345
|
},
|
|
9106
9346
|
"importPath": "@happyvertical/smrt-messages"
|
|
9107
9347
|
},
|
|
@@ -10314,6 +10554,37 @@
|
|
|
10314
10554
|
}
|
|
10315
10555
|
},
|
|
10316
10556
|
"methods": {
|
|
10557
|
+
"save": {
|
|
10558
|
+
"name": "save",
|
|
10559
|
+
"async": true,
|
|
10560
|
+
"parameters": [
|
|
10561
|
+
{
|
|
10562
|
+
"name": "options",
|
|
10563
|
+
"type": "SmrtSaveOptions",
|
|
10564
|
+
"optional": true
|
|
10565
|
+
}
|
|
10566
|
+
],
|
|
10567
|
+
"returnType": "Promise<this>",
|
|
10568
|
+
"isStatic": false,
|
|
10569
|
+
"isPublic": true
|
|
10570
|
+
},
|
|
10571
|
+
"delete": {
|
|
10572
|
+
"name": "delete",
|
|
10573
|
+
"async": true,
|
|
10574
|
+
"parameters": [
|
|
10575
|
+
{
|
|
10576
|
+
"name": "options",
|
|
10577
|
+
"type": "object",
|
|
10578
|
+
"optional": true,
|
|
10579
|
+
"memberTypes": [
|
|
10580
|
+
"Date | string"
|
|
10581
|
+
]
|
|
10582
|
+
}
|
|
10583
|
+
],
|
|
10584
|
+
"returnType": "Promise<void>",
|
|
10585
|
+
"isStatic": false,
|
|
10586
|
+
"isPublic": true
|
|
10587
|
+
},
|
|
10317
10588
|
"getToAddresses": {
|
|
10318
10589
|
"name": "getToAddresses",
|
|
10319
10590
|
"async": false,
|
|
@@ -11661,6 +11932,37 @@
|
|
|
11661
11932
|
}
|
|
11662
11933
|
},
|
|
11663
11934
|
"methods": {
|
|
11935
|
+
"save": {
|
|
11936
|
+
"name": "save",
|
|
11937
|
+
"async": true,
|
|
11938
|
+
"parameters": [
|
|
11939
|
+
{
|
|
11940
|
+
"name": "options",
|
|
11941
|
+
"type": "SmrtSaveOptions",
|
|
11942
|
+
"optional": true
|
|
11943
|
+
}
|
|
11944
|
+
],
|
|
11945
|
+
"returnType": "Promise<this>",
|
|
11946
|
+
"isStatic": false,
|
|
11947
|
+
"isPublic": true
|
|
11948
|
+
},
|
|
11949
|
+
"delete": {
|
|
11950
|
+
"name": "delete",
|
|
11951
|
+
"async": true,
|
|
11952
|
+
"parameters": [
|
|
11953
|
+
{
|
|
11954
|
+
"name": "options",
|
|
11955
|
+
"type": "object",
|
|
11956
|
+
"optional": true,
|
|
11957
|
+
"memberTypes": [
|
|
11958
|
+
"Date | string"
|
|
11959
|
+
]
|
|
11960
|
+
}
|
|
11961
|
+
],
|
|
11962
|
+
"returnType": "Promise<void>",
|
|
11963
|
+
"isStatic": false,
|
|
11964
|
+
"isPublic": true
|
|
11965
|
+
},
|
|
11664
11966
|
"getToAddresses": {
|
|
11665
11967
|
"name": "getToAddresses",
|
|
11666
11968
|
"async": false,
|
|
@@ -14041,6 +14343,7 @@
|
|
|
14041
14343
|
"smrtDependencies": [
|
|
14042
14344
|
"@happyvertical/smrt-core",
|
|
14043
14345
|
"@happyvertical/smrt-ledgers",
|
|
14346
|
+
"@happyvertical/smrt-profiles",
|
|
14044
14347
|
"@happyvertical/smrt-secrets",
|
|
14045
14348
|
"@happyvertical/smrt-tenancy",
|
|
14046
14349
|
"@happyvertical/smrt-users"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Explicit maintenance migration for typed email contact identities. No runtime DDL. */
|
|
2
|
+
import type { DatabaseInterface } from '@happyvertical/smrt-core/migrations';
|
|
3
|
+
export type NotificationProfileRecipientEngine = 'postgres' | 'sqlite';
|
|
4
|
+
export interface NotificationProfileRecipientPlan {
|
|
5
|
+
engine: NotificationProfileRecipientEngine;
|
|
6
|
+
ready: boolean;
|
|
7
|
+
statements: string[];
|
|
8
|
+
invalidRowIds: string[];
|
|
9
|
+
obsoleteIndexes: string[];
|
|
10
|
+
}
|
|
11
|
+
/** Read-only plan against the live schema. Refuses ambiguous drift and never changes rows. */
|
|
12
|
+
export declare function planNotificationProfileRecipients(db: Pick<DatabaseInterface, 'query'>, engine: NotificationProfileRecipientEngine): Promise<NotificationProfileRecipientPlan>;
|
|
13
|
+
/** Apply/replay atomically using a root maintenance handle. No row IDs or evidence are rewritten. */
|
|
14
|
+
export declare function migrateNotificationProfileRecipients(db: DatabaseInterface, engine: NotificationProfileRecipientEngine): Promise<NotificationProfileRecipientPlan>;
|
|
15
|
+
/** Profile-only runtime admission gate checks physical constraints/indexes, never a migration marker. */
|
|
16
|
+
export declare function assertNotificationProfileRecipientSchema(db: Pick<DatabaseInterface, 'query' | 'url'>): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=profileRecipients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileRecipients.d.ts","sourceRoot":"","sources":["../../src/migrations/profileRecipients.ts"],"names":[],"mappings":"AACA,yFAAyF;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAM7E,MAAM,MAAM,kCAAkC,GAAG,UAAU,GAAG,QAAQ,CAAC;AACvE,MAAM,WAAW,gCAAgC;IAC/C,MAAM,EAAE,kCAAkC,CAAC;IAC3C,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAgMD,8FAA8F;AAC9F,wBAAsB,iCAAiC,CACrD,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,EACpC,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,gCAAgC,CAAC,CAkL3C;AACD,qGAAqG;AACrG,wBAAsB,oCAAoC,CACxD,EAAE,EAAE,iBAAiB,EACrB,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,gCAAgC,CAAC,CA0B3C;AACD,yGAAyG;AACzG,wBAAsB,wCAAwC,CAC5D,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,KAAK,CAAC,GAC3C,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../src/models/Account.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAS,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAOnE,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAU,CAAC;AAEvE,qBAOa,OAAQ,SAAQ,UAAU;IAErC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAK/B,IAAI,SAAM;IAIV,YAAY,SAAM;IAKlB,WAAW,SAAM;I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ions } from '@happyvertical/smrt-core';
|
|
1
2
|
/**
|
|
2
3
|
* Message model - Base class for all message types (STI)
|
|
3
4
|
*
|
|
@@ -36,6 +37,12 @@ export declare class Message extends SmrtObject {
|
|
|
36
37
|
createdAt: Date;
|
|
37
38
|
updatedAt: Date;
|
|
38
39
|
constructor(options?: MessageOptions);
|
|
40
|
+
/** Ordinary saves preserve protected outbox provenance and approved content. */
|
|
41
|
+
save(options?: SmrtSaveOptions): Promise<this>;
|
|
42
|
+
/** Protected outbound evidence is retained; ordinary message deletion remains unchanged. */
|
|
43
|
+
delete(options?: {
|
|
44
|
+
expectedUpdatedAt?: Date | string;
|
|
45
|
+
}): Promise<void>;
|
|
39
46
|
private finalizeSendLifecycle;
|
|
40
47
|
/**
|
|
41
48
|
* Get to addresses as parsed array
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAIL,UAAU,EAIX,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACX,MAAM,aAAU,CAAC;AAElB,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAUhE;;;;GAIG;AAIH,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAIL,UAAU,EAIX,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACX,MAAM,aAAU,CAAC;AAElB,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,uBAAuB,CAAC;AAqDtE,qBAOa,OAAQ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@happyvertical/smrt-core';
|
|
2
2
|
import '../__smrt-register__.js';
|
|
3
3
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
4
4
|
/** Channels the notification outbox can deliver through. */
|
|
@@ -18,10 +18,14 @@ export declare const NOTIFICATION_DELIVERY_CHANNELS: readonly NotificationDelive
|
|
|
18
18
|
export type NotificationDeliveryStatus = 'pending' | 'sending' | 'sent' | 'failed' | 'uncertain' | 'cancelled';
|
|
19
19
|
export interface NotificationDeliveryOptions extends SmrtObjectOptions {
|
|
20
20
|
tenantId?: string;
|
|
21
|
-
recipientUserId?: string;
|
|
21
|
+
recipientUserId?: string | null;
|
|
22
|
+
recipientProfileId?: string | null;
|
|
23
|
+
recipientKind?: 'user' | 'profile';
|
|
22
24
|
channel?: NotificationDeliveryChannel;
|
|
23
25
|
sourceRef?: string;
|
|
24
26
|
kind?: string;
|
|
27
|
+
requiredDispatchPolicy?: string;
|
|
28
|
+
dispatchPolicyBinding?: string;
|
|
25
29
|
subject?: string;
|
|
26
30
|
textBody?: string;
|
|
27
31
|
href?: string;
|
|
@@ -63,13 +67,21 @@ export type NotificationDeliveryTransition = Partial<Pick<NotificationDelivery,
|
|
|
63
67
|
export declare class NotificationDelivery extends SmrtObject {
|
|
64
68
|
tenantId: string;
|
|
65
69
|
/** The person being told (`smrt-users:User`, uuid). */
|
|
66
|
-
recipientUserId: string;
|
|
70
|
+
recipientUserId: string | null;
|
|
71
|
+
/** Stable external contact identity; never a fabricated auth account. */
|
|
72
|
+
recipientProfileId: string | null;
|
|
73
|
+
/** Exactly one corresponding reference is required; legacy rows remain users. */
|
|
74
|
+
recipientKind: 'user' | 'profile';
|
|
67
75
|
/** Delivery channel; only `email` today. */
|
|
68
76
|
channel: NotificationDeliveryChannel;
|
|
69
77
|
/** Idempotency key for the underlying event (see class docs). */
|
|
70
78
|
sourceRef: string;
|
|
71
79
|
/** Host-defined type, e.g. `project-question.asked`. */
|
|
72
80
|
kind: string;
|
|
81
|
+
/** Trusted host policy required at every provider handoff; empty is legacy ordinary mail. */
|
|
82
|
+
requiredDispatchPolicy: string;
|
|
83
|
+
/** Immutable host-approved resource/version/digest binding, serialized JSON. */
|
|
84
|
+
dispatchPolicyBinding: string;
|
|
73
85
|
/** Email subject line. */
|
|
74
86
|
subject: string;
|
|
75
87
|
/** Plain-text body; the deep link is appended on its own line. */
|
|
@@ -108,6 +120,11 @@ export declare class NotificationDelivery extends SmrtObject {
|
|
|
108
120
|
/** The latest failure or uncertainty reason. */
|
|
109
121
|
lastError: string;
|
|
110
122
|
constructor(options?: NotificationDeliveryOptions);
|
|
123
|
+
/** Protected consent and document bindings cannot be downgraded by ordinary saves. */
|
|
124
|
+
save(options?: SmrtSaveOptions): Promise<this>;
|
|
125
|
+
private saveWithGuard;
|
|
126
|
+
/** Protected history must survive mutable caller flags and uncertain outcomes. */
|
|
127
|
+
delete(): Promise<void>;
|
|
111
128
|
/** Whether no further automatic work will happen on this row. */
|
|
112
129
|
get isSettled(): boolean;
|
|
113
130
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationDelivery.d.ts","sourceRoot":"","sources":["../../src/models/NotificationDelivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"NotificationDelivery.d.ts","sourceRoot":"","sources":["../../src/models/NotificationDelivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAML,UAAU,EAIX,MAAM,0BAA0B,CAAC;AAGlC,4DAA4D;AAC5D,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC;AAElD,eAAO,MAAM,8BAA8B,EAAE,SAAS,2BAA2B,EACtE,CAAC;AAEZ;;;;;;;;;;GAUG;AACH,MAAM,MAAM,0BAA0B,GAClC,SAAS,GACT,SAAS,GACT,MAAM,GACN,QAAQ,GACR,WAAW,GACX,WA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