@sixtyninecommerce/admin 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +294 -0
  2. package/dist/catalog/products.d.ts +162 -1
  3. package/dist/catalog/products.js +94 -1
  4. package/dist/catalog/variants.d.ts +50 -0
  5. package/dist/catalog/variants.js +48 -18
  6. package/dist/client.d.ts +21 -0
  7. package/dist/client.js +6 -0
  8. package/dist/fulfillments/index.d.ts +77 -0
  9. package/dist/fulfillments/index.js +109 -0
  10. package/dist/index.d.ts +15 -4
  11. package/dist/index.js +5 -0
  12. package/dist/integrations/index.d.ts +14 -0
  13. package/dist/integrations/index.js +9 -0
  14. package/dist/integrations/pipelines.d.ts +113 -0
  15. package/dist/integrations/pipelines.js +62 -0
  16. package/dist/integrations/types.d.ts +176 -0
  17. package/dist/integrations/types.js +8 -0
  18. package/dist/jobs/bulk-action-run.d.ts +11 -2
  19. package/dist/jobs/bulk-action-run.js +4 -5
  20. package/dist/orders/bulk.d.ts +75 -0
  21. package/dist/orders/bulk.js +150 -0
  22. package/dist/orders/deposit-policy.d.ts +103 -0
  23. package/dist/orders/deposit-policy.js +202 -0
  24. package/dist/orders/index.d.ts +80 -0
  25. package/dist/orders/index.js +13 -0
  26. package/dist/orders/manual-discounts.d.ts +11 -2
  27. package/dist/orders/manual-discounts.js +2 -0
  28. package/dist/payments/index.d.ts +7 -0
  29. package/dist/payments/index.js +2 -0
  30. package/dist/payments/methods.d.ts +37 -0
  31. package/dist/payments/methods.js +33 -0
  32. package/dist/pricing/index.d.ts +3 -0
  33. package/dist/pricing/index.js +2 -0
  34. package/dist/pricing/vouchers.d.ts +103 -0
  35. package/dist/pricing/vouchers.js +69 -0
  36. package/dist/returns/index.d.ts +225 -0
  37. package/dist/returns/index.js +160 -0
  38. package/dist/search/index.d.ts +99 -0
  39. package/dist/search/index.js +62 -0
  40. package/dist/types.d.ts +2 -2
  41. package/package.json +1 -1
@@ -0,0 +1,62 @@
1
+ /** The engine's bounds, as `searchAcrossEntities` documents them. */
2
+ export const SEARCH_ENTITIES_MIN_TERM_LENGTH = 2;
3
+ export const SEARCH_ENTITIES_MAX_TAKE = 10;
4
+ export const SEARCH_ACROSS_ENTITIES_QUERY = /* GraphQL */ `
5
+ query SearchAcrossEntities($input: CommandSearchInput!) {
6
+ searchAcrossEntities(input: $input) {
7
+ products {
8
+ id
9
+ name
10
+ slug
11
+ previewUrl
12
+ }
13
+ orders {
14
+ id
15
+ code
16
+ state
17
+ orderPlacedAt
18
+ totalWithTax
19
+ currencyCode
20
+ lifecycleStatus
21
+ }
22
+ customers {
23
+ id
24
+ firstName
25
+ lastName
26
+ emailAddress
27
+ company
28
+ }
29
+ content {
30
+ id
31
+ collectionId
32
+ collectionSlug
33
+ slug
34
+ status
35
+ title
36
+ }
37
+ skipped {
38
+ type
39
+ reason
40
+ }
41
+ }
42
+ }
43
+ `;
44
+ export function createSearchModule(transport) {
45
+ return {
46
+ async entities(term, options = {}) {
47
+ const { types, take, ...call } = options;
48
+ const data = await transport.graphql({
49
+ api: 'admin',
50
+ query: SEARCH_ACROSS_ENTITIES_QUERY,
51
+ variables: {
52
+ input: {
53
+ term,
54
+ ...(types === undefined ? {} : { types: [...types] }),
55
+ ...(take === undefined ? {} : { take }),
56
+ },
57
+ },
58
+ }, call);
59
+ return data.searchAcrossEntities;
60
+ },
61
+ };
62
+ }
package/dist/types.d.ts CHANGED
@@ -12,8 +12,8 @@ export interface Call {
12
12
  * `customers.groups.replaceMembers`, `pricing.coupons.apply` / `remove`,
13
13
  * `orders.setLinePrices` / `setOneTimeDiscounts`,
14
14
  * `pos.sale.applyCouponCode` / `removeCouponCode`, `storedValue.issue` / `adjust` /
15
- * `redeem`, `apps.releaseFieldGroup` and `catalog.products.bulk` (which mints one when
16
- * omitted). Repeating one under the same key
15
+ * `redeem`, `apps.releaseFieldGroup`, `catalog.products.bulk` and `orders.bulk` (both mint
16
+ * one when omitted), and `catalog.products.save`. Repeating one under the same key
17
17
  * returns the first call's result instead of moving the money again; a
18
18
  * DIFFERENT request under the same key is refused with a `ConflictError`
19
19
  * (409) coded `IDEMPOTENCY_CONFLICT`, and a repeat that arrives while the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixtyninecommerce/admin",
3
- "version": "0.9.0",
3
+ "version": "0.10.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": {