@warp-drive-mirror/utilities 5.8.0-alpha.37 → 5.8.0-alpha.40

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 (137) hide show
  1. package/dist/unpkg/dev/active-record.js +11 -12
  2. package/dist/unpkg/dev/handlers.js +4 -5
  3. package/dist/unpkg/dev/index.js +50 -49
  4. package/dist/unpkg/{prod-deprecated/inflect-BSG696t-.js → dev/inflect-BEv8WqY1.js} +4 -5
  5. package/dist/unpkg/dev/json-api.js +16 -16
  6. package/dist/unpkg/dev/rest.js +11 -12
  7. package/dist/unpkg/dev/string.js +1 -1
  8. package/dist/unpkg/dev-deprecated/active-record.js +11 -12
  9. package/dist/unpkg/dev-deprecated/handlers.js +4 -5
  10. package/dist/unpkg/dev-deprecated/index.js +50 -49
  11. package/dist/unpkg/dev-deprecated/{inflect-BSG696t-.js → inflect-BEv8WqY1.js} +4 -5
  12. package/dist/unpkg/dev-deprecated/json-api.js +16 -16
  13. package/dist/unpkg/dev-deprecated/rest.js +11 -12
  14. package/dist/unpkg/dev-deprecated/string.js +1 -1
  15. package/dist/unpkg/prod/active-record.js +1 -30
  16. package/dist/unpkg/prod/handlers.js +1 -13
  17. package/dist/unpkg/prod/index.js +2 -124
  18. package/dist/unpkg/{dev/inflect-BSG696t-.js → prod/inflect-Dh9dyEYx.js} +0 -11
  19. package/dist/unpkg/prod/json-api.js +2 -40
  20. package/dist/unpkg/prod/rest.js +1 -30
  21. package/dist/unpkg/prod/string.js +1 -1
  22. package/dist/unpkg/prod-deprecated/active-record.js +1 -30
  23. package/dist/unpkg/prod-deprecated/handlers.js +1 -13
  24. package/dist/unpkg/prod-deprecated/index.js +2 -124
  25. package/dist/unpkg/{prod/inflect-BSG696t-.js → prod-deprecated/inflect-Dh9dyEYx.js} +0 -11
  26. package/dist/unpkg/prod-deprecated/json-api.js +2 -40
  27. package/dist/unpkg/prod-deprecated/rest.js +1 -30
  28. package/dist/unpkg/prod-deprecated/string.js +1 -1
  29. package/package.json +12 -20
  30. package/dist/unpkg/dev/declarations/-private/active-record/find-record.d.ts +0 -64
  31. package/dist/unpkg/dev/declarations/-private/active-record/query.d.ts +0 -53
  32. package/dist/unpkg/dev/declarations/-private/active-record/save-record.d.ts +0 -146
  33. package/dist/unpkg/dev/declarations/-private/builder-utils.d.ts +0 -4
  34. package/dist/unpkg/dev/declarations/-private/handlers/auto-compress.d.ts +0 -158
  35. package/dist/unpkg/dev/declarations/-private/handlers/gated.d.ts +0 -19
  36. package/dist/unpkg/dev/declarations/-private/handlers/meta-doc.d.ts +0 -47
  37. package/dist/unpkg/dev/declarations/-private/handlers/utils.d.ts +0 -41
  38. package/dist/unpkg/dev/declarations/-private/json-api/-utils.d.ts +0 -109
  39. package/dist/unpkg/dev/declarations/-private/json-api/find-record.d.ts +0 -84
  40. package/dist/unpkg/dev/declarations/-private/json-api/query.d.ts +0 -100
  41. package/dist/unpkg/dev/declarations/-private/json-api/save-record.d.ts +0 -228
  42. package/dist/unpkg/dev/declarations/-private/json-api/serialize.d.ts +0 -70
  43. package/dist/unpkg/dev/declarations/-private/rest/find-record.d.ts +0 -62
  44. package/dist/unpkg/dev/declarations/-private/rest/query.d.ts +0 -53
  45. package/dist/unpkg/dev/declarations/-private/rest/save-record.d.ts +0 -146
  46. package/dist/unpkg/dev/declarations/-private/string/inflect.d.ts +0 -82
  47. package/dist/unpkg/dev/declarations/-private/string/inflections.d.ts +0 -9
  48. package/dist/unpkg/dev/declarations/-private/string/transform.d.ts +0 -77
  49. package/dist/unpkg/dev/declarations/-private.d.ts +0 -1
  50. package/dist/unpkg/dev/declarations/active-record.d.ts +0 -3
  51. package/dist/unpkg/dev/declarations/derivations.d.ts +0 -27
  52. package/dist/unpkg/dev/declarations/handlers.d.ts +0 -10
  53. package/dist/unpkg/dev/declarations/index.d.ts +0 -208
  54. package/dist/unpkg/dev/declarations/json-api.d.ts +0 -5
  55. package/dist/unpkg/dev/declarations/rest.d.ts +0 -3
  56. package/dist/unpkg/dev/declarations/string.d.ts +0 -14
  57. package/dist/unpkg/dev-deprecated/declarations/-private/active-record/find-record.d.ts +0 -64
  58. package/dist/unpkg/dev-deprecated/declarations/-private/active-record/query.d.ts +0 -53
  59. package/dist/unpkg/dev-deprecated/declarations/-private/active-record/save-record.d.ts +0 -146
  60. package/dist/unpkg/dev-deprecated/declarations/-private/builder-utils.d.ts +0 -4
  61. package/dist/unpkg/dev-deprecated/declarations/-private/handlers/auto-compress.d.ts +0 -158
  62. package/dist/unpkg/dev-deprecated/declarations/-private/handlers/gated.d.ts +0 -19
  63. package/dist/unpkg/dev-deprecated/declarations/-private/handlers/meta-doc.d.ts +0 -47
  64. package/dist/unpkg/dev-deprecated/declarations/-private/handlers/utils.d.ts +0 -41
  65. package/dist/unpkg/dev-deprecated/declarations/-private/json-api/-utils.d.ts +0 -109
  66. package/dist/unpkg/dev-deprecated/declarations/-private/json-api/find-record.d.ts +0 -84
  67. package/dist/unpkg/dev-deprecated/declarations/-private/json-api/query.d.ts +0 -100
  68. package/dist/unpkg/dev-deprecated/declarations/-private/json-api/save-record.d.ts +0 -228
  69. package/dist/unpkg/dev-deprecated/declarations/-private/json-api/serialize.d.ts +0 -70
  70. package/dist/unpkg/dev-deprecated/declarations/-private/rest/find-record.d.ts +0 -62
  71. package/dist/unpkg/dev-deprecated/declarations/-private/rest/query.d.ts +0 -53
  72. package/dist/unpkg/dev-deprecated/declarations/-private/rest/save-record.d.ts +0 -146
  73. package/dist/unpkg/dev-deprecated/declarations/-private/string/inflect.d.ts +0 -82
  74. package/dist/unpkg/dev-deprecated/declarations/-private/string/inflections.d.ts +0 -9
  75. package/dist/unpkg/dev-deprecated/declarations/-private/string/transform.d.ts +0 -77
  76. package/dist/unpkg/dev-deprecated/declarations/-private.d.ts +0 -1
  77. package/dist/unpkg/dev-deprecated/declarations/active-record.d.ts +0 -3
  78. package/dist/unpkg/dev-deprecated/declarations/derivations.d.ts +0 -27
  79. package/dist/unpkg/dev-deprecated/declarations/handlers.d.ts +0 -10
  80. package/dist/unpkg/dev-deprecated/declarations/index.d.ts +0 -208
  81. package/dist/unpkg/dev-deprecated/declarations/json-api.d.ts +0 -5
  82. package/dist/unpkg/dev-deprecated/declarations/rest.d.ts +0 -3
  83. package/dist/unpkg/dev-deprecated/declarations/string.d.ts +0 -14
  84. package/dist/unpkg/prod/declarations/-private/active-record/find-record.d.ts +0 -64
  85. package/dist/unpkg/prod/declarations/-private/active-record/query.d.ts +0 -53
  86. package/dist/unpkg/prod/declarations/-private/active-record/save-record.d.ts +0 -146
  87. package/dist/unpkg/prod/declarations/-private/builder-utils.d.ts +0 -4
  88. package/dist/unpkg/prod/declarations/-private/handlers/auto-compress.d.ts +0 -158
  89. package/dist/unpkg/prod/declarations/-private/handlers/gated.d.ts +0 -19
  90. package/dist/unpkg/prod/declarations/-private/handlers/meta-doc.d.ts +0 -47
  91. package/dist/unpkg/prod/declarations/-private/handlers/utils.d.ts +0 -41
  92. package/dist/unpkg/prod/declarations/-private/json-api/-utils.d.ts +0 -109
  93. package/dist/unpkg/prod/declarations/-private/json-api/find-record.d.ts +0 -84
  94. package/dist/unpkg/prod/declarations/-private/json-api/query.d.ts +0 -100
  95. package/dist/unpkg/prod/declarations/-private/json-api/save-record.d.ts +0 -228
  96. package/dist/unpkg/prod/declarations/-private/json-api/serialize.d.ts +0 -70
  97. package/dist/unpkg/prod/declarations/-private/rest/find-record.d.ts +0 -62
  98. package/dist/unpkg/prod/declarations/-private/rest/query.d.ts +0 -53
  99. package/dist/unpkg/prod/declarations/-private/rest/save-record.d.ts +0 -146
  100. package/dist/unpkg/prod/declarations/-private/string/inflect.d.ts +0 -82
  101. package/dist/unpkg/prod/declarations/-private/string/inflections.d.ts +0 -9
  102. package/dist/unpkg/prod/declarations/-private/string/transform.d.ts +0 -77
  103. package/dist/unpkg/prod/declarations/-private.d.ts +0 -1
  104. package/dist/unpkg/prod/declarations/active-record.d.ts +0 -3
  105. package/dist/unpkg/prod/declarations/derivations.d.ts +0 -27
  106. package/dist/unpkg/prod/declarations/handlers.d.ts +0 -10
  107. package/dist/unpkg/prod/declarations/index.d.ts +0 -208
  108. package/dist/unpkg/prod/declarations/json-api.d.ts +0 -5
  109. package/dist/unpkg/prod/declarations/rest.d.ts +0 -3
  110. package/dist/unpkg/prod/declarations/string.d.ts +0 -14
  111. package/dist/unpkg/prod-deprecated/declarations/-private/active-record/find-record.d.ts +0 -64
  112. package/dist/unpkg/prod-deprecated/declarations/-private/active-record/query.d.ts +0 -53
  113. package/dist/unpkg/prod-deprecated/declarations/-private/active-record/save-record.d.ts +0 -146
  114. package/dist/unpkg/prod-deprecated/declarations/-private/builder-utils.d.ts +0 -4
  115. package/dist/unpkg/prod-deprecated/declarations/-private/handlers/auto-compress.d.ts +0 -158
  116. package/dist/unpkg/prod-deprecated/declarations/-private/handlers/gated.d.ts +0 -19
  117. package/dist/unpkg/prod-deprecated/declarations/-private/handlers/meta-doc.d.ts +0 -47
  118. package/dist/unpkg/prod-deprecated/declarations/-private/handlers/utils.d.ts +0 -41
  119. package/dist/unpkg/prod-deprecated/declarations/-private/json-api/-utils.d.ts +0 -109
  120. package/dist/unpkg/prod-deprecated/declarations/-private/json-api/find-record.d.ts +0 -84
  121. package/dist/unpkg/prod-deprecated/declarations/-private/json-api/query.d.ts +0 -100
  122. package/dist/unpkg/prod-deprecated/declarations/-private/json-api/save-record.d.ts +0 -228
  123. package/dist/unpkg/prod-deprecated/declarations/-private/json-api/serialize.d.ts +0 -70
  124. package/dist/unpkg/prod-deprecated/declarations/-private/rest/find-record.d.ts +0 -62
  125. package/dist/unpkg/prod-deprecated/declarations/-private/rest/query.d.ts +0 -53
  126. package/dist/unpkg/prod-deprecated/declarations/-private/rest/save-record.d.ts +0 -146
  127. package/dist/unpkg/prod-deprecated/declarations/-private/string/inflect.d.ts +0 -82
  128. package/dist/unpkg/prod-deprecated/declarations/-private/string/inflections.d.ts +0 -9
  129. package/dist/unpkg/prod-deprecated/declarations/-private/string/transform.d.ts +0 -77
  130. package/dist/unpkg/prod-deprecated/declarations/-private.d.ts +0 -1
  131. package/dist/unpkg/prod-deprecated/declarations/active-record.d.ts +0 -3
  132. package/dist/unpkg/prod-deprecated/declarations/derivations.d.ts +0 -27
  133. package/dist/unpkg/prod-deprecated/declarations/handlers.d.ts +0 -10
  134. package/dist/unpkg/prod-deprecated/declarations/index.d.ts +0 -208
  135. package/dist/unpkg/prod-deprecated/declarations/json-api.d.ts +0 -5
  136. package/dist/unpkg/prod-deprecated/declarations/rest.d.ts +0 -3
  137. package/dist/unpkg/prod-deprecated/declarations/string.d.ts +0 -14
