@fluid-app/fluid-cli-themes 0.1.338 → 0.1.340

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.
@@ -1,6 +1,6 @@
1
1
  // primary.ts — AUTO-GENERATED, DO NOT EDIT
2
2
  import { Command } from "commander";
3
- import type { CommandContext } from "@fluid-app/fluid-cli";
3
+ import { declareInputs, type CommandContext } from "@fluid-app/fluid-cli";
4
4
 
5
5
  function parseBooleanOption(value: string, flag: string): boolean {
6
6
  const normalized = value.trim().toLowerCase();
@@ -11,7 +11,7 @@ function parseBooleanOption(value: string, flag: string): boolean {
11
11
 
12
12
  export function registerPrimary(parent: Command, ctx: CommandContext): void {
13
13
 
14
- parent
14
+ declareInputs(parent
15
15
  .command("list")
16
16
  .description("List application themes")
17
17
  .option("--page <value>", "Page number for pagination")
@@ -28,9 +28,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
28
28
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes` + "\n");
29
29
  const result = await client.get(`/api/application_themes`, params);
30
30
  ctx.output(result);
31
- });
31
+ }), () => []);
32
32
 
33
- parent
33
+ declareInputs(parent
34
34
  .command("create")
35
35
  .description("Create an application theme")
36
36
  .option("--body <json>", "Request body as JSON string")
@@ -39,17 +39,16 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
39
39
  const client = await ctx.getClient();
40
40
  let body: unknown;
41
41
  if (opts.bodyFile) {
42
- const { readFileSync } = await import("fs");
43
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
42
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
44
43
  } else if (opts.body) {
45
44
  body = ctx.parseBody(opts.body);
46
45
  }
47
46
  if (ctx.verbose) process.stderr.write("POST " + `/api/application_themes` + "\n");
48
47
  const result = await client.post(`/api/application_themes`, body);
49
48
  ctx.output(result);
50
- });
49
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
51
50
 
52
- parent
51
+ declareInputs(parent
53
52
  .command("get <id>")
54
53
  .description("Get an application theme")
55
54
  .option("--version <value>", "Version of the theme to retrieve")
@@ -60,9 +59,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
60
59
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes/${id}` + "\n");
61
60
  const result = await client.get(`/api/application_themes/${id}`, params);
62
61
  ctx.output(result);
63
- });
62
+ }), () => []);
64
63
 
65
- parent
64
+ declareInputs(parent
66
65
  .command("update <id>")
67
66
  .description("Update an application theme")
68
67
  .option("--body <json>", "Request body as JSON string")
@@ -71,17 +70,16 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
71
70
  const client = await ctx.getClient();
72
71
  let body: unknown;
73
72
  if (opts.bodyFile) {
74
- const { readFileSync } = await import("fs");
75
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
73
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
76
74
  } else if (opts.body) {
77
75
  body = ctx.parseBody(opts.body);
78
76
  }
79
77
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/application_themes/${id}` + "\n");
80
78
  const result = await client.patch(`/api/application_themes/${id}`, body);
81
79
  ctx.output(result);
82
- });
80
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
83
81
 
84
- parent
82
+ declareInputs(parent
85
83
  .command("delete <id>")
86
84
  .description("Delete an application theme")
87
85
  .action(async (id) => {
@@ -89,9 +87,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
89
87
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/application_themes/${id}` + "\n");
90
88
  const result = await client.delete(`/api/application_themes/${id}`);
91
89
  ctx.output(result);
92
- });
90
+ }), () => []);
93
91
 
94
- parent
92
+ declareInputs(parent
95
93
  .command("clone <id>")
96
94
  .description("Clone an application theme")
97
95
  .action(async (id) => {
@@ -99,9 +97,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
99
97
  if (ctx.verbose) process.stderr.write("POST " + `/api/application_themes/${id}/clone` + "\n");
100
98
  const result = await client.post(`/api/application_themes/${id}/clone`);
101
99
  ctx.output(result);
102
- });
100
+ }), () => []);
103
101
 
