n8n-nodes-shopify-custom 2.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 (139) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +68 -0
  3. package/dist/credentials/ShopifyCustomAdminApi.credentials.d.ts +10 -0
  4. package/dist/credentials/ShopifyCustomAdminApi.credentials.js +65 -0
  5. package/dist/credentials/ShopifyCustomAdminApi.credentials.js.map +1 -0
  6. package/dist/icons/shopify.dark.svg +12 -0
  7. package/dist/icons/shopify.svg +12 -0
  8. package/dist/nodes/ShopifyCustom/ShopifyCustom.node.d.ts +15 -0
  9. package/dist/nodes/ShopifyCustom/ShopifyCustom.node.js +358 -0
  10. package/dist/nodes/ShopifyCustom/ShopifyCustom.node.js.map +1 -0
  11. package/dist/nodes/ShopifyCustom/ShopifyCustom.node.json +18 -0
  12. package/dist/nodes/ShopifyCustom/config/operations/collection.d.ts +2 -0
  13. package/dist/nodes/ShopifyCustom/config/operations/collection.js +306 -0
  14. package/dist/nodes/ShopifyCustom/config/operations/collection.js.map +1 -0
  15. package/dist/nodes/ShopifyCustom/config/operations/common.d.ts +13 -0
  16. package/dist/nodes/ShopifyCustom/config/operations/common.js +222 -0
  17. package/dist/nodes/ShopifyCustom/config/operations/common.js.map +1 -0
  18. package/dist/nodes/ShopifyCustom/config/operations/customer.d.ts +2 -0
  19. package/dist/nodes/ShopifyCustom/config/operations/customer.js +107 -0
  20. package/dist/nodes/ShopifyCustom/config/operations/customer.js.map +1 -0
  21. package/dist/nodes/ShopifyCustom/config/operations/draftOrder.d.ts +2 -0
  22. package/dist/nodes/ShopifyCustom/config/operations/draftOrder.js +118 -0
  23. package/dist/nodes/ShopifyCustom/config/operations/draftOrder.js.map +1 -0
  24. package/dist/nodes/ShopifyCustom/config/operations/index.d.ts +7 -0
  25. package/dist/nodes/ShopifyCustom/config/operations/index.js +48 -0
  26. package/dist/nodes/ShopifyCustom/config/operations/index.js.map +1 -0
  27. package/dist/nodes/ShopifyCustom/config/operations/metafieldDefinition.d.ts +2 -0
  28. package/dist/nodes/ShopifyCustom/config/operations/metafieldDefinition.js +192 -0
  29. package/dist/nodes/ShopifyCustom/config/operations/metafieldDefinition.js.map +1 -0
  30. package/dist/nodes/ShopifyCustom/config/operations/metafieldValue.d.ts +2 -0
  31. package/dist/nodes/ShopifyCustom/config/operations/metafieldValue.js +125 -0
  32. package/dist/nodes/ShopifyCustom/config/operations/metafieldValue.js.map +1 -0
  33. package/dist/nodes/ShopifyCustom/config/operations/metaobject.d.ts +2 -0
  34. package/dist/nodes/ShopifyCustom/config/operations/metaobject.js +198 -0
  35. package/dist/nodes/ShopifyCustom/config/operations/metaobject.js.map +1 -0
  36. package/dist/nodes/ShopifyCustom/config/operations/order.d.ts +2 -0
  37. package/dist/nodes/ShopifyCustom/config/operations/order.js +111 -0
  38. package/dist/nodes/ShopifyCustom/config/operations/order.js.map +1 -0
  39. package/dist/nodes/ShopifyCustom/config/operations/product.d.ts +2 -0
  40. package/dist/nodes/ShopifyCustom/config/operations/product.js +118 -0
  41. package/dist/nodes/ShopifyCustom/config/operations/product.js.map +1 -0
  42. package/dist/nodes/ShopifyCustom/config/operations/productVariant.d.ts +2 -0
  43. package/dist/nodes/ShopifyCustom/config/operations/productVariant.js +109 -0
  44. package/dist/nodes/ShopifyCustom/config/operations/productVariant.js.map +1 -0
  45. package/dist/nodes/ShopifyCustom/config/operations/service.d.ts +2 -0
  46. package/dist/nodes/ShopifyCustom/config/operations/service.js +14 -0
  47. package/dist/nodes/ShopifyCustom/config/operations/service.js.map +1 -0
  48. package/dist/nodes/ShopifyCustom/config/operations/types.d.ts +13 -0
  49. package/dist/nodes/ShopifyCustom/config/operations/types.js +3 -0
  50. package/dist/nodes/ShopifyCustom/config/operations/types.js.map +1 -0
  51. package/dist/nodes/ShopifyCustom/config/resources.d.ts +9 -0
  52. package/dist/nodes/ShopifyCustom/config/resources.js +62 -0
  53. package/dist/nodes/ShopifyCustom/config/resources.js.map +1 -0
  54. package/dist/nodes/ShopifyCustom/shared/collections/ruleConditions.d.ts +17 -0
  55. package/dist/nodes/ShopifyCustom/shared/collections/ruleConditions.js +281 -0
  56. package/dist/nodes/ShopifyCustom/shared/collections/ruleConditions.js.map +1 -0
  57. package/dist/nodes/ShopifyCustom/shared/errors.d.ts +8 -0
  58. package/dist/nodes/ShopifyCustom/shared/errors.js +37 -0
  59. package/dist/nodes/ShopifyCustom/shared/errors.js.map +1 -0
  60. package/dist/nodes/ShopifyCustom/shared/graphql/client.d.ts +26 -0
  61. package/dist/nodes/ShopifyCustom/shared/graphql/client.js +73 -0
  62. package/dist/nodes/ShopifyCustom/shared/graphql/client.js.map +1 -0
  63. package/dist/nodes/ShopifyCustom/shared/graphql/registry.d.ts +17 -0
  64. package/dist/nodes/ShopifyCustom/shared/graphql/registry.js +962 -0
  65. package/dist/nodes/ShopifyCustom/shared/graphql/registry.js.map +1 -0
  66. package/dist/nodes/ShopifyCustom/shared/graphql/templates/collection.d.ts +5 -0
  67. package/dist/nodes/ShopifyCustom/shared/graphql/templates/collection.js +99 -0
  68. package/dist/nodes/ShopifyCustom/shared/graphql/templates/collection.js.map +1 -0
  69. package/dist/nodes/ShopifyCustom/shared/graphql/templates/commonFragments.d.ts +7 -0
  70. package/dist/nodes/ShopifyCustom/shared/graphql/templates/commonFragments.js +69 -0
  71. package/dist/nodes/ShopifyCustom/shared/graphql/templates/commonFragments.js.map +1 -0
  72. package/dist/nodes/ShopifyCustom/shared/graphql/templates/customer.d.ts +5 -0
  73. package/dist/nodes/ShopifyCustom/shared/graphql/templates/customer.js +94 -0
  74. package/dist/nodes/ShopifyCustom/shared/graphql/templates/customer.js.map +1 -0
  75. package/dist/nodes/ShopifyCustom/shared/graphql/templates/draftOrder.d.ts +5 -0
  76. package/dist/nodes/ShopifyCustom/shared/graphql/templates/draftOrder.js +91 -0
  77. package/dist/nodes/ShopifyCustom/shared/graphql/templates/draftOrder.js.map +1 -0
  78. package/dist/nodes/ShopifyCustom/shared/graphql/templates/metafields.d.ts +10 -0
  79. package/dist/nodes/ShopifyCustom/shared/graphql/templates/metafields.js +223 -0
  80. package/dist/nodes/ShopifyCustom/shared/graphql/templates/metafields.js.map +1 -0
  81. package/dist/nodes/ShopifyCustom/shared/graphql/templates/metaobject.d.ts +5 -0
  82. package/dist/nodes/ShopifyCustom/shared/graphql/templates/metaobject.js +92 -0
  83. package/dist/nodes/ShopifyCustom/shared/graphql/templates/metaobject.js.map +1 -0
  84. package/dist/nodes/ShopifyCustom/shared/graphql/templates/order.d.ts +5 -0
  85. package/dist/nodes/ShopifyCustom/shared/graphql/templates/order.js +95 -0
  86. package/dist/nodes/ShopifyCustom/shared/graphql/templates/order.js.map +1 -0
  87. package/dist/nodes/ShopifyCustom/shared/graphql/templates/product.d.ts +5 -0
  88. package/dist/nodes/ShopifyCustom/shared/graphql/templates/product.js +107 -0
  89. package/dist/nodes/ShopifyCustom/shared/graphql/templates/product.js.map +1 -0
  90. package/dist/nodes/ShopifyCustom/shared/graphql/templates/productVariant.d.ts +5 -0
  91. package/dist/nodes/ShopifyCustom/shared/graphql/templates/productVariant.js +99 -0
  92. package/dist/nodes/ShopifyCustom/shared/graphql/templates/productVariant.js.map +1 -0
  93. package/dist/nodes/ShopifyCustom/shared/metafields/definitions.d.ts +24 -0
  94. package/dist/nodes/ShopifyCustom/shared/metafields/definitions.js +65 -0
  95. package/dist/nodes/ShopifyCustom/shared/metafields/definitions.js.map +1 -0
  96. package/dist/nodes/ShopifyCustom/shared/metafields/ownerTypeMap.d.ts +3 -0
  97. package/dist/nodes/ShopifyCustom/shared/metafields/ownerTypeMap.js +19 -0
  98. package/dist/nodes/ShopifyCustom/shared/metafields/ownerTypeMap.js.map +1 -0
  99. package/dist/nodes/ShopifyCustom/shared/metafields/referenceLoaders.d.ts +2 -0
  100. package/dist/nodes/ShopifyCustom/shared/metafields/referenceLoaders.js +122 -0
  101. package/dist/nodes/ShopifyCustom/shared/metafields/referenceLoaders.js.map +1 -0
  102. package/dist/nodes/ShopifyCustom/shared/metafields/types.d.ts +17 -0
  103. package/dist/nodes/ShopifyCustom/shared/metafields/types.js +57 -0
  104. package/dist/nodes/ShopifyCustom/shared/metafields/types.js.map +1 -0
  105. package/dist/nodes/ShopifyCustom/shared/metafields/uiFactory.d.ts +2 -0
  106. package/dist/nodes/ShopifyCustom/shared/metafields/uiFactory.js +395 -0
  107. package/dist/nodes/ShopifyCustom/shared/metafields/uiFactory.js.map +1 -0
  108. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/constants.d.ts +20 -0
  109. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/constants.js +61 -0
  110. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/constants.js.map +1 -0
  111. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/index.d.ts +3 -0
  112. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/index.js +43 -0
  113. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/index.js.map +1 -0
  114. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/list.d.ts +2 -0
  115. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/list.js +103 -0
  116. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/list.js.map +1 -0
  117. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/reference.d.ts +2 -0
  118. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/reference.js +80 -0
  119. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/reference.js.map +1 -0
  120. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/scalar.d.ts +2 -0
  121. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/scalar.js +110 -0
  122. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/scalar.js.map +1 -0
  123. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/structured.d.ts +2 -0
  124. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/structured.js +64 -0
  125. package/dist/nodes/ShopifyCustom/shared/metafields/valueAdapters/structured.js.map +1 -0
  126. package/dist/nodes/ShopifyCustom/shared/metafields/valuePayload.d.ts +3 -0
  127. package/dist/nodes/ShopifyCustom/shared/metafields/valuePayload.js +89 -0
  128. package/dist/nodes/ShopifyCustom/shared/metafields/valuePayload.js.map +1 -0
  129. package/dist/nodes/ShopifyCustom/shared/output/outputMapper.d.ts +3 -0
  130. package/dist/nodes/ShopifyCustom/shared/output/outputMapper.js +82 -0
  131. package/dist/nodes/ShopifyCustom/shared/output/outputMapper.js.map +1 -0
  132. package/dist/nodes/ShopifyCustom/shared/themes/templateSuffixes.d.ts +2 -0
  133. package/dist/nodes/ShopifyCustom/shared/themes/templateSuffixes.js +83 -0
  134. package/dist/nodes/ShopifyCustom/shared/themes/templateSuffixes.js.map +1 -0
  135. package/dist/nodes/ShopifyCustom/shopify.dark.svg +12 -0
  136. package/dist/nodes/ShopifyCustom/shopify.svg +12 -0
  137. package/dist/package.json +62 -0
  138. package/dist/tsconfig.tsbuildinfo +1 -0
  139. package/package.json +62 -0
