@chrt-inc/typescript-sdk 1.647.0 → 1.651.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +8 -8
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/billing/resources/rateSheetMappings/client/Client.d.ts +19 -0
  4. package/dist/cjs/api/resources/billing/resources/rateSheetMappings/client/Client.js +79 -0
  5. package/dist/cjs/api/resources/billing/resources/rateSheetMappings/client/requests/RateSheetMappingsListRateSheetIdsByCounterpartyV1Request.d.ts +18 -0
  6. package/dist/cjs/api/resources/billing/resources/rateSheetMappings/client/requests/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/billing/resources/stripe/client/Client.d.ts +7 -6
  8. package/dist/cjs/api/resources/billing/resources/stripe/client/Client.js +11 -10
  9. package/dist/cjs/api/resources/billing/resources/stripe/client/requests/CreateCheckoutSessionReq.d.ts +4 -3
  10. package/dist/cjs/api/resources/orgs/client/Client.d.ts +5 -5
  11. package/dist/cjs/api/resources/orgs/client/Client.js +8 -8
  12. package/dist/cjs/api/resources/orgs/{resources/publicData/client/requests/CreateOrgPublicDataReq.d.ts → client/requests/SetupOrgReq.d.ts} +6 -2
  13. package/dist/cjs/api/resources/orgs/client/requests/index.d.ts +1 -1
  14. package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.d.ts +0 -13
  15. package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.js +0 -62
  16. package/dist/cjs/api/resources/orgs/resources/publicData/client/requests/index.d.ts +0 -1
  17. package/dist/cjs/api/types/CreateCustomerPortalSessionRes.d.ts +6 -0
  18. package/dist/cjs/api/types/OrgPrivateData1.d.ts +1 -0
  19. package/dist/cjs/api/types/UserPrivateData1.d.ts +0 -1
  20. package/dist/cjs/api/types/index.d.ts +1 -2
  21. package/dist/cjs/api/types/index.js +1 -2
  22. package/dist/cjs/version.d.ts +1 -1
  23. package/dist/cjs/version.js +1 -1
  24. package/dist/esm/Client.mjs +2 -2
  25. package/dist/esm/api/resources/billing/resources/rateSheetMappings/client/Client.d.mts +19 -0
  26. package/dist/esm/api/resources/billing/resources/rateSheetMappings/client/Client.mjs +79 -0
  27. package/dist/esm/api/resources/billing/resources/rateSheetMappings/client/requests/RateSheetMappingsListRateSheetIdsByCounterpartyV1Request.d.mts +18 -0
  28. package/dist/esm/api/resources/billing/resources/rateSheetMappings/client/requests/index.d.mts +1 -0
  29. package/dist/esm/api/resources/billing/resources/stripe/client/Client.d.mts +7 -6
  30. package/dist/esm/api/resources/billing/resources/stripe/client/Client.mjs +11 -10
  31. package/dist/esm/api/resources/billing/resources/stripe/client/requests/CreateCheckoutSessionReq.d.mts +4 -3
  32. package/dist/esm/api/resources/orgs/client/Client.d.mts +5 -5
  33. package/dist/esm/api/resources/orgs/client/Client.mjs +8 -8
  34. package/dist/esm/api/resources/orgs/{resources/publicData/client/requests/CreateOrgPublicDataReq.d.mts → client/requests/SetupOrgReq.d.mts} +6 -2
  35. package/dist/esm/api/resources/orgs/client/requests/index.d.mts +1 -1
  36. package/dist/esm/api/resources/orgs/resources/publicData/client/Client.d.mts +0 -13
  37. package/dist/esm/api/resources/orgs/resources/publicData/client/Client.mjs +0 -62
  38. package/dist/esm/api/resources/orgs/resources/publicData/client/requests/index.d.mts +0 -1
  39. package/dist/esm/api/types/CreateCustomerPortalSessionRes.d.mts +6 -0
  40. package/dist/esm/api/types/OrgPrivateData1.d.mts +1 -0
  41. package/dist/esm/api/types/UserPrivateData1.d.mts +0 -1
  42. package/dist/esm/api/types/index.d.mts +1 -2
  43. package/dist/esm/api/types/index.mjs +1 -2
  44. package/dist/esm/version.d.mts +1 -1
  45. package/dist/esm/version.mjs +1 -1
  46. package/package.json +1 -1
  47. package/reference.md +86 -72
  48. package/dist/cjs/api/resources/orgs/client/requests/SetOrgTypeReq.d.ts +0 -13
  49. package/dist/cjs/api/types/CreateOrgPublicDataRes.d.ts +0 -7
  50. package/dist/cjs/api/types/PriceNameEnum.d.ts +0 -9
  51. package/dist/cjs/api/types/PriceNameEnum.js +0 -11
  52. package/dist/esm/api/resources/orgs/client/requests/SetOrgTypeReq.d.mts +0 -13
  53. package/dist/esm/api/types/CreateOrgPublicDataRes.d.mts +0 -7
  54. package/dist/esm/api/types/PriceNameEnum.d.mts +0 -9
  55. package/dist/esm/api/types/PriceNameEnum.mjs +0 -8
  56. /package/dist/cjs/api/resources/{orgs/client/requests/SetOrgTypeReq.js → billing/resources/rateSheetMappings/client/requests/RateSheetMappingsListRateSheetIdsByCounterpartyV1Request.js} +0 -0
  57. /package/dist/cjs/api/resources/orgs/{resources/publicData/client/requests/CreateOrgPublicDataReq.js → client/requests/SetupOrgReq.js} +0 -0
  58. /package/dist/cjs/api/types/{CreateOrgPublicDataRes.js → CreateCustomerPortalSessionRes.js} +0 -0
  59. /package/dist/esm/api/resources/{orgs/client/requests/SetOrgTypeReq.mjs → billing/resources/rateSheetMappings/client/requests/RateSheetMappingsListRateSheetIdsByCounterpartyV1Request.mjs} +0 -0
  60. /package/dist/esm/api/resources/orgs/{resources/publicData/client/requests/CreateOrgPublicDataReq.mjs → client/requests/SetupOrgReq.mjs} +0 -0
  61. /package/dist/esm/api/types/{CreateOrgPublicDataRes.mjs → CreateCustomerPortalSessionRes.mjs} +0 -0