104
- parent
102
+ declareInputs(parent
105
103
  .command("get-theme-assets <id>")
106
104
  .description("Get theme assets")
107
105
  .action(async (id) => {
@@ -109,9 +107,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
109
107
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes/${id}/theme_assets` + "\n");
110
108
  const result = await client.get(`/api/application_themes/${id}/theme_assets`);
111
109
  ctx.output(result);
112
- });
110
+ }), () => []);
113
111
 
114
- parent
112
+ declareInputs(parent
115
113
  .command("get-active")
116
114
  .description("Get current active application theme")
117
115
  .action(async () => {
@@ -119,9 +117,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
119
117
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes/active` + "\n");
120
118
  const result = await client.get(`/api/application_themes/active`);
121
119
  ctx.output(result);
122
- });
120
+ }), () => []);
123
121
 
124
- parent
122
+ declareInputs(parent
125
123
  .command("import <id>")
126
124
  .description("Import an application theme")
127
125
  .action(async (id) => {
@@ -129,9 +127,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
129
127
  if (ctx.verbose) process.stderr.write("POST " + `/api/application_themes/${id}/import` + "\n");
130
128
  const result = await client.post(`/api/application_themes/${id}/import`);
131
129
  ctx.output(result);
132
- });
130
+ }), () => []);
133
131
 
134
- parent
132
+ declareInputs(parent
135
133
  .command("export <id>")
136
134
  .description("Export an application theme")
137
135
  .action(async (id) => {
@@ -139,9 +137,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
139
137
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes/${id}/export` + "\n");
140
138
  const result = await client.get(`/api/application_themes/${id}/export`);
141
139
  ctx.output(result);
142
- });
140
+ }), () => []);
143
141
 
144
- parent
142
+ declareInputs(parent
145
143
  .command("import-from-zip")
146
144
  .description("Import an application theme from zip file")
147
145
  .option("--body <json>", "Request body as JSON string")
@@ -150,17 +148,16 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
150
148
  const client = await ctx.getClient();
151
149
  let body: unknown;
152
150
  if (opts.bodyFile) {
153
- const { readFileSync } = await import("fs");
154
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
151
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
155
152
  } else if (opts.body) {
156
153
  body = ctx.parseBody(opts.body);
157
154
  }
158
155
  if (ctx.verbose) process.stderr.write("POST " + `/api/application_themes/import_zip` + "\n");
159
156
  const result = await client.post(`/api/application_themes/import_zip`, body);
160
157
  ctx.output(result);
161
- });
158
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
162
159
 
163
- parent
160
+ declareInputs(parent
164
161
  .command("version-diff <id>")
165
162
  .description("Gets version diff information")
166
163
  .option("--version <value>", "Version number to compare with")
@@ -171,9 +168,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
171
168
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes/${id}/version_diff` + "\n");
172
169
  const result = await client.get(`/api/application_themes/${id}/version_diff`, params);
173
170
  ctx.output(result);
174
- });
171
+ }), () => []);
175
172
 
176
- parent
173
+ declareInputs(parent
177
174
  .command("publish <id>")
178
175
  .description("Publishes the theme")
179
176
  .option("--version <value>", "Version of the theme template to publish. If not specified, the latest version will be published.")
@@ -184,9 +181,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
184
181
  if (ctx.verbose) process.stderr.write("POST " + `/api/application_themes/${id}/publish` + "\n");
185
182
  const result = await client.post(`/api/application_themes/${id}/publish`, undefined, { params });
186
183
  ctx.output(result);
187
- });
184
+ }), () => []);
188
185
 
189
- parent
186
+ declareInputs(parent
190
187
  .command("upgrade <id>")
191
188
  .description("Upgrade an application theme")
192
189
  .action(async (id) => {
@@ -194,9 +191,9 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
194
191
  if (ctx.verbose) process.stderr.write("POST " + `/api/application_themes/${id}/upgrade` + "\n");
195
192
  const result = await client.post(`/api/application_themes/${id}/upgrade`);
196
193
  ctx.output(result);
197
- });
194
+ }), () => []);
198
195
 
