@vendure-platform/create 0.3.0 → 0.5.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 (59) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +7 -7
  3. package/dist/add-to-existing.js +1 -583
  4. package/dist/assets/storefront/messages/de.json +2 -0
  5. package/dist/assets/storefront/messages/en.json +2 -0
  6. package/dist/assets/storefront/package.json +1 -1
  7. package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +7 -2
  8. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/activity-feed.tsx +152 -0
  9. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-item-search.tsx +130 -0
  10. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +124 -0
  11. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +240 -0
  12. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +47 -0
  13. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +96 -0
  14. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/shared-cart-detail-client.tsx +555 -0
  15. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +260 -0
  16. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +77 -0
  17. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +47 -0
  18. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +263 -0
  19. package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +12 -1
  20. package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +23 -0
  21. package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +2 -0
  22. package/dist/assets/storefront/src/components/commerce/add-to-shared-cart.tsx +225 -0
  23. package/dist/assets/storefront/src/components/commerce/product-info.tsx +14 -1
  24. package/dist/assets/storefront/src/components/commerce/shared-cart-role.ts +39 -0
  25. package/dist/assets/storefront/src/components/commerce/shared-cart-status-badge.tsx +24 -0
  26. package/dist/assets/storefront/src/graphql-env.d.ts +28 -15
  27. package/dist/assets/storefront/src/lib/vendure/api.ts +8 -4
  28. package/dist/assets/storefront/src/lib/vendure/mutations.ts +96 -0
  29. package/dist/assets/storefront/src/lib/vendure/queries.ts +142 -0
  30. package/dist/assets/storefront/src/schema.graphql +321 -61
  31. package/dist/bin/run.js +1 -119
  32. package/dist/cli.js +1 -309
  33. package/dist/git-init.js +1 -60
  34. package/dist/index.js +1 -19
  35. package/dist/plugin-registry.js +1 -203
  36. package/dist/registry.js +1 -29
  37. package/dist/scaffold-shared.js +1 -124
  38. package/dist/scaffold-storefront-only.js +1 -101
  39. package/dist/scaffolder.js +1 -203
  40. package/dist/sort-package-json.js +1 -26
  41. package/dist/storefront-copier.js +1 -149
  42. package/dist/template-renderer.js +1 -221
  43. package/dist/types.js +1 -3
  44. package/package.json +5 -4
  45. package/dist/add-to-existing.js.map +0 -1
  46. package/dist/assets/storefront/src/lib/quantity.test.js +0 -20
  47. package/dist/bin/run.js.map +0 -1
  48. package/dist/cli.js.map +0 -1
  49. package/dist/git-init.js.map +0 -1
  50. package/dist/index.js.map +0 -1
  51. package/dist/plugin-registry.js.map +0 -1
  52. package/dist/registry.js.map +0 -1
  53. package/dist/scaffold-shared.js.map +0 -1
  54. package/dist/scaffold-storefront-only.js.map +0 -1
  55. package/dist/scaffolder.js.map +0 -1
  56. package/dist/sort-package-json.js.map +0 -1
  57. package/dist/storefront-copier.js.map +0 -1
  58. package/dist/template-renderer.js.map +0 -1
  59. package/dist/types.js.map +0 -1
@@ -1144,3 +1144,99 @@ export const AddReorderToActiveOrderMutation = graphql(`
1144
1144
  }
1145
1145
  }
1146
1146
  `);
1147
+
1148
+ export const CreateSharedCartMutation = graphql(`
1149
+ mutation CreateSharedCart($input: CreateSharedCartInput!) {
1150
+ createSharedCart(input: $input) {
1151
+ id
1152
+ }
1153
+ }
1154
+ `);
1155
+
1156
+ export const UpdateSharedCartMutation = graphql(`
1157
+ mutation UpdateSharedCart($input: UpdateSharedCartInput!) {
1158
+ updateSharedCart(input: $input) {
1159
+ id
1160
+ name
1161
+ description
1162
+ }
1163
+ }
1164
+ `);
1165
+
1166
+ export const DeleteSharedCartMutation = graphql(`
1167
+ mutation DeleteSharedCart($id: ID!) {
1168
+ deleteSharedCart(id: $id) {
1169
+ result
1170
+ message
1171
+ }
1172
+ }
1173
+ `);
1174
+
1175
+ export const AddItemToSharedCartMutation = graphql(`
1176
+ mutation AddItemToSharedCart($sharedCartId: ID!, $productVariantId: ID!, $quantity: Int!) {
1177
+ addItemToSharedCart(
1178
+ sharedCartId: $sharedCartId
1179
+ productVariantId: $productVariantId
1180
+ quantity: $quantity
1181
+ ) {
1182
+ id
1183
+ }
1184
+ }
1185
+ `);
1186
+
1187
+ export const AdjustSharedCartLineMutation = graphql(`
1188
+ mutation AdjustSharedCartLine($sharedCartId: ID!, $lineId: ID!, $quantity: Int!) {
1189
+ adjustSharedCartLine(sharedCartId: $sharedCartId, lineId: $lineId, quantity: $quantity) {
1190
+ id
1191
+ }
1192
+ }
1193
+ `);
1194
+
1195
+ export const RemoveSharedCartLineMutation = graphql(`
1196
+ mutation RemoveSharedCartLine($sharedCartId: ID!, $lineId: ID!) {
1197
+ removeSharedCartLine(sharedCartId: $sharedCartId, lineId: $lineId) {
1198
+ id
1199
+ }
1200
+ }
1201
+ `);
1202
+
1203
+ export const AddSharedCartMemberMutation = graphql(`
1204
+ mutation AddSharedCartMember($input: CreateSharedCartMemberInput!) {
1205
+ addSharedCartMember(input: $input) {
1206
+ id
1207
+ }
1208
+ }
1209
+ `);
1210
+
1211
+ export const RemoveSharedCartMemberMutation = graphql(`
1212
+ mutation RemoveSharedCartMember($sharedCartId: ID!, $customerId: ID!) {
1213
+ removeSharedCartMember(sharedCartId: $sharedCartId, customerId: $customerId) {
1214
+ id
1215
+ }
1216
+ }
1217
+ `);
1218
+
1219
+ export const SetSharedCartMemberRoleMutation = graphql(`
1220
+ mutation SetSharedCartMemberRole($input: UpdateSharedCartMemberInput!) {
1221
+ setSharedCartMemberRole(input: $input) {
1222
+ id
1223
+ }
1224
+ }
1225
+ `);
1226
+
1227
+ export const TransferSharedCartOwnershipMutation = graphql(`
1228
+ mutation TransferSharedCartOwnership($sharedCartId: ID!, $newOwnerCustomerId: ID!) {
1229
+ transferSharedCartOwnership(sharedCartId: $sharedCartId, newOwnerCustomerId: $newOwnerCustomerId) {
1230
+ id
1231
+ }
1232
+ }
1233
+ `);
1234
+
1235
+ export const InitiateSharedCartCheckoutMutation = graphql(`
1236
+ mutation InitiateSharedCartCheckout($sharedCartId: ID!) {
1237
+ initiateSharedCartCheckout(sharedCartId: $sharedCartId) {
1238
+ id
1239
+ status
1240
+ }
1241
+ }
1242
+ `);
@@ -1436,3 +1436,145 @@ export const PreviewReorderQuery = graphql(`
1436
1436
  }
1437
1437
  }
1438
1438
  `);