@@ -0,0 +1,306 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COLLECTION_OPERATION_CONFIGS = void 0;
4
+ const common_1 = require("./common");
5
+ const COLLECTION_SORT_OPTIONS = [
6
+ { name: 'ID', value: 'ID' },
7
+ { name: 'Title', value: 'TITLE' },
8
+ { name: 'Updated At', value: 'UPDATED_AT' },
9
+ { name: 'Products Count', value: 'PRODUCTS_COUNT' },
10
+ ];
11
+ const COLLECTION_TYPE_OPTIONS = [
12
+ { name: 'Manual Collection', value: 'manual' },
13
+ { name: 'Smart Collection', value: 'smart' },
14
+ ];
15
+ const SMART_RULE_MATCH_OPTIONS = [
16
+ { name: 'All Rules (AND)', value: 'all' },
17
+ { name: 'Any Rule (OR)', value: 'any' },
18
+ ];
19
+ function escapeRegex(value) {
20
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
21
+ }
22
+ function metafieldRuleValueTypeDisplay(valueType) {
23
+ return {
24
+ show: {
25
+ ruleSource: ['metafield'],
26
+ metafieldRule: [
27
+ {
28
+ _cnd: {
29
+ regex: `"valueType":"${escapeRegex(valueType)}"`,
30
+ },
31
+ },
32
+ ],
33
+ },
34
+ };
35
+ }
36
+ function collectionBaseFields() {
37
+ return [
38
+ {
39
+ displayName: 'Title',
40
+ name: 'title',
41
+ type: 'string',
42
+ default: '',
43
+ required: true,
44
+ },
45
+ {
46
+ displayName: 'Handle',
47
+ name: 'handle',
48
+ type: 'string',
49
+ default: '',
50
+ },
51
+ {
52
+ displayName: 'Description HTML',
53
+ name: 'descriptionHtml',
54
+ type: 'string',
55
+ typeOptions: {
56
+ rows: 4,
57
+ },
58
+ default: '',
59
+ },
60
+ ...(0, common_1.seoFields)(),
61
+ (0, common_1.templateSuffixTextField)('collection'),
62
+ ];
63
+ }
64
+ function collectionCreateFields() {
65
+ return [
66
+ ...collectionBaseFields(),
67
+ {
68
+ displayName: 'Collection Type',
69
+ name: 'collectionType',
70
+ type: 'options',
71
+ options: COLLECTION_TYPE_OPTIONS,
72
+ default: 'manual',
73
+ },
74
+ {
75
+ displayName: 'Products',
76
+ name: 'manualProducts',
77
+ type: 'fixedCollection',
78
+ typeOptions: {
79
+ multipleValues: true,
80
+ },
81
+ description: 'Select products for a manual collection',
82
+ default: {},
83
+ options: [
84
+ {
85
+ name: 'items',
86
+ displayName: 'Product',
87
+ values: [
88
+ {
89
+ displayName: 'Product ID',
90
+ name: 'productId',
91
+ type: 'string',
92
+ default: '',
93
+ placeholder: 'gid://shopify/Product/...',
94
+ description: 'Global product ID in Shopify',
95
+ },
96
+ ],
97
+ },
98
+ ],
99
+ displayOptions: {
100
+ show: {
101
+ collectionType: ['manual'],
102
+ },
103
+ },
104
+ },
105
+ {
106
+ displayName: 'Rule Match Mode',
107
+ name: 'smartRuleMatchMode',
108
+ type: 'options',
109
+ options: SMART_RULE_MATCH_OPTIONS,
110
+ default: 'all',
111
+ displayOptions: {
112
+ show: {
113
+ collectionType: ['smart'],
114
+ },
115
+ },
116
+ },
117
+ {
118
+ displayName: 'Rules',
119
+ name: 'collectionRules',
120
+ type: 'fixedCollection',
121
+ typeOptions: {
122
+ multipleValues: true,
123
+ },
124
+ default: {},
125
+ options: [
126
+ {
127
+ name: 'items',
128
+ displayName: 'Rule',
129
+ values: [
130
+ {
131
+ displayName: 'Rule Source',
132
+ name: 'ruleSource',
133
+ type: 'options',
134
+ options: [
135
+ { name: 'Native Field', value: 'native' },
136
+ { name: 'Metafield', value: 'metafield' },
137
+ ],
138
+ default: 'native',
139
+ required: true,
140
+ },
141
+ {
142
+ displayName: 'Native Rule Type Name or ID',
143
+ name: 'nativeRuleType',
144
+ type: 'options',
145
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
146
+ typeOptions: {
147
+ loadOptionsMethod: 'getCollectionNativeRuleTypeOptions',
148
+ loadOptionsDependsOn: ['resource', 'ruleSource'],
149
+ },
150
+ default: '',
151
+ options: [],
152
+ required: true,
153
+ displayOptions: {
154
+ show: {
155
+ ruleSource: ['native'],
156
+ },
157
+ },
158
+ },
159
+ {
160
+ displayName: 'Metafield Name or ID',
161
+ name: 'metafieldRule',
162
+ type: 'options',
163
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
164
+ typeOptions: {
165
+ loadOptionsMethod: 'getCollectionMetafieldRuleOptions',
166
+ loadOptionsDependsOn: ['resource', 'ruleSource'],
167
+ },
168
+ default: '',
169
+ options: [],
170
+ required: true,
171
+ displayOptions: {
172
+ show: {
173
+ ruleSource: ['metafield'],
174
+ },
175
+ },
176
+ },
177
+ {
178
+ displayName: 'Condition Name or ID',
179
+ name: 'nativeRelation',
180
+ type: 'options',
181
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
182
+ typeOptions: {
183
+ loadOptionsMethod: 'getCollectionRuleRelationOptions',
184
+ loadOptionsDependsOn: ['resource', 'ruleSource', 'nativeRuleType'],
185
+ },
186
+ default: '',
187
+ options: [],
188
+ required: true,
189
+ displayOptions: {
190
+ show: {
191
+ ruleSource: ['native'],
192
+ },
193
+ },
194
+ },
195
+ {
196
+ displayName: 'Value',
197
+ name: 'nativeValue',
198
+ type: 'string',
199
+ default: '',
200
+ required: true,
201
+ description: 'Rule value to match',
202
+ displayOptions: {
203
+ show: {
204
+ ruleSource: ['native'],
205
+ },
206
+ },
207
+ },
208
+ {
209
+ displayName: 'Value',
210
+ name: 'metafieldValueText',
211
+ type: 'string',
212
+ default: '',
213
+ required: true,
214
+ description: 'Text value for the selected metafield condition',
215
+ displayOptions: metafieldRuleValueTypeDisplay('text'),
216
+ },
217
+ {
218
+ displayName: 'Value',
219
+ name: 'metafieldValueNumber',
220
+ type: 'number',
221
+ default: 0,
222
+ required: true,
223
+ description: 'Numeric value for the selected metafield condition',
224
+ displayOptions: metafieldRuleValueTypeDisplay('number'),
225
+ },
226
+ {
227
+ displayName: 'Value',
228
+ name: 'metafieldValueBoolean',
229
+ type: 'boolean',
230
+ default: false,
231
+ required: true,
232
+ description: 'Whether the selected metafield condition should be true or false',
233
+ displayOptions: metafieldRuleValueTypeDisplay('boolean'),
234
+ },
235
+ {
236
+ displayName: 'Value',
237
+ name: 'metafieldValueMetaobjectId',
238
+ type: 'string',
239
+ default: '',
240
+ required: true,
241
+ placeholder: 'gid://shopify/Metaobject/1234567890',
242
+ description: 'Metaobject record GID value',
243
+ displayOptions: metafieldRuleValueTypeDisplay('metaobject_reference'),
244
+ },
245
+ ],
246
+ },
247
+ ],
248
+ displayOptions: {
249
+ show: {
250
+ collectionType: ['smart'],
251
+ },
252
+ },
253
+ },
254
+ ];
255
+ }
256
+ exports.COLLECTION_OPERATION_CONFIGS = [
257
+ {
258
+ resource: 'collection',
259
+ value: 'create',
260
+ name: 'Create',
261
+ description: 'Create a collection',
262
+ registryKey: 'collection.create',
263
+ fields: collectionCreateFields(),
264
+ supportsMetafields: true,
265
+ },
266
+ {
267
+ resource: 'collection',
268
+ value: 'get',
269
+ name: 'Get',
270
+ description: 'Get a collection by ID',
271
+ registryKey: 'collection.get',
272
+ fields: [
273
+ (0, common_1.gidField)('collectionId', 'Collection ID', 'Global collection ID in Shopify'),
274
+ ...(0, common_1.readMetafieldsFields)(),
275
+ ],
276
+ },
277
+ {
278
+ resource: 'collection',
279
+ value: 'getMany',
280
+ name: 'Get Many',
281
+ description: 'Get many collections',
282
+ registryKey: 'collection.getMany',
283
+ fields: (0, common_1.paginationFields)(COLLECTION_SORT_OPTIONS),
284
+ },
285
+ {
286
+ resource: 'collection',
287
+ value: 'update',
288
+ name: 'Update',
289
+ description: 'Update a collection',
290
+ registryKey: 'collection.update',
291
+ fields: [
292
+ (0, common_1.gidField)('collectionId', 'Collection ID', 'Global collection ID in Shopify'),
293
+ ...collectionBaseFields().map((field) => ({ ...field, required: false })),
294
+ ],
295
+ supportsMetafields: true,
296
+ },
297
+ {
298
+ resource: 'collection',
299
+ value: 'delete',
300
+ name: 'Delete',
301
+ description: 'Delete a collection',
302
+ registryKey: 'collection.delete',
303
+ fields: [(0, common_1.gidField)('collectionId', 'Collection ID', 'Global collection ID in Shopify')],
304
+ },
305
+ ];
306
+ //# sourceMappingURL=collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../../../nodes/ShopifyCustom/config/operations/collection.ts"],"names":[],"mappings":";;;AAGA,qCAMkB;AAGlB,MAAM,uBAAuB,GAAG;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;IAC3B,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IACjC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IAC3C,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE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AAC;SACzE;QACD,kBAAkB,EAAE,IAAI;KACxB;IACD;QACC,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,qBAAqB;QAClC,WAAW,EAAE,mBAAmB;QAChC,MAAM,EAAE,CAAC,IAAA,iBAAQ,EAAC,cAAc,EAAE,eAAe,EAAE,iCAAiC,CAAC,CAAC;KACtF;CACD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ import type { ShopifyResourceValue } from '../resources';
3
+ import type { ShopifyOperationValue } from './types';
4
+ export declare function operationDisplayOptions(resource: ShopifyResourceValue, operation: ShopifyOperationValue): INodeProperties['displayOptions'];
5
+ export declare function gidField(name: string, displayName: string, description: string, required?: boolean): INodeProperties;
6
+ export declare function paginationFields(sortOptions: Array<{
7
+ name: string;
8
+ value: string;
9
+ }>): INodeProperties[];
10
+ export declare function readMetafieldsFields(): INodeProperties[];
11
+ export declare function seoFields(): INodeProperties[];
12
+ export declare function templateSuffixTextField(templateName: 'product' | 'collection'): INodeProperties;
13
+ export declare const TAGS_FIELD: INodeProperties;
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TAGS_FIELD = void 0;
4
+ exports.operationDisplayOptions = operationDisplayOptions;
5
+ exports.gidField = gidField;
6
+ exports.paginationFields = paginationFields;
7
+ exports.readMetafieldsFields = readMetafieldsFields;
8
+ exports.seoFields = seoFields;
9
+ exports.templateSuffixTextField = templateSuffixTextField;
10
+ function operationDisplayOptions(resource, operation) {
11
+ return {
12
+ show: {
13
+ resource: [resource],
14
+ operation: [operation],
15
+ },
16
+ };
17
+ }
18
+ function gidField(name, displayName, description, required = true) {
19
+ return {
20
+ displayName,
21
+ name,
22
+ type: 'string',
23
+ default: '',
24
+ required,
25
+ description,
26
+ placeholder: 'gid://shopify/...',
27
+ };
28
+ }
29
+ function paginationFields(sortOptions) {
30
+ return [
31
+ {
32
+ displayName: 'Get All',
33
+ name: 'getAll',
34
+ type: 'boolean',
35
+ default: true,
36
+ description: 'Whether to fetch all pages',
37
+ },
38
+ {
39
+ displayName: 'Limit',
40
+ name: 'limit',
41
+ type: 'number',
42
+ description: 'Max number of results to return',
43
+ default: 50,
44
+ typeOptions: {
45
+ minValue: 1,
46
+ maxValue: 250,
47
+ },
48
+ displayOptions: {
49
+ show: {
50
+ getAll: [false],
51
+ },
52
+ },
53
+ },
54
+ {
55
+ displayName: 'Options',
56
+ name: 'paginationOptions',
57
+ type: 'collection',
58
+ placeholder: 'Add option',
59
+ default: {},
60
+ options: [
61
+ {
62
+ displayName: 'Cursor',
63
+ name: 'afterCursor',
64
+ type: 'string',
65
+ default: '',
66
+ description: 'Use to continue from a specific cursor',
67
+ },
68
+ {
69
+ displayName: 'Metafields',
70
+ name: 'metafields',
71
+ type: 'collection',
72
+ placeholder: 'Add metafields options',
73
+ default: {},
74
+ options: [
75
+ {
76
+ displayName: 'Include Metafields',
77
+ name: 'includeMetafields',
78
+ type: 'boolean',
79
+ default: false,
80
+ description: 'Whether to also fetch metafields and their values',
81
+ },
82
+ {
83
+ displayName: 'Metafield Definition Names or IDs',
84
+ name: 'selectedMetafields',
85
+ type: 'multiOptions',
86
+ description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
87
+ typeOptions: {
88
+ loadOptionsMethod: 'getMetafieldDefinitionsForCurrentContext',
89
+ loadOptionsDependsOn: ['resource', 'ownerType'],
90
+ },
91
+ default: [],
92
+ displayOptions: {
93
+ show: {
94
+ includeMetafields: [true],
95
+ },
96
+ },
97
+ },
98
+ {
99
+ displayName: 'Resolve Metafield References',
100
+ name: 'resolveMetafieldReferences',
101
+ type: 'boolean',
102
+ default: false,
103
+ description: 'Whether to resolve references for reference metafield types',
104
+ displayOptions: {
105
+ show: {
106
+ includeMetafields: [true],
107
+ },
108
+ },
109
+ },
110
+ ],
111
+ },
112
+ {
113
+ displayName: 'Search Query',
114
+ name: 'query',
115
+ type: 'string',
116
+ default: '',
117
+ description: 'Shopify search syntax query',
118
+ },
119
+ {
120
+ displayName: 'Sorting',
121
+ name: 'sorting',
122
+ type: 'collection',
123
+ placeholder: 'Add sorting options',
124
+ default: {},
125
+ options: [
126
+ {
127
+ displayName: 'Reverse',
128
+ name: 'reverse',
129
+ type: 'boolean',
130
+ default: false,
131
+ },
132
+ {
133
+ displayName: 'Sort By',
134
+ name: 'sortKey',
135
+ type: 'options',
136
+ options: sortOptions,
137
+ default: 'ID',
138
+ },
139
+ ],
140
+ },
141
+ ],
142
+ },
143
+ ];
144
+ }
145
+ function readMetafieldsFields() {
146
+ return [
147
+ {
148
+ displayName: 'Include Metafields',
149
+ name: 'includeMetafields',
150
+ type: 'boolean',
151
+ default: false,
152
+ description: 'Whether to also fetch metafields and their values',
153
+ },
154
+ {
155
+ displayName: 'Metafield Definition Names or IDs',
156
+ name: 'selectedMetafields',
157
+ type: 'multiOptions',
158
+ description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
159
+ typeOptions: {
160
+ loadOptionsMethod: 'getMetafieldDefinitionsForCurrentContext',
161
+ loadOptionsDependsOn: ['resource', 'ownerType'],
162
+ },
163
+ default: [],
164
+ displayOptions: {
165
+ show: {
166
+ includeMetafields: [true],
167
+ },
168
+ },
169
+ },
170
+ {
171
+ displayName: 'Resolve Metafield References',
172
+ name: 'resolveMetafieldReferences',
173
+ type: 'boolean',
174
+ default: false,
175
+ description: 'Whether to resolve references for reference metafield types',
176
+ displayOptions: {
177
+ show: {
178
+ includeMetafields: [true],
179
+ },
180
+ },
181
+ },
182
+ ];
183
+ }
184
+ function seoFields() {
185
+ return [
186
+ {
187
+ displayName: 'Meta Title',
188
+ name: 'seoTitle',
189
+ type: 'string',
190
+ default: '',
191
+ description: 'SEO title shown in search engines',
192
+ },
193
+ {
194
+ displayName: 'Meta Description',
195
+ name: 'seoDescription',
196
+ type: 'string',
197
+ typeOptions: {
198
+ rows: 3,
199
+ },
200
+ default: '',
201
+ description: 'SEO description shown in search engines',
202
+ },
203
+ ];
204
+ }
205
+ function templateSuffixTextField(templateName) {
206
+ return {
207
+ displayName: 'Template Suffix',
208
+ name: 'templateSuffix',
209
+ type: 'string',
210
+ default: '',
211
+ placeholder: 'custom',
212
+ description: `Leave empty to use the default template. Find suffix in Shopify Admin -> Online Store -> Themes -> Edit code -> templates (for example, ${templateName}.custom.JSON => custom).`,
213
+ };
214
+ }
215
+ exports.TAGS_FIELD = {
216
+ displayName: 'Tags',
217
+ name: 'tags',
218
+ type: 'string',
219
+ default: '',
220
+ description: 'Comma-separated tags',
221
+ };
222
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../nodes/ShopifyCustom/config/operations/common.ts"],"names":[],"mappings":";;;AAIA,0DAUC;AAED,4BAeC;AAED,4CAmHC;AAED,oDAsCC;AAED,8BAoBC;AAED,0DASC;AAzND,SAAgB,uBAAuB,CACtC,QAA8B,EAC9B,SAAgC;IAEhC,OAAO;QACN,IAAI,EAAE;YACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,SAAS,EAAE,CAAC,SAAS,CAAC;SACtB;KACD,CAAC;AACH,CAAC;AAED,SAAgB,QAAQ,CACvB,IAAY,EACZ,WAAmB,EACnB,WAAmB,EACnB,QAAQ,GAAG,IAAI;IAEf,OAAO;QACN,WAAW;QACX,IAAI;QACJ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ;QACR,WAAW;QACX,WAAW,EAAE,mBAAmB;KAChC,CAAC;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,WAAmD;IACnF,OAAO;QACN;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,4BAA4B;SACzC;QACD;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,EAAE;oBACL,iBAAiB,EAAE,CAAC,IAAI,CAAC;iBACzB;aACD;SACD;QACD;YACC,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,4BAA4B;YAClC,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,6DAA6D;YAC1E,cAAc,EAAE;gBACf,IAAI,EAAE;oBACL,iBAAiB,EAAE,CAAC,IAAI,CAAC;iBACzB;aACD;SACD;KACD,CAAC;AACH,CAAC;AAED,SAAgB,SAAS;IACxB,OAAO;QACN;YACC,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,mCAAmC;SAChD;QACD;YACC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,IAAI,EAAE,CAAC;aACP;YACD,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,yCAAyC;SACtD;KACD,CAAC;AACH,CAAC;AAED,SAAgB,uBAAuB,CAAC,YAAsC;IAC7E,OAAO;QACN,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,2IAA2I,YAAY,0BAA0B;KAC9L,CAAC;AACH,CAAC;AAEY,QAAA,UAAU,GAAoB;IAC1C,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,sBAAsB;CACnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { IShopifyOperationConfig } from './types';
2
+ export declare const CUSTOMER_OPERATION_CONFIGS: IShopifyOperationConfig[];
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CUSTOMER_OPERATION_CONFIGS = void 0;
4
+ const common_1 = require("./common");
5
+ const CUSTOMER_SORT_OPTIONS = [
6
+ { name: 'ID', value: 'ID' },
7
+ { name: 'Created At', value: 'CREATED_AT' },
8
+ { name: 'Last Order Date', value: 'LAST_ORDER_DATE' },
9
+ { name: 'Updated At', value: 'UPDATED_AT' },
10
+ ];
11
+ function customerBaseFields(isCreate) {
12
+ return [
13
+ {
14
+ displayName: 'Email',
15
+ name: 'email',
16
+ type: 'string',
17
+ placeholder: 'name@email.com',
18
+ default: '',
19
+ required: isCreate,
20
+ },
21
+ {
22
+ displayName: 'Phone',
23
+ name: 'phone',
24
+ type: 'string',
25
+ default: '',
26
+ },
27
+ {
28
+ displayName: 'First Name',
29
+ name: 'firstName',
30
+ type: 'string',
31
+ default: '',
32
+ },
33
+ {
34
+ displayName: 'Last Name',
35
+ name: 'lastName',
36
+ type: 'string',
37
+ default: '',
38
+ },
39
+ {
40
+ displayName: 'Note',
41
+ name: 'note',
42
+ type: 'string',
43
+ typeOptions: {
44
+ rows: 4,
45
+ },
46
+ default: '',
47
+ },
48
+ {
49
+ displayName: 'Tax Exempt',
50
+ name: 'taxExempt',
51
+ type: 'boolean',
52
+ default: false,
53
+ },
54
+ {
55
+ displayName: 'Accepts Marketing',
56
+ name: 'acceptsMarketing',
57
+ type: 'boolean',
58
+ default: false,
59
+ },
60
+ common_1.TAGS_FIELD,
61
+ ];
62
+ }
63
+ exports.CUSTOMER_OPERATION_CONFIGS = [
64
+ {
65
+ resource: 'customer',
66
+ value: 'create',
67
+ name: 'Create',
68
+ description: 'Create a customer',
69
+ registryKey: 'customer.create',
70
+ fields: customerBaseFields(true),
71
+ supportsMetafields: true,
72
+ },
73
+ {
74
+ resource: 'customer',
75
+ value: 'get',
76
+ name: 'Get',
77
+ description: 'Get a customer by ID',
78
+ registryKey: 'customer.get',
79
+ fields: [(0, common_1.gidField)('customerId', 'Customer ID', 'Global customer ID in Shopify'), ...(0, common_1.readMetafieldsFields)()],
80
+ },
81
+ {
82
+ resource: 'customer',
83
+ value: 'getMany',
84
+ name: 'Get Many',
85
+ description: 'Get many customers',
86
+ registryKey: 'customer.getMany',
87
+ fields: (0, common_1.paginationFields)(CUSTOMER_SORT_OPTIONS),
88
+ },
89
+ {
90
+ resource: 'customer',
91
+ value: 'update',
92
+ name: 'Update',
93
+ description: 'Update a customer',
94
+ registryKey: 'customer.update',
95
+ fields: [(0, common_1.gidField)('customerId', 'Customer ID', 'Global customer ID in Shopify'), ...customerBaseFields(false)],
96
+ supportsMetafields: true,
97
+ },
98
+ {
99
+ resource: 'customer',
100
+ value: 'delete',
101
+ name: 'Delete',
102
+ description: 'Delete a customer',
103
+ registryKey: 'customer.delete',
104
+ fields: [(0, common_1.gidField)('customerId', 'Customer ID', 'Global customer ID in Shopify')],
105
+ },
106
+ ];
107
+ //# sourceMappingURL=customer.js.map