@apimatic/cli 2.0.0-beta.4 → 2.0.0-beta.6

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.
Files changed (169) hide show
  1. package/README.md +20 -64
  2. package/apimatic.schema.json +2 -2
  3. package/lib/actions/action-result.d.ts +4 -2
  4. package/lib/actions/action-result.js +8 -3
  5. package/lib/actions/action-result.js.map +1 -1
  6. package/lib/actions/api/transform.d.ts +7 -6
  7. package/lib/actions/api/transform.js +12 -13
  8. package/lib/actions/api/transform.js.map +1 -1
  9. package/lib/actions/api/validate.d.ts +4 -5
  10. package/lib/actions/api/validate.js +30 -32
  11. package/lib/actions/api/validate.js.map +1 -1
  12. package/lib/actions/portal/generate.js +3 -3
  13. package/lib/actions/portal/generate.js.map +1 -1
  14. package/lib/actions/portal/prepare-project.js +3 -0
  15. package/lib/actions/portal/prepare-project.js.map +1 -1
  16. package/lib/actions/quickstart.d.ts +1 -9
  17. package/lib/actions/quickstart.js +122 -102
  18. package/lib/actions/quickstart.js.map +1 -1
  19. package/lib/commands/api/transform.d.ts +1 -1
  20. package/lib/commands/api/transform.js +2 -2
  21. package/lib/commands/api/transform.js.map +1 -1
  22. package/lib/commands/api/validate.d.ts +3 -3
  23. package/lib/commands/api/validate.js +28 -17
  24. package/lib/commands/api/validate.js.map +1 -1
  25. package/lib/commands/plugin/generate.d.ts +1 -1
  26. package/lib/commands/portal/generate.d.ts +2 -2
  27. package/lib/commands/portal/generate.js +3 -1
  28. package/lib/commands/portal/generate.js.map +1 -1
  29. package/lib/commands/portal/serve.d.ts +2 -2
  30. package/lib/commands/portal/serve.js +1 -1
  31. package/lib/commands/sdk/generate.d.ts +1 -1
  32. package/lib/infrastructure/file-service.d.ts +5 -0
  33. package/lib/infrastructure/file-service.js +40 -9
  34. package/lib/infrastructure/file-service.js.map +1 -1
  35. package/lib/infrastructure/portal-dev-server-service.js +2 -1
  36. package/lib/infrastructure/portal-dev-server-service.js.map +1 -1
  37. package/lib/infrastructure/portal-project-service.d.ts +2 -0
  38. package/lib/infrastructure/portal-project-service.js +9 -4
  39. package/lib/infrastructure/portal-project-service.js.map +1 -1
  40. package/lib/infrastructure/services/file-download-service.d.ts +4 -4
  41. package/lib/infrastructure/services/file-download-service.js +14 -14
  42. package/lib/infrastructure/services/file-download-service.js.map +1 -1
  43. package/lib/prompts/api/transform.d.ts +0 -2
  44. package/lib/prompts/api/transform.js +0 -3
  45. package/lib/prompts/api/transform.js.map +1 -1
  46. package/lib/prompts/api/validate.d.ts +2 -2
  47. package/lib/prompts/api/validate.js +35 -3
  48. package/lib/prompts/api/validate.js.map +1 -1
  49. package/lib/prompts/format.d.ts +1 -1
  50. package/lib/prompts/format.js.map +1 -1
  51. package/lib/prompts/portal/generate.d.ts +2 -1
  52. package/lib/prompts/portal/generate.js +22 -6
  53. package/lib/prompts/portal/generate.js.map +1 -1
  54. package/lib/prompts/portal/prepare-project.d.ts +5 -1
  55. package/lib/prompts/portal/prepare-project.js +15 -1
  56. package/lib/prompts/portal/prepare-project.js.map +1 -1
  57. package/lib/prompts/portal/serve.js +6 -3
  58. package/lib/prompts/portal/serve.js.map +1 -1
  59. package/lib/prompts/portal/source.d.ts +6 -6
  60. package/lib/prompts/portal/source.js +97 -31
  61. package/lib/prompts/portal/source.js.map +1 -1
  62. package/lib/prompts/quickstart.d.ts +14 -13
  63. package/lib/prompts/quickstart.js +43 -27
  64. package/lib/prompts/quickstart.js.map +1 -1
  65. package/lib/types/apimatic-config/document.d.ts +2 -0
  66. package/lib/types/apimatic-config/document.js +4 -0
  67. package/lib/types/apimatic-config/document.js.map +1 -1
  68. package/lib/types/file/directory.js +2 -1
  69. package/lib/types/file/directory.js.map +1 -1
  70. package/lib/types/file/directoryPath.d.ts +3 -0
  71. package/lib/types/file/directoryPath.js +10 -1
  72. package/lib/types/file/directoryPath.js.map +1 -1
  73. package/lib/types/file/fileName.d.ts +5 -0
  74. package/lib/types/file/fileName.js +13 -3
  75. package/lib/types/file/fileName.js.map +1 -1
  76. package/lib/types/file/filePath.js +1 -1
  77. package/lib/types/file/filePath.js.map +1 -1
  78. package/lib/types/file/resource-input.d.ts +7 -5
  79. package/lib/types/file/resource-input.js +16 -15
  80. package/lib/types/file/resource-input.js.map +1 -1
  81. package/lib/types/flags-provider.d.ts +6 -1
  82. package/lib/types/flags-provider.js +22 -12
  83. package/lib/types/flags-provider.js.map +1 -1
  84. package/lib/types/plugin-config-context.d.ts +3 -0
  85. package/lib/types/plugin-config-context.js +33 -12
  86. package/lib/types/plugin-config-context.js.map +1 -1
  87. package/lib/types/portal/code-samples.d.ts +2 -0
  88. package/lib/types/portal/code-samples.js +7 -0
  89. package/lib/types/portal/code-samples.js.map +1 -1
  90. package/lib/types/portal/config/site-address.d.ts +16 -0
  91. package/lib/types/portal/config/site-address.js +67 -0
  92. package/lib/types/portal/config/site-address.js.map +1 -0
  93. package/lib/types/portal/config/site-config.d.ts +3 -5
  94. package/lib/types/portal/config/site-config.js +10 -33
  95. package/lib/types/portal/config/site-config.js.map +1 -1
  96. package/lib/types/portal/config/static-asset.d.ts +2 -2
  97. package/lib/types/portal/config/static-asset.js +2 -2
  98. package/lib/types/portal/config/static-asset.js.map +1 -1
  99. package/lib/types/portal/content-tree.d.ts +11 -4
  100. package/lib/types/portal/content-tree.js +31 -20
  101. package/lib/types/portal/content-tree.js.map +1 -1
  102. package/lib/types/portal/endpoint.d.ts +1 -0
  103. package/lib/types/portal/endpoint.js +3 -0
  104. package/lib/types/portal/endpoint.js.map +1 -1
  105. package/lib/types/portal/openapi-document.d.ts +4 -0
  106. package/lib/types/portal/openapi-document.js +12 -0
  107. package/lib/types/portal/openapi-document.js.map +1 -1
  108. package/lib/types/portal/page.js +16 -1
  109. package/lib/types/portal/page.js.map +1 -1
  110. package/lib/types/portal/portal-config.d.ts +6 -3
  111. package/lib/types/portal/portal-config.js +8 -4
  112. package/lib/types/portal/portal-config.js.map +1 -1
  113. package/lib/types/portal/portal-languages.d.ts +2 -0
  114. package/lib/types/portal/portal-languages.js +5 -1
  115. package/lib/types/portal/portal-languages.js.map +1 -1
  116. package/lib/types/portal/portal-source.d.ts +43 -11
  117. package/lib/types/portal/shared.d.ts +11 -0
  118. package/lib/types/portal/shared.js +10 -0
  119. package/lib/types/portal/shared.js.map +1 -0
  120. package/lib/types/portal/spec-metadata.d.ts +17 -0
  121. package/lib/types/portal/spec-metadata.js +40 -0
  122. package/lib/types/portal/spec-metadata.js.map +1 -0
  123. package/lib/types/portal-source-context.d.ts +21 -8
  124. package/lib/types/portal-source-context.js +208 -50
  125. package/lib/types/portal-source-context.js.map +1 -1
  126. package/lib/types/project-context.d.ts +18 -0
  127. package/lib/types/project-context.js +18 -1
  128. package/lib/types/project-context.js.map +1 -1
  129. package/lib/types/project-layout.d.ts +3 -0
  130. package/lib/types/project-layout.js +4 -0
  131. package/lib/types/project-layout.js.map +1 -1
  132. package/lib/types/resource-context.d.ts +25 -10
  133. package/lib/types/resource-context.js +40 -23
  134. package/lib/types/resource-context.js.map +1 -1
  135. package/oclif.manifest.json +88 -70
  136. package/package.json +1 -1
  137. package/portal-template/dependency-directories.ts +31 -40
  138. package/portal-template/downloads.ts +6 -3
  139. package/portal-template/portal-config.ts +4 -0
  140. package/portal-template/prerender-pages.ts +8 -2
  141. package/portal-template/spec-reload.ts +12 -9
  142. package/portal-template/src/components/api-markdown.tsx +32 -0
  143. package/portal-template/src/components/api-page.tsx +8 -1
  144. package/portal-template/src/components/authorization-failure.tsx +63 -0
  145. package/portal-template/src/components/markdown-copy-button.tsx +2 -2
  146. package/portal-template/src/components/plugin-install.tsx +6 -5
  147. package/portal-template/src/components/sdk-actions.tsx +3 -2
  148. package/portal-template/src/components/sdk-cards.tsx +2 -1
  149. package/portal-template/src/components/search.tsx +9 -2
  150. package/portal-template/src/lib/base-path.ts +14 -0
  151. package/portal-template/src/lib/code-titles.ts +8 -0
  152. package/portal-template/src/lib/copy-markdown.ts +4 -2
  153. package/portal-template/src/lib/install-command.ts +5 -5
  154. package/portal-template/src/lib/layout.shared.tsx +5 -3
  155. package/portal-template/src/lib/llms.server.ts +29 -5
  156. package/portal-template/src/lib/oauth-callback.ts +63 -0
  157. package/portal-template/src/lib/portal-types.ts +3 -3
  158. package/portal-template/src/lib/rehype-code-titles.ts +3 -5
  159. package/portal-template/src/lib/remark-image-references.ts +35 -0
  160. package/portal-template/src/lib/search-content.ts +28 -0
  161. package/portal-template/src/lib/search-options.ts +7 -0
  162. package/portal-template/src/lib/source.server.ts +2 -0
  163. package/portal-template/src/router.tsx +3 -1
  164. package/portal-template/src/routes/$.tsx +3 -2
  165. package/portal-template/src/routes/__root.tsx +8 -1
  166. package/portal-template/src/routes/api/search[.]json.ts +23 -2
  167. package/portal-template/src/routes/oauth.callback.tsx +54 -0
  168. package/portal-template/static-functions-base.ts +41 -0
  169. package/portal-template/vite.config.ts +15 -8