package/reference.md CHANGED
@@ -126,7 +126,7 @@ await client.orgs.listMembersV1({
126
126
  </dl>
127
127
  </details>
128
128
 
129
- <details><summary><code>client.orgs.<a href="/src/api/resources/orgs/client/Client.ts">setOrgTypeV1</a>({ ...params }) -> boolean</code></summary>
129
+ <details><summary><code>client.orgs.<a href="/src/api/resources/orgs/client/Client.ts">setupOrgV1</a>({ ...params }) -> boolean</code></summary>
130
130
  <dl>
131
131
  <dd>
132
132
 
@@ -138,7 +138,7 @@ await client.orgs.listMembersV1({
138
138
  <dl>
139
139
  <dd>
140
140
 
141
- Sets the org_type in Clerk's JWT public metadata. Returns True if already set and matching, sets it if not present, or raises exception if conflicting. | (SetOrgTypeReq) -> (bool)
141
+ Single onboarding entry point. Sets `org_type` in Clerk's JWT public metadata (immutable once set) and idempotently creates `org_private_data` + `org_public_data` for the caller's organization. Optional `handle` and `company_name` populate the public doc on first call; later updates go through PATCH /orgs/org_public_data/v1. Returns True on success (including idempotent retries), 400 on org_type conflict or handle collision. | (SetupOrgReq) -> (bool)
142
142
 
143
143
  </dd>
144
144
  </dl>
@@ -154,7 +154,7 @@ Sets the org_type in Clerk's JWT public metadata. Returns True if already set an
154
154
  <dd>
155
155
 
156
156
  ```typescript
157
- await client.orgs.setOrgTypeV1({
157
+ await client.orgs.setupOrgV1({
158
158
  org_type: "provider",
159
159
  });
160
160
  ```
@@ -172,7 +172,7 @@ await client.orgs.setOrgTypeV1({
172
172
  <dl>
173
173
  <dd>
174
174
 
175
- **request:** `Chrt.SetOrgTypeReq`
175
+ **request:** `Chrt.SetupOrgReq`
176
176
 
177
177
  </dd>
178
178
  </dl>
@@ -3529,6 +3529,82 @@ await client.billing.rateSheetMappings.listV1({
3529
3529
  </dl>
3530
3530
  </details>
3531
3531
 
3532
+ <details><summary><code>client.billing.rateSheetMappings.<a href="/src/api/resources/billing/resources/rateSheetMappings/client/Client.ts">listRateSheetIdsByCounterpartyV1</a>(tgType, { ...params }) -> string[]</code></summary>
3533
+ <dl>
3534
+ <dd>
3535
+
3536
+ #### 📝 Description
3537
+
3538
+ <dl>
3539
+ <dd>
3540
+
3541
+ <dl>
3542
+ <dd>
3543
+
3544
+ Lists rate sheet IDs mapped to a counterparty for the requested task group type. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (list[PydanticObjectId])
3545
+
3546
+ </dd>
3547
+ </dl>
3548
+ </dd>
3549
+ </dl>
3550
+
3551
+ #### 🔌 Usage
3552
+
3553
+ <dl>
3554
+ <dd>
3555
+
3556
+ <dl>
3557
+ <dd>
3558
+
3559
+ ```typescript
3560
+ await client.billing.rateSheetMappings.listRateSheetIdsByCounterpartyV1("chrt_ground_provider", {
3561
+ counterparty_org_id: "counterparty_org_id",
3562
+ counterparty_driver_id: "counterparty_driver_id",
3563
+ counterparty_off_chrt_provider_org_id: "counterparty_off_chrt_provider_org_id",
3564
+ counterparty_off_chrt_shipper_org_id: "counterparty_off_chrt_shipper_org_id",
3565
+ });
3566
+ ```
3567
+
3568
+ </dd>
3569
+ </dl>
3570
+ </dd>
3571
+ </dl>
3572
+
3573
+ #### ⚙️ Parameters
3574
+
3575
+ <dl>
3576
+ <dd>
3577
+
3578
+ <dl>
3579
+ <dd>
3580
+
3581
+ **tgType:** `Chrt.TaskGroupTypeEnum1`
3582
+
3583
+ </dd>
3584
+ </dl>
3585
+
3586
+ <dl>
3587
+ <dd>
3588
+
3589
+ **request:** `Chrt.billing.RateSheetMappingsListRateSheetIdsByCounterpartyV1Request`
3590
+
3591
+ </dd>
3592
+ </dl>
3593
+
3594
+ <dl>
3595
+ <dd>
3596
+
3597
+ **requestOptions:** `RateSheetMappings.RequestOptions`
3598
+
3599
+ </dd>
3600
+ </dl>
3601
+ </dd>
3602
+ </dl>
3603
+
3604
+ </dd>
3605
+ </dl>
3606
+ </details>
3607
+
3532
3608
  <details><summary><code>client.billing.rateSheetMappings.<a href="/src/api/resources/billing/resources/rateSheetMappings/client/Client.ts">createV1</a>({ ...params }) -> string</code></summary>
3533
3609
  <dl>
3534
3610
  <dd>
@@ -5132,7 +5208,7 @@ await client.billing.statements.deleteV1("statement_id");
5132
5208
  <dl>
5133
5209
  <dd>
5134
5210
 
5135
- Creates a Stripe checkout session for a subscription with pricing based on the selected plan. | (CreateCheckoutSessionReq) -> (CreateCheckoutSessionRes)
5211
+ Creates a Stripe checkout session for a subscription against the Stripe product+price chosen by the frontend. Stripe rejects unknown/archived/mode-mismatched price IDs. Returns 409 `use_create_customer_portal_session` if the org already has an active subscription in Stripe (source of truth -- bypasses any JWT staleness). FE should route those users to POST /billing/create-customer-portal-session/v1 to manage. authz: allowed_org_types=[provider] (shippers cannot subscribe -- they are never gated, paying would be a no-op), min_org_role=administrator (committing the company to recurring charges is a finance decision, not an operator one). | (CreateCheckoutSessionReq) -> (CreateCheckoutSessionRes)
5136
5212
 
5137
5213
  </dd>
5138
5214
  </dl>
@@ -5149,7 +5225,8 @@ Creates a Stripe checkout session for a subscription with pricing based on the s
5149
5225
 
5150
5226
  ```typescript
5151
5227
  await client.billing.stripe.createCheckoutSessionV1({
5152
- price_name: "courier_ops_100_usd_per_month",
5228
+ product_id: "product_id",
5229
+ price_id: "price_id",
5153
5230
  });
5154
5231
  ```
5155
5232
 
@@ -5185,7 +5262,7 @@ await client.billing.stripe.createCheckoutSessionV1({
5185
5262
  </dl>
5186
5263
  </details>
5187
5264
 
5188
- <details><summary><code>client.billing.stripe.<a href="/src/api/resources/billing/resources/stripe/client/Client.ts">syncStripeToClerkV1</a>() -> boolean</code></summary>
5265
+ <details><summary><code>client.billing.stripe.<a href="/src/api/resources/billing/resources/stripe/client/Client.ts">createCustomerPortalSessionV1</a>() -> Chrt.CreateCustomerPortalSessionRes</code></summary>
5189
5266
  <dl>
5190
5267
  <dd>
5191
5268
 
@@ -5197,7 +5274,7 @@ await client.billing.stripe.createCheckoutSessionV1({
5197
5274
  <dl>
5198
5275
  <dd>
5199
5276
 
5200
- Synchronizes subscription data from Stripe to the authentication service for the current user. | () -> (bool)
5277
+ Creates a Stripe customer-portal session so the org's admin can self-serve update card / view invoices / cancel subscription. authz: allowed_org_types=[provider], min_org_role=administrator (same gate as create-checkout-session — cancelling/updating-card has the same financial weight as subscribing). Returns 404 `use_create_checkout_session` if the org has no Stripe customer. POST /billing/create-checkout-session/v1 first. | (no body) -> (CreateCustomerPortalSessionRes)
5201
5278
 
5202
5279
  </dd>
5203
5280
  </dl>
@@ -5213,7 +5290,7 @@ Synchronizes subscription data from Stripe to the authentication service for the
5213
5290
  <dd>
5214
5291
 
5215
5292
  ```typescript
5216
- await client.billing.stripe.syncStripeToClerkV1();
5293
+ await client.billing.stripe.createCustomerPortalSessionV1();
5217
5294
  ```
5218
5295
 
5219
5296
  </dd>
@@ -12885,69 +12962,6 @@ await client.orgs.publicData.getV1();
12885
12962
  </dl>
12886
12963
  </details>
12887
12964
 
12888
- <details><summary><code>client.orgs.publicData.<a href="/src/api/resources/orgs/resources/publicData/client/Client.ts">createV1</a>({ ...params }) -> Chrt.CreateOrgPublicDataRes</code></summary>
12889
- <dl>
12890
- <dd>
12891
-
12892
- #### 📝 Description
12893
-
12894
- <dl>
12895
- <dd>
12896
-
12897
- <dl>
12898
- <dd>
12899
-
12900
- Creates org_public_data and org_private_data documents for the caller's organization using org_type from JWT. | (CreateOrgPublicDataReq) -> (CreateOrgPublicDataRes)
12901
-
12902
- </dd>
12903
- </dl>
12904
- </dd>
12905
- </dl>
12906
-
12907
- #### 🔌 Usage
12908
-
12909
- <dl>
12910
- <dd>
12911
-
12912
- <dl>
12913
- <dd>
12914
-
12915
- ```typescript
12916
- await client.orgs.publicData.createV1();
12917
- ```
12918
-
12919
- </dd>
12920
- </dl>
12921
- </dd>
12922
- </dl>
12923
-
12924
- #### ⚙️ Parameters
12925
-
12926
- <dl>
12927
- <dd>
12928
-
12929
- <dl>
12930
- <dd>
12931
-
12932
- **request:** `Chrt.orgs.CreateOrgPublicDataReq`
12933
-
12934
- </dd>
12935
- </dl>
12936
-
12937
- <dl>
12938
- <dd>
12939
-
12940
- **requestOptions:** `PublicData.RequestOptions`
12941
-
12942
- </dd>
12943
- </dl>
12944
- </dd>
12945
- </dl>
12946
-
12947
- </dd>
12948
- </dl>
12949
- </details>
12950
-
12951
12965
  <details><summary><code>client.orgs.publicData.<a href="/src/api/resources/orgs/resources/publicData/client/Client.ts">updateV1</a>({ ...params }) -> boolean</code></summary>
12952
12966
  <dl>
12953
12967
  <dd>
@@ -1,13 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as Chrt from "../../../../index.js";
5
- /**
6
- * @example
7
- * {
8
- * org_type: "provider"
9
- * }
10
- */
11
- export interface SetOrgTypeReq {
12
- org_type: Chrt.OrgTypeEnum;
13
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export interface CreateOrgPublicDataRes {
5
- org_public_data_inserted_id: string;
6
- org_private_data_inserted_id?: string | null;
7
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export type PriceNameEnum = "courier_ops_100_usd_per_month" | "courier_ops_500_usd_per_month" | "courier_ops_2500_usd_per_month";
5
- export declare const PriceNameEnum: {
6
- readonly CourierOps100UsdPerMonth: "courier_ops_100_usd_per_month";
7
- readonly CourierOps500UsdPerMonth: "courier_ops_500_usd_per_month";
8
- readonly CourierOps2500UsdPerMonth: "courier_ops_2500_usd_per_month";
9
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PriceNameEnum = void 0;
7
- exports.PriceNameEnum = {
8
- CourierOps100UsdPerMonth: "courier_ops_100_usd_per_month",
9
- CourierOps500UsdPerMonth: "courier_ops_500_usd_per_month",
10
- CourierOps2500UsdPerMonth: "courier_ops_2500_usd_per_month",
11
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as Chrt from "../../../../index.mjs";
5
- /**
6
- * @example
7
- * {
8
- * org_type: "provider"
9
- * }
10
- */
11
- export interface SetOrgTypeReq {
12
- org_type: Chrt.OrgTypeEnum;
13
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export interface CreateOrgPublicDataRes {
5
- org_public_data_inserted_id: string;
6
- org_private_data_inserted_id?: string | null;
7
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export type PriceNameEnum = "courier_ops_100_usd_per_month" | "courier_ops_500_usd_per_month" | "courier_ops_2500_usd_per_month";
5
- export declare const PriceNameEnum: {
6
- readonly CourierOps100UsdPerMonth: "courier_ops_100_usd_per_month";
7
- readonly CourierOps500UsdPerMonth: "courier_ops_500_usd_per_month";
8
- readonly CourierOps2500UsdPerMonth: "courier_ops_2500_usd_per_month";
9
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export const PriceNameEnum = {
5
- CourierOps100UsdPerMonth: "courier_ops_100_usd_per_month",
6
- CourierOps500UsdPerMonth: "courier_ops_500_usd_per_month",
7
- CourierOps2500UsdPerMonth: "courier_ops_2500_usd_per_month",
8
- };