@01.software/sdk 0.26.0 → 0.28.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 (56) hide show
  1. package/README.md +153 -4
  2. package/dist/analytics/react.cjs +249 -0
  3. package/dist/analytics/react.cjs.map +1 -0
  4. package/dist/analytics/react.d.cts +8 -0
  5. package/dist/analytics/react.d.ts +8 -0
  6. package/dist/analytics/react.js +228 -0
  7. package/dist/analytics/react.js.map +1 -0
  8. package/dist/analytics.cjs.map +1 -1
  9. package/dist/analytics.js.map +1 -1
  10. package/dist/{const-R3AyqOHY.d.ts → const-Cz9Ki_I7.d.cts} +6 -6
  11. package/dist/{const-CEiFBZMW.d.cts → const-mdQQtIOz.d.ts} +6 -6
  12. package/dist/{image-TT8lTsk5.d.cts → image-BDz2-AaO.d.cts} +1 -1
  13. package/dist/{image-TT8lTsk5.d.ts → image-BDz2-AaO.d.ts} +1 -1
  14. package/dist/index.cjs +97 -10
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +21 -10
  17. package/dist/index.d.ts +21 -10
  18. package/dist/index.js +97 -10
  19. package/dist/index.js.map +1 -1
  20. package/dist/{payload-types-BF8VVFt6.d.cts → payload-types-BrSYb-sh.d.cts} +365 -122
  21. package/dist/{payload-types-BF8VVFt6.d.ts → payload-types-BrSYb-sh.d.ts} +365 -122
  22. package/dist/realtime.cjs.map +1 -1
  23. package/dist/realtime.d.cts +2 -2
  24. package/dist/realtime.d.ts +2 -2
  25. package/dist/realtime.js.map +1 -1
  26. package/dist/{server-DLdbWJVv.d.cts → server-BINWywT8.d.cts} +1 -1
  27. package/dist/{server-DLdbWJVv.d.ts → server-BINWywT8.d.ts} +1 -1
  28. package/dist/{server-CZrUwqDs.d.cts → server-C2Q9R-Lu.d.ts} +251 -9
  29. package/dist/{server-DULueNYi.d.ts → server-D369bCVJ.d.cts} +251 -9
  30. package/dist/server.cjs +79 -4
  31. package/dist/server.cjs.map +1 -1
  32. package/dist/server.d.cts +4 -4
  33. package/dist/server.d.ts +4 -4
  34. package/dist/server.js +79 -4
  35. package/dist/server.js.map +1 -1
  36. package/dist/{types-CZ1laT6s.d.ts → types-BLUb4cYq.d.ts} +1 -1
  37. package/dist/{types-lPRgx_rC.d.cts → types-CW4PaIL7.d.cts} +1 -1
  38. package/dist/ui/canvas/server.cjs.map +1 -1
  39. package/dist/ui/canvas/server.d.cts +1 -1
  40. package/dist/ui/canvas/server.d.ts +1 -1
  41. package/dist/ui/canvas/server.js.map +1 -1
  42. package/dist/ui/canvas.cjs.map +1 -1
  43. package/dist/ui/canvas.d.cts +3 -3
  44. package/dist/ui/canvas.d.ts +3 -3
  45. package/dist/ui/canvas.js.map +1 -1
  46. package/dist/ui/form.d.cts +1 -1
  47. package/dist/ui/form.d.ts +1 -1
  48. package/dist/ui/image.d.cts +1 -1
  49. package/dist/ui/image.d.ts +1 -1
  50. package/dist/ui/video.d.cts +2 -2
  51. package/dist/ui/video.d.ts +2 -2
  52. package/dist/{video-DbLL8yuc.d.cts → video-WR_TFO9a.d.cts} +1 -1
  53. package/dist/{video-DbLL8yuc.d.ts → video-WR_TFO9a.d.ts} +1 -1
  54. package/dist/webhook.d.cts +3 -3
  55. package/dist/webhook.d.ts +3 -3
  56. package/package.json +40 -24