199
- parent
196
+ declareInputs(parent
200
197
  .command("available-themeables <id>")
201
198
  .description("Returns available themeables for a given type scoped to the theme's company")
202
199
  .option("--themeable <value>", "The themeable type to list (e.g. product, medium, page)")
@@ -213,6 +210,6 @@ export function registerPrimary(parent: Command, ctx: CommandContext): void {
213
210
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes/${id}/available_themeables` + "\n");
214
211
  const result = await client.get(`/api/application_themes/${id}/available_themeables`, params);
215
212
  ctx.output(result);
216
- });
213
+ }), () => []);
217
214
 
218
215
  }
@@ -1,6 +1,6 @@
1
1
  // region-rules.ts — AUTO-GENERATED, DO NOT EDIT
2
2
  import { Command } from "commander";
3
- import type { CommandContext } from "@fluid-app/fluid-cli";
3
+ import { declareInputs, type CommandContext } from "@fluid-app/fluid-cli";
4
4
 
5
5
  function parseBooleanOption(value: string, flag: string): boolean {
6
6
  const normalized = value.trim().toLowerCase();
@@ -12,7 +12,7 @@ function parseBooleanOption(value: string, flag: string): boolean {
12
12
  export function registerRegionRules(parent: Command, ctx: CommandContext): void {
13
13
  const resource = parent.command("region-rules").description("region-rules");
14
14
 
15
- resource
15
+ declareInputs(resource
16
16
  .command("list")
17
17
  .description("List theme region rules")
18
18
  .option("--company-id <value>", "Filter by company ID")
@@ -35,9 +35,9 @@ export function registerRegionRules(parent: Command, ctx: CommandContext): void
35
35
  if (ctx.verbose) process.stderr.write("GET " + `/api/theme_region_rules` + "\n");
36
36
  const result = await client.get(`/api/theme_region_rules`, params);
37
37
  ctx.output(result);
38
- });
38
+ }), () => []);
39
39
 
40
- resource
40
+ declareInputs(resource
41
41
  .command("create")
42
42
  .description("Create theme region rule")
43
43
  .option("--body <json>", "Request body as JSON string")
@@ -46,17 +46,16 @@ export function registerRegionRules(parent: Command, ctx: CommandContext): void
46
46
  const client = await ctx.getClient();
47
47
  let body: unknown;
48
48
  if (opts.bodyFile) {
49
- const { readFileSync } = await import("fs");
50
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
49
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
51
50
  } else if (opts.body) {
52
51
  body = ctx.parseBody(opts.body);
53
52
  }
54
53
  if (ctx.verbose) process.stderr.write("POST " + `/api/theme_region_rules` + "\n");
55
54
  const result = await client.post(`/api/theme_region_rules`, body);
56
55
  ctx.output(result);
57
- });
56
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
58
57
 
59
- resource
58
+ declareInputs(resource
60
59
  .command("get <id>")
61
60
  .description("Show theme region rule")
62
61
  .action(async (id) => {
@@ -64,9 +63,9 @@ export function registerRegionRules(parent: Command, ctx: CommandContext): void
64
63
  if (ctx.verbose) process.stderr.write("GET " + `/api/theme_region_rules/${id}` + "\n");
65
64
  const result = await client.get(`/api/theme_region_rules/${id}`);
66
65
  ctx.output(result);
67
- });
66
+ }), () => []);
68
67
 
69
- resource
68
+ declareInputs(resource
70
69
  .command("update <id>")
71
70
  .description("Update theme region rule")
72
71
  .option("--body <json>", "Request body as JSON string")
@@ -75,17 +74,16 @@ export function registerRegionRules(parent: Command, ctx: CommandContext): void
75
74
  const client = await ctx.getClient();
76
75
  let body: unknown;
77
76
  if (opts.bodyFile) {
78
- const { readFileSync } = await import("fs");
79
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
77
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
80
78
  } else if (opts.body) {
81
79
  body = ctx.parseBody(opts.body);
82
80
  }
83
81
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/theme_region_rules/${id}` + "\n");
84
82
  const result = await client.patch(`/api/theme_region_rules/${id}`, body);
85
83
  ctx.output(result);
86
- });
84
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
87
85
 
