@edenapp/types 0.3.0 → 0.3.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/AppManifest.d.ts CHANGED
@@ -86,6 +86,72 @@ export interface FileHandlerConfig {
86
86
  icon?: string;
87
87
  }
88
88
 
89
+ /**
90
+ * Supported setting input types
91
+ */
92
+ export type SettingType =
93
+ | "text"
94
+ | "number"
95
+ | "checkbox"
96
+ | "radio"
97
+ | "select"
98
+ | "toggle"
99
+ | "textarea"
100
+ | "color"
101
+ | "range";
102
+
103
+ /**
104
+ * Option for radio/select settings
105
+ */
106
+ export interface SettingOption {
107
+ /** Value stored when this option is selected */
108
+ value: string;
109
+ /** Display label for this option */
110
+ label: string;
111
+ /** Optional description for this option */
112
+ description?: string;
113
+ }
114
+
115
+ /**
116
+ * Individual setting definition
117
+ */
118
+ export interface SettingDefinition {
119
+ /** Unique key for this setting */
120
+ key: string;
121
+ /** Display label */
122
+ label: string;
123
+ /** Description shown as help text */
124
+ description?: string;
125
+ /** Input type */
126
+ type: SettingType;
127
+ /** Default value (as string, will be parsed based on type) */
128
+ defaultValue?: string;
129
+ /** Options for radio/select types */
130
+ options?: SettingOption[];
131
+ /** Placeholder for text/textarea */
132
+ placeholder?: string;
133
+ /** Min value for number/range */
134
+ min?: number;
135
+ /** Max value for number/range */
136
+ max?: number;
137
+ /** Step for number/range */
138
+ step?: number;
139
+ }
140
+
141
+ /**
142
+ * Settings category (group of related settings)
143
+ */
144
+ export interface SettingsCategory {
145
+ /** Category ID */
146
+ id: string;
147
+ /** Display name */
148
+ name: string;
149
+ /** Category icon (optional) */
150
+ icon?: string;
151
+ /** Settings in this category */
152
+ settings: SettingDefinition[];
153
+ }
154
+
89
155
  /**
90
156
  * App Manifest Interface
91
157
  *
@@ -195,4 +261,10 @@ export interface AppManifest {
195
261
  * optional access control via allowedClients.
196
262
  */
197
263
  services?: ServiceDeclaration[];
264
+
265
+ /**
266
+ * App settings configuration.
267
+ * Defines settings categories and individual settings that can be configured.
268
+ */
269
+ settings?: SettingsCategory[];
198
270
  }
@@ -243,7 +243,7 @@ export interface FsCommands {
243
243
  "fs/read": {
244
244
  args: {
245
245
  path: string;
246
- encoding?: BufferEncoding };
246
+ encoding?: string };
247
247
  response: string;
248
248
  };
