@sideline/domain 0.2.0 → 0.3.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/cjs/index.js +7 -1
- package/dist/cjs/models/DiscordRoleMapping.js +20 -0
- package/dist/cjs/models/DiscordRoleMapping.js.map +1 -0
- package/dist/cjs/models/RoleSyncEvent.js +28 -0
- package/dist/cjs/models/RoleSyncEvent.js.map +1 -0
- package/dist/cjs/rpc/RoleSyncRpc.js +66 -0
- package/dist/cjs/rpc/RoleSyncRpc.js.map +1 -0
- package/dist/dts/index.d.ts +3 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/models/DiscordRoleMapping.d.ts +84 -0
- package/dist/dts/models/DiscordRoleMapping.d.ts.map +1 -0
- package/dist/dts/models/RoleSyncEvent.d.ts +164 -0
- package/dist/dts/models/RoleSyncEvent.d.ts.map +1 -0
- package/dist/dts/rpc/RoleSyncRpc.d.ts +82 -0
- package/dist/dts/rpc/RoleSyncRpc.d.ts.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/DiscordRoleMapping.js +13 -0
- package/dist/esm/models/DiscordRoleMapping.js.map +1 -0
- package/dist/esm/models/RoleSyncEvent.js +21 -0
- package/dist/esm/models/RoleSyncEvent.js.map +1 -0
- package/dist/esm/rpc/RoleSyncRpc.js +57 -0
- package/dist/esm/rpc/RoleSyncRpc.js.map +1 -0
- package/package.json +2 -1
- package/src/index.ts +6 -0
- package/src/models/DiscordRoleMapping.ts +15 -0
- package/src/models/RoleSyncEvent.ts +30 -0
- package/src/rpc/RoleSyncRpc.ts +59 -0
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.User = exports.TeamMember = exports.TeamInvite = exports.Team = exports.SubgroupModel = exports.SubgroupApi = exports.Session = exports.RosterModel = exports.RosterMemberModel = exports.Roster = exports.RoleApi = exports.Role = exports.NotificationApi = exports.Notification = exports.MemberRole = exports.Invite = exports.Auth = exports.ApiGroup = exports.AgeThresholdRule = exports.AgeThresholdApi = void 0;
|
|
6
|
+
exports.User = exports.TeamMember = exports.TeamInvite = exports.Team = exports.SubgroupModel = exports.SubgroupApi = exports.Session = exports.RosterModel = exports.RosterMemberModel = exports.Roster = exports.RoleSyncRpc = exports.RoleSyncEvent = exports.RoleApi = exports.Role = exports.NotificationApi = exports.Notification = exports.MemberRole = exports.Invite = exports.DiscordRoleMapping = exports.Auth = exports.ApiGroup = exports.AgeThresholdRule = exports.AgeThresholdApi = void 0;
|
|
7
7
|
var _ApiGroup = _interopRequireWildcard(require("./ApiGroup.js"));
|
|
8
8
|
exports.ApiGroup = _ApiGroup;
|
|
9
9
|
var _AgeThresholdApi = _interopRequireWildcard(require("./api/AgeThresholdApi.js"));
|
|
@@ -22,12 +22,16 @@ var _SubgroupApi = _interopRequireWildcard(require("./api/SubgroupApi.js"));
|
|
|
22
22
|
exports.SubgroupApi = _SubgroupApi;
|
|
23
23
|
var _AgeThresholdRule = _interopRequireWildcard(require("./models/AgeThresholdRule.js"));
|
|
24
24
|
exports.AgeThresholdRule = _AgeThresholdRule;
|
|
25
|
+
var _DiscordRoleMapping = _interopRequireWildcard(require("./models/DiscordRoleMapping.js"));
|
|
26
|
+
exports.DiscordRoleMapping = _DiscordRoleMapping;
|
|
25
27
|
var _MemberRole = _interopRequireWildcard(require("./models/MemberRole.js"));
|
|
26
28
|
exports.MemberRole = _MemberRole;
|
|
27
29
|
var _Notification = _interopRequireWildcard(require("./models/Notification.js"));
|
|
28
30
|
exports.Notification = _Notification;
|
|
29
31
|
var _Role = _interopRequireWildcard(require("./models/Role.js"));
|
|
30
32
|
exports.Role = _Role;
|
|
33
|
+
var _RoleSyncEvent = _interopRequireWildcard(require("./models/RoleSyncEvent.js"));
|
|
34
|
+
exports.RoleSyncEvent = _RoleSyncEvent;
|
|
31
35
|
var _RosterMemberModel = _interopRequireWildcard(require("./models/RosterMemberModel.js"));
|
|
32
36
|
exports.RosterMemberModel = _RosterMemberModel;
|
|
33
37
|
var _RosterModel = _interopRequireWildcard(require("./models/RosterModel.js"));
|
|
@@ -44,5 +48,7 @@ var _TeamMember = _interopRequireWildcard(require("./models/TeamMember.js"));
|
|
|
44
48
|
exports.TeamMember = _TeamMember;
|
|
45
49
|
var _User = _interopRequireWildcard(require("./models/User.js"));
|
|
46
50
|
exports.User = _User;
|
|
51
|
+
var _RoleSyncRpc = _interopRequireWildcard(require("./rpc/RoleSyncRpc.js"));
|
|
52
|
+
exports.RoleSyncRpc = _RoleSyncRpc;
|
|
47
53
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
48
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DiscordRoleMappingId = exports.DiscordRoleMapping = void 0;
|
|
7
|
+
var _sql = require("@effect/sql");
|
|
8
|
+
var _effect = require("effect");
|
|
9
|
+
var _Role = require("../models/Role.js");
|
|
10
|
+
var _Team = require("../models/Team.js");
|
|
11
|
+
const DiscordRoleMappingId = exports.DiscordRoleMappingId = /*#__PURE__*/_effect.Schema.String.pipe(/*#__PURE__*/_effect.Schema.brand('DiscordRoleMappingId'));
|
|
12
|
+
class DiscordRoleMapping extends /*#__PURE__*/_sql.Model.Class('DiscordRoleMapping')({
|
|
13
|
+
id: /*#__PURE__*/_sql.Model.Generated(DiscordRoleMappingId),
|
|
14
|
+
team_id: _Team.TeamId,
|
|
15
|
+
role_id: _Role.RoleId,
|
|
16
|
+
discord_role_id: _effect.Schema.String,
|
|
17
|
+
created_at: _sql.Model.DateTimeInsertFromDate
|
|
18
|
+
}) {}
|
|
19
|
+
exports.DiscordRoleMapping = DiscordRoleMapping;
|
|
20
|
+
//# sourceMappingURL=DiscordRoleMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscordRoleMapping.js","names":["_sql","require","_effect","_Role","_Team","DiscordRoleMappingId","exports","Schema","String","pipe","brand","DiscordRoleMapping","Model","Class","id","Generated","team_id","TeamId","role_id","RoleId","discord_role_id","created_at","DateTimeInsertFromDate"],"sources":["../../../src/models/DiscordRoleMapping.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEO,MAAMI,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,gBAAGE,cAAM,CAACC,MAAM,CAACC,IAAI,cAACF,cAAM,CAACG,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAGtF,MAAOC,kBAAmB,sBAAQC,UAAK,CAACC,KAAK,CAAqB,oBAAoB,CAAC,CAAC;EAC5FC,EAAE,eAAEF,UAAK,CAACG,SAAS,CAACV,oBAAoB,CAAC;EACzCW,OAAO,EAAEC,YAAM;EACfC,OAAO,EAAEC,YAAM;EACfC,eAAe,EAAEb,cAAM,CAACC,MAAM;EAC9Ba,UAAU,EAAET,UAAK,CAACU;CACnB,CAAC;AAAAhB,OAAA,CAAAK,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RoleSyncEventType = exports.RoleSyncEventId = exports.RoleSyncEvent = void 0;
|
|
7
|
+
var _sql = require("@effect/sql");
|
|
8
|
+
var _effect = require("effect");
|
|
9
|
+
var _Role = require("../models/Role.js");
|
|
10
|
+
var _Team = require("../models/Team.js");
|
|
11
|
+
var _TeamMember = require("../models/TeamMember.js");
|
|
12
|
+
const RoleSyncEventId = exports.RoleSyncEventId = /*#__PURE__*/_effect.Schema.String.pipe(/*#__PURE__*/_effect.Schema.brand('RoleSyncEventId'));
|
|
13
|
+
const RoleSyncEventType = exports.RoleSyncEventType = /*#__PURE__*/_effect.Schema.Literal('role_assigned', 'role_unassigned', 'role_created', 'role_deleted');
|
|
14
|
+
class RoleSyncEvent extends /*#__PURE__*/_sql.Model.Class('RoleSyncEvent')({
|
|
15
|
+
id: /*#__PURE__*/_sql.Model.Generated(RoleSyncEventId),
|
|
16
|
+
team_id: _Team.TeamId,
|
|
17
|
+
guild_id: _effect.Schema.String,
|
|
18
|
+
event_type: RoleSyncEventType,
|
|
19
|
+
role_id: _Role.RoleId,
|
|
20
|
+
role_name: /*#__PURE__*/_effect.Schema.NullOr(_effect.Schema.String),
|
|
21
|
+
team_member_id: /*#__PURE__*/_effect.Schema.NullOr(_TeamMember.TeamMemberId),
|
|
22
|
+
discord_user_id: /*#__PURE__*/_effect.Schema.NullOr(_effect.Schema.String),
|
|
23
|
+
processed_at: /*#__PURE__*/_effect.Schema.NullOr(_effect.Schema.String),
|
|
24
|
+
error: /*#__PURE__*/_effect.Schema.NullOr(_effect.Schema.String),
|
|
25
|
+
created_at: _sql.Model.DateTimeInsertFromDate
|
|
26
|
+
}) {}
|
|
27
|
+
exports.RoleSyncEvent = RoleSyncEvent;
|
|
28
|
+
//# sourceMappingURL=RoleSyncEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSyncEvent.js","names":["_sql","require","_effect","_Role","_Team","_TeamMember","RoleSyncEventId","exports","Schema","String","pipe","brand","RoleSyncEventType","Literal","RoleSyncEvent","Model","Class","id","Generated","team_id","TeamId","guild_id","event_type","role_id","RoleId","role_name","NullOr","team_member_id","TeamMemberId","discord_user_id","processed_at","error","created_at","DateTimeInsertFromDate"],"sources":["../../../src/models/RoleSyncEvent.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAEO,MAAMK,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAGE,cAAM,CAACC,MAAM,CAACC,IAAI,cAACF,cAAM,CAACG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAG3E,MAAMC,iBAAiB,GAAAL,OAAA,CAAAK,iBAAA,gBAAGJ,cAAM,CAACK,OAAO,CAC7C,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,CACf;AAGK,MAAOC,aAAc,sBAAQC,UAAK,CAACC,KAAK,CAAgB,eAAe,CAAC,CAAC;EAC7EC,EAAE,eAAEF,UAAK,CAACG,SAAS,CAACZ,eAAe,CAAC;EACpCa,OAAO,EAAEC,YAAM;EACfC,QAAQ,EAAEb,cAAM,CAACC,MAAM;EACvBa,UAAU,EAAEV,iBAAiB;EAC7BW,OAAO,EAAEC,YAAM;EACfC,SAAS,eAAEjB,cAAM,CAACkB,MAAM,CAAClB,cAAM,CAACC,MAAM,CAAC;EACvCkB,cAAc,eAAEnB,cAAM,CAACkB,MAAM,CAACE,wBAAY,CAAC;EAC3CC,eAAe,eAAErB,cAAM,CAACkB,MAAM,CAAClB,cAAM,CAACC,MAAM,CAAC;EAC7CqB,YAAY,eAAEtB,cAAM,CAACkB,MAAM,CAAClB,cAAM,CAACC,MAAM,CAAC;EAC1CsB,KAAK,eAAEvB,cAAM,CAACkB,MAAM,CAAClB,cAAM,CAACC,MAAM,CAAC;EACnCuB,UAAU,EAAEjB,UAAK,CAACkB;CACnB,CAAC;AAAA1B,OAAA,CAAAO,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UnprocessedEvent = exports.RoleSyncRpcs = exports.RoleMapping = void 0;
|
|
7
|
+
var _rpc = require("@effect/rpc");
|
|
8
|
+
var _effect = require("effect");
|
|
9
|
+
class UnprocessedEvent extends /*#__PURE__*/_effect.Schema.Class('UnprocessedEvent')({
|
|
10
|
+
id: _effect.Schema.String,
|
|
11
|
+
team_id: _effect.Schema.String,
|
|
12
|
+
guild_id: _effect.Schema.String,
|
|
13
|
+
event_type: /*#__PURE__*/_effect.Schema.Literal('role_assigned', 'role_unassigned', 'role_created', 'role_deleted'),
|
|
14
|
+
role_id: _effect.Schema.String,
|
|
15
|
+
role_name: /*#__PURE__*/_effect.Schema.NullOr(_effect.Schema.String),
|
|
16
|
+
team_member_id: /*#__PURE__*/_effect.Schema.NullOr(_effect.Schema.String),
|
|
17
|
+
discord_user_id: /*#__PURE__*/_effect.Schema.NullOr(_effect.Schema.String)
|
|
18
|
+
}) {}
|
|
19
|
+
exports.UnprocessedEvent = UnprocessedEvent;
|
|
20
|
+
class RoleMapping extends /*#__PURE__*/_effect.Schema.Class('RoleMapping')({
|
|
21
|
+
id: _effect.Schema.String,
|
|
22
|
+
team_id: _effect.Schema.String,
|
|
23
|
+
role_id: _effect.Schema.String,
|
|
24
|
+
discord_role_id: _effect.Schema.String
|
|
25
|
+
}) {}
|
|
26
|
+
exports.RoleMapping = RoleMapping;
|
|
27
|
+
const GetUnprocessedEvents = /*#__PURE__*/_rpc.Rpc.make('GetUnprocessedEvents', {
|
|
28
|
+
payload: {
|
|
29
|
+
limit: _effect.Schema.Number
|
|
30
|
+
},
|
|
31
|
+
success: /*#__PURE__*/_effect.Schema.Array(UnprocessedEvent)
|
|
32
|
+
});
|
|
33
|
+
const MarkEventProcessed = /*#__PURE__*/_rpc.Rpc.make('MarkEventProcessed', {
|
|
34
|
+
payload: {
|
|
35
|
+
id: _effect.Schema.String
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const MarkEventFailed = /*#__PURE__*/_rpc.Rpc.make('MarkEventFailed', {
|
|
39
|
+
payload: {
|
|
40
|
+
id: _effect.Schema.String,
|
|
41
|
+
error: _effect.Schema.String
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const GetMappingForRole = /*#__PURE__*/_rpc.Rpc.make('GetMappingForRole', {
|
|
45
|
+
payload: {
|
|
46
|
+
team_id: _effect.Schema.String,
|
|
47
|
+
role_id: _effect.Schema.String
|
|
48
|
+
},
|
|
49
|
+
success: /*#__PURE__*/_effect.Schema.NullOr(RoleMapping)
|
|
50
|
+
});
|
|
51
|
+
const UpsertMapping = /*#__PURE__*/_rpc.Rpc.make('UpsertMapping', {
|
|
52
|
+
payload: {
|
|
53
|
+
team_id: _effect.Schema.String,
|
|
54
|
+
role_id: _effect.Schema.String,
|
|
55
|
+
discord_role_id: _effect.Schema.String
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const DeleteMapping = /*#__PURE__*/_rpc.Rpc.make('DeleteMapping', {
|
|
59
|
+
payload: {
|
|
60
|
+
team_id: _effect.Schema.String,
|
|
61
|
+
role_id: _effect.Schema.String
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
class RoleSyncRpcs extends /*#__PURE__*/_rpc.RpcGroup.make(GetUnprocessedEvents, MarkEventProcessed, MarkEventFailed, GetMappingForRole, UpsertMapping, DeleteMapping) {}
|
|
65
|
+
exports.RoleSyncRpcs = RoleSyncRpcs;
|
|
66
|
+
//# sourceMappingURL=RoleSyncRpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSyncRpc.js","names":["_rpc","require","_effect","UnprocessedEvent","Schema","Class","id","String","team_id","guild_id","event_type","Literal","role_id","role_name","NullOr","team_member_id","discord_user_id","exports","RoleMapping","discord_role_id","GetUnprocessedEvents","Rpc","make","payload","limit","Number","success","Array","MarkEventProcessed","MarkEventFailed","error","GetMappingForRole","UpsertMapping","DeleteMapping","RoleSyncRpcs","RpcGroup"],"sources":["../../../src/rpc/RoleSyncRpc.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEM,MAAOE,gBAAiB,sBAAQC,cAAM,CAACC,KAAK,CAAmB,kBAAkB,CAAC,CAAC;EACvFC,EAAE,EAAEF,cAAM,CAACG,MAAM;EACjBC,OAAO,EAAEJ,cAAM,CAACG,MAAM;EACtBE,QAAQ,EAAEL,cAAM,CAACG,MAAM;EACvBG,UAAU,eAAEN,cAAM,CAACO,OAAO,CAAC,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,CAAC;EAC9FC,OAAO,EAAER,cAAM,CAACG,MAAM;EACtBM,SAAS,eAAET,cAAM,CAACU,MAAM,CAACV,cAAM,CAACG,MAAM,CAAC;EACvCQ,cAAc,eAAEX,cAAM,CAACU,MAAM,CAACV,cAAM,CAACG,MAAM,CAAC;EAC5CS,eAAe,eAAEZ,cAAM,CAACU,MAAM,CAACV,cAAM,CAACG,MAAM;CAC7C,CAAC;AAAAU,OAAA,CAAAd,gBAAA,GAAAA,gBAAA;AAEI,MAAOe,WAAY,sBAAQd,cAAM,CAACC,KAAK,CAAc,aAAa,CAAC,CAAC;EACxEC,EAAE,EAAEF,cAAM,CAACG,MAAM;EACjBC,OAAO,EAAEJ,cAAM,CAACG,MAAM;EACtBK,OAAO,EAAER,cAAM,CAACG,MAAM;EACtBY,eAAe,EAAEf,cAAM,CAACG;CACzB,CAAC;AAAAU,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAEF,MAAME,oBAAoB,gBAAGC,QAAG,CAACC,IAAI,CAAC,sBAAsB,EAAE;EAC5DC,OAAO,EAAE;IAAEC,KAAK,EAAEpB,cAAM,CAACqB;EAAM,CAAE;EACjCC,OAAO,eAAEtB,cAAM,CAACuB,KAAK,CAACxB,gBAAgB;CACvC,CAAC;AAEF,MAAMyB,kBAAkB,gBAAGP,QAAG,CAACC,IAAI,CAAC,oBAAoB,EAAE;EACxDC,OAAO,EAAE;IAAEjB,EAAE,EAAEF,cAAM,CAACG;EAAM;CAC7B,CAAC;AAEF,MAAMsB,eAAe,gBAAGR,QAAG,CAACC,IAAI,CAAC,iBAAiB,EAAE;EAClDC,OAAO,EAAE;IAAEjB,EAAE,EAAEF,cAAM,CAACG,MAAM;IAAEuB,KAAK,EAAE1B,cAAM,CAACG;EAAM;CACnD,CAAC;AAEF,MAAMwB,iBAAiB,gBAAGV,QAAG,CAACC,IAAI,CAAC,mBAAmB,EAAE;EACtDC,OAAO,EAAE;IAAEf,OAAO,EAAEJ,cAAM,CAACG,MAAM;IAAEK,OAAO,EAAER,cAAM,CAACG;EAAM,CAAE;EAC3DmB,OAAO,eAAEtB,cAAM,CAACU,MAAM,CAACI,WAAW;CACnC,CAAC;AAEF,MAAMc,aAAa,gBAAGX,QAAG,CAACC,IAAI,CAAC,eAAe,EAAE;EAC9CC,OAAO,EAAE;IACPf,OAAO,EAAEJ,cAAM,CAACG,MAAM;IACtBK,OAAO,EAAER,cAAM,CAACG,MAAM;IACtBY,eAAe,EAAEf,cAAM,CAACG;;CAE3B,CAAC;AAEF,MAAM0B,aAAa,gBAAGZ,QAAG,CAACC,IAAI,CAAC,eAAe,EAAE;EAC9CC,OAAO,EAAE;IAAEf,OAAO,EAAEJ,cAAM,CAACG,MAAM;IAAEK,OAAO,EAAER,cAAM,CAACG;EAAM;CAC1D,CAAC;AAEI,MAAO2B,YAAa,sBAAQC,aAAQ,CAACb,IAAI,CAC7CF,oBAAoB,EACpBQ,kBAAkB,EAClBC,eAAe,EACfE,iBAAiB,EACjBC,aAAa,EACbC,aAAa,CACd;AAAAhB,OAAA,CAAAiB,YAAA,GAAAA,YAAA","ignoreList":[]}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -7,9 +7,11 @@ export * as RoleApi from './api/RoleApi.js';
|
|
|
7
7
|
export * as Roster from './api/Roster.js';
|
|
8
8
|
export * as SubgroupApi from './api/SubgroupApi.js';
|
|
9
9
|
export * as AgeThresholdRule from './models/AgeThresholdRule.js';
|
|
10
|
+
export * as DiscordRoleMapping from './models/DiscordRoleMapping.js';
|
|
10
11
|
export * as MemberRole from './models/MemberRole.js';
|
|
11
12
|
export * as Notification from './models/Notification.js';
|
|
12
13
|
export * as Role from './models/Role.js';
|
|
14
|
+
export * as RoleSyncEvent from './models/RoleSyncEvent.js';
|
|
13
15
|
export * as RosterMemberModel from './models/RosterMemberModel.js';
|
|
14
16
|
export * as RosterModel from './models/RosterModel.js';
|
|
15
17
|
export * as Session from './models/Session.js';
|
|
@@ -18,4 +20,5 @@ export * as Team from './models/Team.js';
|
|
|
18
20
|
export * as TeamInvite from './models/TeamInvite.js';
|
|
19
21
|
export * as TeamMember from './models/TeamMember.js';
|
|
20
22
|
export * as User from './models/User.js';
|
|
23
|
+
export * as RoleSyncRpc from './rpc/RoleSyncRpc.js';
|
|
21
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,gBAAgB,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,gBAAgB,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,kBAAkB,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Model } from '@effect/sql';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
export declare const DiscordRoleMappingId: Schema.brand<typeof Schema.String, "DiscordRoleMappingId">;
|
|
4
|
+
export type DiscordRoleMappingId = typeof DiscordRoleMappingId.Type;
|
|
5
|
+
declare const DiscordRoleMapping_base: import("@effect/experimental/VariantSchema").Class<DiscordRoleMapping, {
|
|
6
|
+
readonly id: Model.Generated<Schema.brand<typeof Schema.String, "DiscordRoleMappingId">>;
|
|
7
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
8
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
9
|
+
readonly discord_role_id: typeof Schema.String;
|
|
10
|
+
readonly created_at: Model.DateTimeInsertFromDate;
|
|
11
|
+
}, import("@effect/experimental/VariantSchema").ExtractFields<"select", {
|
|
12
|
+
readonly id: Model.Generated<Schema.brand<typeof Schema.String, "DiscordRoleMappingId">>;
|
|
13
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
14
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
15
|
+
readonly discord_role_id: typeof Schema.String;
|
|
16
|
+
readonly created_at: Model.DateTimeInsertFromDate;
|
|
17
|
+
}, true>, {
|
|
18
|
+
readonly id: string & import("effect/Brand").Brand<"DiscordRoleMappingId">;
|
|
19
|
+
} & {
|
|
20
|
+
readonly created_at: import("effect/DateTime").Utc;
|
|
21
|
+
} & {
|
|
22
|
+
readonly team_id: string & import("effect/Brand").Brand<"TeamId">;
|
|
23
|
+
} & {
|
|
24
|
+
readonly role_id: string & import("effect/Brand").Brand<"RoleId">;
|
|
25
|
+
} & {
|
|
26
|
+
readonly discord_role_id: string;
|
|
27
|
+
}, Schema.Struct.Encoded<import("@effect/experimental/VariantSchema").ExtractFields<"select", {
|
|
28
|
+
readonly id: Model.Generated<Schema.brand<typeof Schema.String, "DiscordRoleMappingId">>;
|
|
29
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
30
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
31
|
+
readonly discord_role_id: typeof Schema.String;
|
|
32
|
+
readonly created_at: Model.DateTimeInsertFromDate;
|
|
33
|
+
}, true>>, never, {
|
|
34
|
+
readonly id: string & import("effect/Brand").Brand<"DiscordRoleMappingId">;
|
|
35
|
+
} & {
|
|
36
|
+
readonly created_at: import("effect/DateTime").Utc;
|
|
37
|
+
} & {
|
|
38
|
+
readonly team_id: string & import("effect/Brand").Brand<"TeamId">;
|
|
39
|
+
} & {
|
|
40
|
+
readonly role_id: string & import("effect/Brand").Brand<"RoleId">;
|
|
41
|
+
} & {
|
|
42
|
+
readonly discord_role_id: string;
|
|
43
|
+
}> & {
|
|
44
|
+
readonly select: Schema.Struct<{
|
|
45
|
+
readonly id: Schema.brand<typeof Schema.String, "DiscordRoleMappingId">;
|
|
46
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
47
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
48
|
+
readonly discord_role_id: typeof Schema.String;
|
|
49
|
+
readonly created_at: Model.DateTimeFromDate;
|
|
50
|
+
}>;
|
|
51
|
+
readonly insert: Schema.Struct<{
|
|
52
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
53
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
54
|
+
readonly discord_role_id: typeof Schema.String;
|
|
55
|
+
readonly created_at: import("@effect/experimental/VariantSchema").Overrideable<import("effect/DateTime").Utc, Date, never>;
|
|
56
|
+
}>;
|
|
57
|
+
readonly update: Schema.Struct<{
|
|
58
|
+
readonly id: Schema.brand<typeof Schema.String, "DiscordRoleMappingId">;
|
|
59
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
60
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
61
|
+
readonly discord_role_id: typeof Schema.String;
|
|
62
|
+
}>;
|
|
63
|
+
readonly json: Schema.Struct<{
|
|
64
|
+
readonly id: Schema.brand<typeof Schema.String, "DiscordRoleMappingId">;
|
|
65
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
66
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
67
|
+
readonly discord_role_id: typeof Schema.String;
|
|
68
|
+
readonly created_at: typeof Schema.DateTimeUtc;
|
|
69
|
+
}>;
|
|
70
|
+
readonly jsonCreate: Schema.Struct<{
|
|
71
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
72
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
73
|
+
readonly discord_role_id: typeof Schema.String;
|
|
74
|
+
}>;
|
|
75
|
+
readonly jsonUpdate: Schema.Struct<{
|
|
76
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
77
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
78
|
+
readonly discord_role_id: typeof Schema.String;
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
export declare class DiscordRoleMapping extends DiscordRoleMapping_base {
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=DiscordRoleMapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscordRoleMapping.d.ts","sourceRoot":"","sources":["../../../src/models/DiscordRoleMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,oBAAoB,4DAA2D,CAAC;AAC7F,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpE,qBAAa,kBAAmB,SAAQ,uBAMtC;CAAG"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { Model } from '@effect/sql';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
export declare const RoleSyncEventId: Schema.brand<typeof Schema.String, "RoleSyncEventId">;
|
|
4
|
+
export type RoleSyncEventId = typeof RoleSyncEventId.Type;
|
|
5
|
+
export declare const RoleSyncEventType: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
6
|
+
export type RoleSyncEventType = typeof RoleSyncEventType.Type;
|
|
7
|
+
declare const RoleSyncEvent_base: import("@effect/experimental/VariantSchema").Class<RoleSyncEvent, {
|
|
8
|
+
readonly id: Model.Generated<Schema.brand<typeof Schema.String, "RoleSyncEventId">>;
|
|
9
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
10
|
+
readonly guild_id: typeof Schema.String;
|
|
11
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
12
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
13
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
14
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
15
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
16
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
17
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
18
|
+
readonly created_at: Model.DateTimeInsertFromDate;
|
|
19
|
+
}, import("@effect/experimental/VariantSchema").ExtractFields<"select", {
|
|
20
|
+
readonly id: Model.Generated<Schema.brand<typeof Schema.String, "RoleSyncEventId">>;
|
|
21
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
22
|
+
readonly guild_id: typeof Schema.String;
|
|
23
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
24
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
25
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
26
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
27
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
28
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
29
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
30
|
+
readonly created_at: Model.DateTimeInsertFromDate;
|
|
31
|
+
}, true>, {
|
|
32
|
+
readonly id: string & import("effect/Brand").Brand<"RoleSyncEventId">;
|
|
33
|
+
} & {
|
|
34
|
+
readonly created_at: import("effect/DateTime").Utc;
|
|
35
|
+
} & {
|
|
36
|
+
readonly team_id: string & import("effect/Brand").Brand<"TeamId">;
|
|
37
|
+
} & {
|
|
38
|
+
readonly role_id: string & import("effect/Brand").Brand<"RoleId">;
|
|
39
|
+
} & {
|
|
40
|
+
readonly error: string | null;
|
|
41
|
+
} & {
|
|
42
|
+
readonly team_member_id: (string & import("effect/Brand").Brand<"TeamMemberId">) | null;
|
|
43
|
+
} & {
|
|
44
|
+
readonly role_name: string | null;
|
|
45
|
+
} & {
|
|
46
|
+
readonly discord_user_id: string | null;
|
|
47
|
+
} & {
|
|
48
|
+
readonly processed_at: string | null;
|
|
49
|
+
} & {
|
|
50
|
+
readonly guild_id: string;
|
|
51
|
+
} & {
|
|
52
|
+
readonly event_type: "role_assigned" | "role_unassigned" | "role_created" | "role_deleted";
|
|
53
|
+
}, Schema.Struct.Encoded<import("@effect/experimental/VariantSchema").ExtractFields<"select", {
|
|
54
|
+
readonly id: Model.Generated<Schema.brand<typeof Schema.String, "RoleSyncEventId">>;
|
|
55
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
56
|
+
readonly guild_id: typeof Schema.String;
|
|
57
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
58
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
59
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
60
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
61
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
62
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
63
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
64
|
+
readonly created_at: Model.DateTimeInsertFromDate;
|
|
65
|
+
}, true>>, never, {
|
|
66
|
+
readonly id: string & import("effect/Brand").Brand<"RoleSyncEventId">;
|
|
67
|
+
} & {
|
|
68
|
+
readonly created_at: import("effect/DateTime").Utc;
|
|
69
|
+
} & {
|
|
70
|
+
readonly team_id: string & import("effect/Brand").Brand<"TeamId">;
|
|
71
|
+
} & {
|
|
72
|
+
readonly role_id: string & import("effect/Brand").Brand<"RoleId">;
|
|
73
|
+
} & {
|
|
74
|
+
readonly error: string | null;
|
|
75
|
+
} & {
|
|
76
|
+
readonly team_member_id: (string & import("effect/Brand").Brand<"TeamMemberId">) | null;
|
|
77
|
+
} & {
|
|
78
|
+
readonly role_name: string | null;
|
|
79
|
+
} & {
|
|
80
|
+
readonly discord_user_id: string | null;
|
|
81
|
+
} & {
|
|
82
|
+
readonly processed_at: string | null;
|
|
83
|
+
} & {
|
|
84
|
+
readonly guild_id: string;
|
|
85
|
+
} & {
|
|
86
|
+
readonly event_type: "role_assigned" | "role_unassigned" | "role_created" | "role_deleted";
|
|
87
|
+
}> & {
|
|
88
|
+
readonly select: Schema.Struct<{
|
|
89
|
+
readonly id: Schema.brand<typeof Schema.String, "RoleSyncEventId">;
|
|
90
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
91
|
+
readonly guild_id: typeof Schema.String;
|
|
92
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
93
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
94
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
95
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
96
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
97
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
98
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
99
|
+
readonly created_at: Model.DateTimeFromDate;
|
|
100
|
+
}>;
|
|
101
|
+
readonly insert: Schema.Struct<{
|
|
102
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
103
|
+
readonly guild_id: typeof Schema.String;
|
|
104
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
105
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
106
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
107
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
108
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
109
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
110
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
111
|
+
readonly created_at: import("@effect/experimental/VariantSchema").Overrideable<import("effect/DateTime").Utc, Date, never>;
|
|
112
|
+
}>;
|
|
113
|
+
readonly update: Schema.Struct<{
|
|
114
|
+
readonly id: Schema.brand<typeof Schema.String, "RoleSyncEventId">;
|
|
115
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
116
|
+
readonly guild_id: typeof Schema.String;
|
|
117
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
118
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
119
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
120
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
121
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
122
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
123
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
124
|
+
}>;
|
|
125
|
+
readonly json: Schema.Struct<{
|
|
126
|
+
readonly id: Schema.brand<typeof Schema.String, "RoleSyncEventId">;
|
|
127
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
128
|
+
readonly guild_id: typeof Schema.String;
|
|
129
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
130
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
131
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
132
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
133
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
134
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
135
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
136
|
+
readonly created_at: typeof Schema.DateTimeUtc;
|
|
137
|
+
}>;
|
|
138
|
+
readonly jsonCreate: Schema.Struct<{
|
|
139
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
140
|
+
readonly guild_id: typeof Schema.String;
|
|
141
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
142
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
143
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
144
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
145
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
146
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
147
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
148
|
+
}>;
|
|
149
|
+
readonly jsonUpdate: Schema.Struct<{
|
|
150
|
+
readonly team_id: Schema.brand<typeof Schema.String, "TeamId">;
|
|
151
|
+
readonly guild_id: typeof Schema.String;
|
|
152
|
+
readonly event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
153
|
+
readonly role_id: Schema.brand<typeof Schema.String, "RoleId">;
|
|
154
|
+
readonly role_name: Schema.NullOr<typeof Schema.String>;
|
|
155
|
+
readonly team_member_id: Schema.NullOr<Schema.brand<typeof Schema.String, "TeamMemberId">>;
|
|
156
|
+
readonly discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
157
|
+
readonly processed_at: Schema.NullOr<typeof Schema.String>;
|
|
158
|
+
readonly error: Schema.NullOr<typeof Schema.String>;
|
|
159
|
+
}>;
|
|
160
|
+
};
|
|
161
|
+
export declare class RoleSyncEvent extends RoleSyncEvent_base {
|
|
162
|
+
}
|
|
163
|
+
export {};
|
|
164
|
+
//# sourceMappingURL=RoleSyncEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSyncEvent.d.ts","sourceRoot":"","sources":["../../../src/models/RoleSyncEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,eAAO,MAAM,eAAe,uDAAsD,CAAC;AACnF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D,eAAO,MAAM,iBAAiB,sFAK7B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,qBAAa,aAAc,SAAQ,kBAYjC;CAAG"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Rpc, RpcGroup } from '@effect/rpc';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
declare const UnprocessedEvent_base: Schema.Class<UnprocessedEvent, {
|
|
4
|
+
id: typeof Schema.String;
|
|
5
|
+
team_id: typeof Schema.String;
|
|
6
|
+
guild_id: typeof Schema.String;
|
|
7
|
+
event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
8
|
+
role_id: typeof Schema.String;
|
|
9
|
+
role_name: Schema.NullOr<typeof Schema.String>;
|
|
10
|
+
team_member_id: Schema.NullOr<typeof Schema.String>;
|
|
11
|
+
discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
12
|
+
}, Schema.Struct.Encoded<{
|
|
13
|
+
id: typeof Schema.String;
|
|
14
|
+
team_id: typeof Schema.String;
|
|
15
|
+
guild_id: typeof Schema.String;
|
|
16
|
+
event_type: Schema.Literal<["role_assigned", "role_unassigned", "role_created", "role_deleted"]>;
|
|
17
|
+
role_id: typeof Schema.String;
|
|
18
|
+
role_name: Schema.NullOr<typeof Schema.String>;
|
|
19
|
+
team_member_id: Schema.NullOr<typeof Schema.String>;
|
|
20
|
+
discord_user_id: Schema.NullOr<typeof Schema.String>;
|
|
21
|
+
}>, never, {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
} & {
|
|
24
|
+
readonly team_id: string;
|
|
25
|
+
} & {
|
|
26
|
+
readonly role_id: string;
|
|
27
|
+
} & {
|
|
28
|
+
readonly team_member_id: string | null;
|
|
29
|
+
} & {
|
|
30
|
+
readonly role_name: string | null;
|
|
31
|
+
} & {
|
|
32
|
+
readonly discord_user_id: string | null;
|
|
33
|
+
} & {
|
|
34
|
+
readonly guild_id: string;
|
|
35
|
+
} & {
|
|
36
|
+
readonly event_type: "role_assigned" | "role_unassigned" | "role_created" | "role_deleted";
|
|
37
|
+
}, {}, {}>;
|
|
38
|
+
export declare class UnprocessedEvent extends UnprocessedEvent_base {
|
|
39
|
+
}
|
|
40
|
+
declare const RoleMapping_base: Schema.Class<RoleMapping, {
|
|
41
|
+
id: typeof Schema.String;
|
|
42
|
+
team_id: typeof Schema.String;
|
|
43
|
+
role_id: typeof Schema.String;
|
|
44
|
+
discord_role_id: typeof Schema.String;
|
|
45
|
+
}, Schema.Struct.Encoded<{
|
|
46
|
+
id: typeof Schema.String;
|
|
47
|
+
team_id: typeof Schema.String;
|
|
48
|
+
role_id: typeof Schema.String;
|
|
49
|
+
discord_role_id: typeof Schema.String;
|
|
50
|
+
}>, never, {
|
|
51
|
+
readonly id: string;
|
|
52
|
+
} & {
|
|
53
|
+
readonly team_id: string;
|
|
54
|
+
} & {
|
|
55
|
+
readonly role_id: string;
|
|
56
|
+
} & {
|
|
57
|
+
readonly discord_role_id: string;
|
|
58
|
+
}, {}, {}>;
|
|
59
|
+
export declare class RoleMapping extends RoleMapping_base {
|
|
60
|
+
}
|
|
61
|
+
declare const RoleSyncRpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"GetUnprocessedEvents", Schema.Struct<{
|
|
62
|
+
limit: typeof Schema.Number;
|
|
63
|
+
}>, Schema.Array$<typeof UnprocessedEvent>, typeof Schema.Never, never> | Rpc.Rpc<"MarkEventProcessed", Schema.Struct<{
|
|
64
|
+
id: typeof Schema.String;
|
|
65
|
+
}>, typeof Schema.Void, typeof Schema.Never, never> | Rpc.Rpc<"MarkEventFailed", Schema.Struct<{
|
|
66
|
+
id: typeof Schema.String;
|
|
67
|
+
error: typeof Schema.String;
|
|
68
|
+
}>, typeof Schema.Void, typeof Schema.Never, never> | Rpc.Rpc<"GetMappingForRole", Schema.Struct<{
|
|
69
|
+
team_id: typeof Schema.String;
|
|
70
|
+
role_id: typeof Schema.String;
|
|
71
|
+
}>, Schema.NullOr<typeof RoleMapping>, typeof Schema.Never, never> | Rpc.Rpc<"UpsertMapping", Schema.Struct<{
|
|
72
|
+
team_id: typeof Schema.String;
|
|
73
|
+
role_id: typeof Schema.String;
|
|
74
|
+
discord_role_id: typeof Schema.String;
|
|
75
|
+
}>, typeof Schema.Void, typeof Schema.Never, never> | Rpc.Rpc<"DeleteMapping", Schema.Struct<{
|
|
76
|
+
team_id: typeof Schema.String;
|
|
77
|
+
role_id: typeof Schema.String;
|
|
78
|
+
}>, typeof Schema.Void, typeof Schema.Never, never>>;
|
|
79
|
+
export declare class RoleSyncRpcs extends RoleSyncRpcs_base {
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=RoleSyncRpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSyncRpc.d.ts","sourceRoot":"","sources":["../../../src/rpc/RoleSyncRpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhC,qBAAa,gBAAiB,SAAQ,qBASpC;CAAG;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,WAAY,SAAQ,gBAK/B;CAAG;;;;;;;;;;;;;;;;;;;AAgCL,qBAAa,YAAa,SAAQ,iBAOjC;CAAG"}
|
package/dist/esm/index.js
CHANGED
|
@@ -7,9 +7,11 @@ export * as RoleApi from './api/RoleApi.js';
|
|
|
7
7
|
export * as Roster from './api/Roster.js';
|
|
8
8
|
export * as SubgroupApi from './api/SubgroupApi.js';
|
|
9
9
|
export * as AgeThresholdRule from './models/AgeThresholdRule.js';
|
|
10
|
+
export * as DiscordRoleMapping from './models/DiscordRoleMapping.js';
|
|
10
11
|
export * as MemberRole from './models/MemberRole.js';
|
|
11
12
|
export * as Notification from './models/Notification.js';
|
|
12
13
|
export * as Role from './models/Role.js';
|
|
14
|
+
export * as RoleSyncEvent from './models/RoleSyncEvent.js';
|
|
13
15
|
export * as RosterMemberModel from './models/RosterMemberModel.js';
|
|
14
16
|
export * as RosterModel from './models/RosterModel.js';
|
|
15
17
|
export * as Session from './models/Session.js';
|
|
@@ -18,4 +20,5 @@ export * as Team from './models/Team.js';
|
|
|
18
20
|
export * as TeamInvite from './models/TeamInvite.js';
|
|
19
21
|
export * as TeamMember from './models/TeamMember.js';
|
|
20
22
|
export * as User from './models/User.js';
|
|
23
|
+
export * as RoleSyncRpc from './rpc/RoleSyncRpc.js';
|
|
21
24
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ApiGroup","AgeThresholdApi","Auth","Invite","NotificationApi","RoleApi","Roster","SubgroupApi","AgeThresholdRule","MemberRole","Notification","Role","RosterMemberModel","RosterModel","Session","SubgroupModel","Team","TeamInvite","TeamMember","User"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,QAAQ,MAAM,eAAe;AAEzC,OAAO,KAAKC,eAAe,MAAM,0BAA0B;AAE3D,OAAO,KAAKC,IAAI,MAAM,eAAe;AAErC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzC,OAAO,KAAKC,eAAe,MAAM,0BAA0B;AAE3D,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAE3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzC,OAAO,KAAKC,WAAW,MAAM,sBAAsB;AAEnD,OAAO,KAAKC,gBAAgB,MAAM,8BAA8B;AAEhE,OAAO,KAAKC,UAAU,MAAM,wBAAwB;AAEpD,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AAExD,OAAO,KAAKC,IAAI,MAAM,kBAAkB;AAExC,OAAO,KAAKC,iBAAiB,MAAM,+BAA+B;AAElE,OAAO,KAAKC,WAAW,MAAM,yBAAyB;AAEtD,OAAO,KAAKC,OAAO,MAAM,qBAAqB;AAE9C,OAAO,KAAKC,aAAa,MAAM,2BAA2B;AAE1D,OAAO,KAAKC,IAAI,MAAM,kBAAkB;AAExC,OAAO,KAAKC,UAAU,MAAM,wBAAwB;AAEpD,OAAO,KAAKC,UAAU,MAAM,wBAAwB;AAEpD,OAAO,KAAKC,IAAI,MAAM,kBAAkB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ApiGroup","AgeThresholdApi","Auth","Invite","NotificationApi","RoleApi","Roster","SubgroupApi","AgeThresholdRule","DiscordRoleMapping","MemberRole","Notification","Role","RoleSyncEvent","RosterMemberModel","RosterModel","Session","SubgroupModel","Team","TeamInvite","TeamMember","User","RoleSyncRpc"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,QAAQ,MAAM,eAAe;AAEzC,OAAO,KAAKC,eAAe,MAAM,0BAA0B;AAE3D,OAAO,KAAKC,IAAI,MAAM,eAAe;AAErC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzC,OAAO,KAAKC,eAAe,MAAM,0BAA0B;AAE3D,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAE3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzC,OAAO,KAAKC,WAAW,MAAM,sBAAsB;AAEnD,OAAO,KAAKC,gBAAgB,MAAM,8BAA8B;AAEhE,OAAO,KAAKC,kBAAkB,MAAM,gCAAgC;AAEpE,OAAO,KAAKC,UAAU,MAAM,wBAAwB;AAEpD,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AAExD,OAAO,KAAKC,IAAI,MAAM,kBAAkB;AAExC,OAAO,KAAKC,aAAa,MAAM,2BAA2B;AAE1D,OAAO,KAAKC,iBAAiB,MAAM,+BAA+B;AAElE,OAAO,KAAKC,WAAW,MAAM,yBAAyB;AAEtD,OAAO,KAAKC,OAAO,MAAM,qBAAqB;AAE9C,OAAO,KAAKC,aAAa,MAAM,2BAA2B;AAE1D,OAAO,KAAKC,IAAI,MAAM,kBAAkB;AAExC,OAAO,KAAKC,UAAU,MAAM,wBAAwB;AAEpD,OAAO,KAAKC,UAAU,MAAM,wBAAwB;AAEpD,OAAO,KAAKC,IAAI,MAAM,kBAAkB;AAExC,OAAO,KAAKC,WAAW,MAAM,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Model } from '@effect/sql';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
import { RoleId } from '../models/Role.js';
|
|
4
|
+
import { TeamId } from '../models/Team.js';
|
|
5
|
+
export const DiscordRoleMappingId = /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.brand('DiscordRoleMappingId'));
|
|
6
|
+
export class DiscordRoleMapping extends /*#__PURE__*/Model.Class('DiscordRoleMapping')({
|
|
7
|
+
id: /*#__PURE__*/Model.Generated(DiscordRoleMappingId),
|
|
8
|
+
team_id: TeamId,
|
|
9
|
+
role_id: RoleId,
|
|
10
|
+
discord_role_id: Schema.String,
|
|
11
|
+
created_at: Model.DateTimeInsertFromDate
|
|
12
|
+
}) {}
|
|
13
|
+
//# sourceMappingURL=DiscordRoleMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscordRoleMapping.js","names":["Model","Schema","RoleId","TeamId","DiscordRoleMappingId","String","pipe","brand","DiscordRoleMapping","Class","id","Generated","team_id","role_id","discord_role_id","created_at","DateTimeInsertFromDate"],"sources":["../../../src/models/DiscordRoleMapping.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,KAAK,QAAQ,aAAa;AACnC,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,OAAO,MAAMC,oBAAoB,gBAAGH,MAAM,CAACI,MAAM,CAACC,IAAI,cAACL,MAAM,CAACM,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAG5F,OAAM,MAAOC,kBAAmB,sBAAQR,KAAK,CAACS,KAAK,CAAqB,oBAAoB,CAAC,CAAC;EAC5FC,EAAE,eAAEV,KAAK,CAACW,SAAS,CAACP,oBAAoB,CAAC;EACzCQ,OAAO,EAAET,MAAM;EACfU,OAAO,EAAEX,MAAM;EACfY,eAAe,EAAEb,MAAM,CAACI,MAAM;EAC9BU,UAAU,EAAEf,KAAK,CAACgB;CACnB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Model } from '@effect/sql';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
import { RoleId } from '../models/Role.js';
|
|
4
|
+
import { TeamId } from '../models/Team.js';
|
|
5
|
+
import { TeamMemberId } from '../models/TeamMember.js';
|
|
6
|
+
export const RoleSyncEventId = /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.brand('RoleSyncEventId'));
|
|
7
|
+
export const RoleSyncEventType = /*#__PURE__*/Schema.Literal('role_assigned', 'role_unassigned', 'role_created', 'role_deleted');
|
|
8
|
+
export class RoleSyncEvent extends /*#__PURE__*/Model.Class('RoleSyncEvent')({
|
|
9
|
+
id: /*#__PURE__*/Model.Generated(RoleSyncEventId),
|
|
10
|
+
team_id: TeamId,
|
|
11
|
+
guild_id: Schema.String,
|
|
12
|
+
event_type: RoleSyncEventType,
|
|
13
|
+
role_id: RoleId,
|
|
14
|
+
role_name: /*#__PURE__*/Schema.NullOr(Schema.String),
|
|
15
|
+
team_member_id: /*#__PURE__*/Schema.NullOr(TeamMemberId),
|
|
16
|
+
discord_user_id: /*#__PURE__*/Schema.NullOr(Schema.String),
|
|
17
|
+
processed_at: /*#__PURE__*/Schema.NullOr(Schema.String),
|
|
18
|
+
error: /*#__PURE__*/Schema.NullOr(Schema.String),
|
|
19
|
+
created_at: Model.DateTimeInsertFromDate
|
|
20
|
+
}) {}
|
|
21
|
+
//# sourceMappingURL=RoleSyncEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSyncEvent.js","names":["Model","Schema","RoleId","TeamId","TeamMemberId","RoleSyncEventId","String","pipe","brand","RoleSyncEventType","Literal","RoleSyncEvent","Class","id","Generated","team_id","guild_id","event_type","role_id","role_name","NullOr","team_member_id","discord_user_id","processed_at","error","created_at","DateTimeInsertFromDate"],"sources":["../../../src/models/RoleSyncEvent.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,KAAK,QAAQ,aAAa;AACnC,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,OAAO,MAAMC,eAAe,gBAAGJ,MAAM,CAACK,MAAM,CAACC,IAAI,cAACN,MAAM,CAACO,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAGlF,OAAO,MAAMC,iBAAiB,gBAAGR,MAAM,CAACS,OAAO,CAC7C,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,CACf;AAGD,OAAM,MAAOC,aAAc,sBAAQX,KAAK,CAACY,KAAK,CAAgB,eAAe,CAAC,CAAC;EAC7EC,EAAE,eAAEb,KAAK,CAACc,SAAS,CAACT,eAAe,CAAC;EACpCU,OAAO,EAAEZ,MAAM;EACfa,QAAQ,EAAEf,MAAM,CAACK,MAAM;EACvBW,UAAU,EAAER,iBAAiB;EAC7BS,OAAO,EAAEhB,MAAM;EACfiB,SAAS,eAAElB,MAAM,CAACmB,MAAM,CAACnB,MAAM,CAACK,MAAM,CAAC;EACvCe,cAAc,eAAEpB,MAAM,CAACmB,MAAM,CAAChB,YAAY,CAAC;EAC3CkB,eAAe,eAAErB,MAAM,CAACmB,MAAM,CAACnB,MAAM,CAACK,MAAM,CAAC;EAC7CiB,YAAY,eAAEtB,MAAM,CAACmB,MAAM,CAACnB,MAAM,CAACK,MAAM,CAAC;EAC1CkB,KAAK,eAAEvB,MAAM,CAACmB,MAAM,CAACnB,MAAM,CAACK,MAAM,CAAC;EACnCmB,UAAU,EAAEzB,KAAK,CAAC0B;CACnB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Rpc, RpcGroup } from '@effect/rpc';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
export class UnprocessedEvent extends /*#__PURE__*/Schema.Class('UnprocessedEvent')({
|
|
4
|
+
id: Schema.String,
|
|
5
|
+
team_id: Schema.String,
|
|
6
|
+
guild_id: Schema.String,
|
|
7
|
+
event_type: /*#__PURE__*/Schema.Literal('role_assigned', 'role_unassigned', 'role_created', 'role_deleted'),
|
|
8
|
+
role_id: Schema.String,
|
|
9
|
+
role_name: /*#__PURE__*/Schema.NullOr(Schema.String),
|
|
10
|
+
team_member_id: /*#__PURE__*/Schema.NullOr(Schema.String),
|
|
11
|
+
discord_user_id: /*#__PURE__*/Schema.NullOr(Schema.String)
|
|
12
|
+
}) {}
|
|
13
|
+
export class RoleMapping extends /*#__PURE__*/Schema.Class('RoleMapping')({
|
|
14
|
+
id: Schema.String,
|
|
15
|
+
team_id: Schema.String,
|
|
16
|
+
role_id: Schema.String,
|
|
17
|
+
discord_role_id: Schema.String
|
|
18
|
+
}) {}
|
|
19
|
+
const GetUnprocessedEvents = /*#__PURE__*/Rpc.make('GetUnprocessedEvents', {
|
|
20
|
+
payload: {
|
|
21
|
+
limit: Schema.Number
|
|
22
|
+
},
|
|
23
|
+
success: /*#__PURE__*/Schema.Array(UnprocessedEvent)
|
|
24
|
+
});
|
|
25
|
+
const MarkEventProcessed = /*#__PURE__*/Rpc.make('MarkEventProcessed', {
|
|
26
|
+
payload: {
|
|
27
|
+
id: Schema.String
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const MarkEventFailed = /*#__PURE__*/Rpc.make('MarkEventFailed', {
|
|
31
|
+
payload: {
|
|
32
|
+
id: Schema.String,
|
|
33
|
+
error: Schema.String
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const GetMappingForRole = /*#__PURE__*/Rpc.make('GetMappingForRole', {
|
|
37
|
+
payload: {
|
|
38
|
+
team_id: Schema.String,
|
|
39
|
+
role_id: Schema.String
|
|
40
|
+
},
|
|
41
|
+
success: /*#__PURE__*/Schema.NullOr(RoleMapping)
|
|
42
|
+
});
|
|
43
|
+
const UpsertMapping = /*#__PURE__*/Rpc.make('UpsertMapping', {
|
|
44
|
+
payload: {
|
|
45
|
+
team_id: Schema.String,
|
|
46
|
+
role_id: Schema.String,
|
|
47
|
+
discord_role_id: Schema.String
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const DeleteMapping = /*#__PURE__*/Rpc.make('DeleteMapping', {
|
|
51
|
+
payload: {
|
|
52
|
+
team_id: Schema.String,
|
|
53
|
+
role_id: Schema.String
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export class RoleSyncRpcs extends /*#__PURE__*/RpcGroup.make(GetUnprocessedEvents, MarkEventProcessed, MarkEventFailed, GetMappingForRole, UpsertMapping, DeleteMapping) {}
|
|
57
|
+
//# sourceMappingURL=RoleSyncRpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSyncRpc.js","names":["Rpc","RpcGroup","Schema","UnprocessedEvent","Class","id","String","team_id","guild_id","event_type","Literal","role_id","role_name","NullOr","team_member_id","discord_user_id","RoleMapping","discord_role_id","GetUnprocessedEvents","make","payload","limit","Number","success","Array","MarkEventProcessed","MarkEventFailed","error","GetMappingForRole","UpsertMapping","DeleteMapping","RoleSyncRpcs"],"sources":["../../../src/rpc/RoleSyncRpc.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAG,EAAEC,QAAQ,QAAQ,aAAa;AAC3C,SAASC,MAAM,QAAQ,QAAQ;AAE/B,OAAM,MAAOC,gBAAiB,sBAAQD,MAAM,CAACE,KAAK,CAAmB,kBAAkB,CAAC,CAAC;EACvFC,EAAE,EAAEH,MAAM,CAACI,MAAM;EACjBC,OAAO,EAAEL,MAAM,CAACI,MAAM;EACtBE,QAAQ,EAAEN,MAAM,CAACI,MAAM;EACvBG,UAAU,eAAEP,MAAM,CAACQ,OAAO,CAAC,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,CAAC;EAC9FC,OAAO,EAAET,MAAM,CAACI,MAAM;EACtBM,SAAS,eAAEV,MAAM,CAACW,MAAM,CAACX,MAAM,CAACI,MAAM,CAAC;EACvCQ,cAAc,eAAEZ,MAAM,CAACW,MAAM,CAACX,MAAM,CAACI,MAAM,CAAC;EAC5CS,eAAe,eAAEb,MAAM,CAACW,MAAM,CAACX,MAAM,CAACI,MAAM;CAC7C,CAAC;AAEF,OAAM,MAAOU,WAAY,sBAAQd,MAAM,CAACE,KAAK,CAAc,aAAa,CAAC,CAAC;EACxEC,EAAE,EAAEH,MAAM,CAACI,MAAM;EACjBC,OAAO,EAAEL,MAAM,CAACI,MAAM;EACtBK,OAAO,EAAET,MAAM,CAACI,MAAM;EACtBW,eAAe,EAAEf,MAAM,CAACI;CACzB,CAAC;AAEF,MAAMY,oBAAoB,gBAAGlB,GAAG,CAACmB,IAAI,CAAC,sBAAsB,EAAE;EAC5DC,OAAO,EAAE;IAAEC,KAAK,EAAEnB,MAAM,CAACoB;EAAM,CAAE;EACjCC,OAAO,eAAErB,MAAM,CAACsB,KAAK,CAACrB,gBAAgB;CACvC,CAAC;AAEF,MAAMsB,kBAAkB,gBAAGzB,GAAG,CAACmB,IAAI,CAAC,oBAAoB,EAAE;EACxDC,OAAO,EAAE;IAAEf,EAAE,EAAEH,MAAM,CAACI;EAAM;CAC7B,CAAC;AAEF,MAAMoB,eAAe,gBAAG1B,GAAG,CAACmB,IAAI,CAAC,iBAAiB,EAAE;EAClDC,OAAO,EAAE;IAAEf,EAAE,EAAEH,MAAM,CAACI,MAAM;IAAEqB,KAAK,EAAEzB,MAAM,CAACI;EAAM;CACnD,CAAC;AAEF,MAAMsB,iBAAiB,gBAAG5B,GAAG,CAACmB,IAAI,CAAC,mBAAmB,EAAE;EACtDC,OAAO,EAAE;IAAEb,OAAO,EAAEL,MAAM,CAACI,MAAM;IAAEK,OAAO,EAAET,MAAM,CAACI;EAAM,CAAE;EAC3DiB,OAAO,eAAErB,MAAM,CAACW,MAAM,CAACG,WAAW;CACnC,CAAC;AAEF,MAAMa,aAAa,gBAAG7B,GAAG,CAACmB,IAAI,CAAC,eAAe,EAAE;EAC9CC,OAAO,EAAE;IACPb,OAAO,EAAEL,MAAM,CAACI,MAAM;IACtBK,OAAO,EAAET,MAAM,CAACI,MAAM;IACtBW,eAAe,EAAEf,MAAM,CAACI;;CAE3B,CAAC;AAEF,MAAMwB,aAAa,gBAAG9B,GAAG,CAACmB,IAAI,CAAC,eAAe,EAAE;EAC9CC,OAAO,EAAE;IAAEb,OAAO,EAAEL,MAAM,CAACI,MAAM;IAAEK,OAAO,EAAET,MAAM,CAACI;EAAM;CAC1D,CAAC;AAEF,OAAM,MAAOyB,YAAa,sBAAQ9B,QAAQ,CAACkB,IAAI,CAC7CD,oBAAoB,EACpBO,kBAAkB,EAClBC,eAAe,EACfE,iBAAiB,EACjBC,aAAa,EACbC,aAAa,CACd","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sideline/domain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The domain template",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@effect/experimental": "0.58.0",
|
|
14
14
|
"@effect/platform": "0.94.5",
|
|
15
|
+
"@effect/rpc": "0.73.0",
|
|
15
16
|
"@effect/sql": "0.49.0",
|
|
16
17
|
"effect": "3.19.18"
|
|
17
18
|
},
|
package/src/index.ts
CHANGED
|
@@ -16,12 +16,16 @@ export * as SubgroupApi from './api/SubgroupApi.js';
|
|
|
16
16
|
|
|
17
17
|
export * as AgeThresholdRule from './models/AgeThresholdRule.js';
|
|
18
18
|
|
|
19
|
+
export * as DiscordRoleMapping from './models/DiscordRoleMapping.js';
|
|
20
|
+
|
|
19
21
|
export * as MemberRole from './models/MemberRole.js';
|
|
20
22
|
|
|
21
23
|
export * as Notification from './models/Notification.js';
|
|
22
24
|
|
|
23
25
|
export * as Role from './models/Role.js';
|
|
24
26
|
|
|
27
|
+
export * as RoleSyncEvent from './models/RoleSyncEvent.js';
|
|
28
|
+
|
|
25
29
|
export * as RosterMemberModel from './models/RosterMemberModel.js';
|
|
26
30
|
|
|
27
31
|
export * as RosterModel from './models/RosterModel.js';
|
|
@@ -37,3 +41,5 @@ export * as TeamInvite from './models/TeamInvite.js';
|
|
|
37
41
|
export * as TeamMember from './models/TeamMember.js';
|
|
38
42
|
|
|
39
43
|
export * as User from './models/User.js';
|
|
44
|
+
|
|
45
|
+
export * as RoleSyncRpc from './rpc/RoleSyncRpc.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Model } from '@effect/sql';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
import { RoleId } from '~/models/Role.js';
|
|
4
|
+
import { TeamId } from '~/models/Team.js';
|
|
5
|
+
|
|
6
|
+
export const DiscordRoleMappingId = Schema.String.pipe(Schema.brand('DiscordRoleMappingId'));
|
|
7
|
+
export type DiscordRoleMappingId = typeof DiscordRoleMappingId.Type;
|
|
8
|
+
|
|
9
|
+
export class DiscordRoleMapping extends Model.Class<DiscordRoleMapping>('DiscordRoleMapping')({
|
|
10
|
+
id: Model.Generated(DiscordRoleMappingId),
|
|
11
|
+
team_id: TeamId,
|
|
12
|
+
role_id: RoleId,
|
|
13
|
+
discord_role_id: Schema.String,
|
|
14
|
+
created_at: Model.DateTimeInsertFromDate,
|
|
15
|
+
}) {}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Model } from '@effect/sql';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
import { RoleId } from '~/models/Role.js';
|
|
4
|
+
import { TeamId } from '~/models/Team.js';
|
|
5
|
+
import { TeamMemberId } from '~/models/TeamMember.js';
|
|
6
|
+
|
|
7
|
+
export const RoleSyncEventId = Schema.String.pipe(Schema.brand('RoleSyncEventId'));
|
|
8
|
+
export type RoleSyncEventId = typeof RoleSyncEventId.Type;
|
|
9
|
+
|
|
10
|
+
export const RoleSyncEventType = Schema.Literal(
|
|
11
|
+
'role_assigned',
|
|
12
|
+
'role_unassigned',
|
|
13
|
+
'role_created',
|
|
14
|
+
'role_deleted',
|
|
15
|
+
);
|
|
16
|
+
export type RoleSyncEventType = typeof RoleSyncEventType.Type;
|
|
17
|
+
|
|
18
|
+
export class RoleSyncEvent extends Model.Class<RoleSyncEvent>('RoleSyncEvent')({
|
|
19
|
+
id: Model.Generated(RoleSyncEventId),
|
|
20
|
+
team_id: TeamId,
|
|
21
|
+
guild_id: Schema.String,
|
|
22
|
+
event_type: RoleSyncEventType,
|
|
23
|
+
role_id: RoleId,
|
|
24
|
+
role_name: Schema.NullOr(Schema.String),
|
|
25
|
+
team_member_id: Schema.NullOr(TeamMemberId),
|
|
26
|
+
discord_user_id: Schema.NullOr(Schema.String),
|
|
27
|
+
processed_at: Schema.NullOr(Schema.String),
|
|
28
|
+
error: Schema.NullOr(Schema.String),
|
|
29
|
+
created_at: Model.DateTimeInsertFromDate,
|
|
30
|
+
}) {}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Rpc, RpcGroup } from '@effect/rpc';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
|
|
4
|
+
export class UnprocessedEvent extends Schema.Class<UnprocessedEvent>('UnprocessedEvent')({
|
|
5
|
+
id: Schema.String,
|
|
6
|
+
team_id: Schema.String,
|
|
7
|
+
guild_id: Schema.String,
|
|
8
|
+
event_type: Schema.Literal('role_assigned', 'role_unassigned', 'role_created', 'role_deleted'),
|
|
9
|
+
role_id: Schema.String,
|
|
10
|
+
role_name: Schema.NullOr(Schema.String),
|
|
11
|
+
team_member_id: Schema.NullOr(Schema.String),
|
|
12
|
+
discord_user_id: Schema.NullOr(Schema.String),
|
|
13
|
+
}) {}
|
|
14
|
+
|
|
15
|
+
export class RoleMapping extends Schema.Class<RoleMapping>('RoleMapping')({
|
|
16
|
+
id: Schema.String,
|
|
17
|
+
team_id: Schema.String,
|
|
18
|
+
role_id: Schema.String,
|
|
19
|
+
discord_role_id: Schema.String,
|
|
20
|
+
}) {}
|
|
21
|
+
|
|
22
|
+
const GetUnprocessedEvents = Rpc.make('GetUnprocessedEvents', {
|
|
23
|
+
payload: { limit: Schema.Number },
|
|
24
|
+
success: Schema.Array(UnprocessedEvent),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const MarkEventProcessed = Rpc.make('MarkEventProcessed', {
|
|
28
|
+
payload: { id: Schema.String },
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const MarkEventFailed = Rpc.make('MarkEventFailed', {
|
|
32
|
+
payload: { id: Schema.String, error: Schema.String },
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const GetMappingForRole = Rpc.make('GetMappingForRole', {
|
|
36
|
+
payload: { team_id: Schema.String, role_id: Schema.String },
|
|
37
|
+
success: Schema.NullOr(RoleMapping),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const UpsertMapping = Rpc.make('UpsertMapping', {
|
|
41
|
+
payload: {
|
|
42
|
+
team_id: Schema.String,
|
|
43
|
+
role_id: Schema.String,
|
|
44
|
+
discord_role_id: Schema.String,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const DeleteMapping = Rpc.make('DeleteMapping', {
|
|
49
|
+
payload: { team_id: Schema.String, role_id: Schema.String },
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export class RoleSyncRpcs extends RpcGroup.make(
|
|
53
|
+
GetUnprocessedEvents,
|
|
54
|
+
MarkEventProcessed,
|
|
55
|
+
MarkEventFailed,
|
|
56
|
+
GetMappingForRole,
|
|
57
|
+
UpsertMapping,
|
|
58
|
+
DeleteMapping,
|
|
59
|
+
) {}
|