@warp-drive-mirror/core 5.10.0-alpha.16 → 5.10.0-alpha.18

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 (70) hide show
  1. package/dist/-private-Y-13dsHO.js.map +1 -1
  2. package/dist/build-config/babel-macros.d.ts +0 -5
  3. package/dist/build-config/canary-features.d.ts +0 -5
  4. package/dist/build-config/debugging.d.ts +0 -59
  5. package/dist/build-config/deprecations.d.ts +0 -5
  6. package/dist/build-config.d.ts +0 -17
  7. package/dist/configure.d.ts +0 -8
  8. package/dist/graph/-private.d.ts +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/{internal-BOC6nyCi.d.ts → internal-DTPBJZLO.d.ts} +2 -1
  12. package/dist/{internal-BOC6nyCi.d.ts.map → internal-DTPBJZLO.d.ts.map} +1 -1
  13. package/dist/reactive/-private.d.ts +1 -1
  14. package/dist/reactive.d.ts +1 -276
  15. package/dist/reactive.js +1 -1
  16. package/dist/request.d.ts +1 -9
  17. package/dist/signals/-leaked.d.ts +1 -15
  18. package/dist/signals/-leaked.d.ts.map +1 -1
  19. package/dist/{src-DDLNZD8D.js → src-PuYJ-RSZ.js} +1 -279
  20. package/dist/src-PuYJ-RSZ.js.map +1 -0
  21. package/dist/store/-private.d.ts +1 -1
  22. package/dist/store/-private.js +1 -1
  23. package/dist/store.d.ts +1 -6
  24. package/dist/types/-private.js +1 -1
  25. package/dist/types/cache/relationship.d.ts +0 -5
  26. package/dist/types/cache.d.ts +1 -6
  27. package/dist/types/graph.d.ts +0 -5
  28. package/dist/types/record.d.ts +0 -5
  29. package/dist/types/request.d.ts +1 -1
  30. package/dist/types/schema/concepts.d.ts +0 -5
  31. package/dist/types/schema/schema-service.d.ts +1 -6
  32. package/dist/types/spec/error.d.ts +0 -4
  33. package/dist/types/spec/json-api-raw.d.ts +0 -5
  34. package/dist/types.d.ts +1 -9
  35. package/dist/unpkg/dev/-private-BoKjsWc1.js.map +1 -1
  36. package/dist/unpkg/dev/index.js +1 -1
  37. package/dist/unpkg/dev/reactive.js +1 -1
  38. package/dist/unpkg/dev/runtime-DhiRXM4s.js.map +1 -1
  39. package/dist/unpkg/dev/{src-DKHeerUf.js → src-Dy9m6GTv.js} +1 -279
  40. package/dist/unpkg/dev/src-Dy9m6GTv.js.map +1 -0
  41. package/dist/unpkg/dev/store/-private.js +1 -1
  42. package/dist/unpkg/dev/types/-private.js +1 -1
  43. package/dist/unpkg/dev-deprecated/-private-BoKjsWc1.js.map +1 -1
  44. package/dist/unpkg/dev-deprecated/index.js +1 -1
  45. package/dist/unpkg/dev-deprecated/reactive.js +1 -1
  46. package/dist/unpkg/dev-deprecated/runtime-DtHRI2Rj.js.map +1 -1
  47. package/dist/unpkg/dev-deprecated/{src-lyEz1lmd.js → src-ByOiBTF3.js} +1 -279
  48. package/dist/unpkg/dev-deprecated/src-ByOiBTF3.js.map +1 -0
  49. package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
  50. package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
  51. package/dist/unpkg/prod/-private-CRDwlN1v.js.map +1 -1
  52. package/dist/unpkg/prod/index.js +1 -1
  53. package/dist/unpkg/prod/reactive.js +1 -1
  54. package/dist/unpkg/prod/{src-Dagh1FmP.js → src-NuWjjfax.js} +1 -279
  55. package/dist/unpkg/prod/src-NuWjjfax.js.map +1 -0
  56. package/dist/unpkg/prod/store/-private.js +1 -1
  57. package/dist/unpkg/prod/types/-private.js +1 -1
  58. package/dist/unpkg/prod-deprecated/-private-CRDwlN1v.js.map +1 -1
  59. package/dist/unpkg/prod-deprecated/index.js +1 -1
  60. package/dist/unpkg/prod-deprecated/reactive.js +1 -1
  61. package/dist/unpkg/prod-deprecated/{src-3nV2sDcO.js → src-Bt7BkX1Y.js} +1 -279
  62. package/dist/unpkg/prod-deprecated/src-Bt7BkX1Y.js.map +1 -0
  63. package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
  64. package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
  65. package/package.json +6 -6
  66. package/dist/src-DDLNZD8D.js.map +0 -1
  67. package/dist/unpkg/dev/src-DKHeerUf.js.map +0 -1
  68. package/dist/unpkg/dev-deprecated/src-lyEz1lmd.js.map +0 -1
  69. package/dist/unpkg/prod/src-Dagh1FmP.js.map +0 -1
  70. package/dist/unpkg/prod-deprecated/src-3nV2sDcO.js.map +0 -1