249
249
  /**
@@ -253,7 +253,7 @@ export interface FsCommands {
253
253
  args: {
254
254
  path: string;
255
255
  content: string;
256
- encoding?: BufferEncoding };
256
+ encoding?: string };
257
257
  response: void;
258
258
  };
259
259
  /**
@@ -427,6 +427,104 @@ export interface ProcessCommands {
427
427
  };
428
428
  }
429
429
 
430
+ /**
431
+ * SettingsCommands - Commands for the "settings" namespace
432
+ */
433
+ export interface SettingsCommands {
434
+ /**
435
+ * Get a setting value (scoped to caller's app)
436
+ */
437
+ "settings/get": {
438
+ args: {
439
+ key: string };
440
+ response: { value: string | undefined };
441
+ };
442
+ /**
443
+ * Set a setting value (scoped to caller's app)
444
+ */
445
+ "settings/set": {
446
+ args: {
447
+ key: string;
448
+ value: string };
449
+ response: { success: boolean };
450
+ };
451
+ /**
452
+ * List all settings keys (scoped to caller's app)
453
+ */
454
+ "settings/list": {
455
+ args: { };
456
+ response: { keys: string[] };
457
+ };
458
+ /**
459
+ * Get all settings with values (scoped to caller's app)
460
+ */
461
+ "settings/get-all": {
462
+ args: { };
463
+ response: { settings: Record<string, string> };
464
+ };
465
+ /**
466
+ * Reset a setting to default (scoped to caller's app)
467
+ */
468
+ "settings/reset": {
469
+ args: {
470
+ key: string;
471
+ schema?: import("./index").SettingsCategory[] };
472
+ response: { success: boolean };
473
+ };
474
+ /**
475
+ * Get a setting from any app's namespace (superuser only)
476
+ */
477
+ "settings/get/su": {
478
+ args: {
479
+ appId: string;
480
+ key: string };
481
+ response: { value: string | undefined };
482
+ };
483
+ /**
484
+ * Set a setting in any app's namespace (superuser only)
485
+ */
486
+ "settings/set/su": {
487
+ args: {
488
+ appId: string;
489
+ key: string;
490
+ value: string };
491
+ response: { success: boolean };
492
+ };
493
+ /**
494
+ * List all settings in any app's namespace (superuser only)
495
+ */
496
+ "settings/list/su": {
497
+ args: {
498
+ appId: string };
499
+ response: { keys: string[] };
500
+ };
501
+ /**
502
+ * Get all settings with values for any app (superuser only)
503
+ */
504
+ "settings/get-all/su": {
505
+ args: {
506
+ appId: string };
507
+ response: { settings: Record<string, string> };
508
+ };
509
+ /**
510
+ * Reset a setting for any app (superuser only)
511
+ */
512
+ "settings/reset/su": {
513
+ args: {
514
+ appId: string;
515
+ key: string;
516
+ schema?: import("./index").SettingsCategory[] };
517
+ response: { success: boolean };
518
+ };
519
+ /**
520
+ * Get the Eden settings schema
521
+ */
522
+ "settings/schema": {
523
+ args: Record<string, never>;
524
+ response: { schema: import("./index").SettingsCategory[] };
525
+ };
526
+ }
527
+
430
528
  /**
431
529
  * ViewCommands - Commands for the "view" namespace
432
530
  */
@@ -528,4 +626,4 @@ export interface ViewCommands {
528
626
  /**
529
627
  * Global command map - merge all command namespaces
530
628
  */
531
- export interface CommandMap extends SystemCommands, AppbusCommands, DbCommands, FileCommands, FsCommands, EventCommands, NotificationCommands, PackageCommands, ProcessCommands, ViewCommands {}
629
+ export interface CommandMap extends SystemCommands, AppbusCommands, DbCommands, FileCommands, FsCommands, EventCommands, NotificationCommands, PackageCommands, ProcessCommands, SettingsCommands, ViewCommands {}
@@ -38,6 +38,13 @@ export interface ProcessEvents {
38
38
  "process/exited": { appId: string; code: number };
39
39
  }
40
40
 
41
+ /**
42
+ * SettingsEvents - Events for the "settings" namespace
43
+ */
44
+ export interface SettingsEvents {
45
+ "settings/changed": { appId: string; key: string; value: string };
46
+ }
47
+
41
48
  /**
42
49
  * ViewEvents - Events for the "view" namespace
43
50
  */
@@ -60,4 +67,4 @@ export interface ViewEvents {
60
67
  /**
61
68
  * Global event map - merge all event namespaces
62
69
  */
63
- export interface AppEvents extends FileEvents, NotificationEvents, PackageEvents, ProcessEvents, ViewEvents {}
70
+ export interface AppEvents extends FileEvents, NotificationEvents, PackageEvents, ProcessEvents, SettingsEvents, ViewEvents {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edenapp/types",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "TypeScript type definitions for the Eden platform",
5
5
  "types": "index.d.ts",
6
6
  "author": "Dariusz Majnert",
@@ -1,13 +0,0 @@
1
- /**
2
- * AUTO-GENERATED FILE - DO NOT EDIT
3
- *
4
- * Type declarations for runtime arrays.
5
- * Generated by scripts/generate-commands.ts
6
- * Run 'pnpm run codegen' to regenerate.
7
- */
8
-
9
- // Command names array
10
- export declare const COMMAND_NAMES: readonly string[];
11
-
12
- // Event names array
13
- export declare const APP_EVENT_NAMES: readonly string[];