@@ -1,4 +1,3 @@
1
- import { err, ok } from 'neverthrow';
2
1
  import { getAuthInfo } from '../client-utils/auth-manager.js';
3
2
  import { FileService } from '../infrastructure/file-service.js';
4
3
  import { withDirPath } from '../infrastructure/tmp-extensions.js';
@@ -7,19 +6,17 @@ import { UrlPath } from '../types/file/urlPath.js';
7
6
  import { LoginAction } from './auth/login.js';
8
7
  import { ActionResult } from './action-result.js';
9
8
  import { ValidateAction } from './api/validate.js';
10
- import { SpecContext } from '../types/spec-context.js';
11
9
  import { OpenApiDocument } from '../types/portal/openapi-document.js';
12
10
  import { PortalAuthorizationService } from '../infrastructure/services/portal-authorization-service.js';
13
- import { FileDownloadService } from '../infrastructure/services/file-download-service.js';
14
11
  import { PortalProjectService } from '../infrastructure/portal-project-service.js';
15
12
  import { APIMATIC_SCHEMA_URL } from '../types/apimatic-config/document.js';
16
13
  import { PLACEHOLDER_METADATA } from '../types/plugin/plugin-config.js';
17
14
  import { ProjectContext } from '../types/project-context.js';
15
+ import { ResourceContext } from '../types/resource-context.js';
18
16
  import { DEFAULT_PORTAL_PORT, PortalServeAction } from './portal/serve.js';
