@voltro/plugin-social 0.0.0-stage → 0.88.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/index.js ADDED
@@ -0,0 +1,134 @@
1
+ import { SocialError as e, socialError as t } from "./errors.js";
2
+ import { SocialBlockPort as n } from "./port.js";
3
+ import { socialRelationsTable as r } from "./relations.entity.js";
4
+ import { socialRecentTable as i } from "./recent.entity.js";
5
+ import { socialSettingsTable as a } from "./settings.entity.js";
6
+ import { dataStoreSocial as o } from "./service.js";
7
+ import { BASE_NAME as s, socialRpcClientImports as c } from "./rpc.js";
8
+ import { socialRpcRoutes as l } from "./rpcRoutes.js";
9
+ import { defaultSocialStrategies as u, resolveSocialOptions as d } from "./strategies.js";
10
+ import { socialStatus as f } from "./inspect.js";
11
+ import { accepted as p, requested as m } from "./events.js";
12
+ import { defineLicensedGamePlugin as h } from "@voltro/plugin-licensing/gate";
13
+ import { Effect as g, Layer as _ } from "effect";
14
+ import { fileURLToPath as v } from "node:url";
15
+ import { replicaEvidence as y } from "@voltro/protocol/identity";
16
+ import { redisStore as b } from "@voltro/plugin-ratelimit";
17
+ // src/index.ts
18
+ var x = {
19
+ slots: {
20
+ suggestions: {
21
+ defaultExport: "mutualMatchSuggestions",
22
+ fixtureExport: "socialSuggestionsFixture"
23
+ },
24
+ requestPolicy: {
25
+ defaultExport: "recipientRequestPolicy",
26
+ fixtureExport: "socialRequestPolicyFixture"
27
+ },
28
+ recentPolicy: {
29
+ defaultExport: "distinctRecentPeers",
30
+ fixtureExport: "socialRecentPolicyFixture"
31
+ }
32
+ },
33
+ ports: { socialBlock: {
34
+ tagExport: "SocialBlockPort",
35
+ fakeLayerExport: "socialBlockFakeLayer",
36
+ fixtureExport: "socialBlockPortFixture"
37
+ } },
38
+ events: [m.name, p.name]
39
+ }, S = (u = {}) => {
40
+ let p = d(u), m = b(p.rateLimit), x, S, C = !1, w = (e) => g.suspend(() => S === void 0 ? g.fail(t("unavailable")) : e(S));
41
+ return h({
42
+ name: s,
43
+ description: "SQL-owned social graph and symmetric block admission.",
44
+ permissions: ["store:write", "inspect:read"],
45
+ services: _.succeed(n, {
46
+ isBlocked: (e, t) => w((n) => n.blockPort.isBlocked(e, t)),
47
+ blockPairs: (e, t) => w((n) => n.blockPort.blockPairs(e, t)),
48
+ canMessage: (e, t) => w((n) => n.blockPort.canMessage(e, t)),
49
+ canInvite: (e, t) => w((n) => n.blockPort.canInvite(e, t)),
50
+ recordRecent: (e, t) => w((n) => n.blockPort.recordRecent(e, t))
51
+ }),
52
+ sources: v(new URL("./social-app", "" + import.meta.url)),
53
+ routes: l({
54
+ request: (e, t) => w((n) => n.service.request(e, t)),
55
+ accept: (e, t) => w((n) => n.service.accept(e, t)),
56
+ decline: (e, t) => w((n) => n.service.decline(e, t)),
57
+ cancel: (e, t) => w((n) => n.service.cancel(e, t)),
58
+ remove: (e, t) => w((n) => n.service.remove(e, t)),
59
+ block: (e, t) => w((n) => n.service.block(e, t)),
60
+ unblock: (e, t) => w((n) => n.service.unblock(e, t)),
61
+ favorite: (e, t, n) => w((r) => r.service.favorite(e, t, n)),
62
+ setSettings: (e, t) => w((n) => n.service.setSettings(e, t)),
63
+ getSettings: (e) => w((t) => t.service.getSettings(e)),
64
+ friends: (e) => w((t) => t.service.friends(e)),
65
+ requests: (e) => w((t) => t.service.requests(e)),
66
+ blocked: (e) => w((t) => t.service.blocked(e)),
67
+ favorites: (e) => w((t) => t.service.favorites(e)),
68
+ recent: (e) => w((t) => t.service.recent(e)),
69
+ suggestions: (e) => w((t) => t.service.suggestions(e))
70
+ }),
71
+ rpcClientDescriptors: c,
72
+ errorSchemas: [{
73
+ schema: e,
74
+ import: {
75
+ module: "@voltro/plugin-social/errors",
76
+ name: "SocialError"
77
+ }
78
+ }],
79
+ extendSchema: { tables: [
80
+ r,
81
+ i,
82
+ a
83
+ ] },
84
+ subjectPrivacy: {
85
+ tables: [
86
+ r.tableName,
87
+ i.tableName,
88
+ a.tableName
89
+ ],
90
+ kinds: ["user", "guest"]
91
+ },
92
+ inspectEndpoints: [{
93
+ method: "GET",
94
+ path: "/status",
95
+ scope: "process",
96
+ description: "Configuration and binding observation, no graph records or SQL/Redis health claim.",
97
+ handler: () => g.try({
98
+ try: () => ({
99
+ kind: "json",
100
+ data: f(p, S !== void 0, C)
101
+ }),
102
+ catch: () => t("unavailable")
103
+ })
104
+ }],
105
+ bindDataStore: (e) => {
106
+ if (x !== void 0 && x !== e) throw Error("Social plugin instance cannot cross app stores");
107
+ x = e, S = o(e, p, m);
108
+ },
109
+ onActivate: (e) => g.tryPromise({
110
+ try: async () => {
111
+ if (p.rateLimit?.hotStore !== void 0 && y(e.env) !== null) throw t("unavailable");
112
+ await m.activate(e.env, e.connectionRegistry), C = !0;
113
+ },
114
+ catch: () => t("unavailable")
115
+ }),
116
+ onExport: (e, t) => w((n) => n.exportSubject({
117
+ subjectId: e,
118
+ tenantId: t.tenantId,
119
+ kind: t.kind
120
+ })),
121
+ onErase: (e, t) => w((n) => n.eraseSubject({
122
+ subjectId: e,
123
+ tenantId: t.tenantId,
124
+ kind: t.kind
125
+ })),
126
+ onDeactivate: () => g.tryPromise({
127
+ try: async () => {
128
+ C = !1, S = void 0, x = void 0, await m.deactivate();
129
+ },
130
+ catch: () => t("unavailable")
131
+ })
132
+ });
133
+ };
134
+ export { n as SocialBlockPort, e as SocialError, o as dataStoreSocial, u as defaultSocialStrategies, d as resolveSocialOptions, S as socialPlugin, i as socialRecentTable, r as socialRelationsTable, a as socialSettingsTable, x as socialSystemContract };
@@ -0,0 +1,27 @@
1
+ import { socialError as e } from "./errors.js";
2
+ import { RECENT_TABLE as t, RELATIONS_TABLE as n, SETTINGS_TABLE as r } from "./contract.js";
3
+ import { defaultSocialStrategies as i } from "./strategies.js";
4
+ // src/inspect.ts
5
+ var a = (a, o, s) => {
6
+ let c = a.now();
7
+ if (!Number.isSafeInteger(c) || c < 0 || c > 864e13) throw e("unavailable");
8
+ return {
9
+ observedAt: c,
10
+ bound: o,
11
+ rateActive: s,
12
+ maxFriends: a.maxFriends,
13
+ maxPendingRequests: a.maxPendingRequests,
14
+ recentLimit: a.recentLimit,
15
+ recentRetentionMs: a.recentRetentionMs,
16
+ requestLimit: a.requestLimit,
17
+ requestWindowMs: a.requestWindowMs,
18
+ suggestionLimit: a.suggestionLimit,
19
+ slots: Object.fromEntries(Object.entries(i).map(([e, t]) => [e, a.strategies[e] === t ? "default" : "custom"])),
20
+ tables: [
21
+ n,
22
+ t,
23
+ r
24
+ ]
25
+ };
26
+ };
27
+ export { a as socialStatus };
package/dist/port.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ import { Context } from 'effect';
2
+ import { Effect } from 'effect';
3
+ import { Schema } from 'effect';
4
+ import { Subject } from '@voltro/protocol';
5
+ import { YieldableError } from 'effect/Cause';
6
+
7
+ declare interface RecordRecentInput {
8
+ readonly tenantId: string;
9
+ readonly participants: ReadonlyArray<string>;
10
+ readonly context: string;
11
+ readonly at?: number;
12
+ }
13
+
14
+ export declare class SocialBlockPort extends SocialBlockPort_base {
15
+ }
16
+
17
+ declare const SocialBlockPort_base: Context.ServiceClass<SocialBlockPort, "@voltro/SocialBlockPort", SocialBlockService>;
18
+
19
+ /** Chat, matchmaking and party admission depend on this port, never Social SQL. */
20
+ export declare interface SocialBlockService {
21
+ readonly isBlocked: (subject: Subject, otherId: string) => Effect.Effect<boolean, SocialError>;
22
+ readonly blockPairs: (subject: Subject, subjectIds: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<readonly [string, string]>, SocialError>;
23
+ readonly canMessage: (subject: Subject, otherId: string) => Effect.Effect<boolean, SocialError>;
24
+ readonly canInvite: (subject: Subject, otherId: string) => Effect.Effect<boolean, SocialError>;
25
+ readonly recordRecent: (subject: Subject, input: RecordRecentInput) => Effect.Effect<void, SocialError>;
26
+ }
27
+
28
+ declare class SocialError extends SocialError_base {
29
+ }
30
+
31
+ declare const SocialError_base: Schema.Class<SocialError, Schema.TaggedStruct<"SocialError", {
32
+ readonly code: Schema.Literals<readonly ["identity_required", "invalid_input", "blocked", "request_refused", "not_found", "friend_limit", "pending_limit", "rate_limited", "unavailable", "export_limit"]>;
33
+ }>, YieldableError>;
34
+
35
+ export { }
package/dist/port.js ADDED
@@ -0,0 +1,4 @@
1
+ import { Context as e } from "effect";
2
+ // src/port.ts
3
+ var t = class extends e.Service()("@voltro/SocialBlockPort") {};
4
+ export { t as SocialBlockPort };
@@ -0,0 +1,17 @@
1
+ import { RECENT_TABLE as e } from "./contract.js";
2
+ import { id as t, json as n, table as r, text as i, timestamp as a } from "@voltro/database";
3
+ // src/recent.entity.ts
4
+ var o = r(e, {
5
+ id: t({ prefix: "srecent" }),
6
+ tenantId: i().maxLength(256).externalId().sensitive("pii"),
7
+ ownerId: i().maxLength(256).externalId().sensitive("pii"),
8
+ otherId: i().maxLength(256).externalId().sensitive("pii"),
9
+ context: i().maxLength(256).sensitive("pii"),
10
+ at: a().safe(),
11
+ metadata: n().sensitive("pii")
12
+ }).index([
13
+ "tenantId",
14
+ "ownerId",
15
+ "at"
16
+ ]).index(["tenantId", "otherId"]);
17
+ export { o as socialRecentTable };
@@ -0,0 +1,29 @@
1
+ import { RELATIONS_TABLE as e } from "./contract.js";
2
+ import { id as t, json as n, table as r, text as i, timestamp as a } from "@voltro/database";
3
+ // src/relations.entity.ts
4
+ var o = r(e, {
5
+ id: t({ prefix: "srel" }),
6
+ tenantId: i().maxLength(256).externalId().sensitive("pii"),
7
+ fromId: i().maxLength(256).externalId().sensitive("pii"),
8
+ toId: i().maxLength(256).externalId().sensitive("pii"),
9
+ pairKey: i().maxLength(64).serverOnly(),
10
+ kind: i().maxLength(16).oneOf([
11
+ "request",
12
+ "friend",
13
+ "block",
14
+ "favorite"
15
+ ]).safe(),
16
+ createdAt: a().safe(),
17
+ respondedAt: a().nullable().safe(),
18
+ note: i().nullable().sensitive("pii"),
19
+ metadata: n().sensitive("pii")
20
+ }).unique(["pairKey", "kind"]).index([
21
+ "tenantId",
22
+ "fromId",
23
+ "kind"
24
+ ]).index([
25
+ "tenantId",
26
+ "toId",
27
+ "kind"
28
+ ]);
29
+ export { o as socialRelationsTable };
package/dist/rpc.d.ts ADDED
@@ -0,0 +1,150 @@
1
+ import { ActionProcedureDescriptor } from '@voltro/protocol';
2
+ import { PluginRpcClientDescriptor } from '@voltro/protocol';
3
+ import { QueryProcedureDescriptor } from '@voltro/protocol';
4
+ import { Schema } from 'effect';
5
+ import { YieldableError } from 'effect/Cause';
6
+
7
+ export declare const acceptDescriptor: ActionProcedureDescriptor<"social.accept", Schema.Struct<{
8
+ readonly otherId: Schema.NonEmptyString;
9
+ }>, Schema.Struct<{
10
+ readonly id: Schema.String;
11
+ readonly fromId: Schema.String;
12
+ readonly toId: Schema.String;
13
+ readonly kind: Schema.Literals<readonly ["request", "friend", "block", "favorite"]>;
14
+ readonly createdAt: Schema.Number;
15
+ readonly respondedAt: Schema.NullOr<Schema.Number>;
16
+ readonly note: Schema.NullOr<Schema.String>;
17
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
18
+ }>, typeof SocialError>;
19
+
20
+ export declare const BASE_NAME = "@voltro/plugin-social";
21
+
22
+ export declare const blockDescriptor: ActionProcedureDescriptor<"social.block", Schema.Struct<{
23
+ readonly otherId: Schema.NonEmptyString;
24
+ }>, Schema.Void, typeof SocialError>;
25
+
26
+ export declare const blockedDescriptor: QueryProcedureDescriptor<"social.blocked", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
27
+ readonly id: Schema.String;
28
+ readonly fromId: Schema.String;
29
+ readonly toId: Schema.String;
30
+ readonly kind: Schema.Literals<readonly ["request", "friend", "block", "favorite"]>;
31
+ readonly createdAt: Schema.Number;
32
+ readonly respondedAt: Schema.NullOr<Schema.Number>;
33
+ readonly note: Schema.NullOr<Schema.String>;
34
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
35
+ }>>, typeof SocialError>;
36
+
37
+ export declare const cancelDescriptor: ActionProcedureDescriptor<"social.cancel", Schema.Struct<{
38
+ readonly otherId: Schema.NonEmptyString;
39
+ }>, Schema.Void, typeof SocialError>;
40
+
41
+ export declare const declineDescriptor: ActionProcedureDescriptor<"social.decline", Schema.Struct<{
42
+ readonly otherId: Schema.NonEmptyString;
43
+ }>, Schema.Void, typeof SocialError>;
44
+
45
+ export declare const favoriteDescriptor: ActionProcedureDescriptor<"social.favorite", Schema.Struct<{
46
+ readonly otherId: Schema.NonEmptyString;
47
+ readonly enabled: Schema.Boolean;
48
+ }>, Schema.Void, typeof SocialError>;
49
+
50
+ export declare const favoritesDescriptor: QueryProcedureDescriptor<"social.favorites", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
51
+ readonly id: Schema.String;
52
+ readonly fromId: Schema.String;
53
+ readonly toId: Schema.String;
54
+ readonly kind: Schema.Literals<readonly ["request", "friend", "block", "favorite"]>;
55
+ readonly createdAt: Schema.Number;
56
+ readonly respondedAt: Schema.NullOr<Schema.Number>;
57
+ readonly note: Schema.NullOr<Schema.String>;
58
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
59
+ }>>, typeof SocialError>;
60
+
61
+ export declare const friendsDescriptor: QueryProcedureDescriptor<"social.friends", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
62
+ readonly id: Schema.String;
63
+ readonly fromId: Schema.String;
64
+ readonly toId: Schema.String;
65
+ readonly kind: Schema.Literals<readonly ["request", "friend", "block", "favorite"]>;
66
+ readonly createdAt: Schema.Number;
67
+ readonly respondedAt: Schema.NullOr<Schema.Number>;
68
+ readonly note: Schema.NullOr<Schema.String>;
69
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
70
+ }>>, typeof SocialError>;
71
+
72
+ export declare const recentDescriptor: QueryProcedureDescriptor<"social.recent", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
73
+ readonly id: Schema.String;
74
+ readonly otherId: Schema.String;
75
+ readonly context: Schema.String;
76
+ readonly at: Schema.Number;
77
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
78
+ }>>, typeof SocialError>;
79
+
80
+ export declare const removeDescriptor: ActionProcedureDescriptor<"social.remove", Schema.Struct<{
81
+ readonly otherId: Schema.NonEmptyString;
82
+ }>, Schema.Void, typeof SocialError>;
83
+
84
+ export declare const requestDescriptor: ActionProcedureDescriptor<"social.request", Schema.Struct<{
85
+ readonly otherId: Schema.NonEmptyString;
86
+ }>, Schema.Struct<{
87
+ readonly id: Schema.String;
88
+ readonly fromId: Schema.String;
89
+ readonly toId: Schema.String;
90
+ readonly kind: Schema.Literals<readonly ["request", "friend", "block", "favorite"]>;
91
+ readonly createdAt: Schema.Number;
92
+ readonly respondedAt: Schema.NullOr<Schema.Number>;
93
+ readonly note: Schema.NullOr<Schema.String>;
94
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
95
+ }>, typeof SocialError>;
96
+
97
+ export declare const requestsDescriptor: QueryProcedureDescriptor<"social.requests", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
98
+ readonly id: Schema.String;
99
+ readonly fromId: Schema.String;
100
+ readonly toId: Schema.String;
101
+ readonly kind: Schema.Literals<readonly ["request", "friend", "block", "favorite"]>;
102
+ readonly createdAt: Schema.Number;
103
+ readonly respondedAt: Schema.NullOr<Schema.Number>;
104
+ readonly note: Schema.NullOr<Schema.String>;
105
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
106
+ }>>, typeof SocialError>;
107
+
108
+ export declare const setSettingsDescriptor: ActionProcedureDescriptor<"social.setSettings", Schema.Struct<{
109
+ readonly requestsFrom: Schema.optional<Schema.Literals<readonly ["anyone", "friends-of-friends", "nobody"]>>;
110
+ readonly showOnline: Schema.optional<Schema.Boolean>;
111
+ readonly showActivity: Schema.optional<Schema.Boolean>;
112
+ readonly allowPartyInvites: Schema.optional<Schema.Literals<readonly ["friends", "anyone"]>>;
113
+ }>, Schema.Struct<{
114
+ readonly ownerId: Schema.String;
115
+ readonly requestsFrom: Schema.Literals<readonly ["anyone", "friends-of-friends", "nobody"]>;
116
+ readonly showOnline: Schema.Boolean;
117
+ readonly showActivity: Schema.Boolean;
118
+ readonly allowPartyInvites: Schema.Literals<readonly ["friends", "anyone"]>;
119
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
120
+ }>, typeof SocialError>;
121
+
122
+ export declare const settingsDescriptor: QueryProcedureDescriptor<"social.settings", Schema.Struct<{}>, Schema.Struct<{
123
+ readonly ownerId: Schema.String;
124
+ readonly requestsFrom: Schema.Literals<readonly ["anyone", "friends-of-friends", "nobody"]>;
125
+ readonly showOnline: Schema.Boolean;
126
+ readonly showActivity: Schema.Boolean;
127
+ readonly allowPartyInvites: Schema.Literals<readonly ["friends", "anyone"]>;
128
+ readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
129
+ }>, typeof SocialError>;
130
+
131
+ declare class SocialError extends SocialError_base {
132
+ }
133
+
134
+ declare const SocialError_base: Schema.Class<SocialError, Schema.TaggedStruct<"SocialError", {
135
+ readonly code: Schema.Literals<readonly ["identity_required", "invalid_input", "blocked", "request_refused", "not_found", "friend_limit", "pending_limit", "rate_limited", "unavailable", "export_limit"]>;
136
+ }>, YieldableError>;
137
+
138
+ export declare const socialRpcClientImports: ReadonlyArray<PluginRpcClientDescriptor>;
139
+
140
+ export declare const suggestionsDescriptor: QueryProcedureDescriptor<"social.suggestions", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
141
+ readonly subjectId: Schema.String;
142
+ readonly mutualFriends: Schema.Number;
143
+ readonly recentMatches: Schema.Number;
144
+ }>>, typeof SocialError>;
145
+
146
+ export declare const unblockDescriptor: ActionProcedureDescriptor<"social.unblock", Schema.Struct<{
147
+ readonly otherId: Schema.NonEmptyString;
148
+ }>, Schema.Void, typeof SocialError>;
149
+
150
+ export { }
package/dist/rpc.js ADDED
@@ -0,0 +1,154 @@
1
+ import { SocialError as e } from "./errors.js";
2
+ import { RECENT_TABLE as t, RELATIONS_TABLE as n, RecentPlayerSchema as r, SETTINGS_TABLE as i, SocialRelationSchema as a, SocialSettingsSchema as o, SuggestionSchema as s } from "./contract.js";
3
+ import { Schema as c } from "effect";
4
+ import { defineAction as l, defineQuery as u } from "@voltro/protocol";
5
+ // src/rpc.ts
6
+ var d = "@voltro/plugin-social", f = "The handler requires a verified human subject and uses its tenant and identity; callers supply only intentions.", p = c.Struct({ otherId: c.NonEmptyString }), m = l({
7
+ name: "social.request",
8
+ input: p,
9
+ output: a,
10
+ error: e,
11
+ openAccess: f
12
+ }), h = l({
13
+ name: "social.accept",
14
+ input: p,
15
+ output: a,
16
+ error: e,
17
+ openAccess: f
18
+ }), g = l({
19
+ name: "social.decline",
20
+ input: p,
21
+ output: c.Void,
22
+ error: e,
23
+ openAccess: f
24
+ }), _ = l({
25
+ name: "social.cancel",
26
+ input: p,
27
+ output: c.Void,
28
+ error: e,
29
+ openAccess: f
30
+ }), v = l({
31
+ name: "social.remove",
32
+ input: p,
33
+ output: c.Void,
34
+ error: e,
35
+ openAccess: f
36
+ }), y = l({
37
+ name: "social.block",
38
+ input: p,
39
+ output: c.Void,
40
+ error: e,
41
+ openAccess: f
42
+ }), b = l({
43
+ name: "social.unblock",
44
+ input: p,
45
+ output: c.Void,
46
+ error: e,
47
+ openAccess: f
48
+ }), x = l({
49
+ name: "social.favorite",
50
+ input: c.Struct({
51
+ otherId: c.NonEmptyString,
52
+ enabled: c.Boolean
53
+ }),
54
+ output: c.Void,
55
+ error: e,
56
+ openAccess: f
57
+ }), S = l({
58
+ name: "social.setSettings",
59
+ input: c.Struct({
60
+ requestsFrom: c.optional(c.Literals([
61
+ "anyone",
62
+ "friends-of-friends",
63
+ "nobody"
64
+ ])),
65
+ showOnline: c.optional(c.Boolean),
66
+ showActivity: c.optional(c.Boolean),
67
+ allowPartyInvites: c.optional(c.Literals(["friends", "anyone"]))
68
+ }),
69
+ output: o,
70
+ error: e,
71
+ openAccess: f
72
+ }), C = u({
73
+ name: "social.settings",
74
+ input: c.Struct({}),
75
+ output: o,
76
+ source: i,
77
+ error: e,
78
+ openAccess: f
79
+ }), w = u({
80
+ name: "social.friends",
81
+ input: c.Struct({}),
82
+ output: c.Array(a),
83
+ source: n,
84
+ error: e,
85
+ openAccess: f
86
+ }), T = u({
87
+ name: "social.favorites",
88
+ input: c.Struct({}),
89
+ output: c.Array(a),
90
+ source: n,
91
+ error: e,
92
+ openAccess: f
93
+ }), E = u({
94
+ name: "social.requests",
95
+ input: c.Struct({}),
96
+ output: c.Array(a),
97
+ source: n,
98
+ error: e,
99
+ openAccess: f
100
+ }), D = u({
101
+ name: "social.blocked",
102
+ input: c.Struct({}),
103
+ output: c.Array(a),
104
+ source: n,
105
+ error: e,
106
+ openAccess: f
107
+ }), O = u({
108
+ name: "social.recent",
109
+ input: c.Struct({}),
110
+ output: c.Array(r),
111
+ source: t,
112
+ error: e,
113
+ openAccess: f
114
+ }), k = u({
115
+ name: "social.suggestions",
116
+ input: c.Struct({}),
117
+ output: c.Array(s),
118
+ source: n,
119
+ error: e,
120
+ openAccess: f
121
+ }), A = [...[
122
+ "request",
123
+ "accept",
124
+ "decline",
125
+ "cancel",
126
+ "remove",
127
+ "block",
128
+ "unblock",
129
+ "favorite",
130
+ "setSettings"
131
+ ].map((e) => ({
132
+ tag: "social." + e,
133
+ kind: "action",
134
+ import: {
135
+ module: "@voltro/plugin-social/rpc",
136
+ name: e + "Descriptor"
137
+ }
138
+ })), ...[
139
+ "settings",
140
+ "friends",
141
+ "favorites",
142
+ "requests",
143
+ "blocked",
144
+ "recent",
145
+ "suggestions"
146
+ ].map((e) => ({
147
+ tag: "social." + e,
148
+ kind: "query",
149
+ import: {
150
+ module: "@voltro/plugin-social/rpc",
151
+ name: e + "Descriptor"
152
+ }
153
+ }))];
154
+ export { d as BASE_NAME, h as acceptDescriptor, y as blockDescriptor, D as blockedDescriptor, _ as cancelDescriptor, g as declineDescriptor, x as favoriteDescriptor, T as favoritesDescriptor, w as friendsDescriptor, O as recentDescriptor, v as removeDescriptor, m as requestDescriptor, E as requestsDescriptor, S as setSettingsDescriptor, C as settingsDescriptor, A as socialRpcClientImports, k as suggestionsDescriptor, b as unblockDescriptor };
@@ -0,0 +1,69 @@
1
+ import { acceptDescriptor as e, blockDescriptor as t, blockedDescriptor as n, cancelDescriptor as r, declineDescriptor as i, favoriteDescriptor as a, favoritesDescriptor as o, friendsDescriptor as s, recentDescriptor as c, removeDescriptor as l, requestDescriptor as u, requestsDescriptor as d, setSettingsDescriptor as f, settingsDescriptor as p, suggestionsDescriptor as m, unblockDescriptor as h } from "./rpc.js";
2
+ // src/rpcRoutes.ts
3
+ var g = (g) => [
4
+ {
5
+ ...u,
6
+ execute: (e, t) => g.request(t.request.subject, e.otherId)
7
+ },
8
+ {
9
+ ...e,
10
+ execute: (e, t) => g.accept(t.request.subject, e.otherId)
11
+ },
12
+ {
13
+ ...i,
14
+ execute: (e, t) => g.decline(t.request.subject, e.otherId)
15
+ },
16
+ {
17
+ ...r,
18
+ execute: (e, t) => g.cancel(t.request.subject, e.otherId)
19
+ },
20
+ {
21
+ ...l,
22
+ execute: (e, t) => g.remove(t.request.subject, e.otherId)
23
+ },
24
+ {
25
+ ...t,
26
+ execute: (e, t) => g.block(t.request.subject, e.otherId)
27
+ },
28
+ {
29
+ ...h,
30
+ execute: (e, t) => g.unblock(t.request.subject, e.otherId)
31
+ },
32
+ {
33
+ ...a,
34
+ execute: (e, t) => g.favorite(t.request.subject, e.otherId, e.enabled)
35
+ },
36
+ {
37
+ ...f,
38
+ execute: (e, t) => g.setSettings(t.request.subject, e)
39
+ },
40
+ {
41
+ ...p,
42
+ execute: (e, t) => g.getSettings(t.request.subject)
43
+ },
44
+ {
45
+ ...s,
46
+ execute: (e, t) => g.friends(t.request.subject)
47
+ },
48
+ {
49
+ ...o,
50
+ execute: (e, t) => g.favorites(t.request.subject)
51
+ },
52
+ {
53
+ ...d,
54
+ execute: (e, t) => g.requests(t.request.subject)
55
+ },
56
+ {
57
+ ...n,
58
+ execute: (e, t) => g.blocked(t.request.subject)
59
+ },
60
+ {
61
+ ...c,
62
+ execute: (e, t) => g.recent(t.request.subject)
63
+ },
64
+ {
65
+ ...m,
66
+ execute: (e, t) => g.suggestions(t.request.subject)
67
+ }
68
+ ];
69
+ export { g as socialRpcRoutes };