1439
+
1440
+ // ---------------------------------------------------------------------------
1441
+ // Shared Carts (EE-13)
1442
+ // A SharedCart wraps a live Order plus a membership overlay. The list query is
1443
+ // kept light; the detail query carries full lines + the activity log so a
1444
+ // single poll refreshes the whole collaborative view. Fields are inlined (not
1445
+ // fragments) to match the masking-on convention of the other list queries.
1446
+ // ---------------------------------------------------------------------------
1447
+
1448
+ export const GetMySharedCartsQuery = graphql(`
1449
+ query GetMySharedCarts($options: SharedCartListOptions) {
1450
+ mySharedCarts(options: $options) {
1451
+ totalItems
1452
+ items {
1453
+ id
1454
+ name
1455
+ status
1456
+ updatedAt
1457
+ owner {
1458
+ id
1459
+ firstName
1460
+ lastName
1461
+ }
1462
+ members {
1463
+ role
1464
+ customer {
1465
+ id
1466
+ }
1467
+ }
1468
+ order {
1469
+ id
1470
+ currencyCode
1471
+ totalWithTax
1472
+ totalQuantity
1473
+ }
1474
+ }
1475
+ }
1476
+ }
1477
+ `);
1478
+
1479
+ // Company-wide list for company admins (ManageSharedCarts): every cart in the company, including
1480
+ // ones the admin isn't a member of. Same shape as GetMySharedCarts so the list page can render
1481
+ // either result interchangeably.
1482
+ export const GetCompanySharedCartsQuery = graphql(`
1483
+ query GetCompanySharedCarts($options: SharedCartListOptions) {
1484
+ companySharedCarts(options: $options) {
1485
+ totalItems
1486
+ items {
1487
+ id
1488
+ name
1489
+ status
1490
+ updatedAt
1491
+ owner {
1492
+ id
1493
+ firstName
1494
+ lastName
1495
+ }
1496
+ members {
1497
+ role
1498
+ customer {
1499
+ id
1500
+ }
1501
+ }
1502
+ order {
1503
+ id
1504
+ currencyCode
1505
+ totalWithTax
1506
+ totalQuantity
1507
+ }
1508
+ }
1509
+ }
1510
+ }
1511
+ `);
1512
+
1513
+ export const GetSharedCartQuery = graphql(`
1514
+ query GetSharedCart($id: ID!) {
1515
+ sharedCart(id: $id) {
1516
+ id
1517
+ name
1518
+ description
1519
+ status
1520
+ createdAt
1521
+ updatedAt
1522
+ companyId
1523
+ owner {
1524
+ id
1525
+ firstName
1526
+ lastName
1527
+ emailAddress
1528
+ }
1529
+ members {
1530
+ role
1531
+ customer {
1532
+ id
1533
+ firstName
1534
+ lastName
1535
+ emailAddress
1536
+ }
1537
+ }
1538
+ order {
1539
+ id
1540
+ code
1541
+ currencyCode
1542
+ subTotalWithTax
1543
+ totalWithTax
1544
+ totalQuantity
1545
+ customer {
1546
+ id
1547
+ firstName
1548
+ lastName
1549
+ }
1550
+ lines {
1551
+ id
1552
+ quantity
1553
+ unitPriceWithTax
1554
+ linePriceWithTax
1555
+ productVariant {
1556
+ id
1557
+ name
1558
+ sku
1559
+ }
1560
+ featuredAsset {
1561
+ preview
1562
+ }
1563
+ }
1564
+ }
1565
+ activity {
1566
+ id
1567
+ createdAt
1568
+ action
1569
+ targetLineId
1570
+ detail
1571
+ actorLabel
1572
+ targetCustomer {
1573
+ id
1574
+ firstName
1575
+ lastName
1576
+ }
1577
+ }
1578
+ }
1579
+ }
1580
+ `);