@@ -1,3 +1,3 @@
1
- import { A as setIdentifierGenerationMethod, M as setIdentifierUpdateMethod, N as setKeyInfoForResource, S as recordIdentifierFor, h as Store, j as setIdentifierResetMethod, k as setIdentifierForgetMethod, m as CacheHandler, n as RequestManager, r as Fetch, t as useRecommendedStore, w as storeFor } from "./src-DKHeerUf.js";
1
+ import { A as setIdentifierGenerationMethod, M as setIdentifierUpdateMethod, N as setKeyInfoForResource, S as recordIdentifierFor, h as Store, j as setIdentifierResetMethod, k as setIdentifierForgetMethod, m as CacheHandler, n as RequestManager, r as Fetch, t as useRecommendedStore, w as storeFor } from "./src-Dy9m6GTv.js";
2
2
 
3
3
  export { CacheHandler, Fetch, RequestManager, Store, recordIdentifierFor as cacheKeyFor, recordIdentifierFor, setIdentifierForgetMethod, setIdentifierGenerationMethod, setIdentifierResetMethod, setIdentifierUpdateMethod, setKeyInfoForResource, storeFor, useRecommendedStore };
@@ -1,5 +1,5 @@
1
1
  import { d as getRequestState, t as getPromiseState, u as createRequestSubscription } from "./-private-BoKjsWc1.js";
2
2
  import { t as Checkout } from "./-private-CmNOwhK0.js";
3
- import { a as fromIdentity, c as instantiateRecord, d as commit, i as SchemaService, l as teardownRecord, o as registerDerivations, s as withDefaults, u as checkout } from "./src-DKHeerUf.js";
3
+ import { a as fromIdentity, c as instantiateRecord, d as commit, i as SchemaService, l as teardownRecord, o as registerDerivations, s as withDefaults, u as checkout } from "./src-Dy9m6GTv.js";
4
4
 
