@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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +73 -0
  3. package/clawpify/SKILL.md +134 -0
  4. package/clawpify/references/blogs.md +385 -0
  5. package/clawpify/references/bulk-operations.md +386 -0
  6. package/clawpify/references/collections.md +71 -0
  7. package/clawpify/references/customers.md +141 -0
  8. package/clawpify/references/discounts.md +431 -0
  9. package/clawpify/references/draft-orders.md +495 -0
  10. package/clawpify/references/files.md +355 -0
  11. package/clawpify/references/fulfillments.md +437 -0
  12. package/clawpify/references/gift-cards.md +453 -0
  13. package/clawpify/references/inventory.md +107 -0
  14. package/clawpify/references/locations.md +349 -0
  15. package/clawpify/references/marketing.md +352 -0
  16. package/clawpify/references/markets.md +346 -0
  17. package/clawpify/references/menus.md +313 -0
  18. package/clawpify/references/metafields.md +461 -0
  19. package/clawpify/references/orders.md +164 -0
  20. package/clawpify/references/pages.md +308 -0
  21. package/clawpify/references/products.md +277 -0
  22. package/clawpify/references/refunds.md +401 -0
  23. package/clawpify/references/segments.md +319 -0
  24. package/clawpify/references/shipping.md +406 -0
  25. package/clawpify/references/shop.md +307 -0
  26. package/clawpify/references/subscriptions.md +429 -0
  27. package/clawpify/references/translations.md +270 -0
  28. package/clawpify/references/webhooks.md +400 -0
  29. package/dist/agent.d.ts +18 -0
  30. package/dist/agent.d.ts.map +1 -0
  31. package/dist/agent.js +100 -0
  32. package/dist/auth.d.ts +34 -0
  33. package/dist/auth.d.ts.map +1 -0
  34. package/dist/auth.js +58 -0
  35. package/dist/index.d.ts +41 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +22 -0
  38. package/dist/mcp-server.d.ts +3 -0
  39. package/dist/mcp-server.d.ts.map +1 -0
  40. package/dist/mcp-server.js +236 -0
  41. package/dist/shopify.d.ts +29 -0
  42. package/dist/shopify.d.ts.map +1 -0
  43. package/dist/shopify.js +41 -0
  44. package/dist/skills.d.ts +8 -0
  45. package/dist/skills.d.ts.map +1 -0
  46. package/dist/skills.js +36 -0
  47. package/package.json +100 -0
  48. package/src/agent.ts +133 -0
  49. package/src/auth.ts +109 -0
  50. package/src/index.ts +55 -0
  51. package/src/mcp-server.ts +190 -0
  52. package/src/shopify.ts +63 -0
  53. package/src/skills.ts +42 -0
