@warp-drive/utilities 5.6.0-alpha.15 → 5.6.0-alpha.17

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 (73) hide show
  1. package/declarations/-private/active-record/find-record.d.ts +59 -60
  2. package/declarations/-private/active-record/query.d.ts +50 -51
  3. package/declarations/-private/active-record/save-record.d.ts +136 -134
  4. package/declarations/-private/builder-utils.d.ts +2 -3
  5. package/declarations/-private/handlers/auto-compress.d.ts +142 -143
  6. package/declarations/-private/handlers/gated.d.ts +12 -13
  7. package/declarations/-private/handlers/utils.d.ts +22 -23
  8. package/declarations/-private/json-api/-utils.d.ts +96 -97
  9. package/declarations/-private/json-api/find-record.d.ts +59 -60
  10. package/declarations/-private/json-api/query.d.ts +97 -98
  11. package/declarations/-private/json-api/save-record.d.ts +180 -178
  12. package/declarations/-private/json-api/serialize.d.ts +43 -44
  13. package/declarations/-private/rest/find-record.d.ts +59 -60
  14. package/declarations/-private/rest/query.d.ts +50 -51
  15. package/declarations/-private/rest/save-record.d.ts +136 -134
  16. package/declarations/-private/string/inflect.d.ts +60 -83
  17. package/declarations/-private/string/inflections.d.ts +4 -5
  18. package/declarations/-private/string/transform.d.ts +68 -80
  19. package/declarations/-private.d.ts +1 -2
  20. package/declarations/active-record.d.ts +3 -4
  21. package/declarations/handlers.d.ts +8 -9
  22. package/declarations/index.d.ts +180 -182
  23. package/declarations/json-api.d.ts +5 -6
  24. package/declarations/rest.d.ts +3 -4
  25. package/declarations/string.d.ts +13 -14
  26. package/dist/active-record.js +1 -1
  27. package/dist/{inflect-Dr20y6b1.js → inflect-BSG696t-.js} +0 -32
  28. package/dist/json-api.js +1 -1
  29. package/dist/rest.js +1 -1
  30. package/dist/string.cjs +0 -33
  31. package/dist/string.js +1 -1
  32. package/package.json +5 -5
  33. package/declarations/-private/active-record/find-record.d.ts.map +0 -1
  34. package/declarations/-private/active-record/query.d.ts.map +0 -1
  35. package/declarations/-private/active-record/save-record.d.ts.map +0 -1
  36. package/declarations/-private/builder-utils.d.ts.map +0 -1
  37. package/declarations/-private/derivations.d.ts +0 -23
  38. package/declarations/-private/derivations.d.ts.map +0 -1
  39. package/declarations/-private/handlers/auto-compress.d.ts.map +0 -1
  40. package/declarations/-private/handlers/gated.d.ts.map +0 -1
  41. package/declarations/-private/handlers/utils.d.ts.map +0 -1
  42. package/declarations/-private/json-api/-utils.d.ts.map +0 -1
  43. package/declarations/-private/json-api/find-record.d.ts.map +0 -1
  44. package/declarations/-private/json-api/find-record.type-test.d.ts +0 -2
  45. package/declarations/-private/json-api/find-record.type-test.d.ts.map +0 -1
  46. package/declarations/-private/json-api/query.d.ts.map +0 -1
  47. package/declarations/-private/json-api/query.type-test.d.ts +0 -2
  48. package/declarations/-private/json-api/query.type-test.d.ts.map +0 -1
  49. package/declarations/-private/json-api/save-record.d.ts.map +0 -1
  50. package/declarations/-private/json-api/serialize.d.ts.map +0 -1
  51. package/declarations/-private/rest/find-record.d.ts.map +0 -1
  52. package/declarations/-private/rest/query.d.ts.map +0 -1
  53. package/declarations/-private/rest/save-record.d.ts.map +0 -1
  54. package/declarations/-private/string/inflect.d.ts.map +0 -1
  55. package/declarations/-private/string/inflections.d.ts.map +0 -1
  56. package/declarations/-private/string/transform.d.ts.map +0 -1
  57. package/declarations/-private.d.ts.map +0 -1
  58. package/declarations/active-record.d.ts.map +0 -1
  59. package/declarations/handlers.d.ts.map +0 -1
  60. package/declarations/index.d.ts.map +0 -1
  61. package/declarations/json-api.d.ts.map +0 -1
  62. package/declarations/rest.d.ts.map +0 -1
  63. package/declarations/string.d.ts.map +0 -1
  64. package/dist/-private.js.map +0 -1
  65. package/dist/active-record.js.map +0 -1
  66. package/dist/builder-utils-Donkk-BZ.js.map +0 -1
  67. package/dist/handlers.js.map +0 -1
  68. package/dist/index.js.map +0 -1
  69. package/dist/inflect-Dr20y6b1.js.map +0 -1
  70. package/dist/json-api.js.map +0 -1
  71. package/dist/rest.js.map +0 -1
  72. package/dist/string.cjs.map +0 -1
  73. package/dist/string.js.map +0 -1
