@posty5/n8n-nodes-posty5 5.1.0 → 6.1.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.
- package/README.md +17 -118
- package/dist/credentials/Posty5Api.credentials.js +1 -1
- package/dist/credentials/Posty5Api.credentials.js.map +1 -1
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.d.ts.map +1 -1
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js +20 -18
- package/dist/nodes/Posty5FormSubmission/Posty5FormSubmission.node.js.map +1 -1
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.d.ts.map +1 -1
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js +42 -36
- package/dist/nodes/Posty5HtmlHosting/Posty5HtmlHosting.node.js.map +1 -1
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.d.ts.map +1 -1
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js +52 -48
- package/dist/nodes/Posty5QrCode/Posty5QrCode.node.js.map +1 -1
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.d.ts.map +1 -1
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js +10 -7
- package/dist/nodes/Posty5ShortLink/Posty5ShortLink.node.js.map +1 -1
- package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.d.ts.map +1 -1
- package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js +123 -88
- package/dist/nodes/Posty5SocialPublisherPost/Posty5SocialPublisherPost.node.js.map +1 -1
- package/dist/nodes/Posty5SocialPublisherWorkspace/Posty5SocialPublisherWorkspace.node.d.ts.map +1 -1
- package/dist/nodes/Posty5SocialPublisherWorkspace/Posty5SocialPublisherWorkspace.node.js +87 -3
- package/dist/nodes/Posty5SocialPublisherWorkspace/Posty5SocialPublisherWorkspace.node.js.map +1 -1
- package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js +2 -2
- package/dist/nodes/Posty5Trigger/Posty5Trigger.node.js.map +1 -1
- package/dist/package.json +10 -10
- package/dist/types/common.d.ts +10 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/html-hosting.types.d.ts +4 -3
- package/dist/types/html-hosting.types.d.ts.map +1 -1
- package/dist/types/qr-code.types.d.ts +4 -3
- package/dist/types/qr-code.types.d.ts.map +1 -1
- package/dist/types/short-link.types.d.ts +5 -4
- package/dist/types/short-link.types.d.ts.map +1 -1
- package/dist/utils/analytics.helpers.js +1 -1
- package/dist/utils/analytics.helpers.js.map +1 -1
- package/dist/utils/analytics.properties.d.ts.map +1 -1
- package/dist/utils/analytics.properties.js +1 -0
- package/dist/utils/analytics.properties.js.map +1 -1
- package/dist/utils/api.helpers.d.ts +10 -3
- package/dist/utils/api.helpers.d.ts.map +1 -1
- package/dist/utils/api.helpers.js +13 -0
- package/dist/utils/api.helpers.js.map +1 -1
- package/dist/utils/constants.d.ts +4 -13
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +5 -14
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/date.helpers.d.ts +9 -0
- package/dist/utils/date.helpers.d.ts.map +1 -1
- package/dist/utils/date.helpers.js +26 -0
- package/dist/utils/date.helpers.js.map +1 -1
- package/dist/utils/list-date-filter.properties.d.ts +11 -0
- package/dist/utils/list-date-filter.properties.d.ts.map +1 -0
- package/dist/utils/list-date-filter.properties.js +30 -0
- package/dist/utils/list-date-filter.properties.js.map +1 -0
- package/dist/utils/post-comments.d.ts +1 -1
- package/dist/utils/post-comments.d.ts.map +1 -1
- package/dist/utils/post-comments.js +1 -1
- package/dist/utils/post-comments.js.map +1 -1
- package/dist/utils/qr-render.helpers.js +1 -1
- package/dist/utils/qr-render.helpers.js.map +1 -1
- package/package.json +10 -10
- package/dist/nodes/Posty5Store/Posty5Store.node.d.ts +0 -17
- package/dist/nodes/Posty5Store/Posty5Store.node.d.ts.map +0 -1
- package/dist/nodes/Posty5Store/Posty5Store.node.js +0 -230
- package/dist/nodes/Posty5Store/Posty5Store.node.js.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts +0 -4
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.d.ts.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js +0 -55
- package/dist/nodes/Posty5Store/descriptions/fulfilment-group.description.js.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/order.description.d.ts +0 -4
- package/dist/nodes/Posty5Store/descriptions/order.description.d.ts.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/order.description.js +0 -91
- package/dist/nodes/Posty5Store/descriptions/order.description.js.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts +0 -4
- package/dist/nodes/Posty5Store/descriptions/product-link.description.d.ts.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/product-link.description.js +0 -48
- package/dist/nodes/Posty5Store/descriptions/product-link.description.js.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts +0 -4
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.d.ts.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js +0 -118
- package/dist/nodes/Posty5Store/descriptions/supplier-order.description.js.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts +0 -4
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.d.ts.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js +0 -167
- package/dist/nodes/Posty5Store/descriptions/supplier-product.description.js.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts +0 -4
- package/dist/nodes/Posty5Store/descriptions/supplier.description.d.ts.map +0 -1
- package/dist/nodes/Posty5Store/descriptions/supplier.description.js +0 -50
- package/dist/nodes/Posty5Store/descriptions/supplier.description.js.map +0 -1
- package/dist/types/store.types.d.ts +0 -71
- package/dist/types/store.types.d.ts.map +0 -1
- package/dist/types/store.types.js +0 -7
- package/dist/types/store.types.js.map +0 -1
- package/dist/utils/store.helpers.d.ts +0 -43
- package/dist/utils/store.helpers.d.ts.map +0 -1
- package/dist/utils/store.helpers.js +0 -87
- package/dist/utils/store.helpers.js.map +0 -1
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.supplierProductFields = exports.supplierProductOperations = void 0;
|
|
4
|
-
const constants_1 = require("../../../utils/constants");
|
|
5
|
-
const show = { resource: ['supplierProduct'] };
|
|
6
|
-
exports.supplierProductOperations = {
|
|
7
|
-
displayName: 'Operation',
|
|
8
|
-
name: 'operation',
|
|
9
|
-
type: 'options',
|
|
10
|
-
noDataExpression: true,
|
|
11
|
-
displayOptions: { show },
|
|
12
|
-
options: [
|
|
13
|
-
{
|
|
14
|
-
name: 'Get',
|
|
15
|
-
value: 'get',
|
|
16
|
-
description: 'Get one supplier product with its variants, costs and stock',
|
|
17
|
-
action: 'Get a supplier product',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'Get Import Status',
|
|
21
|
-
value: 'getImportStatus',
|
|
22
|
-
description: 'Read the progress of a background import',
|
|
23
|
-
action: 'Get an import status',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'Get Many',
|
|
27
|
-
value: 'getMany',
|
|
28
|
-
description: "Browse or search the supplier's catalogue",
|
|
29
|
-
action: 'Get many supplier products',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'Import',
|
|
33
|
-
value: 'import',
|
|
34
|
-
description: 'Import up to 50 products into the store. Charged like adding products. Large imports answer a job ID to poll.',
|
|
35
|
-
action: 'Import supplier products',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'Preview Import',
|
|
39
|
-
value: 'previewImport',
|
|
40
|
-
description: 'Price the chosen products and name duplicates. Nothing is created or charged.',
|
|
41
|
-
action: 'Preview a supplier import',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'Resolve URL',
|
|
45
|
-
value: 'resolveUrl',
|
|
46
|
-
description: 'Turn a pasted product link into the supplier product',
|
|
47
|
-
action: 'Resolve a supplier product URL',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
default: 'getMany',
|
|
51
|
-
};
|
|
52
|
-
exports.supplierProductFields = [
|
|
53
|
-
{
|
|
54
|
-
displayName: 'Supplier Connection ID',
|
|
55
|
-
name: 'integrationId',
|
|
56
|
-
type: 'string',
|
|
57
|
-
required: true,
|
|
58
|
-
default: '',
|
|
59
|
-
description: 'The connection ID, from Supplier → Get Many',
|
|
60
|
-
displayOptions: { show: { ...show, operation: ['get', 'getMany', 'import', 'previewImport', 'resolveUrl'] } },
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
displayName: 'Supplier Product ID',
|
|
64
|
-
name: 'supplierProductId',
|
|
65
|
-
type: 'string',
|
|
66
|
-
required: true,
|
|
67
|
-
default: '',
|
|
68
|
-
displayOptions: { show: { ...show, operation: ['get'] } },
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
displayName: 'Product URL',
|
|
72
|
-
name: 'url',
|
|
73
|
-
type: 'string',
|
|
74
|
-
required: true,
|
|
75
|
-
default: '',
|
|
76
|
-
placeholder: 'https://…',
|
|
77
|
-
description: 'A full product link from the supplier. Shortened links are refused.',
|
|
78
|
-
displayOptions: { show: { ...show, operation: ['resolveUrl'] } },
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
displayName: 'Supplier Product IDs',
|
|
82
|
-
name: 'supplierProductIds',
|
|
83
|
-
type: 'string',
|
|
84
|
-
required: true,
|
|
85
|
-
default: '',
|
|
86
|
-
description: 'Comma-separated supplier product IDs, up to 50. Every variant of each is imported.',
|
|
87
|
-
displayOptions: { show: { ...show, operation: ['import', 'previewImport'] } },
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
displayName: 'Job ID',
|
|
91
|
-
name: 'jobId',
|
|
92
|
-
type: 'string',
|
|
93
|
-
required: true,
|
|
94
|
-
default: '',
|
|
95
|
-
description: 'The job ID an Import answered',
|
|
96
|
-
displayOptions: { show: { ...show, operation: ['getImportStatus'] } },
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
displayName: 'Page',
|
|
100
|
-
name: 'page',
|
|
101
|
-
type: 'number',
|
|
102
|
-
typeOptions: { minValue: 1 },
|
|
103
|
-
default: 1,
|
|
104
|
-
displayOptions: { show: { ...show, operation: ['getMany'] } },
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
displayName: 'Limit',
|
|
108
|
-
name: 'limit',
|
|
109
|
-
type: 'number',
|
|
110
|
-
typeOptions: { minValue: 1, maxValue: constants_1.STORE_SUPPLIER_PAGE_SIZES.CATALOGUE_MAX },
|
|
111
|
-
// The lint rule wants 50, but the api refuses a catalogue pageSize above 48 with a 400.
|
|
112
|
-
// A literal because the lint rules read it; the test pins it to STORE_SUPPLIER_PAGE_SIZES.CATALOGUE_MAX.
|
|
113
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-default-wrong-for-limit
|
|
114
|
-
default: 48,
|
|
115
|
-
description: 'Max number of results to return',
|
|
116
|
-
displayOptions: { show: { ...show, operation: ['getMany'] } },
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
displayName: 'Filters',
|
|
120
|
-
name: 'filters',
|
|
121
|
-
type: 'collection',
|
|
122
|
-
placeholder: 'Add Filter',
|
|
123
|
-
default: {},
|
|
124
|
-
displayOptions: { show: { ...show, operation: ['getMany'] } },
|
|
125
|
-
options: [
|
|
126
|
-
{ displayName: 'Category ID', name: 'categoryId', type: 'string', default: '' },
|
|
127
|
-
{ displayName: 'Search', name: 'q', type: 'string', default: '', description: 'Search text' },
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
displayName: 'Import Options',
|
|
132
|
-
name: 'importOptions',
|
|
133
|
-
type: 'collection',
|
|
134
|
-
placeholder: 'Add Option',
|
|
135
|
-
default: {},
|
|
136
|
-
displayOptions: { show: { ...show, operation: ['import', 'previewImport'] } },
|
|
137
|
-
options: [
|
|
138
|
-
{
|
|
139
|
-
displayName: 'Allow Duplicate',
|
|
140
|
-
name: 'allowDuplicate',
|
|
141
|
-
type: 'boolean',
|
|
142
|
-
default: false,
|
|
143
|
-
description: 'Whether to import a supplier product the store already has, as a second copy',
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
displayName: 'Status',
|
|
147
|
-
name: 'status',
|
|
148
|
-
type: 'options',
|
|
149
|
-
options: [
|
|
150
|
-
{ name: 'Active', value: 'active' },
|
|
151
|
-
{ name: 'Draft', value: 'draft' },
|
|
152
|
-
{ name: 'Hidden', value: 'hidden' },
|
|
153
|
-
],
|
|
154
|
-
default: 'draft',
|
|
155
|
-
description: 'Status of the imported products',
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
displayName: 'Tag Names',
|
|
159
|
-
name: 'tagNames',
|
|
160
|
-
type: 'string',
|
|
161
|
-
default: '',
|
|
162
|
-
description: 'Comma-separated tags to add to the imported products',
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
},
|
|
166
|
-
];
|
|
167
|
-
//# sourceMappingURL=supplier-product.description.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supplier-product.description.js","sourceRoot":"","sources":["../../../../nodes/Posty5Store/descriptions/supplier-product.description.ts"],"names":[],"mappings":";;;AACA,wDAAqE;AAErE,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC;AAElC,QAAA,yBAAyB,GAAoB;IACzD,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,EAAE,IAAI,EAAE;IACxB,OAAO,EAAE;QACR;YACC,IAAI,EAAE,KAA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gBACf,OAAO,EAAE;oBACR,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;oBACnC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBACjC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;iBACnC;gBACD,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,iCAAiC;aAC9C;YACD;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,sDAAsD;aACnE;SACD;KACD;CACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supplier.description.d.ts","sourceRoot":"","sources":["../../../../nodes/Posty5Store/descriptions/supplier.description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,kBAAkB,EAAE,eAiChC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,eAAe,EAU3C,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.supplierFields = exports.supplierOperations = void 0;
|
|
4
|
-
const show = { resource: ['supplier'] };
|
|
5
|
-
exports.supplierOperations = {
|
|
6
|
-
displayName: 'Operation',
|
|
7
|
-
name: 'operation',
|
|
8
|
-
type: 'options',
|
|
9
|
-
noDataExpression: true,
|
|
10
|
-
displayOptions: { show },
|
|
11
|
-
options: [
|
|
12
|
-
{
|
|
13
|
-
name: 'Get Balance',
|
|
14
|
-
value: 'getBalance',
|
|
15
|
-
description: "Read the store's balance at the supplier, where the supplier reports one",
|
|
16
|
-
action: 'Get a supplier balance',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'Get Catalogue',
|
|
20
|
-
value: 'getCatalogue',
|
|
21
|
-
description: 'List the suppliers this store can connect, with what each can do',
|
|
22
|
-
action: 'Get the supplier catalogue',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'Get Many',
|
|
26
|
-
value: 'getMany',
|
|
27
|
-
description: "List the store's supplier connections. Credentials are never returned.",
|
|
28
|
-
action: 'Get many supplier connections',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'Test',
|
|
32
|
-
value: 'test',
|
|
33
|
-
description: 'Check a connection now and record its health. Free; calls the supplier once.',
|
|
34
|
-
action: 'Test a supplier connection',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
default: 'getMany',
|
|
38
|
-
};
|
|
39
|
-
exports.supplierFields = [
|
|
40
|
-
{
|
|
41
|
-
displayName: 'Supplier Connection ID',
|
|
42
|
-
name: 'integrationId',
|
|
43
|
-
type: 'string',
|
|
44
|
-
required: true,
|
|
45
|
-
default: '',
|
|
46
|
-
description: 'The connection ID, from Supplier → Get Many',
|
|
47
|
-
displayOptions: { show: { ...show, operation: ['getBalance', 'test'] } },
|
|
48
|
-
},
|
|
49
|
-
];
|
|
50
|
-
//# sourceMappingURL=supplier.description.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supplier.description.js","sourceRoot":"","sources":["../../../../nodes/Posty5Store/descriptions/supplier.description.ts"],"names":[],"mappings":";;;AAEA,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;AAE3B,QAAA,kBAAkB,GAAoB;IAClD,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,EAAE,IAAI,EAAE;IACxB,OAAO,EAAE;QACR;YACC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,0EAA0E;YACvF,MAAM,EAAE,wBAAwB;SAChC;QACD;YACC,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,kEAAkE;YAC/E,MAAM,EAAE,4BAA4B;SACpC;QACD;YACC,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,wEAAwE;YACrF,MAAM,EAAE,+BAA+B;SACvC;QACD;YACC,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,8EAA8E;YAC3F,MAAM,EAAE,4BAA4B;SACpC;KACD;IACD,OAAO,EAAE,SAAS;CAClB,CAAC;AAEW,QAAA,cAAc,GAAsB;IAChD;QACC,WAAW,EAAE,wBAAwB;QACrC,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,6CAA6C;QAC1D,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,EAAE;KACxE;CACD,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store Types for Posty5 N8N Nodes — dropshipping.
|
|
3
|
-
* The names match `@posty5/store`, so a reader of one recognises the other.
|
|
4
|
-
*/
|
|
5
|
-
export type StoreSupplierOrderStatus = 'queued' | 'needsReview' | 'submitted' | 'confirmed' | 'processing' | 'shipped' | 'delivered' | 'cancelled' | 'failed';
|
|
6
|
-
export type StoreSupplierOrderReviewReason = 'insufficientBalance' | 'variantUnavailable' | 'destinationUnsupported' | 'costAboveLimit' | 'costChanged' | 'customerPaymentPending' | 'customerPaymentNotSettled' | 'connectionUnhealthy' | 'supplierRefused' | 'connectionMissing' | 'supplierAlreadyShipped' | 'testMode' | 'customerCaptureFailed';
|
|
7
|
-
export type StoreFulfilmentGroupStatus = 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled';
|
|
8
|
-
/** The part actions that address a part (order + part key). */
|
|
9
|
-
export type FulfilmentGroupAction = 'submit' | 'fulfil-manually';
|
|
10
|
-
/** The actions that address one supplier order by its id. */
|
|
11
|
-
export type SupplierOrderAction = 'retry' | 'pay' | 'cancel';
|
|
12
|
-
/** One supplier order, as far as the node reads it. */
|
|
13
|
-
export interface IStoreSupplierOrder {
|
|
14
|
-
_id: string;
|
|
15
|
-
orderId: string;
|
|
16
|
-
orderNumber?: string;
|
|
17
|
-
fulfilmentGroupKey: string;
|
|
18
|
-
supplierKey: string;
|
|
19
|
-
status: StoreSupplierOrderStatus;
|
|
20
|
-
reviewReason?: StoreSupplierOrderReviewReason | null;
|
|
21
|
-
reviewMessage?: string | null;
|
|
22
|
-
retryable: boolean;
|
|
23
|
-
[key: string]: unknown;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The pagination block of a cursor-paged store list — the platform's list
|
|
27
|
-
* envelope (`req.end_Searchable`), used by the orders search and the
|
|
28
|
-
* supplier-order queue alike.
|
|
29
|
-
*/
|
|
30
|
-
export interface IStoreCursorPagination {
|
|
31
|
-
nextCursor?: string | null;
|
|
32
|
-
previousCursor?: string | null;
|
|
33
|
-
hasMore?: boolean;
|
|
34
|
-
totalCount?: number;
|
|
35
|
-
pageSize?: number;
|
|
36
|
-
}
|
|
37
|
-
/** One page of a cursor-paged store list. */
|
|
38
|
-
export interface IStoreCursorPage<T> {
|
|
39
|
-
items?: T[];
|
|
40
|
-
pagination?: IStoreCursorPagination;
|
|
41
|
-
}
|
|
42
|
-
/** One part of a store order. */
|
|
43
|
-
export interface IOrderFulfilmentGroup {
|
|
44
|
-
key: string;
|
|
45
|
-
kind: 'merchant' | 'thirdParty';
|
|
46
|
-
label: string;
|
|
47
|
-
status: StoreFulfilmentGroupStatus;
|
|
48
|
-
supplierOrderId?: string;
|
|
49
|
-
shipment?: {
|
|
50
|
-
carrierName?: string;
|
|
51
|
-
trackingNumber?: string;
|
|
52
|
-
trackingUrl?: string;
|
|
53
|
-
status?: string;
|
|
54
|
-
};
|
|
55
|
-
[key: string]: unknown;
|
|
56
|
-
}
|
|
57
|
-
/** A store order as the node reads it for Split Parts. */
|
|
58
|
-
export interface IStoreOrderWithParts {
|
|
59
|
-
_id: string;
|
|
60
|
-
orderNumber?: string;
|
|
61
|
-
fulfilmentGroups?: IOrderFulfilmentGroup[];
|
|
62
|
-
supplierOrders?: IStoreSupplierOrder[];
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
}
|
|
65
|
-
/** One output item of Split Parts: the part, with its order and supplier order attached. */
|
|
66
|
-
export interface IOrderPartItem extends IOrderFulfilmentGroup {
|
|
67
|
-
orderId: string;
|
|
68
|
-
orderNumber?: string;
|
|
69
|
-
supplierOrder: IStoreSupplierOrder | null;
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=store.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.types.d.ts","sourceRoot":"","sources":["../../types/store.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,wBAAwB,GACjC,QAAQ,GACR,aAAa,GACb,WAAW,GACX,WAAW,GACX,YAAY,GACZ,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,CAAC;AAEZ,MAAM,MAAM,8BAA8B,GACvC,qBAAqB,GACrB,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,aAAa,GACb,wBAAwB,GACxB,2BAA2B,GAC3B,qBAAqB,GACrB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,UAAU,GACV,uBAAuB,CAAC;AAE3B,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;AAE1G,+DAA+D;AAC/D,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,MAAM,mBAAmB,GAAG,O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,CAAC;IACpG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC3C,cAAc,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,4FAA4F;AAC5F,MAAM,WAAW,cAAe,SAAQ,qBAAqB;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.types.js","sourceRoot":"","sources":["../../types/store.types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helpers for the Posty5 Store node (dropshipping).
|
|
3
|
-
*/
|
|
4
|
-
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
|
|
5
|
-
import { makeApiRequest } from './api.helpers';
|
|
6
|
-
import type { FulfilmentGroupAction, IOrderPartItem, IStoreCursorPage, IStoreOrderWithParts, SupplierOrderAction } from '../types/store.types';
|
|
7
|
-
/**
|
|
8
|
-
* The route for an action on one part of an order. The part key looks like
|
|
9
|
-
* `supplier:<integrationId>`, so it is encoded before it enters the path.
|
|
10
|
-
*/
|
|
11
|
-
export declare function buildGroupActionEndpoint(storeId: string, orderId: string, groupKey: string, action: FulfilmentGroupAction): string;
|
|
12
|
-
/** The route for an action on one supplier order. */
|
|
13
|
-
export declare function buildSupplierOrderActionEndpoint(storeId: string, supplierOrderId: string, action: SupplierOrderAction): string;
|
|
14
|
-
/**
|
|
15
|
-
* One item per part of an order, each carrying the order's id and number and
|
|
16
|
-
* the supplier order behind it (newest attempt), or null for the store's own part.
|
|
17
|
-
* An order from before parts existed still has one merchant part (the api adds it).
|
|
18
|
-
*/
|
|
19
|
-
export declare function splitOrderParts(order: IStoreOrderWithParts): IOrderPartItem[];
|
|
20
|
-
/**
|
|
21
|
-
* A POST to the `/api/store-suppliers` routes, without the `createdFrom` stamp
|
|
22
|
-
* their schemas never declared. Call it with the node's context:
|
|
23
|
-
* `storeSupplierPost.call(this, apiKey, endpoint, body)`.
|
|
24
|
-
*/
|
|
25
|
-
export declare function storeSupplierPost(this: IExecuteFunctions, apiKey: string, endpoint: string, body?: Record<string, unknown>): ReturnType<typeof makeApiRequest>;
|
|
26
|
-
/** A GET for the store node, with empty filter values dropped from the query. */
|
|
27
|
-
export declare function storeGet(this: IExecuteFunctions, apiKey: string, endpoint: string, qs?: Record<string, unknown>): ReturnType<typeof makeApiRequest>;
|
|
28
|
-
/**
|
|
29
|
-
* One page of a cursor-paged store list as output rows. The page's
|
|
30
|
-
* `nextCursor` rides on the last row, so the next run can pass it back as the
|
|
31
|
-
* Cursor filter and continue from there.
|
|
32
|
-
*/
|
|
33
|
-
export declare function rowsWithNextCursor(page: IStoreCursorPage<IDataObject> | undefined): IDataObject[];
|
|
34
|
-
/**
|
|
35
|
-
* Every row of a cursor-paged store list (Return All): follows
|
|
36
|
-
* `pagination.nextCursor` until `pagination.hasMore` is false. A cursor in `qs`
|
|
37
|
-
* is the starting point. Stops, too, if the api hands back the cursor it was
|
|
38
|
-
* just sent, so a misbehaving page can never loop forever.
|
|
39
|
-
*/
|
|
40
|
-
export declare function storeGetAllByCursor(this: IExecuteFunctions, apiKey: string, endpoint: string, qs: Record<string, unknown>, pageSize: number): Promise<IDataObject[]>;
|
|
41
|
-
/** Drop empty filter values so the api sees only what the user chose. */
|
|
42
|
-
export declare function stripEmpty(qs: Record<string, unknown>): Record<string, unknown>;
|
|
43
|
-
//# sourceMappingURL=store.helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
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AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3B,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,EAAE,CAAC,CAYxB;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAI/E"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Helpers for the Posty5 Store node (dropshipping).
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.buildGroupActionEndpoint = buildGroupActionEndpoint;
|
|
7
|
-
exports.buildSupplierOrderActionEndpoint = buildSupplierOrderActionEndpoint;
|
|
8
|
-
exports.splitOrderParts = splitOrderParts;
|
|
9
|
-
exports.storeSupplierPost = storeSupplierPost;
|
|
10
|
-
exports.storeGet = storeGet;
|
|
11
|
-
exports.rowsWithNextCursor = rowsWithNextCursor;
|
|
12
|
-
exports.storeGetAllByCursor = storeGetAllByCursor;
|
|
13
|
-
exports.stripEmpty = stripEmpty;
|
|
14
|
-
const api_helpers_1 = require("./api.helpers");
|
|
15
|
-
const constants_1 = require("./constants");
|
|
16
|
-
/**
|
|
17
|
-
* The route for an action on one part of an order. The part key looks like
|
|
18
|
-
* `supplier:<integrationId>`, so it is encoded before it enters the path.
|
|
19
|
-
*/
|
|
20
|
-
function buildGroupActionEndpoint(storeId, orderId, groupKey, action) {
|
|
21
|
-
return `${constants_1.API_ENDPOINTS.STORE_SUPPLIERS}/${storeId}/orders/${orderId}/groups/${encodeURIComponent(groupKey)}/${action}`;
|
|
22
|
-
}
|
|
23
|
-
/** The route for an action on one supplier order. */
|
|
24
|
-
function buildSupplierOrderActionEndpoint(storeId, supplierOrderId, action) {
|
|
25
|
-
return `${constants_1.API_ENDPOINTS.STORE_SUPPLIERS}/${storeId}/orders/${supplierOrderId}/${action}`;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* One item per part of an order, each carrying the order's id and number and
|
|
29
|
-
* the supplier order behind it (newest attempt), or null for the store's own part.
|
|
30
|
-
* An order from before parts existed still has one merchant part (the api adds it).
|
|
31
|
-
*/
|
|
32
|
-
function splitOrderParts(order) {
|
|
33
|
-
const supplierOrders = order.supplierOrders || [];
|
|
34
|
-
return (order.fulfilmentGroups || []).map((group) => ({
|
|
35
|
-
...group,
|
|
36
|
-
orderId: order._id,
|
|
37
|
-
orderNumber: order.orderNumber,
|
|
38
|
-
supplierOrder: supplierOrders.find((row) => row.fulfilmentGroupKey === group.key) || null,
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* A POST to the `/api/store-suppliers` routes, without the `createdFrom` stamp
|
|
43
|
-
* their schemas never declared. Call it with the node's context:
|
|
44
|
-
* `storeSupplierPost.call(this, apiKey, endpoint, body)`.
|
|
45
|
-
*/
|
|
46
|
-
function storeSupplierPost(apiKey, endpoint, body = {}) {
|
|
47
|
-
return api_helpers_1.makeApiRequest.call(this, apiKey, { method: 'POST', endpoint, body, stampCreatedFrom: false });
|
|
48
|
-
}
|
|
49
|
-
/** A GET for the store node, with empty filter values dropped from the query. */
|
|
50
|
-
function storeGet(apiKey, endpoint, qs) {
|
|
51
|
-
return api_helpers_1.makeApiRequest.call(this, apiKey, { method: 'GET', endpoint, ...(qs ? { qs: stripEmpty(qs) } : {}) });
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* One page of a cursor-paged store list as output rows. The page's
|
|
55
|
-
* `nextCursor` rides on the last row, so the next run can pass it back as the
|
|
56
|
-
* Cursor filter and continue from there.
|
|
57
|
-
*/
|
|
58
|
-
function rowsWithNextCursor(page) {
|
|
59
|
-
const rows = [...(page?.items || [])];
|
|
60
|
-
const nextCursor = page?.pagination?.nextCursor;
|
|
61
|
-
if (rows.length && nextCursor)
|
|
62
|
-
rows[rows.length - 1] = { ...rows[rows.length - 1], nextCursor };
|
|
63
|
-
return rows;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Every row of a cursor-paged store list (Return All): follows
|
|
67
|
-
* `pagination.nextCursor` until `pagination.hasMore` is false. A cursor in `qs`
|
|
68
|
-
* is the starting point. Stops, too, if the api hands back the cursor it was
|
|
69
|
-
* just sent, so a misbehaving page can never loop forever.
|
|
70
|
-
*/
|
|
71
|
-
async function storeGetAllByCursor(apiKey, endpoint, qs, pageSize) {
|
|
72
|
-
const rows = [];
|
|
73
|
-
let cursor = typeof qs.cursor === 'string' && qs.cursor ? qs.cursor : undefined;
|
|
74
|
-
for (;;) {
|
|
75
|
-
const page = (await storeGet.call(this, apiKey, endpoint, { ...qs, cursor, pageSize }));
|
|
76
|
-
rows.push(...(page?.items || []));
|
|
77
|
-
const next = page?.pagination?.hasMore ? page.pagination.nextCursor : undefined;
|
|
78
|
-
if (!next || next === cursor)
|
|
79
|
-
return rows;
|
|
80
|
-
cursor = next;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/** Drop empty filter values so the api sees only what the user chose. */
|
|
84
|
-
function stripEmpty(qs) {
|
|
85
|
-
return Object.fromEntries(Object.entries(qs).filter(([, value]) => value !== undefined && value !== null && value !== ''));
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=store.helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.helpers.js","sourceRoot":"","sources":["../../utils/store.helpers.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAiBH,4DAOC;AAGD,4EAMC;AAOD,0CAQC;AAOD,8CAOC;AAGD,4BAOC;AAOD,gDAKC;AAQD,kDAkBC;AAGD,gCAIC;AAlHD,+CAA+C;AAC/C,2CAA4C;AA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