19
17
  export class QuickstartAction {
20
18
  prompts = new QuickstartPrompts();
21
19
  fileService = new FileService();
22
- fileDownloadService = new FileDownloadService();
23
20
  authorizationService = new PortalAuthorizationService();
24
21
  projectService = new PortalProjectService();
25
22
  configDir;
@@ -53,35 +50,126 @@ export class QuickstartAction {
53
50
  this.prompts.authorizationFailed(authorization.error);
54
51
  return ActionResult.failed();
55
52
  }
56
- return await withDirPath((tempDirectory) => this.runWizard(workingDirectory, tempDirectory));
53
+ return await withDirPath(async (tempDirectory) => {
54
+ const here = ProjectContext.in(workingDirectory);
55
+ return (await here.specsExist())
56
+ ? await this.adoptProject(here, workingDirectory)
57
+ : await this.startProject(tempDirectory);
58
+ });
57
59
  };
58
- async runWizard(workingDirectory, tempDirectory) {
59
- const here = ProjectContext.in(workingDirectory);
60
- const adoptedSpec = await here.portalSource().primarySpec();
61
- return adoptedSpec === null
62
- ? await this.startProject(tempDirectory)
63
- : await this.adoptProject(here, workingDirectory, adoptedSpec, tempDirectory);
64
- }
65
60
  // A build downloaded from the platform arrives with its specification in `src/spec/`, so it is not asked for again.
