@rapidmx/restapi 0.1.0 → 0.2.0
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/dist/lib/models/mongo/DeviceSyncStateMongo.js +31 -0
- package/dist/lib/models/mongo/DeviceSyncStateMongo.js.map +1 -1
- package/dist/lib/models/mongo/MailboxMongo.js +32 -0
- package/dist/lib/models/mongo/MailboxMongo.js.map +1 -1
- package/dist/lib/models/sql/DeviceSyncStateSQL.js +31 -0
- package/dist/lib/models/sql/DeviceSyncStateSQL.js.map +1 -1
- package/dist/lib/models/sql/MailboxSQL.js +32 -0
- package/dist/lib/models/sql/MailboxSQL.js.map +1 -1
- package/dist/lib/models/types.js.map +1 -1
- package/dist/lib/routes/BaseMailboxRoute.js +31 -3
- package/dist/lib/routes/BaseMailboxRoute.js.map +1 -1
- package/dist/lib/routes/mongo/MailboxRouteMongo.js +2 -1
- package/dist/lib/routes/mongo/MailboxRouteMongo.js.map +1 -1
- package/dist/lib/routes/sql/MailboxRouteSQL.js +2 -1
- package/dist/lib/routes/sql/MailboxRouteSQL.js.map +1 -1
- package/dist/types/models/mongo/DeviceSyncStateMongo.d.ts +4 -0
- package/dist/types/models/mongo/MailboxMongo.d.ts +4 -0
- package/dist/types/models/sql/DeviceSyncStateSQL.d.ts +4 -0
- package/dist/types/models/sql/MailboxSQL.d.ts +4 -0
- package/dist/types/models/types.d.ts +23 -0
- package/dist/types/routes/BaseMailboxRoute.d.ts +8 -0
- package/dist/types/routes/mongo/MailboxRouteMongo.d.ts +1 -0
- package/dist/types/routes/sql/MailboxRouteSQL.d.ts +1 -0
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ let DeviceSyncStateMongo = class DeviceSyncStateMongo extends BaseMongoEntity {
|
|
|
30
30
|
this.deviceId = "";
|
|
31
31
|
this.deviceType = "";
|
|
32
32
|
this.folderSyncKeys = {};
|
|
33
|
+
this.folderCollectionClasses = {};
|
|
33
34
|
this.provisioned = false;
|
|
34
35
|
if (other) {
|
|
35
36
|
this.mailboxUid = other.mailboxUid !== undefined ? other.mailboxUid : this.mailboxUid;
|
|
@@ -37,8 +38,15 @@ let DeviceSyncStateMongo = class DeviceSyncStateMongo extends BaseMongoEntity {
|
|
|
37
38
|
this.deviceType = other.deviceType !== undefined ? other.deviceType : this.deviceType;
|
|
38
39
|
this.policyKey = "policyKey" in other ? other.policyKey : this.policyKey;
|
|
39
40
|
this.folderSyncKeys = other.folderSyncKeys !== undefined ? other.folderSyncKeys : this.folderSyncKeys;
|
|
41
|
+
this.folderCollectionClasses =
|
|
42
|
+
other.folderCollectionClasses !== undefined ? other.folderCollectionClasses : this.folderCollectionClasses;
|
|
40
43
|
this.lastSyncAt = "lastSyncAt" in other ? other.lastSyncAt : this.lastSyncAt;
|
|
41
44
|
this.provisioned = other.provisioned !== undefined ? other.provisioned : this.provisioned;
|
|
45
|
+
this.remoteWipeRequested = "remoteWipeRequested" in other ? other.remoteWipeRequested : this.remoteWipeRequested;
|
|
46
|
+
this.remoteWipeAccountOnly =
|
|
47
|
+
"remoteWipeAccountOnly" in other ? other.remoteWipeAccountOnly : this.remoteWipeAccountOnly;
|
|
48
|
+
this.remoteWipeAcknowledgedAt =
|
|
49
|
+
"remoteWipeAcknowledgedAt" in other ? other.remoteWipeAcknowledgedAt : this.remoteWipeAcknowledgedAt;
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
};
|
|
@@ -68,6 +76,11 @@ __decorate([
|
|
|
68
76
|
Description("The per-folder EAS `SyncKey` cursor, keyed by `Folder.uid`."),
|
|
69
77
|
__metadata("design:type", Object)
|
|
70
78
|
], DeviceSyncStateMongo.prototype, "folderSyncKeys", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Column(),
|
|
81
|
+
Description("The EAS `Class` most recently synced for a folder, keyed by `Folder.uid`."),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], DeviceSyncStateMongo.prototype, "folderCollectionClasses", void 0);
|
|
71
84
|
__decorate([
|
|
72
85
|
Column(),
|
|
73
86
|
Description("The date and time of the device's last successful sync."),
|
|
@@ -79,6 +92,24 @@ __decorate([
|
|
|
79
92
|
Description("`true` if the device has completed EAS provisioning."),
|
|
80
93
|
__metadata("design:type", Boolean)
|
|
81
94
|
], DeviceSyncStateMongo.prototype, "provisioned", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
Column(),
|
|
97
|
+
Description("`true` once an administrator has requested this device be remotely wiped."),
|
|
98
|
+
Nullable,
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], DeviceSyncStateMongo.prototype, "remoteWipeRequested", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
Column(),
|
|
103
|
+
Description("`true` if the pending/most recent remote wipe request was scoped to this account only."),
|
|
104
|
+
Nullable,
|
|
105
|
+
__metadata("design:type", Boolean)
|
|
106
|
+
], DeviceSyncStateMongo.prototype, "remoteWipeAccountOnly", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
Column(),
|
|
109
|
+
Description("When the device most recently acknowledged a remote wipe request."),
|
|
110
|
+
Nullable,
|
|
111
|
+
__metadata("design:type", Date)
|
|
112
|
+
], DeviceSyncStateMongo.prototype, "remoteWipeAcknowledgedAt", void 0);
|
|
82
113
|
DeviceSyncStateMongo = __decorate([
|
|
83
114
|
DataStore("mongo"),
|
|
84
115
|
Entity(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceSyncStateMongo.js","sourceRoot":"","sources":["../../../../src/models/mongo/DeviceSyncStateMongo.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAEH,eAAe,EACf,aAAa,EACb,eAAe,EACf,qBAAqB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,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EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrF,OAAO,CACJ;QACI,GAAG,EAAE,iBAAiB;QACtB,OAAO,EAAE;YACL,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;YAC1C,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;SACtC;KACJ,EACD,KAAK,CACR;;GACY,oBAAoB,CAsEhC"}
|
|
@@ -33,6 +33,8 @@ let MailboxMongo = class MailboxMongo extends BaseMongoEntity {
|
|
|
33
33
|
this.timezone = "";
|
|
34
34
|
this.quotaBytes = 0;
|
|
35
35
|
this.usedBytes = 0;
|
|
36
|
+
this.oofEnabled = false;
|
|
37
|
+
this.oofMessage = "";
|
|
36
38
|
if (other) {
|
|
37
39
|
this.ownerUserUid = other.ownerUserUid !== undefined ? other.ownerUserUid : this.ownerUserUid;
|
|
38
40
|
this.primarySmtpAddress =
|
|
@@ -42,6 +44,10 @@ let MailboxMongo = class MailboxMongo extends BaseMongoEntity {
|
|
|
42
44
|
this.timezone = other.timezone !== undefined ? other.timezone : this.timezone;
|
|
43
45
|
this.quotaBytes = other.quotaBytes !== undefined ? other.quotaBytes : this.quotaBytes;
|
|
44
46
|
this.usedBytes = other.usedBytes !== undefined ? other.usedBytes : this.usedBytes;
|
|
47
|
+
this.oofEnabled = other.oofEnabled !== undefined ? other.oofEnabled : this.oofEnabled;
|
|
48
|
+
this.oofMessage = other.oofMessage !== undefined ? other.oofMessage : this.oofMessage;
|
|
49
|
+
this.oofStartTime = "oofStartTime" in other ? other.oofStartTime : this.oofStartTime;
|
|
50
|
+
this.oofEndTime = "oofEndTime" in other ? other.oofEndTime : this.oofEndTime;
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
};
|
|
@@ -82,6 +88,32 @@ __decorate([
|
|
|
82
88
|
Description("The current total size, in bytes, of all messages/attachments stored in this mailbox."),
|
|
83
89
|
__metadata("design:type", Number)
|
|
84
90
|
], MailboxMongo.prototype, "usedBytes", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
Column(),
|
|
93
|
+
Description("`true` if this mailbox's out-of-office auto-reply (MS-ASSettings `Oof`) is currently enabled."),
|
|
94
|
+
__metadata("design:type", Boolean)
|
|
95
|
+
], MailboxMongo.prototype, "oofEnabled", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
Column(),
|
|
98
|
+
Description("The out-of-office auto-reply message body.")
|
|
99
|
+
// `ObjectUtils.validate()` treats an empty string the same as null/undefined for any non-`@Nullable`
|
|
100
|
+
// field ("Property oofMessage cannot be null.") - this field's natural default (no OOF message configured
|
|
101
|
+
// yet) is legitimately "", so it must be `@Nullable` even though the type itself is always a `string`.
|
|
102
|
+
,
|
|
103
|
+
Nullable,
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], MailboxMongo.prototype, "oofMessage", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
Column(),
|
|
108
|
+
Description("When set together with `oofEndTime`, the auto-reply is only active within this window."),
|
|
109
|
+
Nullable,
|
|
110
|
+
__metadata("design:type", Date)
|
|
111
|
+
], MailboxMongo.prototype, "oofStartTime", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
Column(),
|
|
114
|
+
Nullable,
|
|
115
|
+
__metadata("design:type", Date)
|
|
116
|
+
], MailboxMongo.prototype, "oofEndTime", void 0);
|
|
85
117
|
MailboxMongo = __decorate([
|
|
86
118
|
DataStore("mongo"),
|
|
87
119
|
Entity(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MailboxMongo.js","sourceRoot":"","sources":["../../../../src/models/mongo/MailboxMongo.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM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,SAAS,CAAC,OAAO,CAAC;IAClB,MAAM,EAAE;IACR,WAAW,CACR,yGAAyG;QACrG,2CAA2C,CAClD;IACA,KAAK,CAAC,eAAe,EAAE,CAAC,cAAc,CAAC,CAAC;IACxC,KAAK,CAAC,sBAAsB,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvE,OAAO,CACJ;QACI,GAAG,EAAE,SAAS;QACd,OAAO,EAAE;YACL,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;YAC1C,mGAAmG;YACnG,kGAAkG;YAClG,kGAAkG;YAClG,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;SACtC;KACJ,EACD,IAAI,CACP;;GACY,YAAY,CAwExB"}
|
|
@@ -30,6 +30,7 @@ let DeviceSyncStateSQL = class DeviceSyncStateSQL extends BaseEntity {
|
|
|
30
30
|
this.deviceId = "";
|
|
31
31
|
this.deviceType = "";
|
|
32
32
|
this.folderSyncKeys = {};
|
|
33
|
+
this.folderCollectionClasses = {};
|
|
33
34
|
this.provisioned = false;
|
|
34
35
|
if (other) {
|
|
35
36
|
this.mailboxUid = other.mailboxUid !== undefined ? other.mailboxUid : this.mailboxUid;
|
|
@@ -37,8 +38,15 @@ let DeviceSyncStateSQL = class DeviceSyncStateSQL extends BaseEntity {
|
|
|
37
38
|
this.deviceType = other.deviceType !== undefined ? other.deviceType : this.deviceType;
|
|
38
39
|
this.policyKey = "policyKey" in other ? other.policyKey : this.policyKey;
|
|
39
40
|
this.folderSyncKeys = other.folderSyncKeys !== undefined ? other.folderSyncKeys : this.folderSyncKeys;
|
|
41
|
+
this.folderCollectionClasses =
|
|
42
|
+
other.folderCollectionClasses !== undefined ? other.folderCollectionClasses : this.folderCollectionClasses;
|
|
40
43
|
this.lastSyncAt = "lastSyncAt" in other ? other.lastSyncAt : this.lastSyncAt;
|
|
41
44
|
this.provisioned = other.provisioned !== undefined ? other.provisioned : this.provisioned;
|
|
45
|
+
this.remoteWipeRequested = "remoteWipeRequested" in other ? other.remoteWipeRequested : this.remoteWipeRequested;
|
|
46
|
+
this.remoteWipeAccountOnly =
|
|
47
|
+
"remoteWipeAccountOnly" in other ? other.remoteWipeAccountOnly : this.remoteWipeAccountOnly;
|
|
48
|
+
this.remoteWipeAcknowledgedAt =
|
|
49
|
+
"remoteWipeAcknowledgedAt" in other ? other.remoteWipeAcknowledgedAt : this.remoteWipeAcknowledgedAt;
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
};
|
|
@@ -68,6 +76,11 @@ __decorate([
|
|
|
68
76
|
Description("The per-folder EAS `SyncKey` cursor, keyed by `Folder.uid`."),
|
|
69
77
|
__metadata("design:type", Object)
|
|
70
78
|
], DeviceSyncStateSQL.prototype, "folderSyncKeys", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Column({ type: "simple-json" }),
|
|
81
|
+
Description("The EAS `Class` most recently synced for a folder, keyed by `Folder.uid`."),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], DeviceSyncStateSQL.prototype, "folderCollectionClasses", void 0);
|
|
71
84
|
__decorate([
|
|
72
85
|
Column({ nullable: true }),
|
|
73
86
|
Description("The date and time of the device's last successful sync."),
|
|
@@ -79,6 +92,24 @@ __decorate([
|
|
|
79
92
|
Description("`true` if the device has completed EAS provisioning."),
|
|
80
93
|
__metadata("design:type", Boolean)
|
|
81
94
|
], DeviceSyncStateSQL.prototype, "provisioned", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
Column({ nullable: true }),
|
|
97
|
+
Description("`true` once an administrator has requested this device be remotely wiped."),
|
|
98
|
+
Nullable,
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], DeviceSyncStateSQL.prototype, "remoteWipeRequested", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
Column({ nullable: true }),
|
|
103
|
+
Description("`true` if the pending/most recent remote wipe request was scoped to this account only."),
|
|
104
|
+
Nullable,
|
|
105
|
+
__metadata("design:type", Boolean)
|
|
106
|
+
], DeviceSyncStateSQL.prototype, "remoteWipeAccountOnly", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
Column({ nullable: true }),
|
|
109
|
+
Description("When the device most recently acknowledged a remote wipe request."),
|
|
110
|
+
Nullable,
|
|
111
|
+
__metadata("design:type", Date)
|
|
112
|
+
], DeviceSyncStateSQL.prototype, "remoteWipeAcknowledgedAt", void 0);
|
|
82
113
|
DeviceSyncStateSQL = __decorate([
|
|
83
114
|
DataStore("sql"),
|
|
84
115
|
Entity(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceSyncStateSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/DeviceSyncStateSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAa,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;AAC/C,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;AACtC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,qBAAqB,CAAC;AAExD;;;;;GAKG;AAeI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;
|
|
1
|
+
{"version":3,"file":"DeviceSyncStateSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/DeviceSyncStateSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAa,UAAU,EAAE,aAAa,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EAAE,EAAE,EAAE;SACtC;KACJ,EACD,KAAK,CACR;;GACY,kBAAkB,CAsE9B"}
|
|
@@ -33,6 +33,8 @@ let MailboxSQL = class MailboxSQL extends BaseEntity {
|
|
|
33
33
|
this.timezone = "";
|
|
34
34
|
this.quotaBytes = 0;
|
|
35
35
|
this.usedBytes = 0;
|
|
36
|
+
this.oofEnabled = false;
|
|
37
|
+
this.oofMessage = "";
|
|
36
38
|
if (other) {
|
|
37
39
|
this.ownerUserUid = other.ownerUserUid !== undefined ? other.ownerUserUid : this.ownerUserUid;
|
|
38
40
|
this.primarySmtpAddress =
|
|
@@ -42,6 +44,10 @@ let MailboxSQL = class MailboxSQL extends BaseEntity {
|
|
|
42
44
|
this.timezone = other.timezone !== undefined ? other.timezone : this.timezone;
|
|
43
45
|
this.quotaBytes = other.quotaBytes !== undefined ? other.quotaBytes : this.quotaBytes;
|
|
44
46
|
this.usedBytes = other.usedBytes !== undefined ? other.usedBytes : this.usedBytes;
|
|
47
|
+
this.oofEnabled = other.oofEnabled !== undefined ? other.oofEnabled : this.oofEnabled;
|
|
48
|
+
this.oofMessage = other.oofMessage !== undefined ? other.oofMessage : this.oofMessage;
|
|
49
|
+
this.oofStartTime = "oofStartTime" in other ? other.oofStartTime : this.oofStartTime;
|
|
50
|
+
this.oofEndTime = "oofEndTime" in other ? other.oofEndTime : this.oofEndTime;
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
};
|
|
@@ -82,6 +88,32 @@ __decorate([
|
|
|
82
88
|
Description("The current total size, in bytes, of all messages/attachments stored in this mailbox."),
|
|
83
89
|
__metadata("design:type", Number)
|
|
84
90
|
], MailboxSQL.prototype, "usedBytes", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
Column(),
|
|
93
|
+
Description("`true` if this mailbox's out-of-office auto-reply (MS-ASSettings `Oof`) is currently enabled."),
|
|
94
|
+
__metadata("design:type", Boolean)
|
|
95
|
+
], MailboxSQL.prototype, "oofEnabled", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
Column({ type: "text" }),
|
|
98
|
+
Description("The out-of-office auto-reply message body.")
|
|
99
|
+
// `ObjectUtils.validate()` treats an empty string the same as null/undefined for any non-`@Nullable`
|
|
100
|
+
// field ("Property oofMessage cannot be null.") - this field's natural default (no OOF message configured
|
|
101
|
+
// yet) is legitimately "", so it must be `@Nullable` even though the type itself is always a `string`.
|
|
102
|
+
,
|
|
103
|
+
Nullable,
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], MailboxSQL.prototype, "oofMessage", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
Column({ nullable: true }),
|
|
108
|
+
Description("When set together with `oofEndTime`, the auto-reply is only active within this window."),
|
|
109
|
+
Nullable,
|
|
110
|
+
__metadata("design:type", Date)
|
|
111
|
+
], MailboxSQL.prototype, "oofStartTime", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
Column({ nullable: true }),
|
|
114
|
+
Nullable,
|
|
115
|
+
__metadata("design:type", Date)
|
|
116
|
+
], MailboxSQL.prototype, "oofEndTime", void 0);
|
|
85
117
|
MailboxSQL = __decorate([
|
|
86
118
|
DataStore("sql"),
|
|
87
119
|
Entity(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MailboxSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/MailboxSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE5G,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;AAC/C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAA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IAAI;8CAAC;AApDhB,UAAU;IArBtB,SAAS,CAAC,KAAK,CAAC;IAChB,MAAM,EAAE;IACR,WAAW,CACR,yGAAyG;QACrG,2CAA2C,CAClD;IACA,KAAK,CAAC,eAAe,EAAE,CAAC,cAAc,CAAC,CAAC;IACxC,KAAK,CAAC,sBAAsB,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvE,OAAO,CACJ;QACI,GAAG,EAAE,SAAS;QACd,OAAO,EAAE;YACL,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;YAC1C,mGAAmG;YACnG,kGAAkG;YAClG,kGAAkG;YAClG,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;SACtC;KACJ,EACD,IAAI,CACP;;GACY,UAAU,CAwEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/models/types.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,CAAN,IAAY,UAYX;AAZD,WAAY,UAAU;IAClB,6BAAe,CAAA;IACf,uCAAyB,CAAA;IACzB,+BAAiB,CAAA;IACjB,6CAA+B,CAAA;IAC/B,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,2BAAa,CAAA;AACjB,CAAC,EAZW,UAAU,KAAV,UAAU,QAYrB;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/models/types.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,CAAN,IAAY,UAYX;AAZD,WAAY,UAAU;IAClB,6BAAe,CAAA;IACf,uCAAyB,CAAA;IACzB,+BAAiB,CAAA;IACjB,6CAA+B,CAAA;IAC/B,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,mCAAqB,CAAA;I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3B,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,qCAAuB,CAAA;IACvB,mCAAqB,CAAA;AACzB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AA+FD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AA8CD,0DAA0D;AAC1D,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,2CAAyB,CAAA;AAC7B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,4BAAa,CAAA;AACjB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,4BAAe,CAAA;IACf,kCAAqB,CAAA;IACrB,4BAAe,CAAA;AACnB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AA+BD,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,yCAAqB,CAAA;IACrB,+CAA2B,CAAA;IAC3B,mCAAe,CAAA;AACnB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAiDD,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,iCAAiB,CAAA;AACrB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
|
|
@@ -16,6 +16,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
16
16
|
///////////////////////////////////////////////////////////////////////////////
|
|
17
17
|
import { ApiError, ObjectDecorators, UserUtils } from "@rapidrest/core";
|
|
18
18
|
import { ACLAction, ApiErrorMessages, ApiErrors, CRUDRoute, RouteDecorators } from "@rapidrest/service-core";
|
|
19
|
+
import { FolderType } from "../models/types.js";
|
|
20
|
+
import { findOrCreateWellKnownFolder } from "../util/FolderUtils.js";
|
|
21
|
+
import { RecoverableRepoUtils } from "../util/RecoverableRepoUtils.js";
|
|
19
22
|
const { Param, Query, Request, Response, User: AuthUser } = RouteDecorators;
|
|
20
23
|
const { Config } = ObjectDecorators;
|
|
21
24
|
/**
|
|
@@ -65,6 +68,15 @@ export class BaseMailboxRoute extends CRUDRoute {
|
|
|
65
68
|
super(...arguments);
|
|
66
69
|
this.trustedRoles = ["admin"];
|
|
67
70
|
}
|
|
71
|
+
async getFolderRepo() {
|
|
72
|
+
if (!this.folderRepo) {
|
|
73
|
+
this.folderRepo = await this._objectFactory.newInstance(RecoverableRepoUtils, {
|
|
74
|
+
name: this.folderClass.name,
|
|
75
|
+
args: [this.folderClass],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return this.folderRepo;
|
|
79
|
+
}
|
|
68
80
|
async create(obj, req, user) {
|
|
69
81
|
if (!user) {
|
|
70
82
|
throw new ApiError(ApiErrors.AUTH_PERMISSION_FAILURE, 403, ApiErrorMessages.AUTH_PERMISSION_FAILURE);
|
|
@@ -76,10 +88,26 @@ export class BaseMailboxRoute extends CRUDRoute {
|
|
|
76
88
|
o.ownerUserUid = user.uid;
|
|
77
89
|
}
|
|
78
90
|
}
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
const created = Array.isArray(obj)
|
|
92
|
+
? await this.doBulkCreate(objs, { req, user, ignoreACL: true })
|
|
93
|
+
: [await this.doCreateObject(objs[0], { req, user, ignoreACL: true })];
|
|
94
|
+
// A brand-new mailbox with zero folders is unusable the moment its owner opens it: the webmail
|
|
95
|
+
// client's `MailShell`/`CalendarShell`/`ContactsShell`/`TasksShell` each select a specific
|
|
96
|
+
// well-known folder as their default view (with none found, they show an empty/broken state even
|
|
97
|
+
// though the mailbox itself exists), and Compose needs a `drafts` folder uid in hand before it will
|
|
98
|
+
// create a new draft. Every *other* well-known folder (Junk, Sent Items, Deleted Items, ...) stays
|
|
99
|
+
// lazily provisioned on first actual use — see `findOrCreateWellKnownFolder`'s own doc comment —
|
|
100
|
+
// only these five are load-bearing for the client to render anything at all, so only these five are
|
|
101
|
+
// created eagerly here.
|
|
102
|
+
const folderRepo = await this.getFolderRepo();
|
|
103
|
+
for (const mailbox of created) {
|
|
104
|
+
await findOrCreateWellKnownFolder(folderRepo, this.folderClass, mailbox.uid, FolderType.INBOX, user);
|
|
105
|
+
await findOrCreateWellKnownFolder(folderRepo, this.folderClass, mailbox.uid, FolderType.DRAFTS, user);
|
|
106
|
+
await findOrCreateWellKnownFolder(folderRepo, this.folderClass, mailbox.uid, FolderType.CALENDAR, user);
|
|
107
|
+
await findOrCreateWellKnownFolder(folderRepo, this.folderClass, mailbox.uid, FolderType.CONTACTS, user);
|
|
108
|
+
await findOrCreateWellKnownFolder(folderRepo, this.folderClass, mailbox.uid, FolderType.TASKS, user);
|
|
81
109
|
}
|
|
82
|
-
return
|
|
110
|
+
return Array.isArray(obj) ? created : created[0];
|
|
83
111
|
}
|
|
84
112
|
async find(params, query, user) {
|
|
85
113
|
if (!this.repoUtils || !user) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseMailboxRoute.js","sourceRoot":"","sources":["../../../src/routes/BaseMailboxRoute.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAgB,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAA6B,eAAe,EAAE,MAAM,yBAAyB,CA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CAAC,OAAO,CAAC,CAAC;;sDACU;AA8BhC;IAAsB,WAAA,OAAO,CAAA;IAAoB,WAAA,QAAQ,CAAA;;;;8CAiCrE;AAEY;IAAM,WAAA,KAAK,EAAE,CAAA;IAAe,WAAA,KAAK,EAAE,CAAA;IAAc,WAAA,QAAQ,CAAA;;;;4CAyBrE;AAEY;IACR,WAAA,KAAK,EAAE,CAAA;IACP,WAAA,KAAK,EAAE,CAAA;IACP,WAAA,QAAQ,CAAA;IACR,WAAA,QAAQ,CAAA;;;;6CAuBZ;AAEY;IACR,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IACX,WAAA,KAAK,EAAE,CAAA;IACP,WAAA,QAAQ,CAAA;IACR,WAAA,QAAQ,CAAA;;;;8CAgBZ"}
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { AccessControlListMongo, DatabaseDecorators, RepoUtils, RouteDecorators, } from "@rapidrest/service-core";
|
|
11
|
-
import { MailboxMongo } from "../../mongo.js";
|
|
11
|
+
import { FolderMongo, MailboxMongo } from "../../mongo.js";
|
|
12
12
|
import { BaseMailboxRoute } from "../BaseMailboxRoute.js";
|
|
13
13
|
const { Model } = RouteDecorators;
|
|
14
14
|
const { Repository } = DatabaseDecorators;
|
|
@@ -16,6 +16,7 @@ let MailboxRouteMongo = class MailboxRouteMongo extends BaseMailboxRoute {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.repoUtilsClass = RepoUtils;
|
|
19
|
+
this.folderClass = FolderMongo;
|
|
19
20
|
}
|
|
20
21
|
async findAccessibleMailboxUids(user) {
|
|
21
22
|
if (!this.aclRepo) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MailboxRouteMongo.js","sourceRoot":"","sources":["../../../../src/routes/mongo/MailboxRouteMongo.ts"],"names":[],"mappings":";;;;;;;;;AAKA,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAClB,SAAS,EACT,eAAe,GAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"MailboxRouteMongo.js","sourceRoot":"","sources":["../../../../src/routes/mongo/MailboxRouteMongo.ts"],"names":[],"mappings":";;;;;;;;;AAKA,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAClB,SAAS,EACT,eAAe,GAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,MAAM,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC;AAClC,MAAM,EAAE,UAAU,EAAE,GAAG,kBAAkB,CAAC;AAGnC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,gBAA8B;IAA9D;;QACgB,mBAAc,GAAQ,SAAS,CAAC;QACzC,gBAAW,GAAQ,WAAW,CAAC;IAe7C,CAAC;IAVa,KAAK,CAAC,yBAAyB,CAAC,IAAa;QACnD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACd,CAAC;QACD,MAAM,UAAU,GAAa,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/D,MAAM,IAAI,GAA6B,MAAM,IAAI,CAAC,OAAO;aACpD,IAAI,CAAC,EAAE,sBAAsB,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC;aACrD,OAAO,EAAE,CAAC;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAZW;IADP,UAAU,CAAC,sBAAsB,CAAC;;kDACuB;AALjD,iBAAiB;IAD7B,KAAK,CAAC,YAAY,CAAC;GACP,iBAAiB,CAiB7B"}
|
|
@@ -13,7 +13,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
13
13
|
///////////////////////////////////////////////////////////////////////////////
|
|
14
14
|
import { Raw } from "typeorm";
|
|
15
15
|
import { AccessControlListSQL, DatabaseDecorators, RepoUtils, RouteDecorators } from "@rapidrest/service-core";
|
|
16
|
-
import { MailboxSQL } from "../../sql.js";
|
|
16
|
+
import { FolderSQL, MailboxSQL } from "../../sql.js";
|
|
17
17
|
import { BaseMailboxRoute } from "../BaseMailboxRoute.js";
|
|
18
18
|
const { Model } = RouteDecorators;
|
|
19
19
|
const { Repository } = DatabaseDecorators;
|
|
@@ -21,6 +21,7 @@ let MailboxRouteSQL = class MailboxRouteSQL extends BaseMailboxRoute {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
23
|
this.repoUtilsClass = RepoUtils;
|
|
24
|
+
this.folderClass = FolderSQL;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* `AccessControlListSQL.records` is a `simple-json` column (serialized as a single JSON string), the same
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MailboxRouteSQL.js","sourceRoot":"","sources":["../../../../src/routes/sql/MailboxRouteSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,mCAAmC;AACnC,+EAA+E;AAC/E,OAAO,EAAE,GAAG,EAAwC,MAAM,SAAS,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"MailboxRouteSQL.js","sourceRoot":"","sources":["../../../../src/rout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AC,CAAC,CAAC;QACH,MAAM,IAAI,GAA2B,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAhCW;IADP,UAAU,CAAC,oBAAoB,CAAC;;gDACyB;AALjD,eAAe;IAD3B,KAAK,CAAC,UAAU,CAAC;GACL,eAAe,CAqC3B"}
|
|
@@ -12,7 +12,11 @@ export declare class DeviceSyncStateMongo extends BaseMongoEntity implements Dev
|
|
|
12
12
|
deviceType: string;
|
|
13
13
|
policyKey?: string;
|
|
14
14
|
folderSyncKeys: Record<string, string>;
|
|
15
|
+
folderCollectionClasses: Record<string, string>;
|
|
15
16
|
lastSyncAt?: Date;
|
|
16
17
|
provisioned: boolean;
|
|
18
|
+
remoteWipeRequested?: boolean;
|
|
19
|
+
remoteWipeAccountOnly?: boolean;
|
|
20
|
+
remoteWipeAcknowledgedAt?: Date;
|
|
17
21
|
constructor(other?: Partial<DeviceSyncStateMongo>);
|
|
18
22
|
}
|
|
@@ -14,5 +14,9 @@ export declare class MailboxMongo extends BaseMongoEntity implements Mailbox {
|
|
|
14
14
|
timezone: string;
|
|
15
15
|
quotaBytes: number;
|
|
16
16
|
usedBytes: number;
|
|
17
|
+
oofEnabled: boolean;
|
|
18
|
+
oofMessage: string;
|
|
19
|
+
oofStartTime?: Date;
|
|
20
|
+
oofEndTime?: Date;
|
|
17
21
|
constructor(other?: Partial<MailboxMongo>);
|
|
18
22
|
}
|
|
@@ -12,7 +12,11 @@ export declare class DeviceSyncStateSQL extends BaseEntity implements DeviceSync
|
|
|
12
12
|
deviceType: string;
|
|
13
13
|
policyKey?: string;
|
|
14
14
|
folderSyncKeys: Record<string, string>;
|
|
15
|
+
folderCollectionClasses: Record<string, string>;
|
|
15
16
|
lastSyncAt?: Date;
|
|
16
17
|
provisioned: boolean;
|
|
18
|
+
remoteWipeRequested?: boolean;
|
|
19
|
+
remoteWipeAccountOnly?: boolean;
|
|
20
|
+
remoteWipeAcknowledgedAt?: Date;
|
|
17
21
|
constructor(other?: Partial<DeviceSyncStateSQL>);
|
|
18
22
|
}
|
|
@@ -14,5 +14,9 @@ export declare class MailboxSQL extends BaseEntity implements Mailbox {
|
|
|
14
14
|
timezone: string;
|
|
15
15
|
quotaBytes: number;
|
|
16
16
|
usedBytes: number;
|
|
17
|
+
oofEnabled: boolean;
|
|
18
|
+
oofMessage: string;
|
|
19
|
+
oofStartTime?: Date;
|
|
20
|
+
oofEndTime?: Date;
|
|
17
21
|
constructor(other?: Partial<MailboxSQL>);
|
|
18
22
|
}
|
|
@@ -45,6 +45,16 @@ export interface Mailbox extends BaseEntity {
|
|
|
45
45
|
quotaBytes: number;
|
|
46
46
|
/** The current total size, in bytes, of all messages/attachments stored in this mailbox. */
|
|
47
47
|
usedBytes: number;
|
|
48
|
+
/** `true` if this mailbox's out-of-office auto-reply (MS-ASSettings `Oof`) is currently enabled. */
|
|
49
|
+
oofEnabled: boolean;
|
|
50
|
+
/** The out-of-office auto-reply message body. A single combined message rather than the spec's three
|
|
51
|
+
* audience-specific variants (internal/external-known/external-unknown) - a deliberate pragmatic-subset
|
|
52
|
+
* simplification, matching this library's existing single-slot precedent elsewhere. */
|
|
53
|
+
oofMessage: string;
|
|
54
|
+
/** When set together with `oofEndTime`, the auto-reply is only active within this window rather than
|
|
55
|
+
* indefinitely while `oofEnabled` is `true`. */
|
|
56
|
+
oofStartTime?: Date;
|
|
57
|
+
oofEndTime?: Date;
|
|
48
58
|
}
|
|
49
59
|
/**
|
|
50
60
|
* Defines a single folder within a `Mailbox`. Folders form a hierarchy via `parentFolderUid` and hold
|
|
@@ -536,6 +546,19 @@ export interface DeviceSyncState extends BaseEntity {
|
|
|
536
546
|
policyKey?: string;
|
|
537
547
|
/** The per-folder EAS `SyncKey` cursor, keyed by `Folder.uid`. */
|
|
538
548
|
folderSyncKeys: Record<string, string>;
|
|
549
|
+
/** The EAS `Class` (`"Email"`, `"Contacts"`, ...) most recently synced for a folder, keyed by `Folder.uid` -
|
|
550
|
+
* lets a `Sync` request omit `Class` after its first request for a collection, per [MS-ASCMD], without the
|
|
551
|
+
* server losing track of which entity type that collection holds. */
|
|
552
|
+
folderCollectionClasses: Record<string, string>;
|
|
539
553
|
lastSyncAt?: Date;
|
|
540
554
|
provisioned: boolean;
|
|
555
|
+
/** `true` once an administrator has requested this device be remotely wiped (MS-ASPROV `RemoteWipe`). Set
|
|
556
|
+
* back to `false` once the device acknowledges the wipe. */
|
|
557
|
+
remoteWipeRequested?: boolean;
|
|
558
|
+
/** `true` if the pending/most recent remote wipe request was scoped to this account only (vs. a full device
|
|
559
|
+
* wipe) - recorded for administrative record-keeping; the wire directive sent to the device is the same
|
|
560
|
+
* either way in this library's pragmatic subset. */
|
|
561
|
+
remoteWipeAccountOnly?: boolean;
|
|
562
|
+
/** When the device most recently acknowledged a remote wipe request. */
|
|
563
|
+
remoteWipeAcknowledgedAt?: Date;
|
|
541
564
|
}
|
|
@@ -45,6 +45,13 @@ import { Mailbox } from "../models/types.js";
|
|
|
45
45
|
*/
|
|
46
46
|
export declare abstract class BaseMailboxRoute<T extends Mailbox> extends CRUDRoute<T> {
|
|
47
47
|
protected trustedRoles: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Supplied by the Mongo/SQL concrete subclasses so `create()` can provision a new mailbox's Inbox/Drafts
|
|
50
|
+
* folders (see below) without depending on either backend directly — same pattern as
|
|
51
|
+
* `BaseMessageRoute.folderClass`.
|
|
52
|
+
*/
|
|
53
|
+
protected abstract folderClass: any;
|
|
54
|
+
private folderRepo?;
|
|
48
55
|
/**
|
|
49
56
|
* Returns the uids of every mailbox this user has any ACL grant on — as owner, as a shared delegate, or
|
|
50
57
|
* (implicitly, via a wildcard/role record) as a trusted caller. Backend-specific because
|
|
@@ -53,6 +60,7 @@ export declare abstract class BaseMailboxRoute<T extends Mailbox> extends CRUDRo
|
|
|
53
60
|
* subclass, each against the exact same `AccessControlList` collection/table `BaseACLRoute` exposes.
|
|
54
61
|
*/
|
|
55
62
|
protected abstract findAccessibleMailboxUids(user: JWTUser): Promise<string[]>;
|
|
63
|
+
private getFolderRepo;
|
|
56
64
|
create(obj: T | T[], req: HttpRequest, user?: JWTUser): Promise<T | T[]>;
|
|
57
65
|
find(params: any, query: any, user?: JWTUser): Promise<T[]>;
|
|
58
66
|
count(params: any, query: any, res: HttpResponse, user?: JWTUser): Promise<any>;
|
|
@@ -3,6 +3,7 @@ import { MailboxMongo } from "../../mongo.js";
|
|
|
3
3
|
import { BaseMailboxRoute } from "../BaseMailboxRoute.js";
|
|
4
4
|
export declare class MailboxRouteMongo extends BaseMailboxRoute<MailboxMongo> {
|
|
5
5
|
protected readonly repoUtilsClass: any;
|
|
6
|
+
protected folderClass: any;
|
|
6
7
|
private aclRepo?;
|
|
7
8
|
protected findAccessibleMailboxUids(user: JWTUser): Promise<string[]>;
|
|
8
9
|
}
|
|
@@ -3,6 +3,7 @@ import { MailboxSQL } from "../../sql.js";
|
|
|
3
3
|
import { BaseMailboxRoute } from "../BaseMailboxRoute.js";
|
|
4
4
|
export declare class MailboxRouteSQL extends BaseMailboxRoute<MailboxSQL> {
|
|
5
5
|
protected readonly repoUtilsClass: any;
|
|
6
|
+
protected folderClass: any;
|
|
6
7
|
private aclRepo?;
|
|
7
8
|
/**
|
|
8
9
|
* `AccessControlListSQL.records` is a `simple-json` column (serialized as a single JSON string), the same
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rapidmx/restapi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Core data model and standard REST API for building a mail server on RapidREST.",
|
|
5
5
|
"repository": "https://github.com/RapidMX/restapi.git",
|
|
6
6
|
"author": "RapidREST <rapidrests@gmail.com>",
|