@clawpify/skills 1.0.1
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/LICENSE +21 -0
- package/README.md +73 -0
- package/clawpify/SKILL.md +134 -0
- package/clawpify/references/blogs.md +385 -0
- package/clawpify/references/bulk-operations.md +386 -0
- package/clawpify/references/collections.md +71 -0
- package/clawpify/references/customers.md +141 -0
- package/clawpify/references/discounts.md +431 -0
- package/clawpify/references/draft-orders.md +495 -0
- package/clawpify/references/files.md +355 -0
- package/clawpify/references/fulfillments.md +437 -0
- package/clawpify/references/gift-cards.md +453 -0
- package/clawpify/references/inventory.md +107 -0
- package/clawpify/references/locations.md +349 -0
- package/clawpify/references/marketing.md +352 -0
- package/clawpify/references/markets.md +346 -0
- package/clawpify/references/menus.md +313 -0
- package/clawpify/references/metafields.md +461 -0
- package/clawpify/references/orders.md +164 -0
- package/clawpify/references/pages.md +308 -0
- package/clawpify/references/products.md +277 -0
- package/clawpify/references/refunds.md +401 -0
- package/clawpify/references/segments.md +319 -0
- package/clawpify/references/shipping.md +406 -0
- package/clawpify/references/shop.md +307 -0
- package/clawpify/references/subscriptions.md +429 -0
- package/clawpify/references/translations.md +270 -0
- package/clawpify/references/webhooks.md +400 -0
- package/dist/agent.d.ts +18 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +100 -0
- package/dist/auth.d.ts +34 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +58 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/mcp-server.d.ts +3 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +236 -0
- package/dist/shopify.d.ts +29 -0
- package/dist/shopify.d.ts.map +1 -0
- package/dist/shopify.js +41 -0
- package/dist/skills.d.ts +8 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +36 -0
- package/package.json +100 -0
- package/src/agent.ts +133 -0
- package/src/auth.ts +109 -0
- package/src/index.ts +55 -0
- package/src/mcp-server.ts +190 -0
- package/src/shopify.ts +63 -0
- package/src/skills.ts +42 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
# Shopify Files
|
|
2
|
+
|
|
3
|
+
Manage file uploads, images, videos, and media library via the GraphQL Admin API.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Files represent digital assets including images, videos, 3D models, and documents uploaded to the store.
|
|
8
|
+
|
|
9
|
+
## List Files
|
|
10
|
+
|
|
11
|
+
```graphql
|
|
12
|
+
query ListFiles($first: Int!, $after: String, $query: String) {
|
|
13
|
+
files(first: $first, after: $after, query: $query, sortKey: CREATED_AT, reverse: true) {
|
|
14
|
+
pageInfo {
|
|
15
|
+
hasNextPage
|
|
16
|
+
endCursor
|
|
17
|
+
}
|
|
18
|
+
nodes {
|
|
19
|
+
id
|
|
20
|
+
alt
|
|
21
|
+
createdAt
|
|
22
|
+
fileStatus
|
|
23
|
+
... on MediaImage {
|
|
24
|
+
image {
|
|
25
|
+
url
|
|
26
|
+
width
|
|
27
|
+
height
|
|
28
|
+
}
|
|
29
|
+
mimeType
|
|
30
|
+
}
|
|
31
|
+
... on Video {
|
|
32
|
+
sources {
|
|
33
|
+
url
|
|
34
|
+
mimeType
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
... on GenericFile {
|
|
38
|
+
url
|
|
39
|
+
mimeType
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
Variables: `{ "first": 20 }`
|
|
46
|
+
|
|
47
|
+
## Upload Files (Two-Step Process)
|
|
48
|
+
|
|
49
|
+
### Step 1: Create Staged Upload
|
|
50
|
+
|
|
51
|
+
```graphql
|
|
52
|
+
mutation CreateStagedUpload($input: [StagedUploadInput!]!) {
|
|
53
|
+
stagedUploadsCreate(input: $input) {
|
|
54
|
+
stagedTargets {
|
|
55
|
+
url
|
|
56
|
+
resourceUrl
|
|
57
|
+
parameters {
|
|
58
|
+
name
|
|
59
|
+
value
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
userErrors {
|
|
63
|
+
field
|
|
64
|
+
message
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
Variables:
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"input": [
|
|
73
|
+
{
|
|
74
|
+
"filename": "product-image.jpg",
|
|
75
|
+
"mimeType": "image/jpeg",
|
|
76
|
+
"httpMethod": "POST",
|
|
77
|
+
"resource": "FILE"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Step 2: Create File from Staged Upload
|
|
84
|
+
|
|
85
|
+
```graphql
|
|
86
|
+
mutation CreateFile($files: [FileCreateInput!]!) {
|
|
87
|
+
fileCreate(files: $files) {
|
|
88
|
+
files {
|
|
89
|
+
id
|
|
90
|
+
alt
|
|
91
|
+
fileStatus
|
|
92
|
+
... on MediaImage {
|
|
93
|
+
image {
|
|
94
|
+
url
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
userErrors {
|
|
99
|
+
field
|
|
100
|
+
message
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
Variables:
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"files": [
|
|
109
|
+
{
|
|
110
|
+
"alt": "Summer collection product",
|
|
111
|
+
"contentType": "IMAGE",
|
|
112
|
+
"originalSource": "https://storage.shopify.com/staged/abc123..."
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Create File from URL
|
|
119
|
+
|
|
120
|
+
```graphql
|
|
121
|
+
mutation CreateFileFromUrl($files: [FileCreateInput!]!) {
|
|
122
|
+
fileCreate(files: $files) {
|
|
123
|
+
files {
|
|
124
|
+
id
|
|
125
|
+
alt
|
|
126
|
+
fileStatus
|
|
127
|
+
}
|
|
128
|
+
userErrors {
|
|
129
|
+
field
|
|
130
|
+
message
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
Variables:
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"files": [
|
|
139
|
+
{
|
|
140
|
+
"alt": "Product image",
|
|
141
|
+
"contentType": "IMAGE",
|
|
142
|
+
"originalSource": "https://example.com/images/product.jpg"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Create Video
|
|
149
|
+
|
|
150
|
+
```graphql
|
|
151
|
+
mutation CreateVideo($files: [FileCreateInput!]!) {
|
|
152
|
+
fileCreate(files: $files) {
|
|
153
|
+
files {
|
|
154
|
+
id
|
|
155
|
+
fileStatus
|
|
156
|
+
... on Video {
|
|
157
|
+
sources {
|
|
158
|
+
url
|
|
159
|
+
mimeType
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
userErrors {
|
|
164
|
+
field
|
|
165
|
+
message
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
Variables:
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"files": [
|
|
174
|
+
{
|
|
175
|
+
"alt": "Product demo video",
|
|
176
|
+
"contentType": "VIDEO",
|
|
177
|
+
"originalSource": "https://storage.shopify.com/staged/video123..."
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Create External Video (YouTube/Vimeo)
|
|
184
|
+
|
|
185
|
+
```graphql
|
|
186
|
+
mutation CreateExternalVideo($files: [FileCreateInput!]!) {
|
|
187
|
+
fileCreate(files: $files) {
|
|
188
|
+
files {
|
|
189
|
+
id
|
|
190
|
+
... on ExternalVideo {
|
|
191
|
+
embedUrl
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
userErrors {
|
|
195
|
+
field
|
|
196
|
+
message
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
Variables:
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"files": [
|
|
205
|
+
{
|
|
206
|
+
"alt": "Product tutorial",
|
|
207
|
+
"contentType": "EXTERNAL_VIDEO",
|
|
208
|
+
"originalSource": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Update File
|
|
215
|
+
|
|
216
|
+
```graphql
|
|
217
|
+
mutation UpdateFile($files: [FileUpdateInput!]!) {
|
|
218
|
+
fileUpdate(files: $files) {
|
|
219
|
+
files {
|
|
220
|
+
id
|
|
221
|
+
alt
|
|
222
|
+
}
|
|
223
|
+
userErrors {
|
|
224
|
+
field
|
|
225
|
+
message
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
Variables:
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"files": [
|
|
234
|
+
{
|
|
235
|
+
"id": "gid://shopify/MediaImage/123",
|
|
236
|
+
"alt": "Updated alt text for accessibility"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Delete Files
|
|
243
|
+
|
|
244
|
+
```graphql
|
|
245
|
+
mutation DeleteFiles($fileIds: [ID!]!) {
|
|
246
|
+
fileDelete(fileIds: $fileIds) {
|
|
247
|
+
deletedFileIds
|
|
248
|
+
userErrors {
|
|
249
|
+
field
|
|
250
|
+
message
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
Variables:
|
|
256
|
+
```json
|
|
257
|
+
{
|
|
258
|
+
"fileIds": ["gid://shopify/MediaImage/123", "gid://shopify/MediaImage/456"]
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## File Content Types
|
|
263
|
+
|
|
264
|
+
| Type | Description |
|
|
265
|
+
|------|-------------|
|
|
266
|
+
| `IMAGE` | JPEG, PNG, GIF, WebP images |
|
|
267
|
+
| `VIDEO` | MP4, WebM videos |
|
|
268
|
+
| `EXTERNAL_VIDEO` | YouTube, Vimeo embeds |
|
|
269
|
+
| `MODEL_3D` | 3D model files (GLB, USDZ) |
|
|
270
|
+
| `FILE` | Generic files (PDF, documents) |
|
|
271
|
+
|
|
272
|
+
## File Status
|
|
273
|
+
|
|
274
|
+
| Status | Description |
|
|
275
|
+
|--------|-------------|
|
|
276
|
+
| `UPLOADED` | File uploaded, processing |
|
|
277
|
+
| `PROCESSING` | Being processed |
|
|
278
|
+
| `READY` | Ready for use |
|
|
279
|
+
| `FAILED` | Upload/processing failed |
|
|
280
|
+
|
|
281
|
+
## Query Files by Type
|
|
282
|
+
|
|
283
|
+
```graphql
|
|
284
|
+
query ListImages($first: Int!) {
|
|
285
|
+
files(first: $first, query: "media_type:IMAGE") {
|
|
286
|
+
nodes {
|
|
287
|
+
id
|
|
288
|
+
... on MediaImage {
|
|
289
|
+
image {
|
|
290
|
+
url
|
|
291
|
+
width
|
|
292
|
+
height
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Search Files
|
|
301
|
+
|
|
302
|
+
```graphql
|
|
303
|
+
query SearchFiles($query: String!) {
|
|
304
|
+
files(first: 10, query: $query) {
|
|
305
|
+
nodes {
|
|
306
|
+
id
|
|
307
|
+
alt
|
|
308
|
+
fileStatus
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
Variables: `{ "query": "alt:product OR filename:banner" }`
|
|
314
|
+
|
|
315
|
+
## File Search Filters
|
|
316
|
+
|
|
317
|
+
| Filter | Example | Description |
|
|
318
|
+
|--------|---------|-------------|
|
|
319
|
+
| `media_type` | `media_type:IMAGE` | Filter by type |
|
|
320
|
+
| `status` | `status:READY` | Filter by status |
|
|
321
|
+
| `filename` | `filename:hero` | Search filename |
|
|
322
|
+
| `alt` | `alt:product` | Search alt text |
|
|
323
|
+
| `created_at` | `created_at:>2024-01-01` | Filter by date |
|
|
324
|
+
|
|
325
|
+
## Staged Upload Resources
|
|
326
|
+
|
|
327
|
+
| Resource | Description |
|
|
328
|
+
|----------|-------------|
|
|
329
|
+
| `FILE` | General file upload |
|
|
330
|
+
| `IMAGE` | Image file |
|
|
331
|
+
| `VIDEO` | Video file |
|
|
332
|
+
| `MODEL_3D` | 3D model file |
|
|
333
|
+
| `BULK_MUTATION_VARIABLES` | Bulk operation data |
|
|
334
|
+
| `PRODUCT_MEDIA` | Product media attachment |
|
|
335
|
+
|
|
336
|
+
## Staged Upload HTTP Methods
|
|
337
|
+
|
|
338
|
+
| Method | Use Case |
|
|
339
|
+
|--------|----------|
|
|
340
|
+
| `POST` | Multipart form upload |
|
|
341
|
+
| `PUT` | Direct binary upload |
|
|
342
|
+
|
|
343
|
+
## API Scopes Required
|
|
344
|
+
|
|
345
|
+
- `read_files` - Read files
|
|
346
|
+
- `write_files` - Upload, update, delete files
|
|
347
|
+
|
|
348
|
+
## Notes
|
|
349
|
+
|
|
350
|
+
- Files are processed asynchronously; poll `fileStatus` until `READY`
|
|
351
|
+
- Maximum of 250 files per `fileCreate` call
|
|
352
|
+
- Alt text improves SEO and accessibility
|
|
353
|
+
- Use staged uploads for large files
|
|
354
|
+
- External videos don't count against file storage
|
|
355
|
+
- 3D models require GLB or USDZ format
|