dataiku-sdk 3.2.0 → 3.4.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.
Files changed (132) hide show
  1. package/README.md +151 -46
  2. package/dist/build-metadata.json +1 -1
  3. package/dist/packages/types/src/index.d.ts +102 -0
  4. package/dist/packages/types/src/index.js +76 -0
  5. package/dist/src/cli/commands/app.js +57 -15
  6. package/dist/src/cli/commands/bundle.js +1 -1
  7. package/dist/src/cli/commands/code-env.js +13 -7
  8. package/dist/src/cli/commands/code.js +1 -1
  9. package/dist/src/cli/commands/connection.d.ts +9 -0
  10. package/dist/src/cli/commands/connection.js +267 -1
  11. package/dist/src/cli/commands/data-collection.d.ts +2 -0
  12. package/dist/src/cli/commands/data-collection.js +164 -0
  13. package/dist/src/cli/commands/dataset.js +162 -33
  14. package/dist/src/cli/commands/future.js +2 -2
  15. package/dist/src/cli/commands/group.d.ts +2 -0
  16. package/dist/src/cli/commands/group.js +109 -0
  17. package/dist/src/cli/commands/index.js +151 -78
  18. package/dist/src/cli/commands/job.js +4 -2
  19. package/dist/src/cli/commands/knowledge-bank.d.ts +2 -0
  20. package/dist/src/cli/commands/knowledge-bank.js +80 -0
  21. package/dist/src/cli/commands/llm.d.ts +2 -0
  22. package/dist/src/cli/commands/llm.js +93 -0
  23. package/dist/src/cli/commands/macro.d.ts +2 -0
  24. package/dist/src/cli/commands/macro.js +221 -0
  25. package/dist/src/cli/commands/ml-task.js +18 -6
  26. package/dist/src/cli/commands/notebook.js +6 -2
  27. package/dist/src/cli/commands/plugin.d.ts +2 -0
  28. package/dist/src/cli/commands/plugin.js +799 -0
  29. package/dist/src/cli/commands/project-folder.d.ts +2 -0
  30. package/dist/src/cli/commands/project-folder.js +197 -0
  31. package/dist/src/cli/commands/project-git.js +15 -55
  32. package/dist/src/cli/commands/project.js +52 -6
  33. package/dist/src/cli/commands/recipe.js +36 -1
  34. package/dist/src/cli/commands/saved-model.d.ts +5 -0
  35. package/dist/src/cli/commands/saved-model.js +388 -1
  36. package/dist/src/cli/commands/scenario.js +139 -2
  37. package/dist/src/cli/commands/user.d.ts +8 -0
  38. package/dist/src/cli/commands/user.js +296 -0
  39. package/dist/src/cli/contract.d.ts +1 -2
  40. package/dist/src/cli/contract.js +1098 -297
  41. package/dist/src/cli/flags.js +30 -1
  42. package/dist/src/cli/helpers/app-successor.d.ts +19 -4
  43. package/dist/src/cli/helpers/app-successor.js +90 -30
  44. package/dist/src/cli/helpers/cleanup.js +3 -1
  45. package/dist/src/cli/helpers/flow-zone.js +1 -2
  46. package/dist/src/cli/output-schemas.d.ts +24 -0
  47. package/dist/src/cli/output-schemas.js +233 -0
  48. package/dist/src/cli/output.d.ts +1 -1
  49. package/dist/src/cli/output.js +23 -10
  50. package/dist/src/cli/usage.d.ts +1 -0
  51. package/dist/src/cli/usage.js +47 -1
  52. package/dist/src/cli.js +147 -41
  53. package/dist/src/client.d.ts +92 -5
  54. package/dist/src/client.js +202 -31
  55. package/dist/src/errors.d.ts +3 -0
  56. package/dist/src/errors.js +8 -4
  57. package/dist/src/generated/action-output-schemas.json +1735 -0
  58. package/dist/src/index.d.ts +16 -7
  59. package/dist/src/index.js +11 -2
  60. package/dist/src/resources/analyses.js +1 -8
  61. package/dist/src/resources/applications.d.ts +8 -6
  62. package/dist/src/resources/applications.js +21 -21
  63. package/dist/src/resources/base.d.ts +4 -0
  64. package/dist/src/resources/base.js +15 -0
  65. package/dist/src/resources/bundles.d.ts +9 -4
  66. package/dist/src/resources/bundles.js +10 -5
  67. package/dist/src/resources/connections.d.ts +78 -1
  68. package/dist/src/resources/connections.js +132 -1
  69. package/dist/src/resources/data-collections.d.ts +118 -0
  70. package/dist/src/resources/data-collections.js +49 -0
  71. package/dist/src/resources/datasets.d.ts +69 -0
  72. package/dist/src/resources/datasets.js +136 -5
  73. package/dist/src/resources/flow-zones.d.ts +6 -2
  74. package/dist/src/resources/flow-zones.js +6 -3
  75. package/dist/src/resources/futures.d.ts +6 -1
  76. package/dist/src/resources/futures.js +68 -22
  77. package/dist/src/resources/groups.d.ts +47 -0
  78. package/dist/src/resources/groups.js +56 -0
  79. package/dist/src/resources/jobs.d.ts +8 -13
  80. package/dist/src/resources/jobs.js +71 -34
  81. package/dist/src/resources/knowledge-banks.d.ts +58 -0
  82. package/dist/src/resources/knowledge-banks.js +61 -0
  83. package/dist/src/resources/llms.d.ts +92 -0
  84. package/dist/src/resources/llms.js +62 -0
  85. package/dist/src/resources/macros.d.ts +121 -0
  86. package/dist/src/resources/macros.js +231 -0
  87. package/dist/src/resources/ml-tasks.d.ts +37 -2
  88. package/dist/src/resources/ml-tasks.js +109 -20
  89. package/dist/src/resources/model-evaluation-stores.js +1 -8
  90. package/dist/src/resources/notebooks.d.ts +43 -7
  91. package/dist/src/resources/notebooks.js +53 -13
  92. package/dist/src/resources/plugins.d.ts +263 -0
  93. package/dist/src/resources/plugins.js +455 -0
  94. package/dist/src/resources/project-folders.d.ts +71 -0
  95. package/dist/src/resources/project-folders.js +57 -0
  96. package/dist/src/resources/project-git.d.ts +12 -12
  97. package/dist/src/resources/project-git.js +84 -82
  98. package/dist/src/resources/project-library.d.ts +0 -1
  99. package/dist/src/resources/project-library.js +1 -17
  100. package/dist/src/resources/projects.d.ts +23 -3
  101. package/dist/src/resources/projects.js +60 -34
  102. package/dist/src/resources/recipes.d.ts +15 -1
  103. package/dist/src/resources/recipes.js +73 -6
  104. package/dist/src/resources/saved-models.d.ts +134 -1
  105. package/dist/src/resources/saved-models.js +214 -6
  106. package/dist/src/resources/scenarios.d.ts +105 -0
  107. package/dist/src/resources/scenarios.js +232 -106
  108. package/dist/src/resources/sql.js +5 -1
  109. package/dist/src/resources/users.d.ts +129 -0
  110. package/dist/src/resources/users.js +128 -0
  111. package/dist/src/resources/webapps.d.ts +15 -2
  112. package/dist/src/resources/webapps.js +18 -4
  113. package/dist/src/schemas.d.ts +2 -2
  114. package/dist/src/schemas.js +1 -1
  115. package/dist/src/utils/deep-merge.d.ts +1 -1
  116. package/dist/src/utils/git-reference.d.ts +12 -0
  117. package/dist/src/utils/git-reference.js +38 -0
  118. package/dist/src/utils/polling.d.ts +20 -0
  119. package/dist/src/utils/polling.js +27 -0
  120. package/dist/src/utils/response-file.js +1 -1
  121. package/dist/src/utils/secret-sanitize.d.ts +54 -0
  122. package/dist/src/utils/secret-sanitize.js +101 -0
  123. package/package.json +9 -8
  124. package/packages/types/dist/index.d.ts +102 -0
  125. package/packages/types/dist/index.js +76 -0
  126. package/plugin.json +1 -1
  127. package/skills/dataiku-dss/SKILL.md +11 -7
  128. package/skills/dataiku-dss/references/app-releases.md +8 -8
  129. package/skills/dataiku-dss/references/authentication.md +6 -6
  130. package/skills/dataiku-dss/references/discovery.md +4 -4
  131. package/skills/dataiku-dss/references/mutations.md +1 -1
  132. package/skills/dataiku-dss/references/troubleshooting.md +2 -2
@@ -139,31 +139,71 @@ export class NotebooksResource extends BaseResource {
139
139
  const raw = await this.client.get(`/public/api/projects/${this.enc(projectKey)}/sql-notebooks/${idEnc}`);
140
140
  return this.client.safeParse(SqlNotebookContentSchema, raw, "notebooks.getSql");
141
141
  }
142
- /** Create a SQL notebook. */
143
- async createSql(id, content, projectKey) {
144
- await this.client.post(`/public/api/projects/${this.enc(projectKey)}/sql-notebooks/`, { ...content, id, projectKey: this.resolveProjectKey(projectKey), });
142
+ /**
143
+ * Create a SQL notebook.
144
+ *
145
+ * DSS allocates the notebook id server-side and rejects a request-supplied
146
+ * `id` (`Field 'id' is specified, it must not be specified`); `name` is
147
+ * the display handle (the requested label) when provided. The returned id
148
+ * comes from the creation receipt and is the only handle later reads,
149
+ * updates, and deletes may use.
150
+ */
151
+ async createSql(content, projectKey, opts) {
152
+ const body = {
153
+ ...content,
154
+ projectKey: this.resolveProjectKey(projectKey),
155
+ };
156
+ // Positional identity only: a content-supplied id (e.g. a stale GET
157
+ // spread) is stripped before the request — DSS rejects it outright.
158
+ delete body["id"];
159
+ if (opts?.name !== undefined && body["name"] === undefined)
160
+ body["name"] = opts.name;
161
+ const raw = await this.client.post(`/public/api/projects/${this.enc(projectKey)}/sql-notebooks/`, body);
162
+ const record = raw !== null && typeof raw === "object" && !Array.isArray(raw)
163
+ ? raw
164
+ : undefined;
165
+ const id = record?.["id"];
166
+ if (typeof id !== "string" || id.length === 0) {
167
+ throw new DataikuError(200, "Unexpected Response", "notebooks.createSql: DSS did not return the generated notebook id.");
168
+ }
169
+ return { id, };
145
170
  }
146
- /** Save (overwrite) a SQL notebook's content. */
171
+ /**
172
+ * Save (overwrite) a SQL notebook's content.
173
+ *
174
+ * Identity is positional: the URL id and the resolved project key are
175
+ * injected into the body, overriding any `id`/`projectKey` the content may
176
+ * carry, so a stale or hand-built body can never retarget the write. PUT
177
+ * is a full replacement — fields absent from the content (e.g. `name`)
178
+ * are cleared server-side.
179
+ */
147
180
  async saveSql(id, content, projectKey) {
148
181
  const idEnc = encodeURIComponent(id);
149
- await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/sql-notebooks/${idEnc}`, content);
182
+ await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/sql-notebooks/${idEnc}`, { ...content, id, projectKey: this.resolveProjectKey(projectKey), });
150
183
  }