@@ -1,4 +1,4 @@
1
- import { c as Config } from './payload-types-BF8VVFt6.cjs';
1
+ import { c as Config } from './payload-types-BrSYb-sh.js';
2
2
 
3
3
  /**
4
4
  * Collection type derived from Payload Config.
@@ -9,26 +9,26 @@ type Collection = keyof Config['collections'];
9
9
  * Internal collections that should not be exposed via SDK.
10
10
  * Includes Payload system collections and admin-only collections.
11
11
  */
12
- declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "tenant-web-analytics-config", "analytics-event-schemas", "subscriptions", "billing-history", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
12
+ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "payload-folders", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "tenant-web-analytics-config", "analytics-event-schemas", "subscriptions", "billing-history", "inventory-reservations", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "tenant-purge-jobs", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
13
13
  type InternalCollection = (typeof INTERNAL_COLLECTIONS)[number];
14
14
  /**
15
15
  * Array of all public collection names for runtime use (e.g., Zod enum validation).
16
16
  * This is the single source of truth for which collections are publicly accessible via SDK.
17
17
  */
18
- declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-profile-lists", "customer-addresses", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "reports", "community-bans", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
18
+ declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-profile-lists", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
19
19
  /**
20
20
  * Server-auth collection names for runtime use. These collections are safe for
21
21
  * secret-key/PAT SDK and MCP server tools, but must not appear in browser or
22
22
  * publishable-key collection discovery.
23
23
  */
24
- declare const SERVER_ONLY_COLLECTIONS: readonly ["customer-groups"];
24
+ declare const SERVER_ONLY_COLLECTIONS: readonly ["customer-groups", "reports", "community-bans"];
25
25
  /**
26
26
  * Public collections available for SDK access.
27
27
  * Derived from the COLLECTIONS array (single source of truth).
28
28
  */
29
29
  type PublicCollection = (typeof COLLECTIONS)[number];
30
30
  type ServerOnlyCollection = (typeof SERVER_ONLY_COLLECTIONS)[number];
31
- declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-profile-lists", "customer-addresses", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "reports", "community-bans", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups"];
31
+ declare const SERVER_COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-profile-lists", "customer-addresses", "carts", "cart-items", "discounts", "shipping-policies", "shipping-zones", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags", "customer-groups", "reports", "community-bans"];
32
32
  type ServerCollection = (typeof SERVER_COLLECTIONS)[number];
33
33
 
