@collage-dam/mcp-server 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/.env.example +56 -0
- package/CHANGELOG.md +90 -0
- package/LICENSE +21 -0
- package/README.md +512 -0
- package/dist/client.d.ts +497 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1162 -0
- package/dist/client.js.map +1 -0
- package/dist/conventions/confirmation.d.ts +89 -0
- package/dist/conventions/confirmation.d.ts.map +1 -0
- package/dist/conventions/confirmation.js +132 -0
- package/dist/conventions/confirmation.js.map +1 -0
- package/dist/conventions/dry-run/batch-executor.d.ts +36 -0
- package/dist/conventions/dry-run/batch-executor.d.ts.map +1 -0
- package/dist/conventions/dry-run/batch-executor.js +89 -0
- package/dist/conventions/dry-run/batch-executor.js.map +1 -0
- package/dist/conventions/dry-run/diff-renderer.d.ts +34 -0
- package/dist/conventions/dry-run/diff-renderer.d.ts.map +1 -0
- package/dist/conventions/dry-run/diff-renderer.js +158 -0
- package/dist/conventions/dry-run/diff-renderer.js.map +1 -0
- package/dist/conventions/dry-run/index.d.ts +13 -0
- package/dist/conventions/dry-run/index.d.ts.map +1 -0
- package/dist/conventions/dry-run/index.js +10 -0
- package/dist/conventions/dry-run/index.js.map +1 -0
- package/dist/conventions/dry-run/mutating-tool.d.ts +64 -0
- package/dist/conventions/dry-run/mutating-tool.d.ts.map +1 -0
- package/dist/conventions/dry-run/mutating-tool.js +88 -0
- package/dist/conventions/dry-run/mutating-tool.js.map +1 -0
- package/dist/conventions/dry-run/summary.d.ts +66 -0
- package/dist/conventions/dry-run/summary.d.ts.map +1 -0
- package/dist/conventions/dry-run/summary.js +185 -0
- package/dist/conventions/dry-run/summary.js.map +1 -0
- package/dist/conventions/dry-run/types.d.ts +597 -0
- package/dist/conventions/dry-run/types.d.ts.map +1 -0
- package/dist/conventions/dry-run/types.js +108 -0
- package/dist/conventions/dry-run/types.js.map +1 -0
- package/dist/conventions/dry-run/with-dry-run.d.ts +66 -0
- package/dist/conventions/dry-run/with-dry-run.d.ts.map +1 -0
- package/dist/conventions/dry-run/with-dry-run.js +219 -0
- package/dist/conventions/dry-run/with-dry-run.js.map +1 -0
- package/dist/conventions/env.d.ts +49 -0
- package/dist/conventions/env.d.ts.map +1 -0
- package/dist/conventions/env.js +84 -0
- package/dist/conventions/env.js.map +1 -0
- package/dist/conventions/errors.d.ts +68 -0
- package/dist/conventions/errors.d.ts.map +1 -0
- package/dist/conventions/errors.js +81 -0
- package/dist/conventions/errors.js.map +1 -0
- package/dist/conventions/logger.d.ts +28 -0
- package/dist/conventions/logger.d.ts.map +1 -0
- package/dist/conventions/logger.js +105 -0
- package/dist/conventions/logger.js.map +1 -0
- package/dist/conventions/pagination.d.ts +37 -0
- package/dist/conventions/pagination.d.ts.map +1 -0
- package/dist/conventions/pagination.js +53 -0
- package/dist/conventions/pagination.js.map +1 -0
- package/dist/conventions/rate-limiter.d.ts +54 -0
- package/dist/conventions/rate-limiter.d.ts.map +1 -0
- package/dist/conventions/rate-limiter.js +143 -0
- package/dist/conventions/rate-limiter.js.map +1 -0
- package/dist/conventions/response-budget.d.ts +66 -0
- package/dist/conventions/response-budget.d.ts.map +1 -0
- package/dist/conventions/response-budget.js +89 -0
- package/dist/conventions/response-budget.js.map +1 -0
- package/dist/conventions/schema-version.d.ts +27 -0
- package/dist/conventions/schema-version.d.ts.map +1 -0
- package/dist/conventions/schema-version.js +29 -0
- package/dist/conventions/schema-version.js.map +1 -0
- package/dist/conventions/state-store-redis.d.ts +32 -0
- package/dist/conventions/state-store-redis.d.ts.map +1 -0
- package/dist/conventions/state-store-redis.js +77 -0
- package/dist/conventions/state-store-redis.js.map +1 -0
- package/dist/conventions/state-store.d.ts +46 -0
- package/dist/conventions/state-store.d.ts.map +1 -0
- package/dist/conventions/state-store.js +105 -0
- package/dist/conventions/state-store.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +421 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/collection-audit.d.ts +13 -0
- package/dist/prompts/collection-audit.d.ts.map +1 -0
- package/dist/prompts/collection-audit.js +168 -0
- package/dist/prompts/collection-audit.js.map +1 -0
- package/dist/prompts/create-distribution.d.ts +15 -0
- package/dist/prompts/create-distribution.d.ts.map +1 -0
- package/dist/prompts/create-distribution.js +111 -0
- package/dist/prompts/create-distribution.js.map +1 -0
- package/dist/prompts/helpers.d.ts +20 -0
- package/dist/prompts/helpers.d.ts.map +1 -0
- package/dist/prompts/helpers.js +53 -0
- package/dist/prompts/helpers.js.map +1 -0
- package/dist/prompts/library-health-audit.d.ts +13 -0
- package/dist/prompts/library-health-audit.d.ts.map +1 -0
- package/dist/prompts/library-health-audit.js +131 -0
- package/dist/prompts/library-health-audit.js.map +1 -0
- package/dist/prompts/usage-insights.d.ts +13 -0
- package/dist/prompts/usage-insights.d.ts.map +1 -0
- package/dist/prompts/usage-insights.js +98 -0
- package/dist/prompts/usage-insights.js.map +1 -0
- package/dist/prompts/wrap-prompt-as-tool.d.ts +48 -0
- package/dist/prompts/wrap-prompt-as-tool.d.ts.map +1 -0
- package/dist/prompts/wrap-prompt-as-tool.js +61 -0
- package/dist/prompts/wrap-prompt-as-tool.js.map +1 -0
- package/dist/resources/asset-by-id.d.ts +4 -0
- package/dist/resources/asset-by-id.d.ts.map +1 -0
- package/dist/resources/asset-by-id.js +27 -0
- package/dist/resources/asset-by-id.js.map +1 -0
- package/dist/resources/collections.d.ts +5 -0
- package/dist/resources/collections.d.ts.map +1 -0
- package/dist/resources/collections.js +48 -0
- package/dist/resources/collections.js.map +1 -0
- package/dist/resources/custom-fields.d.ts +4 -0
- package/dist/resources/custom-fields.d.ts.map +1 -0
- package/dist/resources/custom-fields.js +30 -0
- package/dist/resources/custom-fields.js.map +1 -0
- package/dist/resources/folders.d.ts +5 -0
- package/dist/resources/folders.d.ts.map +1 -0
- package/dist/resources/folders.js +73 -0
- package/dist/resources/folders.js.map +1 -0
- package/dist/resources/helpers.d.ts +17 -0
- package/dist/resources/helpers.d.ts.map +1 -0
- package/dist/resources/helpers.js +59 -0
- package/dist/resources/helpers.js.map +1 -0
- package/dist/resources/portals.d.ts +5 -0
- package/dist/resources/portals.d.ts.map +1 -0
- package/dist/resources/portals.js +81 -0
- package/dist/resources/portals.js.map +1 -0
- package/dist/resources/recent-and-dashboard.d.ts +5 -0
- package/dist/resources/recent-and-dashboard.d.ts.map +1 -0
- package/dist/resources/recent-and-dashboard.js +42 -0
- package/dist/resources/recent-and-dashboard.js.map +1 -0
- package/dist/tools/asset-selection.d.ts +102 -0
- package/dist/tools/asset-selection.d.ts.map +1 -0
- package/dist/tools/asset-selection.js +133 -0
- package/dist/tools/asset-selection.js.map +1 -0
- package/dist/tools/audit/audit-folder-structure.d.ts +108 -0
- package/dist/tools/audit/audit-folder-structure.d.ts.map +1 -0
- package/dist/tools/audit/audit-folder-structure.js +260 -0
- package/dist/tools/audit/audit-folder-structure.js.map +1 -0
- package/dist/tools/audit/audit-naming-conventions.d.ts +83 -0
- package/dist/tools/audit/audit-naming-conventions.d.ts.map +1 -0
- package/dist/tools/audit/audit-naming-conventions.js +238 -0
- package/dist/tools/audit/audit-naming-conventions.js.map +1 -0
- package/dist/tools/audit/audit-tagging-hygiene.d.ts +77 -0
- package/dist/tools/audit/audit-tagging-hygiene.d.ts.map +1 -0
- package/dist/tools/audit/audit-tagging-hygiene.js +402 -0
- package/dist/tools/audit/audit-tagging-hygiene.js.map +1 -0
- package/dist/tools/audit/detect-duplicates.d.ts +62 -0
- package/dist/tools/audit/detect-duplicates.d.ts.map +1 -0
- package/dist/tools/audit/detect-duplicates.js +0 -0
- package/dist/tools/audit/detect-duplicates.js.map +1 -0
- package/dist/tools/audit/types.d.ts +526 -0
- package/dist/tools/audit/types.d.ts.map +1 -0
- package/dist/tools/audit/types.js +188 -0
- package/dist/tools/audit/types.js.map +1 -0
- package/dist/tools/bulk-move-assets.d.ts +78 -0
- package/dist/tools/bulk-move-assets.d.ts.map +1 -0
- package/dist/tools/bulk-move-assets.js +122 -0
- package/dist/tools/bulk-move-assets.js.map +1 -0
- package/dist/tools/bulk-normalize-filenames.d.ts +62 -0
- package/dist/tools/bulk-normalize-filenames.d.ts.map +1 -0
- package/dist/tools/bulk-normalize-filenames.js +237 -0
- package/dist/tools/bulk-normalize-filenames.js.map +1 -0
- package/dist/tools/bulk-rename-assets.d.ts +79 -0
- package/dist/tools/bulk-rename-assets.d.ts.map +1 -0
- package/dist/tools/bulk-rename-assets.js +139 -0
- package/dist/tools/bulk-rename-assets.js.map +1 -0
- package/dist/tools/bulk-tags.d.ts +107 -0
- package/dist/tools/bulk-tags.d.ts.map +1 -0
- package/dist/tools/bulk-tags.js +220 -0
- package/dist/tools/bulk-tags.js.map +1 -0
- package/dist/tools/client-adapters.d.ts +76 -0
- package/dist/tools/client-adapters.d.ts.map +1 -0
- package/dist/tools/client-adapters.js +648 -0
- package/dist/tools/client-adapters.js.map +1 -0
- package/dist/tools/collection-membership.d.ts +90 -0
- package/dist/tools/collection-membership.d.ts.map +1 -0
- package/dist/tools/collection-membership.js +195 -0
- package/dist/tools/collection-membership.js.map +1 -0
- package/dist/tools/create-collection.d.ts +63 -0
- package/dist/tools/create-collection.d.ts.map +1 -0
- package/dist/tools/create-collection.js +151 -0
- package/dist/tools/create-collection.js.map +1 -0
- package/dist/tools/create-folder.d.ts +46 -0
- package/dist/tools/create-folder.d.ts.map +1 -0
- package/dist/tools/create-folder.js +83 -0
- package/dist/tools/create-folder.js.map +1 -0
- package/dist/tools/create-share-link.d.ts +107 -0
- package/dist/tools/create-share-link.d.ts.map +1 -0
- package/dist/tools/create-share-link.js +239 -0
- package/dist/tools/create-share-link.js.map +1 -0
- package/dist/tools/get-asset-details.d.ts +401 -0
- package/dist/tools/get-asset-details.d.ts.map +1 -0
- package/dist/tools/get-asset-details.js +56 -0
- package/dist/tools/get-asset-details.js.map +1 -0
- package/dist/tools/get-collection.d.ts +126 -0
- package/dist/tools/get-collection.d.ts.map +1 -0
- package/dist/tools/get-collection.js +52 -0
- package/dist/tools/get-collection.js.map +1 -0
- package/dist/tools/get-embed-code.d.ts +195 -0
- package/dist/tools/get-embed-code.d.ts.map +1 -0
- package/dist/tools/get-embed-code.js +214 -0
- package/dist/tools/get-embed-code.js.map +1 -0
- package/dist/tools/insights/analyze-share-links.d.ts +159 -0
- package/dist/tools/insights/analyze-share-links.d.ts.map +1 -0
- package/dist/tools/insights/analyze-share-links.js +314 -0
- package/dist/tools/insights/analyze-share-links.js.map +1 -0
- package/dist/tools/insights/insight-cache.d.ts +36 -0
- package/dist/tools/insights/insight-cache.d.ts.map +1 -0
- package/dist/tools/insights/insight-cache.js +98 -0
- package/dist/tools/insights/insight-cache.js.map +1 -0
- package/dist/tools/insights/report-asset-activation.d.ts +149 -0
- package/dist/tools/insights/report-asset-activation.d.ts.map +1 -0
- package/dist/tools/insights/report-asset-activation.js +380 -0
- package/dist/tools/insights/report-asset-activation.js.map +1 -0
- package/dist/tools/insights/report-stale-assets.d.ts +120 -0
- package/dist/tools/insights/report-stale-assets.d.ts.map +1 -0
- package/dist/tools/insights/report-stale-assets.js +281 -0
- package/dist/tools/insights/report-stale-assets.js.map +1 -0
- package/dist/tools/insights/report-top-assets.d.ts +139 -0
- package/dist/tools/insights/report-top-assets.d.ts.map +1 -0
- package/dist/tools/insights/report-top-assets.js +407 -0
- package/dist/tools/insights/report-top-assets.js.map +1 -0
- package/dist/tools/list-categories.d.ts +127 -0
- package/dist/tools/list-categories.d.ts.map +1 -0
- package/dist/tools/list-categories.js +68 -0
- package/dist/tools/list-categories.js.map +1 -0
- package/dist/tools/list-collections.d.ts +127 -0
- package/dist/tools/list-collections.d.ts.map +1 -0
- package/dist/tools/list-collections.js +53 -0
- package/dist/tools/list-collections.js.map +1 -0
- package/dist/tools/list-custom-fields.d.ts +125 -0
- package/dist/tools/list-custom-fields.d.ts.map +1 -0
- package/dist/tools/list-custom-fields.js +51 -0
- package/dist/tools/list-custom-fields.js.map +1 -0
- package/dist/tools/list-share-links.d.ts +192 -0
- package/dist/tools/list-share-links.d.ts.map +1 -0
- package/dist/tools/list-share-links.js +92 -0
- package/dist/tools/list-share-links.js.map +1 -0
- package/dist/tools/list-workspaces.d.ts +88 -0
- package/dist/tools/list-workspaces.d.ts.map +1 -0
- package/dist/tools/list-workspaces.js +71 -0
- package/dist/tools/list-workspaces.js.map +1 -0
- package/dist/tools/move-asset.d.ts +48 -0
- package/dist/tools/move-asset.d.ts.map +1 -0
- package/dist/tools/move-asset.js +85 -0
- package/dist/tools/move-asset.js.map +1 -0
- package/dist/tools/rename-asset.d.ts +88 -0
- package/dist/tools/rename-asset.d.ts.map +1 -0
- package/dist/tools/rename-asset.js +100 -0
- package/dist/tools/rename-asset.js.map +1 -0
- package/dist/tools/rename-folder.d.ts +55 -0
- package/dist/tools/rename-folder.d.ts.map +1 -0
- package/dist/tools/rename-folder.js +101 -0
- package/dist/tools/rename-folder.js.map +1 -0
- package/dist/tools/revoke-share-link.d.ts +55 -0
- package/dist/tools/revoke-share-link.d.ts.map +1 -0
- package/dist/tools/revoke-share-link.js +77 -0
- package/dist/tools/revoke-share-link.js.map +1 -0
- package/dist/tools/search/facets.d.ts +34 -0
- package/dist/tools/search/facets.d.ts.map +1 -0
- package/dist/tools/search/facets.js +147 -0
- package/dist/tools/search/facets.js.map +1 -0
- package/dist/tools/search/filter-builder.d.ts +33 -0
- package/dist/tools/search/filter-builder.d.ts.map +1 -0
- package/dist/tools/search/filter-builder.js +111 -0
- package/dist/tools/search/filter-builder.js.map +1 -0
- package/dist/tools/search/search-assets.d.ts +41 -0
- package/dist/tools/search/search-assets.d.ts.map +1 -0
- package/dist/tools/search/search-assets.js +162 -0
- package/dist/tools/search/search-assets.js.map +1 -0
- package/dist/tools/search/search-collections.d.ts +35 -0
- package/dist/tools/search/search-collections.d.ts.map +1 -0
- package/dist/tools/search/search-collections.js +103 -0
- package/dist/tools/search/search-collections.js.map +1 -0
- package/dist/tools/search/types.d.ts +1047 -0
- package/dist/tools/search/types.d.ts.map +1 -0
- package/dist/tools/search/types.js +216 -0
- package/dist/tools/search/types.js.map +1 -0
- package/dist/tools/update-asset-metadata.d.ts +78 -0
- package/dist/tools/update-asset-metadata.d.ts.map +1 -0
- package/dist/tools/update-asset-metadata.js +203 -0
- package/dist/tools/update-asset-metadata.js.map +1 -0
- package/dist/tools/update-collection.d.ts +69 -0
- package/dist/tools/update-collection.d.ts.map +1 -0
- package/dist/tools/update-collection.js +142 -0
- package/dist/tools/update-collection.js.map +1 -0
- package/dist/tools/view-category-contents.d.ts +231 -0
- package/dist/tools/view-category-contents.d.ts.map +1 -0
- package/dist/tools/view-category-contents.js +97 -0
- package/dist/tools/view-category-contents.js.map +1 -0
- package/dist/types.d.ts +1326 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +288 -0
- package/dist/types.js.map +1 -0
- package/dist/typesense.d.ts +84 -0
- package/dist/typesense.d.ts.map +1 -0
- package/dist/typesense.js +243 -0
- package/dist/typesense.js.map +1 -0
- package/docs/api-field-verification.md +244 -0
- package/docs/deployment-runbook.md +446 -0
- package/docs/security-review.md +195 -0
- package/docs/typesense-filter-schema.md +262 -0
- package/docs/verified-endpoints.md +38 -0
- package/package.json +72 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import type { Logger } from 'pino';
|
|
2
|
+
import type { AppConfig } from './conventions/env.js';
|
|
3
|
+
import { type McpToolError } from './conventions/errors.js';
|
|
4
|
+
import { TokenBucketRateLimiter } from './conventions/rate-limiter.js';
|
|
5
|
+
import { type AssetCustomField, type Category, type Collection, type CustomField, type DigitalAsset, type GenerateEmbedCodeResponse, type GenerateShareLinkResponse, type PaginatedAssetRow, type ShareLink, type ShareLinkListEnvelope } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Result wrapper used by all client methods.
|
|
8
|
+
* On success, `data` is the parsed body. On failure, `error` describes the
|
|
9
|
+
* canonical MCP error. Mutually exclusive — exactly one is defined.
|
|
10
|
+
*/
|
|
11
|
+
export type ClientResult<T> = {
|
|
12
|
+
ok: true;
|
|
13
|
+
data: T;
|
|
14
|
+
request_id: string;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
error: McpToolError;
|
|
18
|
+
request_id: string;
|
|
19
|
+
};
|
|
20
|
+
interface RequestOptions {
|
|
21
|
+
/** Whether to attach `?url_workspace_id=...` automatically (default: true). */
|
|
22
|
+
scoped?: boolean;
|
|
23
|
+
/** Additional query parameters merged with the workspace scope. */
|
|
24
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
25
|
+
/** Request body (JSON-serialised). */
|
|
26
|
+
body?: unknown;
|
|
27
|
+
/** Per-call timeout in milliseconds. Defaults to 30s. */
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface CollageClientOptions {
|
|
31
|
+
config: AppConfig;
|
|
32
|
+
logger?: Logger;
|
|
33
|
+
rateLimiter?: TokenBucketRateLimiter;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* HTTP client for the Collage DAM REST API.
|
|
37
|
+
*
|
|
38
|
+
* Responsibilities:
|
|
39
|
+
* - Bearer JWT auth (token from `COLLAGE_API_KEY`)
|
|
40
|
+
* - Workspace scoping via `?url_workspace_id=` on every request
|
|
41
|
+
* - Token-bucket rate limiting
|
|
42
|
+
* - Retry with exponential backoff on 429/5xx (honours `Retry-After`)
|
|
43
|
+
* - HTTP status → canonical `McpToolError` mapping
|
|
44
|
+
* - Per-request `request_id` propagation for tracing
|
|
45
|
+
*/
|
|
46
|
+
export declare class CollageClient {
|
|
47
|
+
private readonly baseUrl;
|
|
48
|
+
private readonly apiKey;
|
|
49
|
+
private readonly workspaceId;
|
|
50
|
+
private readonly limiter;
|
|
51
|
+
private readonly log;
|
|
52
|
+
constructor(opts: CollageClientOptions);
|
|
53
|
+
/** Workspace ID associated with this client (read-only). */
|
|
54
|
+
get scopedWorkspaceId(): string;
|
|
55
|
+
get<T>(path: string, options?: RequestOptions): Promise<ClientResult<T>>;
|
|
56
|
+
post<T>(path: string, options?: RequestOptions): Promise<ClientResult<T>>;
|
|
57
|
+
put<T>(path: string, options?: RequestOptions): Promise<ClientResult<T>>;
|
|
58
|
+
patch<T>(path: string, options?: RequestOptions): Promise<ClientResult<T>>;
|
|
59
|
+
delete<T>(path: string, options?: RequestOptions): Promise<ClientResult<T>>;
|
|
60
|
+
/**
|
|
61
|
+
* Perform a startup sanity check that the configured token can reach the
|
|
62
|
+
* configured workspace. Returns a normalised access result.
|
|
63
|
+
*
|
|
64
|
+
* Used by `src/index.ts` on boot to fail fast on misconfiguration.
|
|
65
|
+
*/
|
|
66
|
+
checkWorkspaceAccess(): Promise<ClientResult<{
|
|
67
|
+
has_access: boolean;
|
|
68
|
+
message?: string;
|
|
69
|
+
}>>;
|
|
70
|
+
/**
|
|
71
|
+
* GET /digital-assets/category/all-category-list
|
|
72
|
+
*
|
|
73
|
+
* Returns ROOT-LEVEL folders only — upstream is flat-by-design. Verified
|
|
74
|
+
* against `Admin-Frontend/pages/_workspace_id/dam/folders/index.vue` (the
|
|
75
|
+
* Folders index page calls this endpoint with the same params and only
|
|
76
|
+
* shows roots; nested folders load via `sub-category-list` on click).
|
|
77
|
+
*
|
|
78
|
+
* Use `listAllCategoriesRecursive()` when you need the full tree.
|
|
79
|
+
*
|
|
80
|
+
* Requires `workspace_id` in the query in addition to the global
|
|
81
|
+
* `?url_workspace_id=`. Without both, the upstream returns 402
|
|
82
|
+
* "Workspace is not available." (Ross Durbin, 2026-05-01.)
|
|
83
|
+
*/
|
|
84
|
+
listCategories(): Promise<ClientResult<Category[]>>;
|
|
85
|
+
/**
|
|
86
|
+
* Walks the workspace folder tree by combining `listCategories()` (roots)
|
|
87
|
+
* with `listSubCategories()` for each parent. Returns a flat list with
|
|
88
|
+
* `parent_id` populated on every row — null for roots — so callers can
|
|
89
|
+
* reconstruct the tree without recursing themselves.
|
|
90
|
+
*
|
|
91
|
+
* Behavior:
|
|
92
|
+
* - Breadth-first traversal, deduped by category id.
|
|
93
|
+
* - Bounded by `maxNodes` (default 5000) and `maxDepth` (default 16) to
|
|
94
|
+
* keep audit/enumeration runs predictable on huge workspaces.
|
|
95
|
+
* - Any non-ok subcategory fetch aborts the walk and propagates the error.
|
|
96
|
+
*/
|
|
97
|
+
listAllCategoriesRecursive(opts?: {
|
|
98
|
+
maxNodes?: number;
|
|
99
|
+
maxDepth?: number;
|
|
100
|
+
}): Promise<ClientResult<Category[]>>;
|
|
101
|
+
/**
|
|
102
|
+
* GET /digital-assets/category/sub-category-list
|
|
103
|
+
* Returns the immediate children of a folder. Same row shape as
|
|
104
|
+
* `all-category-list`. Requires `workspace_id` + `category_id` in the
|
|
105
|
+
* query in addition to the global `?url_workspace_id=`.
|
|
106
|
+
*/
|
|
107
|
+
listSubCategories(categoryId: number | string): Promise<ClientResult<Category[]>>;
|
|
108
|
+
/**
|
|
109
|
+
* GET /digital-assets/instance/get
|
|
110
|
+
* Returns the portal/instance configuration for the workspace. Shape is
|
|
111
|
+
* upstream-defined and not yet narrowed; callers should treat the result
|
|
112
|
+
* as opaque until a tool needs specific fields.
|
|
113
|
+
*/
|
|
114
|
+
getInstance(): Promise<ClientResult<unknown>>;
|
|
115
|
+
/**
|
|
116
|
+
* GET /digital-assets/dashboard/common-data
|
|
117
|
+
* Returns workspace dashboard stats (asset counts, storage, etc.). Shape
|
|
118
|
+
* is upstream-defined; narrow when wiring an insights tool.
|
|
119
|
+
*/
|
|
120
|
+
getDashboardCommonData(): Promise<ClientResult<unknown>>;
|
|
121
|
+
/**
|
|
122
|
+
* GET /digital-assets/get-recent-uploaded
|
|
123
|
+
* Paginated list of recently-uploaded assets. Shape mirrors the standard
|
|
124
|
+
* paginated-asset response but is left opaque here; narrow when wiring
|
|
125
|
+
* the `collage://assets/recent` resource.
|
|
126
|
+
*/
|
|
127
|
+
listRecentUploaded(params: {
|
|
128
|
+
page: number;
|
|
129
|
+
totalRecord: number;
|
|
130
|
+
}): Promise<ClientResult<unknown>>;
|
|
131
|
+
/**
|
|
132
|
+
* POST /digital-assets/category/add (parent_id absent)
|
|
133
|
+
* POST /digital-assets/category/add-sub-category (parent_id present)
|
|
134
|
+
*
|
|
135
|
+
* Source: `Admin-Frontend/components/dam/Dialogs/miniUploadBackdrop.vue:358,366`.
|
|
136
|
+
* Body shape:
|
|
137
|
+
* - top-level: { workspace_id, folder_name }
|
|
138
|
+
* - sub-folder: { workspace_id, folder_name, category_id }
|
|
139
|
+
* The two endpoints differ only by path; the body for sub-folders adds the
|
|
140
|
+
* parent's id under the (confusingly named) `category_id` key.
|
|
141
|
+
*
|
|
142
|
+
* Returns the new folder's id when the upstream surfaces it. The Collage
|
|
143
|
+
* envelope nests the projection under `data.id`; we tolerate either
|
|
144
|
+
* `data.id` or a top-level `id` field.
|
|
145
|
+
*/
|
|
146
|
+
createCategory(input: {
|
|
147
|
+
folder_name: string;
|
|
148
|
+
parent_id?: number | string | null;
|
|
149
|
+
}): Promise<ClientResult<{
|
|
150
|
+
id: number | string;
|
|
151
|
+
}>>;
|
|
152
|
+
/**
|
|
153
|
+
* POST /digital-assets/category/rename/{id}
|
|
154
|
+
* Source: `Admin-Frontend/pages/_workspace_id/dam/folders/index.vue:1281`.
|
|
155
|
+
* Body: { workspace_id, folder_name, description? }
|
|
156
|
+
*/
|
|
157
|
+
renameCategory(categoryId: number | string, input: {
|
|
158
|
+
folder_name: string;
|
|
159
|
+
description?: string | null;
|
|
160
|
+
}): Promise<ClientResult<{
|
|
161
|
+
message?: string;
|
|
162
|
+
}>>;
|
|
163
|
+
/**
|
|
164
|
+
* POST /digital-assets/multiple-file-folder-move
|
|
165
|
+
* Source: `Admin-Frontend/components/dam/Dialogs/FolderDialogs/FolderDialog.vue:1471`.
|
|
166
|
+
* Body: { workspace_id, assets_ids: number[], category_ids: number[], move_id: destFolderId }
|
|
167
|
+
*
|
|
168
|
+
* `move_id` is the destination category id. Pass null to move into the
|
|
169
|
+
* uncategorised root (the frontend uses null when destination is "no
|
|
170
|
+
* folder" — verify against your workspace before relying on that).
|
|
171
|
+
*/
|
|
172
|
+
moveAssetsAndFolders(input: {
|
|
173
|
+
asset_ids: Array<number | string>;
|
|
174
|
+
folder_ids: Array<number | string>;
|
|
175
|
+
destination_id: number | string | null;
|
|
176
|
+
}): Promise<ClientResult<{
|
|
177
|
+
message?: string;
|
|
178
|
+
}>>;
|
|
179
|
+
/**
|
|
180
|
+
* GET /digital-assets/collection/get-all
|
|
181
|
+
* Returns the user's saved DAM collections for the workspace.
|
|
182
|
+
*/
|
|
183
|
+
listCollections(): Promise<ClientResult<Collection[]>>;
|
|
184
|
+
/**
|
|
185
|
+
* GET /digital-assets/collection/get-all (filtered to a single id).
|
|
186
|
+
*
|
|
187
|
+
* The Collage REST API exposes only a list endpoint for collections;
|
|
188
|
+
* there is no per-id route. We fetch the full list and filter
|
|
189
|
+
* client-side so the MCP `get_collection` tool has the same single-row
|
|
190
|
+
* read affordance as the rest of the read-side API surface. For
|
|
191
|
+
* workspaces with thousands of collections this trade-off is fine:
|
|
192
|
+
* the list is small (< few hundred typical) and the upstream caches it.
|
|
193
|
+
*/
|
|
194
|
+
getCollection(collectionId: number | string): Promise<ClientResult<Collection>>;
|
|
195
|
+
/**
|
|
196
|
+
* GET /digital-assets/custom-field/list
|
|
197
|
+
*
|
|
198
|
+
* Returns the workspace-scoped custom-field definitions. Source:
|
|
199
|
+
* `Admin-Frontend/pages/_workspace_id/workspace-settings/custom-fields/index.vue:144`.
|
|
200
|
+
* Each row is shaped `{ id, field_label, field_type, status, ... }`.
|
|
201
|
+
* The endpoint requires `workspace_id` in the query string in addition
|
|
202
|
+
* to the global `?url_workspace_id=` (Collage uses both names — the
|
|
203
|
+
* frontend always sends both).
|
|
204
|
+
*/
|
|
205
|
+
listCustomFields(): Promise<ClientResult<CustomField[]>>;
|
|
206
|
+
/**
|
|
207
|
+
* POST /digital-assets/view-detail
|
|
208
|
+
* Returns full metadata for a single asset.
|
|
209
|
+
*
|
|
210
|
+
* Field-name quirk: the body param is `digital_assets_id`, NOT `asset_id`.
|
|
211
|
+
* The response is a richer projection than the raw `digital_assets` row —
|
|
212
|
+
* it joins in tag rows, breadcrumb, formatted file metadata, and signed
|
|
213
|
+
* S3 thumbnail/compress URLs (24h expiry).
|
|
214
|
+
*
|
|
215
|
+
* Read paths (`getAssetCurrentName`, `getAssetMetadata`, `getAssetTags`)
|
|
216
|
+
* are intentionally implemented as projections of this single response —
|
|
217
|
+
* see the adapters in `src/tools/client-adapters.ts`. There is no
|
|
218
|
+
* dedicated REST endpoint per field; the Admin-Frontend reads everything
|
|
219
|
+
* via this same `view-detail` call.
|
|
220
|
+
*/
|
|
221
|
+
getAssetDetails(assetId: number | string): Promise<ClientResult<DigitalAsset>>;
|
|
222
|
+
/**
|
|
223
|
+
* GET /digital-assets/embed-code-list
|
|
224
|
+
* Returns the embed-code share-link configurations.
|
|
225
|
+
*
|
|
226
|
+
* Schema is intentionally `unknown` until we observe a live response —
|
|
227
|
+
* keep the raw passthrough so the smoke tool can render whatever the
|
|
228
|
+
* upstream returns without rejecting fields we have not modelled yet.
|
|
229
|
+
*/
|
|
230
|
+
listEmbedCodes(): Promise<ClientResult<unknown>>;
|
|
231
|
+
/**
|
|
232
|
+
* POST /digital-assets/collection/create
|
|
233
|
+
* Body: { name, description? }
|
|
234
|
+
* Returns: envelope with { id, name, description, ... }
|
|
235
|
+
*/
|
|
236
|
+
createCollection(body: {
|
|
237
|
+
name: string;
|
|
238
|
+
description: string | null;
|
|
239
|
+
}): Promise<ClientResult<{
|
|
240
|
+
id: string | number;
|
|
241
|
+
name: string;
|
|
242
|
+
description: string | null;
|
|
243
|
+
}>>;
|
|
244
|
+
/**
|
|
245
|
+
* POST /digital-assets/collection/update/{id}
|
|
246
|
+
* Body: { name?, description? }
|
|
247
|
+
* Returns: envelope with the updated collection projection. The live
|
|
248
|
+
* response on BREZ (verified 2026-04-29) omits `id` at the top level —
|
|
249
|
+
* the path id is the canonical identity, so we fall it back through.
|
|
250
|
+
*/
|
|
251
|
+
updateCollection(collectionId: string, body: {
|
|
252
|
+
name?: string;
|
|
253
|
+
description?: string | null;
|
|
254
|
+
}): Promise<ClientResult<{
|
|
255
|
+
id: string | number;
|
|
256
|
+
name: string;
|
|
257
|
+
description: string | null;
|
|
258
|
+
}>>;
|
|
259
|
+
/**
|
|
260
|
+
* POST /digital-assets/collection/{id}/add-assets
|
|
261
|
+
* Body: { assets_id: (string|number)[] }
|
|
262
|
+
*/
|
|
263
|
+
addAssetsToCollection(collectionId: string, assetIds: Array<string | number>): Promise<ClientResult<{
|
|
264
|
+
message?: string;
|
|
265
|
+
}>>;
|
|
266
|
+
/**
|
|
267
|
+
* POST /digital-assets/collection/{id}/remove-assets
|
|
268
|
+
* Body: { assets_id: (string|number)[] }
|
|
269
|
+
*/
|
|
270
|
+
removeAssetsFromCollection(collectionId: string, assetIds: Array<string | number>): Promise<ClientResult<{
|
|
271
|
+
message?: string;
|
|
272
|
+
}>>;
|
|
273
|
+
/**
|
|
274
|
+
* GET /digital-assets/category/view-files-with-category
|
|
275
|
+
*
|
|
276
|
+
* Folder-scoped paginated asset listing. Used as the REST fallback for
|
|
277
|
+
* workspace-wide enumeration (Typesense is the primary path but is not
|
|
278
|
+
* yet wired). Response shape (verified via Admin-Frontend
|
|
279
|
+
* `pages/_workspace_id/dam/folders/_id/index.vue:3357`):
|
|
280
|
+
*
|
|
281
|
+
* { data: { assets_with_folder: { data: [...], last_page, total }, ... } }
|
|
282
|
+
*
|
|
283
|
+
* Each row in `assets_with_folder.data` is the raw `digital_assets` row
|
|
284
|
+
* (NOT the `view-detail` projection), so tag projection here only sees
|
|
285
|
+
* what `category/view-files-with-category` returns — which historically
|
|
286
|
+
* does NOT include the joined `tags` array. See `enumerateAssets` for
|
|
287
|
+
* how the audit tool tolerates that.
|
|
288
|
+
*/
|
|
289
|
+
listAssetsByCategory(categoryId: number | string, page: number, opts?: {
|
|
290
|
+
sortBy?: 'ASC' | 'DESC';
|
|
291
|
+
sortValue?: string;
|
|
292
|
+
}): Promise<ClientResult<{
|
|
293
|
+
assets: PaginatedAssetRow[];
|
|
294
|
+
lastPage: number;
|
|
295
|
+
total: number;
|
|
296
|
+
}>>;
|
|
297
|
+
/**
|
|
298
|
+
* Workspace-wide flat asset enumeration via folder iteration.
|
|
299
|
+
*
|
|
300
|
+
* Walks the FULL folder tree via `listAllCategoriesRecursive()` (roots
|
|
301
|
+
* plus every sub-folder) and paginates `listAssetsByCategory()` per
|
|
302
|
+
* folder to produce a flat `{id, tags?, ...}[]`. Used by the
|
|
303
|
+
* audit-tagging-hygiene tool. Tags come from `view-detail`-shaped rows
|
|
304
|
+
* when present, otherwise the row's `tags` field (often missing on the
|
|
305
|
+
* paginator response — callers must tolerate `tags=[]`).
|
|
306
|
+
*
|
|
307
|
+
* Prior to FU3 (2026-05-04) this only walked root folders, so any asset
|
|
308
|
+
* living in a nested folder was invisible to the audit.
|
|
309
|
+
*/
|
|
310
|
+
enumerateAssets(opts?: {
|
|
311
|
+
maxAssets?: number;
|
|
312
|
+
}): Promise<ClientResult<Array<{
|
|
313
|
+
id: string;
|
|
314
|
+
tags: string[];
|
|
315
|
+
}>>>;
|
|
316
|
+
/**
|
|
317
|
+
* POST /digital-assets/update-with-field
|
|
318
|
+
*
|
|
319
|
+
* Single-field update used by the Admin-Frontend rename and description
|
|
320
|
+
* edit flows. Source: `pages/_workspace_id/dam/files/_id.vue:2329` and
|
|
321
|
+
* `components/dam/SearchAssets.vue:1206`. Body shape:
|
|
322
|
+
*
|
|
323
|
+
* { workspace_id, digital_assets_id, field_name, field_value }
|
|
324
|
+
*
|
|
325
|
+
* Note `digital_assets_id` (not `asset_id`) and `workspace_id` is in the
|
|
326
|
+
* BODY too — even though the same value is also on the URL via
|
|
327
|
+
* `?url_workspace_id=`. The frontend always sends both; we mirror that.
|
|
328
|
+
*/
|
|
329
|
+
updateAssetField(assetId: number | string, fieldName: string, fieldValue: string | number | boolean | null): Promise<ClientResult<{
|
|
330
|
+
message?: string;
|
|
331
|
+
}>>;
|
|
332
|
+
/**
|
|
333
|
+
* POST /digital-assets/update-with-field with `field_name: 'display_file_name'`.
|
|
334
|
+
*
|
|
335
|
+
* The Admin-Frontend rename UI also concatenates the file extension
|
|
336
|
+
* (`${name}.${file_type}`). We do NOT do that here — callers pass the
|
|
337
|
+
* exact `display_file_name` they want, including any extension. This
|
|
338
|
+
* keeps the client a thin pass-through and lets the rename tool decide
|
|
339
|
+
* its own extension policy.
|
|
340
|
+
*/
|
|
341
|
+
renameAsset(assetId: number | string, newName: string): Promise<ClientResult<{
|
|
342
|
+
message?: string;
|
|
343
|
+
}>>;
|
|
344
|
+
/**
|
|
345
|
+
* GET /digital-assets/get-custom-fields
|
|
346
|
+
*
|
|
347
|
+
* Returns the per-asset custom-field projection (id, name, field_type,
|
|
348
|
+
* value, ...). Source: `pages/_workspace_id/dam/files/_id.vue:1319`.
|
|
349
|
+
* Used as the read side for `update_asset_metadata` so the dry-run plan
|
|
350
|
+
* can render a real diff. Schema is defensive — fields beyond
|
|
351
|
+
* {id, name, value} are passed through.
|
|
352
|
+
*/
|
|
353
|
+
getAssetCustomFields(assetId: number | string): Promise<ClientResult<AssetCustomField[]>>;
|
|
354
|
+
/**
|
|
355
|
+
* POST /digital-assets/update-custom-fields
|
|
356
|
+
*
|
|
357
|
+
* Bulk custom-field update. Source: `pages/_workspace_id/dam/files/_id.vue:2894`
|
|
358
|
+
* Body shape:
|
|
359
|
+
*
|
|
360
|
+
* { workspace_id, asset_ids: [id], updated_data: [{ id, value, ... }] }
|
|
361
|
+
*
|
|
362
|
+
* Each entry in `updated_data` is the projection returned by
|
|
363
|
+
* `get-custom-fields` with its `value` overwritten — the upstream
|
|
364
|
+
* matches by the field's row id.
|
|
365
|
+
*/
|
|
366
|
+
updateAssetCustomFields(assetId: number | string, updatedFields: ReadonlyArray<Record<string, unknown>>): Promise<ClientResult<{
|
|
367
|
+
message?: string;
|
|
368
|
+
}>>;
|
|
369
|
+
/**
|
|
370
|
+
* POST /digital-assets/add-tags-to-multiple-file
|
|
371
|
+
*
|
|
372
|
+
* Source: `components/dam/AssetList/AddTags.vue:86`. Body:
|
|
373
|
+
*
|
|
374
|
+
* { workspace_id, digital_assets_ids: [id, ...], tags: ['name', ...] }
|
|
375
|
+
*
|
|
376
|
+
* `tags` is an array of plain string names — the upstream creates new
|
|
377
|
+
* tag rows on demand. Idempotent on the server (duplicate adds are
|
|
378
|
+
* tolerated, surfaced via the `message` field).
|
|
379
|
+
*/
|
|
380
|
+
addTagsToAssets(assetIds: ReadonlyArray<number | string>, tagNames: ReadonlyArray<string>): Promise<ClientResult<{
|
|
381
|
+
message?: string;
|
|
382
|
+
}>>;
|
|
383
|
+
/**
|
|
384
|
+
* POST /digital-assets/delete-tag-from-multiple-file
|
|
385
|
+
*
|
|
386
|
+
* Source: `components/dam/Dialogs/AddTags/AddMultipleTags.vue:202` —
|
|
387
|
+
* the multi-select removal path uses `tag_name` (not `tag_id`), and
|
|
388
|
+
* `digital_assets_ids` is an array of `{ id }` objects. Single-asset
|
|
389
|
+
* removal uses `tag_id` instead. We use the multi-asset / `tag_name`
|
|
390
|
+
* shape so a single client method covers full-replace.
|
|
391
|
+
*
|
|
392
|
+
* { workspace_id, digital_assets_ids: [{ id }, ...], tag_name }
|
|
393
|
+
*
|
|
394
|
+
* One tag name per call — the upstream removes that tag from every
|
|
395
|
+
* provided asset.
|
|
396
|
+
*/
|
|
397
|
+
removeTagFromAssets(assetIds: ReadonlyArray<number | string>, tagName: string): Promise<ClientResult<{
|
|
398
|
+
message?: string;
|
|
399
|
+
}>>;
|
|
400
|
+
/**
|
|
401
|
+
* POST /digital-assets/dashboard/generate-share-assets-url
|
|
402
|
+
*
|
|
403
|
+
* Source: Admin-Frontend
|
|
404
|
+
* `components/dam/Dialogs/ShareAssetDialog/index.vue:399`. Body shape:
|
|
405
|
+
*
|
|
406
|
+
* { workspace_id, assets: number[], category: number[], title?, description?,
|
|
407
|
+
* password?, hide_download?: 0|1, expiration?: 'MMM D, YYYY' }
|
|
408
|
+
*
|
|
409
|
+
* Returns the generated share link projection
|
|
410
|
+
* (`{ data: { id, share_url, ... } }`).
|
|
411
|
+
*/
|
|
412
|
+
generateShareAssetsUrl(input: {
|
|
413
|
+
assets: ReadonlyArray<number | string>;
|
|
414
|
+
category: ReadonlyArray<number | string>;
|
|
415
|
+
title?: string;
|
|
416
|
+
description?: string | null;
|
|
417
|
+
password?: string | null;
|
|
418
|
+
hide_download?: 0 | 1;
|
|
419
|
+
expiration?: string | null;
|
|
420
|
+
}): Promise<ClientResult<GenerateShareLinkResponse>>;
|
|
421
|
+
/**
|
|
422
|
+
* POST /digital-assets/collection/generate-share-url
|
|
423
|
+
*
|
|
424
|
+
* Source: Admin-Frontend
|
|
425
|
+
* `components/dam/Dialogs/ShareAssetDialog/index.vue:520`. Body shape:
|
|
426
|
+
*
|
|
427
|
+
* { workspace_id, id (collection id), assets: number[], title?, description?,
|
|
428
|
+
* password?, hide_download?: 0|1, expiration?: 'MMM D, YYYY' }
|
|
429
|
+
*/
|
|
430
|
+
generateCollectionShareUrl(input: {
|
|
431
|
+
collection_id: number | string;
|
|
432
|
+
assets: ReadonlyArray<number | string>;
|
|
433
|
+
title?: string;
|
|
434
|
+
description?: string | null;
|
|
435
|
+
password?: string | null;
|
|
436
|
+
hide_download?: 0 | 1;
|
|
437
|
+
expiration?: string | null;
|
|
438
|
+
}): Promise<ClientResult<GenerateShareLinkResponse>>;
|
|
439
|
+
/**
|
|
440
|
+
* GET /digital-assets/dashboard/list-share-assets-url
|
|
441
|
+
*
|
|
442
|
+
* Source: Admin-Frontend
|
|
443
|
+
* `pages/_workspace_id/dam/sharing/index.vue:784`. Query shape:
|
|
444
|
+
*
|
|
445
|
+
* { workspace_id, page, total_record, filter_by?, sort_value?, sort_by? }
|
|
446
|
+
*
|
|
447
|
+
* Returns a Laravel paginator under `data`. `filter_by` accepts
|
|
448
|
+
* Admin-Frontend values like `'active'`, `'expired'`, `'revoked'`.
|
|
449
|
+
*/
|
|
450
|
+
listShareLinks(input: {
|
|
451
|
+
page: number;
|
|
452
|
+
pageSize: number;
|
|
453
|
+
filterBy?: string;
|
|
454
|
+
sortBy?: 'ASC' | 'DESC';
|
|
455
|
+
sortValue?: string;
|
|
456
|
+
}): Promise<ClientResult<ShareLinkListEnvelope>>;
|
|
457
|
+
/**
|
|
458
|
+
* Read a single share link by id (client-side filter over
|
|
459
|
+
* `listShareLinks`). Used for the revoke preview so the dry-run plan
|
|
460
|
+
* can show `before` state.
|
|
461
|
+
*/
|
|
462
|
+
getShareLink(shareId: number | string): Promise<ClientResult<ShareLink>>;
|
|
463
|
+
/**
|
|
464
|
+
* POST /digital-assets/dashboard/delete-share-assets-url
|
|
465
|
+
*
|
|
466
|
+
* Source: Admin-Frontend
|
|
467
|
+
* `pages/_workspace_id/dam/sharing/index.vue:1059`. Body shape:
|
|
468
|
+
*
|
|
469
|
+
* { workspace_id, share_url_id: number[] }
|
|
470
|
+
*
|
|
471
|
+
* The Admin-Frontend reuses this endpoint for both single-id and
|
|
472
|
+
* `revoke-all` flows; only the multi-id bulk endpoint
|
|
473
|
+
* (`delete-multiple-share-assets-url`) uses `share_url_ids`. We use
|
|
474
|
+
* the single-id path because `revoke_share_link` is a one-at-a-time tool.
|
|
475
|
+
*/
|
|
476
|
+
revokeShareLink(shareId: number | string): Promise<ClientResult<{
|
|
477
|
+
message?: string;
|
|
478
|
+
}>>;
|
|
479
|
+
/**
|
|
480
|
+
* GET /digital-assets/{id}/generate-embed-code
|
|
481
|
+
*
|
|
482
|
+
* Source: Admin-Frontend
|
|
483
|
+
* `components/dam/Dialogs/ShareAssetDialog/index.vue:476`. Read-only
|
|
484
|
+
* (the upstream caches and returns a stable embed snippet for the asset).
|
|
485
|
+
* Response shape: `{ data: { embed_code: '<iframe...>' } }`.
|
|
486
|
+
*/
|
|
487
|
+
generateEmbedCode(assetId: number | string): Promise<ClientResult<GenerateEmbedCodeResponse>>;
|
|
488
|
+
/**
|
|
489
|
+
* Internal helper: GET + zod-parse using `unwrapEnvelope` so callers can
|
|
490
|
+
* pass either the bare-array shape or `{ status, message, data: [...] }`.
|
|
491
|
+
*/
|
|
492
|
+
private parsedGet;
|
|
493
|
+
private buildUrl;
|
|
494
|
+
private request;
|
|
495
|
+
}
|
|
496
|
+
export {};
|
|
497
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,sBAAsB,EAEvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAYL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC3B,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,UAAU,cAAc;IACtB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,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