@rimori/client 2.5.23 → 2.5.24-next.1

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.d.ts CHANGED
@@ -20,3 +20,4 @@ export { TIER_ORDER, ROLE_ORDER } from './plugin/module/PluginModule';
20
20
  export type { SharedContent, BasicSharedContent, ContentStatus } from './plugin/module/SharedContentController';
21
21
  export type { MacroAccomplishmentPayload, MicroAccomplishmentPayload } from './controller/AccomplishmentController';
22
22
  export { StorageModule } from './plugin/module/StorageModule';
23
+ export type { PublicityLevel } from './plugin/module/DbModule';
@@ -9,6 +9,7 @@ export interface Guild {
9
9
  description: string | null;
10
10
  id: string;
11
11
  isPublic: boolean;
12
+ isShadowGuild: boolean;
12
13
  name: string;
13
14
  ownerId: string;
14
15
  primaryLanguage: string;
@@ -20,6 +20,7 @@ type DbQueryBuilder<Row extends Record<string, unknown>> = Omit<PostgrestQueryBu
20
20
  count?: 'exact' | 'planned' | 'estimated';
21
21
  }): PostgrestFilterBuilder<any, any, Row, Row[], string, any, 'GET'>;
22
22
  };
23
+ export type PublicityLevel = 'own' | 'guild';
23
24
  /**
24
25
  * Database module for plugin database operations.
25
26
  * Provides access to plugin tables with automatic prefixing and schema management.
@@ -51,5 +52,16 @@ export declare class DbModule {
51
52
  * @returns The full table name.
52
53
  */
53
54
  getTableName(table: string): string;
55
+ /**
56
+ * Sets the publicity level of a plugin DB entry via the backend.
57
+ *
58
+ * - 'own' — visible only to the creator (created_by=uid, guild_id=null)
59
+ * - 'guild' — visible to all guild members (users: created_by=uid; moderators/admins: created_by=null; both with guild_id set)
60
+ *
61
+ * @param table The plugin table name (without prefix, e.g. 'pages')
62
+ * @param entryId The UUID of the entry to update
63
+ * @param publicity The desired publicity level
64
+ */
65
+ setPublicity(table: string, entryId: string, publicity: PublicityLevel): Promise<void>;
54
66
  }
55
67
  export {};
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  /**
2
11
  * Database module for plugin database operations.
3
12
  * Provides access to plugin tables with automatic prefixing and schema management.
@@ -49,4 +58,32 @@ export class DbModule {
49
58
  }
50
59
  return this.tablePrefix + '_' + table;
51
60
  }
61
+ /**
62
+ * Sets the publicity level of a plugin DB entry via the backend.
63
+ *
64
+ * - 'own' — visible only to the creator (created_by=uid, guild_id=null)
65
+ * - 'guild' — visible to all guild members (users: created_by=uid; moderators/admins: created_by=null; both with guild_id set)
66
+ *
67
+ * @param table The plugin table name (without prefix, e.g. 'pages')
68
+ * @param entryId The UUID of the entry to update
69
+ * @param publicity The desired publicity level
70
+ */
71
+ setPublicity(table, entryId, publicity) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const tableName = this.getTableName(table);
74
+ yield fetch(`${this.rimoriInfo.backendUrl}/db-entry/publicity`, {
75
+ method: 'POST',
76
+ headers: {
77
+ 'Content-Type': 'application/json',
78
+ Authorization: `Bearer ${this.rimoriInfo.token}`,
79
+ },
80
+ body: JSON.stringify({
81
+ table_name: tableName,
82
+ schema: this.rimoriInfo.dbSchema,
83
+ entry_id: entryId,
84
+ publicity,
85
+ }),
86
+ });
87
+ });
88
+ }
52
89
  }
@@ -55,6 +55,7 @@ export declare class PluginModule {
55
55
  id: string;
56
56
  name: string;
57
57
  description: string | null;
58
+ isShadowGuild: boolean;
58
59
  };
59
60
  /**
60
61
  * Register a callback to be notified when RimoriInfo is updated.
@@ -143,6 +143,7 @@ export class PluginModule {
143
143
  id: this.rimoriInfo.guild.id,
144
144
  name: this.rimoriInfo.guild.name,
145
145
  description: this.rimoriInfo.guild.description,
146
+ isShadowGuild: this.rimoriInfo.guild.isShadowGuild,
146
147
  };
147
148
  }
148
149
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimori/client",
3
- "version": "2.5.23",
3
+ "version": "2.5.24-next.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {