autumn-js 0.0.41 → 0.0.44

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 (143) hide show
  1. package/dist/libraries/backend/{chunk-UD4U5ECV.mjs → chunk-BQYMRMGB.mjs} +1 -1
  2. package/dist/libraries/backend/{chunk-7SOQYC4B.mjs → chunk-DXILLNEF.mjs} +1 -2
  3. package/dist/libraries/backend/{chunk-XPNATE4H.mjs → chunk-LRE7V775.mjs} +1 -1
  4. package/dist/libraries/backend/{chunk-V7VIK7Q2.mjs → chunk-OMSV2SEC.mjs} +4 -3
  5. package/dist/libraries/backend/{chunk-GA6SKSWH.mjs → chunk-U357CO3L.mjs} +4 -4
  6. package/dist/libraries/backend/{entTypes-BHLroNdS.d.mts → client-C4aZxBxK.d.mts} +34 -28
  7. package/dist/libraries/backend/{entTypes-BJGM9Knl.d.ts → client-DJJAbrX7.d.ts} +34 -28
  8. package/dist/libraries/backend/express.js +4 -4
  9. package/dist/libraries/backend/express.mjs +5 -5
  10. package/dist/libraries/backend/fastify.js +4 -4
  11. package/dist/libraries/backend/fastify.mjs +5 -5
  12. package/dist/libraries/backend/hono.js +4 -4
  13. package/dist/libraries/backend/hono.mjs +5 -5
  14. package/dist/libraries/backend/next.js +4 -4
  15. package/dist/libraries/backend/next.mjs +5 -5
  16. package/dist/libraries/backend/remix.js +4 -4
  17. package/dist/libraries/backend/remix.mjs +5 -5
  18. package/dist/libraries/backend/routes/backendRouter.d.mts +1 -1
  19. package/dist/libraries/backend/routes/backendRouter.d.ts +1 -1
  20. package/dist/libraries/backend/routes/backendRouter.js +4 -4
  21. package/dist/libraries/backend/routes/backendRouter.mjs +5 -5
  22. package/dist/libraries/backend/routes/entityRoutes.js +4 -4
  23. package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
  24. package/dist/libraries/backend/routes/genRoutes.js +4 -4
  25. package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
  26. package/dist/libraries/backend/tanstack.js +4 -4
  27. package/dist/libraries/backend/tanstack.mjs +5 -5
  28. package/dist/libraries/backend/utils/AuthFunction.d.mts +1 -1
  29. package/dist/libraries/backend/utils/AuthFunction.d.ts +1 -1
  30. package/dist/libraries/backend/utils/backendRes.js +1 -2
  31. package/dist/libraries/backend/utils/backendRes.mjs +1 -1
  32. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  33. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  34. package/dist/libraries/backend/utils/withAuth.js +4 -4
  35. package/dist/libraries/backend/utils/withAuth.mjs +2 -2
  36. package/dist/libraries/react/AutumnContext.d.mts +2 -2
  37. package/dist/libraries/react/AutumnContext.d.ts +2 -2
  38. package/dist/libraries/react/AutumnContext.js +1 -2
  39. package/dist/libraries/react/AutumnContext.mjs +3 -3
  40. package/dist/libraries/react/BaseAutumnProvider.d.mts +2 -2
  41. package/dist/libraries/react/BaseAutumnProvider.d.ts +2 -2
  42. package/dist/libraries/react/BaseAutumnProvider.js +1 -2
  43. package/dist/libraries/react/BaseAutumnProvider.mjs +6 -6
  44. package/dist/libraries/react/{ReactAutumnClient-C5hkD9_F.d.ts → ReactAutumnClient-CXWgmZSf.d.ts} +1 -1
  45. package/dist/libraries/react/{ReactAutumnClient-Cs1RcVVR.d.mts → ReactAutumnClient-b8N5xZyk.d.mts} +1 -1
  46. package/dist/libraries/react/ReactAutumnProvider.js +1 -2
  47. package/dist/libraries/react/ReactAutumnProvider.mjs +7 -7
  48. package/dist/libraries/react/{chunk-K474E7RH.mjs → chunk-2Z7EC4JM.mjs} +1 -1
  49. package/dist/libraries/react/{chunk-GPMSGEWX.mjs → chunk-3PQR35T5.mjs} +1 -2
  50. package/dist/libraries/react/{chunk-ZQ2RGBVJ.mjs → chunk-4G7CGF2R.mjs} +1 -1
  51. package/dist/libraries/react/{chunk-XM7R467K.mjs → chunk-D2YRPPOL.mjs} +2 -2
  52. package/dist/libraries/react/{chunk-ARMMM4EO.mjs → chunk-ELS2JOCO.mjs} +3 -3
  53. package/dist/libraries/react/{chunk-ZOWIALGE.mjs → chunk-NHKT224P.mjs} +1 -1
  54. package/dist/libraries/react/{chunk-2BGH4NXG.mjs → chunk-R3TB4JFJ.mjs} +1 -1
  55. package/dist/libraries/react/{chunk-K6GCHMT7.mjs → chunk-RLTE5H53.mjs} +8 -12
  56. package/dist/libraries/react/{chunk-4WRDLT7W.mjs → chunk-VXGVATJ5.mjs} +1 -1
  57. package/dist/libraries/react/{chunk-PQ443EFR.mjs → chunk-VY7I5OWG.mjs} +1 -1
  58. package/dist/libraries/react/{chunk-QFMVIMZ4.mjs → chunk-YF5TB4XK.mjs} +1 -1
  59. package/dist/libraries/react/client/ReactAutumnClient.d.mts +2 -2
  60. package/dist/libraries/react/client/ReactAutumnClient.d.ts +2 -2
  61. package/dist/libraries/react/client/ReactAutumnClient.js +1 -2
  62. package/dist/libraries/react/client/ReactAutumnClient.mjs +2 -2
  63. package/dist/libraries/react/client/clientCompMethods.d.mts +2 -2
  64. package/dist/libraries/react/client/clientCompMethods.d.ts +2 -2
  65. package/dist/libraries/react/client/clientCusMethods.d.mts +2 -2
  66. package/dist/libraries/react/client/clientCusMethods.d.ts +2 -2
  67. package/dist/libraries/react/client/clientEntityMethods.d.mts +2 -2
  68. package/dist/libraries/react/client/clientEntityMethods.d.ts +2 -2
  69. package/dist/libraries/react/client/clientGenMethods.d.mts +2 -2
  70. package/dist/libraries/react/client/clientGenMethods.d.ts +2 -2
  71. package/dist/libraries/react/client/types/clientEntTypes.d.mts +5 -1
  72. package/dist/libraries/react/client/types/clientEntTypes.d.ts +5 -1
  73. package/dist/libraries/react/client/types/clientGenTypes.d.mts +5 -0
  74. package/dist/libraries/react/client/types/clientGenTypes.d.ts +5 -0
  75. package/dist/libraries/react/hooks/useAutumn.d.mts +2 -1
  76. package/dist/libraries/react/hooks/useAutumn.d.ts +2 -1
  77. package/dist/libraries/react/hooks/useAutumn.js +8 -13
  78. package/dist/libraries/react/hooks/useAutumn.mjs +4 -4
  79. package/dist/libraries/react/hooks/useCustomer.d.mts +12 -12
  80. package/dist/libraries/react/hooks/useCustomer.d.ts +12 -12
  81. package/dist/libraries/react/hooks/useCustomer.js +1 -2
  82. package/dist/libraries/react/hooks/useCustomer.mjs +4 -4
  83. package/dist/libraries/react/hooks/useCustomerProvider.d.mts +2 -2
  84. package/dist/libraries/react/hooks/useCustomerProvider.d.ts +2 -2
  85. package/dist/libraries/react/hooks/useEntity.js +1 -2
  86. package/dist/libraries/react/hooks/useEntity.mjs +4 -4
  87. package/dist/libraries/react/hooks/useEntityProvider.d.mts +2 -2
  88. package/dist/libraries/react/hooks/useEntityProvider.d.ts +2 -2
  89. package/dist/libraries/react/hooks/useEntityProvider.js +1 -2
  90. package/dist/libraries/react/hooks/useEntityProvider.mjs +2 -2
  91. package/dist/libraries/react/hooks/usePricingTable.js +1 -2
  92. package/dist/libraries/react/hooks/usePricingTable.mjs +4 -4
  93. package/dist/libraries/react/hooks/usePricingTableProvider.d.mts +2 -2
  94. package/dist/libraries/react/hooks/usePricingTableProvider.d.ts +2 -2
  95. package/dist/libraries/react/hooks/usePricingTableProvider.js +1 -2
  96. package/dist/libraries/react/hooks/usePricingTableProvider.mjs +2 -2
  97. package/dist/libraries/react/index.d.mts +5 -5
  98. package/dist/libraries/react/index.d.ts +5 -5
  99. package/dist/libraries/react/index.js +8 -13
  100. package/dist/libraries/react/index.mjs +11 -11
  101. package/dist/libraries/react/{response-DSY82HjT.d.mts → response-T-FFa-qt.d.mts} +0 -1
  102. package/dist/libraries/react/{response-DGkb5pA9.d.ts → response-muDt0SJZ.d.ts} +0 -1
  103. package/dist/next/client/clientUtils.d.mts +1 -1
  104. package/dist/next/client/clientUtils.d.ts +1 -1
  105. package/dist/next/client/clientUtils.js +4 -2
  106. package/dist/next/client/clientUtils.mjs +4 -2
  107. package/dist/next/client/hooks/types.d.mts +2 -23
  108. package/dist/next/client/hooks/types.d.ts +2 -23
  109. package/dist/next/client/hooks/useAutumn.d.mts +5 -3
  110. package/dist/next/client/hooks/useAutumn.d.ts +5 -3
  111. package/dist/next/client/hooks/useAutumn.js +24 -9
  112. package/dist/next/client/hooks/useAutumn.mjs +24 -9
  113. package/dist/next/client/hooks/useCustomer.d.mts +1 -1
  114. package/dist/next/client/hooks/useCustomer.d.ts +1 -1
  115. package/dist/next/client/hooks/useCustomer.js +1 -1
  116. package/dist/next/client/hooks/useCustomer.mjs +1 -1
  117. package/dist/next/client/hooks/useEntity.js +1 -1
  118. package/dist/next/client/hooks/useEntity.mjs +1 -1
  119. package/dist/next/client/types-B7efCges.d.mts +29 -0
  120. package/dist/next/client/types-B7efCges.d.ts +29 -0
  121. package/dist/next/index.d.mts +11 -3
  122. package/dist/next/index.d.ts +11 -3
  123. package/dist/next/server/cusActions.d.mts +2 -29
  124. package/dist/next/server/cusActions.d.ts +2 -29
  125. package/dist/next/server/genActions.d.mts +13 -2
  126. package/dist/next/server/genActions.d.ts +13 -2
  127. package/dist/next/server/genActions.js +25 -10
  128. package/dist/next/server/genActions.mjs +25 -10
  129. package/dist/next/server/{genTypes-faVFtUHP.d.ts → genTypes-DNndDcib.d.mts} +36 -3
  130. package/dist/next/server/{genTypes-C1alamyV.d.mts → genTypes-DaYkl9Ex.d.ts} +36 -3
  131. package/dist/sdk/{entTypes-B07YrTT7.d.mts → entTypes-DAoQnp8D.d.mts} +5 -1
  132. package/dist/sdk/{entTypes-DS32o2jz.d.ts → entTypes-oQpX0x_Y.d.ts} +5 -1
  133. package/dist/sdk/entities.d.mts +1 -1
  134. package/dist/sdk/entities.d.ts +1 -1
  135. package/dist/sdk/general.d.mts +11 -8
  136. package/dist/sdk/general.d.ts +11 -8
  137. package/dist/sdk/index.d.mts +2 -2
  138. package/dist/sdk/index.d.ts +2 -2
  139. package/dist/sdk/index.js +1 -2
  140. package/dist/sdk/index.mjs +1 -2
  141. package/dist/utils/encryptUtils.js +1 -2
  142. package/dist/utils/encryptUtils.mjs +1 -2
  143. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-V7VIK7Q2.mjs";
3
+ } from "./chunk-OMSV2SEC.mjs";
4
4
  import {
5
5
  BASE_PATH
6
6
  } from "./chunk-KSG3E4Q2.mjs";
@@ -109,12 +109,11 @@ var getEntity = async ({
109
109
  entity_id,
110
110
  params
111
111
  }) => {
112
- let res = instance.get(
112
+ return instance.get(
113
113
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
114
114
  params?.expand
115
115
  )}`
116
116
  );
117
- return res;
118
117
  };
119
118
  var createEntity = async ({
120
119
  instance,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-V7VIK7Q2.mjs";
3
+ } from "./chunk-OMSV2SEC.mjs";
4
4
 
5
5
  // src/libraries/backend/routes/entityRoutes.ts
6
6
  import { addRoute } from "rou3";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  toBackendError,
3
3
  toBackendRes
4
- } from "./chunk-7SOQYC4B.mjs";
4
+ } from "./chunk-DXILLNEF.mjs";
5
5
 
6
6
  // src/libraries/backend/utils/withAuth.ts
7
7
  var withAuth = ({
@@ -17,7 +17,8 @@ var withAuth = ({
17
17
  searchParams
18
18
  }) => {
19
19
  let authResult = await getCustomer();
20
- if (!authResult && requireCustomer) {
20
+ let customerId = authResult?.customerId;
21
+ if (!customerId && requireCustomer) {
21
22
  if (body?.errorOnNotFound === false) {
22
23
  return toBackendError({
23
24
  path,
@@ -39,7 +40,7 @@ var withAuth = ({
39
40
  let res = await fn({
40
41
  body,
41
42
  autumn,
42
- customer_id: authResult?.customerId || "",
43
+ customer_id: customerId,
43
44
  customer_data: cusData,
44
45
  pathParams,
45
46
  searchParams
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  addEntityRoutes
3
- } from "./chunk-XPNATE4H.mjs";
3
+ } from "./chunk-LRE7V775.mjs";
4
4
  import {
5
5
  addGenRoutes
6
- } from "./chunk-UD4U5ECV.mjs";
6
+ } from "./chunk-BQYMRMGB.mjs";
7
7
  import {
8
8
  withAuth
9
- } from "./chunk-V7VIK7Q2.mjs";
9
+ } from "./chunk-OMSV2SEC.mjs";
10
10
  import {
11
11
  fetchPricingTable
12
- } from "./chunk-7SOQYC4B.mjs";
12
+ } from "./chunk-DXILLNEF.mjs";
13
13
  import {
14
14
  BASE_PATH
15
15
  } from "./chunk-KSG3E4Q2.mjs";
@@ -114,6 +114,37 @@ interface CustomerInvoice {
114
114
  created_at: number;
115
115
  }
116
116
 
117
+ type EntityExpandOption = "invoices";
118
+
119
+ interface CreateEntityParams {
120
+ id: string;
121
+ name: string;
122
+ feature_id: string;
123
+ }
124
+ interface CreateEntityResult {
125
+ success: boolean;
126
+ }
127
+ interface DeleteEntityResult {
128
+ success: boolean;
129
+ }
130
+ interface GetEntityParams {
131
+ expand?: EntityExpandOption[];
132
+ }
133
+ interface Entity {
134
+ id: string;
135
+ name: string;
136
+ customer_id: string;
137
+ created_at: number;
138
+ env: string;
139
+ products: CustomerProduct[];
140
+ features: Record<string, CustomerFeature>;
141
+ invoices?: CustomerInvoice[];
142
+ }
143
+ interface EntityData {
144
+ name?: string;
145
+ feature_id: string;
146
+ }
147
+
117
148
  interface ProductItem {
118
149
  feature_id?: string;
119
150
  included_usage?: number | typeof Infinite;
@@ -212,6 +243,7 @@ interface AttachParams {
212
243
  metadata?: Record<string, string>;
213
244
  force_checkout?: boolean;
214
245
  customer_data?: CustomerData;
246
+ entity_data?: EntityData;
215
247
  }
216
248
  interface CancelParams {
217
249
  customer_id: string;
@@ -239,6 +271,7 @@ interface TrackParams {
239
271
  entity_id?: string;
240
272
  customer_data?: CustomerData;
241
273
  idempotency_key?: string;
274
+ entity_data?: EntityData;
242
275
  }
243
276
  interface TrackResult {
244
277
  id: string;
@@ -246,7 +279,6 @@ interface TrackResult {
246
279
  customer_id: string;
247
280
  feature_id?: string;
248
281
  event_name?: string;
249
- idempotency_key?: string;
250
282
  }
251
283
  interface CheckParams {
252
284
  customer_id: string;
@@ -257,6 +289,7 @@ interface CheckParams {
257
289
  required_quantity?: number;
258
290
  send_event?: boolean;
259
291
  with_preview?: "raw" | "formatted";
292
+ entity_data?: EntityData;
260
293
  }
261
294
  interface CheckResult {
262
295
  customer_id: string;
@@ -364,31 +397,4 @@ declare class Autumn {
364
397
  usage(params: UsageParams): Promise<Result<UsageResult, AutumnError>>;
365
398
  }
366
399
 
367
- type EntityExpandOption = "invoices";
368
-
369
- interface CreateEntityParams {
370
- id: string;
371
- name: string;
372
- feature_id: string;
373
- }
374
- interface CreateEntityResult {
375
- success: boolean;
376
- }
377
- interface DeleteEntityResult {
378
- success: boolean;
379
- }
380
- interface GetEntityParams {
381
- expand?: EntityExpandOption[];
382
- }
383
- interface Entity {
384
- id: string;
385
- name: string;
386
- customer_id: string;
387
- created_at: number;
388
- env: string;
389
- products: CustomerProduct[];
390
- features: Record<string, CustomerFeature>;
391
- invoices?: CustomerInvoice[];
392
- }
393
-
394
400
  export { Autumn as A, type CustomerData as C };
@@ -114,6 +114,37 @@ interface CustomerInvoice {
114
114
  created_at: number;
115
115
  }
116
116
 
117
+ type EntityExpandOption = "invoices";
118
+
119
+ interface CreateEntityParams {
120
+ id: string;
121
+ name: string;
122
+ feature_id: string;
123
+ }
124
+ interface CreateEntityResult {
125
+ success: boolean;
126
+ }
127
+ interface DeleteEntityResult {
128
+ success: boolean;
129
+ }
130
+ interface GetEntityParams {
131
+ expand?: EntityExpandOption[];
132
+ }
133
+ interface Entity {
134
+ id: string;
135
+ name: string;
136
+ customer_id: string;
137
+ created_at: number;
138
+ env: string;
139
+ products: CustomerProduct[];
140
+ features: Record<string, CustomerFeature>;
141
+ invoices?: CustomerInvoice[];
142
+ }
143
+ interface EntityData {
144
+ name?: string;
145
+ feature_id: string;
146
+ }
147
+
117
148
  interface ProductItem {
118
149
  feature_id?: string;
119
150
  included_usage?: number | typeof Infinite;
@@ -212,6 +243,7 @@ interface AttachParams {
212
243
  metadata?: Record<string, string>;
213
244
  force_checkout?: boolean;
214
245
  customer_data?: CustomerData;
246
+ entity_data?: EntityData;
215
247
  }
216
248
  interface CancelParams {
217
249
  customer_id: string;
@@ -239,6 +271,7 @@ interface TrackParams {
239
271
  entity_id?: string;
240
272
  customer_data?: CustomerData;
241
273
  idempotency_key?: string;
274
+ entity_data?: EntityData;
242
275
  }
243
276
  interface TrackResult {
244
277
  id: string;
@@ -246,7 +279,6 @@ interface TrackResult {
246
279
  customer_id: string;
247
280
  feature_id?: string;
248
281
  event_name?: string;
249
- idempotency_key?: string;
250
282
  }
251
283
  interface CheckParams {
252
284
  customer_id: string;
@@ -257,6 +289,7 @@ interface CheckParams {
257
289
  required_quantity?: number;
258
290
  send_event?: boolean;
259
291
  with_preview?: "raw" | "formatted";
292
+ entity_data?: EntityData;
260
293
  }
261
294
  interface CheckResult {
262
295
  customer_id: string;
@@ -364,31 +397,4 @@ declare class Autumn {
364
397
  usage(params: UsageParams): Promise<Result<UsageResult, AutumnError>>;
365
398
  }
366
399
 
367
- type EntityExpandOption = "invoices";
368
-
369
- interface CreateEntityParams {
370
- id: string;
371
- name: string;
372
- feature_id: string;
373
- }
374
- interface CreateEntityResult {
375
- success: boolean;
376
- }
377
- interface DeleteEntityResult {
378
- success: boolean;
379
- }
380
- interface GetEntityParams {
381
- expand?: EntityExpandOption[];
382
- }
383
- interface Entity {
384
- id: string;
385
- name: string;
386
- customer_id: string;
387
- created_at: number;
388
- env: string;
389
- products: CustomerProduct[];
390
- features: Record<string, CustomerFeature>;
391
- invoices?: CustomerInvoice[];
392
- }
393
-
394
400
  export { Autumn as A, type CustomerData as C };
@@ -136,12 +136,11 @@ var getEntity = async ({
136
136
  entity_id,
137
137
  params
138
138
  }) => {
139
- let res = instance.get(
139
+ return instance.get(
140
140
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
141
141
  params?.expand
142
142
  )}`
143
143
  );
