@chatarmin/os 1.7.0 → 1.8.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 +386 -8
- package/dist/billing/client.d.ts +8 -0
- package/dist/billing/client.d.ts.map +1 -0
- package/dist/billing/client.js +46 -0
- package/dist/billing/index.d.ts +3 -0
- package/dist/billing/index.d.ts.map +1 -0
- package/dist/billing/index.js +1 -0
- package/dist/billing/types.d.ts +201 -0
- package/dist/billing/types.d.ts.map +1 -0
- package/dist/billing/types.js +1 -0
- package/dist/billing/usage-breakdown-types.d.ts +132 -0
- package/dist/billing/usage-breakdown-types.d.ts.map +1 -0
- package/dist/billing/usage-breakdown-types.js +1 -0
- package/dist/companies/client.d.ts +1 -1
- package/dist/companies/client.d.ts.map +1 -1
- package/dist/features/client.d.ts +8 -0
- package/dist/features/client.d.ts.map +1 -0
- package/dist/features/client.js +18 -0
- package/dist/features/index.d.ts +3 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +1 -0
- package/dist/features/types.d.ts +184 -0
- package/dist/features/types.d.ts.map +1 -0
- package/dist/features/types.js +1 -0
- package/dist/index.d.ts +23 -760
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -361
- package/dist/webhooks/construct-event.d.ts +1 -1
- package/dist/webhooks/construct-event.d.ts.map +1 -1
- package/dist/webhooks/construct-event.js +4 -4
- package/dist/webhooks/generate-test-headers.d.ts +1 -1
- package/dist/webhooks/generate-test-headers.d.ts.map +1 -1
- package/dist/webhooks/generate-test-headers.js +2 -2
- package/dist/webhooks/index.d.ts +25 -8
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/index.js +24 -7
- package/dist/webhooks/read-header.d.ts +1 -1
- package/dist/webhooks/read-header.d.ts.map +1 -1
- package/package.json +2 -3
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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAG1D,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAA;AACnE,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA;AAGtE,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,0BAA0B,EAC1B,mCAAmC,EACnC,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,cAAc,EACd,mBAAmB,GACpB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,aAAa,EACb,0BAA0B,EAC1B,2BAA2B,EAC3B,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,WAAW,GACZ,MAAM,WAAW,CAAA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyFG;IACG,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;CA8E3D;AAGD,YAAY,EAAE,SAAS,EAAE,CAAA;AAGzB,eAAe,WAAW,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TRPCClientError, createTRPCClient, httpBatchLink } from "@trpc/client";
|
|
2
2
|
import superjson from "superjson";
|
|
3
3
|
import { createCompaniesClient, } from "./companies";
|
|
4
|
+
import { createBillingClient } from "./billing";
|
|
5
|
+
import { createFeaturesClient } from "./features";
|
|
4
6
|
import { webhooks } from "./webhooks";
|
|
5
7
|
export { webhooks, constructProductWebhookEvent, generateTestWebhookHeaders, OsWebhookSignatureVerificationError, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from "./webhooks";
|
|
6
8
|
const INSPECT_SYMBOL = Symbol.for("nodejs.util.inspect.custom");
|
|
@@ -325,372 +327,14 @@ export class ChatarminOS {
|
|
|
325
327
|
* ```
|
|
326
328
|
*/
|
|
327
329
|
get features() {
|
|
328
|
-
|
|
329
|
-
const call = this.call.bind(this);
|
|
330
|
-
return {
|
|
331
|
-
/**
|
|
332
|
-
* Check if a company has access to a specific feature.
|
|
333
|
-
*
|
|
334
|
-
* Returns detailed access information including whether the feature
|
|
335
|
-
* is enabled, current usage, limits, and whether they can use more.
|
|
336
|
-
*
|
|
337
|
-
* @param input - Check parameters
|
|
338
|
-
* @param input.companyId - Company ID to check
|
|
339
|
-
* @param input.featureCode - Feature code (e.g., "ai_credit")
|
|
340
|
-
* @returns Detailed feature access information
|
|
341
|
-
*
|
|
342
|
-
* @example
|
|
343
|
-
* ```typescript
|
|
344
|
-
* const access = await os.features.check({
|
|
345
|
-
* companyId: 'comp_xxx',
|
|
346
|
-
* featureCode: 'ai_credit'
|
|
347
|
-
* })
|
|
348
|
-
*
|
|
349
|
-
* console.log({
|
|
350
|
-
* enabled: access.isEnabled,
|
|
351
|
-
* canUse: access.canUse,
|
|
352
|
-
* usage: access.currentUsage,
|
|
353
|
-
* limit: access.quantityLimit,
|
|
354
|
-
* remaining: access.remaining,
|
|
355
|
-
* included: access.includedQuantity
|
|
356
|
-
* })
|
|
357
|
-
* ```
|
|
358
|
-
*/
|
|
359
|
-
check: (input) => call("features.check", () => client.features.check.query(input)),
|
|
360
|
-
/**
|
|
361
|
-
* List all features and their access status for a company.
|
|
362
|
-
*
|
|
363
|
-
* Returns a complete list of features with their current status,
|
|
364
|
-
* useful for displaying a company's full feature set or building
|
|
365
|
-
* a feature comparison view.
|
|
366
|
-
*
|
|
367
|
-
* @param input - Query parameters
|
|
368
|
-
* @returns Array of feature access records
|
|
369
|
-
*
|
|
370
|
-
* @example Basic usage
|
|
371
|
-
* ```typescript
|
|
372
|
-
* const features = await os.features.listAccess({ companyId: company.id })
|
|
373
|
-
*
|
|
374
|
-
* for (const f of features) {
|
|
375
|
-
* console.log(`${f.featureName}: ${f.isEnabled ? '✓' : '✗'}`)
|
|
376
|
-
* if (f.quantityLimit) {
|
|
377
|
-
* console.log(` Usage: ${f.currentUsage} / ${f.quantityLimit}`)
|
|
378
|
-
* }
|
|
379
|
-
* }
|
|
380
|
-
* ```
|
|
381
|
-
*
|
|
382
|
-
* @example With billing details
|
|
383
|
-
* ```typescript
|
|
384
|
-
* const features = await os.features.listAccess({
|
|
385
|
-
* companyId: company.id,
|
|
386
|
-
* includeBillingDetails: true
|
|
387
|
-
* })
|
|
388
|
-
*
|
|
389
|
-
* for (const f of features) {
|
|
390
|
-
* console.log(`${f.featureName}:`)
|
|
391
|
-
* console.log(` Usage: ${f.currentUsage} / ${f.quantityLimit}`)
|
|
392
|
-
*
|
|
393
|
-
* if (f.billing) {
|
|
394
|
-
* console.log(` Price: ${f.billing.unitAmount / 100} ${f.billing.currency}`)
|
|
395
|
-
* console.log(` Period: ${f.billing.currentPeriodStart} to ${f.billing.currentPeriodEnd}`)
|
|
396
|
-
* console.log(` Status: ${f.billing.subscriptionStatus}`)
|
|
397
|
-
* }
|
|
398
|
-
* }
|
|
399
|
-
* ```
|
|
400
|
-
*/
|
|
401
|
-
listAccess: (input) => call("features.listAccess", () => {
|
|
402
|
-
// Support legacy companyId string param for backward compatibility
|
|
403
|
-
const params = typeof input === "string" ? { companyId: input } : input;
|
|
404
|
-
return client.features.getAccess.query(params);
|
|
405
|
-
}),
|
|
406
|
-
/**
|
|
407
|
-
* Update feature access for a company with partial config merge.
|
|
408
|
-
*
|
|
409
|
-
* This allows you to update individual feature configs without
|
|
410
|
-
* replacing all config values. Only the fields you specify in
|
|
411
|
-
* `config` will be updated - other fields remain unchanged.
|
|
412
|
-
*
|
|
413
|
-
* @param input - Update parameters
|
|
414
|
-
* @returns Updated feature access information
|
|
415
|
-
*
|
|
416
|
-
* @example Update by company ID
|
|
417
|
-
* ```typescript
|
|
418
|
-
* await os.features.setAccess({
|
|
419
|
-
* companyId: 'comp_xxx',
|
|
420
|
-
* featureCode: 'ai_credit',
|
|
421
|
-
* isEnabled: true,
|
|
422
|
-
* config: {
|
|
423
|
-
* included_quantity: 500,
|
|
424
|
-
* max_quantity: 1000
|
|
425
|
-
* }
|
|
426
|
-
* })
|
|
427
|
-
* ```
|
|
428
|
-
*
|
|
429
|
-
* @example Update by your product's external org ID
|
|
430
|
-
* ```typescript
|
|
431
|
-
* await os.features.setAccess({
|
|
432
|
-
* externalOrgId: 'org_abc123',
|
|
433
|
-
* featureCode: 'ai_credit',
|
|
434
|
-
* config: { tier_level: 'premium' }
|
|
435
|
-
* })
|
|
436
|
-
* ```
|
|
437
|
-
*
|
|
438
|
-
* @example Partial config update (only updates specified fields)
|
|
439
|
-
* ```typescript
|
|
440
|
-
* // Existing config: { tier_level: 'basic', max_seats: 5 }
|
|
441
|
-
* await os.features.setAccess({
|
|
442
|
-
* companyId: 'comp_xxx',
|
|
443
|
-
* featureCode: 'team_seats',
|
|
444
|
-
* config: { max_seats: 10 } // tier_level remains 'basic'
|
|
445
|
-
* })
|
|
446
|
-
* // New config: { tier_level: 'basic', max_seats: 10 }
|
|
447
|
-
* ```
|
|
448
|
-
*/
|
|
449
|
-
setAccess: (input) => call("features.setAccess", () => client.features.updateAccess.mutate(input)),
|
|
450
|
-
/**
|
|
451
|
-
* Get all feature access using your product's external org ID.
|
|
452
|
-
*
|
|
453
|
-
* Convenience method when you know the external org ID but not
|
|
454
|
-
* the ChatarminOS company ID.
|
|
455
|
-
*
|
|
456
|
-
* @param externalOrgId - Your product's organization ID
|
|
457
|
-
* @returns All features with their access status and config values
|
|
458
|
-
*
|
|
459
|
-
* @example
|
|
460
|
-
* ```typescript
|
|
461
|
-
* const result = await os.features.getAccessByExternalOrgId('org_abc123')
|
|
462
|
-
*
|
|
463
|
-
* console.log(`Company: ${result.companyId}`)
|
|
464
|
-
* for (const f of result.features) {
|
|
465
|
-
* console.log(`${f.featureCode}: ${f.isEnabled}`)
|
|
466
|
-
* console.log(` Config:`, f.configValues)
|
|
467
|
-
* }
|
|
468
|
-
* ```
|
|
469
|
-
*/
|
|
470
|
-
getAccessByExternalOrgId: (externalOrgId) => call("features.getAccessByExternalOrgId", () => client.features.getAccessByExternalOrgId.query({ externalOrgId })),
|
|
471
|
-
/**
|
|
472
|
-
* Check specific feature access using your product's external org ID.
|
|
473
|
-
*
|
|
474
|
-
* @param externalOrgId - Your product's organization ID
|
|
475
|
-
* @param featureCode - Feature code to check
|
|
476
|
-
* @returns Detailed feature access including config values
|
|
477
|
-
*
|
|
478
|
-
* @example
|
|
479
|
-
* ```typescript
|
|
480
|
-
* const access = await os.features.checkByExternalOrgId(
|
|
481
|
-
* 'org_abc123',
|
|
482
|
-
* 'ai_credit'
|
|
483
|
-
* )
|
|
484
|
-
*
|
|
485
|
-
* if (access.canUse) {
|
|
486
|
-
* console.log(`Remaining: ${access.remaining}`)
|
|
487
|
-
* console.log(`Config:`, access.configValues)
|
|
488
|
-
* }
|
|
489
|
-
* ```
|
|
490
|
-
*/
|
|
491
|
-
checkByExternalOrgId: (externalOrgId, featureCode) => call("features.checkByExternalOrgId", () => client.features.checkByExternalOrgId.query({
|
|
492
|
-
externalOrgId,
|
|
493
|
-
featureCode,
|
|
494
|
-
})),
|
|
495
|
-
};
|
|
330
|
+
return createFeaturesClient(this.client, this.call.bind(this));
|
|
496
331
|
}
|
|
497
332
|
// ==========================================================================
|
|
498
333
|
// Billing
|
|
499
334
|
// ==========================================================================
|
|
500
|
-
/**
|
|
501
|
-
* Billing, usage tracking, and subscription management.
|
|
502
|
-
*
|
|
503
|
-
* Set feature usage for billing, claim subscriptions from Stripe checkout,
|
|
504
|
-
* or link existing Stripe subscriptions to companies.
|
|
505
|
-
*
|
|
506
|
-
* @example Set Usage
|
|
507
|
-
* ```typescript
|
|
508
|
-
* await os.billing.setUsage({
|
|
509
|
-
* companyId: company.id,
|
|
510
|
-
* featureCode: 'ai_credit',
|
|
511
|
-
* absoluteValue: 42,
|
|
512
|
-
* reason: 'Synced current usage'
|
|
513
|
-
* })
|
|
514
|
-
* ```
|
|
515
|
-
*
|
|
516
|
-
* @example Claim Checkout Subscription
|
|
517
|
-
* ```typescript
|
|
518
|
-
* // After Stripe checkout completes
|
|
519
|
-
* const result = await os.billing.claimCheckout({
|
|
520
|
-
* companyId: company.id,
|
|
521
|
-
* checkoutSessionId: 'cs_xxx'
|
|
522
|
-
* })
|
|
523
|
-
* ```
|
|
524
|
-
*
|
|
525
|
-
* @example Link Existing Subscription
|
|
526
|
-
* ```typescript
|
|
527
|
-
* // When you create subscriptions on your Stripe account
|
|
528
|
-
* const result = await os.billing.linkSubscription({
|
|
529
|
-
* companyId: company.id,
|
|
530
|
-
* stripeSubscriptionId: 'sub_xxx',
|
|
531
|
-
* tierCode: 'pro' // Apply tier features
|
|
532
|
-
* })
|
|
533
|
-
* ```
|
|
534
|
-
*/
|
|
335
|
+
/** Billing, usage tracking, subscriptions, and customer billing surfaces. */
|
|
535
336
|
get billing() {
|
|
536
|
-
|
|
537
|
-
const call = this.call.bind(this);
|
|
538
|
-
return {
|
|
539
|
-
/**
|
|
540
|
-
* Set usage to an absolute value.
|
|
541
|
-
*
|
|
542
|
-
* Use this for corrections when you know what the total usage SHOULD be.
|
|
543
|
-
* Creates a snapshot for audit trail. The delta (difference) is calculated
|
|
544
|
-
* automatically and synced to Stripe.
|
|
545
|
-
*
|
|
546
|
-
* @param input - Set usage parameters
|
|
547
|
-
* @returns Result with previous and new usage values
|
|
548
|
-
*
|
|
549
|
-
* @example Correct usage to 100 (was 150)
|
|
550
|
-
* ```typescript
|
|
551
|
-
* const result = await os.billing.setUsage({
|
|
552
|
-
* companyId: 'comp_xxx',
|
|
553
|
-
* featureCode: 'ai_credit',
|
|
554
|
-
* absoluteValue: 100,
|
|
555
|
-
* reason: 'Corrected after customer support review',
|
|
556
|
-
* performedBy: 'admin@company.com'
|
|
557
|
-
* })
|
|
558
|
-
*
|
|
559
|
-
* console.log({
|
|
560
|
-
* previousUsage: result.previousUsage, // 150
|
|
561
|
-
* currentUsage: result.currentUsage, // 100
|
|
562
|
-
* delta: result.delta // -50
|
|
563
|
-
* })
|
|
564
|
-
* ```
|
|
565
|
-
*/
|
|
566
|
-
setUsage: (input) => call("billing.setUsage", () => client.billing.setUsage.mutate({
|
|
567
|
-
...input,
|
|
568
|
-
source: "api",
|
|
569
|
-
})),
|
|
570
|
-
/**
|
|
571
|
-
* Get usage event history for a feature.
|
|
572
|
-
*
|
|
573
|
-
* Returns the history of usage events including increments, sets,
|
|
574
|
-
* and adjustments. Useful for auditing and debugging.
|
|
575
|
-
*
|
|
576
|
-
* @param companyId - Company ID
|
|
577
|
-
* @param featureCode - Feature code to get history for
|
|
578
|
-
* @param options - Query options
|
|
579
|
-
* @returns Array of usage events
|
|
580
|
-
*
|
|
581
|
-
* @example
|
|
582
|
-
* ```typescript
|
|
583
|
-
* const history = await os.billing.getUsageHistory(
|
|
584
|
-
* 'comp_xxx',
|
|
585
|
-
* 'ai_credit',
|
|
586
|
-
* { limit: 20, eventType: 'adjustment' }
|
|
587
|
-
* )
|
|
588
|
-
*
|
|
589
|
-
* for (const event of history) {
|
|
590
|
-
* console.log(`${event.event_type}: ${event.quantity} at ${event.event_time}`)
|
|
591
|
-
* if (event.adjustment_reason) {
|
|
592
|
-
* console.log(` Reason: ${event.adjustment_reason}`)
|
|
593
|
-
* }
|
|
594
|
-
* }
|
|
595
|
-
* ```
|
|
596
|
-
*/
|
|
597
|
-
getUsageHistory: (companyId, featureCode, options) => call("billing.getUsageHistory", () => client.billing.getUsageHistory.query({
|
|
598
|
-
companyId,
|
|
599
|
-
featureCode,
|
|
600
|
-
...options,
|
|
601
|
-
})),
|
|
602
|
-
/**
|
|
603
|
-
* Claim a subscription from a completed Stripe Checkout Session.
|
|
604
|
-
*
|
|
605
|
-
* Use this after a user completes Stripe checkout in your product.
|
|
606
|
-
* This links the subscription and customer to the company in OS.
|
|
607
|
-
*
|
|
608
|
-
* @param input - Claim parameters
|
|
609
|
-
* @returns Result with subscription ID and claim status
|
|
610
|
-
*
|
|
611
|
-
* @example
|
|
612
|
-
* ```typescript
|
|
613
|
-
* // In your Stripe checkout success handler:
|
|
614
|
-
* const result = await os.billing.claimCheckout({
|
|
615
|
-
* companyId: company.id,
|
|
616
|
-
* checkoutSessionId: session.id // From Stripe callback
|
|
617
|
-
* })
|
|
618
|
-
*
|
|
619
|
-
* if (result.alreadyClaimed) {
|
|
620
|
-
* console.log('Subscription was already claimed')
|
|
621
|
-
* } else {
|
|
622
|
-
* console.log(`Claimed subscription: ${result.subscriptionId}`)
|
|
623
|
-
* }
|
|
624
|
-
* ```
|
|
625
|
-
*/
|
|
626
|
-
claimCheckout: (input) => call("billing.claimCheckout", () => client.billing.claimCheckout.mutate(input)),
|
|
627
|
-
/**
|
|
628
|
-
* Link an existing Stripe subscription to a company.
|
|
629
|
-
*
|
|
630
|
-
* Use this when you create subscriptions on your product's Stripe
|
|
631
|
-
* account and want OS to track them. Optionally applies tier features.
|
|
632
|
-
*
|
|
633
|
-
* @param input - Link parameters
|
|
634
|
-
* @returns Result with subscription ID, link status, and features applied
|
|
635
|
-
*
|
|
636
|
-
* @example
|
|
637
|
-
* ```typescript
|
|
638
|
-
* // After creating subscription on your Stripe account:
|
|
639
|
-
* const result = await os.billing.linkSubscription({
|
|
640
|
-
* companyId: company.id,
|
|
641
|
-
* stripeSubscriptionId: 'sub_xxx',
|
|
642
|
-
* stripeCustomerId: 'cus_xxx', // Optional
|
|
643
|
-
* tierCode: 'pro', // Apply tier features
|
|
644
|
-
* displayName: 'Pro Plan'
|
|
645
|
-
* })
|
|
646
|
-
*
|
|
647
|
-
* console.log({
|
|
648
|
-
* subscriptionId: result.subscriptionId,
|
|
649
|
-
* isNew: !result.alreadyLinked,
|
|
650
|
-
* featuresApplied: result.featuresApplied
|
|
651
|
-
* })
|
|
652
|
-
* ```
|
|
653
|
-
*/
|
|
654
|
-
linkSubscription: (input) => call("billing.linkSubscription", () => client.billing.linkSubscription.mutate(input)),
|
|
655
|
-
/**
|
|
656
|
-
* Get billing status for a company.
|
|
657
|
-
*
|
|
658
|
-
* Quick check for subscription status, active features, and
|
|
659
|
-
* billing profile information.
|
|
660
|
-
*
|
|
661
|
-
* @param companyId - Company ID to check
|
|
662
|
-
* @returns Billing status overview
|
|
663
|
-
*
|
|
664
|
-
* @example
|
|
665
|
-
* ```typescript
|
|
666
|
-
* const status = await os.billing.getStatus(company.id)
|
|
667
|
-
*
|
|
668
|
-
* console.log({
|
|
669
|
-
* hasBilling: status.hasBillingProfile,
|
|
670
|
-
* subscriptions: status.activeSubscriptions.length,
|
|
671
|
-
* features: status.enabledFeaturesCount
|
|
672
|
-
* })
|
|
673
|
-
*
|
|
674
|
-
* // Check active tier
|
|
675
|
-
* if (status.activeSubscriptions[0]?.tier) {
|
|
676
|
-
* console.log(`Current tier: ${status.activeSubscriptions[0].tier.name}`)
|
|
677
|
-
* }
|
|
678
|
-
* ```
|
|
679
|
-
*/
|
|
680
|
-
getStatus: (companyId) => call("billing.getStatus", () => client.billing.getStatus.query({ companyId })),
|
|
681
|
-
/**
|
|
682
|
-
* Sync billing profile, subscriptions, and feature access from Stripe.
|
|
683
|
-
*/
|
|
684
|
-
syncCompanyFromStripe: (input) => call("billing.syncCompanyFromStripe", () => client.billing.syncCompanyFromStripe.mutate(input)),
|
|
685
|
-
/**
|
|
686
|
-
* Relink billing profile to a new Stripe customer (destructive).
|
|
687
|
-
*/
|
|
688
|
-
relinkBillingProfile: (input) => call("billing.relinkBillingProfile", () => client.billing.relinkBillingProfile.mutate(input)),
|
|
689
|
-
/**
|
|
690
|
-
* Ensure a feature is linked to an active Stripe subscription item.
|
|
691
|
-
*/
|
|
692
|
-
ensureFeatureSubscription: (input) => call("billing.ensureFeatureSubscription", () => client.billing.ensureFeatureSubscription.mutate(input)),
|
|
693
|
-
};
|
|
337
|
+
return createBillingClient(this.client, this.call.bind(this));
|
|
694
338
|
}
|
|
695
339
|
// ==========================================================================
|
|
696
340
|
// Links
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ConstructProductWebhookEventOptions, ProductWebhookHeaders, VerifiedProductWebhookEvent } from './types
|
|
1
|
+
import type { ConstructProductWebhookEventOptions, ProductWebhookHeaders, VerifiedProductWebhookEvent } from './types';
|
|
2
2
|
export declare function constructProductWebhookEvent(rawBody: string, headers: ProductWebhookHeaders, secret: string, options?: ConstructProductWebhookEventOptions): VerifiedProductWebhookEvent;
|
|
3
3
|
//# sourceMappingURL=construct-event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"construct-event.d.ts","sourceRoot":"","sources":["../../src/webhooks/construct-event.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,mCAAmC,EAEnC,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,
|
|
1
|
+
{"version":3,"file":"construct-event.d.ts","sourceRoot":"","sources":["../../src/webhooks/construct-event.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,mCAAmC,EAEnC,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,SAAS,CAAA;AA0DhB,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,mCAAmC,GAC5C,2BAA2B,CAsC7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_WEBHOOK_TOLERANCE_SECONDS, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants
|
|
2
|
-
import { OsWebhookSignatureVerificationError } from './errors
|
|
3
|
-
import { readWebhookHeader } from './read-header
|
|
4
|
-
import { verifyWebhookSignature } from './signing
|
|
1
|
+
import { DEFAULT_WEBHOOK_TOLERANCE_SECONDS, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants';
|
|
2
|
+
import { OsWebhookSignatureVerificationError } from './errors';
|
|
3
|
+
import { readWebhookHeader } from './read-header';
|
|
4
|
+
import { verifyWebhookSignature } from './signing';
|
|
5
5
|
function assertNonEmpty(value, message) {
|
|
6
6
|
const trimmed = value?.trim();
|
|
7
7
|
if (!trimmed) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { GenerateTestWebhookHeadersInput } from './types
|
|
1
|
+
import type { GenerateTestWebhookHeadersInput } from './types';
|
|
2
2
|
export declare function generateTestWebhookHeaders(input: GenerateTestWebhookHeadersInput): Record<string, string>;
|
|
3
3
|
//# sourceMappingURL=generate-test-headers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-test-headers.d.ts","sourceRoot":"","sources":["../../src/webhooks/generate-test-headers.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"generate-test-headers.d.ts","sourceRoot":"","sources":["../../src/webhooks/generate-test-headers.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAA;AAE9D,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,GACrC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants
|
|
2
|
-
import { buildWebhookSignature } from './signing
|
|
1
|
+
import { WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants';
|
|
2
|
+
import { buildWebhookSignature } from './signing';
|
|
3
3
|
export function generateTestWebhookHeaders(input) {
|
|
4
4
|
const timestamp = (input.timestamp ?? Date.now()).toString();
|
|
5
5
|
const webhookId = input.webhookId ?? 'test_webhook_id';
|
package/dist/webhooks/index.d.ts
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
import { constructProductWebhookEvent } from './construct-event
|
|
2
|
-
import { generateTestWebhookHeaders } from './generate-test-headers
|
|
3
|
-
export { DEFAULT_WEBHOOK_TOLERANCE_SECONDS, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants
|
|
4
|
-
export { constructProductWebhookEvent } from './construct-event
|
|
5
|
-
export { OsWebhookSignatureVerificationError } from './errors
|
|
6
|
-
export { generateTestWebhookHeaders } from './generate-test-headers
|
|
7
|
-
export { buildWebhookSignature, buildWebhookSignatureMaterial, verifyWebhookSignature, } from './signing
|
|
8
|
-
export type { ConstructProductWebhookEventOptions, GenerateTestWebhookHeadersInput, ProductWebhookEventPayload, ProductWebhookHeaders, VerifiedProductWebhookEvent, } from './types
|
|
1
|
+
import { constructProductWebhookEvent } from './construct-event';
|
|
2
|
+
import { generateTestWebhookHeaders } from './generate-test-headers';
|
|
3
|
+
export { DEFAULT_WEBHOOK_TOLERANCE_SECONDS, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants';
|
|
4
|
+
export { constructProductWebhookEvent } from './construct-event';
|
|
5
|
+
export { OsWebhookSignatureVerificationError } from './errors';
|
|
6
|
+
export { generateTestWebhookHeaders } from './generate-test-headers';
|
|
7
|
+
export { buildWebhookSignature, buildWebhookSignatureMaterial, verifyWebhookSignature, } from './signing';
|
|
8
|
+
export type { ConstructProductWebhookEventOptions, GenerateTestWebhookHeadersInput, ProductWebhookEventPayload, ProductWebhookHeaders, VerifiedProductWebhookEvent, } from './types';
|
|
9
9
|
/**
|
|
10
10
|
* Verify inbound OS product webhooks.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { webhooks } from '@chatarmin/os/webhooks'
|
|
15
|
+
*
|
|
16
|
+
* export async function POST(request: Request) {
|
|
17
|
+
* const rawBody = await request.text()
|
|
18
|
+
* const event = webhooks.constructEvent(
|
|
19
|
+
* rawBody,
|
|
20
|
+
* request.headers,
|
|
21
|
+
* process.env.OS_WEBHOOK_SIGNING_SECRET!,
|
|
22
|
+
* )
|
|
23
|
+
*
|
|
24
|
+
* console.log(event.type, event.action, event.webhookId)
|
|
25
|
+
* return Response.json({ received: true })
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
11
28
|
*/
|
|
12
29
|
export declare const webhooks: {
|
|
13
30
|
constructEvent: typeof constructProductWebhookEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AAEpE,OAAO,EACL,iCAAiC,EACjC,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,GACvB,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,mCAAmC,EACnC,+BAA+B,EAC/B,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,QAAQ;;;CAGpB,CAAA"}
|
package/dist/webhooks/index.js
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import { constructProductWebhookEvent } from './construct-event
|
|
2
|
-
import { generateTestWebhookHeaders } from './generate-test-headers
|
|
3
|
-
export { DEFAULT_WEBHOOK_TOLERANCE_SECONDS, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants
|
|
4
|
-
export { constructProductWebhookEvent } from './construct-event
|
|
5
|
-
export { OsWebhookSignatureVerificationError } from './errors
|
|
6
|
-
export { generateTestWebhookHeaders } from './generate-test-headers
|
|
7
|
-
export { buildWebhookSignature, buildWebhookSignatureMaterial, verifyWebhookSignature, } from './signing
|
|
1
|
+
import { constructProductWebhookEvent } from './construct-event';
|
|
2
|
+
import { generateTestWebhookHeaders } from './generate-test-headers';
|
|
3
|
+
export { DEFAULT_WEBHOOK_TOLERANCE_SECONDS, WEBHOOK_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, } from './constants';
|
|
4
|
+
export { constructProductWebhookEvent } from './construct-event';
|
|
5
|
+
export { OsWebhookSignatureVerificationError } from './errors';
|
|
6
|
+
export { generateTestWebhookHeaders } from './generate-test-headers';
|
|
7
|
+
export { buildWebhookSignature, buildWebhookSignatureMaterial, verifyWebhookSignature, } from './signing';
|
|
8
8
|
/**
|
|
9
9
|
* Verify inbound OS product webhooks.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { webhooks } from '@chatarmin/os/webhooks'
|
|
14
|
+
*
|
|
15
|
+
* export async function POST(request: Request) {
|
|
16
|
+
* const rawBody = await request.text()
|
|
17
|
+
* const event = webhooks.constructEvent(
|
|
18
|
+
* rawBody,
|
|
19
|
+
* request.headers,
|
|
20
|
+
* process.env.OS_WEBHOOK_SIGNING_SECRET!,
|
|
21
|
+
* )
|
|
22
|
+
*
|
|
23
|
+
* console.log(event.type, event.action, event.webhookId)
|
|
24
|
+
* return Response.json({ received: true })
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
10
27
|
*/
|
|
11
28
|
export const webhooks = {
|
|
12
29
|
constructEvent: constructProductWebhookEvent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-header.d.ts","sourceRoot":"","sources":["../../src/webhooks/read-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"read-header.d.ts","sourceRoot":"","sources":["../../src/webhooks/read-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,qBAAqB,EAC9B,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAoBf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatarmin/os",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Type-safe SDK for ChatarminOS - Customer & Subscription Management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "tsc
|
|
29
|
-
"build:full": "tsc --skipLibCheck",
|
|
28
|
+
"build": "tsc --skipLibCheck",
|
|
30
29
|
"dev": "tsc --watch --skipLibCheck",
|
|
31
30
|
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
32
31
|
"test": "tsx test-sdk.ts",
|