66
- async adoptProject(project, projectDirectory, specPath, tempDirectory) {
67
- this.prompts.importSpecStepAdopted(project.sourceDirectory());
68
- const validated = await this.validate({ file: specPath, source: specPath }, tempDirectory, true);
69
- if (validated.isErr()) {
70
- return validated.error;
61
+ async adoptProject(project, projectDirectory) {
62
+ const sourceDirectory = project.sourceDirectory();
63
+ const config = await project.config().read();
64
+ if (config.state === 'missing') {
65
+ this.prompts.configMissing(sourceDirectory);
66
+ return ActionResult.failed();
67
+ }
68
+ const unsupported = config.state === 'parsed' ? config.document.findingsFor('root') : config.findings;
69
+ if (unsupported.length > 0) {
70
+ this.prompts.configUnsupported(unsupported, sourceDirectory);
71
+ return ActionResult.failed();
72
+ }
73
+ this.prompts.importSpecStepAdopted(sourceDirectory);
74
+ this.prompts.validateSpecStep();
75
+ const failure = await this.validationFailure(project);
76
+ if (failure === 'unchecked') {
77
+ return ActionResult.failed();
78
+ }
79
+ // No sample is offered: nothing here moves it into a `spec/` the project already fills.
80
+ if (failure === 'invalid') {
81
+ this.prompts.specValidationFailed('project');
82
+ this.prompts.fixYourSpec();
83
+ return ActionResult.cancelled();
84
+ }
85
+ const portalSource = project.portalSource();
86
+ const specs = await portalSource.resolveSpecs();
87
+ if (specs.isErr()) {
88
+ this.prompts.specsUnsupported(specs.error, sourceDirectory);
89
+ return ActionResult.failed();
71
90
  }
72
91
  this.prompts.createPortalStep();
73
- const scaffolded = await project.portalSource().adopt(validated.value, APIMATIC_SCHEMA_URL);
74
- return await this.completeProject(project, projectDirectory, scaffolded);
92
+ const [namedAfter] = specs.value;
93
+ const adopted = await portalSource.adopt(namedAfter);
94
+ if (adopted.isErr()) {
95
+ this.prompts.scaffoldFailed(adopted.error, sourceDirectory);
96
+ return ActionResult.failed();
97
+ }
98
+ const pluginConfig = project.pluginConfig();
99
+ const pluginAdded = await pluginConfig.addMetadataIfMissing(PLACEHOLDER_METADATA);
100
+ if (pluginAdded.isErr()) {
101
+ this.prompts.configNotWritten(pluginAdded.error, sourceDirectory);
102
+ return ActionResult.failed();
103
+ }
104
+ if (await pluginConfig.languagesMissing()) {
105
+ const languages = await this.prompts.selectLanguages();
106
+ if (!languages?.length) {
107
+ this.prompts.noLanguagesSelected();
108
+ return ActionResult.cancelled();
109
+ }
110
+ const languagesAdded = await pluginConfig.addLanguagesIfMissing(languages);
111
+ if (languagesAdded.isErr()) {
112
+ this.prompts.configNotWritten(languagesAdded.error, sourceDirectory);
113
+ return ActionResult.failed();
114
+ }
115
+ }
116
+ return await this.completeProject(project, projectDirectory, adopted.value);
75
117
  }
76
118
  async startProject(tempDirectory) {
77
119
  this.prompts.importSpecStep();
78
- const imported = await this.importSpec(tempDirectory);
79
- if (imported === undefined) {
80
- return ActionResult.cancelled();
120
+ // Dropped once the CLI's own sample has failed: re-offering the address the user just
121
+ // watched fail, pre-filled, is the one suggestion that cannot work.
122
+ let sampleUrl = this.defaultSpecUrl;
123
+ let spec;
124
+ for (;;) {
125
+ const input = await this.prompts.specPathPrompt(sampleUrl);
126
+ if (!input) {
127
+ this.prompts.noSpecSpecified();
128
+ return ActionResult.cancelled();
129
+ }
130
+ const resolving = ResourceContext.resolveTo(input, tempDirectory.join('user-spec'));
131
+ const resolved = input instanceof UrlPath ? await this.prompts.downloadSpecFile(resolving) : await resolving;
132
+ if (resolved.isOk()) {
133
+ spec = resolved.value;
134
+ break;
135
+ }
136
+ this.prompts.specUnavailable(resolved.error);
137
+ if (resolved.error.kind === 'downloadFailed' && sampleUrl?.isEqual(resolved.error.url)) {
138
+ sampleUrl = null;
139
+ }
140
+ }
141
+ this.prompts.validateSpecStep();
142
+ const failure = await this.validationFailure(spec);
143
+ // The service's own error is already on screen; the spec may be valid, so there is nothing to fix.
144
+ if (failure === 'unchecked') {
145
+ return ActionResult.failed();
81
146
  }
82
- const validated = await this.validate(imported, tempDirectory, false);
83
- if (validated.isErr()) {
84
- return validated.error;
147
+ if (failure === 'invalid') {
148
+ this.prompts.specValidationFailed(spec.kind());
149
+ if (!(await this.prompts.useDefaultSpecPrompt())) {
150
+ this.prompts.fixYourSpec();
151
+ return ActionResult.cancelled();
152
+ }
153
+ const sample = await this.prompts.downloadSpecFile(ResourceContext.resolveTo(this.defaultSpecUrl, tempDirectory.join('sample')));
154
+ if (sample.isErr()) {
155
+ this.prompts.specUnavailable(sample.error);
156
+ return ActionResult.failed();
157
+ }
158
+ spec = sample.value;
159
+ }
160
+ const specFile = spec.file();
161
+ // The validation above accepts Swagger 2.0, which a portal cannot be built from. Asked
162
+ // here rather than left to `portal serve`, which refuses only once the project is
163
+ // written -- and running the wizard again then rejects the non-empty tree it created.
164
+ const format = await this.specFormat(specFile);
165
+ if (!format.supported) {
166
+ if (format.format === null) {
167
+ this.prompts.specNotRecognised(specFile);
168
+ }
169
+ else {
170
+ this.prompts.specFormatUnsupported(specFile, format.format);
171
+ }
172
+ return ActionResult.failed();
85
173
  }
86
174
  this.prompts.createPortalStep();
87
175
  const projectDirectory = await this.chooseProjectDirectory();
@@ -89,11 +177,8 @@ export class QuickstartAction {
89
177
  return ActionResult.cancelled();
90
178
  }
91
179
  const project = ProjectContext.in(projectDirectory);
92
- const scaffolded = await project.portalSource().scaffold(validated.value, APIMATIC_SCHEMA_URL);
93
- return await this.completeProject(project, projectDirectory, scaffolded);
94
- }
95
- async completeProject(project, projectDirectory, scaffolded) {
96
180
  const sourceDirectory = project.sourceDirectory();
181
+ const scaffolded = await project.portalSource().scaffold(specFile, APIMATIC_SCHEMA_URL);
97
182
  if (scaffolded.isErr()) {
98
183
  this.prompts.scaffoldFailed(scaffolded.error, sourceDirectory);
99
184
  return ActionResult.failed();
@@ -112,87 +197,22 @@ export class QuickstartAction {
112
197
  this.prompts.configNotWritten(pluginConfigRecorded.error, sourceDirectory);
113
198
  return ActionResult.failed();
114
199
  }
200
+ return await this.completeProject(project, projectDirectory, scaffolded.value);
201
+ }
202
+ async completeProject(project, projectDirectory, configFile) {
115
203
  // Reported rather than fatal: what Git tracks does not decide whether a portal can be built.
116
204
  const ignored = await project.upsertGitignore();
117
205
  if (ignored.isErr()) {
118
206
  this.prompts.gitignoreNotUpdated(ignored.error, projectDirectory);
119
207
  }
120
- const structure = await this.fileService.getDirectory(sourceDirectory);
208
+ const structure = await this.fileService.getDirectory(project.sourceDirectory());
121
209
  this.prompts.printDirectoryStructure(projectDirectory, structure);
122
- const result = await new PortalServeAction(this.configDir, this.commandMetadata, null).execute(project, DEFAULT_PORTAL_PORT, true, () => this.prompts.nextSteps(scaffolded.value));
210
+ const result = await new PortalServeAction(this.configDir, this.commandMetadata, null).execute(project, DEFAULT_PORTAL_PORT, true, () => this.prompts.nextSteps(configFile));
123
211
  return result.isFailed() ? ActionResult.failed() : ActionResult.success();
124
212
  }
125
- async importSpec(tempDirectory) {
126
- // Dropped once the CLI's own sample has failed: re-offering the address the user just
127
- // watched fail, pre-filled, is the one suggestion that cannot work.
128
- let sampleUrl = this.defaultSpecUrl;
129
- for (;;) {
130
- const inputPath = await this.prompts.specPathPrompt(sampleUrl);
131
- if (!inputPath) {
132
- this.prompts.noSpecSpecified();
133
- return undefined;
134
- }
135
- if (inputPath instanceof UrlPath) {
136
- const downloaded = await this.prompts.downloadSpecFile(this.fileDownloadService.downloadFile(inputPath));
137
- if (downloaded.isErr()) {
138
- this.prompts.specDownloadFailed(inputPath, downloaded.error);
139
- if (sampleUrl !== null && inputPath.isEqual(sampleUrl)) {
140
- sampleUrl = null;
141
- }
142
- continue;
143
- }
144
- const file = await new SpecContext(tempDirectory).save(downloaded.value.stream, downloaded.value.filename);
145
- return { file, source: inputPath };
146
- }
147
- if (await this.fileService.fileExists(inputPath)) {
148
- return { file: inputPath, source: inputPath };
149
- }
150
- this.prompts.specFileDoesNotExist();
151
- }
152
- }
153
- /**
154
- * `adopted` decides what a failure offers. The sample can replace a specification the user
155
- * named, but not one their project carries: an adopted `spec/` already holds the document the
156
- * portal would be built from, and nothing here moves the sample into it.
157
- */
158
- async validate(spec, tempDirectory, adopted) {
159
- this.prompts.validateSpecStep();
160
- let validation = 'unchecked';
161
- await new ValidateAction(this.configDir, this.commandMetadata).execute(spec.file, false, (check) => {
162
- validation = check;
163
- });
164
- // The service's own error is already on screen; the spec may be valid, so there is nothing to fix.
165
- if (validation === 'unchecked') {
166
- return err(ActionResult.failed());
167
- }
168
- let checked = spec.file;
169
- if (validation === 'invalid') {
170
- this.prompts.specValidationFailed(spec.source);
171
- if (adopted || !(await this.prompts.useDefaultSpecPrompt())) {
172
- this.prompts.fixYourSpec();
173
- return err(ActionResult.cancelled());
174
- }
175
- const downloaded = await this.prompts.downloadSpecFile(this.fileDownloadService.downloadFile(this.defaultSpecUrl));
176
- if (downloaded.isErr()) {
177
- this.prompts.serviceError(downloaded.error);
178
- return err(ActionResult.failed());
179
- }
180
- checked = await new SpecContext(tempDirectory).save(downloaded.value.stream, downloaded.value.filename);
181
- }
182
- // The validation above accepts Swagger 2.0, which a portal cannot be built from. Asked
183
- // here rather than left to `portal serve`, which refuses only once the project is
184
- // written -- and running the wizard again then rejects the non-empty tree it created.
185
- const format = await this.specFormat(checked);
186
- if (!format.supported) {
187
- if (format.format === null) {
188
- this.prompts.specNotRecognised(checked);
189
- }
190
- else {
191
- this.prompts.specFormatUnsupported(checked, format.format);
192
- }
193
- return err(ActionResult.failed());
194
- }
195
- return ok(checked);
213
+ async validationFailure(spec) {
214
+ const validated = await new ValidateAction(this.configDir, this.commandMetadata).execute(spec, false);
215
+ return validated.isFailed() ? validated.getError() ?? 'unchecked' : undefined;
196
216
  }
197
217
  async chooseProjectDirectory() {
198
218
  for (;;) {
@@ -1 +1 @@
1
- {"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../src/actions/quickstart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAU,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAa,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAc,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4D,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,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,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;YACtG,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC1E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
@@ -5,7 +5,7 @@ export default class Transform extends Command {
5
5
  static readonly cmdTxt: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
- "auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'auth-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
11
  file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -3,7 +3,7 @@ import { DirectoryPath } from '../../types/file/directoryPath.js';
3
3
  import { FlagsProvider } from '../../types/flags-provider.js';
4
4
  import { TransformAction } from '../../actions/api/transform.js';
5
5
  import { format, intro, outro } from '../../prompts/format.js';
6
- import { createResourceInput } from '../../types/file/resource-input.js';
6
+ import { createFileOrUrlInput } from '../../types/file/resource-input.js';
7
7
  import { TransformationFormats } from '../../types/api/transform.js';
8
8
  import { TRANSFORMATIONS_DIRECTORY_NAME } from '../../types/transform-context.js';
9
9
  import { ExportFormats } from '@apimatic/sdk';
@@ -40,7 +40,7 @@ Supports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Col
40
40
  const { flags: { format, file, url, destination, force, 'auth-key': authKey } } = await this.parse(Transform);
41
41
  const workingDirectory = DirectoryPath.createInput(destination);
42
42
  const transformedApiDirectory = workingDirectory.join(TRANSFORMATIONS_DIRECTORY_NAME);
43
- const specFile = createResourceInput(file, url);
43
+ const specFile = createFileOrUrlInput(file, url);
44
44
  // Directly map the format flag to ExportFormats using TransformationFormats
45
45
  const key = format;
46
46
  const transformationFormat = TransformationFormats[key];
@@ -1 +1 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/commands/api/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,MAAM,CAAU,OAAO,GAAG,wDAAwD,CAAC;IAEnF,MAAM,CAAU,WAAW,GAAG;0FAC0D,CAAC;IAEzF,MAAM,CAAU,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IAEpE,MAAM,CAAC,QAAQ,GAAG;QAChB,GAAG,SAAS,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,IAAI,CACzE,MAAM,EACN,qBAAqB,CACtB,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;QACvC,GAAG,SAAS,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CAAC,GAAG;QACP,MAAM,EACJ,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EACtE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,gBAAgB,GAAG,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChE,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QACtF,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACjD,4EAA4E;QAC5E,MAAM,GAAG,GAAG,MAA4C,CAAC;QACzD,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,GAAG,CAA+B,CAAC;QACtF,MAAM,YAAY,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;QAEzD,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,SAAS,CAAC,EAAE;YACzB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QAClF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAC5F,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEgB,YAAY,GAAG,GAAG,EAAE;QACnC,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC,CAAC;CACH"}
@@ -1,11 +1,11 @@
1
- import { Command } from "@oclif/core";
1
+ import { Command } from '@oclif/core';
2
2
  export default class Validate extends Command {
3
3
  static readonly summary = "Validate API specification for syntactic and semantic correctness";
4
- static readonly description = "Validate your API specification to ensure it adheres to syntactic and semantic standards.";
4
+ static readonly description = "Validate the API specification in your 'src/spec' directory, or the one --file or --url points to, to ensure it adheres to syntactic and semantic standards.";
5
5
  static readonly cmdTxt: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
- "auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'auth-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  };
@@ -1,32 +1,43 @@
1
- import { Command, Flags } from "@oclif/core";
2
- import { DirectoryPath } from "../../types/file/directoryPath.js";
3
- import { FlagsProvider } from "../../types/flags-provider.js";
4
- import { ValidateAction } from "../../actions/api/validate.js";
5
- import { format, intro, outro } from "../../prompts/format.js";
6
- import { createResourceInput } from "../../types/file/resource-input.js";
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { DirectoryPath } from '../../types/file/directoryPath.js';
3
+ import { FlagsProvider } from '../../types/flags-provider.js';
4
+ import { ValidateAction } from '../../actions/api/validate.js';
5
+ import { format, intro, outro } from '../../prompts/format.js';
6
+ import { createResourceInput } from '../../types/file/resource-input.js';
7
7
  export default class Validate extends Command {
8
- static summary = "Validate API specification for syntactic and semantic correctness";
9
- static description = `Validate your API specification to ensure it adheres to syntactic and semantic standards.`;
10
- static cmdTxt = format.cmd("apimatic", "api", "validate");
8
+ static summary = 'Validate API specification for syntactic and semantic correctness';
9
+ static description = `Validate the API specification in your 'src/spec' directory, or the one --file or --url points to, to ensure it adheres to syntactic and semantic standards.`;
10
+ static cmdTxt = format.cmd('apimatic', 'api', 'validate');
11
11
  static examples = [
12
- `${Validate.cmdTxt} ${format.flag("file", "./specs/sample.json")}`,
13
- `${Validate.cmdTxt} ${format.flag("url", '"https://petstore.swagger.io/v2/swagger.json"')}`
12
+ Validate.cmdTxt,
13
+ `${Validate.cmdTxt} ${format.flag('input', './')}`,
14
+ `${Validate.cmdTxt} ${format.flag('file', './specs/sample.json')}`,
15
+ `${Validate.cmdTxt} ${format.flag('url', '"https://petstore.swagger.io/v2/swagger.json"')}`
14
16
  ];
15
17
  static flags = {
16
- file: Flags.string({ description: "Path to the API specification file to validate" }),
17
- url: Flags.string({ description: "URL to the API specification file to validate (publicly accessible)" }),
18
+ file: Flags.string({
19
+ description: 'Path to the API specification file to validate',
20
+ exclusive: ['url', 'input'],
21
+ parse: FlagsProvider.nonEmpty
22
+ }),
23
+ url: Flags.string({
24
+ description: 'URL to the API specification file to validate (publicly accessible)',
25
+ exclusive: ['file', 'input'],
26
+ parse: FlagsProvider.nonEmpty
27
+ }),
28
+ ...FlagsProvider.nonEmptyInput,
18
29
  ...FlagsProvider.authKey
19
30
  };
20
31
  async run() {
21
- const { flags: { file, url, "auth-key": authKey } } = await this.parse(Validate);
32
+ const { flags: { file, url, input, 'auth-key': authKey } } = await this.parse(Validate);
33
+ const spec = createResourceInput(file, url, input);
22
34
  const commandMetadata = {
23
35
  commandName: Validate.id,
24
36
  shell: this.config.shell
25
37
  };
26
38
  const action = new ValidateAction(this.getConfigDir(), commandMetadata, authKey);
27
- const resourceInput = createResourceInput(file, url);
28
- intro("Validate API");
29
- const result = await action.execute(resourceInput);
39
+ intro('Validate API');
40
+ const result = await action.execute(spec);
30
41
  outro(result);
31
42
  }
32
43
  getConfigDir = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/api/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,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CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEgB,YAAY,GAAG,GAAG,EAAE;QACnC,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC,CAAC;CACH"}
@@ -6,7 +6,7 @@ export default class PluginGenerate extends Command {
6
6
  static readonly examples: string[];
7
7
  static readonly flags: {
8
8
  destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- "auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ 'auth-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  };
12
12
  run(): Promise<void>;
@@ -1,12 +1,12 @@
1
1
  import { Command } from '@oclif/core';
2
2
  export default class PortalGenerate extends Command {
3
3
  static readonly summary = "Generate a static API Documentation Portal.";
4
- static readonly description = "Builds a documentation portal from the OpenAPI documents and Markdown pages in your 'src' directory.\n\nThe portal is built on your machine and written as static files you can host anywhere. Configure it with 'src/apimatic.json', whose 'languages' block gives the portal a page for each SDK language, and whose 'plugin' block, or a 'pluginUrl' in its 'portal' block for a plugin hosted elsewhere, a page for the context plugin.";
4
+ static readonly description = "Builds a documentation portal from the OpenAPI documents and Markdown pages in your 'src' directory.\n\nEach OpenAPI document at the top of 'src/spec' gets a section of the API reference, and the SDKs are built from one of them. To build the SDKs from several, put each in a folder of its own and set 'MergeConfiguration.MergeApis' to true in an 'APIMATIC-META.json' beside the folders; each folder then gets a section.\n\nThe portal is built on your machine and written as static files for any static host, served at its root or, when 'portal.site.url' has a path such as 'https://example.com/docs', at that path. Configure it with 'src/apimatic.json', whose 'languages' block gives the portal a page for each SDK language, and whose 'plugin' block, or a 'pluginUrl' in its 'portal' block for a plugin hosted elsewhere, a page for the context plugin.";
5
5
  static readonly cmdTxt: string;
6
6
  static readonly examples: string[];
7
7
  static flags: {
8
8
  destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- "auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ 'auth-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  zip: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
12
  };
@@ -8,7 +8,9 @@ export default class PortalGenerate extends Command {
8
8
  static summary = 'Generate a static API Documentation Portal.';
9
9
  static description = `Builds a documentation portal from the OpenAPI documents and Markdown pages in your 'src' directory.
10
10
 
11
- The portal is built on your machine and written as static files you can host anywhere. Configure it with 'src/apimatic.json', whose 'languages' block gives the portal a page for each SDK language, and whose 'plugin' block, or a 'pluginUrl' in its 'portal' block for a plugin hosted elsewhere, a page for the context plugin.`;
11
+ Each OpenAPI document at the top of 'src/spec' gets a section of the API reference, and the SDKs are built from one of them. To build the SDKs from several, put each in a folder of its own and set 'MergeConfiguration.MergeApis' to true in an 'APIMATIC-META.json' beside the folders; each folder then gets a section.
12
+
13
+ The portal is built on your machine and written as static files for any static host, served at its root or, when 'portal.site.url' has a path such as 'https://example.com/docs', at that path. Configure it with 'src/apimatic.json', whose 'languages' block gives the portal a page for each SDK language, and whose 'plugin' block, or a 'pluginUrl' in its 'portal' block for a plugin hosted elsewhere, a page for the context plugin.`;
12
14
  static cmdTxt = format.cmd('apimatic', 'portal', 'generate');
13
15
  static examples = [
14
16
  PortalGenerate.cmdTxt,
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/portal/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAA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AG,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACrG,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEgB,YAAY,GAAG,GAAG,EAAE;QACnC,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC,CAAC;CACH"}
@@ -1,11 +1,11 @@
1
1
  import { Command } from '@oclif/core';
2
2
  export default class PortalServe extends Command {
3
3
  static readonly summary = "Preview your API Documentation Portal with live reload.";
4
- static readonly description = "Serves the portal described by 'src/apimatic.json' from your machine, reloading the browser as you edit the Markdown pages in 'src/content', reorder them in a 'nav.json', or change the 'portal', 'languages' or 'plugin' block of 'apimatic.json'.\n\nAdding a language or a 'plugin' block, adding or removing a page in 'src/content', creating 'src/static', or changing which documents are in 'src/spec', needs the preview restarted.\n\nNothing is written to disk; run 'apimatic portal generate' to produce the static files.";
4
+ static readonly description = "Serves the portal described by 'src/apimatic.json' from your machine, reloading the browser as you edit the Markdown pages in 'src/content', reorder them in a 'nav.json', or change the 'portal', 'languages' or 'plugin' block of 'apimatic.json'.\n\nAdding a language or a 'plugin' block, adding or removing a page in 'src/content', creating 'src/static', changing which documents are in 'src/spec' or which folders its 'APIMATIC-META.json' merges, or changing the path in 'portal.site.url', needs the preview restarted.\n\nNothing is written to disk; run 'apimatic portal generate' to produce the static files.";
5
5
  static readonly cmdTxt: string;
6
6
  static readonly examples: string[];
7
7
  static flags: {
8
- "auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'auth-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  port: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
10
  open: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  };
@@ -9,7 +9,7 @@ export default class PortalServe extends Command {
9
9
  static summary = 'Preview your API Documentation Portal with live reload.';
10
10
  static description = `Serves the portal described by 'src/apimatic.json' from your machine, reloading the browser as you edit the Markdown pages in 'src/content', reorder them in a 'nav.json', or change the 'portal', 'languages' or 'plugin' block of 'apimatic.json'.
11
11
 
12
- Adding a language or a 'plugin' block, adding or removing a page in 'src/content', creating 'src/static', or changing which documents are in 'src/spec', needs the preview restarted.
12
+ Adding a language or a 'plugin' block, adding or removing a page in 'src/content', creating 'src/static', changing which documents are in 'src/spec' or which folders its 'APIMATIC-META.json' merges, or changing the path in 'portal.site.url', needs the preview restarted.
13
13
 
14
14
  Nothing is written to disk; run 'apimatic portal generate' to produce the static files.`;
15
15
  static cmdTxt = format.cmd('apimatic', 'portal', 'serve');
@@ -4,7 +4,7 @@ export default class SdkGenerate extends Command {
4
4
  static readonly description: string;
5
5
  static readonly cmdTxt: string;
6
6
  static flags: {
7
- "auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ 'auth-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
9
  language: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -1,4 +1,5 @@
1
1
  import fs from 'node:fs';
2
+ import { Result } from 'neverthrow';
2
3
  import { FilePath } from '../types/file/filePath.js';
3
4
  import { DirectoryPath } from '../types/file/directoryPath.js';
4
5
  import { Directory } from '../types/file/directory.js';
@@ -13,6 +14,8 @@ export declare class FileService {
13
14
  * the normal way to start a project, so the prompts say "apart from hidden files".
14
15
  */
15
16
  directoryEmpty(dir: DirectoryPath): Promise<boolean>;
17
+ findSymlinks(dir: DirectoryPath): Promise<Result<FilePath[], string>>;
18
+ private symlinksUnder;
16
19
  cleanDirectory(dir: DirectoryPath): Promise<void>;
17
20
  cleanDirectoryExcluding(dir: DirectoryPath, excludeNames: FileName[]): Promise<void>;
18
21
  createDirectoryIfNotExists(dir: DirectoryPath): Promise<void>;
@@ -31,6 +34,8 @@ export declare class FileService {
31
34
  getFileNames(dir: DirectoryPath): Promise<FileName[]>;
32
35
  getSubDirectoriesPaths(dir: DirectoryPath): Promise<DirectoryPath[]>;
33
36
  spelledOnDisk(root: DirectoryPath, file: FilePath): Promise<FilePath | null>;
37
+ /** `directory`, at or below `root`, as each folder below `root` is spelt on disk; null when one is not there. */
38
+ directorySpelledOnDisk(root: DirectoryPath, directory: DirectoryPath): Promise<DirectoryPath | null>;
34
39
  private listEntries;
35
40
  copyDirectoryContents(source: DirectoryPath, destination: DirectoryPath): Promise<void>;
36
41
  moveDirectoryContents(source: DirectoryPath, destination: DirectoryPath): Promise<void>;