144
- return res;
145
144
  };
146
145
  var createEntity = async ({
147
146
  instance,
@@ -473,7 +472,8 @@ var withAuth = ({
473
472
  searchParams
474
473
  }) => {
475
474
  let authResult = await getCustomer2();
476
- if (!authResult && requireCustomer) {
475
+ let customerId = authResult?.customerId;
476
+ if (!customerId && requireCustomer) {
477
477
  if (body?.errorOnNotFound === false) {
478
478
  return toBackendError({
479
479
  path,
@@ -495,7 +495,7 @@ var withAuth = ({
495
495
  let res = await fn({
496
496
  body,
497
497
  autumn,
498
- customer_id: authResult?.customerId || "",
498
+ customer_id: customerId,
499
499
  customer_data: cusData,
500
500
  pathParams,
501
501
  searchParams
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRouterWithOptions
3
- } from "./chunk-GA6SKSWH.mjs";
4
- import "./chunk-XPNATE4H.mjs";
5
- import "./chunk-UD4U5ECV.mjs";
6
- import "./chunk-V7VIK7Q2.mjs";
3
+ } from "./chunk-U357CO3L.mjs";
4
+ import "./chunk-LRE7V775.mjs";
5
+ import "./chunk-BQYMRMGB.mjs";
6
+ import "./chunk-OMSV2SEC.mjs";
7
7
  import {
8
8
  Autumn
9
- } from "./chunk-7SOQYC4B.mjs";
9
+ } from "./chunk-DXILLNEF.mjs";
10
10
  import {
11
11
  autumnApiUrl
12
12
  } from "./chunk-KSG3E4Q2.mjs";
@@ -136,12 +136,11 @@ var getEntity = async ({
136
136
  entity_id,
137
137
  params
138
138
  }) => {
139
- let res = instance.get(
139
+ return instance.get(
140
140
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
141
141
  params?.expand
142
142
  )}`
143
143
  );
144
- return res;
145
144
  };
146
145
  var createEntity = async ({
147
146
  instance,
@@ -473,7 +472,8 @@ var withAuth = ({
473
472
  searchParams
474
473
  }) => {
475
474
  let authResult = await getCustomer2();
476
- if (!authResult && requireCustomer) {
475
+ let customerId = authResult?.customerId;
476
+ if (!customerId && requireCustomer) {
477
477
  if (body?.errorOnNotFound === false) {
478
478
  return toBackendError({
479
479
  path,
@@ -495,7 +495,7 @@ var withAuth = ({
495
495
  let res = await fn({
496
496
  body,
497
497
  autumn,
498
- customer_id: authResult?.customerId || "",
498
+ customer_id: customerId,
499
499
  customer_data: cusData,
500
500
  pathParams,
501
501
  searchParams
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRouterWithOptions
3
- } from "./chunk-GA6SKSWH.mjs";
4
- import "./chunk-XPNATE4H.mjs";
5
- import "./chunk-UD4U5ECV.mjs";
6
- import "./chunk-V7VIK7Q2.mjs";
3
+ } from "./chunk-U357CO3L.mjs";
4
+ import "./chunk-LRE7V775.mjs";
5
+ import "./chunk-BQYMRMGB.mjs";
6
+ import "./chunk-OMSV2SEC.mjs";
7
7
  import {
8
8
  Autumn
9
- } from "./chunk-7SOQYC4B.mjs";
9
+ } from "./chunk-DXILLNEF.mjs";
10
10
  import {
11
11
  autumnApiUrl
12
12
  } from "./chunk-KSG3E4Q2.mjs";
@@ -136,12 +136,11 @@ var getEntity = async ({
136
136
  entity_id,
137
137
  params
138
138
  }) => {
139
- let res = instance.get(
139
+ return instance.get(
140
140
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
141
141
  params?.expand
142
142
  )}`
143
143
  );
144
- return res;
145
144
  };
146
145
  var createEntity = async ({
147
146
  instance,
@@ -473,7 +472,8 @@ var withAuth = ({
473
472
  searchParams
474
473
  }) => {
475
474
  let authResult = await getCustomer2();
476
- if (!authResult && requireCustomer) {
475
+ let customerId = authResult?.customerId;
476
+ if (!customerId && requireCustomer) {
477
477
  if (body?.errorOnNotFound === false) {
478
478
  return toBackendError({
479
479
  path,
@@ -495,7 +495,7 @@ var withAuth = ({
495
495
  let res = await fn({
496
496
  body,
497
497
  autumn,
498
- customer_id: authResult?.customerId || "",
498
+ customer_id: customerId,
499
499
  customer_data: cusData,
500
500
  pathParams,
501
501
  searchParams
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRouterWithOptions
3
- } from "./chunk-GA6SKSWH.mjs";
4
- import "./chunk-XPNATE4H.mjs";
5
- import "./chunk-UD4U5ECV.mjs";
6
- import "./chunk-V7VIK7Q2.mjs";
3
+ } from "./chunk-U357CO3L.mjs";
4
+ import "./chunk-LRE7V775.mjs";
5
+ import "./chunk-BQYMRMGB.mjs";
6
+ import "./chunk-OMSV2SEC.mjs";
7
7
  import {
8
8
  Autumn
9
- } from "./chunk-7SOQYC4B.mjs";
9
+ } from "./chunk-DXILLNEF.mjs";
10
10
  import {
11
11
  autumnApiUrl
12
12
  } from "./chunk-KSG3E4Q2.mjs";
@@ -3643,12 +3643,11 @@ var getEntity = async ({
3643
3643
  entity_id,
3644
3644
  params
3645
3645
  }) => {
3646
- let res = instance.get(
3646
+ return instance.get(
3647
3647
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
3648
3648
  params?.expand
3649
3649
  )}`
3650
3650
  );
3651
- return res;
3652
3651
  };
3653
3652
  var createEntity = async ({
3654
3653
  instance,
@@ -3983,7 +3982,8 @@ var withAuth = ({
3983
3982
  searchParams
3984
3983
  }) => {
3985
3984
  let authResult = await getCustomer2();
3986
- if (!authResult && requireCustomer) {
3985
+ let customerId = authResult?.customerId;
3986
+ if (!customerId && requireCustomer) {
3987
3987
  if (body?.errorOnNotFound === false) {
3988
3988
  return toBackendError({
3989
3989
  path,
@@ -4005,7 +4005,7 @@ var withAuth = ({
4005
4005
  let res = await fn({
4006
4006
  body,
4007
4007
  autumn,
4008
- customer_id: authResult?.customerId || "",
4008
+ customer_id: customerId,
4009
4009
  customer_data: cusData,
4010
4010
  pathParams,
4011
4011
  searchParams
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRouterWithOptions
3
- } from "./chunk-GA6SKSWH.mjs";
4
- import "./chunk-XPNATE4H.mjs";
5
- import "./chunk-UD4U5ECV.mjs";
6
- import "./chunk-V7VIK7Q2.mjs";
3
+ } from "./chunk-U357CO3L.mjs";
4
+ import "./chunk-LRE7V775.mjs";
5
+ import "./chunk-BQYMRMGB.mjs";
6
+ import "./chunk-OMSV2SEC.mjs";
7
7
  import {
8
8
  Autumn
9
- } from "./chunk-7SOQYC4B.mjs";
9
+ } from "./chunk-DXILLNEF.mjs";
10
10
  import {
11
11
  autumnApiUrl
12
12
  } from "./chunk-KSG3E4Q2.mjs";
@@ -135,12 +135,11 @@ var getEntity = async ({
135
135
  entity_id,
136
136
  params
137
137
  }) => {
138
- let res = instance.get(
138
+ return instance.get(
139
139
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
140
140
  params?.expand
141
141
  )}`
142
142
  );
143
- return res;
144
143
  };
145
144
  var createEntity = async ({
146
145
  instance,
@@ -472,7 +471,8 @@ var withAuth = ({
472
471
  searchParams
473
472
  }) => {
474
473
  let authResult = await getCustomer2();
475
- if (!authResult && requireCustomer) {
474
+ let customerId = authResult?.customerId;
475
+ if (!customerId && requireCustomer) {
476
476
  if (body?.errorOnNotFound === false) {
477
477
  return toBackendError({
478
478
  path,
@@ -494,7 +494,7 @@ var withAuth = ({
494
494
  let res = await fn({
495
495
  body,
496
496
  autumn,
497
- customer_id: authResult?.customerId || "",
497
+ customer_id: customerId,
498
498
  customer_data: cusData,
499
499
  pathParams,
500
500
  searchParams
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRouterWithOptions
3
- } from "./chunk-GA6SKSWH.mjs";
4
- import "./chunk-XPNATE4H.mjs";
5
- import "./chunk-UD4U5ECV.mjs";
6
- import "./chunk-V7VIK7Q2.mjs";
3
+ } from "./chunk-U357CO3L.mjs";
4
+ import "./chunk-LRE7V775.mjs";
5
+ import "./chunk-BQYMRMGB.mjs";
6
+ import "./chunk-OMSV2SEC.mjs";
7
7
  import {
8
8
  Autumn
9
- } from "./chunk-7SOQYC4B.mjs";
9
+ } from "./chunk-DXILLNEF.mjs";
10
10
  import {
11
11
  autumnApiUrl
12
12
  } from "./chunk-KSG3E4Q2.mjs";
@@ -1,5 +1,5 @@
1
1
  import * as rou3 from 'rou3';
2
- import { A as Autumn } from '../entTypes-BHLroNdS.mjs';
2
+ import { A as Autumn } from '../client-C4aZxBxK.mjs';
3
3
  import '../response-ByHPEnHs.mjs';
4
4
 
5
5
  type RouteData = {
@@ -1,5 +1,5 @@
1
1
  import * as rou3 from 'rou3';
2
- import { A as Autumn } from '../entTypes-BJGM9Knl.js';
2
+ import { A as Autumn } from '../client-DJJAbrX7.js';
3
3
  import '../response-ByHPEnHs.js';
4
4
 
5
5
  type RouteData = {
@@ -135,12 +135,11 @@ var getEntity = async ({
135
135
  entity_id,
136
136
  params
137
137
  }) => {
138
- let res = instance.get(
138
+ return instance.get(
139
139
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
140
140
  params?.expand
141
141
  )}`
142
142
  );
143
- return res;
144
143
  };
145
144
  var createEntity = async ({
146
145
  instance,
@@ -472,7 +471,8 @@ var withAuth = ({
472
471
  searchParams
473
472
  }) => {
474
473
  let authResult = await getCustomer2();
475
- if (!authResult && requireCustomer) {
474
+ let customerId = authResult?.customerId;
475
+ if (!customerId && requireCustomer) {
476
476
  if (body?.errorOnNotFound === false) {
477
477
  return toBackendError({
478
478
  path,
@@ -494,7 +494,7 @@ var withAuth = ({
494
494
  let res = await fn({
495
495
  body,
496
496
  autumn,
497
- customer_id: authResult?.customerId || "",
497
+ customer_id: customerId,
498
498
  customer_data: cusData,
499
499
  pathParams,
500
500
  searchParams
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createRouterWithOptions
3
- } from "../chunk-GA6SKSWH.mjs";
4
- import "../chunk-XPNATE4H.mjs";
5
- import "../chunk-UD4U5ECV.mjs";
6
- import "../chunk-V7VIK7Q2.mjs";
7
- import "../chunk-7SOQYC4B.mjs";
3
+ } from "../chunk-U357CO3L.mjs";
4
+ import "../chunk-LRE7V775.mjs";
5
+ import "../chunk-BQYMRMGB.mjs";
6
+ import "../chunk-OMSV2SEC.mjs";
7
+ import "../chunk-DXILLNEF.mjs";
8
8
  import "../chunk-KSG3E4Q2.mjs";
9
9
  import "../chunk-6DZX6EAA.mjs";
10
10
  export {
@@ -136,12 +136,11 @@ var getEntity = async ({
136
136
  entity_id,
137
137
  params
138
138
  }) => {
139
- let res = instance.get(
139
+ return instance.get(
140
140
  `/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
141
141
  params?.expand
142
142
  )}`
143
143
  );
144
- return res;
145
144
  };
146
145
  var createEntity = async ({
147
146
  instance,
@@ -449,7 +448,8 @@ var withAuth = ({
449
448
  searchParams
450
449
  }) => {
451
450
  let authResult = await getCustomer2();
452
- if (!authResult && requireCustomer) {
451
+ let customerId = authResult?.customerId;
452
+ if (!customerId && requireCustomer) {
453
453
  if (body?.errorOnNotFound === false) {
454
454
  return toBackendError({
455
455
  path,
@@ -471,7 +471,7 @@ var withAuth = ({
471
471
  let res = await fn({
472
472
  body,
473
473
  autumn,
474
- customer_id: authResult?.customerId || "",
474
+ customer_id: customerId,
475
475
  customer_data: cusData,
476
476
  pathParams,
477
477
  searchParams
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  addEntityRoutes
3
- } from "../chunk-XPNATE4H.mjs";
4
- import "../chunk-V7VIK7Q2.mjs";
5
- import "../chunk-7SOQYC4B.mjs";
3
+ } from "../chunk-LRE7V775.mjs";
4
+ import "../chunk-OMSV2SEC.mjs";
5
+ import "../chunk-DXILLNEF.mjs";
6
6
  import "../chunk-6DZX6EAA.mjs";
7
7
  export {
8
8
  addEntityRoutes