5
5
  export { Checkout, SchemaService, checkout, commit, createRequestSubscription, fromIdentity, getPromiseState, getRequestState, instantiateRecord, registerDerivations, teardownRecord, withDefaults };
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-DhiRXM4s.js","names":["each","array","Array","isArray","Error","macroCondition","predicate","config","packageRoot","runtimeConfig","packages","getGlobalConfig","global","isTesting","g","e","Boolean","setTesting","globalThis","__embroider_macros__runtime_config__","localConfig","initializeRuntimeMacrosConfig","Object","assign","updaterMethods","setConfig","value","setGlobalConfig","key","updaters","window","_embroider_macros_runtime_config","undefined","methods","updater"],"sources":["../../../../../node_modules/.pnpm/@embroider+macros@1.21.3/node_modules/@embroider/macros/src/addon/runtime.js"],"sourcesContent":["/*\n These are the runtime implementations for the javascript macros that have\n runtime implementations.\n\n Not every macro has a runtime implementation, some only make sense in the\n build and always run there.\n\n Even when we have runtime implementations, we are still careful to emit static\n errors during the build wherever possible, and runtime errors when necessary,\n so that you're not surprised when you switch from runtime-mode to compile-time\n mode.\n*/\n\n/*\n CAUTION: in classic builds, this file gets shared by all present copies of\n @embroider/macros. If you want to change its public API, you need to rename it\n and update `pathToRuntime` in ../babel/state.ts to point at it, so that your\n babel plugin and runtime will match.\n*/\n\nexport function each(array) {\n if (!Array.isArray(array)) {\n throw new Error(`the argument to the each() macro must be an array`);\n }\n return array;\n}\n\nexport function macroCondition(predicate) {\n return predicate;\n}\n\n// This is here as a compile target for `getConfig` and `getOwnConfig` when\n// we're in runtime mode. This is not public API to call from your own code.\nexport function config(packageRoot) {\n return runtimeConfig.packages[packageRoot];\n}\n\nexport function getGlobalConfig() {\n return runtimeConfig.global;\n}\n\nexport function isTesting() {\n let g = runtimeConfig.global;\n let e = g && g['@embroider/macros'];\n return Boolean(e && e.isTesting);\n}\n\nexport function setTesting(isTesting) {\n if (!runtimeConfig.global) {\n runtimeConfig.global = {};\n }\n if (!runtimeConfig.global['@embroider/macros']) {\n runtimeConfig.global['@embroider/macros'] = {};\n }\n runtimeConfig.global['@embroider/macros'].isTesting = Boolean(isTesting);\n}\n\n// Welcome intrepid developer!\n//\n// While this data is \"global\", this is a private variable.\n//\n// do not build features based off of its contents,\n// or assume it will have the same name in future releases.\nconst runtimeConfig = globalThis.__embroider_macros__runtime_config__ ||= {};\n\nruntimeConfig.packages ||= {};\nruntimeConfig.global ||= {};\n\n// In the off chance there are duplicate copies of @embroider/macros in the dep graph\n// (due to the package manager messing up)\n// Let's try to merge them together via the above global well known variable\nconst localConfig = initializeRuntimeMacrosConfig();\n\nObject.assign(runtimeConfig.packages, localConfig.packages);\nObject.assign(runtimeConfig.global, localConfig.global);\n\n// this exists to be targeted by our babel plugin\nfunction initializeRuntimeMacrosConfig() {\n return { packages: {}, global: {} };\n}\n\nfunction updaterMethods() {\n return {\n config,\n getGlobalConfig,\n setConfig(packageRoot, value) {\n runtimeConfig.packages[packageRoot] = value;\n },\n setGlobalConfig(key, value) {\n runtimeConfig.global[key] = value;\n },\n };\n}\n\n// this is how runtime config can get injected at boot. I'm not sure yet if this\n// should be public API, but we certainly need it internally to set things like\n// the global fastboot.isRunning.\n//\n// consumers of this API push a function onto\n// window._embroider_macros_runtime_config. The function is given four methods\n// which allow it to read and write the per-package and global configs. The\n// reason for allowing both read & write is that merging strategies are up to\n// each consumers -- read first, then merge, then write.\n//\n// For an example user of this API, see where we generate\n// embroider_macros_fastboot_init.js' in @embroider/core.\nlet updaters = typeof window !== 'undefined' ? window._embroider_macros_runtime_config : undefined;\nif (updaters) {\n let methods = updaterMethods();\n for (let updater of updaters) {\n updater(methods);\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";AAiCA,SAAgBO,OAAOC,aAAa;CAClC,OAAOC,cAAcC,SAASF;AAChC;AAEA,SAAgBG,kBAAkB;CAChC,OAAOF,cAAcG;AACvB;AAwBA,MAAMH,gBAAgBS,WAAWC,yCAAyC,CAAC;AAE3EV,cAAcC,aAAa,CAAC;AAC5BD,cAAcG,WAAW,CAAC;AAK1B,MAAMQ,cAAcC,8BAA8B;AAElDC,OAAOC,OAAOd,cAAcC,UAAUU,YAAYV,QAAQ;AAC1DY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AC9B;CACF;AACF;AAcA,IAAIG,WAAW,OAAOC,WAAW,cAAcA,OAAOC,mCAAmCC;AACzF,IAAIH,UAAU;CACZ,IAAII,UAAUT,eAAe;CAC7B,KAAK,IAAIU,WAAWL,UAClBK,QAAQD,OAAO;AAEnB"}
1
+ {"version":3,"file":"runtime-DhiRXM4s.js","names":["each","array","Array","isArray","Error","macroCondition","predicate","config","packageRoot","runtimeConfig","packages","getGlobalConfig","global","isTesting","g","e","Boolean","setTesting","globalThis","__embroider_macros__runtime_config__","localConfig","initializeRuntimeMacrosConfig","Object","assign","updaterMethods","setConfig","value","setGlobalConfig","key","updaters","window","_embroider_macros_runtime_config","undefined","methods","updater"],"sources":["../../../../../node_modules/.pnpm/@embroider+macros@1.21.3/node_modules/@embroider/macros/src/addon/runtime.js"],"sourcesContent":["/*\n These are the runtime implementations for the javascript macros that have\n runtime implementations.\n\n Not every macro has a runtime implementation, some only make sense in the\n build and always run there.\n\n Even when we have runtime implementations, we are still careful to emit static\n errors during the build wherever possible, and runtime errors when necessary,\n so that you're not surprised when you switch from runtime-mode to compile-time\n mode.\n*/\n\n/*\n CAUTION: in classic builds, this file gets shared by all present copies of\n @embroider/macros. If you want to change its public API, you need to rename it\n and update `pathToRuntime` in ../babel/state.ts to point at it, so that your\n babel plugin and runtime will match.\n*/\n\nexport function each(array) {\n if (!Array.isArray(array)) {\n throw new Error(`the argument to the each() macro must be an array`);\n }\n return array;\n}\n\nexport function macroCondition(predicate) {\n return predicate;\n}\n\n// This is here as a compile target for `getConfig` and `getOwnConfig` when\n// we're in runtime mode. This is not public API to call from your own code.\nexport function config(packageRoot) {\n return runtimeConfig.packages[packageRoot];\n}\n\nexport function getGlobalConfig() {\n return runtimeConfig.global;\n}\n\nexport function isTesting() {\n let g = runtimeConfig.global;\n let e = g && g['@embroider/macros'];\n return Boolean(e && e.isTesting);\n}\n\nexport function setTesting(isTesting) {\n if (!runtimeConfig.global) {\n runtimeConfig.global = {};\n }\n if (!runtimeConfig.global['@embroider/macros']) {\n runtimeConfig.global['@embroider/macros'] = {};\n }\n runtimeConfig.global['@embroider/macros'].isTesting = Boolean(isTesting);\n}\n\n// Welcome intrepid developer!\n//\n// While this data is \"global\", this is a private variable.\n//\n// do not build features based off of its contents,\n// or assume it will have the same name in future releases.\nconst runtimeConfig = globalThis.__embroider_macros__runtime_config__ ||= {};\n\nruntimeConfig.packages ||= {};\nruntimeConfig.global ||= {};\n\n// In the off chance there are duplicate copies of @embroider/macros in the dep graph\n// (due to the package manager messing up)\n// Let's try to merge them together via the above global well known variable\nconst localConfig = initializeRuntimeMacrosConfig();\n\nObject.assign(runtimeConfig.packages, localConfig.packages);\nObject.assign(runtimeConfig.global, localConfig.global);\n\n// this exists to be targeted by our babel plugin\nfunction initializeRuntimeMacrosConfig() {\n return { packages: {}, global: {} };\n}\n\nfunction updaterMethods() {\n return {\n config,\n getGlobalConfig,\n setConfig(packageRoot, value) {\n runtimeConfig.packages[packageRoot] = value;\n },\n setGlobalConfig(key, value) {\n runtimeConfig.global[key] = value;\n },\n };\n}\n\n// this is how runtime config can get injected at boot. I'm not sure yet if this\n// should be public API, but we certainly need it internally to set things like\n// the global fastboot.isRunning.\n//\n// consumers of this API push a function onto\n// window._embroider_macros_runtime_config. The function is given four methods\n// which allow it to read and write the per-package and global configs. The\n// reason for allowing both read & write is that merging strategies are up to\n// each consumers -- read first, then merge, then write.\n//\n// For an example user of this API, see where we generate\n// embroider_macros_fastboot_init.js' in @embroider/core.\nlet updaters = typeof window !== 'undefined' ? window._embroider_macros_runtime_config : undefined;\nif (updaters) {\n let methods = updaterMethods();\n for (let updater of updaters) {\n updater(methods);\n }\n}\n"],"ignoreList":[0],"mappings":";AAiCA,SAAgBO,OAAOC,aAAa;CAClC,OAAOC,cAAcC,SAASF;AAChC;AAEA,SAAgBG,kBAAkB;CAChC,OAAOF,cAAcG;AACvB;AAwBA,MAAMH,gBAAgBS,WAAWC,yCAAyC,CAAC;AAE3EV,cAAcC,aAAa,CAAC;AA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B,aAAakB,OAAO;GAC5BjB,cAAcC,SAASF,eAAekB;EACxC;EACAC,gBAAgBC,KAAKF,OAAO;GAC1BjB,cAAcG,OAAOgB,OAAOF;EAC9B;CACF;AACF;AAcA,IAAIG,WAAW,OAAOC,WAAW,cAAcA,OAAOC,mCAAmCC;AACzF,IAAIH,UAAU;CACZ,IAAII,UAAUT,eAAe;CAC7B,KAAK,IAAIU,WAAWL,UAClBK,QAAQD,OAAO;AAEnB"}
@@ -7595,284 +7595,6 @@ function mergeMap(base, toApply) {
7595
7595
  for (const [key, value] of toApply) base.set(key, value);
7596
7596
  }