@@ -0,0 +1,386 @@
1
+ # Shopify Bulk Operations
2
+
3
+ Run large queries and mutations asynchronously via the GraphQL Admin API.
4
+
5
+ ## Overview
6
+
7
+ Bulk operations handle large data sets efficiently by processing requests asynchronously and returning results in JSONL files.
8
+
9
+ ## Run Bulk Query
10
+
11
+ ```graphql
12
+ mutation RunBulkQuery($query: String!) {
13
+ bulkOperationRunQuery(query: $query) {
14
+ bulkOperation {
15
+ id
16
+ status
17
+ url
18
+ }
19
+ userErrors {
20
+ field
21
+ message
22
+ }
23
+ }
24
+ }
25
+ ```
26
+ Variables:
27
+ ```json
28
+ {
29
+ "query": "{ products { edges { node { id title variants { edges { node { id title sku } } } } } } }"
30
+ }
31
+ ```
32
+
33
+ ## Example Bulk Queries
34
+
35
+ ### Export All Products
36
+
37
+ ```graphql
38
+ mutation ExportProducts {
39
+ bulkOperationRunQuery(query: """
40
+ {
41
+ products {
42
+ edges {
43
+ node {
44
+ id
45
+ title
46
+ handle
47
+ status
48
+ vendor
49
+ productType
50
+ tags
51
+ variants {
52
+ edges {
53
+ node {
54
+ id
55
+ title
56
+ sku
57
+ price
58
+ inventoryQuantity
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ """) {
67
+ bulkOperation {
68
+ id
69
+ status
70
+ }
71
+ userErrors {
72
+ field
73
+ message
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ ### Export All Orders
80
+
81
+ ```graphql
82
+ mutation ExportOrders {
83
+ bulkOperationRunQuery(query: """
84
+ {
85
+ orders {
86
+ edges {
87
+ node {
88
+ id
89
+ name
90
+ createdAt
91
+ totalPriceSet {
92
+ shopMoney {
93
+ amount
94
+ currencyCode
95
+ }
96
+ }
97
+ customer {
98
+ id
99
+ displayName
100
+ }
101
+ lineItems {
102
+ edges {
103
+ node {
104
+ title
105
+ quantity
106
+ variant {
107
+ sku
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ """) {
117
+ bulkOperation {
118
+ id
119
+ status
120
+ }
121
+ userErrors {
122
+ field
123
+ message
124
+ }
125
+ }
126
+ }
127
+ ```
128
+
129
+ ### Export Customers
130
+
131
+ ```graphql
132
+ mutation ExportCustomers {
133
+ bulkOperationRunQuery(query: """
134
+ {
135
+ customers {
136
+ edges {
137
+ node {
138
+ id
139
+ displayName
140
+ defaultEmailAddress {
141
+ emailAddress
142
+ }
143
+ numberOfOrders
144
+ amountSpent {
145
+ amount
146
+ currencyCode
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ """) {
153
+ bulkOperation {
154
+ id
155
+ status
156
+ }
157
+ userErrors {
158
+ field
159
+ message
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ ## Check Bulk Operation Status
166
+
167
+ ```graphql
168
+ query GetBulkOperation($id: ID!) {
169
+ node(id: $id) {
170
+ ... on BulkOperation {
171
+ id
172
+ status
173
+ errorCode
174
+ objectCount
175
+ fileSize
176
+ url
177
+ partialDataUrl
178
+ createdAt
179
+ completedAt
180
+ }
181
+ }
182
+ }
183
+ ```
184
+ Variables: `{ "id": "gid://shopify/BulkOperation/123" }`
185
+
186
+ ## Get Current Bulk Operation
187
+
188
+ ```graphql
189
+ query GetCurrentBulkOperation {
190
+ currentBulkOperation {
191
+ id
192
+ status
193
+ errorCode
194
+ createdAt
195
+ completedAt
196
+ objectCount
197
+ fileSize
198
+ url
199
+ query
200
+ }
201
+ }
202
+ ```
203
+
204
+ ## List Bulk Operations
205
+
206
+ ```graphql
207
+ query ListBulkOperations($first: Int!) {
208
+ bulkOperations(first: $first, sortKey: CREATED_AT, reverse: true) {
209
+ nodes {
210
+ id
211
+ status
212
+ type
213
+ createdAt
214
+ completedAt
215
+ objectCount
216
+ fileSize
217
+ }
218
+ }
219
+ }
220
+ ```
221
+ Variables: `{ "first": 10 }`
222
+
223
+ ## Cancel Bulk Operation
224
+
225
+ ```graphql
226
+ mutation CancelBulkOperation($id: ID!) {
227
+ bulkOperationCancel(id: $id) {
228
+ bulkOperation {
229
+ id
230
+ status
231
+ }
232
+ userErrors {
233
+ field
234
+ message
235
+ }
236
+ }
237
+ }
238
+ ```
239
+
240
+ ## Run Bulk Mutation
241
+
242
+ First, upload JSONL data using staged uploads, then run the mutation.
243
+
244
+ ### Step 1: Create Staged Upload
245
+
246
+ ```graphql
247
+ mutation CreateStagedUpload {
248
+ stagedUploadsCreate(input: {
249
+ resource: BULK_MUTATION_VARIABLES
250
+ filename: "bulk_input.jsonl"
251
+ mimeType: "text/jsonl"
252
+ httpMethod: POST
253
+ }) {
254
+ stagedTargets {
255
+ url
256
+ resourceUrl
257
+ parameters {
258
+ name
259
+ value
260
+ }
261
+ }
262
+ userErrors {
263
+ field
264
+ message
265
+ }
266
+ }
267
+ }
268
+ ```
269
+
270
+ ### Step 2: Run Bulk Mutation
271
+
272
+ ```graphql
273
+ mutation RunBulkMutation($mutation: String!, $stagedUploadPath: String!) {
274
+ bulkOperationRunMutation(mutation: $mutation, stagedUploadPath: $stagedUploadPath) {
275
+ bulkOperation {
276
+ id
277
+ status
278
+ url
279
+ }
280
+ userErrors {
281
+ field
282
+ message
283
+ }
284
+ }
285
+ }
286
+ ```
287
+ Variables:
288
+ ```json
289
+ {
290
+ "mutation": "mutation UpdateProduct($input: ProductInput!) { productUpdate(input: $input) { product { id } userErrors { field message } } }",
291
+ "stagedUploadPath": "tmp/bulk_input.jsonl"
292
+ }
293
+ ```
294
+
295
+ ### Example JSONL Input for Bulk Mutation
296
+
297
+ Each line is a separate mutation input:
298
+
299
+ ```jsonl
300
+ {"input": {"id": "gid://shopify/Product/1", "title": "Updated Title 1"}}
301
+ {"input": {"id": "gid://shopify/Product/2", "title": "Updated Title 2"}}
302
+ {"input": {"id": "gid://shopify/Product/3", "title": "Updated Title 3"}}
303
+ ```
304
+
305
+ ## Bulk Operation Status
306
+
307
+ | Status | Description |
308
+ |--------|-------------|
309
+ | `CREATED` | Operation created, not started |
310
+ | `RUNNING` | Currently processing |
311
+ | `COMPLETED` | Finished successfully |
312
+ | `CANCELING` | Being cancelled |
313
+ | `CANCELED` | Cancelled |
314
+ | `FAILED` | Failed with error |
315
+ | `EXPIRED` | Results expired (7 days) |
316
+
317
+ ## Error Codes
318
+
319
+ | Code | Description |
320
+ |------|-------------|
321
+ | `ACCESS_DENIED` | Insufficient permissions |
322
+ | `INTERNAL_SERVER_ERROR` | Server error |
323
+ | `TIMEOUT` | Operation timed out |
324
+
325
+ ## JSONL Output Format
326
+
327
+ Results are in JSONL (JSON Lines) format:
328
+
329
+ ```jsonl
330
+ {"id":"gid://shopify/Product/1","title":"Product 1","__parentId":null}
331
+ {"id":"gid://shopify/ProductVariant/1","title":"Default","__parentId":"gid://shopify/Product/1"}
332
+ {"id":"gid://shopify/Product/2","title":"Product 2","__parentId":null}
333
+ ```
334
+
335
+ The `__parentId` field links nested objects to their parent.
336
+
337
+ ## Polling Strategy
338
+
339
+ ```javascript
340
+ // Pseudo-code for polling
341
+ async function pollBulkOperation(operationId) {
342
+ let status = 'RUNNING';
343
+ let delay = 1000; // Start with 1 second
344
+
345
+ while (status === 'RUNNING' || status === 'CREATED') {
346
+ await sleep(delay);
347
+ const result = await queryBulkOperation(operationId);
348
+ status = result.status;
349
+
350
+ if (status === 'COMPLETED') {
351
+ return result.url; // Download URL for results
352
+ }
353
+
354
+ // Exponential backoff, max 30 seconds
355
+ delay = Math.min(delay * 2, 30000);
356
+ }
357
+
358
+ throw new Error(`Bulk operation failed: ${status}`);
359
+ }
360
+ ```
361
+
362
+ ## Limits
363
+
364
+ | Limit | Value |
365
+ |-------|-------|
366
+ | Concurrent query operations | 1 per shop |
367
+ | Concurrent mutation operations | 1 per shop |
368
+ | Result availability | 7 days |
369
+ | Max connections per query | 5 |
370
+ | Max nesting depth | 2 levels |
371
+
372
+ ## API Scopes Required
373
+
374
+ - Depends on the resources being queried/mutated
375
+ - `read_products` for product queries
376
+ - `write_products` for product mutations
377
+ - etc.
378
+
379
+ ## Notes
380
+
381
+ - One bulk query and one bulk mutation can run simultaneously
382
+ - Results are available for 7 days after completion
383
+ - Use `__parentId` to reconstruct nested relationships
384
+ - Bulk operations bypass rate limits but have their own constraints
385
+ - Download and process results before they expire
386
+ - Mutations require staged upload with JSONL input
@@ -0,0 +1,71 @@
1
+ # Shopify Collections & Discounts
2
+
3
+ ## Collections
4
+
5
+ ### List Collections
6
+
7
+ ```graphql
8
+ query ListCollections($first: Int!) {
9
+ collections(first: $first) {
10
+ nodes {
11
+ id
12
+ title
13
+ handle
14
+ productsCount {
15
+ count
16
+ precision
17
+ }
18
+ }
19
+ }
20
+ }
21
+ ```
22
+ Variables: `{ "first": 10 }`
23
+
24
+ Note: `productsCount.precision` indicates if count is `EXACT` or `AT_LEAST` (estimated).
25
+
26
+ ### Get Collection Products
27
+
28
+ ```graphql
29
+ query GetCollectionProducts($id: ID!, $first: Int!) {
30
+ collection(id: $id) {
31
+ id
32
+ title
33
+ products(first: $first) {
34
+ nodes {
35
+ id
36
+ title
37
+ status
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ```
43
+ Variables: `{ "id": "gid://shopify/Collection/123", "first": 20 }`
44
+
45
+ ---
46
+
47
+ ## Discounts
48
+
49
+ ### List Discount Codes
50
+
51
+ ```graphql
52
+ query ListDiscounts($first: Int!) {
53
+ codeDiscountNodes(first: $first) {
54
+ nodes {
55
+ id
56
+ codeDiscount {
57
+ ... on DiscountCodeBasic {
58
+ title
59
+ status
60
+ codes(first: 5) {
61
+ nodes {
62
+ code
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ```
71
+ Variables: `{ "first": 10 }`
@@ -0,0 +1,141 @@
1
+ # Shopify Customers
2
+
3
+ ## List Customers
4
+
5
+ ```graphql
6
+ query ListCustomers($first: Int!, $after: String, $query: String) {
7
+ customers(first: $first, after: $after, query: $query) {
8
+ pageInfo {
9
+ hasNextPage
10
+ endCursor
11
+ }
12
+ nodes {
13
+ id
14
+ displayName
15
+ defaultEmailAddress {
16
+ emailAddress
17
+ }
18
+ defaultPhoneNumber {
19
+ phoneNumber
20
+ }
21
+ createdAt
22
+ numberOfOrders
23
+ amountSpent {
24
+ amount
25
+ currencyCode
26
+ }
27
+ }
28
+ }
29
+ }
30
+ ```
31
+ Variables: `{ "first": 10 }`
32
+
33
+ Customer query syntax:
34
+ - `email:*@gmail.com` - by email pattern
35
+ - `number_of_orders:>5` - by order count
36
+ - `amount_spent:>100` - by total spent
37
+
38
+ ## Get Customer by ID
39
+
40
+ ```graphql
41
+ query GetCustomer($id: ID!) {
42
+ customer(id: $id) {
43
+ id
44
+ displayName
45
+ firstName
46
+ lastName
47
+ defaultEmailAddress {
48
+ emailAddress
49
+ }
50
+ defaultPhoneNumber {
51
+ phoneNumber
52
+ }
53
+ createdAt
54
+ numberOfOrders
55
+ amountSpent {
56
+ amount
57
+ currencyCode
58
+ }
59
+ tags
60
+ addresses {
61
+ address1
62
+ address2
63
+ city
64
+ province
65
+ country
66
+ zip
67
+ }
68
+ orders(first: 10) {
69
+ nodes {
70
+ id
71
+ name
72
+ totalPriceSet {
73
+ shopMoney {
74
+ amount
75
+ currencyCode
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ ```
83
+ Variables: `{ "id": "gid://shopify/Customer/123" }`
84
+
85
+ ## Create Customer
86
+
87
+ ```graphql
88
+ mutation CreateCustomer($input: CustomerInput!) {
89
+ customerCreate(input: $input) {
90
+ customer {
91
+ id
92
+ displayName
93
+ defaultEmailAddress {
94
+ emailAddress
95
+ }
96
+ }
97
+ userErrors {
98
+ field
99
+ message
100
+ }
101
+ }
102
+ }
103
+ ```
104
+ Variables:
105
+ ```json
106
+ {
107
+ "input": {
108
+ "firstName": "John",
109
+ "lastName": "Doe",
110
+ "email": "john@example.com",
111
+ "phone": "+1234567890",
112
+ "tags": ["vip"]
113
+ }
114
+ }
115
+ ```
116
+
117
+ ## Update Customer
118
+
119
+ ```graphql
120
+ mutation UpdateCustomer($input: CustomerInput!) {
121
+ customerUpdate(input: $input) {
122
+ customer {
123
+ id
124
+ tags
125
+ }
126
+ userErrors {
127
+ field
128
+ message
129
+ }
130
+ }
131
+ }
132
+ ```
133
+ Variables:
134
+ ```json
135
+ {
136
+ "input": {
137
+ "id": "gid://shopify/Customer/123",
138
+ "tags": ["vip", "wholesale"]
139
+ }
140
+ }
141
+ ```