@fluid-app/fluid-cli-themes 0.1.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/.turbo/turbo-build.log +18 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +516 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
- package/scripts/generate.ts +18 -0
- package/src/generated/index.ts +20 -0
- package/src/generated/primary.ts +288 -0
- package/src/generated/region-rules.ts +116 -0
- package/src/generated/resources.ts +78 -0
- package/src/generated/root-themes.ts +119 -0
- package/src/generated/templates.ts +366 -0
- package/src/index.ts +20 -0
- package/tsconfig.json +10 -0
- package/tsdown.config.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["parseBooleanOption","parseBooleanOption"],"sources":["../src/generated/primary.ts","../src/generated/resources.ts","../src/generated/templates.ts","../src/generated/root-themes.ts","../src/generated/region-rules.ts","../src/generated/index.ts","../src/index.ts"],"sourcesContent":["// primary.ts — AUTO-GENERATED, DO NOT EDIT\nimport { Command } from \"commander\";\nimport type { CommandContext } from \"@fluid-app/fluid-cli\";\n\nfunction parseBooleanOption(value: string, flag: string): boolean {\n const normalized = value.trim().toLowerCase();\n if ([\"true\", \"1\", \"yes\", \"on\"].includes(normalized)) return true;\n if ([\"false\", \"0\", \"no\", \"off\"].includes(normalized)) return false;\n throw new Error(`Invalid value for ${flag}: ${value}. Expected true/false.`);\n}\n\nexport function registerPrimary(parent: Command, ctx: CommandContext): void {\n parent\n .command(\"list\")\n .description(\"List application themes\")\n .option(\"--page <value>\", \"Page number for pagination\")\n .option(\"--per-page <value>\", \"Number of records per page\")\n .option(\n \"--root-themes <value>\",\n \"If true, returns root themes instead of company-specific themes\",\n )\n .option(\n \"--include-default-home-template <value>\",\n \"If true, includes each theme's default home page template ID in the response\",\n )\n .action(async (opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.page !== undefined) params[\"page\"] = Number(opts.page);\n if (opts.perPage !== undefined) params[\"per_page\"] = Number(opts.perPage);\n if (opts.rootThemes !== undefined)\n params[\"root_themes\"] = parseBooleanOption(\n opts.rootThemes,\n \"--root-themes\",\n );\n if (opts.includeDefaultHomeTemplate !== undefined)\n params[\"include_default_home_template\"] = parseBooleanOption(\n opts.includeDefaultHomeTemplate,\n \"--include-default-home-template\",\n );\n if (ctx.verbose)\n process.stderr.write(\"GET \" + `/api/application_themes` + \"\\n\");\n const result = await client.get(`/api/application_themes`, params);\n ctx.output(result);\n });\n\n parent\n .command(\"create\")\n .description(\"Create an application theme\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\"POST \" + `/api/application_themes` + \"\\n\");\n const result = await client.post(`/api/application_themes`, body);\n ctx.output(result);\n });\n\n parent\n .command(\"get <id>\")\n .description(\"Get an application theme\")\n .option(\"--version <value>\", \"Version of the theme to retrieve\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = Number(opts.version);\n if (ctx.verbose)\n process.stderr.write(\"GET \" + `/api/application_themes/${id}` + \"\\n\");\n const result = await client.get(`/api/application_themes/${id}`, params);\n ctx.output(result);\n });\n\n parent\n .command(\"update <id>\")\n .description(\"Update an application theme\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\"PATCH \" + `/api/application_themes/${id}` + \"\\n\");\n const result = await client.patch(`/api/application_themes/${id}`, body);\n ctx.output(result);\n });\n\n parent\n .command(\"delete <id>\")\n .description(\"Delete an application theme\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"DELETE \" + `/api/application_themes/${id}` + \"\\n\",\n );\n const result = await client.delete(`/api/application_themes/${id}`);\n ctx.output(result);\n });\n\n parent\n .command(\"clone <id>\")\n .description(\"Clone an application theme\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_themes/${id}/clone` + \"\\n\",\n );\n const result = await client.post(`/api/application_themes/${id}/clone`);\n ctx.output(result);\n });\n\n parent\n .command(\"get-theme-assets <id>\")\n .description(\"Get theme assets\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_themes/${id}/theme_assets` + \"\\n\",\n );\n const result = await client.get(\n `/api/application_themes/${id}/theme_assets`,\n );\n ctx.output(result);\n });\n\n parent\n .command(\"get-active\")\n .description(\"Get current active application theme\")\n .action(async () => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\"GET \" + `/api/application_themes/active` + \"\\n\");\n const result = await client.get(`/api/application_themes/active`);\n ctx.output(result);\n });\n\n parent\n .command(\"import <id>\")\n .description(\"Import an application theme\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_themes/${id}/import` + \"\\n\",\n );\n const result = await client.post(`/api/application_themes/${id}/import`);\n ctx.output(result);\n });\n\n parent\n .command(\"export <id>\")\n .description(\"Export an application theme\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_themes/${id}/export` + \"\\n\",\n );\n const result = await client.get(`/api/application_themes/${id}/export`);\n ctx.output(result);\n });\n\n parent\n .command(\"import-from-zip\")\n .description(\"Import an application theme from zip file\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_themes/import_zip` + \"\\n\",\n );\n const result = await client.post(\n `/api/application_themes/import_zip`,\n body,\n );\n ctx.output(result);\n });\n\n parent\n .command(\"version-diff <id>\")\n .description(\"Gets version diff information\")\n .option(\"--version <value>\", \"Version number to compare with\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = Number(opts.version);\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_themes/${id}/version_diff` + \"\\n\",\n );\n const result = await client.get(\n `/api/application_themes/${id}/version_diff`,\n params,\n );\n ctx.output(result);\n });\n\n parent\n .command(\"publish <id>\")\n .description(\"Publishes the theme\")\n .option(\n \"--version <value>\",\n \"Version of the theme template to publish. If not specified, the latest version will be published.\",\n )\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = opts.version;\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_themes/${id}/publish` + \"\\n\",\n );\n const result = await client.post(\n `/api/application_themes/${id}/publish`,\n undefined,\n { params },\n );\n ctx.output(result);\n });\n\n parent\n .command(\"upgrade <id>\")\n .description(\"Upgrade an application theme\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_themes/${id}/upgrade` + \"\\n\",\n );\n const result = await client.post(`/api/application_themes/${id}/upgrade`);\n ctx.output(result);\n });\n\n parent\n .command(\"available-themeables <id>\")\n .description(\n \"Returns available themeables for a given type scoped to the theme's company\",\n )\n .option(\n \"--themeable <value>\",\n \"The themeable type to list (e.g. product, medium, page)\",\n )\n .option(\"--search <value>\", \"Filter themeables by title\")\n .option(\"--page <value>\", \"Page number for pagination\")\n .option(\"--per-page <value>\", \"Number of items per page\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.themeable !== undefined) params[\"themeable\"] = opts.themeable;\n if (opts.search !== undefined) params[\"search\"] = opts.search;\n if (opts.page !== undefined) params[\"page\"] = Number(opts.page);\n if (opts.perPage !== undefined) params[\"per_page\"] = Number(opts.perPage);\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_themes/${id}/available_themeables` + \"\\n\",\n );\n const result = await client.get(\n `/api/application_themes/${id}/available_themeables`,\n params,\n );\n ctx.output(result);\n });\n}\n","// resources.ts — AUTO-GENERATED, DO NOT EDIT\nimport { Command } from \"commander\";\nimport type { CommandContext } from \"@fluid-app/fluid-cli\";\n\nexport function registerResources(parent: Command, ctx: CommandContext): void {\n const resource = parent.command(\"resources\").description(\"resources\");\n\n resource\n .command(\"get <application-theme-id>\")\n .description(\"Lists all theme resources\")\n .action(async (applicationThemeId) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" +\n `/api/application_themes/${applicationThemeId}/resources` +\n \"\\n\",\n );\n const result = await client.get(\n `/api/application_themes/${applicationThemeId}/resources`,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"update <application-theme-id>\")\n .description(\"Updates a theme resource\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (applicationThemeId, opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\n \"PUT \" +\n `/api/application_themes/${applicationThemeId}/resources` +\n \"\\n\",\n );\n const result = await client.put(\n `/api/application_themes/${applicationThemeId}/resources`,\n body,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"delete <application-theme-id>\")\n .description(\"Deletes a theme resource\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (applicationThemeId, opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\n \"DELETE \" +\n `/api/application_themes/${applicationThemeId}/resources` +\n \"\\n\",\n );\n const result = await client.delete(\n `/api/application_themes/${applicationThemeId}/resources`,\n { body },\n );\n ctx.output(result);\n });\n}\n","// templates.ts — AUTO-GENERATED, DO NOT EDIT\nimport { Command } from \"commander\";\nimport type { CommandContext } from \"@fluid-app/fluid-cli\";\n\nfunction parseBooleanOption(value: string, flag: string): boolean {\n const normalized = value.trim().toLowerCase();\n if ([\"true\", \"1\", \"yes\", \"on\"].includes(normalized)) return true;\n if ([\"false\", \"0\", \"no\", \"off\"].includes(normalized)) return false;\n throw new Error(`Invalid value for ${flag}: ${value}. Expected true/false.`);\n}\n\nexport function registerTemplates(parent: Command, ctx: CommandContext): void {\n const resource = parent.command(\"templates\").description(\"templates\");\n\n resource\n .command(\"list\")\n .description(\"Lists all theme templates\")\n .option(\"--application-theme-id <value>\", \"ID of the application theme\")\n .option(\"--themeable-type <value>\", \"Filter templates by themeable type\")\n .option(\"--published <value>\", \"return published versions\")\n .action(async (opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.applicationThemeId !== undefined)\n params[\"application_theme_id\"] = opts.applicationThemeId;\n if (opts.themeableType !== undefined)\n params[\"themeable_type\"] = opts.themeableType;\n if (opts.published !== undefined)\n params[\"published\"] = parseBooleanOption(opts.published, \"--published\");\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_theme_templates` + \"\\n\",\n );\n const result = await client.get(\n `/api/application_theme_templates`,\n params,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"create\")\n .description(\"Creates a theme template\")\n .option(\"--application-theme-id <value>\", \"ID of the application theme\")\n .option(\"--themeable-type <value>\", \"Filter templates by themeable type\")\n .option(\"--published <value>\", \"return published versions\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.applicationThemeId !== undefined)\n params[\"application_theme_id\"] = opts.applicationThemeId;\n if (opts.themeableType !== undefined)\n params[\"themeable_type\"] = opts.themeableType;\n if (opts.published !== undefined)\n params[\"published\"] = parseBooleanOption(opts.published, \"--published\");\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_theme_templates` + \"\\n\",\n );\n const result = await client.post(\n `/api/application_theme_templates`,\n body,\n { params },\n );\n ctx.output(result);\n });\n\n resource\n .command(\"get <id>\")\n .description(\"Retrieves a theme template\")\n .option(\"--version <value>\", \"Version of the theme template to retrieve\")\n .option(\n \"--published <value>\",\n \"Retrieve the published version of the theme template\",\n )\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = opts.version;\n if (opts.published !== undefined)\n params[\"published\"] = parseBooleanOption(opts.published, \"--published\");\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_theme_templates/${id}` + \"\\n\",\n );\n const result = await client.get(\n `/api/application_theme_templates/${id}`,\n params,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"update <id>\")\n .description(\"Updates a theme template\")\n .option(\"--version <value>\", \"Version of the theme template to retrieve\")\n .option(\n \"--published <value>\",\n \"Retrieve the published version of the theme template\",\n )\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = opts.version;\n if (opts.published !== undefined)\n params[\"published\"] = parseBooleanOption(opts.published, \"--published\");\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\n \"PATCH \" + `/api/application_theme_templates/${id}` + \"\\n\",\n );\n const result = await client.patch(\n `/api/application_theme_templates/${id}`,\n body,\n { params },\n );\n ctx.output(result);\n });\n\n resource\n .command(\"delete <id>\")\n .description(\"Deletes a theme template\")\n .option(\"--version <value>\", \"Version of the theme template to retrieve\")\n .option(\n \"--published <value>\",\n \"Retrieve the published version of the theme template\",\n )\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = opts.version;\n if (opts.published !== undefined)\n params[\"published\"] = parseBooleanOption(opts.published, \"--published\");\n if (ctx.verbose)\n process.stderr.write(\n \"DELETE \" + `/api/application_theme_templates/${id}` + \"\\n\",\n );\n const result = await client.delete(\n `/api/application_theme_templates/${id}`,\n { params },\n );\n ctx.output(result);\n });\n\n resource\n .command(\"clone <id>\")\n .description(\"Clones a theme template\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_theme_templates/${id}/clone` + \"\\n\",\n );\n const result = await client.post(\n `/api/application_theme_templates/${id}/clone`,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"set-default <id>\")\n .description(\"Sets a theme template as default\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_theme_templates/${id}/set_default` + \"\\n\",\n );\n const result = await client.post(\n `/api/application_theme_templates/${id}/set_default`,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"version-diff <id>\")\n .description(\"Gets version diff information\")\n .option(\"--version <value>\", \"Version number to compare with\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = Number(opts.version);\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_theme_templates/${id}/version_diff` + \"\\n\",\n );\n const result = await client.get(\n `/api/application_theme_templates/${id}/version_diff`,\n params,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"render-page <id>\")\n .description(\"Renders a page for a theme template\")\n .option(\"--version <value>\", \"Version of the theme template to retrieve\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = opts.version;\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_theme_templates/${id}/render_page` + \"\\n\",\n );\n const result = await client.post(\n `/api/application_theme_templates/${id}/render_page`,\n body,\n { params },\n );\n ctx.output(result);\n });\n\n resource\n .command(\"render-section <id>\")\n .description(\"Renders a section template\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" +\n `/api/application_theme_templates/${id}/render_section` +\n \"\\n\",\n );\n const result = await client.post(\n `/api/application_theme_templates/${id}/render_section`,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"get-theme-template-available-variables-api <id>\")\n .description(\"Get available variables for a theme template\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" +\n `/api/application_theme_templates/${id}/available_variables` +\n \"\\n\",\n );\n const result = await client.get(\n `/api/application_theme_templates/${id}/available_variables`,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"publish <id>\")\n .description(\"Publishes the template\")\n .option(\n \"--version <value>\",\n \"Version of the theme template to publish. If not specified, the latest version will be published.\",\n )\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.version !== undefined) params[\"version\"] = opts.version;\n if (ctx.verbose)\n process.stderr.write(\n \"POST \" + `/api/application_theme_templates/${id}/publish` + \"\\n\",\n );\n const result = await client.post(\n `/api/application_theme_templates/${id}/publish`,\n undefined,\n { params },\n );\n ctx.output(result);\n });\n\n resource\n .command(\"available-themeables <id>\")\n .description(\"Returns all available themeables for theme template\")\n .option(\n \"--selected <value>\",\n \"Filter themeables that are already assigned to this template\",\n )\n .option(\n \"--status <value>\",\n \"Filter themeables by status (active, draft, archived)\",\n )\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.selected !== undefined)\n params[\"selected\"] = parseBooleanOption(opts.selected, \"--selected\");\n if (opts.status !== undefined) params[\"status\"] = opts.status;\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" +\n `/api/application_theme_templates/${id}/available_themeables` +\n \"\\n\",\n );\n const result = await client.get(\n `/api/application_theme_templates/${id}/available_themeables`,\n params,\n );\n ctx.output(result);\n });\n\n resource\n .command(\"themeables-update <id>\")\n .description(\n \"Updates themeable records to be used by the specified template\",\n )\n .option(\"--query-params <value>\", \"query_params\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.queryParams !== undefined)\n params[\"query_params\"] = opts.queryParams;\n if (ctx.verbose)\n process.stderr.write(\n \"PUT \" +\n `/api/application_theme_templates/${id}/themeables_update` +\n \"\\n\",\n );\n const result = await client.put(\n `/api/application_theme_templates/${id}/themeables_update`,\n undefined,\n { params },\n );\n ctx.output(result);\n });\n\n resource\n .command(\"get-mysite-themes\")\n .description(\"List all mysite themes\")\n .action(async () => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"GET \" + `/api/application_theme_templates/mysite_themes` + \"\\n\",\n );\n const result = await client.get(\n `/api/application_theme_templates/mysite_themes`,\n );\n ctx.output(result);\n });\n}\n","// root-themes.ts — AUTO-GENERATED, DO NOT EDIT\nimport { Command } from \"commander\";\nimport type { CommandContext } from \"@fluid-app/fluid-cli\";\n\nexport function registerRootThemes(parent: Command, ctx: CommandContext): void {\n const resource = parent.command(\"root-themes\").description(\"root-themes\");\n\n resource\n .command(\"list\")\n .description(\"List root themes\")\n .option(\"--page <value>\", \"Page number for pagination\")\n .option(\"--per-page <value>\", \"Number of records per page\")\n .option(\n \"--status <value>\",\n \"Filter themes by status of their versions (draft, publishing, rejected, published)\",\n )\n .action(async (opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.page !== undefined) params[\"page\"] = Number(opts.page);\n if (opts.perPage !== undefined) params[\"per_page\"] = Number(opts.perPage);\n if (opts.status !== undefined) params[\"status\"] = opts.status;\n if (ctx.verbose) process.stderr.write(\"GET \" + `/api/root_themes` + \"\\n\");\n const result = await client.get(`/api/root_themes`, params);\n ctx.output(result);\n });\n\n resource\n .command(\"create\")\n .description(\"Create a root theme\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\"POST \" + `/api/root_themes` + \"\\n\");\n const result = await client.post(`/api/root_themes`, body);\n ctx.output(result);\n });\n\n resource\n .command(\"list-company\")\n .description(\"List company root themes\")\n .option(\"--page <value>\", \"Page number for pagination\")\n .option(\"--per-page <value>\", \"Number of records per page\")\n .option(\n \"--status <value>\",\n \"Filter themes by status of their versions (draft, publishing, rejected, published, active)\",\n )\n .action(async (opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.page !== undefined) params[\"page\"] = Number(opts.page);\n if (opts.perPage !== undefined) params[\"per_page\"] = Number(opts.perPage);\n if (opts.status !== undefined) params[\"status\"] = opts.status;\n if (ctx.verbose)\n process.stderr.write(\"GET \" + `/api/root_themes/my` + \"\\n\");\n const result = await client.get(`/api/root_themes/my`, params);\n ctx.output(result);\n });\n\n resource\n .command(\"update <id>\")\n .description(\"Update a root theme\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\"PATCH \" + `/api/root_themes/${id}` + \"\\n\");\n const result = await client.patch(`/api/root_themes/${id}`, body);\n ctx.output(result);\n });\n\n resource\n .command(\"delete <id>\")\n .description(\"Delete a root theme\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\"DELETE \" + `/api/root_themes/${id}` + \"\\n\");\n const result = await client.delete(`/api/root_themes/${id}`);\n ctx.output(result);\n });\n\n resource\n .command(\"update-status <id>\")\n .description(\"Update a root theme status\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\"POST \" + `/api/root_themes/${id}/status` + \"\\n\");\n const result = await client.post(`/api/root_themes/${id}/status`, body);\n ctx.output(result);\n });\n}\n","// region-rules.ts — AUTO-GENERATED, DO NOT EDIT\nimport { Command } from \"commander\";\nimport type { CommandContext } from \"@fluid-app/fluid-cli\";\n\nfunction parseBooleanOption(value: string, flag: string): boolean {\n const normalized = value.trim().toLowerCase();\n if ([\"true\", \"1\", \"yes\", \"on\"].includes(normalized)) return true;\n if ([\"false\", \"0\", \"no\", \"off\"].includes(normalized)) return false;\n throw new Error(`Invalid value for ${flag}: ${value}. Expected true/false.`);\n}\n\nexport function registerRegionRules(\n parent: Command,\n ctx: CommandContext,\n): void {\n const resource = parent.command(\"region-rules\").description(\"region-rules\");\n\n resource\n .command(\"list\")\n .description(\"List theme region rules\")\n .option(\"--company-id <value>\", \"Filter by company ID\")\n .option(\n \"--application-theme-template-id <value>\",\n \"Filter by application theme template ID\",\n )\n .option(\"--route-path <value>\", \"Filter by route path\")\n .option(\"--region-code <value>\", \"Filter by region code\")\n .option(\"--active <value>\", \"Filter by active status\")\n .option(\"--page <value>\", \"Page number for pagination\")\n .option(\"--per-page <value>\", \"Number of items per page\")\n .action(async (opts) => {\n const client = await ctx.getClient();\n const params: Record<string, unknown> = {};\n if (opts.companyId !== undefined)\n params[\"company_id\"] = Number(opts.companyId);\n if (opts.applicationThemeTemplateId !== undefined)\n params[\"application_theme_template_id\"] = Number(\n opts.applicationThemeTemplateId,\n );\n if (opts.routePath !== undefined) params[\"route_path\"] = opts.routePath;\n if (opts.regionCode !== undefined)\n params[\"region_code\"] = opts.regionCode;\n if (opts.active !== undefined)\n params[\"active\"] = parseBooleanOption(opts.active, \"--active\");\n if (opts.page !== undefined) params[\"page\"] = Number(opts.page);\n if (opts.perPage !== undefined) params[\"per_page\"] = Number(opts.perPage);\n if (ctx.verbose)\n process.stderr.write(\"GET \" + `/api/theme_region_rules` + \"\\n\");\n const result = await client.get(`/api/theme_region_rules`, params);\n ctx.output(result);\n });\n\n resource\n .command(\"create\")\n .description(\"Create theme region rule\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\"POST \" + `/api/theme_region_rules` + \"\\n\");\n const result = await client.post(`/api/theme_region_rules`, body);\n ctx.output(result);\n });\n\n resource\n .command(\"get <id>\")\n .description(\"Show theme region rule\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\"GET \" + `/api/theme_region_rules/${id}` + \"\\n\");\n const result = await client.get(`/api/theme_region_rules/${id}`);\n ctx.output(result);\n });\n\n resource\n .command(\"update <id>\")\n .description(\"Update theme region rule\")\n .option(\"--body <json>\", \"Request body as JSON string\")\n .option(\"--body-file <path>\", \"Read request body from file\")\n .action(async (id, opts) => {\n const client = await ctx.getClient();\n let body: unknown;\n if (opts.bodyFile) {\n const { readFileSync } = await import(\"fs\");\n body = ctx.parseBody(readFileSync(opts.bodyFile, \"utf-8\"));\n } else if (opts.body) {\n body = ctx.parseBody(opts.body);\n }\n if (ctx.verbose)\n process.stderr.write(\"PATCH \" + `/api/theme_region_rules/${id}` + \"\\n\");\n const result = await client.patch(`/api/theme_region_rules/${id}`, body);\n ctx.output(result);\n });\n\n resource\n .command(\"delete <id>\")\n .description(\"Delete theme region rule\")\n .action(async (id) => {\n const client = await ctx.getClient();\n if (ctx.verbose)\n process.stderr.write(\n \"DELETE \" + `/api/theme_region_rules/${id}` + \"\\n\",\n );\n const result = await client.delete(`/api/theme_region_rules/${id}`);\n ctx.output(result);\n });\n}\n","// index.ts — AUTO-GENERATED, DO NOT EDIT\nimport { Command } from \"commander\";\nimport type { CommandContext } from \"@fluid-app/fluid-cli\";\n\nimport { registerPrimary } from \"./primary.js\";\nimport { registerResources } from \"./resources.js\";\nimport { registerTemplates } from \"./templates.js\";\nimport { registerRootThemes } from \"./root-themes.js\";\nimport { registerRegionRules } from \"./region-rules.js\";\n\nexport function registerAllCommands(\n parent: Command,\n ctx: CommandContext,\n): void {\n registerPrimary(parent, ctx);\n registerResources(parent, ctx);\n registerTemplates(parent, ctx);\n registerRootThemes(parent, ctx);\n registerRegionRules(parent, ctx);\n}\n","import type { FluidPlugin } from \"@fluid-app/fluid-cli\";\nimport { createDomainCommand } from \"@fluid-app/fluid-cli\";\n\nimport { registerAllCommands } from \"./generated/index.js\";\n\nconst plugin: FluidPlugin = {\n name: \"@fluid-app/fluid-cli-themes\",\n version: \"0.1.0\",\n register(ctx) {\n ctx.program.addCommand(\n createDomainCommand(\n \"themes\",\n \"Manage Fluid application themes and templates\",\n registerAllCommands,\n ),\n );\n },\n};\n\nexport default plugin;\n"],"mappings":";;;AAIA,SAASA,qBAAmB,OAAe,MAAuB;CAChE,MAAM,aAAa,MAAM,MAAM,CAAC,aAAa;AAC7C,KAAI;EAAC;EAAQ;EAAK;EAAO;EAAK,CAAC,SAAS,WAAW,CAAE,QAAO;AAC5D,KAAI;EAAC;EAAS;EAAK;EAAM;EAAM,CAAC,SAAS,WAAW,CAAE,QAAO;AAC7D,OAAM,IAAI,MAAM,qBAAqB,KAAK,IAAI,MAAM,wBAAwB;;AAG9E,SAAgB,gBAAgB,QAAiB,KAA2B;AAC1E,QACG,QAAQ,OAAO,CACf,YAAY,0BAA0B,CACtC,OAAO,kBAAkB,6BAA6B,CACtD,OAAO,sBAAsB,6BAA6B,CA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I;;;;ACblC,MAAM,SAAsB;CAC1B,MAAM;CACN,SAAS;CACT,SAAS,KAAK;AACZ,MAAI,QAAQ,WACV,oBACE,UACA,iDACA,oBACD,CACF;;CAEJ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluid-app/fluid-cli-themes",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Fluid CLI commands for theme management",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.mts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.mts",
|
|
12
|
+
"default": "./dist/index.mjs"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"commander": "^12.0.0",
|
|
21
|
+
"@fluid-app/fluid-cli": "0.1.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^24",
|
|
25
|
+
"tsdown": "^0.21.0",
|
|
26
|
+
"tsx": "^4.21.0",
|
|
27
|
+
"typescript": "^5",
|
|
28
|
+
"@fluid-app/api-client-scripts": "0.0.0",
|
|
29
|
+
"@fluid-app/typescript-config": "0.0.0"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsdown",
|
|
36
|
+
"dev": "tsdown --watch",
|
|
37
|
+
"generate": "tsx scripts/generate.ts",
|
|
38
|
+
"lint": "oxlint",
|
|
39
|
+
"lint:fix": "oxlint --fix",
|
|
40
|
+
"typecheck": "tsgo --noEmit"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { generateCLICommands } from "@fluid-app/api-client-scripts";
|
|
3
|
+
|
|
4
|
+
const packageDir = resolve(import.meta.dirname, "..");
|
|
5
|
+
const specPath = resolve(packageDir, "..", "specs", "swagger.json");
|
|
6
|
+
|
|
7
|
+
await generateCLICommands({
|
|
8
|
+
packageDir,
|
|
9
|
+
specPath,
|
|
10
|
+
contextImportPath: "@fluid-app/fluid-cli",
|
|
11
|
+
primaryTags: ["Application Themes"],
|
|
12
|
+
tagGroups: {
|
|
13
|
+
resources: ["ApplicationThemeResources"],
|
|
14
|
+
templates: ["ApplicationThemeTemplates"],
|
|
15
|
+
"root-themes": ["Root Themes"],
|
|
16
|
+
"region-rules": ["Theme Region Rules"],
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// index.ts — AUTO-GENERATED, DO NOT EDIT
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import type { CommandContext } from "@fluid-app/fluid-cli";
|
|
4
|
+
|
|
5
|
+
import { registerPrimary } from "./primary.js";
|
|
6
|
+
import { registerResources } from "./resources.js";
|
|
7
|
+
import { registerTemplates } from "./templates.js";
|
|
8
|
+
import { registerRootThemes } from "./root-themes.js";
|
|
9
|
+
import { registerRegionRules } from "./region-rules.js";
|
|
10
|
+
|
|
11
|
+
export function registerAllCommands(
|
|
12
|
+
parent: Command,
|
|
13
|
+
ctx: CommandContext,
|
|
14
|
+
): void {
|
|
15
|
+
registerPrimary(parent, ctx);
|
|
16
|
+
registerResources(parent, ctx);
|
|
17
|
+
registerTemplates(parent, ctx);
|
|
18
|
+
registerRootThemes(parent, ctx);
|
|
19
|
+
registerRegionRules(parent, ctx);
|
|
20
|
+
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
// primary.ts — AUTO-GENERATED, DO NOT EDIT
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import type { CommandContext } from "@fluid-app/fluid-cli";
|
|
4
|
+
|
|
5
|
+
function parseBooleanOption(value: string, flag: string): boolean {
|
|
6
|
+
const normalized = value.trim().toLowerCase();
|
|
7
|
+
if (["true", "1", "yes", "on"].includes(normalized)) return true;
|
|
8
|
+
if (["false", "0", "no", "off"].includes(normalized)) return false;
|
|
9
|
+
throw new Error(`Invalid value for ${flag}: ${value}. Expected true/false.`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function registerPrimary(parent: Command, ctx: CommandContext): void {
|
|
13
|
+
parent
|
|
14
|
+
.command("list")
|
|
15
|
+
.description("List application themes")
|
|
16
|
+
.option("--page <value>", "Page number for pagination")
|
|
17
|
+
.option("--per-page <value>", "Number of records per page")
|
|
18
|
+
.option(
|
|
19
|
+
"--root-themes <value>",
|
|
20
|
+
"If true, returns root themes instead of company-specific themes",
|
|
21
|
+
)
|
|
22
|
+
.option(
|
|
23
|
+
"--include-default-home-template <value>",
|
|
24
|
+
"If true, includes each theme's default home page template ID in the response",
|
|
25
|
+
)
|
|
26
|
+
.action(async (opts) => {
|
|
27
|
+
const client = await ctx.getClient();
|
|
28
|
+
const params: Record<string, unknown> = {};
|
|
29
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
30
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
31
|
+
if (opts.rootThemes !== undefined)
|
|
32
|
+
params["root_themes"] = parseBooleanOption(
|
|
33
|
+
opts.rootThemes,
|
|
34
|
+
"--root-themes",
|
|
35
|
+
);
|
|
36
|
+
if (opts.includeDefaultHomeTemplate !== undefined)
|
|
37
|
+
params["include_default_home_template"] = parseBooleanOption(
|
|
38
|
+
opts.includeDefaultHomeTemplate,
|
|
39
|
+
"--include-default-home-template",
|
|
40
|
+
);
|
|
41
|
+
if (ctx.verbose)
|
|
42
|
+
process.stderr.write("GET " + `/api/application_themes` + "\n");
|
|
43
|
+
const result = await client.get(`/api/application_themes`, params);
|
|
44
|
+
ctx.output(result);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
parent
|
|
48
|
+
.command("create")
|
|
49
|
+
.description("Create an application theme")
|
|
50
|
+
.option("--body <json>", "Request body as JSON string")
|
|
51
|
+
.option("--body-file <path>", "Read request body from file")
|
|
52
|
+
.action(async (opts) => {
|
|
53
|
+
const client = await ctx.getClient();
|
|
54
|
+
let body: unknown;
|
|
55
|
+
if (opts.bodyFile) {
|
|
56
|
+
const { readFileSync } = await import("fs");
|
|
57
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
58
|
+
} else if (opts.body) {
|
|
59
|
+
body = ctx.parseBody(opts.body);
|
|
60
|
+
}
|
|
61
|
+
if (ctx.verbose)
|
|
62
|
+
process.stderr.write("POST " + `/api/application_themes` + "\n");
|
|
63
|
+
const result = await client.post(`/api/application_themes`, body);
|
|
64
|
+
ctx.output(result);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
parent
|
|
68
|
+
.command("get <id>")
|
|
69
|
+
.description("Get an application theme")
|
|
70
|
+
.option("--version <value>", "Version of the theme to retrieve")
|
|
71
|
+
.action(async (id, opts) => {
|
|
72
|
+
const client = await ctx.getClient();
|
|
73
|
+
const params: Record<string, unknown> = {};
|
|
74
|
+
if (opts.version !== undefined) params["version"] = Number(opts.version);
|
|
75
|
+
if (ctx.verbose)
|
|
76
|
+
process.stderr.write("GET " + `/api/application_themes/${id}` + "\n");
|
|
77
|
+
const result = await client.get(`/api/application_themes/${id}`, params);
|
|
78
|
+
ctx.output(result);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
parent
|
|
82
|
+
.command("update <id>")
|
|
83
|
+
.description("Update an application theme")
|
|
84
|
+
.option("--body <json>", "Request body as JSON string")
|
|
85
|
+
.option("--body-file <path>", "Read request body from file")
|
|
86
|
+
.action(async (id, opts) => {
|
|
87
|
+
const client = await ctx.getClient();
|
|
88
|
+
let body: unknown;
|
|
89
|
+
if (opts.bodyFile) {
|
|
90
|
+
const { readFileSync } = await import("fs");
|
|
91
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
92
|
+
} else if (opts.body) {
|
|
93
|
+
body = ctx.parseBody(opts.body);
|
|
94
|
+
}
|
|
95
|
+
if (ctx.verbose)
|
|
96
|
+
process.stderr.write("PATCH " + `/api/application_themes/${id}` + "\n");
|
|
97
|
+
const result = await client.patch(`/api/application_themes/${id}`, body);
|
|
98
|
+
ctx.output(result);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
parent
|
|
102
|
+
.command("delete <id>")
|
|
103
|
+
.description("Delete an application theme")
|
|
104
|
+
.action(async (id) => {
|
|
105
|
+
const client = await ctx.getClient();
|
|
106
|
+
if (ctx.verbose)
|
|
107
|
+
process.stderr.write(
|
|
108
|
+
"DELETE " + `/api/application_themes/${id}` + "\n",
|
|
109
|
+
);
|
|
110
|
+
const result = await client.delete(`/api/application_themes/${id}`);
|
|
111
|
+
ctx.output(result);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
parent
|
|
115
|
+
.command("clone <id>")
|
|
116
|
+
.description("Clone an application theme")
|
|
117
|
+
.action(async (id) => {
|
|
118
|
+
const client = await ctx.getClient();
|
|
119
|
+
if (ctx.verbose)
|
|
120
|
+
process.stderr.write(
|
|
121
|
+
"POST " + `/api/application_themes/${id}/clone` + "\n",
|
|
122
|
+
);
|
|
123
|
+
const result = await client.post(`/api/application_themes/${id}/clone`);
|
|
124
|
+
ctx.output(result);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
parent
|
|
128
|
+
.command("get-theme-assets <id>")
|
|
129
|
+
.description("Get theme assets")
|
|
130
|
+
.action(async (id) => {
|
|
131
|
+
const client = await ctx.getClient();
|
|
132
|
+
if (ctx.verbose)
|
|
133
|
+
process.stderr.write(
|
|
134
|
+
"GET " + `/api/application_themes/${id}/theme_assets` + "\n",
|
|
135
|
+
);
|
|
136
|
+
const result = await client.get(
|
|
137
|
+
`/api/application_themes/${id}/theme_assets`,
|
|
138
|
+
);
|
|
139
|
+
ctx.output(result);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
parent
|
|
143
|
+
.command("get-active")
|
|
144
|
+
.description("Get current active application theme")
|
|
145
|
+
.action(async () => {
|
|
146
|
+
const client = await ctx.getClient();
|
|
147
|
+
if (ctx.verbose)
|
|
148
|
+
process.stderr.write("GET " + `/api/application_themes/active` + "\n");
|
|
149
|
+
const result = await client.get(`/api/application_themes/active`);
|
|
150
|
+
ctx.output(result);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
parent
|
|
154
|
+
.command("import <id>")
|
|
155
|
+
.description("Import an application theme")
|
|
156
|
+
.action(async (id) => {
|
|
157
|
+
const client = await ctx.getClient();
|
|
158
|
+
if (ctx.verbose)
|
|
159
|
+
process.stderr.write(
|
|
160
|
+
"POST " + `/api/application_themes/${id}/import` + "\n",
|
|
161
|
+
);
|
|
162
|
+
const result = await client.post(`/api/application_themes/${id}/import`);
|
|
163
|
+
ctx.output(result);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
parent
|
|
167
|
+
.command("export <id>")
|
|
168
|
+
.description("Export an application theme")
|
|
169
|
+
.action(async (id) => {
|
|
170
|
+
const client = await ctx.getClient();
|
|
171
|
+
if (ctx.verbose)
|
|
172
|
+
process.stderr.write(
|
|
173
|
+
"GET " + `/api/application_themes/${id}/export` + "\n",
|
|
174
|
+
);
|
|
175
|
+
const result = await client.get(`/api/application_themes/${id}/export`);
|
|
176
|
+
ctx.output(result);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
parent
|
|
180
|
+
.command("import-from-zip")
|
|
181
|
+
.description("Import an application theme from zip file")
|
|
182
|
+
.option("--body <json>", "Request body as JSON string")
|
|
183
|
+
.option("--body-file <path>", "Read request body from file")
|
|
184
|
+
.action(async (opts) => {
|
|
185
|
+
const client = await ctx.getClient();
|
|
186
|
+
let body: unknown;
|
|
187
|
+
if (opts.bodyFile) {
|
|
188
|
+
const { readFileSync } = await import("fs");
|
|
189
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
190
|
+
} else if (opts.body) {
|
|
191
|
+
body = ctx.parseBody(opts.body);
|
|
192
|
+
}
|
|
193
|
+
if (ctx.verbose)
|
|
194
|
+
process.stderr.write(
|
|
195
|
+
"POST " + `/api/application_themes/import_zip` + "\n",
|
|
196
|
+
);
|
|
197
|
+
const result = await client.post(
|
|
198
|
+
`/api/application_themes/import_zip`,
|
|
199
|
+
body,
|
|
200
|
+
);
|
|
201
|
+
ctx.output(result);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
parent
|
|
205
|
+
.command("version-diff <id>")
|
|
206
|
+
.description("Gets version diff information")
|
|
207
|
+
.option("--version <value>", "Version number to compare with")
|
|
208
|
+
.action(async (id, opts) => {
|
|
209
|
+
const client = await ctx.getClient();
|
|
210
|
+
const params: Record<string, unknown> = {};
|
|
211
|
+
if (opts.version !== undefined) params["version"] = Number(opts.version);
|
|
212
|
+
if (ctx.verbose)
|
|
213
|
+
process.stderr.write(
|
|
214
|
+
"GET " + `/api/application_themes/${id}/version_diff` + "\n",
|
|
215
|
+
);
|
|
216
|
+
const result = await client.get(
|
|
217
|
+
`/api/application_themes/${id}/version_diff`,
|
|
218
|
+
params,
|
|
219
|
+
);
|
|
220
|
+
ctx.output(result);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
parent
|
|
224
|
+
.command("publish <id>")
|
|
225
|
+
.description("Publishes the theme")
|
|
226
|
+
.option(
|
|
227
|
+
"--version <value>",
|
|
228
|
+
"Version of the theme template to publish. If not specified, the latest version will be published.",
|
|
229
|
+
)
|
|
230
|
+
.action(async (id, opts) => {
|
|
231
|
+
const client = await ctx.getClient();
|
|
232
|
+
const params: Record<string, unknown> = {};
|
|
233
|
+
if (opts.version !== undefined) params["version"] = opts.version;
|
|
234
|
+
if (ctx.verbose)
|
|
235
|
+
process.stderr.write(
|
|
236
|
+
"POST " + `/api/application_themes/${id}/publish` + "\n",
|
|
237
|
+
);
|
|
238
|
+
const result = await client.post(
|
|
239
|
+
`/api/application_themes/${id}/publish`,
|
|
240
|
+
undefined,
|
|
241
|
+
{ params },
|
|
242
|
+
);
|
|
243
|
+
ctx.output(result);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
parent
|
|
247
|
+
.command("upgrade <id>")
|
|
248
|
+
.description("Upgrade an application theme")
|
|
249
|
+
.action(async (id) => {
|
|
250
|
+
const client = await ctx.getClient();
|
|
251
|
+
if (ctx.verbose)
|
|
252
|
+
process.stderr.write(
|
|
253
|
+
"POST " + `/api/application_themes/${id}/upgrade` + "\n",
|
|
254
|
+
);
|
|
255
|
+
const result = await client.post(`/api/application_themes/${id}/upgrade`);
|
|
256
|
+
ctx.output(result);
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
parent
|
|
260
|
+
.command("available-themeables <id>")
|
|
261
|
+
.description(
|
|
262
|
+
"Returns available themeables for a given type scoped to the theme's company",
|
|
263
|
+
)
|
|
264
|
+
.option(
|
|
265
|
+
"--themeable <value>",
|
|
266
|
+
"The themeable type to list (e.g. product, medium, page)",
|
|
267
|
+
)
|
|
268
|
+
.option("--search <value>", "Filter themeables by title")
|
|
269
|
+
.option("--page <value>", "Page number for pagination")
|
|
270
|
+
.option("--per-page <value>", "Number of items per page")
|
|
271
|
+
.action(async (id, opts) => {
|
|
272
|
+
const client = await ctx.getClient();
|
|
273
|
+
const params: Record<string, unknown> = {};
|
|
274
|
+
if (opts.themeable !== undefined) params["themeable"] = opts.themeable;
|
|
275
|
+
if (opts.search !== undefined) params["search"] = opts.search;
|
|
276
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
277
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
278
|
+
if (ctx.verbose)
|
|
279
|
+
process.stderr.write(
|
|
280
|
+
"GET " + `/api/application_themes/${id}/available_themeables` + "\n",
|
|
281
|
+
);
|
|
282
|
+
const result = await client.get(
|
|
283
|
+
`/api/application_themes/${id}/available_themeables`,
|
|
284
|
+
params,
|
|
285
|
+
);
|
|
286
|
+
ctx.output(result);
|
|
287
|
+
});
|
|
288
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// region-rules.ts — AUTO-GENERATED, DO NOT EDIT
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import type { CommandContext } from "@fluid-app/fluid-cli";
|
|
4
|
+
|
|
5
|
+
function parseBooleanOption(value: string, flag: string): boolean {
|
|
6
|
+
const normalized = value.trim().toLowerCase();
|
|
7
|
+
if (["true", "1", "yes", "on"].includes(normalized)) return true;
|
|
8
|
+
if (["false", "0", "no", "off"].includes(normalized)) return false;
|
|
9
|
+
throw new Error(`Invalid value for ${flag}: ${value}. Expected true/false.`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function registerRegionRules(
|
|
13
|
+
parent: Command,
|
|
14
|
+
ctx: CommandContext,
|
|
15
|
+
): void {
|
|
16
|
+
const resource = parent.command("region-rules").description("region-rules");
|
|
17
|
+
|
|
18
|
+
resource
|
|
19
|
+
.command("list")
|
|
20
|
+
.description("List theme region rules")
|
|
21
|
+
.option("--company-id <value>", "Filter by company ID")
|
|
22
|
+
.option(
|
|
23
|
+
"--application-theme-template-id <value>",
|
|
24
|
+
"Filter by application theme template ID",
|
|
25
|
+
)
|
|
26
|
+
.option("--route-path <value>", "Filter by route path")
|
|
27
|
+
.option("--region-code <value>", "Filter by region code")
|
|
28
|
+
.option("--active <value>", "Filter by active status")
|
|
29
|
+
.option("--page <value>", "Page number for pagination")
|
|
30
|
+
.option("--per-page <value>", "Number of items per page")
|
|
31
|
+
.action(async (opts) => {
|
|
32
|
+
const client = await ctx.getClient();
|
|
33
|
+
const params: Record<string, unknown> = {};
|
|
34
|
+
if (opts.companyId !== undefined)
|
|
35
|
+
params["company_id"] = Number(opts.companyId);
|
|
36
|
+
if (opts.applicationThemeTemplateId !== undefined)
|
|
37
|
+
params["application_theme_template_id"] = Number(
|
|
38
|
+
opts.applicationThemeTemplateId,
|
|
39
|
+
);
|
|
40
|
+
if (opts.routePath !== undefined) params["route_path"] = opts.routePath;
|
|
41
|
+
if (opts.regionCode !== undefined)
|
|
42
|
+
params["region_code"] = opts.regionCode;
|
|
43
|
+
if (opts.active !== undefined)
|
|
44
|
+
params["active"] = parseBooleanOption(opts.active, "--active");
|
|
45
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
46
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
47
|
+
if (ctx.verbose)
|
|
48
|
+
process.stderr.write("GET " + `/api/theme_region_rules` + "\n");
|
|
49
|
+
const result = await client.get(`/api/theme_region_rules`, params);
|
|
50
|
+
ctx.output(result);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
resource
|
|
54
|
+
.command("create")
|
|
55
|
+
.description("Create theme region rule")
|
|
56
|
+
.option("--body <json>", "Request body as JSON string")
|
|
57
|
+
.option("--body-file <path>", "Read request body from file")
|
|
58
|
+
.action(async (opts) => {
|
|
59
|
+
const client = await ctx.getClient();
|
|
60
|
+
let body: unknown;
|
|
61
|
+
if (opts.bodyFile) {
|
|
62
|
+
const { readFileSync } = await import("fs");
|
|
63
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
64
|
+
} else if (opts.body) {
|
|
65
|
+
body = ctx.parseBody(opts.body);
|
|
66
|
+
}
|
|
67
|
+
if (ctx.verbose)
|
|
68
|
+
process.stderr.write("POST " + `/api/theme_region_rules` + "\n");
|
|
69
|
+
const result = await client.post(`/api/theme_region_rules`, body);
|
|
70
|
+
ctx.output(result);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
resource
|
|
74
|
+
.command("get <id>")
|
|
75
|
+
.description("Show theme region rule")
|
|
76
|
+
.action(async (id) => {
|
|
77
|
+
const client = await ctx.getClient();
|
|
78
|
+
if (ctx.verbose)
|
|
79
|
+
process.stderr.write("GET " + `/api/theme_region_rules/${id}` + "\n");
|
|
80
|
+
const result = await client.get(`/api/theme_region_rules/${id}`);
|
|
81
|
+
ctx.output(result);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
resource
|
|
85
|
+
.command("update <id>")
|
|
86
|
+
.description("Update theme region rule")
|
|
87
|
+
.option("--body <json>", "Request body as JSON string")
|
|
88
|
+
.option("--body-file <path>", "Read request body from file")
|
|
89
|
+
.action(async (id, opts) => {
|
|
90
|
+
const client = await ctx.getClient();
|
|
91
|
+
let body: unknown;
|
|
92
|
+
if (opts.bodyFile) {
|
|
93
|
+
const { readFileSync } = await import("fs");
|
|
94
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
95
|
+
} else if (opts.body) {
|
|
96
|
+
body = ctx.parseBody(opts.body);
|
|
97
|
+
}
|
|
98
|
+
if (ctx.verbose)
|
|
99
|
+
process.stderr.write("PATCH " + `/api/theme_region_rules/${id}` + "\n");
|
|
100
|
+
const result = await client.patch(`/api/theme_region_rules/${id}`, body);
|
|
101
|
+
ctx.output(result);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
resource
|
|
105
|
+
.command("delete <id>")
|
|
106
|
+
.description("Delete theme region rule")
|
|
107
|
+
.action(async (id) => {
|
|
108
|
+
const client = await ctx.getClient();
|
|
109
|
+
if (ctx.verbose)
|
|
110
|
+
process.stderr.write(
|
|
111
|
+
"DELETE " + `/api/theme_region_rules/${id}` + "\n",
|
|
112
|
+
);
|
|
113
|
+
const result = await client.delete(`/api/theme_region_rules/${id}`);
|
|
114
|
+
ctx.output(result);
|
|
115
|
+
});
|
|
116
|
+
}
|