@sixtyninecommerce/admin 0.12.0 → 0.14.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.
@@ -1,5 +1,5 @@
1
1
  import { pageFromVendureList, readOffsetCursor, } from '@sixtyninecommerce/core';
2
- import { PURCHASE_ORDER_FIELDS } from './purchase-orders.js';
2
+ import { PURCHASE_ORDER_FIELDS, sentReferenceAware, withSentReferences, } from './purchase-orders.js';
3
3
  export const REPLENISHMENT_RULE_FIELDS = /* GraphQL */ `
4
4
  id
5
5
  scopeId
@@ -135,7 +135,9 @@ function picked(input, fields) {
135
135
  }
136
136
  return out;
137
137
  }
138
- export function createPurchasingReplenishmentModule(transport) {
138
+ export function createPurchasingReplenishmentModule(baseTransport) {
139
+ // `suggestions.createDrafts` answers its drafts through PURCHASE_ORDER_FIELDS (`sentReference`).
140
+ const transport = sentReferenceAware(baseTransport);
139
141
  const rulesPage = async (skip, take, options) => {
140
142
  const filters = options ? picked(options, RULE_FILTERS) : {};
141
143
  const data = await transport.graphql({
@@ -233,7 +235,8 @@ export function createPurchasingReplenishmentModule(transport) {
233
235
  idempotencyKey: call?.idempotencyKey,
234
236
  },
235
237
  }, call);
236
- return data.createReplenishmentDrafts;
238
+ const drafts = data.createReplenishmentDrafts;
239
+ return { ...drafts, purchaseOrders: drafts.purchaseOrders.map(withSentReferences) };
237
240
  },
238
241
  },
239
242
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixtyninecommerce/admin",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Back-office SDK for sixtynine-commerce: every capability of the platform as a method",
5
5
  "homepage": "https://github.com/SIXTYNINE-digital/sixtynine-commerce-engine/tree/main/packages/admin-client#readme",
6
6
  "repository": {