151
184
  /**
152
- * Save a SQL notebook, creating it when missing. Same contract as
153
- * `saveOrCreateJupyter`: `created` reflects the fresh read, and `hash` is
154
- * the hash of the persisted content from a confirming re-read.
185
+ * Save a SQL notebook, creating it when missing.
186
+ *
187
+ * Update path: the fresh read finds the notebook and a PUT overwrites it.
188
+ * Create path: DSS allocates the persisted id (the requested handle becomes
189
+ * the display name; there is no name-based re-lookup, so a foreign
190
+ * notebook can never be mistaken for the target), the id is returned, and
191
+ * every later read/update/delete must use that returned id. `created`
192
+ * reflects the fresh read; `hash` is the hash of the persisted content
193
+ * from a confirming re-read. The armed `--expect-hash` guard also refuses
194
+ * an absent target.
155
195
  */
156
196
  async saveOrCreateSql(id, content, projectKey, opts) {
157
197
  const pk = this.resolveProjectKey(projectKey);
158
198
  const before = await this.prepareSave(() => this.getSql(id, pk), opts?.expectHash, pk, "SQL notebook", id);
159
199
  if (before === undefined) {
160
- await this.createSql(id, content, pk);
161
- }
162
- else {
163
- await this.saveSql(id, content, pk);
200
+ const created = await this.createSql(content, pk, { name: id, });
201
+ const persisted = await this.getSql(created.id, pk);
202
+ return { created: true, id: created.id, hash: stableHash(persisted), };
164
203
  }
204
+ await this.saveSql(id, content, pk);
165
205
  const persisted = await this.getSql(id, pk);
166
- return { created: before === undefined, hash: stableHash(persisted), };
206
+ return { created: false, id, hash: stableHash(persisted), };
167
207
  }