@@ -1,8 +1,7 @@
1
1
  import { buildBaseURL, buildQueryParams } from './index.js';
2
- import { p as pluralize, j as underscore } from "./inflect-BSG696t-.js";
2
+ import { p as pluralize, j as underscore } from "./inflect-BEv8WqY1.js";
3
3
  import { e as extractCacheOptions, c as copyForwardUrlOptions } from "./builder-utils-Donkk-BZ.js";
4
4
  import { recordIdentifierFor } from '@warp-drive-mirror/core';
5
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
5
 
7
6
  /**
8
7
  * Builds request options to fetch a single resource by a known id or identifier
@@ -218,16 +217,16 @@ function isExisting(identifier) {
218
217
 
219
218
  function deleteRecord(record, options = {}) {
220
219
  const identifier = recordIdentifierFor(record);
221
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
220
+ (test => {
222
221
  if (!test) {
223
222
  throw new Error(`Expected to be given a record instance`);
224
223
  }
225
- })(identifier) : {};
226
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
224
+ })(identifier);
225
+ (test => {
227
226
  if (!test) {
228
227
  throw new Error(`Cannot delete a record that does not have an associated type and id.`);
229
228
  }
230
- })(isExisting(identifier)) : {};
229
+ })(isExisting(identifier));
231
230
  const urlOptions = {
232
231
  identifier: identifier,
233
232
  op: 'deleteRecord',
@@ -291,11 +290,11 @@ function deleteRecord(record, options = {}) {
291
290
 
292
291
  function createRecord(record, options = {}) {
293
292
  const identifier = recordIdentifierFor(record);
294
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
293
+ (test => {
295
294
  if (!test) {
296
295
  throw new Error(`Expected to be given a record instance`);
297
296
  }
298
- })(identifier) : {};
297
+ })(identifier);
299
298
  const urlOptions = {
300
299
  identifier: identifier,
301
300
  op: 'createRecord',
@@ -362,16 +361,16 @@ function createRecord(record, options = {}) {
362
361
 
363
362
  function updateRecord(record, options = {}) {
364
363
  const identifier = recordIdentifierFor(record);
365
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
364
+ (test => {
366
365
  if (!test) {
367
366
  throw new Error(`Expected to be given a record instance`);
368
367
  }
369
- })(identifier) : {};
370
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
368
+ })(identifier);
369
+ (test => {
371
370
  if (!test) {
372
371
  throw new Error(`Cannot update a record that does not have an associated type and id.`);
373
372
  }
374
- })(isExisting(identifier)) : {};
373
+ })(isExisting(identifier));
375
374
  const urlOptions = {
376
375
  identifier: identifier,
377
376
  op: 'updateRecord',
@@ -1,4 +1,3 @@
1
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
1
  function isCompressibleMethod(method) {
3
2
  return method === 'POST' || method === 'PUT' || method === 'PATCH' || method === 'DELETE';
4
3
  }
@@ -144,11 +143,11 @@ function encodingForFormat(format) {
144
143
  case 'deflate-raw':
145
144
  return format;
146
145
  default:
147
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
146
+ (test => {
148
147
  {
149
148
  throw new Error(`Unsupported compression format: ${format}`);
150
149
  }
151
- })() : {};
150
+ })();
152
151
  // @ts-expect-error - unreachable code is reachable in production
153
152
  return format;
154
153
  }
@@ -308,10 +307,10 @@ const MAX_URL_LENGTH = 8192;
308
307
  * @group Utility Functions
309
308
  */
