@sixtyninecommerce/admin 0.10.0 → 0.11.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 +4347 -171
- package/dist/catalog/assets.d.ts +120 -8
- package/dist/catalog/assets.js +98 -12
- package/dist/catalog/collections.d.ts +279 -14
- package/dist/catalog/collections.js +246 -15
- package/dist/catalog/index.d.ts +9 -2
- package/dist/catalog/index.js +4 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +102 -14
- package/dist/catalog/properties.js +13 -0
- package/dist/catalog/recommendations.d.ts +261 -0
- package/dist/catalog/recommendations.js +145 -0
- package/dist/catalog/reviews.d.ts +368 -0
- package/dist/catalog/reviews.js +318 -0
- package/dist/catalog/types.d.ts +17 -1
- package/dist/catalog/types.js +10 -0
- package/dist/catalog/variant-find.d.ts +136 -0
- package/dist/catalog/variant-find.js +239 -0
- package/dist/catalog/variants.d.ts +233 -26
- package/dist/catalog/variants.js +125 -7
- package/dist/catalog/visibility.d.ts +20 -5
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +95 -9
- package/dist/client.js +35 -7
- package/dist/content/assets.d.ts +286 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/items.d.ts +269 -0
- package/dist/content/items.js +170 -0
- package/dist/content/types.d.ts +282 -0
- package/dist/content/types.js +100 -0
- package/dist/customers/age-verification.d.ts +66 -0
- package/dist/customers/age-verification.js +79 -0
- package/dist/customers/credit.d.ts +263 -0
- package/dist/customers/credit.js +244 -0
- package/dist/customers/delivery-preferences.d.ts +120 -0
- package/dist/customers/delivery-preferences.js +97 -0
- package/dist/customers/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +447 -37
- package/dist/customers/index.js +313 -40
- package/dist/customers/invitation-status.d.ts +57 -0
- package/dist/customers/invitation-status.js +21 -0
- package/dist/customers/notes.d.ts +67 -0
- package/dist/customers/notes.js +51 -0
- package/dist/customers/notification-recipients.d.ts +97 -0
- package/dist/customers/notification-recipients.js +84 -0
- package/dist/customers/saved-lists.d.ts +42 -0
- package/dist/customers/saved-lists.js +61 -0
- package/dist/customers/vat.d.ts +83 -0
- package/dist/customers/vat.js +46 -0
- package/dist/customers/wire.d.ts +20 -0
- package/dist/customers/wire.js +35 -0
- package/dist/documents/ar.d.ts +307 -0
- package/dist/documents/ar.js +254 -0
- package/dist/documents/index.d.ts +731 -21
- package/dist/documents/index.js +436 -24
- package/dist/documents/pdf.d.ts +2 -0
- package/dist/documents/pdf.js +11 -0
- package/dist/fulfillments/create.d.ts +167 -0
- package/dist/fulfillments/create.js +216 -0
- package/dist/fulfillments/index.d.ts +44 -10
- package/dist/fulfillments/index.js +11 -2
- package/dist/fulfillments/payment-policy.d.ts +64 -0
- package/dist/fulfillments/payment-policy.js +140 -0
- package/dist/fulfillments/warehouse.d.ts +724 -0
- package/dist/fulfillments/warehouse.js +914 -0
- package/dist/geo/index.d.ts +119 -0
- package/dist/geo/index.js +107 -0
- package/dist/index.d.ts +123 -35
- package/dist/index.js +45 -12
- package/dist/integrations/afas-actions.d.ts +234 -0
- package/dist/integrations/afas-actions.js +310 -0
- package/dist/integrations/afas-types.d.ts +483 -0
- package/dist/integrations/afas-types.js +5 -0
- package/dist/integrations/afas.d.ts +234 -0
- package/dist/integrations/afas.js +290 -0
- package/dist/integrations/connections.d.ts +103 -0
- package/dist/integrations/connections.js +55 -0
- package/dist/integrations/esp.d.ts +313 -0
- package/dist/integrations/esp.js +169 -0
- package/dist/integrations/exact-online-types.d.ts +423 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +248 -0
- package/dist/integrations/exact-online.js +376 -0
- package/dist/integrations/index.d.ts +29 -3
- package/dist/integrations/index.js +18 -3
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipelines.d.ts +15 -14
- package/dist/integrations/pipelines.js +6 -22
- package/dist/integrations/types.d.ts +146 -0
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +162 -0
- package/dist/orders/cancel-with-money.d.ts +227 -0
- package/dist/orders/cancel-with-money.js +153 -0
- package/dist/orders/commit-edit.d.ts +7 -1
- package/dist/orders/commit-edit.js +5 -1
- package/dist/orders/drafts.d.ts +800 -0
- package/dist/orders/drafts.js +771 -0
- package/dist/orders/fields.d.ts +245 -0
- package/dist/orders/fields.js +188 -0
- package/dist/orders/get.d.ts +29 -19
- package/dist/orders/get.js +17 -8
- package/dist/orders/index.d.ts +49 -9
- package/dist/orders/index.js +22 -2
- package/dist/orders/lifecycle.d.ts +128 -0
- package/dist/orders/lifecycle.js +158 -0
- package/dist/orders/line-price-preview.d.ts +7 -2
- package/dist/orders/list.d.ts +222 -0
- package/dist/orders/list.js +377 -0
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +1 -1
- package/dist/orders/plan-edit.js +4 -1
- package/dist/orders/settings.d.ts +201 -0
- package/dist/orders/settings.js +325 -0
- package/dist/orders/status.d.ts +159 -13
- package/dist/orders/status.js +21 -0
- package/dist/orders/surcharges.d.ts +8 -1
- package/dist/orders/surcharges.js +3 -2
- package/dist/payments/account-credit.d.ts +30 -0
- package/dist/payments/account-credit.js +19 -0
- package/dist/payments/ar.d.ts +292 -0
- package/dist/payments/ar.js +223 -0
- package/dist/payments/connected-account.d.ts +47 -0
- package/dist/payments/connected-account.js +61 -0
- package/dist/payments/credit-noted-fields.d.ts +12 -0
- package/dist/payments/credit-noted-fields.js +37 -0
- package/dist/payments/index.d.ts +257 -11
- package/dist/payments/index.js +131 -1
- package/dist/payments/methods.d.ts +303 -8
- package/dist/payments/methods.js +337 -7
- package/dist/payments/mollie-methods.d.ts +159 -0
- package/dist/payments/mollie-methods.js +141 -0
- package/dist/payments/payment-links.d.ts +180 -0
- package/dist/payments/payment-links.js +97 -0
- package/dist/payments/provider-keys.d.ts +150 -0
- package/dist/payments/provider-keys.js +118 -0
- package/dist/payments/providers.d.ts +86 -11
- package/dist/payments/providers.js +29 -0
- package/dist/payments/requests.d.ts +144 -0
- package/dist/payments/requests.js +92 -0
- package/dist/payments/store-credit-fields.d.ts +15 -0
- package/dist/payments/store-credit-fields.js +51 -0
- package/dist/pickups/index.d.ts +104 -0
- package/dist/pickups/index.js +105 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +154 -0
- package/dist/platform/tax.js +139 -0
- package/dist/pos/anomalies.d.ts +158 -0
- package/dist/pos/anomalies.js +64 -0
- package/dist/pos/assisted-selling.d.ts +79 -0
- package/dist/pos/assisted-selling.js +38 -0
- package/dist/pos/exchanges.d.ts +103 -0
- package/dist/pos/exchanges.js +22 -0
- package/dist/pos/gift-cards.d.ts +135 -0
- package/dist/pos/gift-cards.js +47 -0
- package/dist/pos/index.d.ts +2125 -32
- package/dist/pos/index.js +742 -4
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +187 -0
- package/dist/pos/offline-sales.js +116 -0
- package/dist/pos/pay-by-link.d.ts +143 -0
- package/dist/pos/pay-by-link.js +57 -0
- package/dist/pos/quick-keys.d.ts +103 -0
- package/dist/pos/quick-keys.js +45 -0
- package/dist/pos/reports.d.ts +360 -0
- package/dist/pos/reports.js +62 -0
- package/dist/pos/returns.d.ts +217 -0
- package/dist/pos/returns.js +53 -0
- package/dist/pricing/bulk-coupons.d.ts +139 -0
- package/dist/pricing/bulk-coupons.js +112 -0
- package/dist/pricing/index.d.ts +174 -4
- package/dist/pricing/index.js +174 -1
- package/dist/pricing/price-lists.d.ts +604 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +89 -0
- package/dist/purchasing/alerts.js +62 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +36 -0
- package/dist/purchasing/index.js +16 -0
- package/dist/purchasing/purchase-orders.d.ts +548 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -0
- package/dist/purchasing/settings.d.ts +152 -0
- package/dist/purchasing/settings.js +181 -0
- package/dist/purchasing/suppliers.d.ts +476 -0
- package/dist/purchasing/suppliers.js +438 -0
- package/dist/quotes/index.d.ts +501 -0
- package/dist/quotes/index.js +439 -0
- package/dist/reports/index.d.ts +71 -8
- package/dist/reports/index.js +74 -11
- package/dist/returns/index.d.ts +614 -21
- package/dist/returns/index.js +695 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -0
- package/dist/shipping/definitions.d.ts +29 -0
- package/dist/shipping/definitions.js +47 -0
- package/dist/shipping/fulfillment-profiles.d.ts +174 -0
- package/dist/shipping/fulfillment-profiles.js +104 -0
- package/dist/shipping/hendriks.d.ts +97 -0
- package/dist/shipping/hendriks.js +50 -0
- package/dist/shipping/index.d.ts +48 -0
- package/dist/shipping/index.js +25 -0
- package/dist/shipping/methods.d.ts +198 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +254 -0
- package/dist/shipping/myparcel.js +178 -0
- package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
- package/dist/shipping/parcel-rule.d.ts +6 -5
- package/dist/shipping/parcel-rule.js +21 -23
- package/dist/shipping/rate-tables.d.ts +179 -0
- package/dist/shipping/rate-tables.js +184 -0
- package/dist/stock/index.d.ts +10 -3
- package/dist/stock/index.js +3 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/transfers.d.ts +216 -43
- package/dist/stock/transfers.js +140 -13
- package/dist/stored-value/index.d.ts +214 -4
- package/dist/stored-value/index.js +152 -0
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/index.d.ts +76 -1
- package/dist/tax/index.js +50 -0
- package/dist/tenant/email-style.d.ts +102 -0
- package/dist/tenant/email-style.js +72 -0
- package/dist/tenant/email-templates.d.ts +66 -0
- package/dist/tenant/email-templates.js +54 -0
- package/dist/tenant/notifications.d.ts +23 -17
- package/dist/tenant/settings-sources.d.ts +1 -1
- package/dist/tenant/time-zone.d.ts +17 -0
- package/dist/tenant/time-zone.js +11 -0
- package/dist/types.d.ts +50 -3
- package/dist/users/index.d.ts +3 -0
- package/dist/users/index.js +2 -0
- package/dist/users/warehouses.d.ts +50 -0
- package/dist/users/warehouses.js +51 -0
- package/package.json +2 -2
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { assertDeleted, DELETION_FIELDS, fieldOf } from './types.js';
|
|
2
|
+
/** The source types whose entry names a row (`sourceId`); the others must name none. */
|
|
3
|
+
export const RECOMMENDATION_SOURCE_TYPES_WITH_ID = [
|
|
4
|
+
'PRODUCT',
|
|
5
|
+
'COLLECTION',
|
|
6
|
+
'FACET_VALUE',
|
|
7
|
+
];
|
|
8
|
+
const ENTRY_FIELDS = /* GraphQL */ `
|
|
9
|
+
id
|
|
10
|
+
groupId
|
|
11
|
+
sourceType
|
|
12
|
+
sourceId
|
|
13
|
+
position
|
|
14
|
+
createdAt
|
|
15
|
+
updatedAt
|
|
16
|
+
`;
|
|
17
|
+
const GROUP_SUMMARY_FIELDS = /* GraphQL */ `
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
slug
|
|
21
|
+
description
|
|
22
|
+
maxItems
|
|
23
|
+
position
|
|
24
|
+
enabled
|
|
25
|
+
mode
|
|
26
|
+
createdAt
|
|
27
|
+
updatedAt
|
|
28
|
+
`;
|
|
29
|
+
const GROUP_FIELDS = /* GraphQL */ `
|
|
30
|
+
${GROUP_SUMMARY_FIELDS}
|
|
31
|
+
entries { ${ENTRY_FIELDS} }
|
|
32
|
+
`;
|
|
33
|
+
export const RECOMMENDATION_GROUPS_QUERY = /* GraphQL */ `
|
|
34
|
+
query CatalogRecommendationGroups {
|
|
35
|
+
recommendationGroups { ${GROUP_FIELDS} }
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
export const RECOMMENDATION_GROUP_QUERY = /* GraphQL */ `
|
|
39
|
+
query CatalogRecommendationGroup($id: ID!) {
|
|
40
|
+
recommendationGroup(id: $id) { ${GROUP_FIELDS} }
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
export const CREATE_RECOMMENDATION_GROUP_MUTATION = /* GraphQL */ `
|
|
44
|
+
mutation CatalogCreateRecommendationGroup($input: CreateRecommendationGroupInput!) {
|
|
45
|
+
createRecommendationGroup(input: $input) { ${GROUP_FIELDS} }
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
export const UPDATE_RECOMMENDATION_GROUP_MUTATION = /* GraphQL */ `
|
|
49
|
+
mutation CatalogUpdateRecommendationGroup($id: ID!, $input: UpdateRecommendationGroupInput!) {
|
|
50
|
+
updateRecommendationGroup(id: $id, input: $input) { ${GROUP_FIELDS} }
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
export const DELETE_RECOMMENDATION_GROUP_MUTATION = /* GraphQL */ `
|
|
54
|
+
mutation CatalogDeleteRecommendationGroup($id: ID!) {
|
|
55
|
+
deleteRecommendationGroup(id: $id) { ${DELETION_FIELDS} }
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export const REORDER_RECOMMENDATION_GROUPS_MUTATION = /* GraphQL */ `
|
|
59
|
+
mutation CatalogReorderRecommendationGroups($ids: [ID!]!) {
|
|
60
|
+
reorderRecommendationGroups(ids: $ids) { ${GROUP_FIELDS} }
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
export const CREATE_RECOMMENDATION_ENTRY_MUTATION = /* GraphQL */ `
|
|
64
|
+
mutation CatalogCreateRecommendationEntry($input: CreateRecommendationEntryInput!) {
|
|
65
|
+
createRecommendationEntry(input: $input) { ${ENTRY_FIELDS} }
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
export const UPDATE_RECOMMENDATION_ENTRY_MUTATION = /* GraphQL */ `
|
|
69
|
+
mutation CatalogUpdateRecommendationEntry($id: ID!, $input: UpdateRecommendationEntryInput!) {
|
|
70
|
+
updateRecommendationEntry(id: $id, input: $input) { ${ENTRY_FIELDS} }
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
export const DELETE_RECOMMENDATION_ENTRY_MUTATION = /* GraphQL */ `
|
|
74
|
+
mutation CatalogDeleteRecommendationEntry($id: ID!) {
|
|
75
|
+
deleteRecommendationEntry(id: $id) { ${DELETION_FIELDS} }
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
export const REORDER_RECOMMENDATION_ENTRIES_MUTATION = /* GraphQL */ `
|
|
79
|
+
mutation CatalogReorderRecommendationEntries($groupId: ID!, $ids: [ID!]!) {
|
|
80
|
+
reorderRecommendationEntries(groupId: $groupId, ids: $ids) { ${ENTRY_FIELDS} }
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
// The engine does not load `entries` for these groups (a MANUAL group has none), and selecting a
|
|
84
|
+
// non-null field it did not load fails the whole read: never add `entries` here.
|
|
85
|
+
export const PRODUCT_MANUAL_RECOMMENDATIONS_QUERY = /* GraphQL */ `
|
|
86
|
+
query CatalogProductManualRecommendations($productId: ID!) {
|
|
87
|
+
productManualRecommendations(productId: $productId) {
|
|
88
|
+
group { ${GROUP_SUMMARY_FIELDS} }
|
|
89
|
+
productIds
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
export const SET_PRODUCT_MANUAL_RECOMMENDATIONS_MUTATION = /* GraphQL */ `
|
|
94
|
+
mutation CatalogSetProductManualRecommendations(
|
|
95
|
+
$productId: ID!
|
|
96
|
+
$groupId: ID!
|
|
97
|
+
$targetProductIds: [ID!]!
|
|
98
|
+
) {
|
|
99
|
+
setProductManualRecommendations(
|
|
100
|
+
productId: $productId
|
|
101
|
+
groupId: $groupId
|
|
102
|
+
targetProductIds: $targetProductIds
|
|
103
|
+
) { ${GROUP_SUMMARY_FIELDS} }
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
/** Entries in `position` order, the older first on a tie, as the engine's own entry reads sort. */
|
|
107
|
+
function byPosition(entries) {
|
|
108
|
+
return [...entries].sort((a, b) => a.position - b.position || a.createdAt.localeCompare(b.createdAt));
|
|
109
|
+
}
|
|
110
|
+
// The engine's group list loads `entries` without an order; only its one-group read sorts them.
|
|
111
|
+
function withSortedEntries(group) {
|
|
112
|
+
return { ...group, entries: byPosition(group.entries) };
|
|
113
|
+
}
|
|
114
|
+
export function createRecommendationsModule(transport) {
|
|
115
|
+
const call = (document, field, variables, options) => fieldOf(transport, document, field, variables, options);
|
|
116
|
+
return {
|
|
117
|
+
groups: {
|
|
118
|
+
list: async (options) => (await call(RECOMMENDATION_GROUPS_QUERY, 'recommendationGroups', {}, options)).map(withSortedEntries),
|
|
119
|
+
async get(id, options) {
|
|
120
|
+
const group = await call(RECOMMENDATION_GROUP_QUERY, 'recommendationGroup', { id }, options);
|
|
121
|
+
return group === null ? null : withSortedEntries(group);
|
|
122
|
+
},
|
|
123
|
+
create: async (input, options) => withSortedEntries(await call(CREATE_RECOMMENDATION_GROUP_MUTATION, 'createRecommendationGroup', { input }, options)),
|
|
124
|
+
update: async (id, input, options) => withSortedEntries(await call(UPDATE_RECOMMENDATION_GROUP_MUTATION, 'updateRecommendationGroup', { id, input }, options)),
|
|
125
|
+
async delete(id, options) {
|
|
126
|
+
const response = await call(DELETE_RECOMMENDATION_GROUP_MUTATION, 'deleteRecommendationGroup', { id }, options);
|
|
127
|
+
assertDeleted('RECOMMENDATION_GROUP_NOT_DELETED', [response]);
|
|
128
|
+
},
|
|
129
|
+
reorder: async (ids, options) => (await call(REORDER_RECOMMENDATION_GROUPS_MUTATION, 'reorderRecommendationGroups', { ids }, options)).map(withSortedEntries),
|
|
130
|
+
},
|
|
131
|
+
entries: {
|
|
132
|
+
create: (input, options) => call(CREATE_RECOMMENDATION_ENTRY_MUTATION, 'createRecommendationEntry', { input }, options),
|
|
133
|
+
update: (id, input, options) => call(UPDATE_RECOMMENDATION_ENTRY_MUTATION, 'updateRecommendationEntry', { id, input }, options),
|
|
134
|
+
async delete(id, options) {
|
|
135
|
+
const response = await call(DELETE_RECOMMENDATION_ENTRY_MUTATION, 'deleteRecommendationEntry', { id }, options);
|
|
136
|
+
assertDeleted('RECOMMENDATION_ENTRY_NOT_DELETED', [response]);
|
|
137
|
+
},
|
|
138
|
+
reorder: (groupId, ids, options) => call(REORDER_RECOMMENDATION_ENTRIES_MUTATION, 'reorderRecommendationEntries', { groupId, ids }, options),
|
|
139
|
+
},
|
|
140
|
+
manual: {
|
|
141
|
+
get: (productId, options) => call(PRODUCT_MANUAL_RECOMMENDATIONS_QUERY, 'productManualRecommendations', { productId }, options),
|
|
142
|
+
set: (productId, groupId, productIds, options) => call(SET_PRODUCT_MANUAL_RECOMMENDATIONS_MUTATION, 'setProductManualRecommendations', { productId, groupId, targetProductIds: productIds }, options),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product reviews (headless spec §9.2 `catalog`: "reviews moderation"; W10-117): the reviews the
|
|
3
|
+
* store's customers wrote, moderating them (what the storefront shows under the store's name),
|
|
4
|
+
* the store's reply to one, the review statistics, and the review attributes (the questions a
|
|
5
|
+
* review form asks: "Quality", "Fit", …).
|
|
6
|
+
*
|
|
7
|
+
* - **What the storefront shows**: only `APPROVED` reviews, with the reviewer's display name,
|
|
8
|
+
* rating, title, text, attribute answers and the store's reply. `PENDING` (waiting), `FLAGGED`
|
|
9
|
+
* (the automatic checks or a shopper's report asked for a look) and `REJECTED` reviews are never
|
|
10
|
+
* shown. Approving publishes the review; rejecting, flagging or re-opening it (`PENDING`) takes it
|
|
11
|
+
* off. Each moderation is recorded in the review's moderation log with the staff member and the
|
|
12
|
+
* reason given.
|
|
13
|
+
* - **The reply** is the store's own text, shown under an approved review on the storefront.
|
|
14
|
+
*
|
|
15
|
+
* Customer data (headless spec §6.3): an app installation below `customerData: full` reads every
|
|
16
|
+
* review with what the customer typed blanked: `title`, `body`, `attributeValues` (ratings and
|
|
17
|
+
* self-declared details such as an age band) and `ipAddressHash`, the edit history's previous
|
|
18
|
+
* texts and the moderation log's reasons and AI analysis answer `null`, and so does
|
|
19
|
+
* `customerDisplayName` below `identity`. Every record of such an answer carries `redacted: true`,
|
|
20
|
+
* so a blanked field never reads as "the customer wrote none". A `search` below `full` is refused
|
|
21
|
+
* `CUSTOMER_DATA_NOT_GRANTED` (`PermissionDeniedError`, 403). The answers of the writes are
|
|
22
|
+
* blanked the same way.
|
|
23
|
+
*
|
|
24
|
+
* Permissions: reads need `ReadCatalog`, writes `UpdateCatalog`. Every row is the store's own: a
|
|
25
|
+
* review or attribute of another store is never answered and never changed.
|
|
26
|
+
*
|
|
27
|
+
* Refusals, GraphQL errors mapped by `core`. An unknown id and another store's get the same
|
|
28
|
+
* answer, so none tells whether another store holds the row:
|
|
29
|
+
* - `ENTITY_NOT_FOUND` → `NotFoundError` (404): a review or attribute the store does not have. An
|
|
30
|
+
* id that is not a uuid gets it too, before anything is read.
|
|
31
|
+
* - `REVIEW_ATTRIBUTE_SLUG_TAKEN` → `ConflictError` (409): another of the store's attributes holds
|
|
32
|
+
* the slug, the one derived from the label included, also when two writes race for it.
|
|
33
|
+
* - `REVIEW_ATTRIBUTE_COLLECTION_NOT_FOUND` → `NotFoundError` (404): `attributes.setCollections`
|
|
34
|
+
* named a collection the store does not hold, each in `details` (`field` `/collectionIds/<i>`).
|
|
35
|
+
* - `BULK_ACTION_INPUT_INVALID` → `ValidationError` (400): a `bulkModerate` selection of no
|
|
36
|
+
* review, more than {@link MAX_BULK_REVIEWS} or one twice, refused before anything is sent.
|
|
37
|
+
* - `USER_INPUT_ERROR` → `ValidationError` (400), in the engine's words: a reply over 2,000
|
|
38
|
+
* characters, an attribute type other than `rating` / `selection`, a selection with fewer than
|
|
39
|
+
* two options.
|
|
40
|
+
* - `FORBIDDEN` → `PermissionDeniedError` (403) without the permission.
|
|
41
|
+
*
|
|
42
|
+
* Release: `bulkModerate` needs a platform release with `moderateReviews` (deploy vendure-server
|
|
43
|
+
* first: an older one refuses the document). Every other method is served by every release this
|
|
44
|
+
* SDK supports; an older release answers each not-found and a taken slug as `USER_INPUT_ERROR`
|
|
45
|
+
* (400), a taken slug as an uncoded database error, and takes another store's collection in
|
|
46
|
+
* `setCollections`. No method deduplicates on `idempotencyKey`.
|
|
47
|
+
*/
|
|
48
|
+
import { type Page, type Transport } from '@sixtyninecommerce/core';
|
|
49
|
+
import type { Call } from '../types.js';
|
|
50
|
+
export type ReviewStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'FLAGGED';
|
|
51
|
+
export declare const REVIEW_STATUSES: readonly ReviewStatus[];
|
|
52
|
+
/** The admin list's orders; ties go to the newer review. */
|
|
53
|
+
export type ReviewSortKey = 'NEWEST' | 'OLDEST' | 'HIGHEST_RATING' | 'LOWEST_RATING' | 'MOST_HELPFUL';
|
|
54
|
+
/** How many reviews one list page holds at most: the engine answers no more. */
|
|
55
|
+
export declare const MAX_REVIEW_PAGE_SIZE = 50;
|
|
56
|
+
/** How many reviews one `bulkModerate` call may name. */
|
|
57
|
+
export declare const MAX_BULK_REVIEWS = 100;
|
|
58
|
+
/** A review as the list and the writes answer it. */
|
|
59
|
+
export interface ProductReviewSummary {
|
|
60
|
+
id: string;
|
|
61
|
+
channelId: string;
|
|
62
|
+
customerId: string;
|
|
63
|
+
productId: string;
|
|
64
|
+
/** The product's name in the request's language (any language when it has none); null when gone. */
|
|
65
|
+
productName: string | null;
|
|
66
|
+
variantId: string | null;
|
|
67
|
+
/** 1 to 5; null when the store asks for no rating. */
|
|
68
|
+
rating: number | null;
|
|
69
|
+
title: string | null;
|
|
70
|
+
body: string | null;
|
|
71
|
+
status: ReviewStatus;
|
|
72
|
+
/** True when the customer had an order with this product when they wrote it. */
|
|
73
|
+
isVerifiedPurchase: boolean;
|
|
74
|
+
/** ISO-8601 UTC. */
|
|
75
|
+
purchaseDate: string | null;
|
|
76
|
+
/** ISO-8601 UTC. */
|
|
77
|
+
deliveryDate: string | null;
|
|
78
|
+
isEdited: boolean;
|
|
79
|
+
editCount: number;
|
|
80
|
+
/** The reviewer's first and last name as the storefront shows them; null when none. */
|
|
81
|
+
customerDisplayName: string | null;
|
|
82
|
+
imageAssetIds: string[] | null;
|
|
83
|
+
videoAssetIds: string[] | null;
|
|
84
|
+
/** The answers to the review attributes, keyed by attribute id: a 1–5 rating or an option. */
|
|
85
|
+
attributeValues: Record<string, number | string> | null;
|
|
86
|
+
helpfulCount: number;
|
|
87
|
+
notHelpfulCount: number;
|
|
88
|
+
/** The store's reply, shown under the review once it is approved. */
|
|
89
|
+
merchantReply: string | null;
|
|
90
|
+
/** ISO-8601 UTC. */
|
|
91
|
+
merchantReplyAt: string | null;
|
|
92
|
+
/** A hash of the address the review was sent from (spam checks). */
|
|
93
|
+
ipAddressHash: string | null;
|
|
94
|
+
/** ISO-8601 UTC. */
|
|
95
|
+
createdAt: string;
|
|
96
|
+
/** ISO-8601 UTC. */
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
/**
|
|
99
|
+
* Set when the caller's customer-data level blanked part of the answer (an app installation
|
|
100
|
+
* below `customerData: full`): read a `null` text or name as "not granted", never as "none".
|
|
101
|
+
*/
|
|
102
|
+
redacted?: true;
|
|
103
|
+
}
|
|
104
|
+
export interface ReviewEditHistoryEntry {
|
|
105
|
+
id: string;
|
|
106
|
+
previousRating: number | null;
|
|
107
|
+
previousTitle: string | null;
|
|
108
|
+
previousBody: string | null;
|
|
109
|
+
previousAttributeValues: Record<string, number | string> | null;
|
|
110
|
+
/** ISO-8601 UTC. */
|
|
111
|
+
editedAt: string;
|
|
112
|
+
/** True when the edit sent the review back to moderation. */
|
|
113
|
+
reEnteredModeration: boolean;
|
|
114
|
+
/** ISO-8601 UTC. */
|
|
115
|
+
createdAt: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ReviewModerationLogEntry {
|
|
118
|
+
id: string;
|
|
119
|
+
/** `profanity`, `spam`, `ai`, `manual` (staff) or `customer_report`. */
|
|
120
|
+
step: string;
|
|
121
|
+
/** `approved`, `rejected`, `flagged` or `skipped`. */
|
|
122
|
+
action: string;
|
|
123
|
+
reason: string | null;
|
|
124
|
+
/** The AI check's confidence, 0 to 1. */
|
|
125
|
+
confidence: number | null;
|
|
126
|
+
aiAnalysis: Record<string, unknown> | null;
|
|
127
|
+
/** The staff user (a User id) for a `manual` step. */
|
|
128
|
+
performedBy: string | null;
|
|
129
|
+
tokenUsage: {
|
|
130
|
+
inputTokens: number;
|
|
131
|
+
outputTokens: number;
|
|
132
|
+
} | null;
|
|
133
|
+
/** ISO-8601 UTC. */
|
|
134
|
+
createdAt: string;
|
|
135
|
+
}
|
|
136
|
+
/** One review with its edit history and moderation log, as `get` answers it. */
|
|
137
|
+
export interface ProductReview extends ProductReviewSummary {
|
|
138
|
+
editHistory: ReviewEditHistoryEntry[];
|
|
139
|
+
moderationLogs: ReviewModerationLogEntry[];
|
|
140
|
+
}
|
|
141
|
+
export interface ReviewStats {
|
|
142
|
+
/** Every review of the store, whatever its status. */
|
|
143
|
+
totalReviews: number;
|
|
144
|
+
pendingCount: number;
|
|
145
|
+
approvedCount: number;
|
|
146
|
+
rejectedCount: number;
|
|
147
|
+
flaggedCount: number;
|
|
148
|
+
/** Over the approved reviews with a rating; null when there is none. */
|
|
149
|
+
averageRating: number | null;
|
|
150
|
+
/** Reviews of any status written in the last 7 days, counted back from now (not the calendar week). */
|
|
151
|
+
ratingsThisWeek: number;
|
|
152
|
+
/** Reviews of any status written in the last 30 days, counted back from now. */
|
|
153
|
+
ratingsThisMonth: number;
|
|
154
|
+
}
|
|
155
|
+
export interface ReviewListOptions extends Call {
|
|
156
|
+
status?: ReviewStatus;
|
|
157
|
+
productId?: string;
|
|
158
|
+
customerId?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Matches the title or the text, any case (`%` and `_` are literal). Refused
|
|
161
|
+
* `CUSTOMER_DATA_NOT_GRANTED` below `customerData: full`: it searches what the customer typed.
|
|
162
|
+
*/
|
|
163
|
+
search?: string;
|
|
164
|
+
/** 1 to 5. The engine filters nothing on any other value. */
|
|
165
|
+
rating?: number;
|
|
166
|
+
/** Defaults to `NEWEST`. */
|
|
167
|
+
sort?: ReviewSortKey;
|
|
168
|
+
/** 1 to {@link MAX_REVIEW_PAGE_SIZE}; 25 when left out. */
|
|
169
|
+
limit?: number;
|
|
170
|
+
/** The cursor from the previous page. */
|
|
171
|
+
after?: string;
|
|
172
|
+
}
|
|
173
|
+
/** A moderation: the status the review takes, and the reason recorded with it. */
|
|
174
|
+
export interface ReviewModerationInput {
|
|
175
|
+
action: ReviewStatus;
|
|
176
|
+
/** Recorded in the review's moderation log; not shown on the storefront. */
|
|
177
|
+
reason?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface ReviewBulkModerationInput extends ReviewModerationInput {
|
|
180
|
+
/** 1 to {@link MAX_BULK_REVIEWS} reviews of the store, each named once. */
|
|
181
|
+
ids: readonly string[];
|
|
182
|
+
}
|
|
183
|
+
/** One review's outcome in a `bulkModerate` call. */
|
|
184
|
+
export interface ReviewModerationOutcome {
|
|
185
|
+
id: string;
|
|
186
|
+
/** `OK`, or `FAILED` (a string on the wire: read anything else as not done). */
|
|
187
|
+
status: 'OK' | 'FAILED' | (string & {});
|
|
188
|
+
/**
|
|
189
|
+
* When FAILED: the single door's own code: `ENTITY_NOT_FOUND` (no such review in this store),
|
|
190
|
+
* …; `INTERNAL_SERVER_ERROR` for a fault the engine logged.
|
|
191
|
+
*/
|
|
192
|
+
code: string | null;
|
|
193
|
+
/** When FAILED: the door's sentence. */
|
|
194
|
+
message: string | null;
|
|
195
|
+
}
|
|
196
|
+
export type ReviewAttributeInputType = 'rating' | 'selection';
|
|
197
|
+
export type ReviewAttributeSection = 'product' | 'demographic';
|
|
198
|
+
/** A question the store's review form asks. */
|
|
199
|
+
export interface ReviewAttribute {
|
|
200
|
+
id: string;
|
|
201
|
+
/** Unique within the store. */
|
|
202
|
+
slug: string;
|
|
203
|
+
label: string;
|
|
204
|
+
/** `rating` (1 to 5) or `selection` (one of `options`). A string on the wire. */
|
|
205
|
+
inputType: ReviewAttributeInputType | (string & {});
|
|
206
|
+
/** The choices of a `selection`; null for a `rating`. */
|
|
207
|
+
options: string[] | null;
|
|
208
|
+
isRequired: boolean;
|
|
209
|
+
/** A disabled attribute is kept but never asked. */
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
/** `product` (feedback on the product) or `demographic` (about the reviewer). */
|
|
212
|
+
section: ReviewAttributeSection | (string & {});
|
|
213
|
+
position: number;
|
|
214
|
+
/**
|
|
215
|
+
* The store's collections the attribute is asked for: it applies to a product in any of them.
|
|
216
|
+
* Empty: it applies to every product.
|
|
217
|
+
*/
|
|
218
|
+
collectionIds: string[];
|
|
219
|
+
/** ISO-8601 UTC. */
|
|
220
|
+
createdAt: string;
|
|
221
|
+
/** ISO-8601 UTC. */
|
|
222
|
+
updatedAt: string;
|
|
223
|
+
}
|
|
224
|
+
export interface CreateReviewAttributeInput {
|
|
225
|
+
label: string;
|
|
226
|
+
inputType: ReviewAttributeInputType;
|
|
227
|
+
/** Defaults to the label, lower-cased, every run of other characters than `a-z0-9` a `-`. */
|
|
228
|
+
slug?: string;
|
|
229
|
+
/** Required for a `selection`: at least two. */
|
|
230
|
+
options?: string[];
|
|
231
|
+
/** Defaults to false. */
|
|
232
|
+
isRequired?: boolean;
|
|
233
|
+
/** Defaults to true. */
|
|
234
|
+
enabled?: boolean;
|
|
235
|
+
/** Defaults to `product`. */
|
|
236
|
+
section?: ReviewAttributeSection;
|
|
237
|
+
}
|
|
238
|
+
/** Only the fields named change. */
|
|
239
|
+
export interface UpdateReviewAttributeInput {
|
|
240
|
+
label?: string;
|
|
241
|
+
slug?: string;
|
|
242
|
+
inputType?: ReviewAttributeInputType;
|
|
243
|
+
options?: string[];
|
|
244
|
+
isRequired?: boolean;
|
|
245
|
+
enabled?: boolean;
|
|
246
|
+
section?: ReviewAttributeSection;
|
|
247
|
+
}
|
|
248
|
+
export interface ReviewsModule {
|
|
249
|
+
/**
|
|
250
|
+
* One page of the store's reviews, every status unless `status` is given, in `sort` order.
|
|
251
|
+
* `total` counts every match.
|
|
252
|
+
*
|
|
253
|
+
* @effect read
|
|
254
|
+
*/
|
|
255
|
+
list(options?: ReviewListOptions): Promise<Page<ProductReviewSummary>>;
|
|
256
|
+
/**
|
|
257
|
+
* One review with its edit history and moderation log; `null` when the store has none with
|
|
258
|
+
* that id.
|
|
259
|
+
*
|
|
260
|
+
* @effect read
|
|
261
|
+
*/
|
|
262
|
+
get(id: string, options?: Call): Promise<ProductReview | null>;
|
|
263
|
+
/** @effect read */
|
|
264
|
+
stats(options?: Call): Promise<ReviewStats>;
|
|
265
|
+
/**
|
|
266
|
+
* Give one review a status: `APPROVED` publishes it on the storefront; `REJECTED`, `FLAGGED`
|
|
267
|
+
* and `PENDING` take it off. Recorded in its moderation log with `reason`. The product's
|
|
268
|
+
* average rating follows within seconds. Refused (`ENTITY_NOT_FOUND`) for a review the store
|
|
269
|
+
* does not have.
|
|
270
|
+
*
|
|
271
|
+
* @effect write
|
|
272
|
+
*/
|
|
273
|
+
moderate(id: string, input: ReviewModerationInput, options?: Call): Promise<ProductReviewSummary>;
|
|
274
|
+
/**
|
|
275
|
+
* Moderate many reviews in one call. Each goes through `moderate`'s rules in a transaction of
|
|
276
|
+
* its own and is reported on its own, in the order named: a refused review
|
|
277
|
+
* (`ENTITY_NOT_FOUND`) changes nothing, and the others still go through. A selection of no
|
|
278
|
+
* review, more than {@link MAX_BULK_REVIEWS} or one twice is refused
|
|
279
|
+
* `BULK_ACTION_INPUT_INVALID` (400) before anything is sent. Not keyed: a repeat moderates
|
|
280
|
+
* again (and logs again). Needs a platform release with `moderateReviews`.
|
|
281
|
+
*
|
|
282
|
+
* @effect write
|
|
283
|
+
*/
|
|
284
|
+
bulkModerate(input: ReviewBulkModerationInput, options?: Call): Promise<ReviewModerationOutcome[]>;
|
|
285
|
+
/** The store's reply under a review. */
|
|
286
|
+
reply: {
|
|
287
|
+
/**
|
|
288
|
+
* Set (or replace) the store's reply, trimmed; shown under the review on the storefront once
|
|
289
|
+
* it is approved. Over 2,000 characters is refused (`USER_INPUT_ERROR`). An empty reply is
|
|
290
|
+
* stored as one: use `remove` to take a reply away.
|
|
291
|
+
*
|
|
292
|
+
* @effect write
|
|
293
|
+
*/
|
|
294
|
+
set(reviewId: string, reply: string, options?: Call): Promise<ProductReviewSummary>;
|
|
295
|
+
/**
|
|
296
|
+
* Take the store's reply away.
|
|
297
|
+
*
|
|
298
|
+
* @effect destructive
|
|
299
|
+
*/
|
|
300
|
+
remove(reviewId: string, options?: Call): Promise<ProductReviewSummary>;
|
|
301
|
+
};
|
|
302
|
+
/** The questions the store's review form asks. */
|
|
303
|
+
attributes: {
|
|
304
|
+
/**
|
|
305
|
+
* Every attribute of the store, disabled ones included, in `position` order (ties: the
|
|
306
|
+
* older first). The engine answers them all at once; there are no pages.
|
|
307
|
+
*
|
|
308
|
+
* @effect read
|
|
309
|
+
*/
|
|
310
|
+
list(options?: Call): Promise<ReviewAttribute[]>;
|
|
311
|
+
/**
|
|
312
|
+
* Created after the store's last attribute. Refused: a taken slug
|
|
313
|
+
* (`REVIEW_ATTRIBUTE_SLUG_TAKEN`), an unknown type or a selection with fewer than two
|
|
314
|
+
* options (`USER_INPUT_ERROR`).
|
|
315
|
+
*
|
|
316
|
+
* @effect write
|
|
317
|
+
*/
|
|
318
|
+
create(input: CreateReviewAttributeInput, options?: Call): Promise<ReviewAttribute>;
|
|
319
|
+
/**
|
|
320
|
+
* Refused: an attribute the store does not have (`ENTITY_NOT_FOUND`), a slug another of its
|
|
321
|
+
* attributes holds (`REVIEW_ATTRIBUTE_SLUG_TAKEN`), a change to an unknown type or to a
|
|
322
|
+
* selection with fewer than two options (`USER_INPUT_ERROR`). Answers given before keep the
|
|
323
|
+
* attribute id they named; a review's answers are not rewritten.
|
|
324
|
+
*
|
|
325
|
+
* @effect write
|
|
326
|
+
*/
|
|
327
|
+
update(id: string, input: UpdateReviewAttributeInput, options?: Call): Promise<ReviewAttribute>;
|
|
328
|
+
/**
|
|
329
|
+
* Deletes the attribute and its collection scoping. Reviews keep the answers given to it,
|
|
330
|
+
* no longer labelled. Refused (`ENTITY_NOT_FOUND`) for an attribute the store does not have.
|
|
331
|
+
*
|
|
332
|
+
* @effect destructive
|
|
333
|
+
*/
|
|
334
|
+
delete(id: string, options?: Call): Promise<void>;
|
|
335
|
+
/**
|
|
336
|
+
* Gives the named attributes the positions `0, 1, 2…` in the order given, and answers every
|
|
337
|
+
* attribute as `list` does. An id the store does not hold is skipped without a word; an
|
|
338
|
+
* attribute left out keeps its position, which may then equal a named one's: name them all.
|
|
339
|
+
*
|
|
340
|
+
* @effect write
|
|
341
|
+
*/
|
|
342
|
+
reorder(ids: string[], options?: Call): Promise<ReviewAttribute[]>;
|
|
343
|
+
/**
|
|
344
|
+
* Replace the collections the attribute is asked for (`[]`: every product). Repeats are
|
|
345
|
+
* dropped. A collection the store does not hold refuses the whole call and changes nothing
|
|
346
|
+
* (`REVIEW_ATTRIBUTE_COLLECTION_NOT_FOUND`, each in `details`), except one the attribute is
|
|
347
|
+
* already scoped to that the store no longer holds (deleted since), which is dropped: sending
|
|
348
|
+
* the attribute's `collectionIds` back always saves.
|
|
349
|
+
*
|
|
350
|
+
* @effect write
|
|
351
|
+
*/
|
|
352
|
+
setCollections(attributeId: string, collectionIds: string[], options?: Call): Promise<ReviewAttribute>;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
export declare const PRODUCT_REVIEWS_QUERY = "\n query CatalogProductReviews($options: AdminReviewListOptions) {\n adminProductReviews(options: $options) {\n items { \n id\n channelId\n customerId\n productId\n productName\n variantId\n rating\n title\n body\n status\n isVerifiedPurchase\n purchaseDate\n deliveryDate\n isEdited\n editCount\n customerDisplayName\n imageAssetIds\n videoAssetIds\n attributeValues\n helpfulCount\n notHelpfulCount\n merchantReply\n merchantReplyAt\n ipAddressHash\n createdAt\n updatedAt\n }\n totalItems\n }\n }\n";
|
|
356
|
+
export declare const PRODUCT_REVIEW_QUERY = "\n query CatalogProductReview($id: ID!) {\n adminProductReview(id: $id) { \n \n id\n channelId\n customerId\n productId\n productName\n variantId\n rating\n title\n body\n status\n isVerifiedPurchase\n purchaseDate\n deliveryDate\n isEdited\n editCount\n customerDisplayName\n imageAssetIds\n videoAssetIds\n attributeValues\n helpfulCount\n notHelpfulCount\n merchantReply\n merchantReplyAt\n ipAddressHash\n createdAt\n updatedAt\n\n editHistory {\n id\n previousRating\n previousTitle\n previousBody\n previousAttributeValues\n editedAt\n reEnteredModeration\n createdAt\n }\n moderationLogs {\n id\n step\n action\n reason\n confidence\n aiAnalysis\n performedBy\n tokenUsage\n createdAt\n }\n }\n }\n";
|
|
357
|
+
export declare const REVIEW_STATS_QUERY = "\n query CatalogReviewStats {\n reviewStats {\n totalReviews\n pendingCount\n approvedCount\n rejectedCount\n flaggedCount\n averageRating\n ratingsThisWeek\n ratingsThisMonth\n }\n }\n";
|
|
358
|
+
export declare const MODERATE_REVIEW_MUTATION = "\n mutation CatalogModerateReview($id: ID!, $action: ReviewStatus!, $reason: String) {\n moderateReview(id: $id, action: $action, reason: $reason) { \n id\n channelId\n customerId\n productId\n productName\n variantId\n rating\n title\n body\n status\n isVerifiedPurchase\n purchaseDate\n deliveryDate\n isEdited\n editCount\n customerDisplayName\n imageAssetIds\n videoAssetIds\n attributeValues\n helpfulCount\n notHelpfulCount\n merchantReply\n merchantReplyAt\n ipAddressHash\n createdAt\n updatedAt\n }\n }\n";
|
|
359
|
+
export declare const MODERATE_REVIEWS_MUTATION = "\n mutation CatalogModerateReviews($input: ModerateReviewsInput!) {\n moderateReviews(input: $input) {\n items { id status code message }\n }\n }\n";
|
|
360
|
+
export declare const SET_MERCHANT_REPLY_MUTATION = "\n mutation CatalogSetMerchantReply($reviewId: ID!, $reply: String!) {\n setMerchantReply(reviewId: $reviewId, reply: $reply) { \n id\n channelId\n customerId\n productId\n productName\n variantId\n rating\n title\n body\n status\n isVerifiedPurchase\n purchaseDate\n deliveryDate\n isEdited\n editCount\n customerDisplayName\n imageAssetIds\n videoAssetIds\n attributeValues\n helpfulCount\n notHelpfulCount\n merchantReply\n merchantReplyAt\n ipAddressHash\n createdAt\n updatedAt\n }\n }\n";
|
|
361
|
+
export declare const REMOVE_MERCHANT_REPLY_MUTATION = "\n mutation CatalogRemoveMerchantReply($reviewId: ID!) {\n removeMerchantReply(reviewId: $reviewId) { \n id\n channelId\n customerId\n productId\n productName\n variantId\n rating\n title\n body\n status\n isVerifiedPurchase\n purchaseDate\n deliveryDate\n isEdited\n editCount\n customerDisplayName\n imageAssetIds\n videoAssetIds\n attributeValues\n helpfulCount\n notHelpfulCount\n merchantReply\n merchantReplyAt\n ipAddressHash\n createdAt\n updatedAt\n }\n }\n";
|
|
362
|
+
export declare const REVIEW_ATTRIBUTES_QUERY = "\n query CatalogReviewAttributes {\n adminReviewAttributes { \n id\n slug\n label\n inputType\n options\n isRequired\n enabled\n section\n position\n collectionIds\n createdAt\n updatedAt\n }\n }\n";
|
|
363
|
+
export declare const CREATE_REVIEW_ATTRIBUTE_MUTATION = "\n mutation CatalogCreateReviewAttribute($input: AdminReviewAttributeInput!) {\n createReviewAttribute(input: $input) { \n id\n slug\n label\n inputType\n options\n isRequired\n enabled\n section\n position\n collectionIds\n createdAt\n updatedAt\n }\n }\n";
|
|
364
|
+
export declare const UPDATE_REVIEW_ATTRIBUTE_MUTATION = "\n mutation CatalogUpdateReviewAttribute($id: ID!, $input: UpdateReviewAttributeInput!) {\n updateReviewAttribute(id: $id, input: $input) { \n id\n slug\n label\n inputType\n options\n isRequired\n enabled\n section\n position\n collectionIds\n createdAt\n updatedAt\n }\n }\n";
|
|
365
|
+
export declare const DELETE_REVIEW_ATTRIBUTE_MUTATION = "\n mutation CatalogDeleteReviewAttribute($id: ID!) {\n deleteReviewAttribute(id: $id) { \n result\n message\n }\n }\n";
|
|
366
|
+
export declare const REORDER_REVIEW_ATTRIBUTES_MUTATION = "\n mutation CatalogReorderReviewAttributes($ids: [ID!]!) {\n reorderReviewAttributes(ids: $ids) { \n id\n slug\n label\n inputType\n options\n isRequired\n enabled\n section\n position\n collectionIds\n createdAt\n updatedAt\n }\n }\n";
|
|
367
|
+
export declare const SET_REVIEW_ATTRIBUTE_COLLECTIONS_MUTATION = "\n mutation CatalogSetReviewAttributeCollections($attributeId: ID!, $collectionIds: [ID!]!) {\n setReviewAttributeCollections(attributeId: $attributeId, collectionIds: $collectionIds) {\n \n id\n slug\n label\n inputType\n options\n isRequired\n enabled\n section\n position\n collectionIds\n createdAt\n updatedAt\n\n }\n }\n";
|
|
368
|
+
export declare function createReviewsModule(transport: Transport): ReviewsModule;
|