@propeller-commerce/propeller-sdk-v2 0.12.1 → 0.13.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/CHANGELOG.md +49 -0
- package/dist/cjs/generated/operationVariables.d.ts +9 -1
- package/dist/cjs/generated/operations/machine.js +31 -51
- package/dist/cjs/generated/operations/machineCreate.js +31 -51
- package/dist/cjs/generated/operations/machineUpsert.js +31 -51
- package/dist/cjs/generated/operations/machines.js +31 -51
- package/dist/cjs/service/MachineService.d.ts +22 -7
- package/dist/cjs/service/MachineService.js +25 -8
- package/dist/cjs/service/SparePartsMachineService.d.ts +13 -7
- package/dist/cjs/service/SparePartsMachineService.js +16 -8
- package/dist/esm/generated/operations/machine.js +31 -51
- package/dist/esm/generated/operations/machineCreate.js +31 -51
- package/dist/esm/generated/operations/machineUpsert.js +31 -51
- package/dist/esm/generated/operations/machines.js +31 -51
- package/dist/esm/service/MachineService.js +25 -8
- package/dist/esm/service/SparePartsMachineService.js +16 -8
- package/package.json +1 -1
|
@@ -14,20 +14,35 @@ function machineService(client) {
|
|
|
14
14
|
return {
|
|
15
15
|
/**
|
|
16
16
|
Retrieves a specific machine
|
|
17
|
-
* @param variables
|
|
17
|
+
* @param variables Variables for the machine query
|
|
18
|
+
* - id: string - Machine ID to fetch
|
|
19
|
+
* - slug: string - Machine slug to fetch
|
|
20
|
+
* - source / sourceId: string - External source / source identifier pair
|
|
21
|
+
* - language: string - Language for localized content
|
|
22
|
+
* - sparePartsMachineProductSearchInput: SparePartsMachineProductSearchInput -
|
|
23
|
+
* Search/filter/sort/paging input for the machine's `sparePartProducts`
|
|
24
|
+
* - priceCalculateProductInput: PriceCalculateProductInput - Price calculation input
|
|
25
|
+
* - imageSearchFilters: MediaImageProductSearchInput - Image search filters
|
|
26
|
+
* - imageVariantFilters: TransformationsInput! - Image transformation filters
|
|
27
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
28
|
+
* into the request body.
|
|
18
29
|
* @returns Promise<SparePartsMachine> Machine data
|
|
19
30
|
*/
|
|
20
|
-
async getMachine(variables) {
|
|
21
|
-
const
|
|
31
|
+
async getMachine(variables, fetchOptions) {
|
|
32
|
+
const language = variables.language ?? client.getDefaultLanguage();
|
|
33
|
+
const result = await (0, runOperation_1.runOperation)(client, machine_1.document, 'machine', { ...variables, language }, fetchOptions);
|
|
22
34
|
return result.data.machine;
|
|
23
35
|
},
|
|
24
36
|
/**
|
|
25
37
|
Retrieves machines with search criteria
|
|
26
38
|
* @param variables Search input parameters
|
|
39
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
40
|
+
* into the request body.
|
|
27
41
|
* @returns Promise<SparePartsMachineResponse> Machines response
|
|
28
42
|
*/
|
|
29
|
-
async getMachines(variables) {
|
|
30
|
-
const
|
|
43
|
+
async getMachines(variables, fetchOptions) {
|
|
44
|
+
const language = variables.language ?? client.getDefaultLanguage();
|
|
45
|
+
const result = await (0, runOperation_1.runOperation)(client, machines_1.document, 'machines', { ...variables, language }, fetchOptions);
|
|
31
46
|
return result.data.machines;
|
|
32
47
|
},
|
|
33
48
|
/**
|
|
@@ -57,14 +72,16 @@ class MachineService {
|
|
|
57
72
|
constructor(client) { this._svc = machineService(client); }
|
|
58
73
|
/**
|
|
59
74
|
* Retrieves a specific machine
|
|
60
|
-
* @param variables
|
|
75
|
+
* @param variables Variables for the machine query
|
|
76
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
61
77
|
*/
|
|
62
|
-
getMachine(variables) { return this._svc.getMachine(variables); }
|
|
78
|
+
getMachine(variables, fetchOptions) { return this._svc.getMachine(variables, fetchOptions); }
|
|
63
79
|
/**
|
|
64
80
|
* Retrieves machines with search criteria
|
|
65
81
|
* @param variables Search input parameters
|
|
82
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
66
83
|
*/
|
|
67
|
-
getMachines(variables) { return this._svc.getMachines(variables); }
|
|
84
|
+
getMachines(variables, fetchOptions) { return this._svc.getMachines(variables, fetchOptions); }
|
|
68
85
|
/**
|
|
69
86
|
* Creates a new machine
|
|
70
87
|
* @param variables Machine creation input
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SparePartsMachine } from '../type/SparePartsMachine';
|
|
2
2
|
import { SparePartsMachineResponse } from '../type/SparePartsMachineResponse';
|
|
3
|
-
import { GraphQLClient } from '../client/GraphQLClient';
|
|
3
|
+
import { GraphQLClient, GraphQLFetchOptions } from '../client/GraphQLClient';
|
|
4
4
|
import type { MachineCreateVariables, MachineUpsertVariables, MachineVariables, MachinesVariables } from '../generated/operationVariables';
|
|
5
5
|
/**
|
|
6
6
|
Service for managing spare parts machines
|
|
@@ -8,16 +8,20 @@ import type { MachineCreateVariables, MachineUpsertVariables, MachineVariables,
|
|
|
8
8
|
export declare function sparePartsMachineService(client: GraphQLClient): {
|
|
9
9
|
/**
|
|
10
10
|
Retrieves a specific spare parts machine
|
|
11
|
-
* @param variables
|
|
11
|
+
* @param variables Variables for the machine query — see `machineService.getMachine`
|
|
12
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
13
|
+
* into the request body.
|
|
12
14
|
* @returns Promise<SparePartsMachine> Spare parts machine data
|
|
13
15
|
*/
|
|
14
|
-
getSparePartsMachine(variables: MachineVariables): Promise<SparePartsMachine>;
|
|
16
|
+
getSparePartsMachine(variables: MachineVariables, fetchOptions?: GraphQLFetchOptions): Promise<SparePartsMachine>;
|
|
15
17
|
/**
|
|
16
18
|
Retrieves spare parts machines with search criteria
|
|
17
19
|
* @param variables Search input parameters
|
|
20
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
21
|
+
* into the request body.
|
|
18
22
|
* @returns Promise<SparePartsMachineResponse> Spare parts machines response
|
|
19
23
|
*/
|
|
20
|
-
getSparePartsMachines(variables: MachinesVariables): Promise<SparePartsMachineResponse>;
|
|
24
|
+
getSparePartsMachines(variables: MachinesVariables, fetchOptions?: GraphQLFetchOptions): Promise<SparePartsMachineResponse>;
|
|
21
25
|
/**
|
|
22
26
|
Creates a new spare parts machine
|
|
23
27
|
* @param variables Spare parts machine creation input
|
|
@@ -39,14 +43,16 @@ export declare class SparePartsMachineService {
|
|
|
39
43
|
constructor(client: GraphQLClient);
|
|
40
44
|
/**
|
|
41
45
|
* Retrieves a specific spare parts machine
|
|
42
|
-
* @param variables
|
|
46
|
+
* @param variables Variables for the machine query
|
|
47
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
43
48
|
*/
|
|
44
|
-
getSparePartsMachine(variables: MachineVariables): Promise<SparePartsMachine>;
|
|
49
|
+
getSparePartsMachine(variables: MachineVariables, fetchOptions?: GraphQLFetchOptions): Promise<SparePartsMachine>;
|
|
45
50
|
/**
|
|
46
51
|
* Retrieves spare parts machines with search criteria
|
|
47
52
|
* @param variables Search input parameters
|
|
53
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
48
54
|
*/
|
|
49
|
-
getSparePartsMachines(variables: MachinesVariables): Promise<SparePartsMachineResponse>;
|
|
55
|
+
getSparePartsMachines(variables: MachinesVariables, fetchOptions?: GraphQLFetchOptions): Promise<SparePartsMachineResponse>;
|
|
50
56
|
/**
|
|
51
57
|
* Creates a new spare parts machine
|
|
52
58
|
* @param variables Spare parts machine creation input
|
|
@@ -14,20 +14,26 @@ function sparePartsMachineService(client) {
|
|
|
14
14
|
return {
|
|
15
15
|
/**
|
|
16
16
|
Retrieves a specific spare parts machine
|
|
17
|
-
* @param variables
|
|
17
|
+
* @param variables Variables for the machine query — see `machineService.getMachine`
|
|
18
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
19
|
+
* into the request body.
|
|
18
20
|
* @returns Promise<SparePartsMachine> Spare parts machine data
|
|
19
21
|
*/
|
|
20
|
-
async getSparePartsMachine(variables) {
|
|
21
|
-
const
|
|
22
|
+
async getSparePartsMachine(variables, fetchOptions) {
|
|
23
|
+
const language = variables.language ?? client.getDefaultLanguage();
|
|
24
|
+
const result = await (0, runOperation_1.runOperation)(client, machine_1.document, 'machine', { ...variables, language }, fetchOptions);
|
|
22
25
|
return result.data.machine;
|
|
23
26
|
},
|
|
24
27
|
/**
|
|
25
28
|
Retrieves spare parts machines with search criteria
|
|
26
29
|
* @param variables Search input parameters
|
|
30
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
31
|
+
* into the request body.
|
|
27
32
|
* @returns Promise<SparePartsMachineResponse> Spare parts machines response
|
|
28
33
|
*/
|
|
29
|
-
async getSparePartsMachines(variables) {
|
|
30
|
-
const
|
|
34
|
+
async getSparePartsMachines(variables, fetchOptions) {
|
|
35
|
+
const language = variables.language ?? client.getDefaultLanguage();
|
|
36
|
+
const result = await (0, runOperation_1.runOperation)(client, machines_1.document, 'machines', { ...variables, language }, fetchOptions);
|
|
31
37
|
return result.data.machines;
|
|
32
38
|
},
|
|
33
39
|
/**
|
|
@@ -57,14 +63,16 @@ class SparePartsMachineService {
|
|
|
57
63
|
constructor(client) { this._svc = sparePartsMachineService(client); }
|
|
58
64
|
/**
|
|
59
65
|
* Retrieves a specific spare parts machine
|
|
60
|
-
* @param variables
|
|
66
|
+
* @param variables Variables for the machine query
|
|
67
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
61
68
|
*/
|
|
62
|
-
getSparePartsMachine(variables) { return this._svc.getSparePartsMachine(variables); }
|
|
69
|
+
getSparePartsMachine(variables, fetchOptions) { return this._svc.getSparePartsMachine(variables, fetchOptions); }
|
|
63
70
|
/**
|
|
64
71
|
* Retrieves spare parts machines with search criteria
|
|
65
72
|
* @param variables Search input parameters
|
|
73
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
66
74
|
*/
|
|
67
|
-
getSparePartsMachines(variables) { return this._svc.getSparePartsMachines(variables); }
|
|
75
|
+
getSparePartsMachines(variables, fetchOptions) { return this._svc.getSparePartsMachines(variables, fetchOptions); }
|
|
68
76
|
/**
|
|
69
77
|
* Creates a new spare parts machine
|
|
70
78
|
* @param variables Spare parts machine creation input
|
|
@@ -1,65 +1,28 @@
|
|
|
1
1
|
/* Auto-generated. Do not edit. */
|
|
2
2
|
export const document = `fragment SparePartsMachineFields on SparePartsMachine {
|
|
3
|
+
...SparePartsMachineMinimalFields
|
|
4
|
+
sparePartProducts(input: \$sparePartsMachineProductSearchInput) {
|
|
5
|
+
...SparePartsResponseFields
|
|
6
|
+
}
|
|
7
|
+
machines {
|
|
8
|
+
...SparePartsMachineMinimalFields
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
fragment SparePartsMachineMinimalFields on SparePartsMachine {
|
|
3
13
|
id
|
|
4
14
|
media {
|
|
5
15
|
...SparePartsMachineMediaImagesOnlyFields
|
|
6
16
|
}
|
|
7
|
-
|
|
8
|
-
items {
|
|
9
|
-
...SparePartFields
|
|
10
|
-
}
|
|
11
|
-
itemsFound
|
|
12
|
-
offset
|
|
13
|
-
page
|
|
14
|
-
pages
|
|
15
|
-
start
|
|
16
|
-
end
|
|
17
|
-
minPrice
|
|
18
|
-
maxPrice
|
|
19
|
-
filters {
|
|
20
|
-
...AttributeFilterFields
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
name {
|
|
17
|
+
name(language: \$language) {
|
|
24
18
|
...LocalizedStringFields
|
|
25
19
|
}
|
|
26
|
-
description {
|
|
20
|
+
description(language: \$language) {
|
|
27
21
|
...LocalizedStringFields
|
|
28
22
|
}
|
|
29
|
-
slug {
|
|
23
|
+
slug(language: \$language) {
|
|
30
24
|
...LocalizedStringFields
|
|
31
25
|
}
|
|
32
|
-
machines {
|
|
33
|
-
id
|
|
34
|
-
media {
|
|
35
|
-
...SparePartsMachineMediaImagesOnlyFields
|
|
36
|
-
}
|
|
37
|
-
sparePartProducts {
|
|
38
|
-
items {
|
|
39
|
-
...SparePartFields
|
|
40
|
-
}
|
|
41
|
-
itemsFound
|
|
42
|
-
offset
|
|
43
|
-
page
|
|
44
|
-
pages
|
|
45
|
-
start
|
|
46
|
-
end
|
|
47
|
-
minPrice
|
|
48
|
-
maxPrice
|
|
49
|
-
filters {
|
|
50
|
-
...AttributeFilterFields
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
name {
|
|
54
|
-
...LocalizedStringFields
|
|
55
|
-
}
|
|
56
|
-
description {
|
|
57
|
-
...LocalizedStringFields
|
|
58
|
-
}
|
|
59
|
-
slug {
|
|
60
|
-
...LocalizedStringFields
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
26
|
}
|
|
64
27
|
|
|
65
28
|
fragment SparePartsMachineMediaImagesOnlyFields on SparePartsMachineMedia {
|
|
@@ -118,6 +81,23 @@ fragment LocalizedStringArrayFields on LocalizedStringArray {
|
|
|
118
81
|
values
|
|
119
82
|
}
|
|
120
83
|
|
|
84
|
+
fragment SparePartsResponseFields on SparePartsResponse {
|
|
85
|
+
items {
|
|
86
|
+
...SparePartFields
|
|
87
|
+
}
|
|
88
|
+
itemsFound
|
|
89
|
+
offset
|
|
90
|
+
page
|
|
91
|
+
pages
|
|
92
|
+
start
|
|
93
|
+
end
|
|
94
|
+
minPrice
|
|
95
|
+
maxPrice
|
|
96
|
+
filters(input: \$filterAvailableAttributeInput) {
|
|
97
|
+
...AttributeFilterFields
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
121
101
|
fragment SparePartFields on SparePart {
|
|
122
102
|
id
|
|
123
103
|
sku
|
|
@@ -403,7 +383,7 @@ fragment AttributeFilterFields on AttributeFilter {
|
|
|
403
383
|
}
|
|
404
384
|
}
|
|
405
385
|
|
|
406
|
-
query machine(\$id: String, \$slug: String, \$language: String, \$source: String, \$sourceId: String, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
386
|
+
query machine(\$id: String, \$slug: String, \$language: String, \$source: String, \$sourceId: String, \$sparePartsMachineProductSearchInput: SparePartsMachineProductSearchInput, \$filterAvailableAttributeInput: FilterAvailableAttributeInput, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
407
387
|
machine(
|
|
408
388
|
id: \$id
|
|
409
389
|
slug: \$slug
|
|
@@ -1,65 +1,28 @@
|
|
|
1
1
|
/* Auto-generated. Do not edit. */
|
|
2
2
|
export const document = `fragment SparePartsMachineFields on SparePartsMachine {
|
|
3
|
+
...SparePartsMachineMinimalFields
|
|
4
|
+
sparePartProducts(input: \$sparePartsMachineProductSearchInput) {
|
|
5
|
+
...SparePartsResponseFields
|
|
6
|
+
}
|
|
7
|
+
machines {
|
|
8
|
+
...SparePartsMachineMinimalFields
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
fragment SparePartsMachineMinimalFields on SparePartsMachine {
|
|
3
13
|
id
|
|
4
14
|
media {
|
|
5
15
|
...SparePartsMachineMediaImagesOnlyFields
|
|
6
16
|
}
|
|
7
|
-
|
|
8
|
-
items {
|
|
9
|
-
...SparePartFields
|
|
10
|
-
}
|
|
11
|
-
itemsFound
|
|
12
|
-
offset
|
|
13
|
-
page
|
|
14
|
-
pages
|
|
15
|
-
start
|
|
16
|
-
end
|
|
17
|
-
minPrice
|
|
18
|
-
maxPrice
|
|
19
|
-
filters {
|
|
20
|
-
...AttributeFilterFields
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
name {
|
|
17
|
+
name(language: \$language) {
|
|
24
18
|
...LocalizedStringFields
|
|
25
19
|
}
|
|
26
|
-
description {
|
|
20
|
+
description(language: \$language) {
|
|
27
21
|
...LocalizedStringFields
|
|
28
22
|
}
|
|
29
|
-
slug {
|
|
23
|
+
slug(language: \$language) {
|
|
30
24
|
...LocalizedStringFields
|
|
31
25
|
}
|
|
32
|
-
machines {
|
|
33
|
-
id
|
|
34
|
-
media {
|
|
35
|
-
...SparePartsMachineMediaImagesOnlyFields
|
|
36
|
-
}
|
|
37
|
-
sparePartProducts {
|
|
38
|
-
items {
|
|
39
|
-
...SparePartFields
|
|
40
|
-
}
|
|
41
|
-
itemsFound
|
|
42
|
-
offset
|
|
43
|
-
page
|
|
44
|
-
pages
|
|
45
|
-
start
|
|
46
|
-
end
|
|
47
|
-
minPrice
|
|
48
|
-
maxPrice
|
|
49
|
-
filters {
|
|
50
|
-
...AttributeFilterFields
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
name {
|
|
54
|
-
...LocalizedStringFields
|
|
55
|
-
}
|
|
56
|
-
description {
|
|
57
|
-
...LocalizedStringFields
|
|
58
|
-
}
|
|
59
|
-
slug {
|
|
60
|
-
...LocalizedStringFields
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
26
|
}
|
|
64
27
|
|
|
65
28
|
fragment SparePartsMachineMediaImagesOnlyFields on SparePartsMachineMedia {
|
|
@@ -118,6 +81,23 @@ fragment LocalizedStringArrayFields on LocalizedStringArray {
|
|
|
118
81
|
values
|
|
119
82
|
}
|
|
120
83
|
|
|
84
|
+
fragment SparePartsResponseFields on SparePartsResponse {
|
|
85
|
+
items {
|
|
86
|
+
...SparePartFields
|
|
87
|
+
}
|
|
88
|
+
itemsFound
|
|
89
|
+
offset
|
|
90
|
+
page
|
|
91
|
+
pages
|
|
92
|
+
start
|
|
93
|
+
end
|
|
94
|
+
minPrice
|
|
95
|
+
maxPrice
|
|
96
|
+
filters(input: \$filterAvailableAttributeInput) {
|
|
97
|
+
...AttributeFilterFields
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
121
101
|
fragment SparePartFields on SparePart {
|
|
122
102
|
id
|
|
123
103
|
sku
|
|
@@ -403,7 +383,7 @@ fragment AttributeFilterFields on AttributeFilter {
|
|
|
403
383
|
}
|
|
404
384
|
}
|
|
405
385
|
|
|
406
|
-
mutation machineCreate(\$input: CreateSparePartsMachineInput!, \$language: String, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
386
|
+
mutation machineCreate(\$input: CreateSparePartsMachineInput!, \$language: String, \$sparePartsMachineProductSearchInput: SparePartsMachineProductSearchInput, \$filterAvailableAttributeInput: FilterAvailableAttributeInput, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
407
387
|
machineCreate(input: \$input) {
|
|
408
388
|
...SparePartsMachineFields
|
|
409
389
|
}
|
|
@@ -1,65 +1,28 @@
|
|
|
1
1
|
/* Auto-generated. Do not edit. */
|
|
2
2
|
export const document = `fragment SparePartsMachineFields on SparePartsMachine {
|
|
3
|
+
...SparePartsMachineMinimalFields
|
|
4
|
+
sparePartProducts(input: \$sparePartsMachineProductSearchInput) {
|
|
5
|
+
...SparePartsResponseFields
|
|
6
|
+
}
|
|
7
|
+
machines {
|
|
8
|
+
...SparePartsMachineMinimalFields
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
fragment SparePartsMachineMinimalFields on SparePartsMachine {
|
|
3
13
|
id
|
|
4
14
|
media {
|
|
5
15
|
...SparePartsMachineMediaImagesOnlyFields
|
|
6
16
|
}
|
|
7
|
-
|
|
8
|
-
items {
|
|
9
|
-
...SparePartFields
|
|
10
|
-
}
|
|
11
|
-
itemsFound
|
|
12
|
-
offset
|
|
13
|
-
page
|
|
14
|
-
pages
|
|
15
|
-
start
|
|
16
|
-
end
|
|
17
|
-
minPrice
|
|
18
|
-
maxPrice
|
|
19
|
-
filters {
|
|
20
|
-
...AttributeFilterFields
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
name {
|
|
17
|
+
name(language: \$language) {
|
|
24
18
|
...LocalizedStringFields
|
|
25
19
|
}
|
|
26
|
-
description {
|
|
20
|
+
description(language: \$language) {
|
|
27
21
|
...LocalizedStringFields
|
|
28
22
|
}
|
|
29
|
-
slug {
|
|
23
|
+
slug(language: \$language) {
|
|
30
24
|
...LocalizedStringFields
|
|
31
25
|
}
|
|
32
|
-
machines {
|
|
33
|
-
id
|
|
34
|
-
media {
|
|
35
|
-
...SparePartsMachineMediaImagesOnlyFields
|
|
36
|
-
}
|
|
37
|
-
sparePartProducts {
|
|
38
|
-
items {
|
|
39
|
-
...SparePartFields
|
|
40
|
-
}
|
|
41
|
-
itemsFound
|
|
42
|
-
offset
|
|
43
|
-
page
|
|
44
|
-
pages
|
|
45
|
-
start
|
|
46
|
-
end
|
|
47
|
-
minPrice
|
|
48
|
-
maxPrice
|
|
49
|
-
filters {
|
|
50
|
-
...AttributeFilterFields
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
name {
|
|
54
|
-
...LocalizedStringFields
|
|
55
|
-
}
|
|
56
|
-
description {
|
|
57
|
-
...LocalizedStringFields
|
|
58
|
-
}
|
|
59
|
-
slug {
|
|
60
|
-
...LocalizedStringFields
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
26
|
}
|
|
64
27
|
|
|
65
28
|
fragment SparePartsMachineMediaImagesOnlyFields on SparePartsMachineMedia {
|
|
@@ -118,6 +81,23 @@ fragment LocalizedStringArrayFields on LocalizedStringArray {
|
|
|
118
81
|
values
|
|
119
82
|
}
|
|
120
83
|
|
|
84
|
+
fragment SparePartsResponseFields on SparePartsResponse {
|
|
85
|
+
items {
|
|
86
|
+
...SparePartFields
|
|
87
|
+
}
|
|
88
|
+
itemsFound
|
|
89
|
+
offset
|
|
90
|
+
page
|
|
91
|
+
pages
|
|
92
|
+
start
|
|
93
|
+
end
|
|
94
|
+
minPrice
|
|
95
|
+
maxPrice
|
|
96
|
+
filters(input: \$filterAvailableAttributeInput) {
|
|
97
|
+
...AttributeFilterFields
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
121
101
|
fragment SparePartFields on SparePart {
|
|
122
102
|
id
|
|
123
103
|
sku
|
|
@@ -403,7 +383,7 @@ fragment AttributeFilterFields on AttributeFilter {
|
|
|
403
383
|
}
|
|
404
384
|
}
|
|
405
385
|
|
|
406
|
-
mutation machineUpsert(\$input: UpsertSparePartsMachineInput!, \$language: String, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
386
|
+
mutation machineUpsert(\$input: UpsertSparePartsMachineInput!, \$language: String, \$sparePartsMachineProductSearchInput: SparePartsMachineProductSearchInput, \$filterAvailableAttributeInput: FilterAvailableAttributeInput, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
407
387
|
machineUpsert(input: \$input) {
|
|
408
388
|
...SparePartsMachineFields
|
|
409
389
|
}
|
|
@@ -12,66 +12,29 @@ export const document = `fragment SparePartsMachineResponseFields on SparePartsM
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
fragment SparePartsMachineFields on SparePartsMachine {
|
|
15
|
+
...SparePartsMachineMinimalFields
|
|
16
|
+
sparePartProducts(input: \$sparePartsMachineProductSearchInput) {
|
|
17
|
+
...SparePartsResponseFields
|
|
18
|
+
}
|
|
19
|
+
machines {
|
|
20
|
+
...SparePartsMachineMinimalFields
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
fragment SparePartsMachineMinimalFields on SparePartsMachine {
|
|
15
25
|
id
|
|
16
26
|
media {
|
|
17
27
|
...SparePartsMachineMediaImagesOnlyFields
|
|
18
28
|
}
|
|
19
|
-
|
|
20
|
-
items {
|
|
21
|
-
...SparePartFields
|
|
22
|
-
}
|
|
23
|
-
itemsFound
|
|
24
|
-
offset
|
|
25
|
-
page
|
|
26
|
-
pages
|
|
27
|
-
start
|
|
28
|
-
end
|
|
29
|
-
minPrice
|
|
30
|
-
maxPrice
|
|
31
|
-
filters {
|
|
32
|
-
...AttributeFilterFields
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
name {
|
|
29
|
+
name(language: \$language) {
|
|
36
30
|
...LocalizedStringFields
|
|
37
31
|
}
|
|
38
|
-
description {
|
|
32
|
+
description(language: \$language) {
|
|
39
33
|
...LocalizedStringFields
|
|
40
34
|
}
|
|
41
|
-
slug {
|
|
35
|
+
slug(language: \$language) {
|
|
42
36
|
...LocalizedStringFields
|
|
43
37
|
}
|
|
44
|
-
machines {
|
|
45
|
-
id
|
|
46
|
-
media {
|
|
47
|
-
...SparePartsMachineMediaImagesOnlyFields
|
|
48
|
-
}
|
|
49
|
-
sparePartProducts {
|
|
50
|
-
items {
|
|
51
|
-
...SparePartFields
|
|
52
|
-
}
|
|
53
|
-
itemsFound
|
|
54
|
-
offset
|
|
55
|
-
page
|
|
56
|
-
pages
|
|
57
|
-
start
|
|
58
|
-
end
|
|
59
|
-
minPrice
|
|
60
|
-
maxPrice
|
|
61
|
-
filters {
|
|
62
|
-
...AttributeFilterFields
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
name {
|
|
66
|
-
...LocalizedStringFields
|
|
67
|
-
}
|
|
68
|
-
description {
|
|
69
|
-
...LocalizedStringFields
|
|
70
|
-
}
|
|
71
|
-
slug {
|
|
72
|
-
...LocalizedStringFields
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
38
|
}
|
|
76
39
|
|
|
77
40
|
fragment SparePartsMachineMediaImagesOnlyFields on SparePartsMachineMedia {
|
|
@@ -130,6 +93,23 @@ fragment LocalizedStringArrayFields on LocalizedStringArray {
|
|
|
130
93
|
values
|
|
131
94
|
}
|
|
132
95
|
|
|
96
|
+
fragment SparePartsResponseFields on SparePartsResponse {
|
|
97
|
+
items {
|
|
98
|
+
...SparePartFields
|
|
99
|
+
}
|
|
100
|
+
itemsFound
|
|
101
|
+
offset
|
|
102
|
+
page
|
|
103
|
+
pages
|
|
104
|
+
start
|
|
105
|
+
end
|
|
106
|
+
minPrice
|
|
107
|
+
maxPrice
|
|
108
|
+
filters(input: \$filterAvailableAttributeInput) {
|
|
109
|
+
...AttributeFilterFields
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
133
113
|
fragment SparePartFields on SparePart {
|
|
134
114
|
id
|
|
135
115
|
sku
|
|
@@ -415,7 +395,7 @@ fragment AttributeFilterFields on AttributeFilter {
|
|
|
415
395
|
}
|
|
416
396
|
}
|
|
417
397
|
|
|
418
|
-
query machines(\$input: SearchSparePartsMachineInput, \$language: String, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
398
|
+
query machines(\$input: SearchSparePartsMachineInput, \$language: String, \$sparePartsMachineProductSearchInput: SparePartsMachineProductSearchInput, \$filterAvailableAttributeInput: FilterAvailableAttributeInput, \$imageVariantFilters: TransformationsInput!, \$priceCalculateProductInput: PriceCalculateProductInput, \$imageSearchFilters: MediaImageProductSearchInput) {
|
|
419
399
|
machines(input: \$input) {
|
|
420
400
|
...SparePartsMachineResponseFields
|
|
421
401
|
}
|
|
@@ -10,20 +10,35 @@ export function machineService(client) {
|
|
|
10
10
|
return {
|
|
11
11
|
/**
|
|
12
12
|
Retrieves a specific machine
|
|
13
|
-
* @param variables
|
|
13
|
+
* @param variables Variables for the machine query
|
|
14
|
+
* - id: string - Machine ID to fetch
|
|
15
|
+
* - slug: string - Machine slug to fetch
|
|
16
|
+
* - source / sourceId: string - External source / source identifier pair
|
|
17
|
+
* - language: string - Language for localized content
|
|
18
|
+
* - sparePartsMachineProductSearchInput: SparePartsMachineProductSearchInput -
|
|
19
|
+
* Search/filter/sort/paging input for the machine's `sparePartProducts`
|
|
20
|
+
* - priceCalculateProductInput: PriceCalculateProductInput - Price calculation input
|
|
21
|
+
* - imageSearchFilters: MediaImageProductSearchInput - Image search filters
|
|
22
|
+
* - imageVariantFilters: TransformationsInput! - Image transformation filters
|
|
23
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
24
|
+
* into the request body.
|
|
14
25
|
* @returns Promise<SparePartsMachine> Machine data
|
|
15
26
|
*/
|
|
16
|
-
async getMachine(variables) {
|
|
17
|
-
const
|
|
27
|
+
async getMachine(variables, fetchOptions) {
|
|
28
|
+
const language = variables.language ?? client.getDefaultLanguage();
|
|
29
|
+
const result = await runOperation(client, machineDoc, 'machine', { ...variables, language }, fetchOptions);
|
|
18
30
|
return result.data.machine;
|
|
19
31
|
},
|
|
20
32
|
/**
|
|
21
33
|
Retrieves machines with search criteria
|
|
22
34
|
* @param variables Search input parameters
|
|
35
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags). Never serialised
|
|
36
|
+
* into the request body.
|
|
23
37
|
* @returns Promise<SparePartsMachineResponse> Machines response
|
|
24
38
|
*/
|
|
25
|
-
async getMachines(variables) {
|
|
26
|
-
const
|
|
39
|
+
async getMachines(variables, fetchOptions) {
|
|
40
|
+
const language = variables.language ?? client.getDefaultLanguage();
|
|
41
|
+
const result = await runOperation(client, machinesDoc, 'machines', { ...variables, language }, fetchOptions);
|
|
27
42
|
return result.data.machines;
|
|
28
43
|
},
|
|
29
44
|
/**
|
|
@@ -53,14 +68,16 @@ export class MachineService {
|
|
|
53
68
|
constructor(client) { this._svc = machineService(client); }
|
|
54
69
|
/**
|
|
55
70
|
* Retrieves a specific machine
|
|
56
|
-
* @param variables
|
|
71
|
+
* @param variables Variables for the machine query
|
|
72
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
57
73
|
*/
|
|
58
|
-
getMachine(variables) { return this._svc.getMachine(variables); }
|
|
74
|
+
getMachine(variables, fetchOptions) { return this._svc.getMachine(variables, fetchOptions); }
|
|
59
75
|
/**
|
|
60
76
|
* Retrieves machines with search criteria
|
|
61
77
|
* @param variables Search input parameters
|
|
78
|
+
* @param fetchOptions Transport-level hints (e.g. cache tags)
|
|
62
79
|
*/
|
|
63
|
-
getMachines(variables) { return this._svc.getMachines(variables); }
|
|
80
|
+
getMachines(variables, fetchOptions) { return this._svc.getMachines(variables, fetchOptions); }
|
|
64
81
|
/**
|
|
65
82
|
* Creates a new machine
|
|
66
83
|
* @param variables Machine creation input
|