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,22 @@
1
+ /**
2
+ * GraphQL queries and mutations for file operations
3
+ * Used by the upload_file smart tool
4
+ */
5
+ /**
6
+ * Create file(s) from external URL
7
+ * Shopify will fetch the file and process it
8
+ */
9
+ export declare const FILE_CREATE = "#graphql\n mutation FileCreate($files: [FileCreateInput!]!) {\n fileCreate(files: $files) {\n files {\n id\n alt\n createdAt\n fileStatus\n fileErrors {\n code\n details\n message\n }\n ... on GenericFile {\n url\n mimeType\n originalFileSize\n }\n ... on MediaImage {\n id\n alt\n mimeType\n image {\n url\n width\n height\n }\n }\n ... on Video {\n id\n alt\n originalSource {\n url\n mimeType\n }\n duration\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
10
+ /**
11
+ * Get file status by ID
12
+ * Used for polling until file is READY
13
+ */
14
+ export declare const GET_FILE = "#graphql\n query GetFile($id: ID!) {\n node(id: $id) {\n ... on GenericFile {\n id\n alt\n fileStatus\n url\n mimeType\n originalFileSize\n fileErrors {\n code\n details\n message\n }\n }\n ... on MediaImage {\n id\n alt\n fileStatus\n image {\n url\n width\n height\n }\n fileErrors {\n code\n details\n message\n }\n }\n ... on Video {\n id\n alt\n fileStatus\n originalSource {\n url\n }\n duration\n fileErrors {\n code\n details\n message\n }\n }\n }\n }\n";
15
+ /**
16
+ * List files with optional filtering
17
+ */
18
+ export declare const GET_FILES = "#graphql\n query GetFiles($first: Int!, $after: String, $query: String) {\n files(first: $first, after: $after, query: $query) {\n edges {\n node {\n id\n alt\n createdAt\n fileStatus\n fileErrors {\n code\n details\n message\n }\n ... on GenericFile {\n url\n mimeType\n originalFileSize\n }\n ... on MediaImage {\n id\n alt\n mimeType\n image {\n url\n width\n height\n }\n }\n ... on Video {\n id\n alt\n originalSource {\n url\n mimeType\n }\n duration\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
19
+ /**
20
+ * Delete file(s)
21
+ */
22
+ export declare const FILE_DELETE = "#graphql\n mutation FileDelete($fileIds: [ID!]!) {\n fileDelete(fileIds: $fileIds) {\n deletedFileIds\n userErrors {\n field\n message\n }\n }\n }\n";
@@ -0,0 +1,170 @@
1
+ /**
2
+ * GraphQL queries and mutations for file operations
3
+ * Used by the upload_file smart tool
4
+ */
5
+ /**
6
+ * Create file(s) from external URL
7
+ * Shopify will fetch the file and process it
8
+ */
9
+ export const FILE_CREATE = `#graphql
10
+ mutation FileCreate($files: [FileCreateInput!]!) {
11
+ fileCreate(files: $files) {
12
+ files {
13
+ id
14
+ alt
15
+ createdAt
16
+ fileStatus
17
+ fileErrors {
18
+ code
19
+ details
20
+ message
21
+ }
22
+ ... on GenericFile {
23
+ url
24
+ mimeType
25
+ originalFileSize
26
+ }
27
+ ... on MediaImage {
28
+ id
29
+ alt
30
+ mimeType
31
+ image {
32
+ url
33
+ width
34
+ height
35
+ }
36
+ }
37
+ ... on Video {
38
+ id
39
+ alt
40
+ originalSource {
41
+ url
42
+ mimeType
43
+ }
44
+ duration
45
+ }
46
+ }
47
+ userErrors {
48
+ field
49
+ message
50
+ }
51
+ }
52
+ }
53
+ `;
54
+ /**
55
+ * Get file status by ID
56
+ * Used for polling until file is READY
57
+ */
58
+ export const GET_FILE = `#graphql
59
+ query GetFile($id: ID!) {
60
+ node(id: $id) {
61
+ ... on GenericFile {
62
+ id
63
+ alt
64
+ fileStatus
65
+ url
66
+ mimeType
67
+ originalFileSize
68
+ fileErrors {
69
+ code
70
+ details
71
+ message
72
+ }
73
+ }
74
+ ... on MediaImage {
75
+ id
76
+ alt
77
+ fileStatus
78
+ image {
79
+ url
80
+ width
81
+ height
82
+ }
83
+ fileErrors {
84
+ code
85
+ details
86
+ message
87
+ }
88
+ }
89
+ ... on Video {
90
+ id
91
+ alt
92
+ fileStatus
93
+ originalSource {
94
+ url
95
+ }
96
+ duration
97
+ fileErrors {
98
+ code
99
+ details
100
+ message
101
+ }
102
+ }
103
+ }
104
+ }
105
+ `;
106
+ /**
107
+ * List files with optional filtering
108
+ */
109
+ export const GET_FILES = `#graphql
110
+ query GetFiles($first: Int!, $after: String, $query: String) {
111
+ files(first: $first, after: $after, query: $query) {
112
+ edges {
113
+ node {
114
+ id
115
+ alt
116
+ createdAt
117
+ fileStatus
118
+ fileErrors {
119
+ code
120
+ details
121
+ message
122
+ }
123
+ ... on GenericFile {
124
+ url
125
+ mimeType
126
+ originalFileSize
127
+ }
128
+ ... on MediaImage {
129
+ id
130
+ alt
131
+ mimeType
132
+ image {
133
+ url
134
+ width
135
+ height
136
+ }
137
+ }
138
+ ... on Video {
139
+ id
140
+ alt
141
+ originalSource {
142
+ url
143
+ mimeType
144
+ }
145
+ duration
146
+ }
147
+ }
148
+ }
149
+ pageInfo {
150
+ hasNextPage
151
+ endCursor
152
+ }
153
+ }
154
+ }
155
+ `;
156
+ /**
157
+ * Delete file(s)
158
+ */
159
+ export const FILE_DELETE = `#graphql
160
+ mutation FileDelete($fileIds: [ID!]!) {
161
+ fileDelete(fileIds: $fileIds) {
162
+ deletedFileIds
163
+ userErrors {
164
+ field
165
+ message
166
+ }
167
+ }
168
+ }
169
+ `;
170
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * GraphQL queries and mutations for inventory operations
3
+ */
4
+ /**
5
+ * Get inventory levels for product variants across locations
6
+ * Shows available, incoming, committed, reserved, and on-hand quantities
7
+ */
8
+ export declare const GET_INVENTORY_LEVELS = "#graphql\n query GetInventoryLevels($first: Int!, $after: String, $query: String) {\n productVariants(first: $first, after: $after, query: $query) {\n edges {\n node {\n id\n title\n sku\n product {\n id\n title\n }\n inventoryItem {\n id\n tracked\n inventoryLevels(first: 10) {\n edges {\n node {\n id\n quantities(names: [\"available\", \"incoming\", \"committed\", \"reserved\", \"on_hand\"]) {\n name\n quantity\n }\n location {\n id\n name\n }\n }\n }\n }\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
9
+ /**
10
+ * Adjust inventory quantities at a specific location
11
+ * Uses delta-based adjustment (positive to add, negative to subtract)
12
+ */
13
+ export declare const ADJUST_INVENTORY_QUANTITIES = "#graphql\n mutation InventoryAdjustQuantities($input: InventoryAdjustQuantitiesInput!) {\n inventoryAdjustQuantities(input: $input) {\n inventoryAdjustmentGroup {\n reason\n changes {\n name\n delta\n quantityAfterChange\n item {\n id\n }\n location {\n id\n name\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
@@ -0,0 +1,78 @@
1
+ /**
2
+ * GraphQL queries and mutations for inventory operations
3
+ */
4
+ /**
5
+ * Get inventory levels for product variants across locations
6
+ * Shows available, incoming, committed, reserved, and on-hand quantities
7
+ */
8
+ export const GET_INVENTORY_LEVELS = `#graphql
9
+ query GetInventoryLevels($first: Int!, $after: String, $query: String) {
10
+ productVariants(first: $first, after: $after, query: $query) {
11
+ edges {
12
+ node {
13
+ id
14
+ title
15
+ sku
16
+ product {
17
+ id
18
+ title
19
+ }
20
+ inventoryItem {
21
+ id
22
+ tracked
23
+ inventoryLevels(first: 10) {
24
+ edges {
25
+ node {
26
+ id
27
+ quantities(names: ["available", "incoming", "committed", "reserved", "on_hand"]) {
28
+ name
29
+ quantity
30
+ }
31
+ location {
32
+ id
33
+ name
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ cursor
41
+ }
42
+ pageInfo {
43
+ hasNextPage
44
+ endCursor
45
+ }
46
+ }
47
+ }
48
+ `;
49
+ /**
50
+ * Adjust inventory quantities at a specific location
51
+ * Uses delta-based adjustment (positive to add, negative to subtract)
52
+ */
53
+ export const ADJUST_INVENTORY_QUANTITIES = `#graphql
54
+ mutation InventoryAdjustQuantities($input: InventoryAdjustQuantitiesInput!) {
55
+ inventoryAdjustQuantities(input: $input) {
56
+ inventoryAdjustmentGroup {
57
+ reason
58
+ changes {
59
+ name
60
+ delta
61
+ quantityAfterChange
62
+ item {
63
+ id
64
+ }
65
+ location {
66
+ id
67
+ name
68
+ }
69
+ }
70
+ }
71
+ userErrors {
72
+ field
73
+ message
74
+ }
75
+ }
76
+ }
77
+ `;
78
+ //# sourceMappingURL=inventory.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * GraphQL queries and mutations for metafield operations
3
+ */
4
+ /**
5
+ * Get metafields for a specific resource owner
6
+ * Supports filtering by namespace
7
+ */
8
+ export declare const GET_METAFIELDS_BY_OWNER = "#graphql\n query GetMetafieldsByOwner($ownerId: ID!, $first: Int!, $after: String, $namespace: String) {\n node(id: $ownerId) {\n ... on HasMetafields {\n metafields(first: $first, after: $after, namespace: $namespace) {\n edges {\n node {\n id\n namespace\n key\n value\n type\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n }\n";
9
+ /**
10
+ * Set (create or update) metafields on any resource
11
+ * If a metafield with the same namespace/key exists, it will be updated
12
+ */
13
+ export declare const SET_METAFIELDS = "#graphql\n mutation MetafieldsSet($metafields: [MetafieldsSetInput!]!) {\n metafieldsSet(metafields: $metafields) {\n metafields {\n id\n namespace\n key\n value\n type\n }\n userErrors {\n field\n message\n }\n }\n }\n";
14
+ /**
15
+ * Get metafield definitions for a resource type
16
+ * Used for schema discovery
17
+ */
18
+ export declare const GET_METAFIELD_DEFINITIONS = "#graphql\n query GetMetafieldDefinitions($ownerType: MetafieldOwnerType!, $first: Int!, $after: String) {\n metafieldDefinitions(ownerType: $ownerType, first: $first, after: $after) {\n edges {\n node {\n id\n name\n namespace\n key\n type {\n name\n }\n description\n validations {\n name\n value\n }\n pinnedPosition\n ownerType\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
19
+ /**
20
+ * Delete a metafield by ID
21
+ */
22
+ export declare const DELETE_METAFIELD = "#graphql\n mutation MetafieldDelete($input: MetafieldDeleteInput!) {\n metafieldDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n }\n";
@@ -0,0 +1,100 @@
1
+ /**
2
+ * GraphQL queries and mutations for metafield operations
3
+ */
4
+ /**
5
+ * Get metafields for a specific resource owner
6
+ * Supports filtering by namespace
7
+ */
8
+ export const GET_METAFIELDS_BY_OWNER = `#graphql
9
+ query GetMetafieldsByOwner($ownerId: ID!, $first: Int!, $after: String, $namespace: String) {
10
+ node(id: $ownerId) {
11
+ ... on HasMetafields {
12
+ metafields(first: $first, after: $after, namespace: $namespace) {
13
+ edges {
14
+ node {
15
+ id
16
+ namespace
17
+ key
18
+ value
19
+ type
20
+ createdAt
21
+ updatedAt
22
+ }
23
+ }
24
+ pageInfo {
25
+ hasNextPage
26
+ endCursor
27
+ }
28
+ }
29
+ }
30
+ }
31
+ }
32
+ `;
33
+ /**
34
+ * Set (create or update) metafields on any resource
35
+ * If a metafield with the same namespace/key exists, it will be updated
36
+ */
37
+ export const SET_METAFIELDS = `#graphql
38
+ mutation MetafieldsSet($metafields: [MetafieldsSetInput!]!) {
39
+ metafieldsSet(metafields: $metafields) {
40
+ metafields {
41
+ id
42
+ namespace
43
+ key
44
+ value
45
+ type
46
+ }
47
+ userErrors {
48
+ field
49
+ message
50
+ }
51
+ }
52
+ }
53
+ `;
54
+ /**
55
+ * Get metafield definitions for a resource type
56
+ * Used for schema discovery
57
+ */
58
+ export const GET_METAFIELD_DEFINITIONS = `#graphql
59
+ query GetMetafieldDefinitions($ownerType: MetafieldOwnerType!, $first: Int!, $after: String) {
60
+ metafieldDefinitions(ownerType: $ownerType, first: $first, after: $after) {
61
+ edges {
62
+ node {
63
+ id
64
+ name
65
+ namespace
66
+ key
67
+ type {
68
+ name
69
+ }
70
+ description
71
+ validations {
72
+ name
73
+ value
74
+ }
75
+ pinnedPosition
76
+ ownerType
77
+ }
78
+ }
79
+ pageInfo {
80
+ hasNextPage
81
+ endCursor
82
+ }
83
+ }
84
+ }
85
+ `;
86
+ /**
87
+ * Delete a metafield by ID
88
+ */
89
+ export const DELETE_METAFIELD = `#graphql
90
+ mutation MetafieldDelete($input: MetafieldDeleteInput!) {
91
+ metafieldDelete(input: $input) {
92
+ deletedId
93
+ userErrors {
94
+ field
95
+ message
96
+ }
97
+ }
98
+ }
99
+ `;
100
+ //# sourceMappingURL=metafields.js.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * GraphQL queries and mutations for metaobject operations
3
+ * Used by upsert_metaobject and schema_discover smart tools
4
+ */
5
+ /**
6
+ * List all metaobject definitions (schema discovery)
7
+ */
8
+ export declare const GET_METAOBJECT_DEFINITIONS = "#graphql\n query GetMetaobjectDefinitions($first: Int!, $after: String) {\n metaobjectDefinitions(first: $first, after: $after) {\n edges {\n node {\n id\n type\n name\n displayNameKey\n description\n fieldDefinitions {\n key\n name\n description\n type {\n name\n }\n required\n validations {\n name\n value\n }\n }\n capabilities {\n publishable {\n enabled\n }\n translatable {\n enabled\n }\n renderable {\n enabled\n }\n }\n access {\n admin\n storefront\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
9
+ /**
10
+ * Get a single metaobject definition by type
11
+ */
12
+ export declare const GET_METAOBJECT_DEFINITION_BY_TYPE = "#graphql\n query GetMetaobjectDefinitionByType($type: String!) {\n metaobjectDefinitionByType(type: $type) {\n id\n type\n name\n displayNameKey\n description\n fieldDefinitions {\n key\n name\n description\n type {\n name\n }\n required\n }\n capabilities {\n publishable {\n enabled\n }\n }\n }\n }\n";
13
+ /**
14
+ * List metaobjects by type
15
+ */
16
+ export declare const GET_METAOBJECTS = "#graphql\n query GetMetaobjects($type: String!, $first: Int!, $after: String) {\n metaobjects(type: $type, first: $first, after: $after) {\n edges {\n node {\n id\n handle\n type\n displayName\n fields {\n key\n value\n type\n }\n capabilities {\n publishable {\n status\n }\n }\n createdAt\n updatedAt\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
17
+ /**
18
+ * Get a single metaobject by ID
19
+ */
20
+ export declare const GET_METAOBJECT = "#graphql\n query GetMetaobject($id: ID!) {\n metaobject(id: $id) {\n id\n handle\n type\n displayName\n fields {\n key\n value\n type\n }\n capabilities {\n publishable {\n status\n }\n }\n createdAt\n updatedAt\n }\n }\n";
21
+ /**
22
+ * Get a metaobject by handle (for upsert check)
23
+ */
24
+ export declare const GET_METAOBJECT_BY_HANDLE = "#graphql\n query GetMetaobjectByHandle($handle: MetaobjectHandleInput!) {\n metaobjectByHandle(handle: $handle) {\n id\n handle\n type\n displayName\n fields {\n key\n value\n type\n }\n capabilities {\n publishable {\n status\n }\n }\n }\n }\n";
25
+ /**
26
+ * Create a new metaobject
27
+ */
28
+ export declare const METAOBJECT_CREATE = "#graphql\n mutation MetaobjectCreate($metaobject: MetaobjectCreateInput!) {\n metaobjectCreate(metaobject: $metaobject) {\n metaobject {\n id\n handle\n type\n displayName\n fields {\n key\n value\n type\n }\n capabilities {\n publishable {\n status\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\n";
29
+ /**
30
+ * Update an existing metaobject
31
+ */
32
+ export declare const METAOBJECT_UPDATE = "#graphql\n mutation MetaobjectUpdate($id: ID!, $metaobject: MetaobjectUpdateInput!) {\n metaobjectUpdate(id: $id, metaobject: $metaobject) {\n metaobject {\n id\n handle\n type\n displayName\n fields {\n key\n value\n type\n }\n capabilities {\n publishable {\n status\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\n";
33
+ /**
34
+ * Delete a metaobject
35
+ */
36
+ export declare const METAOBJECT_DELETE = "#graphql\n mutation MetaobjectDelete($id: ID!) {\n metaobjectDelete(id: $id) {\n deletedId\n userErrors {\n field\n message\n code\n }\n }\n }\n";
@@ -0,0 +1,239 @@
1
+ /**
2
+ * GraphQL queries and mutations for metaobject operations
3
+ * Used by upsert_metaobject and schema_discover smart tools
4
+ */
5
+ /**
6
+ * List all metaobject definitions (schema discovery)
7
+ */
8
+ export const GET_METAOBJECT_DEFINITIONS = `#graphql
9
+ query GetMetaobjectDefinitions($first: Int!, $after: String) {
10
+ metaobjectDefinitions(first: $first, after: $after) {
11
+ edges {
12
+ node {
13
+ id
14
+ type
15
+ name
16
+ displayNameKey
17
+ description
18
+ fieldDefinitions {
19
+ key
20
+ name
21
+ description
22
+ type {
23
+ name
24
+ }
25
+ required
26
+ validations {
27
+ name
28
+ value
29
+ }
30
+ }
31
+ capabilities {
32
+ publishable {
33
+ enabled
34
+ }
35
+ translatable {
36
+ enabled
37
+ }
38
+ renderable {
39
+ enabled
40
+ }
41
+ }
42
+ access {
43
+ admin
44
+ storefront
45
+ }
46
+ }
47
+ }
48
+ pageInfo {
49
+ hasNextPage
50
+ endCursor
51
+ }
52
+ }
53
+ }
54
+ `;
55
+ /**
56
+ * Get a single metaobject definition by type
57
+ */
58
+ export const GET_METAOBJECT_DEFINITION_BY_TYPE = `#graphql
59
+ query GetMetaobjectDefinitionByType($type: String!) {
60
+ metaobjectDefinitionByType(type: $type) {
61
+ id
62
+ type
63
+ name
64
+ displayNameKey
65
+ description
66
+ fieldDefinitions {
67
+ key
68
+ name
69
+ description
70
+ type {
71
+ name
72
+ }
73
+ required
74
+ }
75
+ capabilities {
76
+ publishable {
77
+ enabled
78
+ }
79
+ }
80
+ }
81
+ }
82
+ `;
83
+ /**
84
+ * List metaobjects by type
85
+ */
86
+ export const GET_METAOBJECTS = `#graphql
87
+ query GetMetaobjects($type: String!, $first: Int!, $after: String) {
88
+ metaobjects(type: $type, first: $first, after: $after) {
89
+ edges {
90
+ node {
91
+ id
92
+ handle
93
+ type
94
+ displayName
95
+ fields {
96
+ key
97
+ value
98
+ type
99
+ }
100
+ capabilities {
101
+ publishable {
102
+ status
103
+ }
104
+ }
105
+ createdAt
106
+ updatedAt
107
+ }
108
+ }
109
+ pageInfo {
110
+ hasNextPage
111
+ endCursor
112
+ }
113
+ }
114
+ }
115
+ `;
116
+ /**
117
+ * Get a single metaobject by ID
118
+ */
119
+ export const GET_METAOBJECT = `#graphql
120
+ query GetMetaobject($id: ID!) {
121
+ metaobject(id: $id) {
122
+ id
123
+ handle
124
+ type
125
+ displayName
126
+ fields {
127
+ key
128
+ value
129
+ type
130
+ }
131
+ capabilities {
132
+ publishable {
133
+ status
134
+ }
135
+ }
136
+ createdAt
137
+ updatedAt
138
+ }
139
+ }
140
+ `;
141
+ /**
142
+ * Get a metaobject by handle (for upsert check)
143
+ */
144
+ export const GET_METAOBJECT_BY_HANDLE = `#graphql
145
+ query GetMetaobjectByHandle($handle: MetaobjectHandleInput!) {
146
+ metaobjectByHandle(handle: $handle) {
147
+ id
148
+ handle
149
+ type
150
+ displayName
151
+ fields {
152
+ key
153
+ value
154
+ type
155
+ }
156
+ capabilities {
157
+ publishable {
158
+ status
159
+ }
160
+ }
161
+ }
162
+ }
163
+ `;
164
+ /**
165
+ * Create a new metaobject
166
+ */
167
+ export const METAOBJECT_CREATE = `#graphql
168
+ mutation MetaobjectCreate($metaobject: MetaobjectCreateInput!) {
169
+ metaobjectCreate(metaobject: $metaobject) {
170
+ metaobject {
171
+ id
172
+ handle
173
+ type
174
+ displayName
175
+ fields {
176
+ key
177
+ value
178
+ type
179
+ }
180
+ capabilities {
181
+ publishable {
182
+ status
183
+ }
184
+ }
185
+ }
186
+ userErrors {
187
+ field
188
+ message
189
+ code
190
+ }
191
+ }
192
+ }
193
+ `;
194
+ /**
195
+ * Update an existing metaobject
196
+ */
197
+ export const METAOBJECT_UPDATE = `#graphql
198
+ mutation MetaobjectUpdate($id: ID!, $metaobject: MetaobjectUpdateInput!) {
199
+ metaobjectUpdate(id: $id, metaobject: $metaobject) {
200
+ metaobject {
201
+ id
202
+ handle
203
+ type
204
+ displayName
205
+ fields {
206
+ key
207
+ value
208
+ type
209
+ }
210
+ capabilities {
211
+ publishable {
212
+ status
213
+ }
214
+ }
215
+ }
216
+ userErrors {
217
+ field
218
+ message
219
+ code
220
+ }
221
+ }
222
+ }
223
+ `;
224
+ /**
225
+ * Delete a metaobject
226
+ */
227
+ export const METAOBJECT_DELETE = `#graphql
228
+ mutation MetaobjectDelete($id: ID!) {
229
+ metaobjectDelete(id: $id) {
230
+ deletedId
231
+ userErrors {
232
+ field
233
+ message
234
+ code
235
+ }
236
+ }
237
+ }
238
+ `;
239
+ //# sourceMappingURL=metaobjects.js.map