7597
7597
 
7598
- //#endregion
7599
- //#region src/reactive.ts
7600
- /**
7601
- * # About
7602
- *
7603
- * This module provides an implementation of reactive objects that a Store may use for creating
7604
- * reactive representations of the raw data for requests, resources and their relationships
7605
- * stored in the cache.
7606
- *
7607
- * - For configuring the store to use these reactive objects, see [The Setup Guide](/guides/configuration/)
7608
- * - For defining resource schemas, see [The Schema Guide](/guides/the-manual/schemas/)
7609
- *
7610
- * Any method that returns a record instance will use the `instantiateRecord`
7611
- * hook configured above to instantiate a ReactiveResource once this is in place.
7612
- * After that, its up to you what ReactiveResource can do.
7613
- *
7614
- * ## Modes
7615
- *
7616
- * ReactiveResource has two modes: `legacy` and `polaris`.
7617
- *
7618
- * **LegacyMode** can be used to emulate the behaviors and capabilities of WarpDrive's `Model` class,
7619
- * and because there is little distinction between Model and a ReactiveResource in LegacyMode we refer
7620
- * to both of these approaches as LegacyMode. This mode is the default experience in V5.
7621
- *
7622
- * In LegacyMode:
7623
- *
7624
- * - records are mutable
7625
- * - local changes immediately reflect app wide
7626
- * - records have all the APIs of Model (references, state props, currentState, methods etc)
7627
- * - the continued use of `@warp-drive-mirror/legacy` is required (though most imports from it can be removed)
7628
- * - `async: true` relationships are supported (but not recommended outside of [LinksMode](/guides/the-manual/misc/links-mode.md))
7629
- *
7630
- * ---
7631
- *
7632
- * **PolarisMode** is an upcoming suite of features that will become the default experience in V6.
7633
- *
7634
- * In PolarisMode:
7635
- *
7636
- * - records are immutable, unless creating a new resource or explicitly checking out a record for editing
7637
- * - local changes are isolated until committed, displaying only via the editable version of the record
7638
- * - records have a more limited API, focused on only what is in their schema.
7639
- * - some common operations may have more friction to perform because intended utilities are not yet available
7640
- * - `async: true` relationships are not supported (see [LinksMode](/guides/the-manual/misc/links-mode.md))
7641
- * - The `@warp-drive-mirror/legacy` package is not required
7642
- *
7643
- * These modes are interopable. The reactive object (record) for a resource in PolarisMode can relate to
7644
- * a record in LegacyMode and vice-versa. This interopability is true whether the record in LegacyMode is
7645
- * a ReactiveResource or a Model.
7646
- *
7647
- * ---
7648
- *
7649
- * ## Basic Usage
7650
- *
7651
- * ReactiveResource is a reactive object that transforms raw data from an associated
7652
- * cache into reactive data backed by Signals.
7653
- *
7654
- * The shape of the object and the transformation of raw cache data into its
7655
- * reactive form is controlled by a resource schema.
7656
- *
7657
- * For instance, lets say your API is a [{json:api}](https://jsonapi.org) and your store is using
7658
- * the Cache provided by {@link @warp-drive-mirror/json-api! | @warp-drive-mirror/json-api}, and a request
7659
- * returns the following raw data:
7660
- *
7661
- * ```ts
7662
- * {
7663
- * data: {
7664
- * type: 'user',
7665
- * id: '1',
7666
- * attributes: { firstName: 'Chris', lastName: 'Thoburn' },
7667
- * relationships: { pets: { data: [{ type: 'dog', id: '1' }] }}
7668
- * },
7669
- * included: [
7670
- * {
7671
- * type: 'dog',
7672
- * id: '1',
7673
- * attributes: { name: 'Rey' },
7674
- * relationships: { owner: { data: { type: 'user', id: '1' }}}
7675
- * }
7676
- * ]
7677
- * }
7678
- * ```
7679
- *
7680
- * We could describe the `'user'` and `'dog'` resources in the above payload
7681
- * with the following schemas:
7682
- *
7683
- * ```ts
7684
- * store.schema.registerResources([
7685
- * {
7686
- * type: 'user',
7687
- * identity: { type: '@id', name: 'id' },
7688
- * fields: [
7689
- * {
7690
- * type: '@identity',
7691
- * name: '$type',
7692
- * kind: 'derived',
7693
- * options: { key: 'type' },
7694
- * },
7695
- * { kind: 'field', name: 'firstName' },
7696
- * { kind: 'field', name: 'lastName' },
7697
- * {
7698
- * kind: 'derived',
7699
- * name: 'name',
7700
- * type: 'concat',
7701
- * options: { fields: ['firstName', 'lastName'], separator: ' ' }
7702
- * },
7703
- * {
7704
- * kind: 'hasMany',
7705
- * name: 'pets',
7706
- * type: 'pet',
7707
- * options: {
7708
- * async: false,
7709
- * inverse: 'owner',
7710
- * polymorphic: true,
7711
- * linksMode: true,
7712
- * }
7713
- * }
7714
- * ]
7715
- * },
7716
- * {
7717
- * type: 'dog',
7718
- * identity: { type: '@id', name: 'id' },
7719
- * fields: [
7720
- * {
7721
- * type: '@identity',
7722
- * name: '$type',
7723
- * kind: 'derived',
7724
- * options: { key: 'type' },
7725
- * },
7726
- * { kind: 'field', name: 'name' },
7727
- * {
7728
- * kind: 'belongsTo',
7729
- * name: 'owner',
7730
- * type: 'user',
7731
- * options: {
7732
- * async: false,
7733
- * inverse: 'pets',
7734
- * as: 'pet',
7735
- * linksMode: true,
7736
- * }
7737
- * }
7738
- * ]
7739
- * }
7740
- * ]);
7741
- * ```
7742
- *
7743
- * With these schemas in place, the reactive objects that the store would
7744
- * provide us whenever we encountered a `'user'` or a `'dog'` would be:
7745
- *
7746
- * ```ts
7747
- * interface Pet {
7748
- * readonly id: string;
7749
- * readonly owner: User;
7750
- * }
7751
- *
7752
- * interface Dog extends Pet {
7753
- * readonly $type: 'dog';
7754
- * readonly name: string;
7755
- * }
7756
- *
7757
- * interface EditableUser {
7758
- * readonly $type: 'user';
7759
- * readonly id: string;
7760
- * firstName: string;
7761
- * lastName: string;
7762
- * readonly name: string;
7763
- * pets: Array<Dog | Pet>;
7764
- * }
7765
- *
7766
- * interface User {
7767
- * readonly $type: 'user';
7768
- * readonly id: string;
7769
- * readonly firstName: string;
7770
- * readonly lastName: string;
7771
- * readonly name: string;
7772
- * readonly pets: Readonly<Array<Dog | Pet>>;
7773
- * [Checkout](): Promise<EditableUser>
7774
- * }>
7775
- * ```
7776
- *
7777
- * Note how based on the schema the reactive object we receive is able to produce
7778
- * `name` on user (despite no name field being in the cache), provide `$type`
7779
- * pulled from the identity of the resource, and flatten the individual attributes
7780
- * and relationships onto the record for easier use.
7781
- *
7782
- * Notice also how we typed this object with `readonly`. This is because while
7783
- * ReactiveResource instances are ***deeply reactive***, they are also ***immutable***.
7784
- *
7785
- * We can mutate a ReactiveResource only be explicitly asking permission to do so, and
7786
- * in the process gaining access to an editable copy. The immutable version will
7787
- * not show any in-process edits made to this editable copy.
7788
- *
7789
- * ```ts
7790
- * import { checkout } from '@warp-drive-mirror/core/reactive';
7791
- *
7792
- * const editable = await checkout<EditableUser>(user);
7793
- * ```
7794
- *
7795
- * ## Utilities
7796
- *
7797
- * ReactiveResource provides a schema builder that simplifies setting up a couple of
7798
- * conventional fields like identity and `$type`. We can rewrite the schema
7799
- * definition above using this utility like so:
7800
- *
7801
- * ```ts
7802
- * import { withDefaults } from '@warp-drive-mirror/core/reactive';
7803
- *
7804
- * store.schema.registerResources([
7805
- * withDefaults({
7806
- * type: 'user',
7807
- * fields: [
7808
- * { kind: 'field', name: 'firstName' },
7809
- * { kind: 'field', name: 'lastName' },
7810
- * {
7811
- * kind: 'derived',
7812
- * name: 'name',
7813
- * type: 'concat',
7814
- * options: { fields: ['firstName', 'lastName'], separator: ' ' }
7815
- * },
7816
- * {
7817
- * kind: 'hasMany',
7818
- * name: 'pets',
7819
- * type: 'pet',
7820
- * options: {
7821
- * async: false,
7822
- * inverse: 'owner',
7823
- * polymorphic: true,
7824
- * linksMode: true,
7825
- * resetOnRemoteUpdate: false,
7826
- * }
7827
- * }
7828
- * ]
7829
- * }),
7830
- * withDefaults({
7831
- * type: 'dog',
7832
- * fields: [
7833
- * { kind: 'field', name: 'name' },
7834
- * {
7835
- * kind: 'belongsTo',
7836
- * name: 'owner',
7837
- * type: 'user',
7838
- * options: {
7839
- * async: false,
7840
- * inverse: 'pets',
7841
- * as: 'pet',
7842
- * linksMode: true,
7843
- * resetOnRemoteUpdate: false,
7844
- * }
7845
- * }
7846
- * ]
7847
- * })
7848
- * ]);
7849
- * ```
7850
- *
7851
- * ## Type Support
7852
- *
7853
- * ### Resource Schemas
7854
- *
7855
- * - {@link PolarisResourceSchema}
7856
- * - {@link LegacyResourceSchema}
7857
- * - {@link ObjectSchema}
7858
- *
7859
- * ### Resource Schema Type Utils
7860
- *
7861
- * - {@link resourceSchema}
7862
- * - {@link objectSchema}
7863
- * - {@link isResourceSchema}
7864
- * - {@link isLegacyResourceSchema}
7865
- *
7866
- * ### Field Schemas
7867
- *
7868
- * - {@link LegacyModeFieldSchema}
7869
- * - {@link PolarisModeFieldSchema}
7870
- *
7871
- * @summary Schema-driven reactive records, arrays, and documents the store builds from cached data, plus the
7872
- * `SchemaService` and schema types that define them.
7873
- * @module
7874
- */
7875
-
7876
7598
  //#endregion