310
309
  function assertInvalidUrlLength(url) {
311
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
310
+ (test => {
312
311
  if (!test) {
313
312
  throw new Error(`URL length ${url?.length} exceeds the maximum URL length of ${MAX_URL_LENGTH} bytes.\n\nConsider converting this request query a \`/query\` endpoint instead of a GET, or upgrade the current endpoint to be able to receive a POST request directly (ideally specifying the header HTTP-Method-Override: QUERY)\n\nThe Invalid URL is:\n\n${url}`);
314
313
  }
315
- })(!url || url.length <= MAX_URL_LENGTH) : {};
314
+ })(!url || url.length <= MAX_URL_LENGTH);
316
315
  }
317
316
  export { AutoCompress, Gate, MAX_URL_LENGTH, MetaDocHandler, SupportsRequestStreams, TAB_ASSIGNED, TAB_ID, addTraceHeader, assertInvalidUrlLength };
@@ -1,13 +1,14 @@
1
1
  import { getOrSetGlobal } from '@warp-drive-mirror/core/types/-private';
2
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
3
2
 
4
3
  /**
5
4
  * @module
6
5
  * @mergeModuleWith <project>
7
6
  */
8
7
 
8
+ // prevents the final constructed object from needing to add
9
9
  // host and namespace which are provided by the final consuming
