@epcc-sdk/sdks-files 0.3.0 → 0.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.
- package/README.md +73 -0
- package/dist/client/mcp-support.gen.cjs +209 -0
- package/dist/client/mcp-support.gen.cjs.map +1 -0
- package/dist/client/mcp-support.gen.d.cts +42 -0
- package/dist/client/mcp-support.gen.d.ts +42 -0
- package/dist/client/mcp-support.gen.mjs +172 -0
- package/dist/client/mcp-support.gen.mjs.map +1 -0
- package/dist/client/mcp.gen.cjs +203 -0
- package/dist/client/mcp.gen.cjs.map +1 -0
- package/dist/client/mcp.gen.d.cts +967 -0
- package/dist/client/mcp.gen.d.ts +967 -0
- package/dist/client/mcp.gen.mjs +175 -0
- package/dist/client/mcp.gen.mjs.map +1 -0
- package/dist/client/types.gen.cjs.map +1 -1
- package/dist/client/types.gen.d.cts +4 -4
- package/dist/client/types.gen.d.ts +4 -4
- package/dist/mcp.cjs +23 -0
- package/dist/mcp.cjs.map +1 -0
- package/dist/mcp.d.cts +14 -0
- package/dist/mcp.d.ts +14 -0
- package/dist/mcp.mjs +2 -0
- package/dist/mcp.mjs.map +1 -0
- package/package.json +23 -2
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import {
|
|
3
|
+
dataUriFields,
|
|
4
|
+
decodeDataUris,
|
|
5
|
+
loose,
|
|
6
|
+
toToolResult
|
|
7
|
+
} from "./mcp-support.gen.mjs";
|
|
8
|
+
import { createAFile, deleteAFile, getAFile, getAllFiles } from "./sdk.gen.mjs";
|
|
9
|
+
import {
|
|
10
|
+
zCreateAFileBody,
|
|
11
|
+
zDeleteAFilePath,
|
|
12
|
+
zGetAFilePath,
|
|
13
|
+
zGetAllFilesQuery
|
|
14
|
+
} from "./zod.gen.mjs";
|
|
15
|
+
const getAllFilesInput = z.object({
|
|
16
|
+
query: zGetAllFilesQuery.strict().optional()
|
|
17
|
+
}).strict();
|
|
18
|
+
const getAllFilesTool = (options) => {
|
|
19
|
+
const handler = (args, extra) => toToolResult(
|
|
20
|
+
getAllFiles({
|
|
21
|
+
...args,
|
|
22
|
+
client: options?.client,
|
|
23
|
+
signal: extra.signal,
|
|
24
|
+
throwOnError: false
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
return {
|
|
28
|
+
name: "files_get_all_files",
|
|
29
|
+
config: {
|
|
30
|
+
title: "Get all Files",
|
|
31
|
+
description: "Lists the files in the store, such as product images, videos and documents, with each file's link, name, type and size. Filter by file name, width, height or file size, or get several files at once by ID with the in operator; IDs that do not exist are left out without an error. Returns at most 100 files per page.",
|
|
32
|
+
inputSchema: getAllFilesInput,
|
|
33
|
+
annotations: {
|
|
34
|
+
readOnlyHint: true,
|
|
35
|
+
destructiveHint: false,
|
|
36
|
+
idempotentHint: true,
|
|
37
|
+
openWorldHint: true
|
|
38
|
+
},
|
|
39
|
+
_meta: {
|
|
40
|
+
"com.elasticpath/operation": {
|
|
41
|
+
id: "files.getAllFiles",
|
|
42
|
+
method: "GET",
|
|
43
|
+
path: "/v2/files",
|
|
44
|
+
risk: "read"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
handler
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const createAFileInput = z.object({
|
|
52
|
+
body: dataUriFields(loose(zCreateAFileBody), ["file"], 8388608)
|
|
53
|
+
}).strict();
|
|
54
|
+
const createAFileTool = (options) => {
|
|
55
|
+
const handler = (args, extra) => toToolResult(
|
|
56
|
+
decodeDataUris(args.body, ["file"], 8388608).then(
|
|
57
|
+
(body) => createAFile({
|
|
58
|
+
...args,
|
|
59
|
+
client: options?.client,
|
|
60
|
+
signal: extra.signal,
|
|
61
|
+
throwOnError: false,
|
|
62
|
+
body
|
|
63
|
+
})
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
return {
|
|
67
|
+
name: "files_create_a_file",
|
|
68
|
+
config: {
|
|
69
|
+
title: "Create a File",
|
|
70
|
+
description: "Uploads a file, such as a product image, video or PDF, or registers an image hosted elsewhere by its URL. Files are limited to 8MB by default; store a larger file elsewhere and register it by URL. Returns the new file's ID and link, which you use to attach the file to a product.",
|
|
71
|
+
inputSchema: createAFileInput,
|
|
72
|
+
annotations: {
|
|
73
|
+
readOnlyHint: false,
|
|
74
|
+
destructiveHint: false,
|
|
75
|
+
idempotentHint: false,
|
|
76
|
+
openWorldHint: true
|
|
77
|
+
},
|
|
78
|
+
_meta: {
|
|
79
|
+
"com.elasticpath/operation": {
|
|
80
|
+
id: "files.createAFile",
|
|
81
|
+
method: "POST",
|
|
82
|
+
path: "/v2/files",
|
|
83
|
+
risk: "create"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
handler
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
const deleteAFileInput = z.object({
|
|
91
|
+
path: zDeleteAFilePath.strict()
|
|
92
|
+
}).strict();
|
|
93
|
+
const deleteAFileTool = (options) => {
|
|
94
|
+
const handler = (args, extra) => toToolResult(
|
|
95
|
+
deleteAFile({
|
|
96
|
+
...args,
|
|
97
|
+
client: options?.client,
|
|
98
|
+
signal: extra.signal,
|
|
99
|
+
throwOnError: false
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
return {
|
|
103
|
+
name: "files_delete_a_file",
|
|
104
|
+
config: {
|
|
105
|
+
title: "Delete a File",
|
|
106
|
+
description: "Deletes a file from the store by its ID. To find a file's ID, list the files and filter by file name.",
|
|
107
|
+
inputSchema: deleteAFileInput,
|
|
108
|
+
annotations: {
|
|
109
|
+
readOnlyHint: false,
|
|
110
|
+
destructiveHint: true,
|
|
111
|
+
idempotentHint: true,
|
|
112
|
+
openWorldHint: true
|
|
113
|
+
},
|
|
114
|
+
_meta: {
|
|
115
|
+
"com.elasticpath/operation": {
|
|
116
|
+
id: "files.deleteAFile",
|
|
117
|
+
method: "DELETE",
|
|
118
|
+
path: "/v2/files/{fileID}",
|
|
119
|
+
risk: "delete"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
handler
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
const getAFileInput = z.object({
|
|
127
|
+
path: zGetAFilePath.strict()
|
|
128
|
+
}).strict();
|
|
129
|
+
const getAFileTool = (options) => {
|
|
130
|
+
const handler = (args, extra) => toToolResult(
|
|
131
|
+
getAFile({
|
|
132
|
+
...args,
|
|
133
|
+
client: options?.client,
|
|
134
|
+
signal: extra.signal,
|
|
135
|
+
throwOnError: false
|
|
136
|
+
})
|
|
137
|
+
);
|
|
138
|
+
return {
|
|
139
|
+
name: "files_get_a_file",
|
|
140
|
+
config: {
|
|
141
|
+
title: "Get a File",
|
|
142
|
+
description: "Gets one file by ID, including its link, name, type, size and dimensions. To get several files at once, list the files filtered by ID.",
|
|
143
|
+
inputSchema: getAFileInput,
|
|
144
|
+
annotations: {
|
|
145
|
+
readOnlyHint: true,
|
|
146
|
+
destructiveHint: false,
|
|
147
|
+
idempotentHint: true,
|
|
148
|
+
openWorldHint: true
|
|
149
|
+
},
|
|
150
|
+
_meta: {
|
|
151
|
+
"com.elasticpath/operation": {
|
|
152
|
+
id: "files.getAFile",
|
|
153
|
+
method: "GET",
|
|
154
|
+
path: "/v2/files/{fileID}",
|
|
155
|
+
risk: "read"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
handler
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
const tools = (options) => [
|
|
163
|
+
getAllFilesTool(options),
|
|
164
|
+
createAFileTool(options),
|
|
165
|
+
deleteAFileTool(options),
|
|
166
|
+
getAFileTool(options)
|
|
167
|
+
];
|
|
168
|
+
export {
|
|
169
|
+
createAFileTool,
|
|
170
|
+
deleteAFileTool,
|
|
171
|
+
getAFileTool,
|
|
172
|
+
getAllFilesTool,
|
|
173
|
+
tools
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=mcp.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/client/mcp.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ToolCallback } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport * as z from \"zod\"\n\nimport type { Client } from \"./client\"\nimport {\n dataUriFields,\n decodeDataUris,\n loose,\n type Tool,\n toToolResult,\n} from \"./mcp-support.gen\"\nimport { createAFile, deleteAFile, getAFile, getAllFiles } from \"./sdk.gen\"\nimport {\n zCreateAFileBody,\n zDeleteAFilePath,\n zGetAFilePath,\n zGetAllFilesQuery,\n} from \"./zod.gen\"\n\ntype ToolOptions = {\n client?: Client\n}\n\nconst getAllFilesInput = z\n .object({\n query: zGetAllFilesQuery.strict().optional(),\n })\n .strict()\n\n/**\n * Get all Files\n *\n * Retrieves all files.\n *\n * ### Filtering\n *\n * For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering).\n *\n * The following operators and attributes are available when filtering on this endpoint.\n *\n * | Attribute | Type | Operators | Example |\n * |:----------------------|:----------|:--------------------------|:-------------|\n * | `id` | `string` | `in` | `in(id,file-id-1,file-id-2,file-id-3)` |\n * | `file_name` | `string` | `eq` / `like` | `eq(file_name, my_image.jpg)` |\n * | `width` | `integer` | `gt` / `ge` / `lt` / `le` | `gt(width,200)` |\n * | `height` | `integer` | `gt` / `ge` / `lt` / `le` | `lt(height,500)` |\n * | `file_size` | `integer` | `gt` / `ge` / `lt` / `le` | `le(file_size,20953)` |\n *\n * #### Bulk File Retrieval\n *\n * To retrieve multiple files by their IDs in a single request, use the `in` operator with a comma-separated list of file IDs:\n *\n * ```\n * GET /v2/files?filter=in(id,06b881bd-f152-4c36-8658-7132a8fab49c,ec73567b-04e8-4000-a11a-7e1407cc2f21)\n * ```\n *\n * This is more efficient than making separate requests for each file and is recommended for bulk operations.\n *\n * **Note on invalid IDs**: If any IDs in the filter are missing, malformed, or do not exist in the store, they will be silently ignored. The response will only include files that were successfully found. For example, if you request 5 IDs but only 3 exist, the response will contain 3 files with `total: 3` in the metadata.\n *\n */\nexport const getAllFilesTool = (options?: ToolOptions) => {\n const handler: ToolCallback<typeof getAllFilesInput> = (args, extra) =>\n toToolResult(\n getAllFiles({\n ...args,\n client: options?.client,\n signal: extra.signal,\n throwOnError: false,\n }),\n )\n return {\n name: \"files_get_all_files\" as const,\n config: {\n title: \"Get all Files\",\n description:\n \"Lists the files in the store, such as product images, videos and documents, with each file's link, name, type and size. Filter by file name, width, height or file size, or get several files at once by ID with the in operator; IDs that do not exist are left out without an error. Returns at most 100 files per page.\",\n inputSchema: getAllFilesInput,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n _meta: {\n \"com.elasticpath/operation\": {\n id: \"files.getAllFiles\",\n method: \"GET\",\n path: \"/v2/files\",\n risk: \"read\" as const,\n },\n },\n },\n handler,\n }\n}\n\nconst createAFileInput = z\n .object({\n body: dataUriFields(loose(zCreateAFileBody), [\"file\"], 8388608),\n })\n .strict()\n\n/**\n * Create a File\n *\n * Create a File\n */\nexport const createAFileTool = (options?: ToolOptions) => {\n const handler: ToolCallback<typeof createAFileInput> = (args, extra) =>\n toToolResult(\n decodeDataUris(args.body, [\"file\"], 8388608).then((body) =>\n createAFile({\n ...args,\n client: options?.client,\n signal: extra.signal,\n throwOnError: false,\n body,\n }),\n ),\n )\n return {\n name: \"files_create_a_file\" as const,\n config: {\n title: \"Create a File\",\n description:\n \"Uploads a file, such as a product image, video or PDF, or registers an image hosted elsewhere by its URL. Files are limited to 8MB by default; store a larger file elsewhere and register it by URL. Returns the new file's ID and link, which you use to attach the file to a product.\",\n inputSchema: createAFileInput,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n _meta: {\n \"com.elasticpath/operation\": {\n id: \"files.createAFile\",\n method: \"POST\",\n path: \"/v2/files\",\n risk: \"create\" as const,\n },\n },\n },\n handler,\n }\n}\n\nconst deleteAFileInput = z\n .object({\n path: zDeleteAFilePath.strict(),\n })\n .strict()\n\n/**\n * Delete a File\n *\n * Delete a File\n */\nexport const deleteAFileTool = (options?: ToolOptions) => {\n const handler: ToolCallback<typeof deleteAFileInput> = (args, extra) =>\n toToolResult(\n deleteAFile({\n ...args,\n client: options?.client,\n signal: extra.signal,\n throwOnError: false,\n }),\n )\n return {\n name: \"files_delete_a_file\" as const,\n config: {\n title: \"Delete a File\",\n description:\n \"Deletes a file from the store by its ID. To find a file's ID, list the files and filter by file name.\",\n inputSchema: deleteAFileInput,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n openWorldHint: true,\n },\n _meta: {\n \"com.elasticpath/operation\": {\n id: \"files.deleteAFile\",\n method: \"DELETE\",\n path: \"/v2/files/{fileID}\",\n risk: \"delete\" as const,\n },\n },\n },\n handler,\n }\n}\n\nconst getAFileInput = z\n .object({\n path: zGetAFilePath.strict(),\n })\n .strict()\n\n/**\n * Get a File\n *\n * Get a File\n */\nexport const getAFileTool = (options?: ToolOptions) => {\n const handler: ToolCallback<typeof getAFileInput> = (args, extra) =>\n toToolResult(\n getAFile({\n ...args,\n client: options?.client,\n signal: extra.signal,\n throwOnError: false,\n }),\n )\n return {\n name: \"files_get_a_file\" as const,\n config: {\n title: \"Get a File\",\n description:\n \"Gets one file by ID, including its link, name, type, size and dimensions. To get several files at once, list the files filtered by ID.\",\n inputSchema: getAFileInput,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n _meta: {\n \"com.elasticpath/operation\": {\n id: \"files.getAFile\",\n method: \"GET\",\n path: \"/v2/files/{fileID}\",\n risk: \"read\" as const,\n },\n },\n },\n handler,\n }\n}\n\nexport const tools = (options?: ToolOptions): Array<Tool> => [\n getAllFilesTool(options),\n createAFileTool(options),\n deleteAFileTool(options),\n getAFileTool(options),\n]\n"],"mappings":"AAGA,YAAY,OAAO;AAGnB;A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S;AAAA,MACjB,QAAQ,MAAM;AAAA,MACd,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AACF,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,aACE;AAAA,MACF,aAAa;AAAA,MACb,aAAa;AAAA,QACX,cAAc;AAAA,QACd,iBAAiB;AAAA,QACjB,gBAAgB;AAAA,QAChB,eAAe;AAAA,MACjB;AAAA,MACA,OAAO;AAAA,QACL,6BAA6B;AAAA,UAC3B,IAAI;AAAA,UACJ,QAAQ;AAAA,UACR,MAAM;AAAA,UACN,MAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,QAAQ,CAAC,YAAuC;AAAA,EAC3D,gBAAgB,OAAO;AAAA,EACvB,gBAAgB,OAAO;AAAA,EACvB,gBAAgB,OAAO;AAAA,EACvB,aAAa,OAAO;AACtB;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/types.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nexport type ClientOptions = {\n baseUrl:\n | \"https://euwest.api.elasticpath.com\"\n | \"https://useast.api.elasticpath.com\"\n | (string & {})\n}\n\nexport type ErrorResponse = {\n errors: Array<Error>\n}\n\nexport type File = {\n /**\n * The unique identifier for this file.\n */\n id?: Uuid\n /**\n * The type represents the object being returned.\n */\n type?: string\n /**\n * The name of the file.\n */\n file_name?: string\n /**\n * The mime type of the file.\n */\n mime_type?: string\n /**\n * The size of the file. Required when uploading files.\n */\n file_size?: number\n /**\n * DEPRECATED Whether the file public or not. Required when uploading files.\n */\n public?: boolean\n meta?: FileMeta\n links?: Links\n link?: FileLink\n}\n\nexport type FileMeta = {\n /**\n * The date and time the file was created.\n */\n timestamps?: {\n /**\n * The date and time the file was created.\n */\n created_at?: string\n }\n /**\n * The file dimensions.\n */\n dimensions?: {\n /**\n * The width of the file.\n */\n width?: number\n /**\n * The height of the file.\n */\n height?: number\n }\n}\n\nexport type ResultsMeta = {\n /**\n * Contains the results for the entire collection.\n */\n page?: {\n /**\n * The maximum number of records for all pages.\n */\n limit?: number\n /**\n * The current offset by number of pages.\n */\n offset?: number\n /**\n * The current number of pages.\n */\n current?: number\n /**\n * The total number of records for the entire collection.\n */\n total?: number\n }\n /**\n * Contains the results for the entire collection.\n */\n results?: {\n /**\n * The total number of records for the entire collection.\n */\n total?: number\n }\n}\n\n/**\n * Links are used to allow you to move between requests.\n */\nexport type Links = {\n /**\n * Single entities use a self parameter with a link to that specific resource.\n */\n self?: string\n}\n\n/**\n * Links are used to allow you to move between requests.\n */\nexport type ResultsLinks = {\n /**\n * Single entities use a self parameter with a link to that specific resource.\n */\n self?: string | null\n /**\n * The current page.\n */\n current?: string | null\n /**\n * Always the first page.\n */\n first?: string | null\n /**\n * This is `null` if there is only one page.\n */\n last?: string | null\n /**\n * The previous page. This is `null` if on the first page.\n */\n prev?: string | null\n /**\n * The next page. This is `null` if there is no next page.\n */\n next?: string | null\n}\n\n/**\n * The publicly available URL for this file.\n */\nexport type FileLink = {\n /**\n * The publicly available URL for this file.\n */\n href?: string\n}\n\nexport type Uuid = string\n\nexport type Error = {\n /**\n * The HTTP response code of the error.\n */\n status: number\n /**\n * A brief summary of the error.\n */\n title: string\n /**\n * Optional additional detail about the error.\n */\n detail?: string\n /**\n * Internal request ID.\n */\n request_id?: string\n /**\n * Additional supporting meta data for the error.\n */\n meta?: {\n [key: string]: unknown\n }\n}\n\n/**\n *\n * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).\n *\n */\nexport type Filter = string\n\n/**\n * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\nexport type PageOffset =
|
|
1
|
+
{"version":3,"sources":["../../src/client/types.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nexport type ClientOptions = {\n baseUrl:\n | \"https://euwest.api.elasticpath.com\"\n | \"https://useast.api.elasticpath.com\"\n | (string & {})\n}\n\nexport type ErrorResponse = {\n errors: Array<Error>\n}\n\nexport type File = {\n /**\n * The unique identifier for this file.\n */\n id?: Uuid\n /**\n * The type represents the object being returned.\n */\n type?: string\n /**\n * The name of the file.\n */\n file_name?: string\n /**\n * The mime type of the file.\n */\n mime_type?: string\n /**\n * The size of the file. Required when uploading files.\n */\n file_size?: number\n /**\n * DEPRECATED Whether the file public or not. Required when uploading files.\n */\n public?: boolean\n meta?: FileMeta\n links?: Links\n link?: FileLink\n}\n\nexport type FileMeta = {\n /**\n * The date and time the file was created.\n */\n timestamps?: {\n /**\n * The date and time the file was created.\n */\n created_at?: string\n }\n /**\n * The file dimensions.\n */\n dimensions?: {\n /**\n * The width of the file.\n */\n width?: number\n /**\n * The height of the file.\n */\n height?: number\n }\n}\n\nexport type ResultsMeta = {\n /**\n * Contains the results for the entire collection.\n */\n page?: {\n /**\n * The maximum number of records for all pages.\n */\n limit?: number\n /**\n * The current offset by number of pages.\n */\n offset?: number\n /**\n * The current number of pages.\n */\n current?: number\n /**\n * The total number of records for the entire collection.\n */\n total?: number\n }\n /**\n * Contains the results for the entire collection.\n */\n results?: {\n /**\n * The total number of records for the entire collection.\n */\n total?: number\n }\n}\n\n/**\n * Links are used to allow you to move between requests.\n */\nexport type Links = {\n /**\n * Single entities use a self parameter with a link to that specific resource.\n */\n self?: string\n}\n\n/**\n * Links are used to allow you to move between requests.\n */\nexport type ResultsLinks = {\n /**\n * Single entities use a self parameter with a link to that specific resource.\n */\n self?: string | null\n /**\n * The current page.\n */\n current?: string | null\n /**\n * Always the first page.\n */\n first?: string | null\n /**\n * This is `null` if there is only one page.\n */\n last?: string | null\n /**\n * The previous page. This is `null` if on the first page.\n */\n prev?: string | null\n /**\n * The next page. This is `null` if there is no next page.\n */\n next?: string | null\n}\n\n/**\n * The publicly available URL for this file.\n */\nexport type FileLink = {\n /**\n * The publicly available URL for this file.\n */\n href?: string\n}\n\nexport type Uuid = string\n\nexport type Error = {\n /**\n * The HTTP response code of the error.\n */\n status: number\n /**\n * A brief summary of the error.\n */\n title: string\n /**\n * Optional additional detail about the error.\n */\n detail?: string\n /**\n * Internal request ID.\n */\n request_id?: string\n /**\n * Additional supporting meta data for the error.\n */\n meta?: {\n [key: string]: unknown\n }\n}\n\n/**\n *\n * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).\n *\n */\nexport type Filter = string\n\n/**\n * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\nexport type PageOffset = number\n\n/**\n * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\nexport type PageLimit = number\n\nexport type GetAllFilesData = {\n body?: never\n path?: never\n query?: {\n /**\n *\n * Filtering is available for this endpoint. See [Filtering](/docs/api/pxm/files/get-all-files#filtering).\n *\n */\n filter?: string\n /**\n * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\n \"page[limit]\"?: number\n /**\n * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.\n */\n \"page[offset]\"?: number\n }\n url: \"/v2/files\"\n}\n\nexport type GetAllFilesErrors = {\n /**\n * Bad request. The request failed validation.\n */\n 400: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type GetAllFilesError = GetAllFilesErrors[keyof GetAllFilesErrors]\n\nexport type GetAllFilesResponses = {\n /**\n * OK\n */\n 200: {\n data?: Array<File>\n meta?: ResultsMeta\n links?: ResultsLinks\n }\n}\n\nexport type GetAllFilesResponse =\n GetAllFilesResponses[keyof GetAllFilesResponses]\n\nexport type CreateAFileData = {\n body: {\n /**\n * Indicates the file you want to upload.\n */\n file?: Blob | File\n /**\n * Use this parameter to reference a file stored at a specific location. This must be the URL that points to an image file.\n */\n file_location?: string\n }\n path?: never\n query?: never\n url: \"/v2/files\"\n}\n\nexport type CreateAFileErrors = {\n /**\n * Bad request. The request failed validation.\n */\n 400: ErrorResponse\n /**\n * Bad request. The request failed validation.\n */\n 422: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type CreateAFileError = CreateAFileErrors[keyof CreateAFileErrors]\n\nexport type CreateAFileResponses = {\n /**\n * Created\n */\n 201: {\n data?: File\n }\n}\n\nexport type CreateAFileResponse =\n CreateAFileResponses[keyof CreateAFileResponses]\n\nexport type DeleteAFileData = {\n body?: never\n path: {\n /**\n * The unique identifier of the file you want to delete.\n */\n fileID: string\n }\n query?: never\n url: \"/v2/files/{fileID}\"\n}\n\nexport type DeleteAFileErrors = {\n /**\n * Bad request. The request failed validation.\n */\n 403: ErrorResponse\n /**\n * Forbidden. The operation is forbidden on this entity.\n */\n 404: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type DeleteAFileError = DeleteAFileErrors[keyof DeleteAFileErrors]\n\nexport type DeleteAFileResponses = {\n /**\n * No Content\n */\n 204: void\n}\n\nexport type DeleteAFileResponse =\n DeleteAFileResponses[keyof DeleteAFileResponses]\n\nexport type GetAFileData = {\n body?: never\n path: {\n /**\n * The unique identifier for a file.\n */\n fileID: string\n }\n query?: never\n url: \"/v2/files/{fileID}\"\n}\n\nexport type GetAFileErrors = {\n /**\n * Forbidden. The operation is forbidden on this entity.\n */\n 404: ErrorResponse\n /**\n * Internal server error. There was a system failure in the platform.\n */\n 500: ErrorResponse\n}\n\nexport type GetAFileError = GetAFileErrors[keyof GetAFileErrors]\n\nexport type GetAFileResponses = {\n 200: {\n data?: File\n }\n}\n\nexport type GetAFileResponse = GetAFileResponses[keyof GetAFileResponses]\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -170,11 +170,11 @@ type Filter = string;
|
|
|
170
170
|
/**
|
|
171
171
|
* The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
172
172
|
*/
|
|
173
|
-
type PageOffset =
|
|
173
|
+
type PageOffset = number;
|
|
174
174
|
/**
|
|
175
175
|
* The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
176
176
|
*/
|
|
177
|
-
type PageLimit =
|
|
177
|
+
type PageLimit = number;
|
|
178
178
|
type GetAllFilesData = {
|
|
179
179
|
body?: never;
|
|
180
180
|
path?: never;
|
|
@@ -188,11 +188,11 @@ type GetAllFilesData = {
|
|
|
188
188
|
/**
|
|
189
189
|
* The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
190
190
|
*/
|
|
191
|
-
"page[limit]"?:
|
|
191
|
+
"page[limit]"?: number;
|
|
192
192
|
/**
|
|
193
193
|
* The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
194
194
|
*/
|
|
195
|
-
"page[offset]"?:
|
|
195
|
+
"page[offset]"?: number;
|
|
196
196
|
};
|
|
197
197
|
url: "/v2/files";
|
|
198
198
|
};
|
|
@@ -170,11 +170,11 @@ type Filter = string;
|
|
|
170
170
|
/**
|
|
171
171
|
* The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
172
172
|
*/
|
|
173
|
-
type PageOffset =
|
|
173
|
+
type PageOffset = number;
|
|
174
174
|
/**
|
|
175
175
|
* The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
176
176
|
*/
|
|
177
|
-
type PageLimit =
|
|
177
|
+
type PageLimit = number;
|
|
178
178
|
type GetAllFilesData = {
|
|
179
179
|
body?: never;
|
|
180
180
|
path?: never;
|
|
@@ -188,11 +188,11 @@ type GetAllFilesData = {
|
|
|
188
188
|
/**
|
|
189
189
|
* The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
190
190
|
*/
|
|
191
|
-
"page[limit]"?:
|
|
191
|
+
"page[limit]"?: number;
|
|
192
192
|
/**
|
|
193
193
|
* The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
|
|
194
194
|
*/
|
|
195
|
-
"page[offset]"?:
|
|
195
|
+
"page[offset]"?: number;
|
|
196
196
|
};
|
|
197
197
|
url: "/v2/files";
|
|
198
198
|
};
|
package/dist/mcp.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var mcp_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(mcp_exports);
|
|
18
|
+
__reExport(mcp_exports, require('./client/mcp.gen.cjs'), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require('./client/mcp.gen.cjs')
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=mcp.cjs.map
|
package/dist/mcp.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp.ts"],"sourcesContent":["export * from \"./client/mcp.gen\"\nexport type { OperationMeta, Tool, ToolConfig } from \"./client/mcp-support.gen\"\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,6BAAd;","names":[]}
|
package/dist/mcp.d.cts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { createAFileTool, deleteAFileTool, getAFileTool, getAllFilesTool, tools } from './client/mcp.gen.cjs';
|
|
2
|
+
export { OperationMeta, Tool, ToolConfig } from './client/mcp-support.gen.cjs';
|
|
3
|
+
import '@modelcontextprotocol/sdk/shared/protocol';
|
|
4
|
+
import '@modelcontextprotocol/sdk/types';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import './types.gen-mB6gWg8u.cjs';
|
|
7
|
+
import './client/core/auth.gen.cjs';
|
|
8
|
+
import './client/core/serverSentEvents.gen.cjs';
|
|
9
|
+
import './client/core/types.gen.cjs';
|
|
10
|
+
import './client/core/bodySerializer.gen.cjs';
|
|
11
|
+
import './client/core/pathSerializer.gen.cjs';
|
|
12
|
+
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
|
+
import '@modelcontextprotocol/sdk/server/zod-compat.js';
|
|
14
|
+
import '@modelcontextprotocol/sdk/types.js';
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { createAFileTool, deleteAFileTool, getAFileTool, getAllFilesTool, tools } from './client/mcp.gen.js';
|
|
2
|
+
export { OperationMeta, Tool, ToolConfig } from './client/mcp-support.gen.js';
|
|
3
|
+
import '@modelcontextprotocol/sdk/shared/protocol';
|
|
4
|
+
import '@modelcontextprotocol/sdk/types';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import './types.gen-DXwTHYA3.js';
|
|
7
|
+
import './client/core/auth.gen.js';
|
|
8
|
+
import './client/core/serverSentEvents.gen.js';
|
|
9
|
+
import './client/core/types.gen.js';
|
|
10
|
+
import './client/core/bodySerializer.gen.js';
|
|
11
|
+
import './client/core/pathSerializer.gen.js';
|
|
12
|
+
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
|
+
import '@modelcontextprotocol/sdk/server/zod-compat.js';
|
|
14
|
+
import '@modelcontextprotocol/sdk/types.js';
|
package/dist/mcp.mjs
ADDED
package/dist/mcp.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp.ts"],"sourcesContent":["export * from \"./client/mcp.gen\"\nexport type { OperationMeta, Tool, ToolConfig } from \"./client/mcp-support.gen\"\n"],"mappings":"AAAA,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epcc-sdk/sdks-files",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -27,12 +27,25 @@
|
|
|
27
27
|
"default": "./dist/zod.cjs"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
+
"./mcp": {
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/mcp.d.ts",
|
|
33
|
+
"default": "./dist/mcp.mjs"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/mcp.d.cts",
|
|
37
|
+
"default": "./dist/mcp.cjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
30
40
|
"./package.json": "./package.json"
|
|
31
41
|
},
|
|
32
42
|
"typesVersions": {
|
|
33
43
|
"*": {
|
|
34
44
|
"zod": [
|
|
35
45
|
"./dist/zod.d.ts"
|
|
46
|
+
],
|
|
47
|
+
"mcp": [
|
|
48
|
+
"./dist/mcp.d.ts"
|
|
36
49
|
]
|
|
37
50
|
}
|
|
38
51
|
},
|
|
@@ -48,6 +61,9 @@
|
|
|
48
61
|
},
|
|
49
62
|
"devDependencies": {
|
|
50
63
|
"@hey-api/openapi-ts": "0.99.0",
|
|
64
|
+
"@modelcontextprotocol/sdk": "1.31.0",
|
|
65
|
+
"@redocly/cli": "^1.21.0",
|
|
66
|
+
"@redocly/openapi-core": "^1.21.0",
|
|
51
67
|
"@types/ejs": "^3.1.5",
|
|
52
68
|
"ejs": "^3.1.10",
|
|
53
69
|
"esbuild-fix-imports-plugin": "^1.0.19",
|
|
@@ -58,16 +74,21 @@
|
|
|
58
74
|
"zod": "4.6.5"
|
|
59
75
|
},
|
|
60
76
|
"peerDependencies": {
|
|
77
|
+
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
61
78
|
"zod": "^4.0.0"
|
|
62
79
|
},
|
|
63
80
|
"peerDependenciesMeta": {
|
|
81
|
+
"@modelcontextprotocol/sdk": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
64
84
|
"zod": {
|
|
65
85
|
"optional": true
|
|
66
86
|
}
|
|
67
87
|
},
|
|
68
88
|
"scripts": {
|
|
69
|
-
"build": "pnpm openapi-ts && pnpm build:tsup",
|
|
89
|
+
"build": "pnpm oas:build && pnpm openapi-ts && pnpm build:tsup",
|
|
70
90
|
"build:tsup": "tsup",
|
|
91
|
+
"oas:build": "redocly bundle files-standalone@v1 --config ../specs/config/redocly.yaml",
|
|
71
92
|
"openapi-ts": "openapi-ts",
|
|
72
93
|
"test": "vitest run",
|
|
73
94
|
"test:watch": "vitest"
|