@@ -1,66 +1,65 @@
1
- import type { TypeFromInstance } from '@warp-drive/core/types/record';
2
- import type { FindRecordOptions, FindRecordRequestOptions, RemotelyAccessibleIdentifier } from '@warp-drive/core/types/request';
3
- import type { SingleResourceDataDocument } from '@warp-drive/core/types/spec/document';
4
- export type FindRecordResultDocument<T> = Omit<SingleResourceDataDocument<T>, 'data'> & {
5
- data: T;
1
+ import type { TypeFromInstance } from "@warp-drive/core/types/record";
2
+ import type { FindRecordOptions, FindRecordRequestOptions, RemotelyAccessibleIdentifier } from "@warp-drive/core/types/request";
3
+ import type { SingleResourceDataDocument } from "@warp-drive/core/types/spec/document";
4
+ export type FindRecordResultDocument<T> = Omit<SingleResourceDataDocument<T>, "data"> & {
5
+ data: T;
6
6
  };
7
7
  /**
8
- * Builds request options to fetch a single resource by a known id or identifier
9
- * configured for the url and header expectations of most ActiveRecord APIs.
10
- *
11
- * **Basic Usage**
12
- *
13
- * ```ts
14
- * import { findRecord } from '@warp-drive/utilities/active-record';
15
- *
16
- * const data = await store.request(findRecord('person', '1'));
17
- * ```
18
- *
19
- * **With Options**
20
- *
21
- * ```ts
22
- * import { findRecord } from '@warp-drive/utilities/active-record';
23
- *
24
- * const options = findRecord('person', '1', { include: ['pets', 'friends'] });
25
- * const data = await store.request(options);
26
- * ```
27
- *
28
- * **With an Identifier**
29
- *
30
- * ```ts
31
- * import { findRecord } from '@warp-drive/utilities/active-record';
32
- *
33
- * const options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });
34
- * const data = await store.request(options);
35
- * ```
36
- *
37
- * **Supplying Options to Modify the Request Behavior**
38
- *
39
- * The following options are supported:
40
- *
41
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
42
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
43
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type
44
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
45
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
46
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
47
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
48
- * defaulting to `false` if none is configured.
49
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
50
- *
51
- * ```ts
52
- * import { findRecord } from '@warp-drive/utilities/active-record';
53
- *
54
- * const options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });
55
- * const data = await store.request(options);
56
- * ```
57
- *
58
- * @public
59
- * @param identifier
60
- * @param options
61
- */
8
+ * Builds request options to fetch a single resource by a known id or identifier
9
+ * configured for the url and header expectations of most ActiveRecord APIs.
10
+ *
11
+ * **Basic Usage**
12
+ *
13
+ * ```ts
14
+ * import { findRecord } from '@warp-drive/utilities/active-record';
15
+ *
16
+ * const data = await store.request(findRecord('person', '1'));
17
+ * ```
18
+ *
19
+ * **With Options**
20
+ *
21
+ * ```ts
22
+ * import { findRecord } from '@warp-drive/utilities/active-record';
23
+ *
24
+ * const options = findRecord('person', '1', { include: ['pets', 'friends'] });
25
+ * const data = await store.request(options);
26
+ * ```
27
+ *
28
+ * **With an Identifier**
29
+ *
30
+ * ```ts
31
+ * import { findRecord } from '@warp-drive/utilities/active-record';
32
+ *
33
+ * const options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });
34
+ * const data = await store.request(options);
35
+ * ```
36
+ *
37
+ * **Supplying Options to Modify the Request Behavior**
38
+ *
39
+ * The following options are supported:
40
+ *
41
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
42
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
43
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type
44
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
45
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
46
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
47
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
48
+ * defaulting to `false` if none is configured.
49
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
50
+ *
51
+ * ```ts
52
+ * import { findRecord } from '@warp-drive/utilities/active-record';
53
+ *
54
+ * const options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });
55
+ * const data = await store.request(options);
56
+ * ```
57
+ *
58
+ * @public
59
+ * @param identifier
60
+ * @param options
61
+ */
62
62
  export declare function findRecord<T>(identifier: RemotelyAccessibleIdentifier<TypeFromInstance<T>>, options?: FindRecordOptions<T>): FindRecordRequestOptions<FindRecordResultDocument<T>, T>;
63
63
  export declare function findRecord(identifier: RemotelyAccessibleIdentifier, options?: FindRecordOptions): FindRecordRequestOptions;
64
64
  export declare function findRecord<T>(type: TypeFromInstance<T>, id: string, options?: FindRecordOptions<T>): FindRecordRequestOptions<FindRecordResultDocument<T>, T>;
65
65
  export declare function findRecord(type: string, id: string, options?: FindRecordOptions): FindRecordRequestOptions;
66
- //# sourceMappingURL=find-record.d.ts.map
@@ -1,54 +1,53 @@
1
- import type { QueryParamsSource } from '@warp-drive/core/types/params';
2
- import type { TypeFromInstance } from '@warp-drive/core/types/record';
3
- import type { ConstrainedRequestOptions, QueryRequestOptions } from '@warp-drive/core/types/request';
4
- import type { CollectionResourceDataDocument } from '@warp-drive/core/types/spec/document';
1
+ import type { QueryParamsSource } from "@warp-drive/core/types/params";
2
+ import type { TypeFromInstance } from "@warp-drive/core/types/record";
3
+ import type { ConstrainedRequestOptions, QueryRequestOptions } from "@warp-drive/core/types/request";
4
+ import type { CollectionResourceDataDocument } from "@warp-drive/core/types/spec/document";
5
5
  /**
6
- * Builds request options to query for resources, usually by a primary
7
- * type, configured for the url and header expectations of most ActiveRecord APIs.
8
- *
9
- * **Basic Usage**
10
- *
11
- * ```ts
12
- * import { query } from '@warp-drive/utilities/active-record';
13
- *
14
- * const data = await store.request(query('person'));
15
- * ```
16
- *
17
- * **With Query Params**
18
- *
19
- * ```ts
20
- * import { query } from '@warp-drive/utilities/active-record';
21
- *
22
- * const options = query('person', { include: ['pets', 'friends'] });
23
- * const data = await store.request(options);
24
- * ```
25
- *
26
- * **Supplying Options to Modify the Request Behavior**
27
- *
28
- * The following options are supported:
29
- *
30
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
31
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
32
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type
33
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
34
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
35
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
36
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
37
- * defaulting to `false` if none is configured.
38
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
39
- *
40
- * ```ts
41
- * import { query } from '@warp-drive/utilities/active-record';
42
- *
43
- * const options = query('person', { include: ['pets', 'friends'] }, { reload: true });
44
- * const data = await store.request(options);
45
- * ```
46
- *
47
- * @public
48
- * @param identifier
49
- * @param query
50
- * @param options
51
- */
6
+ * Builds request options to query for resources, usually by a primary
7
+ * type, configured for the url and header expectations of most ActiveRecord APIs.
8
+ *
9
+ * **Basic Usage**
10
+ *
11
+ * ```ts
12
+ * import { query } from '@warp-drive/utilities/active-record';
13
+ *
14
+ * const data = await store.request(query('person'));
15
+ * ```
16
+ *
17
+ * **With Query Params**
18
+ *
19
+ * ```ts
20
+ * import { query } from '@warp-drive/utilities/active-record';
21
+ *
22
+ * const options = query('person', { include: ['pets', 'friends'] });
23
+ * const data = await store.request(options);
24
+ * ```
25
+ *
26
+ * **Supplying Options to Modify the Request Behavior**
27
+ *
28
+ * The following options are supported:
29
+ *
30
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
31
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
32
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type
33
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
34
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
35
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
36
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
37
+ * defaulting to `false` if none is configured.
38
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
39
+ *
40
+ * ```ts
41
+ * import { query } from '@warp-drive/utilities/active-record';
42
+ *
43
+ * const options = query('person', { include: ['pets', 'friends'] }, { reload: true });
44
+ * const data = await store.request(options);
45
+ * ```
46
+ *
47
+ * @public
48
+ * @param identifier
49
+ * @param query
50
+ * @param options
51
+ */
52
52
  export declare function query<T>(type: TypeFromInstance<T>, query?: QueryParamsSource, options?: ConstrainedRequestOptions): QueryRequestOptions<CollectionResourceDataDocument<T>, T>;
53
53
  export declare function query(type: string, query?: QueryParamsSource, options?: ConstrainedRequestOptions): QueryRequestOptions;
54
- //# sourceMappingURL=query.d.ts.map
@@ -1,144 +1,146 @@
1
- import type { TypedRecordInstance } from '@warp-drive/core/types/record';
2
- import type { ConstrainedRequestOptions, CreateRequestOptions, DeleteRequestOptions, UpdateRequestOptions } from '@warp-drive/core/types/request';
3
- import type { SingleResourceDataDocument } from '@warp-drive/core/types/spec/document';
1
+ import type { TypedRecordInstance } from "@warp-drive/core/types/record";
2
+ import type { ConstrainedRequestOptions, CreateRequestOptions, DeleteRequestOptions, UpdateRequestOptions } from "@warp-drive/core/types/request";
3
+ import type { SingleResourceDataDocument } from "@warp-drive/core/types/spec/document";
4
4
  /**
5
- * Builds request options to delete record for resources,
6
- * configured for the url, method and header expectations of ActiveRecord APIs.
7
- *
8
- * **Basic Usage**
9
- *
10
- * ```ts
11
- * import { deleteRecord } from '@warp-drive/utilities/active-record';
12
- *
13
- * const person = store.peekRecord('person', '1');
14
- *
15
- * // mark record as deleted
16
- * store.deleteRecord(person);
17
- *
18
- * // persist deletion
19
- * const data = await store.request(deleteRecord(person));
20
- * ```
21
- *
22
- * **Supplying Options to Modify the Request Behavior**
23
- *
24
- * The following options are supported:
25
- *
26
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
27
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
28
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
29
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
30
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
31
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
32
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
33
- * defaulting to `false` if none is configured.
34
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
35
- *
36
- * ```ts
37
- * import { deleteRecord } from '@warp-drive/utilities/active-record';
38
- *
39
- * const person = store.peekRecord('person', '1');
40
- *
41
- * // mark record as deleted
42
- * store.deleteRecord(person);
43
- *
44
- * // persist deletion
45
- * const options = deleteRecord(person, { namespace: 'api/v1' });
46
- * const data = await store.request(options);
47
- * ```
48
- *
49
- * @public
50
- * @param record
51
- * @param options
52
- */
5
+ * Builds request options to delete record for resources,
6
+ * configured for the url, method and header expectations of ActiveRecord APIs.
7
+ *
8
+ * **Basic Usage**
9
+ *
10
+ * ```ts
11
+ * import { deleteRecord } from '@warp-drive/utilities/active-record';
12
+ *
13
+ * const person = store.peekRecord('person', '1');
14
+ *
15
+ * // mark record as deleted
16
+ * store.deleteRecord(person);
17
+ *
18
+ * // persist deletion
19
+ * const data = await store.request(deleteRecord(person));
20
+ * ```
21
+ *
22
+ * **Supplying Options to Modify the Request Behavior**
23
+ *
24
+ * The following options are supported:
25
+ *
26
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
27
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
28
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
29
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
30
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
31
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
32
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
33
+ * defaulting to `false` if none is configured.
34
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
35
+ *
36
+ * ```ts
37
+ * import { deleteRecord } from '@warp-drive/utilities/active-record';
38
+ *
39
+ * const person = store.peekRecord('person', '1');
40
+ *
41
+ * // mark record as deleted
42
+ * store.deleteRecord(person);
43
+ *
44
+ * // persist deletion
45
+ * const options = deleteRecord(person, { namespace: 'api/v1' });
46
+ * const data = await store.request(options);
47
+ * ```
48
+ *
49
+ * @public
50
+ * @param record
51
+ * @param options
52
+ */
53
53
  export declare function deleteRecord<T>(record: T, options?: ConstrainedRequestOptions): DeleteRequestOptions<T>;
54
54
  export declare function deleteRecord(record: unknown, options?: ConstrainedRequestOptions): DeleteRequestOptions;
55
55
  /**
56
- * Builds request options to create new record for resources,
57
- * configured for the url, method and header expectations of most ActiveRecord APIs.
58
- *
59
- * **Basic Usage**
60
- *
61
- * ```ts
62
- * import { createRecord } from '@warp-drive/utilities/active-record';
63
- *
64
- * const person = store.createRecord('person', { name: 'Ted' });
65
- * const data = await store.request(createRecord(person));
66
- * ```
67
- *
68
- * **Supplying Options to Modify the Request Behavior**
69
- *
70
- * The following options are supported:
71
- *
72
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
73
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
74
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
75
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
76
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
77
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
78
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
79
- * defaulting to `false` if none is configured.
80
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
81
- *
82
- * ```ts
83
- * import { createRecord } from '@warp-drive/utilities/active-record';
84
- *
85
- * const person = store.createRecord('person', { name: 'Ted' });
86
- * const options = createRecord(person, { namespace: 'api/v1' });
87
- * const data = await store.request(options);
88
- * ```
89
- *
90
- * @public
91
- * @param record
92
- * @param options
93
- */
56
+ * Builds request options to create new record for resources,
57
+ * configured for the url, method and header expectations of most ActiveRecord APIs.
58
+ *
59
+ * **Basic Usage**
60
+ *
61
+ * ```ts
62
+ * import { createRecord } from '@warp-drive/utilities/active-record';
63
+ *
64
+ * const person = store.createRecord('person', { name: 'Ted' });
65
+ * const data = await store.request(createRecord(person));
66
+ * ```
67
+ *
68
+ * **Supplying Options to Modify the Request Behavior**
69
+ *
70
+ * The following options are supported:
71
+ *
72
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
73
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
74
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
75
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
76
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
77
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
78
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
79
+ * defaulting to `false` if none is configured.
80
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
81
+ *
82
+ * ```ts
83
+ * import { createRecord } from '@warp-drive/utilities/active-record';
84
+ *
85
+ * const person = store.createRecord('person', { name: 'Ted' });
86
+ * const options = createRecord(person, { namespace: 'api/v1' });
87
+ * const data = await store.request(options);
88
+ * ```
89
+ *
90
+ * @public
91
+ * @param record
92
+ * @param options
93
+ */
94
94
  export declare function createRecord<T>(record: T, options?: ConstrainedRequestOptions): CreateRequestOptions<T>;
95
95
  export declare function createRecord(record: unknown, options?: ConstrainedRequestOptions): CreateRequestOptions;
96
96
  /**
97
- * Builds request options to update existing record for resources,
98
- * configured for the url, method and header expectations of most ActiveRecord APIs.
99
- *
100
- * **Basic Usage**
101
- *
102
- * ```ts
103
- * import { updateRecord } from '@warp-drive/utilities/active-record';
104
- *
105
- * const person = store.peekRecord('person', '1');
106
- * person.name = 'Chris';
107
- * const data = await store.request(updateRecord(person));
108
- * ```
109
- *
110
- * **Supplying Options to Modify the Request Behavior**
111
- *
112
- * The following options are supported:
113
- *
114
- * - `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.
115
- * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
116
- * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
117
- * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
118
- * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
119
- * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
120
- * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
121
- * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
122
- * defaulting to `false` if none is configured.
123
- * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
124
- *
125
- * ```ts
126
- * import { updateRecord } from '@warp-drive/utilities/active-record';
127
- *
128
- * const person = store.peekRecord('person', '1');
129
- * person.name = 'Chris';
130
- * const options = updateRecord(person, { patch: true });
131
- * const data = await store.request(options);
132
- * ```
133
- *
134
- * @public
135
- * @param record
136
- * @param options
137
- */
138
- export declare function updateRecord<T extends TypedRecordInstance, RT extends TypedRecordInstance = T>(record: T, options?: ConstrainedRequestOptions & {
139
- patch?: boolean;
97
+ * Builds request options to update existing record for resources,
98
+ * configured for the url, method and header expectations of most ActiveRecord APIs.
99
+ *
100
+ * **Basic Usage**
101
+ *
102
+ * ```ts
103
+ * import { updateRecord } from '@warp-drive/utilities/active-record';
104
+ *
105
+ * const person = store.peekRecord('person', '1');
106
+ * person.name = 'Chris';
107
+ * const data = await store.request(updateRecord(person));
108
+ * ```
109
+ *
110
+ * **Supplying Options to Modify the Request Behavior**
111
+ *
112
+ * The following options are supported:
113
+ *
114
+ * - `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.
115
+ * - `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.
116
+ * - `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.
117
+ * - `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type
118
+ * - `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this
119
+ * option will delegate to the store's CachePolicy, defaulting to `false` if none is configured.
120
+ * - `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the
121
+ * promise with the cached value, not supplying this option will delegate to the store's CachePolicy,
122
+ * defaulting to `false` if none is configured.
123
+ * - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
124
+ *
125
+ * ```ts
126
+ * import { updateRecord } from '@warp-drive/utilities/active-record';
127
+ *
128
+ * const person = store.peekRecord('person', '1');
129
+ * person.name = 'Chris';
130
+ * const options = updateRecord(person, { patch: true });
131
+ * const data = await store.request(options);
132
+ * ```
133
+ *
134
+ * @public
135
+ * @param record
136
+ * @param options
137
+ */
138
+ export declare function updateRecord<
139
+ T extends TypedRecordInstance,
140
+ RT extends TypedRecordInstance = T
141
+ >(record: T, options?: ConstrainedRequestOptions & {
142
+ patch?: boolean;
140
143
  }): UpdateRequestOptions<SingleResourceDataDocument<RT>, T>;
141
144
  export declare function updateRecord(record: unknown, options?: ConstrainedRequestOptions & {
142
- patch?: boolean;
145
+ patch?: boolean;
143
146
  }): UpdateRequestOptions;
144
- //# sourceMappingURL=save-record.d.ts.map
@@ -1,5 +1,4 @@
1
- import type { CacheOptions, ConstrainedRequestOptions } from '@warp-drive/core/types/request';
2
- import type { UrlOptions } from '../index.ts';
1
+ import type { CacheOptions, ConstrainedRequestOptions } from "@warp-drive/core/types/request";
2
+ import type { UrlOptions } from "../index.js";
3
3
  export declare function copyForwardUrlOptions(urlOptions: UrlOptions, options: ConstrainedRequestOptions): void;
4
4
  export declare function extractCacheOptions(options: ConstrainedRequestOptions): CacheOptions;
5
- //# sourceMappingURL=builder-utils.d.ts.map