10
10
  // class to the prototype which can result in overwrite errors
11
+
11
12
  const CONFIG = getOrSetGlobal('CONFIG', {
12
13
  host: '',
13
14
  namespace: ''
@@ -49,33 +50,33 @@ const CONFIG = getOrSetGlobal('CONFIG', {
49
50
  * @public
50
51
  */
51
52
  function setBuildURLConfig(config) {
52
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
53
+ (test => {
53
54
  if (!test) {
54
55
  throw new Error(`setBuildURLConfig: You must pass a config object`);
55
56
  }
56
- })(config) : {};
57
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
57
+ })(config);
58
+ (test => {
58
59
  if (!test) {
59
60
  throw new Error(`setBuildURLConfig: You must pass a config object with a 'host' or 'namespace' property`);
60
61
  }
61
- })('host' in config || 'namespace' in config) : {};
62
+ })('host' in config || 'namespace' in config);
62
63
  CONFIG.host = config.host || '';
63
64
  CONFIG.namespace = config.namespace || '';
64
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
65
+ (test => {
65
66
  if (!test) {
66
67
  throw new Error(`buildBaseURL: host must NOT end with '/', received '${CONFIG.host}'`);
67
68
  }
68
- })(CONFIG.host === '/' || !CONFIG.host.endsWith('/')) : {};
69
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
69
+ })(CONFIG.host === '/' || !CONFIG.host.endsWith('/'));
70
+ (test => {
70
71
  if (!test) {
71
72
  throw new Error(`buildBaseURL: namespace must NOT start with '/', received '${CONFIG.namespace}'`);
72
73
  }
73
- })(!CONFIG.namespace.startsWith('/')) : {};
74
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
74
+ })(!CONFIG.namespace.startsWith('/'));
75
+ (test => {
75
76
  if (!test) {
76
77
  throw new Error(`buildBaseURL: namespace must NOT end with '/', received '${CONFIG.namespace}'`);
77
78
  }
78
- })(!CONFIG.namespace.endsWith('/')) : {};
79
+ })(!CONFIG.namespace.endsWith('/'));
79
80
  }
80
81
  const OPERATIONS_WITH_PRIMARY_RECORDS = new Set(['findRecord', 'findRelatedRecord', 'findRelatedCollection', 'updateRecord', 'deleteRecord']);
81
82
  function isOperationWithPrimaryRecord(options) {
@@ -85,11 +86,11 @@ function hasResourcePath(options) {
85
86
  return 'resourcePath' in options && typeof options.resourcePath === 'string' && options.resourcePath.length > 0;
86
87
  }
87
88
  function resourcePathForType(options) {
88
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
89
+ (test => {
89
90
  if (!test) {
90
91
  throw new Error(`resourcePathForType: You must pass a valid op as part of options`);
91
92
  }
92
- })('op' in options && typeof options.op === 'string') : {};
93
+ })('op' in options && typeof options.op === 'string');
93
94
  return options.op === 'findMany' ? options.identifiers[0].type : options.identifier.type;
94
95
  }
95
96
 
@@ -134,41 +135,41 @@ function buildBaseURL(urlOptions) {
134
135
  host: CONFIG.host,
135
136
  namespace: CONFIG.namespace
136
137
  }, urlOptions);
