shopify-store-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +172 -0
  3. package/dist/config.d.ts +10 -0
  4. package/dist/config.js +65 -0
  5. package/dist/db.d.ts +19 -0
  6. package/dist/db.js +161 -0
  7. package/dist/errors.d.ts +36 -0
  8. package/dist/errors.js +93 -0
  9. package/dist/graphql/admin/common/collections.d.ts +8 -0
  10. package/dist/graphql/admin/common/collections.js +44 -0
  11. package/dist/graphql/admin/common/customers.d.ts +13 -0
  12. package/dist/graphql/admin/common/customers.js +112 -0
  13. package/dist/graphql/admin/common/orders.d.ts +13 -0
  14. package/dist/graphql/admin/common/orders.js +142 -0
  15. package/dist/graphql/admin/common/products.d.ts +23 -0
  16. package/dist/graphql/admin/common/products.js +159 -0
  17. package/dist/graphql/admin/common/shop.d.ts +7 -0
  18. package/dist/graphql/admin/common/shop.js +38 -0
  19. package/dist/graphql/admin/index.d.ts +15 -0
  20. package/dist/graphql/admin/index.js +18 -0
  21. package/dist/graphql/admin/specialized/bulk.d.ts +33 -0
  22. package/dist/graphql/admin/specialized/bulk.js +132 -0
  23. package/dist/graphql/admin/specialized/files.d.ts +22 -0
  24. package/dist/graphql/admin/specialized/files.js +170 -0
  25. package/dist/graphql/admin/specialized/inventory.d.ts +13 -0
  26. package/dist/graphql/admin/specialized/inventory.js +78 -0
  27. package/dist/graphql/admin/specialized/metafields.d.ts +22 -0
  28. package/dist/graphql/admin/specialized/metafields.js +100 -0
  29. package/dist/graphql/admin/specialized/metaobjects.d.ts +36 -0
  30. package/dist/graphql/admin/specialized/metaobjects.js +239 -0
  31. package/dist/graphql/admin/specialized/search.d.ts +21 -0
  32. package/dist/graphql/admin/specialized/search.js +100 -0
  33. package/dist/graphql/collections.d.ts +1 -0
  34. package/dist/graphql/collections.js +37 -0
  35. package/dist/graphql/customers.d.ts +2 -0
  36. package/dist/graphql/customers.js +98 -0
  37. package/dist/graphql/inventory.d.ts +2 -0
  38. package/dist/graphql/inventory.js +67 -0
  39. package/dist/graphql/metafields.d.ts +2 -0
  40. package/dist/graphql/metafields.js +43 -0
  41. package/dist/graphql/orders.d.ts +2 -0
  42. package/dist/graphql/orders.js +116 -0
  43. package/dist/graphql/products.d.ts +4 -0
  44. package/dist/graphql/products.js +140 -0
  45. package/dist/graphql/shop.d.ts +1 -0
  46. package/dist/graphql/shop.js +32 -0
  47. package/dist/graphql/storefront/common/cart.d.ts +23 -0
  48. package/dist/graphql/storefront/common/cart.js +210 -0
  49. package/dist/graphql/storefront/common/collections.d.ts +11 -0
  50. package/dist/graphql/storefront/common/collections.js +114 -0
  51. package/dist/graphql/storefront/common/products.d.ts +14 -0
  52. package/dist/graphql/storefront/common/products.js +155 -0
  53. package/dist/graphql/storefront/index.d.ts +7 -0
  54. package/dist/graphql/storefront/index.js +8 -0
  55. package/dist/index.d.ts +2 -0
  56. package/dist/index.js +97 -0
  57. package/dist/logger.d.ts +58 -0
  58. package/dist/logger.js +165 -0
  59. package/dist/prompts/index.d.ts +2 -0
  60. package/dist/prompts/index.js +169 -0
  61. package/dist/queue.d.ts +73 -0
  62. package/dist/queue.js +120 -0
  63. package/dist/resources/index.d.ts +3 -0
  64. package/dist/resources/index.js +180 -0
  65. package/dist/shopify-client.d.ts +16 -0
  66. package/dist/shopify-client.js +39 -0
  67. package/dist/tools/graphql.d.ts +3 -0
  68. package/dist/tools/graphql.js +41 -0
  69. package/dist/tools/index.d.ts +3 -0
  70. package/dist/tools/index.js +23 -0
  71. package/dist/tools/infrastructure.d.ts +6 -0
  72. package/dist/tools/infrastructure.js +215 -0
  73. package/dist/tools/shop.d.ts +3 -0
  74. package/dist/tools/shop.js +28 -0
  75. package/dist/tools/smart-bulk.d.ts +7 -0
  76. package/dist/tools/smart-bulk.js +286 -0
  77. package/dist/tools/smart-files.d.ts +7 -0
  78. package/dist/tools/smart-files.js +169 -0
  79. package/dist/tools/smart-metaobjects.d.ts +7 -0
  80. package/dist/tools/smart-metaobjects.js +186 -0
  81. package/dist/tools/smart-schema.d.ts +7 -0
  82. package/dist/tools/smart-schema.js +138 -0
  83. package/dist/types.d.ts +19 -0
  84. package/dist/types.js +2 -0
  85. package/dist/utils/polling.d.ts +53 -0
  86. package/dist/utils/polling.js +77 -0
  87. package/package.json +83 -0
  88. package/prisma/schema.prisma +82 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * GraphQL queries for customer operations