88
- resource
86
+ declareInputs(resource
89
87
  .command("delete <id>")
90
88
  .description("Delete theme region rule")
91
89
  .action(async (id) => {
@@ -93,6 +91,6 @@ export function registerRegionRules(parent: Command, ctx: CommandContext): void
93
91
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/theme_region_rules/${id}` + "\n");
94
92
  const result = await client.delete(`/api/theme_region_rules/${id}`);
95
93
  ctx.output(result);
96
- });
94
+ }), () => []);
97
95
 
98
96
  }
@@ -1,11 +1,11 @@
1
1
  // resources.ts — AUTO-GENERATED, DO NOT EDIT
2
2
  import { Command } from "commander";
3
- import type { CommandContext } from "@fluid-app/fluid-cli";
3
+ import { declareInputs, type CommandContext } from "@fluid-app/fluid-cli";
4
4
 
5
5
  export function registerResources(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("resources").description("resources");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("get <application-theme-id>")
10
10
  .description("Lists all theme resources")
11
11
  .action(async (applicationThemeId) => {
@@ -13,9 +13,9 @@ export function registerResources(parent: Command, ctx: CommandContext): void {
13
13
  if (ctx.verbose) process.stderr.write("GET " + `/api/application_themes/${applicationThemeId}/resources` + "\n");
14
14
  const result = await client.get(`/api/application_themes/${applicationThemeId}/resources`);
15
15
  ctx.output(result);
16
- });
16
+ }), () => []);
17
17
 
18
- resource
18
+ declareInputs(resource
19
19
  .command("update <application-theme-id>")
20
20
  .description("Updates a theme resource")
21
21
  .option("--body <json>", "Request body as JSON string")
@@ -24,17 +24,16 @@ export function registerResources(parent: Command, ctx: CommandContext): void {
24
24
  const client = await ctx.getClient();
25
25
  let body: unknown;
26
26
  if (opts.bodyFile) {
27
- const { readFileSync } = await import("fs");
28
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
27
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
29
28
  } else if (opts.body) {
30
29
  body = ctx.parseBody(opts.body);
31
30
  }
32
31
  if (ctx.verbose) process.stderr.write("PUT " + `/api/application_themes/${applicationThemeId}/resources` + "\n");
33
32
  const result = await client.put(`/api/application_themes/${applicationThemeId}/resources`, body);
34
33
  ctx.output(result);
35
- });
34
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
36
35
 
37
- resource
36
+ declareInputs(resource
38
37
  .command("delete <application-theme-id>")
39
38
  .description("Deletes a theme resource")
40
39
  .option("--body <json>", "Request body as JSON string")
@@ -43,14 +42,13 @@ export function registerResources(parent: Command, ctx: CommandContext): void {
43
42
  const client = await ctx.getClient();
44
43
  let body: unknown;
45
44
  if (opts.bodyFile) {
46
- const { readFileSync } = await import("fs");
47
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
45
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
48
46
  } else if (opts.body) {
49
47
  body = ctx.parseBody(opts.body);
50
48
  }
51
49
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/application_themes/${applicationThemeId}/resources` + "\n");
52
50
  const result = await client.delete(`/api/application_themes/${applicationThemeId}/resources`, { body });
53
51
  ctx.output(result);
54
- });
52
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
55
53
 
56
54
  }
@@ -1,11 +1,11 @@
1
1
  // root-themes.ts — AUTO-GENERATED, DO NOT EDIT
2
2
  import { Command } from "commander";
3
- import type { CommandContext } from "@fluid-app/fluid-cli";
3
+ import { declareInputs, type CommandContext } from "@fluid-app/fluid-cli";
4
4
 