137
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
138
+ (test => {
138
139
  if (!test) {
139
140
  throw new Error(`buildBaseURL: You must pass \`op\` as part of options`);
140
141
  }
141
- })(hasResourcePath(options) || typeof options.op === 'string' && options.op.length > 0) : {};
142
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
142
+ })(hasResourcePath(options) || typeof options.op === 'string' && options.op.length > 0);
143
+ (test => {
143
144
  if (!test) {
144
145
  throw new Error(`buildBaseURL: You must pass \`identifier\` as part of options`);
145
146
  }
146
- })(hasResourcePath(options) || options.op === 'findMany' || options.identifier && typeof options.identifier === 'object') : {};
147
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
147
+ })(hasResourcePath(options) || options.op === 'findMany' || options.identifier && typeof options.identifier === 'object');
148
+ (test => {
148
149
  if (!test) {
149
150
  throw new Error(`buildBaseURL: You must pass \`identifiers\` as part of options`);
150
151
  }
151
- })(hasResourcePath(options) || options.op !== 'findMany' || options.identifiers && Array.isArray(options.identifiers) && options.identifiers.length > 0 && options.identifiers.every(i => i && typeof i === 'object')) : {};
152
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
152
+ })(hasResourcePath(options) || options.op !== 'findMany' || options.identifiers && Array.isArray(options.identifiers) && options.identifiers.length > 0 && options.identifiers.every(i => i && typeof i === 'object'));
153
+ (test => {
153
154
  if (!test) {
154
155
  throw new Error(`buildBaseURL: You must pass valid \`identifier\` as part of options, expected 'id'`);
155
156
  }
156
- })(hasResourcePath(options) || !isOperationWithPrimaryRecord(options) || typeof options.identifier.id === 'string' && options.identifier.id.length > 0) : {};
157
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
157
+ })(hasResourcePath(options) || !isOperationWithPrimaryRecord(options) || typeof options.identifier.id === 'string' && options.identifier.id.length > 0);
158
+ (test => {
158
159
  if (!test) {
159
160
  throw new Error(`buildBaseURL: You must pass \`identifiers\` as part of options`);
160
161
  }
161
- })(hasResourcePath(options) || options.op !== 'findMany' || options.identifiers.every(i => typeof i.id === 'string' && i.id.length > 0)) : {};
162
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
162
+ })(hasResourcePath(options) || options.op !== 'findMany' || options.identifiers.every(i => typeof i.id === 'string' && i.id.length > 0));
163
+ (test => {
163
164
  if (!test) {
164
165
  throw new Error(`buildBaseURL: You must pass valid \`identifier\` as part of options, expected 'type'`);
165
166
  }
166
- })(hasResourcePath(options) || options.op === 'findMany' || typeof options.identifier.type === 'string' && options.identifier.type.length > 0) : {};
167
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
167
+ })(hasResourcePath(options) || options.op === 'findMany' || typeof options.identifier.type === 'string' && options.identifier.type.length > 0);
168
+ (test => {
168
169
  if (!test) {
169
170
  throw new Error(`buildBaseURL: You must pass valid \`identifiers\` as part of options, expected 'type'`);
170
171
  }
171
- })(hasResourcePath(options) || options.op !== 'findMany' || typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0) : {};
172
+ })(hasResourcePath(options) || options.op !== 'findMany' || typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0);
172
173
 
173
174
  // prettier-ignore
174
175
  const idPath = isOperationWithPrimaryRecord(options) ? encodeURIComponent(options.identifier.id) : '';
@@ -178,56 +179,56 @@ function buildBaseURL(urlOptions) {
178
179
  namespace
179
180
  } = options;
180
181
  const fieldPath = 'fieldPath' in options ? options.fieldPath : '';