3
+ */
4
+ /**
5
+ * Get a paginated list of customers with basic info
6
+ * Supports search query filtering
7
+ */
8
+ export const GET_CUSTOMERS = `#graphql
9
+ query GetCustomers($first: Int!, $after: String, $query: String) {
10
+ customers(first: $first, after: $after, query: $query) {
11
+ edges {
12
+ node {
13
+ id
14
+ displayName
15
+ email
16
+ phone
17
+ state
18
+ numberOfOrders
19
+ amountSpent {
20
+ amount
21
+ currencyCode
22
+ }
23
+ createdAt
24
+ updatedAt
25
+ tags
26
+ defaultAddress {
27
+ city
28
+ province
29
+ country
30
+ }
31
+ }
32
+ cursor
33
+ }
34
+ pageInfo {
35
+ hasNextPage
36
+ endCursor
37
+ }
38
+ }
39
+ }
40
+ `;
41
+ /**
42
+ * Get a single customer by ID with full details
43
+ * Includes addresses, recent orders, and metafields
44
+ */
45
+ export const GET_CUSTOMER = `#graphql
46
+ query GetCustomer($id: ID!) {
47
+ customer(id: $id) {
48
+ id
49
+ displayName
50
+ firstName
51
+ lastName
52
+ email
53
+ phone
54
+ state
55
+ note
56
+ tags
57
+ numberOfOrders
58
+ amountSpent {
59
+ amount
60
+ currencyCode
61
+ }
62
+ createdAt
63
+ updatedAt
64
+ defaultAddress {
65
+ address1
66
+ address2
67
+ city
68
+ province
69
+ country
70
+ zip
71
+ phone
72
+ }
73
+ addresses {
74
+ address1
75
+ address2
76
+ city
77
+ province
78
+ country
79
+ zip
80
+ }
81
+ orders(first: 10) {
82
+ edges {
83
+ node {
84
+ id
85
+ name
86
+ createdAt
87
+ displayFinancialStatus
88
+ displayFulfillmentStatus
89
+ totalPriceSet {
90
+ shopMoney {
91
+ amount
92
+ currencyCode
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ metafields(first: 10) {
99
+ edges {
100
+ node {
101
+ id
102
+ namespace
103
+ key
104
+ value
105
+ type
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ `;
112
+ //# sourceMappingURL=customers.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * GraphQL queries for order operations
3
+ */
4
+ /**
5
+ * Get a paginated list of orders with basic customer and line item info
6
+ * Supports search query filtering
7
+ */
8
+ export declare const GET_ORDERS = "#graphql\n query GetOrders($first: Int!, $after: String, $query: String) {\n orders(first: $first, after: $after, query: $query) {\n edges {\n node {\n id\n name\n email\n createdAt\n displayFinancialStatus\n displayFulfillmentStatus\n totalPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n customer {\n id\n displayName\n email\n }\n lineItems(first: 10) {\n edges {\n node {\n title\n quantity\n originalUnitPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
9
+ /**
10
+ * Get a single order by ID with full details
11
+ * Includes line items, customer, addresses, fulfillments, and financial info
12
+ */
13
+ export declare const GET_ORDER = "#graphql\n query GetOrder($id: ID!) {\n order(id: $id) {\n id\n name\n email\n phone\n createdAt\n updatedAt\n cancelledAt\n closedAt\n displayFinancialStatus\n displayFulfillmentStatus\n note\n tags\n totalPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n subtotalPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n totalShippingPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n customer {\n id\n displayName\n email\n phone\n }\n shippingAddress {\n address1\n address2\n city\n province\n country\n zip\n }\n lineItems(first: 50) {\n edges {\n node {\n title\n quantity\n sku\n originalUnitPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n variant {\n id\n title\n }\n }\n }\n }\n fulfillments {\n id\n status\n trackingInfo {\n number\n url\n company\n }\n }\n }\n }\n";
@@ -0,0 +1,142 @@
1
+ /**
2
+ * GraphQL queries for order operations
3
+ */
4
+ /**
5
+ * Get a paginated list of orders with basic customer and line item info
6
+ * Supports search query filtering
7
+ */
8
+ export const GET_ORDERS = `#graphql
9
+ query GetOrders($first: Int!, $after: String, $query: String) {
10
+ orders(first: $first, after: $after, query: $query) {
11
+ edges {
12
+ node {
13
+ id
14
+ name
15
+ email
16
+ createdAt
17
+ displayFinancialStatus
18
+ displayFulfillmentStatus
19
+ totalPriceSet {
20
+ shopMoney {
21
+ amount
22
+ currencyCode
23
+ }
24
+ }
25
+ customer {
26
+ id
27
+ displayName
28
+ email
29
+ }
30
+ lineItems(first: 10) {
31
+ edges {
32
+ node {
33
+ title
34
+ quantity
35
+ originalUnitPriceSet {
36
+ shopMoney {
37
+ amount
38
+ currencyCode
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ cursor
46
+ }
47
+ pageInfo {
48
+ hasNextPage
49
+ endCursor
50
+ }
51
+ }
52
+ }
53
+ `;
54
+ /**
55
+ * Get a single order by ID with full details
56
+ * Includes line items, customer, addresses, fulfillments, and financial info
57
+ */
58
+ export const GET_ORDER = `#graphql
59
+ query GetOrder($id: ID!) {
60
+ order(id: $id) {
61
+ id
62
+ name
63
+ email
64
+ phone
65
+ createdAt
66
+ updatedAt
67
+ cancelledAt
68
+ closedAt
69
+ displayFinancialStatus
70
+ displayFulfillmentStatus
71
+ note
72
+ tags
73
+ totalPriceSet {
74
+ shopMoney {
75
+ amount
76
+ currencyCode
77
+ }
78
+ }
79
+ subtotalPriceSet {
80
+ shopMoney {
81
+ amount
82
+ currencyCode
83
+ }
84
+ }
85
+ totalTaxSet {
86
+ shopMoney {
87
+ amount
88
+ currencyCode
89
+ }
90
+ }
91
+ totalShippingPriceSet {
92
+ shopMoney {
93
+ amount
94
+ currencyCode
95
+ }
96
+ }
97
+ customer {
98
+ id
99
+ displayName
100
+ email
101
+ phone
102
+ }
103
+ shippingAddress {
104
+ address1
105
+ address2
106
+ city
107
+ province
108
+ country
109
+ zip
110
+ }
111
+ lineItems(first: 50) {
112
+ edges {
113
+ node {
114
+ title
115
+ quantity
116
+ sku
117
+ originalUnitPriceSet {
118
+ shopMoney {
119
+ amount
120
+ currencyCode
121
+ }
122
+ }
123
+ variant {
124
+ id
125
+ title
126
+ }
127
+ }
128
+ }
129
+ }
130
+ fulfillments {
131
+ id
132
+ status
133
+ trackingInfo {
134
+ number
135
+ url
136
+ company
137
+ }
138
+ }
139
+ }
140
+ }
141
+ `;
142
+ //# sourceMappingURL=orders.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * GraphQL queries and mutations for product operations
3
+ */
4
+ /**
5
+ * Get a paginated list of products with basic variant and image info
6
+ * Supports search query filtering
7
+ */
8
+ export declare const GET_PRODUCTS = "#graphql\n query GetProducts($first: Int!, $after: String, $query: String) {\n products(first: $first, after: $after, query: $query) {\n edges {\n node {\n id\n title\n handle\n descriptionHtml\n vendor\n productType\n status\n tags\n totalInventory\n createdAt\n updatedAt\n variants(first: 10) {\n edges {\n node {\n id\n title\n sku\n price\n inventoryQuantity\n }\n }\n }\n images(first: 5) {\n edges {\n node {\n id\n url\n altText\n }\n }\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
9
+ /**
10
+ * Get a single product by ID with full details
11
+ * Includes all variants, images, options, and metafields
12
+ */
13
+ export declare const GET_PRODUCT = "#graphql\n query GetProduct($id: ID!) {\n product(id: $id) {\n id\n title\n handle\n descriptionHtml\n vendor\n productType\n status\n tags\n totalInventory\n createdAt\n updatedAt\n options {\n id\n name\n values\n }\n variants(first: 100) {\n edges {\n node {\n id\n title\n sku\n price\n compareAtPrice\n inventoryQuantity\n selectedOptions {\n name\n value\n }\n }\n }\n }\n images(first: 20) {\n edges {\n node {\n id\n url\n altText\n width\n height\n }\n }\n }\n metafields(first: 20) {\n edges {\n node {\n id\n namespace\n key\n value\n type\n }\n }\n }\n }\n }\n";
14
+ /**
15
+ * Create a new product
16
+ * Returns the created product's basic info
17
+ */
18
+ export declare const CREATE_PRODUCT = "#graphql\n mutation ProductCreate($product: ProductCreateInput!) {\n productCreate(product: $product) {\n product {\n id\n title\n handle\n status\n }\n userErrors {\n field\n message\n }\n }\n }\n";
19
+ /**
20
+ * Update an existing product
21
+ * Returns the updated product's basic info
22
+ */
23
+ export declare const UPDATE_PRODUCT = "#graphql\n mutation ProductUpdate($product: ProductUpdateInput!) {\n productUpdate(product: $product) {\n product {\n id\n title\n handle\n status\n updatedAt\n }\n userErrors {\n field\n message\n }\n }\n }\n";
@@ -0,0 +1,159 @@
1
+ /**
2
+ * GraphQL queries and mutations for product operations
3
+ */
4
+ /**
5
+ * Get a paginated list of products with basic variant and image info
6
+ * Supports search query filtering
7
+ */
8
+ export const GET_PRODUCTS = `#graphql
9
+ query GetProducts($first: Int!, $after: String, $query: String) {
10
+ products(first: $first, after: $after, query: $query) {
11
+ edges {
12
+ node {
13
+ id
14
+ title
15
+ handle
16
+ descriptionHtml
17
+ vendor
18
+ productType
19
+ status
20
+ tags
21
+ totalInventory
22
+ createdAt
23
+ updatedAt
24
+ variants(first: 10) {
25
+ edges {
26
+ node {
27
+ id
28
+ title
29
+ sku
30
+ price
31
+ inventoryQuantity
32
+ }
33
+ }
34
+ }
35
+ images(first: 5) {
36
+ edges {
37
+ node {
38
+ id
39
+ url
40
+ altText
41
+ }
42
+ }
43
+ }
44
+ }
45
+ cursor
46
+ }
47
+ pageInfo {
48
+ hasNextPage
49
+ endCursor
50
+ }
51
+ }
52
+ }
53
+ `;
54
+ /**
55
+ * Get a single product by ID with full details
56
+ * Includes all variants, images, options, and metafields
57
+ */
58
+ export const GET_PRODUCT = `#graphql
59
+ query GetProduct($id: ID!) {
60
+ product(id: $id) {
61
+ id
62
+ title
63
+ handle
64
+ descriptionHtml
65
+ vendor
66
+ productType
67
+ status
68
+ tags
69
+ totalInventory
70
+ createdAt
71
+ updatedAt
72
+ options {
73
+ id
74
+ name
75
+ values
76
+ }
77
+ variants(first: 100) {
78
+ edges {
79
+ node {
80
+ id
81
+ title
82
+ sku
83
+ price
84
+ compareAtPrice
85
+ inventoryQuantity
86
+ selectedOptions {
87
+ name
88
+ value
89
+ }
90
+ }
91
+ }
92
+ }
93
+ images(first: 20) {
94
+ edges {
95
+ node {
96
+ id
97
+ url
98
+ altText
99
+ width
100
+ height
101
+ }
102
+ }
103
+ }
104
+ metafields(first: 20) {
105
+ edges {
106
+ node {
107
+ id
108
+ namespace
109
+ key
110
+ value
111
+ type
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ `;
118
+ /**
119
+ * Create a new product
120
+ * Returns the created product's basic info
121
+ */
122
+ export const CREATE_PRODUCT = `#graphql
123
+ mutation ProductCreate($product: ProductCreateInput!) {
124
+ productCreate(product: $product) {
125
+ product {
126
+ id
127
+ title
128
+ handle
129
+ status
130
+ }
131
+ userErrors {
132
+ field
133
+ message
134
+ }
135
+ }
136
+ }
137
+ `;
138
+ /**
139
+ * Update an existing product
140
+ * Returns the updated product's basic info
141
+ */
142
+ export const UPDATE_PRODUCT = `#graphql
143
+ mutation ProductUpdate($product: ProductUpdateInput!) {
144
+ productUpdate(product: $product) {
145
+ product {
146
+ id
147
+ title
148
+ handle
149
+ status
150
+ updatedAt
151
+ }
152
+ userErrors {
153
+ field
154
+ message
155
+ }
156
+ }
157
+ }
158
+ `;
159
+ //# sourceMappingURL=products.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * GraphQL queries for shop/store information
3
+ */
4
+ /**
5
+ * Get basic shop information including name, domain, plan, and settings
6
+ */
7
+ export declare const GET_SHOP = "#graphql\n query GetShop {\n shop {\n id\n name\n email\n url\n myshopifyDomain\n plan {\n displayName\n partnerDevelopment\n shopifyPlus\n }\n primaryDomain {\n url\n host\n }\n currencyCode\n weightUnit\n billingAddress {\n address1\n city\n province\n country\n zip\n }\n timezoneAbbreviation\n ianaTimezone\n }\n }\n";
@@ -0,0 +1,38 @@
1
+ /**
2
+ * GraphQL queries for shop/store information
3
+ */
4
+ /**
5
+ * Get basic shop information including name, domain, plan, and settings
6
+ */
7
+ export const GET_SHOP = `#graphql
8
+ query GetShop {
9
+ shop {
10
+ id
11
+ name
12
+ email
13
+ url
14
+ myshopifyDomain
15
+ plan {
16
+ displayName
17
+ partnerDevelopment
18
+ shopifyPlus
19
+ }
20
+ primaryDomain {
21
+ url
22
+ host
23
+ }
24
+ currencyCode
25
+ weightUnit
26
+ billingAddress {
27
+ address1
28
+ city
29
+ province
30
+ country
31
+ zip
32
+ }
33
+ timezoneAbbreviation
34
+ ianaTimezone
35
+ }
36
+ }
37
+ `;
38
+ //# sourceMappingURL=shop.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Admin API GraphQL queries and mutations
3
+ * Re-exports all queries organized by domain
4
+ */
5
+ export * from "./common/shop.js";
6
+ export * from "./common/products.js";
7
+ export * from "./common/orders.js";
8
+ export * from "./common/customers.js";
9
+ export * from "./common/collections.js";
10
+ export * from "./specialized/inventory.js";
11
+ export * from "./specialized/metafields.js";
12
+ export * from "./specialized/search.js";
13
+ export * from "./specialized/files.js";
14
+ export * from "./specialized/bulk.js";
15
+ export * from "./specialized/metaobjects.js";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Admin API GraphQL queries and mutations
3
+ * Re-exports all queries organized by domain
4
+ */
5
+ // Common queries
6
+ export * from "./common/shop.js";
7
+ export * from "./common/products.js";
8
+ export * from "./common/orders.js";
9
+ export * from "./common/customers.js";
10
+ export * from "./common/collections.js";
11
+ // Specialized queries
12
+ export * from "./specialized/inventory.js";
13
+ export * from "./specialized/metafields.js";
14
+ export * from "./specialized/search.js";
15
+ export * from "./specialized/files.js";
16
+ export * from "./specialized/bulk.js";
17
+ export * from "./specialized/metaobjects.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,33 @@
1
+ /**
2
+ * GraphQL queries and mutations for bulk operations
3
+ * Used by bulk_export and bulk_import smart tools
4
+ */
5
+ /**
6
+ * Start a bulk query operation
7
+ * The query parameter should be a GraphQL query without the top-level `query` keyword
8
+ * Example: { products { edges { node { id title } } } }
9
+ */
10
+ export declare const BULK_OPERATION_RUN_QUERY = "#graphql\n mutation BulkOperationRunQuery($query: String!) {\n bulkOperationRunQuery(query: $query) {\n bulkOperation {\n id\n status\n query\n rootObjectCount\n objectCount\n createdAt\n }\n userErrors {\n field\n message\n }\n }\n }\n";
11
+ /**
12
+ * Start a bulk mutation operation
13
+ * Requires a staged upload path containing JSONL data
14
+ */
15
+ export declare const BULK_OPERATION_RUN_MUTATION = "#graphql\n mutation BulkOperationRunMutation($mutation: String!, $stagedUploadPath: String!) {\n bulkOperationRunMutation(mutation: $mutation, stagedUploadPath: $stagedUploadPath) {\n bulkOperation {\n id\n status\n url\n objectCount\n }\n userErrors {\n field\n message\n }\n }\n }\n";
16
+ /**
17
+ * Get current bulk operation status
18
+ * Only one bulk operation can run at a time per app
19
+ */
20
+ export declare const GET_CURRENT_BULK_OPERATION = "#graphql\n query GetCurrentBulkOperation {\n currentBulkOperation {\n id\n type\n status\n query\n url\n rootObjectCount\n objectCount\n fileSize\n partialDataUrl\n errorCode\n createdAt\n completedAt\n }\n }\n";
21
+ /**
22
+ * Get a specific bulk operation by ID
23
+ */
24
+ export declare const GET_BULK_OPERATION = "#graphql\n query GetBulkOperation($id: ID!) {\n node(id: $id) {\n ... on BulkOperation {\n id\n type\n status\n query\n url\n rootObjectCount\n objectCount\n fileSize\n partialDataUrl\n errorCode\n createdAt\n completedAt\n }\n }\n }\n";
25
+ /**
26
+ * Cancel a running bulk operation
27
+ */
28
+ export declare const BULK_OPERATION_CANCEL = "#graphql\n mutation BulkOperationCancel($id: ID!) {\n bulkOperationCancel(id: $id) {\n bulkOperation {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }\n";
29
+ /**
30
+ * Create staged upload targets for file upload
31
+ * Used before bulk mutation to upload JSONL data
32
+ */
33
+ export declare const STAGED_UPLOADS_CREATE = "#graphql\n mutation StagedUploadsCreate($input: [StagedUploadInput!]!) {\n stagedUploadsCreate(input: $input) {\n stagedTargets {\n url\n resourceUrl\n parameters {\n name\n value\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
@@ -0,0 +1,132 @@
1
+ /**
2
+ * GraphQL queries and mutations for bulk operations
3
+ * Used by bulk_export and bulk_import smart tools
4
+ */
5
+ /**
6
+ * Start a bulk query operation
7
+ * The query parameter should be a GraphQL query without the top-level `query` keyword
8
+ * Example: { products { edges { node { id title } } } }
9
+ */
10
+ export const BULK_OPERATION_RUN_QUERY = `#graphql
11
+ mutation BulkOperationRunQuery($query: String!) {
12
+ bulkOperationRunQuery(query: $query) {
13
+ bulkOperation {
14
+ id
15
+ status
16
+ query
17
+ rootObjectCount
18
+ objectCount
19
+ createdAt
20
+ }
21
+ userErrors {
22
+ field
23
+ message
24
+ }
25
+ }
26
+ }
27
+ `;
28
+ /**
29
+ * Start a bulk mutation operation
30
+ * Requires a staged upload path containing JSONL data
31
+ */
32
+ export const BULK_OPERATION_RUN_MUTATION = `#graphql
33
+ mutation BulkOperationRunMutation($mutation: String!, $stagedUploadPath: String!) {
34
+ bulkOperationRunMutation(mutation: $mutation, stagedUploadPath: $stagedUploadPath) {
35
+ bulkOperation {
36
+ id
37
+ status
38
+ url
39
+ objectCount
40
+ }
41
+ userErrors {
42
+ field
43
+ message
44
+ }
45
+ }
46
+ }
47
+ `;
48
+ /**
49
+ * Get current bulk operation status
50
+ * Only one bulk operation can run at a time per app
51
+ */
52
+ export const GET_CURRENT_BULK_OPERATION = `#graphql
53
+ query GetCurrentBulkOperation {
54
+ currentBulkOperation {
55
+ id
56
+ type
57
+ status
58
+ query
59
+ url
60
+ rootObjectCount
61
+ objectCount
62
+ fileSize
63
+ partialDataUrl
64
+ errorCode
65
+ createdAt
66
+ completedAt
67
+ }
68
+ }
69
+ `;
70
+ /**
71
+ * Get a specific bulk operation by ID
72
+ */
73
+ export const GET_BULK_OPERATION = `#graphql
74
+ query GetBulkOperation($id: ID!) {
75
+ node(id: $id) {
76
+ ... on BulkOperation {
77
+ id
78
+ type
79
+ status
80
+ query
81
+ url
82
+ rootObjectCount
83
+ objectCount
84
+ fileSize
85
+ partialDataUrl
86
+ errorCode
87
+ createdAt
88
+ completedAt
89
+ }
90
+ }
91
+ }
92
+ `;
93
+ /**
94
+ * Cancel a running bulk operation
95
+ */
96
+ export const BULK_OPERATION_CANCEL = `#graphql
97
+ mutation BulkOperationCancel($id: ID!) {
98
+ bulkOperationCancel(id: $id) {
99
+ bulkOperation {
100
+ id
101
+ status
102
+ }
103
+ userErrors {
104
+ field
105
+ message
106
+ }
107
+ }
108
+ }
109
+ `;
110
+ /**
111
+ * Create staged upload targets for file upload
112
+ * Used before bulk mutation to upload JSONL data
113
+ */
114
+ export const STAGED_UPLOADS_CREATE = `#graphql
115
+ mutation StagedUploadsCreate($input: [StagedUploadInput!]!) {
116
+ stagedUploadsCreate(input: $input) {
117
+ stagedTargets {
118
+ url
119
+ resourceUrl
120
+ parameters {
121
+ name
122
+ value
123
+ }
124
+ }
125
+ userErrors {
126
+ field
127
+ message
128
+ }
129
+ }
130
+ }
131
+ `;
132
+ //# sourceMappingURL=bulk.js.map