168
208
  /** Delete a SQL notebook. */
169
209
  async deleteSql(id, projectKey) {
@@ -0,0 +1,263 @@
1
+ import { BaseResource } from "./base.js";
2
+ /** Summary entry of `/plugins/` as documented (id/version/isDev/meta). */
3
+ export interface PluginSummary {
4
+ id: string;
5
+ version?: string;
6
+ isDev?: boolean;
7
+ meta?: {
8
+ label?: string;
9
+ description?: string;
10
+ /** Opaque server-authored metadata (icon, author, tags, ...). */
11
+ [key: string]: unknown;
12
+ };
13
+ /** Opaque server fields are preserved. */
14
+ [key: string]: unknown;
15
+ }
16
+ /** Settings of a plugin (config dict + optional code env name). */
17
+ export interface PluginSettings {
18
+ config?: Record<string, unknown>;
19
+ codeEnvName?: string;
20
+ [key: string]: unknown;
21
+ }
22
+ /** One usage entry of a plugin element, as returned by listUsages. */
23
+ export interface PluginUsage {
24
+ elementKind?: string;
25
+ elementType?: string;
26
+ objectId?: string;
27
+ objectType?: string;
28
+ projectKey?: string;
29
+ [key: string]: unknown;
30
+ }
31
+ /** One missing-type entry of a plugin usage analysis. */
32
+ export interface PluginMissingType {
33
+ missingType?: string;
34
+ objectId?: string;
35
+ objectType?: string;
36
+ projectKey?: string;
37
+ [key: string]: unknown;
38
+ }
39
+ export interface PluginUsageReport {
40
+ usages?: PluginUsage[];
41
+ missingTypes?: PluginMissingType[];
42
+ [key: string]: unknown;
43
+ }
44
+ /** Contents-tree item of a dev plugin (mirrors the library listing shape). */
45
+ export interface PluginContentItem {
46
+ name: string;
47
+ /** Full plugin-relative path as observed from DSS contents listings. */
48
+ path?: string;
49
+ mimeType?: string;
50
+ size?: number;
51
+ hasData?: boolean;
52
+ lastModified?: number;
53
+ children?: PluginContentItem[];
54
+ [key: string]: unknown;
55
+ }
56
+ /** Detail record of a single plugin file (`/plugins/{id}/details/{path}`). */
57
+ export interface PluginFileDetails {
58
+ name?: string;
59
+ path?: string;
60
+ mimeType?: string;
61
+ size?: number;
62
+ hasData?: boolean;
63
+ readOnly?: boolean;
64
+ lastModified?: number;
65
+ [key: string]: unknown;
66
+ }
67
+ /** Git remote info of a dev plugin (`repositoryUrl` is null when unset). */
68
+ export interface PluginGitRemote {
69
+ repositoryUrl: string | null;
70
+ [key: string]: unknown;
71
+ }
72
+ /** Options for creating a development plugin. */
73
+ export interface PluginCreateDevOptions {
74
+ pluginId: string;
75
+ creationMode: "EMPTY" | "GIT_CLONE" | "GIT_EXPORT";
76
+ gitRepository?: string;
77
+ gitCheckout?: string;
78
+ gitSubpath?: string;
79
+ }
80
+ /** Options for installing/updating a plugin from Git. */
81
+ export interface PluginGitInstallOptions {
82
+ gitRepositoryUrl: string;
83
+ gitCheckout?: string;
84
+ gitSubpath?: string;
85
+ }
86
+ /** Options for creating the code env of a plugin. */
87
+ export interface PluginCodeEnvCreateOptions {
88
+ conda?: boolean;
89
+ pythonInterpreter?: string;
90
+ }
91
+ /** Scope selectors for plugin settings and usage analysis. */
92
+ export interface PluginProjectScopeOptions {
93
+ projectKey?: string;
94
+ }
95
+ /**
96
+ * Validate a plugin identifier. Plugin ids select the API route segment, so a
97
+ * hostile id must not be able to change which resource the URL addresses.
98
+ */
99
+ export declare function validatePluginId(pluginId: string): string;
100
+ /**
101
+ * Validate and canonicalize a path inside a plugin. Mirrors the project
102
+ * library validator: rejects empty paths, control characters, backslashes,
103
+ * empty segments, '.'/'..' traversals, whitespace-only or edge-whitespace
104
+ * segments, and trailing dot/space segments.
105
+ *
106
+ * Returns the canonical path with any leading '/' stripped (the contents
107
+ * endpoints take paths relative to the plugin root).
108
+ */
109
+ export declare function validatePluginPath(path: string): string;
110
+ /**
111
+ * Validate a destination folder for a plugin contents move. '/' (the plugin
112
+ * root) is valid; any other path must pass {@link validatePluginPath}.
113
+ * Returns the canonical destination ('/' or '/<path>').
114
+ */
115
+ export declare function validatePluginDestinationPath(path: string): string;
116
+ /** Validate a rename target: a single plugin path segment, no '/'. */
117
+ export declare function validatePluginName(name: string): string;
118
+ /** Validate and URL-encode each segment of a plugin path for endpoint use. */
119
+ export declare function encodePluginPath(path: string): string;
120
+ /**
121
+ * The documented Plugins REST section (DSS 15): instance-level plugin
122
+ * administration under `/public/api/plugins/...`. All endpoints require admin
123
+ * or plugin-developer privileges server-side.
124
+ */
125
+ export declare class PluginsResource extends BaseResource {
126
+ /** List installed plugins (including dev plugins). */
127
+ list(): Promise<PluginSummary[]>;
128
+ /**
129
+ * Install a plugin from a local zip file. Fails if already installed.
130
+ * Resolves only after the installation completed: when DSS answers with a
131
+ * future receipt the future is settled before returning.
132
+ */
133
+ installFromZip(filePath: string): Promise<void>;
134
+ /** Install a plugin from the Dataiku store. Fails if already installed. */
135
+ installFromStore(pluginId: string): Promise<void>;
136
+ /** Install a plugin by checking out a Git repository. Fails if already installed. */
137
+ installFromGit(options: PluginGitInstallOptions): Promise<void>;
138
+ /** Download a development plugin as a zip archive. */
139
+ download(pluginId: string): Promise<Response>;
140
+ /**
141
+ * Update a plugin from a local zip file. Fails if not already installed.
142
+ * Resolves only after the update completed (future receipt settled).
143
+ */
144
+ updateFromZip(pluginId: string, filePath: string): Promise<void>;
145
+ /** Update a plugin from the Dataiku Store. */
146
+ updateFromStore(pluginId: string): Promise<void>;
147
+ /**
148
+ * Update an installed plugin from Git. Fails if the plugin is not already
149
+ * installed. Resolves only after the update completed (future settled).
150
+ */
151
+ updateFromGit(pluginId: string, options: PluginGitInstallOptions): Promise<void>;
152
+ /**
153
+ * Move an installed plugin to the development environment. Resolves only
154
+ * after the move completed (future receipt settled).
155
+ */
156
+ moveToDev(pluginId: string): Promise<void>;
157
+ /**
158
+ * Delete a plugin; refuses when usages exist unless `force` is set.
159
+ * Resolves only after the deletion completed: DSS answers this route with
160
+ * a future, so reporting success before the future settles would leave
161
+ * the plugin briefly present after the call returned.
162
+ */
163
+ delete(pluginId: string, options?: {
164
+ force?: boolean;
165
+ }): Promise<void>;
166
+ /** Get plugin settings (optionally scoped to a project). */
167
+ getSettings(pluginId: string, options?: PluginProjectScopeOptions): Promise<PluginSettings>;
168
+ /**
169
+ * Replace plugin settings. DSS expects a settings object previously
170
+ * obtained through {@link getSettings}; `config` and `codeEnvName` are
171
+ * the documented fields and any extra keys the caller read are forwarded.
172
+ */
173
+ setSettings(pluginId: string, settings: PluginSettings, options?: PluginProjectScopeOptions): Promise<void>;
174
+ /** List usages of the plugin's elements, optionally scoped to a project. */
175
+ listUsages(pluginId: string, options?: PluginProjectScopeOptions): Promise<PluginUsageReport>;
176
+ /**
177
+ * Create the code env of a plugin. Returns the DSS future handle
178
+ * (`{jobId}`). The request carries the plugin-managed deployment mode and
179
+ * an explicit interpreter (null = the plugin's default), exactly as the
180
+ * official Python client sends it.
181
+ */
182
+ createCodeEnv(pluginId: string, options?: PluginCodeEnvCreateOptions): Promise<{
183
+ jobId: string;
184
+ } & Record<string, unknown>>;
185
+ /** Update the code env of a plugin. Returns the DSS future handle. */
186
+ updateCodeEnv(pluginId: string): Promise<{
187
+ jobId: string;
188
+ } & Record<string, unknown>>;
189
+ /** Create a new development plugin (empty, cloned, or exported from Git). */
190
+ createDev(options: PluginCreateDevOptions): Promise<void>;
191
+ /** Get the Git remote declared for a dev plugin (null when unset). */
192
+ getGitRemote(pluginId: string): Promise<PluginGitRemote>;
193
+ /** Set (create or replace) the Git remote of a dev plugin. */
194
+ setGitRemote(pluginId: string, repositoryUrl: string): Promise<PluginGitRemote>;
195
+ /** Delete the Git remote declared for a dev plugin. */
196
+ deleteGitRemote(pluginId: string): Promise<void>;
197
+ /**
198
+ * List the Git branches of a dev plugin. Observed DSS 15 contract: GET
199
+ * `/plugins/{pluginId}/gitBranches` answers `200 ["master"]`. The upstream
200
+ * DSS 15 REST reference documents POST for this path, but the live API
201
+ * answers that POST with 405 Method Not Allowed (upstream method wrong);
202
+ * this SDK uses the observed GET, with no POST fallback.
203
+ */
204
+ listGitBranches(pluginId: string): Promise<string[]>;
205
+ /** Push the dev plugin's content to its previously-declared Git remote. */
206
+ push(pluginId: string): Promise<Record<string, unknown>>;
207
+ /** Pull (and rebase) the dev plugin's content from its Git remote. */
208
+ pull(pluginId: string): Promise<Record<string, unknown>>;
209
+ /** Fetch the dev plugin's content from its Git remote. */
210
+ fetch(pluginId: string): Promise<Record<string, unknown>>;
211
+ /** Reset the dev plugin to its local HEAD state (discards local edits). */
212
+ resetToLocalHeadState(pluginId: string): Promise<Record<string, unknown>>;
213
+ /** Reset the dev plugin to the remote HEAD state (discards local work). */
214
+ resetToRemoteHeadState(pluginId: string): Promise<Record<string, unknown>>;
215
+ private devGitAction;
216
+ /**
217
+ * Settle a plugin action's future receipt. Plugin action endpoints answer
218
+ * with `{jobId}` when DSS processes the action asynchronously, and with an
219
+ * empty or already-settled body for synchronous ones — the official
220
+ * Python client's `DSSFuture.from_resp` accepts a missing jobId and its
221
+ * `wait_for_result` treats a jobless state as already complete. A jobless
222
+ * receipt is returned as-is (no fake wait); a jobId is polled through the
223
+ * shared futures waiter so callers only observe completion.
224
+ */
225
+ private settleActionFuture;
226
+ /** List the contents tree of a dev plugin. */
227
+ listContents(pluginId: string): Promise<PluginContentItem[]>;
228
+ /**
229
+ * Read a dev plugin file as text. DSS answers this route with the raw file
230
+ * body (no JSON envelope, `dataEncoding` is not honored), so the response
231
+ * is read as text directly.
232
+ */
233
+ getFile(pluginId: string, path: string): Promise<string>;
234
+ /** Read a dev plugin file as raw bytes (same raw-body route as getFile). */
235
+ getFileBytes(pluginId: string, path: string): Promise<Uint8Array>;
236
+ /** Download a dev plugin file as a raw stream (binary-safe). */
237
+ downloadFile(pluginId: string, path: string): Promise<Response>;
238
+ /** Get a single plugin file's detail record (size, mime, timestamps). */
239
+ getFileDetails(pluginId: string, path: string): Promise<PluginFileDetails>;
240
+ /** Upload (create or replace) a dev plugin file with text or binary content. */
241
+ putFile(pluginId: string, path: string, content: string | Uint8Array): Promise<void>;
242
+ /** Delete a file (or folder) from a dev plugin. */
243
+ deleteFile(pluginId: string, path: string): Promise<void>;
244
+ /** Add a folder to a dev plugin. */
245
+ addFolder(pluginId: string, path: string): Promise<void>;
246
+ /** Rename a file or folder inside a dev plugin (same parent folder). */
247
+ rename(pluginId: string, path: string, newName: string): Promise<void>;
248
+ /** Move a file or folder inside a dev plugin. The destination folder must exist. */
249
+ move(pluginId: string, path: string, destinationFolderPath: string): Promise<void>;
250
+ private contentsPath;
251
+ }
252
+ /**
253
+ * Reject `https://user:token@host/repo` before it reaches DSS for plugin Git
254
+ * install/update/dev-create and the dev-plugin Git remote. Same policy as the
255
+ * project Git remotes: HTTP(S) URLs must not embed credentials; SSH and
256
+ * scp-style remotes stay allowed.
257
+ */
258
+ export declare function validatedPluginGitUrl(repository: string, field?: string): string;
259
+ /**
260
+ * True when a value is a usable plugin id shape without throwing — used by the
261
+ * CLI to decide which actions need a plugin id positional.
262
+ */
263
+ export declare function isPluginIdCandidate(value: unknown): boolean;