34
- export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, type ServerCollection as S, type ServerOnlyCollection as a, COLLECTIONS as b, SERVER_ONLY_COLLECTIONS as c, SERVER_COLLECTIONS as d, type InternalCollection as e };
34
+ export { COLLECTIONS as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, SERVER_COLLECTIONS as S, type Collection as a, type InternalCollection as b, SERVER_ONLY_COLLECTIONS as c, type ServerCollection as d, type ServerOnlyCollection as e };
@@ -79,4 +79,4 @@ interface ImagePlaceholderOptions {
79
79
  */
80
80
  declare function getImagePlaceholderStyle(image: ImageData, options?: ImagePlaceholderOptions): Record<string, string>;
81
81
 
82
- export { type ImageData as I, type ImagePalette as a, IMAGE_SIZES as b, getImageSrcSet as c, getImageLqip as d, getImagePalette as e, type ImagePlaceholderOptions as f, getImageUrl as g, getImagePlaceholderStyle as h };
82
+ export { type ImageData as I, IMAGE_SIZES as a, type ImagePalette as b, type ImagePlaceholderOptions as c, getImagePalette as d, getImagePlaceholderStyle as e, getImageSrcSet as f, getImageLqip as g, getImageUrl as h };
@@ -79,4 +79,4 @@ interface ImagePlaceholderOptions {
79
79
  */
80
80
  declare function getImagePlaceholderStyle(image: ImageData, options?: ImagePlaceholderOptions): Record<string, string>;
81
81
 
82
- export { type ImageData as I, type ImagePalette as a, IMAGE_SIZES as b, getImageSrcSet as c, getImageLqip as d, getImagePalette as e, type ImagePlaceholderOptions as f, getImageUrl as g, getImagePlaceholderStyle as h };
82
+ export { type ImageData as I, IMAGE_SIZES as a, type ImagePalette as b, type ImagePlaceholderOptions as c, getImagePalette as d, getImagePlaceholderStyle as e, getImageSrcSet as f, getImageLqip as g, getImageUrl as h };
package/dist/index.cjs CHANGED
@@ -1260,6 +1260,7 @@ var INTERNAL_COLLECTIONS = [
1260
1260
  "analytics-event-schemas",
1261
1261
  "subscriptions",
1262
1262
  "billing-history",
1263
+ "inventory-reservations",
1263
1264
  "order-status-logs",
1264
1265
  "api-keys",
1265
1266
  "personal-access-tokens",
@@ -1300,8 +1301,8 @@ var COLLECTIONS = [
1300
1301
  "carts",
1301
1302
  "cart-items",
1302
1303
  "discounts",
1303
- "promotions",
1304
1304
  "shipping-policies",
1305
+ "shipping-zones",
1305
1306
  "documents",
1306
1307
  "document-categories",
1307
1308
  "document-types",
@@ -1343,8 +1344,6 @@ var COLLECTIONS = [
1343
1344
  "reaction-types",
1344
1345
  "bookmarks",
1345
1346
  "post-categories",
1346
- "reports",
1347
- "community-bans",
1348
1347
  // Events
1349
1348
  "event-calendars",
1350
1349
  "events",
@@ -1352,7 +1351,11 @@ var COLLECTIONS = [
1352
1351
  "event-occurrences",
1353
1352
  "event-tags"
1354
1353
  ];
1355
- var SERVER_ONLY_COLLECTIONS = ["customer-groups"];
1354
+ var SERVER_ONLY_COLLECTIONS = [
1355
+ "customer-groups",
1356
+ "reports",
1357
+ "community-bans"
1358
+ ];
1356
1359
  var SERVER_COLLECTIONS = [
1357
1360
  ...COLLECTIONS,
1358
1361
  ...SERVER_ONLY_COLLECTIONS
@@ -1968,7 +1971,15 @@ var CommerceClient = class {
1968
1971
  };
1969
1972
  this.product = {
1970
1973
  stockCheck: (params) => execute("/api/products/stock-check", params),
1971
- listingGroups: (params) => execute("/api/products/listing-groups", params)
1974
+ listingGroups: (params) => execute("/api/products/listing-groups", params),
1975
+ detail: async (params) => {
1976
+ try {
1977
+ return await execute("/api/products/detail", params);
1978
+ } catch (err) {
1979
+ if (err instanceof NotFoundError) return null;
1980
+ throw err;
1981
+ }
1982
+ }
1972
1983
  };
1973
1984
  this.cart = {
1974
1985
  get: cartApi.getCart.bind(cartApi),
@@ -2011,6 +2022,32 @@ var ProductApi = class extends BaseApi {
2011
2022
  params
2012
2023
  );
2013
2024
  }
2025
+ /**
2026
+ * Fetch full product detail by slug or id.
2027
+ * Returns `null` on 404 regardless of reason (`not_found` / `not_published` /
2028
+ * `tenant_mismatch` / `feature_disabled`). For the reason behind a null,
2029
+ * inspect `client.lastRequestId` against backend logs.
2030
+ */
2031
+ async detail(params) {
2032
+ try {
2033
+ return await this.request("/api/products/detail", params);
2034
+ } catch (err) {
2035
+ if (err instanceof NotFoundError) return null;
2036
+ throw err;
2037
+ }
2038
+ }
2039
+ /**
2040
+ * Atomically create or update a product together with its options,
2041
+ * option-values, and variants in a single transaction. Mirrors Shopify's
2042
+ * `productSet` shape and is the canonical write path for the MCP
2043
+ * `product-upsert` tool.
2044
+ */
2045
+ upsert(params) {
2046
+ return this.request(
2047
+ "/api/products/upsert",
2048
+ params
2049
+ );
2050
+ }
2014
2051
  };
2015
2052
 
2016
2053
  // src/core/api/discount-api.ts
@@ -2047,6 +2084,13 @@ var OrderApi = class extends BaseApi {
2047
2084
  updateTransaction(params) {
2048
2085
  return this.request("/api/transactions/update", params);
2049
2086
  }
2087
+ confirmPayment(params) {
2088
+ return this.request(
2089
+ "/api/orders/confirm-payment",
2090
+ params,
2091
+ params.providerEventId ? { headers: { "X-Idempotency-Key": params.providerEventId } } : void 0
2092
+ );
2093
+ }
2050
2094
  checkout(params) {
2051
2095
  return this.request("/api/orders/checkout", params);
2052
2096
  }
@@ -2096,7 +2140,9 @@ var ServerCommerceClient = class {
2096
2140
  const orderApi = new OrderApi(serverOptions);
2097
2141
  this.product = {
2098
2142
  stockCheck: productApi.stockCheck.bind(productApi),
2099
- listingGroups: productApi.listingGroups.bind(productApi)
2143
+ listingGroups: productApi.listingGroups.bind(productApi),
2144
+ detail: productApi.detail.bind(productApi),
2145
+ upsert: productApi.upsert.bind(productApi)
2100
2146
  };
2101
2147
  this.cart = {
2102
2148
  get: cartApi.getCart.bind(cartApi),
@@ -2112,6 +2158,7 @@ var ServerCommerceClient = class {
2112
2158
  create: orderApi.createOrder.bind(orderApi),
2113
2159
  update: orderApi.updateOrder.bind(orderApi),
2114
2160
  updateTransaction: orderApi.updateTransaction.bind(orderApi),
2161
+ confirmPayment: orderApi.confirmPayment.bind(orderApi),
2115
2162
  createFulfillment: orderApi.createFulfillment.bind(orderApi),
2116
2163
  updateFulfillment: orderApi.updateFulfillment.bind(orderApi),
2117
2164
  bulkImportFulfillments: orderApi.bulkImportFulfillments.bind(orderApi),
@@ -2182,10 +2229,24 @@ var customerKeys = {
2182
2229
  };
2183
2230
  var productKeys = {
2184
2231
  listingGroups: (options) => ["products", "listing-groups", "list", options],
2185
- listingGroupsInfinite: (options) => ["products", "listing-groups", "infinite", options]
2232
+ listingGroupsInfinite: (options) => ["products", "listing-groups", "infinite", options],
2233
+ detail: (params) => ["products", "detail", params],
2234
+ detailAll: () => ["products", "detail"]
2186
2235
  };
2187
2236
 
2188
2237
  // src/core/query/collection-hooks.ts
2238
+ var PRODUCT_DETAIL_INVALIDATING_COLLECTIONS = /* @__PURE__ */ new Set([
2239
+ "products",
2240
+ "product-variants",
2241
+ "product-options",
2242
+ "product-option-values",
2243
+ "product-categories",
2244
+ "product-tags",
2245
+ "product-collections",
2246
+ "brands",
2247
+ "brand-logos",
2248
+ "images"
2249
+ ]);
2189
2250
  var DEFAULT_PAGE_SIZE = 20;
2190
2251
  var CollectionHooks = class {
2191
2252
  constructor(queryClient, collectionClient) {
@@ -2343,6 +2404,9 @@ var CollectionHooks = class {
2343
2404
  this.queryClient.invalidateQueries({
2344
2405
  queryKey: collectionKeys(collection).all
2345
2406
  });
2407
+ if (PRODUCT_DETAIL_INVALIDATING_COLLECTIONS.has(collection)) {
2408
+ this.queryClient.invalidateQueries({ queryKey: ["products", "detail"] });
2409
+ }
2346
2410
  options?.onSuccess?.(data);
2347
2411
  },
2348
2412
  onError: options?.onError,
@@ -2363,6 +2427,9 @@ var CollectionHooks = class {
2363
2427
  this.queryClient.invalidateQueries({
2364
2428
  queryKey: collectionKeys(collection).all
2365
2429
  });
2430
+ if (PRODUCT_DETAIL_INVALIDATING_COLLECTIONS.has(collection)) {
2431
+ this.queryClient.invalidateQueries({ queryKey: ["products", "detail"] });
2432
+ }
2366
2433
  options?.onSuccess?.(data);
2367
2434
  },
2368
2435
  onError: options?.onError,
@@ -2379,6 +2446,9 @@ var CollectionHooks = class {
2379
2446
  this.queryClient.invalidateQueries({
2380
2447
  queryKey: collectionKeys(collection).all
2381
2448
  });
2449
+ if (PRODUCT_DETAIL_INVALIDATING_COLLECTIONS.has(collection)) {
2450
+ this.queryClient.invalidateQueries({ queryKey: ["products", "detail"] });
2451
+ }
2382
2452
  options?.onSuccess?.(data);
2383
2453
  },
2384
2454
  onError: options?.onError,
@@ -2531,7 +2601,7 @@ var CustomerHooks = class {
2531
2601
 
2532
2602
  // src/core/query/query-hooks.ts
2533
2603
  var QueryHooks = class extends CollectionHooks {
2534
- constructor(queryClient, collectionClient, customerAuth) {
2604
+ constructor(queryClient, collectionClient, customerAuth, commerceClient) {
2535
2605
  super(queryClient, collectionClient);
2536
2606
  // --- Customer hooks delegation ---
2537
2607
  this.useCustomerMe = (...args) => this._customer.useCustomerMe(...args);
@@ -2548,6 +2618,7 @@ var QueryHooks = class extends CollectionHooks {
2548
2618
  this.getCustomerData = () => this._customer.getCustomerData();
2549
2619
  this.setCustomerData = (data) => this._customer.setCustomerData(data);
2550
2620
  this._customer = new CustomerHooks(queryClient, customerAuth);
2621
+ this._commerce = commerceClient;
2551
2622
  }
2552
2623
  useProductListingGroupsQuery(params, options) {
2553
2624
  const queryOptions = params.options;
@@ -2641,6 +2712,21 @@ var QueryHooks = class extends CollectionHooks {
2641
2712
  staleTime: options?.staleTime
2642
2713
  });
2643
2714
  }
2715
+ useProductDetail(params, options) {
2716
+ const discriminator = "slug" in params ? params.slug : params.id;
2717
+ const enabled = options?.enabled !== false && Boolean(discriminator);
2718
+ return (0, import_react_query4.useQuery)({
2719
+ queryKey: productKeys.detail(params),
2720
+ queryFn: () => this._commerce.product.detail(params),
2721
+ enabled
2722
+ });
2723
+ }
2724
+ useProductDetailBySlug(slug, options) {
2725
+ return this.useProductDetail({ slug }, options);
2726
+ }
2727
+ useProductDetailById(id, options) {
2728
+ return this.useProductDetail({ id }, options);
2729
+ }
2644
2730
  };
2645
2731
 
2646
2732
  // src/core/client/client.ts
@@ -2703,7 +2789,8 @@ var Client = class {
2703
2789
  this.query = new QueryHooks(
2704
2790
  this.queryClient,
2705
2791
  collectionClient,
2706
- this.customer.auth
2792
+ this.customer.auth,
2793
+ this.commerce
2707
2794
  );
2708
2795
  }
2709
2796
  getState() {
@@ -2765,7 +2852,7 @@ var ServerClient = class {
2765
2852
  onRequestId
2766
2853
  );
2767
2854
  this.queryClient = getQueryClient();
2768
- this.query = new QueryHooks(this.queryClient, this.collections);
2855
+ this.query = new QueryHooks(this.queryClient, this.collections, void 0, this.commerce);
2769
2856
  }
2770
2857
  getState() {
2771
2858
  return { ...this.state };