@things-factory/guild-overlay 10.1.315 → 10.1.316
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-client/components/guild-coin-layer.js +2 -0
- package/dist-client/overlay-state.d.ts +11 -1
- package/dist-client/overlay-state.js +30 -3
- package/dist-client/setup-guild-overlay.js +10 -1
- package/dist-server/hub-route.d.ts +6 -1
- package/dist-server/hub-route.js +4 -7
- package/dist-server/overlay-resolver.d.ts +7 -1
- package/dist-server/overlay-resolver.js +29 -5
- package/dist-server/settings.d.ts +5 -20
- package/dist-server/settings.js +7 -18
- package/package.json +7 -7
- package/translations/en.json +4 -6
- package/translations/es.json +5 -7
- package/translations/ja.json +4 -6
- package/translations/ko.json +4 -6
- package/translations/ms.json +4 -6
- package/translations/zh.json +4 -6
|
@@ -350,6 +350,8 @@ let GuildCoinLayer = class GuildCoinLayer extends localize(i18next)(LitElement)
|
|
|
350
350
|
this.showNote('purse', i18next.t('text.guild-overlay-issued', { gt: fmt(pulse.gt ?? 0) }), ISSUED_MS);
|
|
351
351
|
else if (pulse.kind === 'impact')
|
|
352
352
|
this.showNote('star', i18next.t('text.guild-overlay-impact'), NOTE_MS);
|
|
353
|
+
else if ((pulse.count ?? 1) > 1)
|
|
354
|
+
this.showNote('coin', i18next.t('text.guild-overlay-confirmed-more', { label: labelOf(pulse), count: pulse.count - 1 }), NOTE_MS);
|
|
353
355
|
else
|
|
354
356
|
this.showNote('coin', labelOf(pulse), NOTE_MS);
|
|
355
357
|
await new Promise(resolve => setTimeout(resolve, STEP_MS));
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export type Label = string | Record<string, string> | null | undefined;
|
|
2
2
|
export interface Overlay {
|
|
3
3
|
enabled: boolean;
|
|
4
|
+
/** Confirmed while the person was away from this device - shown once at the next visit. */
|
|
5
|
+
missed?: {
|
|
6
|
+
count: number;
|
|
7
|
+
kind: string;
|
|
8
|
+
label?: Label;
|
|
9
|
+
};
|
|
4
10
|
}
|
|
5
11
|
export interface Pulse {
|
|
6
12
|
kind: 'prospect' | 'verified' | 'matured' | 'issued' | 'impact' | 'skipped' | 'voided';
|
|
@@ -31,7 +37,11 @@ declare class OverlayState extends EventTarget {
|
|
|
31
37
|
overlay: Overlay;
|
|
32
38
|
choices: OverlayChoices;
|
|
33
39
|
private subscription?;
|
|
34
|
-
load(): Promise<Overlay>;
|
|
40
|
+
load(since?: string): Promise<Overlay>;
|
|
41
|
+
/** When this device last saw a coin - none on a device that never did. */
|
|
42
|
+
seenAt(): Promise<string | undefined>;
|
|
43
|
+
/** Seen up to now - what comes after shows live, or gathered at the next visit. */
|
|
44
|
+
seen(): Promise<void>;
|
|
35
45
|
loadChoices(): Promise<OverlayChoices>;
|
|
36
46
|
choose(change: Partial<OverlayChoices>): Promise<void>;
|
|
37
47
|
/** Listen for this person's coins. A pulse that moves money reloads the overlay read. */
|
|
@@ -3,6 +3,8 @@ import { client, subscribe } from '@operato/graphql';
|
|
|
3
3
|
import { i18next } from '@operato/i18n';
|
|
4
4
|
import { clientSettingStore } from '@operato/shell';
|
|
5
5
|
const CHOICES_KEY = 'guild-overlay';
|
|
6
|
+
/** When this device last saw a coin - kept on the device, as the choices are. */
|
|
7
|
+
const SEEN_KEY = 'guild-overlay-seen';
|
|
6
8
|
const DEFAULT_CHOICES = { show: true, reduceMotion: false, sound: false };
|
|
7
9
|
/** A label in the reader's language - a plain string is every language's. */
|
|
8
10
|
export function wordOf(label) {
|
|
@@ -19,16 +21,22 @@ class OverlayState extends EventTarget {
|
|
|
19
21
|
this.overlay = { enabled: false };
|
|
20
22
|
this.choices = { ...DEFAULT_CHOICES };
|
|
21
23
|
}
|
|
22
|
-
async load() {
|
|
24
|
+
async load(since) {
|
|
23
25
|
try {
|
|
24
26
|
const response = await client.query({
|
|
25
27
|
query: gql `
|
|
26
|
-
query {
|
|
27
|
-
guildOverlay {
|
|
28
|
+
query ($since: Date) {
|
|
29
|
+
guildOverlay(since: $since) {
|
|
28
30
|
enabled
|
|
31
|
+
missed {
|
|
32
|
+
count
|
|
33
|
+
kind
|
|
34
|
+
label
|
|
35
|
+
}
|
|
29
36
|
}
|
|
30
37
|
}
|
|
31
38
|
`,
|
|
39
|
+
variables: { since: since ?? null },
|
|
32
40
|
fetchPolicy: 'network-only'
|
|
33
41
|
});
|
|
34
42
|
this.overlay = response.data?.guildOverlay ?? { enabled: false };
|
|
@@ -40,6 +48,24 @@ class OverlayState extends EventTarget {
|
|
|
40
48
|
this.dispatchEvent(new Event('overlay'));
|
|
41
49
|
return this.overlay;
|
|
42
50
|
}
|
|
51
|
+
/** When this device last saw a coin - none on a device that never did. */
|
|
52
|
+
async seenAt() {
|
|
53
|
+
try {
|
|
54
|
+
return (await clientSettingStore.get(SEEN_KEY))?.value ?? undefined;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** Seen up to now - what comes after shows live, or gathered at the next visit. */
|
|
61
|
+
async seen() {
|
|
62
|
+
try {
|
|
63
|
+
await clientSettingStore.put({ key: SEEN_KEY, value: new Date().toISOString() });
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
/* Not kept on this device - the next visit shows nothing gathered. */
|
|
67
|
+
}
|
|
68
|
+
}
|
|
43
69
|
async loadChoices() {
|
|
44
70
|
try {
|
|
45
71
|
this.choices = { ...DEFAULT_CHOICES, ...((await clientSettingStore.get(CHOICES_KEY))?.value ?? {}) };
|
|
@@ -71,6 +97,7 @@ class OverlayState extends EventTarget {
|
|
|
71
97
|
if (!pulse)
|
|
72
98
|
return;
|
|
73
99
|
this.dispatchEvent(new CustomEvent('pulse', { detail: pulse }));
|
|
100
|
+
this.seen();
|
|
74
101
|
}
|
|
75
102
|
});
|
|
76
103
|
}
|
|
@@ -10,9 +10,12 @@ import { overlayState } from './overlay-state.js';
|
|
|
10
10
|
* the product's screens are as they were. On: a layer that shows nothing until one's own work earns, and the setting.
|
|
11
11
|
*/
|
|
12
12
|
let attached = false;
|
|
13
|
+
const MISSED_AFTER_MS = 1500;
|
|
13
14
|
export async function setupGuildOverlay() {
|
|
14
15
|
await overlayState.loadChoices();
|
|
15
|
-
|
|
16
|
+
/* A device that never saw a coin starts from now - nothing old comes in a pile. */
|
|
17
|
+
const since = await overlayState.seenAt();
|
|
18
|
+
const overlay = await overlayState.load(since);
|
|
16
19
|
if (!overlay.enabled)
|
|
17
20
|
return false;
|
|
18
21
|
if (attached)
|
|
@@ -24,6 +27,12 @@ export async function setupGuildOverlay() {
|
|
|
24
27
|
});
|
|
25
28
|
document.body.appendChild(document.createElement('guild-coin-layer'));
|
|
26
29
|
await overlayState.listen();
|
|
30
|
+
/* What was confirmed while away - one gathered note, a moment after the screen settles (ADR-0238 decision 15). */
|
|
31
|
+
const missed = since ? overlay.missed : undefined;
|
|
32
|
+
if (missed?.count) {
|
|
33
|
+
setTimeout(() => overlayState.dispatchEvent(new CustomEvent('pulse', { detail: { kind: 'verified', contributionKind: missed.kind, label: missed.label, count: missed.count, at: new Date().toISOString() } })), MISSED_AFTER_MS);
|
|
34
|
+
}
|
|
35
|
+
overlayState.seen();
|
|
27
36
|
return true;
|
|
28
37
|
}
|
|
29
38
|
//# sourceMappingURL=setup-guild-overlay.js.map
|
|
@@ -14,7 +14,7 @@ export interface LocalGuildHub {
|
|
|
14
14
|
id: string;
|
|
15
15
|
}, user: {
|
|
16
16
|
id: string;
|
|
17
|
-
}): Promise<GuildOverlayDigest>;
|
|
17
|
+
}, since?: Date): Promise<GuildOverlayDigest>;
|
|
18
18
|
}
|
|
19
19
|
export interface GuildProspectInput {
|
|
20
20
|
kind: string;
|
|
@@ -48,6 +48,11 @@ export interface GuildBadgeDigest {
|
|
|
48
48
|
export interface GuildOverlayDigest {
|
|
49
49
|
/** false - the host says this person does not earn (office: not an employee at work today); the overlay stays away. */
|
|
50
50
|
eligible?: boolean;
|
|
51
|
+
/** What was confirmed since the person last saw a coin on this device - shown once, gathered (design §14-1). */
|
|
52
|
+
missed?: {
|
|
53
|
+
count: number;
|
|
54
|
+
kind: string;
|
|
55
|
+
};
|
|
51
56
|
wallet?: GuildWalletDigest;
|
|
52
57
|
badges: GuildBadgeDigest[];
|
|
53
58
|
/** The contributor's GP for one of each kind by the rule in force - what a quest says one is worth. */
|
package/dist-server/hub-route.js
CHANGED
|
@@ -27,15 +27,12 @@ async function hubRoadOf(tx, domain) {
|
|
|
27
27
|
const place = await (0, settings_js_1.guildPlaceOf)(domain, tx);
|
|
28
28
|
if (!place.enabled)
|
|
29
29
|
return { kind: 'off' };
|
|
30
|
-
|
|
31
|
-
if (place.hubPeer)
|
|
32
|
-
warnOnce(`both:${domain.id}`, `domain ${domain.id}: Guild::hub and Guild::hubPeer are both set - the hub on this server is used`);
|
|
33
|
-
return { kind: 'local', hub: localHub };
|
|
34
|
-
}
|
|
35
|
-
if (place.hub && !localHub)
|
|
36
|
-
warnOnce(`nohub:${domain.id}`, `domain ${domain.id}: Guild::hub is on but this server carries no guild hub module`);
|
|
30
|
+
/* Another server named - the rewards are kept there. None - kept here, where the hub module is loaded. */
|
|
37
31
|
if (place.hubPeer)
|
|
38
32
|
return { kind: 'remote', peer: place.hubPeer };
|
|
33
|
+
if (localHub)
|
|
34
|
+
return { kind: 'local', hub: localHub };
|
|
35
|
+
warnOnce(`nohub:${domain.id}`, `domain ${domain.id}: Guild::enabled is on, but this server carries no guild hub module and Guild::hubPeer names no other server`);
|
|
39
36
|
return { kind: 'off' };
|
|
40
37
|
}
|
|
41
38
|
/** Hand records over on the road the domain's settings name. */
|
|
@@ -30,8 +30,14 @@ export declare class GuildOverlayKind {
|
|
|
30
30
|
hint?: any;
|
|
31
31
|
gpEach?: number;
|
|
32
32
|
}
|
|
33
|
+
export declare class GuildOverlayMissed {
|
|
34
|
+
count: number;
|
|
35
|
+
kind: string;
|
|
36
|
+
label?: any;
|
|
37
|
+
}
|
|
33
38
|
export declare class GuildOverlay {
|
|
34
39
|
enabled: boolean;
|
|
40
|
+
missed?: GuildOverlayMissed;
|
|
35
41
|
wallet?: GuildOverlayWallet;
|
|
36
42
|
badges: GuildOverlayBadge[];
|
|
37
43
|
quests: GuildOverlayQuest[];
|
|
@@ -53,6 +59,6 @@ export declare class GuildPulseNote {
|
|
|
53
59
|
at: string;
|
|
54
60
|
}
|
|
55
61
|
export declare class GuildOverlayResolver {
|
|
56
|
-
guildOverlay(context: ResolverContext): Promise<GuildOverlay>;
|
|
62
|
+
guildOverlay(since: Date | undefined, context: ResolverContext): Promise<GuildOverlay>;
|
|
57
63
|
guildPulse(message: GuildPulseMessage): GuildPulseNote;
|
|
58
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuildOverlayResolver = exports.GuildPulseNote = exports.GuildOverlay = exports.GuildOverlayKind = exports.GuildOverlayQuest = exports.GuildOverlayBadge = exports.GuildOverlayWallet = void 0;
|
|
3
|
+
exports.GuildOverlayResolver = exports.GuildPulseNote = exports.GuildOverlay = exports.GuildOverlayMissed = exports.GuildOverlayKind = exports.GuildOverlayQuest = exports.GuildOverlayBadge = exports.GuildOverlayWallet = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const graphql_yoga_1 = require("graphql-yoga");
|
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
|
@@ -130,6 +130,24 @@ tslib_1.__decorate([
|
|
|
130
130
|
exports.GuildOverlayKind = GuildOverlayKind = tslib_1.__decorate([
|
|
131
131
|
(0, type_graphql_1.ObjectType)({ description: 'A contribution kind and the page it happens on - the 「이 화면의 기여」 chip' })
|
|
132
132
|
], GuildOverlayKind);
|
|
133
|
+
let GuildOverlayMissed = class GuildOverlayMissed {
|
|
134
|
+
};
|
|
135
|
+
exports.GuildOverlayMissed = GuildOverlayMissed;
|
|
136
|
+
tslib_1.__decorate([
|
|
137
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
138
|
+
tslib_1.__metadata("design:type", Number)
|
|
139
|
+
], GuildOverlayMissed.prototype, "count", void 0);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, type_graphql_1.Field)({ description: 'The latest one’s kind' }),
|
|
142
|
+
tslib_1.__metadata("design:type", String)
|
|
143
|
+
], GuildOverlayMissed.prototype, "kind", void 0);
|
|
144
|
+
tslib_1.__decorate([
|
|
145
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'Its label - a string or one per language' }),
|
|
146
|
+
tslib_1.__metadata("design:type", Object)
|
|
147
|
+
], GuildOverlayMissed.prototype, "label", void 0);
|
|
148
|
+
exports.GuildOverlayMissed = GuildOverlayMissed = tslib_1.__decorate([
|
|
149
|
+
(0, type_graphql_1.ObjectType)({ description: 'What was confirmed while the person was away - one gathered note at the next visit' })
|
|
150
|
+
], GuildOverlayMissed);
|
|
133
151
|
let GuildOverlay = class GuildOverlay {
|
|
134
152
|
};
|
|
135
153
|
exports.GuildOverlay = GuildOverlay;
|
|
@@ -137,6 +155,10 @@ tslib_1.__decorate([
|
|
|
137
155
|
(0, type_graphql_1.Field)({ description: 'Guild::enabled - when off, the overlay draws nothing' }),
|
|
138
156
|
tslib_1.__metadata("design:type", Boolean)
|
|
139
157
|
], GuildOverlay.prototype, "enabled", void 0);
|
|
158
|
+
tslib_1.__decorate([
|
|
159
|
+
(0, type_graphql_1.Field)(type => GuildOverlayMissed, { nullable: true }),
|
|
160
|
+
tslib_1.__metadata("design:type", GuildOverlayMissed)
|
|
161
|
+
], GuildOverlay.prototype, "missed", void 0);
|
|
140
162
|
tslib_1.__decorate([
|
|
141
163
|
(0, type_graphql_1.Field)(type => GuildOverlayWallet, { nullable: true }),
|
|
142
164
|
tslib_1.__metadata("design:type", GuildOverlayWallet)
|
|
@@ -215,13 +237,13 @@ exports.GuildPulseNote = GuildPulseNote = tslib_1.__decorate([
|
|
|
215
237
|
(0, type_graphql_1.ObjectType)({ description: 'One movement of one person’s coins (design §14-1)' })
|
|
216
238
|
], GuildPulseNote);
|
|
217
239
|
let GuildOverlayResolver = class GuildOverlayResolver {
|
|
218
|
-
async guildOverlay(context) {
|
|
240
|
+
async guildOverlay(since, context) {
|
|
219
241
|
const { domain, user } = context.state;
|
|
220
242
|
const place = await (0, settings_js_1.guildPlaceOf)(domain);
|
|
221
243
|
if (!place.enabled)
|
|
222
244
|
return { enabled: false, badges: [], quests: [], kinds: [] };
|
|
223
245
|
const road = await (0, hub_route_js_1.hubRoadOf)(undefined, domain);
|
|
224
|
-
const digest = road.kind === 'local' && road.hub.overlayOf ? await road.hub.overlayOf(domain, user) : { badges: [], baseGp: {} };
|
|
246
|
+
const digest = road.kind === 'local' && road.hub.overlayOf ? await road.hub.overlayOf(domain, user, since ?? undefined) : { badges: [], baseGp: {} };
|
|
225
247
|
if (digest.eligible === false)
|
|
226
248
|
return { enabled: false, badges: [], quests: [], kinds: [] };
|
|
227
249
|
const gpOf = (kind) => digest.baseGp[kind];
|
|
@@ -235,6 +257,7 @@ let GuildOverlayResolver = class GuildOverlayResolver {
|
|
|
235
257
|
.map(one => ({ kind: one.kind, label: one.label, route: one.route, hint: one.prospectHint, gpEach: gpOf(one.kind) }));
|
|
236
258
|
return {
|
|
237
259
|
enabled: true,
|
|
260
|
+
missed: digest.missed ? { ...digest.missed, label: (0, define_kinds_js_1.declaredKind)(digest.missed.kind)?.kind.label } : undefined,
|
|
238
261
|
wallet: digest.wallet,
|
|
239
262
|
badges: digest.badges.map(one => ({ ...one, label: (0, define_kinds_js_1.declaredKind)(one.kind)?.kind.label })),
|
|
240
263
|
quests,
|
|
@@ -249,9 +272,10 @@ exports.GuildOverlayResolver = GuildOverlayResolver;
|
|
|
249
272
|
tslib_1.__decorate([
|
|
250
273
|
(0, type_graphql_1.Directive)('@privilege(category: "guild", privilege: "query", domainOwnerGranted: true)'),
|
|
251
274
|
(0, type_graphql_1.Query)(returns => GuildOverlay, { description: "The game overlay's read - the person's own wallet, badges and quests" }),
|
|
252
|
-
tslib_1.__param(0, (0, type_graphql_1.
|
|
275
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('since', type => Date, { nullable: true, description: 'When the person last saw a coin on this device - what was confirmed after it comes back gathered' })),
|
|
276
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
253
277
|
tslib_1.__metadata("design:type", Function),
|
|
254
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
278
|
+
tslib_1.__metadata("design:paramtypes", [Date, Object]),
|
|
255
279
|
tslib_1.__metadata("design:returntype", Promise)
|
|
256
280
|
], GuildOverlayResolver.prototype, "guildOverlay", null);
|
|
257
281
|
tslib_1.__decorate([
|
|
@@ -15,20 +15,6 @@ export declare const GUILD_SETTINGS: {
|
|
|
15
15
|
privilege: "mutation";
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
hub: {
|
|
19
|
-
name: string;
|
|
20
|
-
type: "boolean";
|
|
21
|
-
level: "domain";
|
|
22
|
-
section: "connection";
|
|
23
|
-
card: string;
|
|
24
|
-
label: string;
|
|
25
|
-
hint: string;
|
|
26
|
-
order: number;
|
|
27
|
-
write: {
|
|
28
|
-
category: string;
|
|
29
|
-
privilege: "mutation";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
18
|
hubPeer: {
|
|
33
19
|
name: string;
|
|
34
20
|
type: "string";
|
|
@@ -48,23 +34,22 @@ export declare const GUILD_SETTINGS: {
|
|
|
48
34
|
};
|
|
49
35
|
text: (domain: {
|
|
50
36
|
id: string;
|
|
51
|
-
}, key: "enabled" | "
|
|
37
|
+
}, key: "enabled" | "hubPeer", manager?: EntityManager) => Promise<string>;
|
|
52
38
|
number: (domain: {
|
|
53
39
|
id: string;
|
|
54
|
-
}, key: "enabled" | "
|
|
40
|
+
}, key: "enabled" | "hubPeer", manager?: EntityManager) => Promise<number>;
|
|
55
41
|
flag: (domain: {
|
|
56
42
|
id: string;
|
|
57
|
-
}, key: "enabled" | "
|
|
43
|
+
}, key: "enabled" | "hubPeer", manager?: EntityManager) => Promise<boolean>;
|
|
58
44
|
json: <V = unknown>(domain: {
|
|
59
45
|
id: string;
|
|
60
|
-
}, key: "enabled" | "
|
|
46
|
+
}, key: "enabled" | "hubPeer", manager?: EntityManager) => Promise<V>;
|
|
61
47
|
};
|
|
62
48
|
export interface GuildPlace {
|
|
63
49
|
enabled: boolean;
|
|
64
|
-
hub: boolean;
|
|
65
50
|
hubPeer?: string;
|
|
66
51
|
}
|
|
67
|
-
/** The
|
|
52
|
+
/** The two settings, read through the work's own manager so a test's or a door's transaction sees them. */
|
|
68
53
|
export declare function guildPlaceOf(domain: {
|
|
69
54
|
id: string;
|
|
70
55
|
}, manager?: EntityManager): Promise<GuildPlace>;
|
package/dist-server/settings.js
CHANGED
|
@@ -5,12 +5,13 @@ exports.guildPlaceOf = guildPlaceOf;
|
|
|
5
5
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
6
6
|
const setting_base_1 = require("@things-factory/setting-base");
|
|
7
7
|
/*
|
|
8
|
-
* **Where the guild is for a domain** (design §9) -
|
|
8
|
+
* **Where the guild is for a domain** (design §9) - two domain settings every application carries, declared here
|
|
9
9
|
* because every application loads this module and only some load the hub.
|
|
10
10
|
*
|
|
11
11
|
* - `Guild::enabled` - off, the application sends nothing and draws nothing; its screens stay as they are.
|
|
12
|
-
* - `Guild::
|
|
13
|
-
*
|
|
12
|
+
* - `Guild::hubPeer` - the rewards are kept on another server: facts go out on the webhook outbox to this peer.
|
|
13
|
+
* Empty, they are kept on this server - where the hub module is loaded, nothing else to switch on (사용자
|
|
14
|
+
* 2026-11-27: 「"이 서버의 허브 사용" 이 말을 쉽게 이해할 수가 있냐」 - the `Guild::hub` switch is gone).
|
|
14
15
|
*
|
|
15
16
|
* They are changed by whoever runs the guild (`guild-admin`).
|
|
16
17
|
*/
|
|
@@ -27,17 +28,6 @@ exports.GUILD_SETTINGS = (0, setting_base_1.declareDomainSettings)('guild-overla
|
|
|
27
28
|
order: 1,
|
|
28
29
|
write: { category: 'guild-admin', privilege: 'mutation' }
|
|
29
30
|
},
|
|
30
|
-
hub: {
|
|
31
|
-
name: 'Guild::hub',
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
level: 'domain',
|
|
34
|
-
section: 'connection',
|
|
35
|
-
card: 'title.guild',
|
|
36
|
-
label: 'label.guild-hub',
|
|
37
|
-
hint: 'text.guild-hub-hint',
|
|
38
|
-
order: 2,
|
|
39
|
-
write: { category: 'guild-admin', privilege: 'mutation' }
|
|
40
|
-
},
|
|
41
31
|
hubPeer: {
|
|
42
32
|
name: 'Guild::hubPeer',
|
|
43
33
|
type: 'string',
|
|
@@ -52,13 +42,12 @@ exports.GUILD_SETTINGS = (0, setting_base_1.declareDomainSettings)('guild-overla
|
|
|
52
42
|
write: { category: 'guild-admin', privilege: 'mutation' }
|
|
53
43
|
}
|
|
54
44
|
});
|
|
55
|
-
/** The
|
|
45
|
+
/** The two settings, read through the work's own manager so a test's or a door's transaction sees them. */
|
|
56
46
|
async function guildPlaceOf(domain, manager) {
|
|
57
47
|
const enabled = await exports.GUILD_SETTINGS.flag(domain, 'enabled', manager);
|
|
58
48
|
if (!enabled)
|
|
59
|
-
return { enabled: false
|
|
60
|
-
const hub = await exports.GUILD_SETTINGS.flag(domain, 'hub', manager);
|
|
49
|
+
return { enabled: false };
|
|
61
50
|
const hubPeer = (await exports.GUILD_SETTINGS.text(domain, 'hubPeer', manager)) || undefined;
|
|
62
|
-
return { enabled,
|
|
51
|
+
return { enabled, ...(hubPeer ? { hubPeer } : {}) };
|
|
63
52
|
}
|
|
64
53
|
//# sourceMappingURL=settings.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/guild-overlay",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.316",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist-client",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"test": "npm run build:server && node --import ./test/resolve-ts-siblings.mjs --test test/*.test.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@things-factory/auth-base": "^10.1.
|
|
43
|
+
"@things-factory/auth-base": "^10.1.316",
|
|
44
44
|
"@things-factory/env": "^10.1.298",
|
|
45
|
-
"@things-factory/fact-change": "^10.1.
|
|
46
|
-
"@things-factory/setting-base": "^10.1.
|
|
45
|
+
"@things-factory/fact-change": "^10.1.316",
|
|
46
|
+
"@things-factory/setting-base": "^10.1.316",
|
|
47
47
|
"@things-factory/shell": "^10.1.304",
|
|
48
|
-
"@things-factory/webhook": "^10.1.
|
|
49
|
-
"@things-factory/worklist": "^10.1.
|
|
48
|
+
"@things-factory/webhook": "^10.1.316",
|
|
49
|
+
"@things-factory/worklist": "^10.1.316"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "8bdf4ae696ae7ec9c21312485f86f212052bb10a"
|
|
52
52
|
}
|
package/translations/en.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"label.guild-enabled": "Use contribution rewards",
|
|
3
|
-
"label.guild-hub": "
|
|
4
|
-
"label.guild-hub-peer": "Webhook peer of the hub on another server",
|
|
3
|
+
"label.guild-hub-peer": "Server that keeps the rewards, if not this one",
|
|
5
4
|
"label.guild-overlay-reduce-motion": "Reduce motion",
|
|
6
5
|
"label.guild-overlay-show": "Show coins",
|
|
7
6
|
"label.guild-overlay-sound": "Sound",
|
|
8
|
-
"text.guild-enabled-hint": "
|
|
9
|
-
"text.guild-hub-hint": "
|
|
10
|
-
"text.guild-hub-peer-hint": "The peer's name when the hub is on another server. Its address is kept on the webhook destination.",
|
|
7
|
+
"text.guild-enabled-hint": "On: each time someone’s work is confirmed they earn reward points, and a small coin shows for a moment at the top right. Off: no points, no coins.",
|
|
8
|
+
"text.guild-hub-peer-hint": "Usually leave it empty - then this server keeps the rewards. Fill it in only when another server keeps this app’s rewards, with that server’s connection name.",
|
|
11
9
|
"text.guild-overlay-confirmed": "Record confirmed",
|
|
12
10
|
"text.guild-overlay-confirmed-more": "{label} and {count} more",
|
|
13
11
|
"text.guild-overlay-impact": "Your record was put to use",
|
|
14
12
|
"text.guild-overlay-issued": "{gt} GT acquired",
|
|
15
13
|
"text.guild-overlay-setting-note": "Your coins and balance are shown to you alone.",
|
|
16
|
-
"title.guild": "Contribution rewards
|
|
14
|
+
"title.guild": "Contribution rewards",
|
|
17
15
|
"title.guild-overlay-setting": "Guild coins"
|
|
18
16
|
}
|
package/translations/es.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"label.guild-enabled": "Usar recompensas
|
|
3
|
-
"label.guild-hub": "
|
|
4
|
-
"label.guild-hub-peer": "Par de webhook del centro en otro servidor",
|
|
2
|
+
"label.guild-enabled": "Usar recompensas por contribución",
|
|
3
|
+
"label.guild-hub-peer": "Servidor que guarda las recompensas, si no es este",
|
|
5
4
|
"label.guild-overlay-reduce-motion": "Reducir el movimiento",
|
|
6
5
|
"label.guild-overlay-show": "Mostrar monedas",
|
|
7
6
|
"label.guild-overlay-sound": "Sonido",
|
|
8
|
-
"text.guild-enabled-hint": "
|
|
9
|
-
"text.guild-hub-hint": "
|
|
10
|
-
"text.guild-hub-peer-hint": "El nombre del par cuando el centro está en otro servidor. Su dirección se guarda en el destino del webhook.",
|
|
7
|
+
"text.guild-enabled-hint": "Activado: cada vez que se confirma el trabajo de alguien, acumula puntos y aparece un instante una pequeña moneda arriba a la derecha. Desactivado: ni puntos ni monedas.",
|
|
8
|
+
"text.guild-hub-peer-hint": "Normalmente déjalo vacío: entonces este servidor guarda las recompensas. Rellénalo solo si otro servidor guarda las recompensas de esta app, con el nombre de conexión de ese servidor.",
|
|
11
9
|
"text.guild-overlay-confirmed": "Registro confirmado",
|
|
12
10
|
"text.guild-overlay-confirmed-more": "{label} y {count} más",
|
|
13
11
|
"text.guild-overlay-impact": "Tu registro se aprovechó",
|
|
14
12
|
"text.guild-overlay-issued": "{gt} GT obtenidos",
|
|
15
13
|
"text.guild-overlay-setting-note": "Tus monedas y tu saldo solo los ves tú.",
|
|
16
|
-
"title.guild": "Recompensas
|
|
14
|
+
"title.guild": "Recompensas por contribución",
|
|
17
15
|
"title.guild-overlay-setting": "Monedas del gremio"
|
|
18
16
|
}
|
package/translations/ja.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"label.guild-enabled": "貢献報酬を使う",
|
|
3
|
-
"label.guild-hub": "
|
|
4
|
-
"label.guild-hub-peer": "別サーバーのハブの webhook 相手名",
|
|
3
|
+
"label.guild-hub-peer": "報酬を別のサーバーで管理する場合のサーバー",
|
|
5
4
|
"label.guild-overlay-reduce-motion": "動きを減らす",
|
|
6
5
|
"label.guild-overlay-show": "コインを表示",
|
|
7
6
|
"label.guild-overlay-sound": "サウンド",
|
|
8
|
-
"text.guild-enabled-hint": "
|
|
9
|
-
"text.guild-hub-hint": "
|
|
10
|
-
"text.guild-hub-peer-hint": "ハブが別サーバーにある場合の相手名です。宛先アドレスは webhook の宛先に置きます。",
|
|
7
|
+
"text.guild-enabled-hint": "オンにすると、社員の仕事が確認されるたびに報酬ポイントがたまり、画面右上に小さなコインが少しの間表示されます。オフにするとポイントもコインもありません。",
|
|
8
|
+
"text.guild-hub-peer-hint": "通常は空欄のままにします。空欄ならこのサーバーで報酬を管理します。このアプリの報酬を別のサーバーでまとめて管理するときだけ、そのサーバーの接続名を入れます。",
|
|
11
9
|
"text.guild-overlay-confirmed": "記録確認",
|
|
12
10
|
"text.guild-overlay-confirmed-more": "{label} ほか {count} 件",
|
|
13
11
|
"text.guild-overlay-impact": "記録が活用された",
|
|
14
12
|
"text.guild-overlay-issued": "{gt} GT 獲得",
|
|
15
13
|
"text.guild-overlay-setting-note": "コインと残高はあなたにだけ表示されます。",
|
|
16
|
-
"title.guild": "
|
|
14
|
+
"title.guild": "貢献報酬",
|
|
17
15
|
"title.guild-overlay-setting": "ギルドコイン"
|
|
18
16
|
}
|
package/translations/ko.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"label.guild-enabled": "기여 보상 사용",
|
|
3
|
-
"label.guild-hub": "
|
|
4
|
-
"label.guild-hub-peer": "다른 서버 허브의 webhook 상대 이름",
|
|
3
|
+
"label.guild-hub-peer": "보상을 다른 서버에서 관리할 때, 그 서버",
|
|
5
4
|
"label.guild-overlay-reduce-motion": "움직임 줄이기",
|
|
6
5
|
"label.guild-overlay-show": "코인 표시",
|
|
7
6
|
"label.guild-overlay-sound": "소리",
|
|
8
|
-
"text.guild-enabled-hint": "
|
|
9
|
-
"text.guild-hub-hint": "
|
|
10
|
-
"text.guild-hub-peer-hint": "허브가 다른 서버에 있을 때 그 상대 이름. 목적지 주소는 webhook 목적지에 둡니다.",
|
|
7
|
+
"text.guild-enabled-hint": "켜면 직원이 한 일이 확인될 때마다 보상 점수가 쌓이고, 화면 오른쪽 위에 작은 코인이 잠깐 나타납니다. 끄면 점수도 코인도 없습니다.",
|
|
8
|
+
"text.guild-hub-peer-hint": "보통은 비워 둡니다. 비워 두면 이 서버에서 보상을 관리합니다. 이 앱의 보상을 다른 서버에서 함께 관리할 때만 그 서버의 연결 이름을 적습니다.",
|
|
11
9
|
"text.guild-overlay-confirmed": "기록 확인",
|
|
12
10
|
"text.guild-overlay-confirmed-more": "{label} 외 {count}건",
|
|
13
11
|
"text.guild-overlay-impact": "내 기록 활용됨",
|
|
14
12
|
"text.guild-overlay-issued": "{gt} GT 획득",
|
|
15
13
|
"text.guild-overlay-setting-note": "내 코인과 잔액은 나에게만 보여요.",
|
|
16
|
-
"title.guild": "기여 보상
|
|
14
|
+
"title.guild": "기여 보상",
|
|
17
15
|
"title.guild-overlay-setting": "길드 코인"
|
|
18
16
|
}
|
package/translations/ms.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"label.guild-enabled": "Guna ganjaran sumbangan",
|
|
3
|
-
"label.guild-hub": "
|
|
4
|
-
"label.guild-hub-peer": "Rakan webhook bagi hab pada pelayan lain",
|
|
3
|
+
"label.guild-hub-peer": "Pelayan yang menyimpan ganjaran, jika bukan yang ini",
|
|
5
4
|
"label.guild-overlay-reduce-motion": "Kurangkan gerakan",
|
|
6
5
|
"label.guild-overlay-show": "Tunjukkan syiling",
|
|
7
6
|
"label.guild-overlay-sound": "Bunyi",
|
|
8
|
-
"text.guild-enabled-hint": "
|
|
9
|
-
"text.guild-hub-hint": "
|
|
10
|
-
"text.guild-hub-peer-hint": "Nama rakan apabila hab berada pada pelayan lain. Alamatnya disimpan pada destinasi webhook.",
|
|
7
|
+
"text.guild-enabled-hint": "Hidup: setiap kali kerja seseorang disahkan, mata ganjaran terkumpul dan syiling kecil muncul seketika di atas kanan. Mati: tiada mata, tiada syiling.",
|
|
8
|
+
"text.guild-hub-peer-hint": "Biasanya biarkan kosong - pelayan ini yang menyimpan ganjaran. Isi hanya apabila pelayan lain menyimpan ganjaran aplikasi ini, dengan nama sambungan pelayan itu.",
|
|
11
9
|
"text.guild-overlay-confirmed": "Rekod disahkan",
|
|
12
10
|
"text.guild-overlay-confirmed-more": "{label} dan {count} lagi",
|
|
13
11
|
"text.guild-overlay-impact": "Rekod anda digunakan",
|
|
14
12
|
"text.guild-overlay-issued": "{gt} GT diperoleh",
|
|
15
13
|
"text.guild-overlay-setting-note": "Syiling dan baki anda hanya dipaparkan kepada anda.",
|
|
16
|
-
"title.guild": "Ganjaran sumbangan
|
|
14
|
+
"title.guild": "Ganjaran sumbangan",
|
|
17
15
|
"title.guild-overlay-setting": "Syiling guild"
|
|
18
16
|
}
|
package/translations/zh.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"label.guild-enabled": "使用贡献奖励",
|
|
3
|
-
"label.guild-hub": "
|
|
4
|
-
"label.guild-hub-peer": "其他服务器中心的 webhook 对端名称",
|
|
3
|
+
"label.guild-hub-peer": "在其他服务器管理奖励时的服务器",
|
|
5
4
|
"label.guild-overlay-reduce-motion": "减少动画",
|
|
6
5
|
"label.guild-overlay-show": "显示硬币",
|
|
7
6
|
"label.guild-overlay-sound": "声音",
|
|
8
|
-
"text.guild-enabled-hint": "
|
|
9
|
-
"text.guild-hub-hint": "
|
|
10
|
-
"text.guild-hub-peer-hint": "中心在其他服务器时的对端名称。目标地址保存在 webhook 目标中。",
|
|
7
|
+
"text.guild-enabled-hint": "开启后,员工的工作每被确认一次就会累积奖励积分,屏幕右上角会短暂出现一枚小硬币。关闭后既没有积分也没有硬币。",
|
|
8
|
+
"text.guild-hub-peer-hint": "通常留空。留空时由本服务器管理奖励。只有当本应用的奖励由其他服务器统一管理时,才填写那台服务器的连接名称。",
|
|
11
9
|
"text.guild-overlay-confirmed": "记录已确认",
|
|
12
10
|
"text.guild-overlay-confirmed-more": "{label} 等 {count} 项",
|
|
13
11
|
"text.guild-overlay-impact": "你的记录被采用",
|
|
14
12
|
"text.guild-overlay-issued": "获得 {gt} GT",
|
|
15
13
|
"text.guild-overlay-setting-note": "你的硬币和余额只对你显示。",
|
|
16
|
-
"title.guild": "
|
|
14
|
+
"title.guild": "贡献奖励",
|
|
17
15
|
"title.guild-overlay-setting": "公会硬币"
|
|
18
16
|
}
|