5
5
  export function registerRootThemes(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("root-themes").description("root-themes");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("list")
10
10
  .description("List root themes")
11
11
  .option("--page <value>", "Page number for pagination")
@@ -22,9 +22,9 @@ export function registerRootThemes(parent: Command, ctx: CommandContext): void {
22
22
  if (ctx.verbose) process.stderr.write("GET " + `/api/root_themes` + "\n");
23
23
  const result = await client.get(`/api/root_themes`, params);
24
24
  ctx.output(result);
25
- });
25
+ }), () => []);
26
26
 
27
- resource
27
+ declareInputs(resource
28
28
  .command("create")
29
29
  .description("Create a root theme")
30
30
  .option("--body <json>", "Request body as JSON string")
@@ -33,17 +33,16 @@ export function registerRootThemes(parent: Command, ctx: CommandContext): void {
33
33
  const client = await ctx.getClient();
34
34
  let body: unknown;
35
35
  if (opts.bodyFile) {
36
- const { readFileSync } = await import("fs");
37
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
36
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
38
37
  } else if (opts.body) {
39
38
  body = ctx.parseBody(opts.body);
40
39
  }
41
40
  if (ctx.verbose) process.stderr.write("POST " + `/api/root_themes` + "\n");
42
41
  const result = await client.post(`/api/root_themes`, body);
43
42
  ctx.output(result);
44
- });
43
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
45
44
 
46
- resource
45
+ declareInputs(resource
47
46
  .command("list-company")
48
47
  .description("List company root themes")
49
48
  .option("--page <value>", "Page number for pagination")
@@ -58,9 +57,9 @@ export function registerRootThemes(parent: Command, ctx: CommandContext): void {
58
57
  if (ctx.verbose) process.stderr.write("GET " + `/api/root_themes/my` + "\n");
59
58
  const result = await client.get(`/api/root_themes/my`, params);
60
59
  ctx.output(result);
61
- });
60
+ }), () => []);
62
61
 
63
- resource
62
+ declareInputs(resource
64
63
  .command("update <id>")
65
64
  .description("Update a root theme")
66
65
  .option("--body <json>", "Request body as JSON string")
@@ -69,17 +68,16 @@ export function registerRootThemes(parent: Command, ctx: CommandContext): void {
69
68
  const client = await ctx.getClient();
70
69
  let body: unknown;
71
70
  if (opts.bodyFile) {
72
- const { readFileSync } = await import("fs");
73
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
71
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
74
72
  } else if (opts.body) {
75
73
  body = ctx.parseBody(opts.body);
76
74
  }
77
75
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/root_themes/${id}` + "\n");
78
76
  const result = await client.patch(`/api/root_themes/${id}`, body);
79
77
  ctx.output(result);
80
- });
78
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
81
79
 
82
- resource
80
+ declareInputs(resource
83
81
  .command("delete <id>")
84
82
  .description("Delete a root theme")
85
83
  .action(async (id) => {
@@ -87,9 +85,9 @@ export function registerRootThemes(parent: Command, ctx: CommandContext): void {
87
85
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/root_themes/${id}` + "\n");
88
86
  const result = await client.delete(`/api/root_themes/${id}`);
89
87
  ctx.output(result);
90
- });
88
+ }), () => []);
91
89
 
92
- resource
90
+ declareInputs(resource
93
91
  .command("update-status <id>")
94
92
  .description("Update a root theme status")
95
93
  .option("--body <json>", "Request body as JSON string")
@@ -98,14 +96,13 @@ export function registerRootThemes(parent: Command, ctx: CommandContext): void {
98
96
  const client = await ctx.getClient();
99
97
  let body: unknown;
100
98
  if (opts.bodyFile) {
101
- const { readFileSync } = await import("fs");
102
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
99
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
103
100
  } else if (opts.body) {
104
101
  body = ctx.parseBody(opts.body);
105
102
  }
106
103
  if (ctx.verbose) process.stderr.write("POST " + `/api/root_themes/${id}/status` + "\n");
107
104
  const result = await client.post(`/api/root_themes/${id}/status`, body);
108
105
  ctx.output(result);
109
- });
106
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
110
107
 
111
108
  }