181
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
182
+ (test => {
182
183
  if (!test) {
183
184
  throw new Error(`buildBaseURL: You tried to build a url for a ${String('op' in options ? options.op + ' ' : '')}request to ${resourcePath} but resourcePath must be set or op must be one of "${['findRecord', 'findRelatedRecord', 'findRelatedCollection', 'updateRecord', 'deleteRecord', 'createRecord', 'query', 'findMany'].join('","')}".`);
184
185
  }
185
- })(hasResourcePath(options) || ['findRecord', 'query', 'findMany', 'findRelatedCollection', 'findRelatedRecord', 'createRecord', 'updateRecord', 'deleteRecord'].includes(options.op)) : {};
186
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
186
+ })(hasResourcePath(options) || ['findRecord', 'query', 'findMany', 'findRelatedCollection', 'findRelatedRecord', 'createRecord', 'updateRecord', 'deleteRecord'].includes(options.op));
187
+ (test => {
187
188
  if (!test) {
188
189
  throw new Error(`buildBaseURL: host must NOT end with '/', received '${host}'`);
189
190
  }
190
- })(host === '/' || !host.endsWith('/')) : {};
191
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
191
+ })(host === '/' || !host.endsWith('/'));
192
+ (test => {
192
193
  if (!test) {
193
194
  throw new Error(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`);
194
195
  }
195
- })(!namespace.startsWith('/')) : {};
196
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
196
+ })(!namespace.startsWith('/'));
197
+ (test => {
197
198
  if (!test) {
198
199
  throw new Error(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`);
199
200
  }
200
- })(!namespace.endsWith('/')) : {};
201
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
201
+ })(!namespace.endsWith('/'));
202
+ (test => {
202
203
  if (!test) {
203
204
  throw new Error(`buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`);
204
205
  }
205
- })(!resourcePath.startsWith('/')) : {};
206
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
206
+ })(!resourcePath.startsWith('/'));
207
+ (test => {
207
208
  if (!test) {
208
209
  throw new Error(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`);
209
210
  }
210
- })(!resourcePath.endsWith('/')) : {};
211
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
211
+ })(!resourcePath.endsWith('/'));
212
+ (test => {
212
213
  if (!test) {
213
214
  throw new Error(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`);
214
215
  }
215
- })(!fieldPath.startsWith('/')) : {};
216
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
216
+ })(!fieldPath.startsWith('/'));
217
+ (test => {
217
218
  if (!test) {
218
219
  throw new Error(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`);
219
220
  }
220
- })(!fieldPath.endsWith('/')) : {};
221
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
221
+ })(!fieldPath.endsWith('/'));
222
+ (test => {
222
223
  if (!test) {
223
224
  throw new Error(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`);
224
225
  }
225
- })(!idPath.startsWith('/')) : {};
226
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
226
+ })(!idPath.startsWith('/'));
227
+ (test => {
227
228
  if (!test) {
228
229
  throw new Error(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`);
229
230
  }
230
- })(!idPath.endsWith('/')) : {};
231
+ })(!idPath.endsWith('/'));
231
232
  const hasHost = host !== '' && host !== '/';
232
233
  const url = [hasHost ? host : '', namespace, resourcePath, idPath, fieldPath].filter(Boolean).join('/');
233
234
  return hasHost ? url : `/${url}`;
@@ -236,11 +237,11 @@ const DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS = {
236
237
  arrayFormat: 'comma'
237
238
  };
238
239
  function handleInclude(include) {
239
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
240
+ (test => {
240
241
  if (!test) {
241
242
  throw new Error(`Expected include to be a string or array, got ${typeof include}`);
242
243
  }
243
- })(typeof include === 'string' || Array.isArray(include)) : {};
244
+ })(typeof include === 'string' || Array.isArray(include));
244
245
  return typeof include === 'string' ? include.split(',') : include;
245
246
  }
246
247
 
@@ -1,6 +1,5 @@
1
1
  import { LRUCache, dasherize as dasherize$1, STRING_DASHERIZE_CACHE } from '@warp-drive-mirror/core/utils/string';
2
2
  import { InflectionRuleDefaults as defaultRules } from './-private.js';
3
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
4
3
 
5
4
  // eslint-disable-next-line no-useless-escape
6
5
  const STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g;
@@ -231,11 +230,11 @@ function clearRules() {
231
230
  * @since 4.13.0
232
231
  */
233
232
  function singularize(word) {
234
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
233
+ (test => {
235
234
  if (!test) {
236
235
  throw new Error(`singularize expects to receive a non-empty string`);
237
236
  }
238
- })(typeof word === 'string' && word.length > 0) : {};
237
+ })(typeof word === 'string' && word.length > 0);
239
238
  if (!word) return '';
240
239
  return SINGULARS.get(word);
241
240
  }
@@ -247,11 +246,11 @@ function singularize(word) {
247
246
  * @since 4.13.0
248
247
  */
249
248
  function pluralize(word) {
250
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
249
+ (test => {
251
250
  if (!test) {
252
251
  throw new Error(`pluralize expects to receive a non-empty string`);
253
252
  }
254
- })(typeof word === 'string' && word.length > 0) : {};
253
+ })(typeof word === 'string' && word.length > 0);
255
254
  if (!word) return '';
256
255
  return PLURALS.get(word);
257
256
  }
@@ -1,8 +1,7 @@
1
1
  import { setBuildURLConfig as setBuildURLConfig$1, buildBaseURL, buildQueryParams } from './index.js';
2
- import { p as pluralize } from "./inflect-BSG696t-.js";
2
+ import { p as pluralize } from "./inflect-BEv8WqY1.js";
3
3
  import { e as extractCacheOptions, c as copyForwardUrlOptions } from "./builder-utils-Donkk-BZ.js";
4
4
  import { recordIdentifierFor } from '@warp-drive-mirror/core';
5
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
5
  const JsonApiAccept = 'application/vnd.api+json';
7
6
  const DEFAULT_CONFIG = {
8
7
  host: '',
@@ -382,16 +381,16 @@ function isExisting(identifier) {
382
381
 
383
382
  function deleteRecord(record, options = {}) {
384
383
  const identifier = recordIdentifierFor(record);
385
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
384
+ (test => {
386
385
  if (!test) {
387
386
  throw new Error(`Expected to be given a record instance`);
388
387
  }
389
- })(identifier) : {};
390
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
388
+ })(identifier);
389
+ (test => {
391
390
  if (!test) {
392
391
  throw new Error(`Cannot delete a record that does not have an associated type and id.`);
393
392
  }
394
- })(isExisting(identifier)) : {};
393
+ })(isExisting(identifier));
395
394
  const urlOptions = {
396
395
  identifier: identifier,
397
396
  op: 'deleteRecord',
@@ -470,11 +469,11 @@ function deleteRecord(record, options = {}) {
470
469
 
471
470
  function createRecord(record, options = {}) {
472
471
  const identifier = recordIdentifierFor(record);
473
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
472
+ (test => {
474
473
  if (!test) {
475
474
  throw new Error(`Expected to be given a record instance`);
476
475
  }
477
- })(identifier) : {};
476
+ })(identifier);
478
477
  const urlOptions = {
479
478
  identifier: identifier,
480
479
  op: 'createRecord',
@@ -556,16 +555,16 @@ function createRecord(record, options = {}) {
556
555
 
557
556
  function updateRecord(record, options = {}) {
558
557
  const identifier = recordIdentifierFor(record);
559
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
558
+ (test => {
560
559
  if (!test) {
561
560
  throw new Error(`Expected to be given a record instance`);
562
561
  }
563
- })(identifier) : {};
564
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
562
+ })(identifier);
563
+ (test => {
565
564
  if (!test) {
566
565
  throw new Error(`Cannot update a record that does not have an associated type and id.`);
567
566
  }
568
- })(isExisting(identifier)) : {};
567
+ })(isExisting(identifier));
569
568
  const urlOptions = {
570
569
  identifier: identifier,
571
570
  op: 'updateRecord',
@@ -602,6 +601,7 @@ function updateRecord(record, options = {}) {
602
601
  * @param {ResourceKey} identifier
603
602
  * @return {Object} An object with a `data` property containing the serialized resource patch
604
603
  */
604
+
605
605
  function serializeResources(cache, identifiers) {
606
606
  return {
607
607
  data: Array.isArray(identifiers) ? identifiers.map(identifier => _serializeResource(cache, identifier)) : _serializeResource(cache, identifiers)
@@ -641,11 +641,11 @@ function _serializeResource(cache, identifier) {
641
641
  // peek gives us everything we want, but since its referentially the same data
642
642
  // as is in the cache we clone it to avoid any accidental mutations
643
643
  const record = structuredClone(cache.peek(identifier));
644
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
644
+ (test => {
645
645
  if (!test) {
646
646
  throw new Error(`A record with id ${String(id)} and type ${type} for lid ${lid} was not found not in the supplied Cache.`);
647
647
  }
648
- })(record) : {};
648
+ })(record);
649
649
 
650
650
  // remove lid from anything that has an ID and slice any relationship arrays
651
651
  if (record.id !== null) {
@@ -700,11 +700,11 @@ function serializePatch(cache, identifier) {
700
700
  lid,
701
701
  type
702
702
  } = identifier;
703
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
703
+ (test => {
704
704
  if (!test) {
705
705
  throw new Error(`A record with id ${String(id)} and type ${type} for lid ${lid} was not found not in the supplied Cache.`);
706
706
  }
707
- })(cache.peek(identifier)) : {};
707
+ })(cache.peek(identifier));
708
708
  const data = id === null ? {
709
709
  type,
710
710
  lid,
@@ -1,8 +1,7 @@
1
1
  import { buildBaseURL, buildQueryParams } from './index.js';
2
- import { p as pluralize, g as camelize } from "./inflect-BSG696t-.js";
2
+ import { p as pluralize, g as camelize } from "./inflect-BEv8WqY1.js";
3
3
  import { e as extractCacheOptions, c as copyForwardUrlOptions } from "./builder-utils-Donkk-BZ.js";
4
4
  import { recordIdentifierFor } from '@warp-drive-mirror/core';
5
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
5
 
7
6
  /**
8
7
  * Builds request options to fetch a single resource by a known id or identifier
@@ -216,16 +215,16 @@ function isExisting(identifier) {
216
215
 
217
216
  function deleteRecord(record, options = {}) {
218
217
  const identifier = recordIdentifierFor(record);
219
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
218
+ (test => {
220
219
  if (!test) {
221
220
  throw new Error(`Expected to be given a record instance`);
222
221
  }
223
- })(identifier) : {};
224
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
222
+ })(identifier);
223
+ (test => {
225
224
  if (!test) {
226
225
  throw new Error(`Cannot delete a record that does not have an associated type and id.`);
227
226
  }
228
- })(isExisting(identifier)) : {};
227
+ })(isExisting(identifier));
229
228
  const urlOptions = {
230
229
  identifier: identifier,
231
230
  op: 'deleteRecord',
@@ -289,11 +288,11 @@ function deleteRecord(record, options = {}) {
289
288
 
290
289
  function createRecord(record, options = {}) {
291
290
  const identifier = recordIdentifierFor(record);
292
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
291
+ (test => {
293
292
  if (!test) {
294
293
  throw new Error(`Expected to be given a record instance`);
295
294
  }
296
- })(identifier) : {};
295
+ })(identifier);
297
296
  const urlOptions = {
298
297
  identifier: identifier,
299
298
  op: 'createRecord',
@@ -360,16 +359,16 @@ function createRecord(record, options = {}) {
360
359
 
361
360
  function updateRecord(record, options = {}) {
362
361
  const identifier = recordIdentifierFor(record);
363
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
362
+ (test => {
364
363
  if (!test) {
365
364
  throw new Error(`Expected to be given a record instance`);
366
365
  }
367
- })(identifier) : {};
368
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
366
+ })(identifier);
367
+ (test => {
369
368
  if (!test) {
370
369
  throw new Error(`Cannot update a record that does not have an associated type and id.`);
371
370
  }
372
- })(isExisting(identifier)) : {};
371
+ })(isExisting(identifier));
373
372
  const urlOptions = {
374
373
  identifier: identifier,
375
374
  op: 'updateRecord',
@@ -1 +1 @@
1
- export { g as camelize, h as capitalize, d as clear, e as clearRules, f as dasherize, i as irregular, l as loadIrregular, c as loadUncountable, b as plural, p as pluralize, r as resetToDefaults, k as setMaxLRUCacheSize, a as singular, s as singularize, u as uncountable, j as underscore } from "./inflect-BSG696t-.js";
1
+ export { g as camelize, h as capitalize, d as clear, e as clearRules, f as dasherize, i as irregular, l as loadIrregular, c as loadUncountable, b as plural, p as pluralize, r as resetToDefaults, k as setMaxLRUCacheSize, a as singular, s as singularize, u as uncountable, j as underscore } from "./inflect-BEv8WqY1.js";
@@ -1,8 +1,7 @@
1
1
  import { buildBaseURL, buildQueryParams } from './index.js';
2
- import { p as pluralize, j as underscore } from "./inflect-BSG696t-.js";
2
+ import { p as pluralize, j as underscore } from "./inflect-BEv8WqY1.js";
3
3
  import { e as extractCacheOptions, c as copyForwardUrlOptions } from "./builder-utils-Donkk-BZ.js";
4
4
  import { recordIdentifierFor } from '@warp-drive-mirror/core';
5
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
6
5
 
7
6
  /**
8
7
  * Builds request options to fetch a single resource by a known id or identifier
@@ -218,16 +217,16 @@ function isExisting(identifier) {
218
217
 
219
218
  function deleteRecord(record, options = {}) {
220
219
  const identifier = recordIdentifierFor(record);
221
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
220
+ (test => {
222
221
  if (!test) {
223
222
  throw new Error(`Expected to be given a record instance`);
224
223
  }
225
- })(identifier) : {};
226
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
224
+ })(identifier);
225
+ (test => {
227
226
  if (!test) {
228
227
  throw new Error(`Cannot delete a record that does not have an associated type and id.`);
229
228
  }
230
- })(isExisting(identifier)) : {};
229
+ })(isExisting(identifier));
231
230
  const urlOptions = {
232
231
  identifier: identifier,
233
232
  op: 'deleteRecord',
@@ -291,11 +290,11 @@ function deleteRecord(record, options = {}) {
291
290
 
292
291
  function createRecord(record, options = {}) {
293
292
  const identifier = recordIdentifierFor(record);
294
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
293
+ (test => {
295
294
  if (!test) {
296
295
  throw new Error(`Expected to be given a record instance`);
297
296
  }
298
- })(identifier) : {};
297
+ })(identifier);
299
298
  const urlOptions = {
300
299
  identifier: identifier,
301
300
  op: 'createRecord',
@@ -362,16 +361,16 @@ function createRecord(record, options = {}) {
362
361
 
363
362
  function updateRecord(record, options = {}) {
364
363
  const identifier = recordIdentifierFor(record);
365
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
364
+ (test => {
366
365
  if (!test) {
367
366
  throw new Error(`Expected to be given a record instance`);
368
367
  }
369
- })(identifier) : {};
370
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
368
+ })(identifier);
369
+ (test => {
371
370
  if (!test) {
372
371
  throw new Error(`Cannot update a record that does not have an associated type and id.`);
373
372
  }
374
- })(isExisting(identifier)) : {};
373
+ })(isExisting(identifier));
375
374
  const urlOptions = {
376
375
  identifier: identifier,
377
376
  op: 'updateRecord',
@@ -1,4 +1,3 @@
1
- import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
1
  function isCompressibleMethod(method) {
3
2
  return method === 'POST' || method === 'PUT' || method === 'PATCH' || method === 'DELETE';
4
3
  }
@@ -144,11 +143,11 @@ function encodingForFormat(format) {
144
143
  case 'deflate-raw':
145
144
  return format;
146
145
  default:
147
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
146
+ (test => {
148
147
  {
149
148
  throw new Error(`Unsupported compression format: ${format}`);
150
149
  }
151
- })() : {};
150
+ })();
152
151
  // @ts-expect-error - unreachable code is reachable in production
153
152
  return format;
154
153
  }
@@ -308,10 +307,10 @@ const MAX_URL_LENGTH = 8192;
308
307
  * @group Utility Functions
309
308
  */
310
309
  function assertInvalidUrlLength(url) {
311
- macroCondition(getGlobalConfig().WarpDriveMirror.env.DEBUG) ? (test => {
310
+ (test => {
312
311
  if (!test) {
313
312
  throw new Error(`URL length ${url?.length} exceeds the maximum URL length of ${MAX_URL_LENGTH} bytes.\n\nConsider converting this request query a \`/query\` endpoint instead of a GET, or upgrade the current endpoint to be able to receive a POST request directly (ideally specifying the header HTTP-Method-Override: QUERY)\n\nThe Invalid URL is:\n\n${url}`);
314
313
  }
315
- })(!url || url.length <= MAX_URL_LENGTH) : {};
314
+ })(!url || url.length <= MAX_URL_LENGTH);
316
315
  }
317
316
  export { AutoCompress, Gate, MAX_URL_LENGTH, MetaDocHandler, SupportsRequestStreams, TAB_ASSIGNED, TAB_ID, addTraceHeader, assertInvalidUrlLength };