@chatarmin/os 1.1.0 → 1.3.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.
- package/README.md +11 -1
- package/dist/index.d.ts +100 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +124 -41
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -63,6 +63,7 @@ const os = new ChatarminOS({
|
|
|
63
63
|
// Onboard a new customer (single call does everything!)
|
|
64
64
|
const result = await os.onboard({
|
|
65
65
|
externalOrgId: "org_abc123", // Your product's org ID
|
|
66
|
+
label: "My Product", // Display label for the product link (required)
|
|
66
67
|
hints: {
|
|
67
68
|
companyName: "Acme Inc",
|
|
68
69
|
domain: "acme.com",
|
|
@@ -109,6 +110,7 @@ const company = await os.companies.create({
|
|
|
109
110
|
name: "Acme Inc",
|
|
110
111
|
domain: "acme.com",
|
|
111
112
|
externalOrgId: "org_abc123",
|
|
113
|
+
label: "My Product", // Display label for the product link
|
|
112
114
|
contactEmail: "admin@acme.com",
|
|
113
115
|
contactName: "John Doe",
|
|
114
116
|
createdAt: "2024-01-15T10:30:00.000Z", // Optional: historical date
|
|
@@ -136,12 +138,13 @@ Intelligently find and link a company using hints.
|
|
|
136
138
|
```typescript
|
|
137
139
|
const result = await os.companies.smartLink({
|
|
138
140
|
externalOrgId: "org_abc123",
|
|
141
|
+
label: "My Product", // Display label for the product link (required)
|
|
139
142
|
hints: {
|
|
140
143
|
companyName: "Acme Inc",
|
|
141
144
|
domain: "acme.com",
|
|
142
145
|
emails: ["john@acme.com", "jane@acme.com"],
|
|
143
146
|
},
|
|
144
|
-
minConfidence: 0.7, // Default: 0.
|
|
147
|
+
minConfidence: 0.7, // Default: 0.8
|
|
145
148
|
})
|
|
146
149
|
|
|
147
150
|
switch (result.status) {
|
|
@@ -542,6 +545,7 @@ The `onboard()` method handles:
|
|
|
542
545
|
```typescript
|
|
543
546
|
const result = await os.onboard({
|
|
544
547
|
externalOrgId: "org_abc123", // Your product's org ID (required)
|
|
548
|
+
label: "My Product", // Display label for the product link (required)
|
|
545
549
|
hints: {
|
|
546
550
|
companyName: "Acme Inc",
|
|
547
551
|
domain: "acme.com",
|
|
@@ -566,6 +570,7 @@ console.log({
|
|
|
566
570
|
```typescript
|
|
567
571
|
const result = await os.onboard({
|
|
568
572
|
externalOrgId: "org_abc123",
|
|
573
|
+
label: "My Product",
|
|
569
574
|
hints: { companyName: "Acme Inc", domain: "acme.com" },
|
|
570
575
|
checkoutSessionId: "cs_test_xxx", // From Stripe checkout callback
|
|
571
576
|
})
|
|
@@ -579,6 +584,7 @@ const result = await os.onboard({
|
|
|
579
584
|
```typescript
|
|
580
585
|
const result = await os.onboard({
|
|
581
586
|
externalOrgId: "org_abc123",
|
|
587
|
+
label: "My Product",
|
|
582
588
|
hints: { companyName: "Acme Inc" },
|
|
583
589
|
tierCode: "free",
|
|
584
590
|
contactEmail: "admin@acme.com",
|
|
@@ -602,6 +608,7 @@ const stripeSub = await stripe.subscriptions.create({
|
|
|
602
608
|
// 3. Onboard with the subscription
|
|
603
609
|
const result = await os.onboard({
|
|
604
610
|
externalOrgId: "org_abc123",
|
|
611
|
+
label: "My Product",
|
|
605
612
|
hints: { companyName: "Acme Inc" },
|
|
606
613
|
stripeSubscriptionId: stripeSub.id,
|
|
607
614
|
stripeCustomerId: stripeCustomerId,
|
|
@@ -617,6 +624,7 @@ const result = await os.onboard({
|
|
|
617
624
|
```typescript
|
|
618
625
|
const result = await os.onboard({
|
|
619
626
|
externalOrgId: "org_abc123",
|
|
627
|
+
label: "My Product",
|
|
620
628
|
hints: { companyName: "Acme Inc" },
|
|
621
629
|
})
|
|
622
630
|
|
|
@@ -684,6 +692,7 @@ const session = await stripe.checkout.sessions.create({
|
|
|
684
692
|
// 3. After checkout completes → Claim subscription
|
|
685
693
|
const result = await os.onboard({
|
|
686
694
|
externalOrgId: "org_abc123",
|
|
695
|
+
label: "My Product",
|
|
687
696
|
checkoutSessionId: session.id,
|
|
688
697
|
})
|
|
689
698
|
```
|
|
@@ -700,6 +709,7 @@ for (const org of historicalData) {
|
|
|
700
709
|
// Create company with historical date
|
|
701
710
|
const result = await os.onboard({
|
|
702
711
|
externalOrgId: org.id,
|
|
712
|
+
label: "Imported", // Display label for historical import
|
|
703
713
|
hints: {
|
|
704
714
|
companyName: org.name,
|
|
705
715
|
domain: org.domain,
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,23 @@ export interface ChatarminOSConfig {
|
|
|
15
15
|
*/
|
|
16
16
|
baseUrl?: string;
|
|
17
17
|
}
|
|
18
|
+
export interface ChatarminOSErrorDetails {
|
|
19
|
+
operation: string;
|
|
20
|
+
code?: string;
|
|
21
|
+
httpStatus?: number;
|
|
22
|
+
path?: string;
|
|
23
|
+
zodError?: unknown;
|
|
24
|
+
requestId?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare class ChatarminOSError extends Error {
|
|
27
|
+
details: ChatarminOSErrorDetails;
|
|
28
|
+
constructor(message: string, details: ChatarminOSErrorDetails, cause?: unknown);
|
|
29
|
+
toJSON(): {
|
|
30
|
+
name: string;
|
|
31
|
+
message: string;
|
|
32
|
+
details: ChatarminOSErrorDetails;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
18
35
|
/**
|
|
19
36
|
* Input for creating a new company with product link.
|
|
20
37
|
*/
|
|
@@ -27,6 +44,8 @@ export interface CreateCompanyInput {
|
|
|
27
44
|
externalOrgId: string;
|
|
28
45
|
/** Optional user ID who created this in your product */
|
|
29
46
|
externalUserId?: string;
|
|
47
|
+
/** Display label for the product link (e.g., "Chatarmin CX", "Shopify") */
|
|
48
|
+
label?: string;
|
|
30
49
|
/** Primary contact email */
|
|
31
50
|
contactEmail?: string;
|
|
32
51
|
/** Primary contact name */
|
|
@@ -40,6 +59,8 @@ export interface CreateCompanyInput {
|
|
|
40
59
|
export interface SmartLinkInput {
|
|
41
60
|
/** Your product's unique organization ID for this company */
|
|
42
61
|
externalOrgId: string;
|
|
62
|
+
/** Display label for the product link (e.g., "Chatarmin CX", "Shopify") */
|
|
63
|
+
label: string;
|
|
43
64
|
/** Hints to help match existing companies */
|
|
44
65
|
hints: {
|
|
45
66
|
/** Company name to match against */
|
|
@@ -51,7 +72,7 @@ export interface SmartLinkInput {
|
|
|
51
72
|
};
|
|
52
73
|
/**
|
|
53
74
|
* Minimum confidence score (0-1) required for auto-linking.
|
|
54
|
-
* @default 0.
|
|
75
|
+
* @default 0.8
|
|
55
76
|
*/
|
|
56
77
|
minConfidence?: number;
|
|
57
78
|
}
|
|
@@ -85,6 +106,44 @@ export interface FeatureCheckInput {
|
|
|
85
106
|
companyId: string;
|
|
86
107
|
/** Feature code (e.g., "ai_credit", "whatsapp_messages") */
|
|
87
108
|
featureCode: string;
|
|
109
|
+
/**
|
|
110
|
+
* Verify Stripe subscription is active for this feature.
|
|
111
|
+
* When true, the response includes subscription validation fields
|
|
112
|
+
* and `canUse` will be false if no active subscription exists.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
verifySubscription?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Result of a feature access check.
|
|
119
|
+
*/
|
|
120
|
+
export interface FeatureCheckResult {
|
|
121
|
+
/** Feature code */
|
|
122
|
+
featureCode: string;
|
|
123
|
+
/** Whether the feature is enabled for this company */
|
|
124
|
+
isEnabled: boolean;
|
|
125
|
+
/** Whether this feature tracks quantity/usage */
|
|
126
|
+
hasQuantity: boolean;
|
|
127
|
+
/** Current usage count (for quantity-based features) */
|
|
128
|
+
currentUsage: number;
|
|
129
|
+
/** Maximum allowed quantity (null = unlimited) */
|
|
130
|
+
quantityLimit: number | null;
|
|
131
|
+
/** Included/free quantity before overage charges */
|
|
132
|
+
includedQuantity: number;
|
|
133
|
+
/** Remaining quantity before limit (null = unlimited) */
|
|
134
|
+
remaining: number | null;
|
|
135
|
+
/** Whether usage limit has been reached */
|
|
136
|
+
isAtLimit: boolean;
|
|
137
|
+
/** Whether the company can use this feature (enabled + not at limit + subscription if verified) */
|
|
138
|
+
canUse: boolean;
|
|
139
|
+
/** Whether an active Stripe subscription exists for this feature */
|
|
140
|
+
hasActiveSubscription?: boolean;
|
|
141
|
+
/** Stripe subscription status (active, trialing, canceled, etc.) */
|
|
142
|
+
subscriptionStatus?: string | null;
|
|
143
|
+
/** Stripe price ID from the subscription item */
|
|
144
|
+
stripePriceId?: string | null;
|
|
145
|
+
/** Stripe subscription ID */
|
|
146
|
+
stripeSubscriptionId?: string | null;
|
|
88
147
|
}
|
|
89
148
|
/**
|
|
90
149
|
* Input for updating feature access with partial config merge.
|
|
@@ -135,6 +194,17 @@ export interface TrackUsageInput {
|
|
|
135
194
|
* Store external references here (e.g., { externalId: "msg_123", type: "message" })
|
|
136
195
|
*/
|
|
137
196
|
metadata?: Record<string, unknown>;
|
|
197
|
+
/**
|
|
198
|
+
* Ensure the feature is linked to an active Stripe subscription.
|
|
199
|
+
* If no subscription item is linked:
|
|
200
|
+
* 1. Checks existing subscriptions for a matching price
|
|
201
|
+
* 2. If found, links the feature_access to that subscription item
|
|
202
|
+
* 3. If not found, adds the feature's default price to a compatible subscription
|
|
203
|
+
*
|
|
204
|
+
* Only works with monthly/flexible subscriptions.
|
|
205
|
+
* @default false
|
|
206
|
+
*/
|
|
207
|
+
ensureSubscription?: boolean;
|
|
138
208
|
}
|
|
139
209
|
/**
|
|
140
210
|
* Input for setting usage to an absolute value.
|
|
@@ -274,6 +344,8 @@ export interface BulkContactResult {
|
|
|
274
344
|
export interface OnboardInput {
|
|
275
345
|
/** Your product's unique organization ID for this customer */
|
|
276
346
|
externalOrgId: string;
|
|
347
|
+
/** Display label for the product link (e.g., "Chatarmin CX", "Shopify") */
|
|
348
|
+
label: string;
|
|
277
349
|
/**
|
|
278
350
|
* Hints for smart company matching.
|
|
279
351
|
* Provide as much info as possible for best matching.
|
|
@@ -370,6 +442,7 @@ export interface OnboardResult {
|
|
|
370
442
|
* // When a new user signs up in your product:
|
|
371
443
|
* const result = await os.onboard({
|
|
372
444
|
* externalOrgId: 'org_abc123',
|
|
445
|
+
* label: 'My Product',
|
|
373
446
|
* hints: {
|
|
374
447
|
* companyName: 'Acme Inc',
|
|
375
448
|
* domain: 'acme.com'
|
|
@@ -393,6 +466,7 @@ export interface OnboardResult {
|
|
|
393
466
|
*/
|
|
394
467
|
export declare class ChatarminOS {
|
|
395
468
|
private client;
|
|
469
|
+
private call;
|
|
396
470
|
/**
|
|
397
471
|
* Create a new ChatarminOS SDK client.
|
|
398
472
|
*
|
|
@@ -621,8 +695,8 @@ export declare class ChatarminOS {
|
|
|
621
695
|
created_at: Date;
|
|
622
696
|
updated_at: Date;
|
|
623
697
|
company_id: string | null;
|
|
624
|
-
is_primary: boolean;
|
|
625
698
|
short_id: string | null;
|
|
699
|
+
is_primary: boolean;
|
|
626
700
|
avatar_url: string | null;
|
|
627
701
|
}>;
|
|
628
702
|
/**
|
|
@@ -677,8 +751,8 @@ export declare class ChatarminOS {
|
|
|
677
751
|
created_at: Date;
|
|
678
752
|
updated_at: Date;
|
|
679
753
|
company_id: string | null;
|
|
680
|
-
is_primary: boolean;
|
|
681
754
|
short_id: string | null;
|
|
755
|
+
is_primary: boolean;
|
|
682
756
|
avatar_url: string | null;
|
|
683
757
|
}[]>;
|
|
684
758
|
};
|
|
@@ -734,17 +808,7 @@ export declare class ChatarminOS {
|
|
|
734
808
|
* })
|
|
735
809
|
* ```
|
|
736
810
|
*/
|
|
737
|
-
check: (input: FeatureCheckInput) => Promise<
|
|
738
|
-
featureCode: string;
|
|
739
|
-
isEnabled: boolean;
|
|
740
|
-
hasQuantity: boolean;
|
|
741
|
-
currentUsage: number;
|
|
742
|
-
quantityLimit: number | null;
|
|
743
|
-
includedQuantity: number;
|
|
744
|
-
remaining: number | null;
|
|
745
|
-
isAtLimit: boolean;
|
|
746
|
-
canUse: boolean;
|
|
747
|
-
}>;
|
|
811
|
+
check: (input: FeatureCheckInput) => Promise<FeatureCheckResult>;
|
|
748
812
|
/**
|
|
749
813
|
* List all features and their access status for a company.
|
|
750
814
|
*
|
|
@@ -974,12 +1038,15 @@ export declare class ChatarminOS {
|
|
|
974
1038
|
success: boolean;
|
|
975
1039
|
featureCode: string;
|
|
976
1040
|
currentUsage: number;
|
|
1041
|
+
previousUsage: number;
|
|
977
1042
|
quantityLimit: number | null;
|
|
978
1043
|
remaining: number | null;
|
|
979
1044
|
isAtLimit: boolean;
|
|
980
1045
|
includedQuantity: number;
|
|
981
1046
|
billableQuantity: number;
|
|
1047
|
+
delta: number;
|
|
982
1048
|
meterId: string;
|
|
1049
|
+
eventId: string | null;
|
|
983
1050
|
}>;
|
|
984
1051
|
/**
|
|
985
1052
|
* Set usage to an absolute value.
|
|
@@ -1075,8 +1142,8 @@ export declare class ChatarminOS {
|
|
|
1075
1142
|
}) => Promise<{
|
|
1076
1143
|
id: string;
|
|
1077
1144
|
metadata: unknown;
|
|
1078
|
-
quantity: number;
|
|
1079
1145
|
source: string;
|
|
1146
|
+
quantity: number;
|
|
1080
1147
|
created_at: Date;
|
|
1081
1148
|
company_id: string;
|
|
1082
1149
|
billing_profile_id: string;
|
|
@@ -1260,19 +1327,29 @@ export declare class ChatarminOS {
|
|
|
1260
1327
|
* a direct link without smart matching.
|
|
1261
1328
|
*
|
|
1262
1329
|
* @param input - Link parameters
|
|
1330
|
+
* @param input.companyId - Company UUID or short_id (e.g., "acme-corp")
|
|
1263
1331
|
* @returns The created link record
|
|
1264
1332
|
*
|
|
1265
|
-
* @example
|
|
1333
|
+
* @example Using UUID
|
|
1266
1334
|
* ```typescript
|
|
1267
1335
|
* const link = await os.links.create({
|
|
1268
|
-
* companyId: '
|
|
1336
|
+
* companyId: 'a1b2c3d4-e5f6-...',
|
|
1337
|
+
* externalOrgId: 'org_abc123',
|
|
1338
|
+
* label: 'Store Vienna'
|
|
1339
|
+
* })
|
|
1340
|
+
* ```
|
|
1341
|
+
*
|
|
1342
|
+
* @example Using short_id
|
|
1343
|
+
* ```typescript
|
|
1344
|
+
* const link = await os.links.create({
|
|
1345
|
+
* companyId: 'acme-corp', // short_id works too!
|
|
1269
1346
|
* externalOrgId: 'org_abc123',
|
|
1270
|
-
* label: 'Store Vienna'
|
|
1271
|
-
* externalUserId: 'user_xyz' // Optional: user who created the link
|
|
1347
|
+
* label: 'Store Vienna'
|
|
1272
1348
|
* })
|
|
1273
1349
|
* ```
|
|
1274
1350
|
*/
|
|
1275
1351
|
create: (input: {
|
|
1352
|
+
/** Company UUID or short_id */
|
|
1276
1353
|
companyId: string;
|
|
1277
1354
|
externalOrgId: string;
|
|
1278
1355
|
label?: string;
|
|
@@ -1675,6 +1752,7 @@ export declare class ChatarminOS {
|
|
|
1675
1752
|
* ```typescript
|
|
1676
1753
|
* const result = await os.onboard({
|
|
1677
1754
|
* externalOrgId: 'org_abc123',
|
|
1755
|
+
* label: 'My Product',
|
|
1678
1756
|
* hints: {
|
|
1679
1757
|
* companyName: 'Acme Inc',
|
|
1680
1758
|
* domain: 'acme.com'
|
|
@@ -1689,6 +1767,7 @@ export declare class ChatarminOS {
|
|
|
1689
1767
|
* ```typescript
|
|
1690
1768
|
* const result = await os.onboard({
|
|
1691
1769
|
* externalOrgId: 'org_abc123',
|
|
1770
|
+
* label: 'My Product',
|
|
1692
1771
|
* hints: {
|
|
1693
1772
|
* companyName: 'Acme Inc',
|
|
1694
1773
|
* domain: 'acme.com'
|
|
@@ -1715,6 +1794,7 @@ export declare class ChatarminOS {
|
|
|
1715
1794
|
* // Then onboard with the subscription
|
|
1716
1795
|
* const result = await os.onboard({
|
|
1717
1796
|
* externalOrgId: 'org_abc123',
|
|
1797
|
+
* label: 'My Product',
|
|
1718
1798
|
* hints: { companyName: 'Acme Inc' },
|
|
1719
1799
|
* stripeSubscriptionId: stripeSub.id,
|
|
1720
1800
|
* stripeCustomerId: stripeCustomerId,
|
|
@@ -1729,6 +1809,7 @@ export declare class ChatarminOS {
|
|
|
1729
1809
|
* ```typescript
|
|
1730
1810
|
* const result = await os.onboard({
|
|
1731
1811
|
* externalOrgId: 'org_abc123',
|
|
1812
|
+
* label: 'My Product',
|
|
1732
1813
|
* hints: { companyName: 'Acme Inc' }
|
|
1733
1814
|
* })
|
|
1734
1815
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAQ/C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,KAAK,EAAE;QACL,oCAAoC;QACpC,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,2CAA2C;QAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,yCAAyC;QACzC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAClB,CAAA;IACD;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,MAAM,EAAE,gBA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,OAAO,CAAC;YAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE;;;;;MAKrE;IAMD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,aAAa;QAIb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6BG;2BACgB,MAAM,WAAW,cAAc;;;;;QASlD;;;;;;;;;;;;;;;;;;;WAmBG;;;;;;;;;;;;;;;;;;;;QAMH;;;;;;;;;;;;;;;;;;;;;;;WAuBG;4BACiB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAK7B;IAMD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,IAAI,KAAK;QAIL;;;;;;;;;;;WAWG;;;;;;;;;;;;;;;;;;;;QAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAsCG;wBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAKtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA8BG;0BACe,MAAM,WAAW,cAAc;;;;;MASpD;IAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2FG;IACG,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;CAsF3D;AAGD,YAAY,EAAE,SAAS,EAAE,CAAA;AAGzB,eAAe,WAAW,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
|
-
import { createTRPCClient, httpBatchLink } from "@trpc/client";
|
|
1
|
+
import { TRPCClientError, createTRPCClient, httpBatchLink } from "@trpc/client";
|
|
2
2
|
import superjson from "superjson";
|
|
3
|
+
export class ChatarminOSError extends Error {
|
|
4
|
+
details;
|
|
5
|
+
constructor(message, details, cause) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "ChatarminOSError";
|
|
8
|
+
this.details = details;
|
|
9
|
+
if (cause !== undefined) {
|
|
10
|
+
;
|
|
11
|
+
this.cause = cause;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
toJSON() {
|
|
15
|
+
return {
|
|
16
|
+
name: this.name,
|
|
17
|
+
message: this.message,
|
|
18
|
+
details: this.details,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function readResponseHeader(headers, name) {
|
|
23
|
+
if (!headers)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (typeof headers.get === "function") {
|
|
26
|
+
return headers.get(name) ?? undefined;
|
|
27
|
+
}
|
|
28
|
+
if (typeof headers === "object" && headers !== null) {
|
|
29
|
+
const record = headers;
|
|
30
|
+
const direct = record[name] ?? record[name.toLowerCase()];
|
|
31
|
+
if (Array.isArray(direct))
|
|
32
|
+
return direct[0];
|
|
33
|
+
if (typeof direct === "string")
|
|
34
|
+
return direct;
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
function toChatarminOSError(operation, error) {
|
|
39
|
+
const data = error.data ?? error.shape?.data;
|
|
40
|
+
const requestId = data?.requestId ??
|
|
41
|
+
readResponseHeader(error.meta?.response
|
|
42
|
+
?.headers, "x-request-id");
|
|
43
|
+
return new ChatarminOSError(error.message, {
|
|
44
|
+
operation,
|
|
45
|
+
code: data?.code,
|
|
46
|
+
httpStatus: data?.httpStatus,
|
|
47
|
+
path: data?.path,
|
|
48
|
+
zodError: data?.zodError ?? undefined,
|
|
49
|
+
requestId,
|
|
50
|
+
}, error);
|
|
51
|
+
}
|
|
3
52
|
// ============================================================================
|
|
4
53
|
// SDK Client
|
|
5
54
|
// ============================================================================
|
|
@@ -23,6 +72,7 @@ import superjson from "superjson";
|
|
|
23
72
|
* // When a new user signs up in your product:
|
|
24
73
|
* const result = await os.onboard({
|
|
25
74
|
* externalOrgId: 'org_abc123',
|
|
75
|
+
* label: 'My Product',
|
|
26
76
|
* hints: {
|
|
27
77
|
* companyName: 'Acme Inc',
|
|
28
78
|
* domain: 'acme.com'
|
|
@@ -46,6 +96,17 @@ import superjson from "superjson";
|
|
|
46
96
|
*/
|
|
47
97
|
export class ChatarminOS {
|
|
48
98
|
client;
|
|
99
|
+
async call(operation, action) {
|
|
100
|
+
try {
|
|
101
|
+
return await action();
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
if (error instanceof TRPCClientError) {
|
|
105
|
+
throw toChatarminOSError(operation, error);
|
|
106
|
+
}
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
49
110
|
/**
|
|
50
111
|
* Create a new ChatarminOS SDK client.
|
|
51
112
|
*
|
|
@@ -103,6 +164,7 @@ export class ChatarminOS {
|
|
|
103
164
|
*/
|
|
104
165
|
get companies() {
|
|
105
166
|
const client = this.client;
|
|
167
|
+
const call = this.call.bind(this);
|
|
106
168
|
return {
|
|
107
169
|
/**
|
|
108
170
|
* Look up a company by their external organization ID in your product.
|
|
@@ -127,7 +189,7 @@ export class ChatarminOS {
|
|
|
127
189
|
* }
|
|
128
190
|
* ```
|
|
129
191
|
*/
|
|
130
|
-
getByProductLink: (input) => client.companies.getByProductLink.query(input),
|
|
192
|
+
getByProductLink: (input) => call("companies.getByProductLink", () => client.companies.getByProductLink.query(input)),
|
|
131
193
|
/**
|
|
132
194
|
* Create a new company and link it to your product.
|
|
133
195
|
*
|
|
@@ -151,7 +213,7 @@ export class ChatarminOS {
|
|
|
151
213
|
* console.log(company.shortId) // e.g., "acme-inc"
|
|
152
214
|
* ```
|
|
153
215
|
*/
|
|
154
|
-
create: (input) => client.companies.createWithLink.mutate(input),
|
|
216
|
+
create: (input) => call("companies.create", () => client.companies.createWithLink.mutate(input)),
|
|
155
217
|
/**
|
|
156
218
|
* Update company metadata.
|
|
157
219
|
*
|
|
@@ -168,7 +230,7 @@ export class ChatarminOS {
|
|
|
168
230
|
* })
|
|
169
231
|
* ```
|
|
170
232
|
*/
|
|
171
|
-
update: (input) => client.companies.updateCompany.mutate(input),
|
|
233
|
+
update: (input) => call("companies.update", () => client.companies.updateCompany.mutate(input)),
|
|
172
234
|
/**
|
|
173
235
|
* Smart link - intelligently find and link a company using hints.
|
|
174
236
|
*
|
|
@@ -205,7 +267,7 @@ export class ChatarminOS {
|
|
|
205
267
|
*
|
|
206
268
|
* @experimental This API may change in future versions
|
|
207
269
|
*/
|
|
208
|
-
smartLink: (input) => client.companies.smartLink.mutate(input),
|
|
270
|
+
smartLink: (input) => call("companies.smartLink", () => client.companies.smartLink.mutate(input)),
|
|
209
271
|
};
|
|
210
272
|
}
|
|
211
273
|
// ==========================================================================
|
|
@@ -241,6 +303,7 @@ export class ChatarminOS {
|
|
|
241
303
|
*/
|
|
242
304
|
get contacts() {
|
|
243
305
|
const client = this.client;
|
|
306
|
+
const call = this.call.bind(this);
|
|
244
307
|
return {
|
|
245
308
|
/**
|
|
246
309
|
* Create or update a single contact for a company.
|
|
@@ -268,7 +331,7 @@ export class ChatarminOS {
|
|
|
268
331
|
* }
|
|
269
332
|
* ```
|
|
270
333
|
*/
|
|
271
|
-
create: (input) => client.contacts.createForCompany.mutate(input),
|
|
334
|
+
create: (input) => call("contacts.create", () => client.contacts.createForCompany.mutate(input)),
|
|
272
335
|
/**
|
|
273
336
|
* Bulk create or update multiple contacts for a company.
|
|
274
337
|
*
|
|
@@ -292,7 +355,7 @@ export class ChatarminOS {
|
|
|
292
355
|
* console.log(`Created: ${result.created}, Updated: ${result.updated}`)
|
|
293
356
|
* ```
|
|
294
357
|
*/
|
|
295
|
-
bulkUpsert: (input) => client.contacts.bulkUpsert.mutate(input),
|
|
358
|
+
bulkUpsert: (input) => call("contacts.bulkUpsert", () => client.contacts.bulkUpsert.mutate(input)),
|
|
296
359
|
/**
|
|
297
360
|
* List all contacts for a company.
|
|
298
361
|
*
|
|
@@ -309,7 +372,7 @@ export class ChatarminOS {
|
|
|
309
372
|
* const primary = await os.contacts.list('comp_xxx', true)
|
|
310
373
|
* ```
|
|
311
374
|
*/
|
|
312
|
-
list: (companyId, primaryOnly = false) => client.contacts.listForCompany.query({ companyId, primaryOnly }),
|
|
375
|
+
list: (companyId, primaryOnly = false) => call("contacts.list", () => client.contacts.listForCompany.query({ companyId, primaryOnly })),
|
|
313
376
|
};
|
|
314
377
|
}
|
|
315
378
|
// ==========================================================================
|
|
@@ -340,6 +403,7 @@ export class ChatarminOS {
|
|
|
340
403
|
*/
|
|
341
404
|
get features() {
|
|
342
405
|
const client = this.client;
|
|
406
|
+
const call = this.call.bind(this);
|
|
343
407
|
return {
|
|
344
408
|
/**
|
|
345
409
|
* Check if a company has access to a specific feature.
|
|
@@ -369,7 +433,7 @@ export class ChatarminOS {
|
|
|
369
433
|
* })
|
|
370
434
|
* ```
|
|
371
435
|
*/
|
|
372
|
-
check: (input) => client.features.check.query(input),
|
|
436
|
+
check: (input) => call("features.check", () => client.features.check.query(input)),
|
|
373
437
|
/**
|
|
374
438
|
* List all features and their access status for a company.
|
|
375
439
|
*
|
|
@@ -392,7 +456,7 @@ export class ChatarminOS {
|
|
|
392
456
|
* }
|
|
393
457
|
* ```
|
|
394
458
|
*/
|
|
395
|
-
listAccess: (companyId) => client.features.getAccess.query({ companyId }),
|
|
459
|
+
listAccess: (companyId) => call("features.listAccess", () => client.features.getAccess.query({ companyId })),
|
|
396
460
|
/**
|
|
397
461
|
* Update feature access for a company with partial config merge.
|
|
398
462
|
*
|
|
@@ -436,7 +500,7 @@ export class ChatarminOS {
|
|
|
436
500
|
* // New config: { tier_level: 'basic', max_seats: 10 }
|
|
437
501
|
* ```
|
|
438
502
|
*/
|
|
439
|
-
setAccess: (input) => client.features.updateAccess.mutate(input),
|
|
503
|
+
setAccess: (input) => call("features.setAccess", () => client.features.updateAccess.mutate(input)),
|
|
440
504
|
/**
|
|
441
505
|
* Get all feature access using your product's external org ID.
|
|
442
506
|
*
|
|
@@ -457,7 +521,7 @@ export class ChatarminOS {
|
|
|
457
521
|
* }
|
|
458
522
|
* ```
|
|
459
523
|
*/
|
|
460
|
-
getAccessByExternalOrgId: (externalOrgId) => client.features.getAccessByExternalOrgId.query({ externalOrgId }),
|
|
524
|
+
getAccessByExternalOrgId: (externalOrgId) => call("features.getAccessByExternalOrgId", () => client.features.getAccessByExternalOrgId.query({ externalOrgId })),
|
|
461
525
|
/**
|
|
462
526
|
* Check specific feature access using your product's external org ID.
|
|
463
527
|
*
|
|
@@ -478,10 +542,10 @@ export class ChatarminOS {
|
|
|
478
542
|
* }
|
|
479
543
|
* ```
|
|
480
544
|
*/
|
|
481
|
-
checkByExternalOrgId: (externalOrgId, featureCode) => client.features.checkByExternalOrgId.query({
|
|
545
|
+
checkByExternalOrgId: (externalOrgId, featureCode) => call("features.checkByExternalOrgId", () => client.features.checkByExternalOrgId.query({
|
|
482
546
|
externalOrgId,
|
|
483
547
|
featureCode,
|
|
484
|
-
}),
|
|
548
|
+
})),
|
|
485
549
|
};
|
|
486
550
|
}
|
|
487
551
|
// ==========================================================================
|
|
@@ -524,6 +588,7 @@ export class ChatarminOS {
|
|
|
524
588
|
*/
|
|
525
589
|
get billing() {
|
|
526
590
|
const client = this.client;
|
|
591
|
+
const call = this.call.bind(this);
|
|
527
592
|
return {
|
|
528
593
|
/**
|
|
529
594
|
* Track usage for a metered feature.
|
|
@@ -554,7 +619,7 @@ export class ChatarminOS {
|
|
|
554
619
|
* })
|
|
555
620
|
* ```
|
|
556
621
|
*/
|
|
557
|
-
trackUsage: (input) => client.billing.trackUsage.mutate(input),
|
|
622
|
+
trackUsage: (input) => call("billing.trackUsage", () => client.billing.trackUsage.mutate(input)),
|
|
558
623
|
/**
|
|
559
624
|
* Set usage to an absolute value.
|
|
560
625
|
*
|
|
@@ -582,10 +647,10 @@ export class ChatarminOS {
|
|
|
582
647
|
* })
|
|
583
648
|
* ```
|
|
584
649
|
*/
|
|
585
|
-
setUsage: (input) => client.billing.setUsage.mutate({
|
|
650
|
+
setUsage: (input) => call("billing.setUsage", () => client.billing.setUsage.mutate({
|
|
586
651
|
...input,
|
|
587
652
|
source: "api",
|
|
588
|
-
}),
|
|
653
|
+
})),
|
|
589
654
|
/**
|
|
590
655
|
* Adjust usage by a delta (positive or negative).
|
|
591
656
|
*
|
|
@@ -617,10 +682,10 @@ export class ChatarminOS {
|
|
|
617
682
|
* })
|
|
618
683
|
* ```
|
|
619
684
|
*/
|
|
620
|
-
adjustUsage: (input) => client.billing.adjustUsage.mutate({
|
|
685
|
+
adjustUsage: (input) => call("billing.adjustUsage", () => client.billing.adjustUsage.mutate({
|
|
621
686
|
...input,
|
|
622
687
|
source: "api",
|
|
623
|
-
}),
|
|
688
|
+
})),
|
|
624
689
|
/**
|
|
625
690
|
* Get usage event history for a feature.
|
|
626
691
|
*
|
|
@@ -648,11 +713,11 @@ export class ChatarminOS {
|
|
|
648
713
|
* }
|
|
649
714
|
* ```
|
|
650
715
|
*/
|
|
651
|
-
getUsageHistory: (companyId, featureCode, options) => client.billing.getUsageHistory.query({
|
|
716
|
+
getUsageHistory: (companyId, featureCode, options) => call("billing.getUsageHistory", () => client.billing.getUsageHistory.query({
|
|
652
717
|
companyId,
|
|
653
718
|
featureCode,
|
|
654
719
|
...options,
|
|
655
|
-
}),
|
|
720
|
+
})),
|
|
656
721
|
/**
|
|
657
722
|
* Get usage snapshots for a feature.
|
|
658
723
|
*
|
|
@@ -664,11 +729,11 @@ export class ChatarminOS {
|
|
|
664
729
|
* @param limit - Max number of snapshots to return
|
|
665
730
|
* @returns Array of usage snapshots
|
|
666
731
|
*/
|
|
667
|
-
getUsageSnapshots: (companyId, featureCode, limit) => client.billing.getUsageSnapshots.query({
|
|
732
|
+
getUsageSnapshots: (companyId, featureCode, limit) => call("billing.getUsageSnapshots", () => client.billing.getUsageSnapshots.query({
|
|
668
733
|
companyId,
|
|
669
734
|
featureCode,
|
|
670
735
|
limit,
|
|
671
|
-
}),
|
|
736
|
+
})),
|
|
672
737
|
/**
|
|
673
738
|
* Claim a subscription from a completed Stripe Checkout Session.
|
|
674
739
|
*
|
|
@@ -693,7 +758,7 @@ export class ChatarminOS {
|
|
|
693
758
|
* }
|
|
694
759
|
* ```
|
|
695
760
|
*/
|
|
696
|
-
claimCheckout: (input) => client.billing.claimCheckout.mutate(input),
|
|
761
|
+
claimCheckout: (input) => call("billing.claimCheckout", () => client.billing.claimCheckout.mutate(input)),
|
|
697
762
|
/**
|
|
698
763
|
* Link an existing Stripe subscription to a company.
|
|
699
764
|
*
|
|
@@ -721,7 +786,7 @@ export class ChatarminOS {
|
|
|
721
786
|
* })
|
|
722
787
|
* ```
|
|
723
788
|
*/
|
|
724
|
-
linkSubscription: (input) => client.billing.linkSubscription.mutate(input),
|
|
789
|
+
linkSubscription: (input) => call("billing.linkSubscription", () => client.billing.linkSubscription.mutate(input)),
|
|
725
790
|
/**
|
|
726
791
|
* Get billing status for a company.
|
|
727
792
|
*
|
|
@@ -747,7 +812,7 @@ export class ChatarminOS {
|
|
|
747
812
|
* }
|
|
748
813
|
* ```
|
|
749
814
|
*/
|
|
750
|
-
getStatus: (companyId) => client.billing.getStatus.query({ companyId }),
|
|
815
|
+
getStatus: (companyId) => call("billing.getStatus", () => client.billing.getStatus.query({ companyId })),
|
|
751
816
|
};
|
|
752
817
|
}
|
|
753
818
|
// ==========================================================================
|
|
@@ -771,6 +836,7 @@ export class ChatarminOS {
|
|
|
771
836
|
*/
|
|
772
837
|
get links() {
|
|
773
838
|
const client = this.client;
|
|
839
|
+
const call = this.call.bind(this);
|
|
774
840
|
return {
|
|
775
841
|
/**
|
|
776
842
|
* Create a manual link between your external org ID and an existing company.
|
|
@@ -779,24 +845,33 @@ export class ChatarminOS {
|
|
|
779
845
|
* a direct link without smart matching.
|
|
780
846
|
*
|
|
781
847
|
* @param input - Link parameters
|
|
848
|
+
* @param input.companyId - Company UUID or short_id (e.g., "acme-corp")
|
|
782
849
|
* @returns The created link record
|
|
783
850
|
*
|
|
784
|
-
* @example
|
|
851
|
+
* @example Using UUID
|
|
785
852
|
* ```typescript
|
|
786
853
|
* const link = await os.links.create({
|
|
787
|
-
* companyId: '
|
|
854
|
+
* companyId: 'a1b2c3d4-e5f6-...',
|
|
855
|
+
* externalOrgId: 'org_abc123',
|
|
856
|
+
* label: 'Store Vienna'
|
|
857
|
+
* })
|
|
858
|
+
* ```
|
|
859
|
+
*
|
|
860
|
+
* @example Using short_id
|
|
861
|
+
* ```typescript
|
|
862
|
+
* const link = await os.links.create({
|
|
863
|
+
* companyId: 'acme-corp', // short_id works too!
|
|
788
864
|
* externalOrgId: 'org_abc123',
|
|
789
|
-
* label: 'Store Vienna'
|
|
790
|
-
* externalUserId: 'user_xyz' // Optional: user who created the link
|
|
865
|
+
* label: 'Store Vienna'
|
|
791
866
|
* })
|
|
792
867
|
* ```
|
|
793
868
|
*/
|
|
794
|
-
create: (input) => client.companies.upsertProductLink.mutate({
|
|
869
|
+
create: (input) => call("links.create", () => client.companies.upsertProductLink.mutate({
|
|
795
870
|
companyId: input.companyId,
|
|
796
871
|
externalOrgId: input.externalOrgId,
|
|
797
872
|
externalUserId: input.externalUserId,
|
|
798
873
|
label: input.label,
|
|
799
|
-
}),
|
|
874
|
+
})),
|
|
800
875
|
/**
|
|
801
876
|
* Delete all product links for this product.
|
|
802
877
|
*
|
|
@@ -824,7 +899,7 @@ export class ChatarminOS {
|
|
|
824
899
|
* console.log(`Deleted ${result.linksDeleted} links, ${result.contactsDeleted} contacts`)
|
|
825
900
|
* ```
|
|
826
901
|
*/
|
|
827
|
-
reset: (options) => client.companies.resetProductLinks.mutate(options),
|
|
902
|
+
reset: (options) => call("links.reset", () => client.companies.resetProductLinks.mutate(options)),
|
|
828
903
|
};
|
|
829
904
|
}
|
|
830
905
|
// ==========================================================================
|
|
@@ -852,6 +927,7 @@ export class ChatarminOS {
|
|
|
852
927
|
*/
|
|
853
928
|
get subscriptions() {
|
|
854
929
|
const client = this.client;
|
|
930
|
+
const call = this.call.bind(this);
|
|
855
931
|
return {
|
|
856
932
|
/**
|
|
857
933
|
* Apply a subscription tier to a company.
|
|
@@ -883,11 +959,11 @@ export class ChatarminOS {
|
|
|
883
959
|
* })
|
|
884
960
|
* ```
|
|
885
961
|
*/
|
|
886
|
-
create: (tierCode, options) => client.tiers.applyByCode.mutate({
|
|
962
|
+
create: (tierCode, options) => call("subscriptions.create", () => client.tiers.applyByCode.mutate({
|
|
887
963
|
tierCode,
|
|
888
964
|
companyId: options.companyId,
|
|
889
965
|
featureOverrides: options.features,
|
|
890
|
-
}),
|
|
966
|
+
})),
|
|
891
967
|
/**
|
|
892
968
|
* Get all available tiers for your product.
|
|
893
969
|
*
|
|
@@ -908,7 +984,7 @@ export class ChatarminOS {
|
|
|
908
984
|
* }
|
|
909
985
|
* ```
|
|
910
986
|
*/
|
|
911
|
-
tiers: () => client.tiers.listForProduct.query({ includeInactive: false }),
|
|
987
|
+
tiers: () => call("subscriptions.tiers", () => client.tiers.listForProduct.query({ includeInactive: false })),
|
|
912
988
|
/**
|
|
913
989
|
* Get detailed information about a specific tier.
|
|
914
990
|
*
|
|
@@ -933,7 +1009,7 @@ export class ChatarminOS {
|
|
|
933
1009
|
* })
|
|
934
1010
|
* ```
|
|
935
1011
|
*/
|
|
936
|
-
getTier: (tierCode) => client.tiers.getByCode.query({ code: tierCode }),
|
|
1012
|
+
getTier: (tierCode) => call("subscriptions.getTier", () => client.tiers.getByCode.query({ code: tierCode })),
|
|
937
1013
|
};
|
|
938
1014
|
}
|
|
939
1015
|
// ==========================================================================
|
|
@@ -965,6 +1041,7 @@ export class ChatarminOS {
|
|
|
965
1041
|
*/
|
|
966
1042
|
get tiers() {
|
|
967
1043
|
const client = this.client;
|
|
1044
|
+
const call = this.call.bind(this);
|
|
968
1045
|
return {
|
|
969
1046
|
/**
|
|
970
1047
|
* List all available tiers for your product.
|
|
@@ -978,7 +1055,7 @@ export class ChatarminOS {
|
|
|
978
1055
|
* // ['Free', 'Pro', 'Enterprise']
|
|
979
1056
|
* ```
|
|
980
1057
|
*/
|
|
981
|
-
list: () => client.tiers.listForProduct.query({ includeInactive: false }),
|
|
1058
|
+
list: () => call("tiers.list", () => client.tiers.listForProduct.query({ includeInactive: false })),
|
|
982
1059
|
/**
|
|
983
1060
|
* Get detailed tier information by code.
|
|
984
1061
|
*
|
|
@@ -1018,7 +1095,7 @@ export class ChatarminOS {
|
|
|
1018
1095
|
* })
|
|
1019
1096
|
* ```
|
|
1020
1097
|
*/
|
|
1021
|
-
get: (tierCode) => client.tiers.getByCode.query({ code: tierCode }),
|
|
1098
|
+
get: (tierCode) => call("tiers.get", () => client.tiers.getByCode.query({ code: tierCode })),
|
|
1022
1099
|
/**
|
|
1023
1100
|
* Apply a tier's features to a company (without Stripe).
|
|
1024
1101
|
*
|
|
@@ -1050,11 +1127,11 @@ export class ChatarminOS {
|
|
|
1050
1127
|
* })
|
|
1051
1128
|
* ```
|
|
1052
1129
|
*/
|
|
1053
|
-
apply: (tierCode, options) => client.tiers.applyByCode.mutate({
|
|
1130
|
+
apply: (tierCode, options) => call("tiers.apply", () => client.tiers.applyByCode.mutate({
|
|
1054
1131
|
tierCode,
|
|
1055
1132
|
companyId: options.companyId,
|
|
1056
1133
|
featureOverrides: options.features,
|
|
1057
|
-
}),
|
|
1134
|
+
})),
|
|
1058
1135
|
};
|
|
1059
1136
|
}
|
|
1060
1137
|
// ==========================================================================
|
|
@@ -1082,6 +1159,7 @@ export class ChatarminOS {
|
|
|
1082
1159
|
* ```typescript
|
|
1083
1160
|
* const result = await os.onboard({
|
|
1084
1161
|
* externalOrgId: 'org_abc123',
|
|
1162
|
+
* label: 'My Product',
|
|
1085
1163
|
* hints: {
|
|
1086
1164
|
* companyName: 'Acme Inc',
|
|
1087
1165
|
* domain: 'acme.com'
|
|
@@ -1096,6 +1174,7 @@ export class ChatarminOS {
|
|
|
1096
1174
|
* ```typescript
|
|
1097
1175
|
* const result = await os.onboard({
|
|
1098
1176
|
* externalOrgId: 'org_abc123',
|
|
1177
|
+
* label: 'My Product',
|
|
1099
1178
|
* hints: {
|
|
1100
1179
|
* companyName: 'Acme Inc',
|
|
1101
1180
|
* domain: 'acme.com'
|
|
@@ -1122,6 +1201,7 @@ export class ChatarminOS {
|
|
|
1122
1201
|
* // Then onboard with the subscription
|
|
1123
1202
|
* const result = await os.onboard({
|
|
1124
1203
|
* externalOrgId: 'org_abc123',
|
|
1204
|
+
* label: 'My Product',
|
|
1125
1205
|
* hints: { companyName: 'Acme Inc' },
|
|
1126
1206
|
* stripeSubscriptionId: stripeSub.id,
|
|
1127
1207
|
* stripeCustomerId: stripeCustomerId,
|
|
@@ -1136,6 +1216,7 @@ export class ChatarminOS {
|
|
|
1136
1216
|
* ```typescript
|
|
1137
1217
|
* const result = await os.onboard({
|
|
1138
1218
|
* externalOrgId: 'org_abc123',
|
|
1219
|
+
* label: 'My Product',
|
|
1139
1220
|
* hints: { companyName: 'Acme Inc' }
|
|
1140
1221
|
* })
|
|
1141
1222
|
*
|
|
@@ -1155,6 +1236,7 @@ export class ChatarminOS {
|
|
|
1155
1236
|
let linkStatus;
|
|
1156
1237
|
const smartLinkResult = await this.companies.smartLink({
|
|
1157
1238
|
externalOrgId: input.externalOrgId,
|
|
1239
|
+
label: input.label,
|
|
1158
1240
|
hints: input.hints ?? {},
|
|
1159
1241
|
});
|
|
1160
1242
|
if (smartLinkResult.status === "already_linked") {
|
|
@@ -1173,6 +1255,7 @@ export class ChatarminOS {
|
|
|
1173
1255
|
name: input.hints?.companyName ?? `Company ${input.externalOrgId}`,
|
|
1174
1256
|
domain: input.hints?.domain,
|
|
1175
1257
|
externalOrgId: input.externalOrgId,
|
|
1258
|
+
label: input.label,
|
|
1176
1259
|
contactEmail: input.contactEmail,
|
|
1177
1260
|
contactName: input.contactName,
|
|
1178
1261
|
createdAt: input.createdAt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatarmin/os",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Type-safe SDK for ChatarminOS - Customer & Subscription Management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
26
26
|
"test": "tsx test-sdk.ts",
|
|
27
27
|
"sync": "tsx scripts/sync-orgs.ts",
|
|
28
|
+
"sync:interactive": "tsx scripts/sync-interactive.ts",
|
|
28
29
|
"sync:example": "tsx scripts/sync-orgs.ts ./scripts/data/orgs.example.json --dry-run --verbose",
|
|
29
30
|
"prepublishOnly": "pnpm build",
|
|
30
31
|
"release": "./scripts/publish.sh",
|