7877
7599
  //#region src/request/-private/fetch.ts
7878
7600
  const _fetch = typeof fetch !== "undefined" ? (...args) => fetch(...args) : typeof FastBoot !== "undefined" ? (...args) => FastBoot.require("node-fetch")(...args) : () => {
@@ -8547,4 +8269,4 @@ function useRecommendedStore(options, StoreKlass = Store) {
8547
8269
 
8548
8270
  //#endregion
8549
8271
  export { setIdentifierGenerationMethod as A, setRecordIdentifier as C, isRequestKey as D, fieldValueIdentity as E, coerceId as F, ensureStringId as I, log as L, setIdentifierUpdateMethod as M, setKeyInfoForResource as N, isResourceKey as O, normalizeModelName as P, logGroup as R, recordIdentifierFor as S, assertPrivateCapabilities as T, isPrivateStore as _, fromIdentity as a, StoreMap as b, instantiateRecord as c, commit as d, createLegacyManyArray as f, assertPrivateStore as g, Store as h, SchemaService as i, setIdentifierResetMethod as j, setIdentifierForgetMethod as k, teardownRecord as l, CacheHandler as m, RequestManager as n, registerDerivations as o, constructResource as p, Fetch as r, withDefaults as s, useRecommendedStore as t, checkout as u, RecordArrayManager as v, storeFor as w, _clearCaches as x, fastPush as y };
8550
- //# sourceMappingURL=src-DKHeerUf.js.map
8272
+ //# sourceMappingURL=src-Dy9m6GTv.js.map