@tangle-network/agent-integrations 1.0.3 → 1.0.4
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 +31 -30
- package/data/bundled-adapter-manifests.json +1 -1
- package/dist/{adapters-SSISY8Yg.js → adapters-x5V_2d6D.js} +74 -113
- package/dist/{adapters-SSISY8Yg.js.map → adapters-x5V_2d6D.js.map} +1 -1
- package/dist/{billing-access-policy-CtvuHvM8.d.ts → billing-access-policy-Ce3WWxG5.d.ts} +2 -3
- package/dist/billing-access-policy-Ce3WWxG5.d.ts.map +1 -0
- package/dist/billing-access-policy-DJ63AxZ5.js.map +1 -1
- package/dist/{bundled-manifest-data-y4NLBbZM.js → bundled-manifest-data-DLzwtr7z.js} +25 -1
- package/dist/{bundled-manifest-data-y4NLBbZM.js.map → bundled-manifest-data-DLzwtr7z.js.map} +1 -1
- package/dist/{bundled-manifest-runtime-EpjLQKA9.d.ts → bundled-manifest-runtime-nc86Eowo.d.ts} +2 -2
- package/dist/{bundled-manifest-runtime-EpjLQKA9.d.ts.map → bundled-manifest-runtime-nc86Eowo.d.ts.map} +1 -1
- package/dist/{catalog-CFvKzwVj.js → catalog-DEbD4Cn3.js} +6 -10
- package/dist/catalog-DEbD4Cn3.js.map +1 -0
- package/dist/{catalog-z4zNeXVL.d.ts → catalog-VQlC1Ew0.d.ts} +8 -12
- package/dist/{catalog-z4zNeXVL.d.ts.map → catalog-VQlC1Ew0.d.ts.map} +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +1 -1
- package/dist/connect/index.d.ts +1 -1
- package/dist/connectors/adapters/index.d.ts +3 -2
- package/dist/connectors/adapters/index.js +1 -1
- package/dist/connectors/index.d.ts +7 -7
- package/dist/connectors/index.js +2 -2
- package/dist/connectors/oauth.d.ts +1 -1
- package/dist/{consumer-PHOoRorX.d.ts → consumer-BMWxApGG.d.ts} +10 -122
- package/dist/consumer-BMWxApGG.d.ts.map +1 -0
- package/dist/consumer.d.ts +1 -1
- package/dist/{types-Bq85dJDW.d.ts → core-types-ZuEjjJAr.d.ts} +546 -14
- package/dist/core-types-ZuEjjJAr.d.ts.map +1 -0
- package/dist/{coverage-catalog-5LheuThC.d.ts → coverage-catalog-CsJmShn5.d.ts} +3 -4
- package/dist/{coverage-catalog-5LheuThC.d.ts.map → coverage-catalog-CsJmShn5.d.ts.map} +1 -1
- package/dist/coverage-catalog.d.ts +2 -2
- package/dist/coverage-catalog.js +1 -22
- package/dist/coverage-catalog.js.map +1 -1
- package/dist/{errors-8ePwEZRM.d.ts → errors-CvjrGB5r.d.ts} +4 -1
- package/dist/errors-CvjrGB5r.d.ts.map +1 -0
- package/dist/{errors-CvO_y8JO.js → errors-DSdeYms8.js} +16 -3
- package/dist/errors-DSdeYms8.js.map +1 -0
- package/dist/{hub-DkiKVWJX.d.ts → hub-CRteFmOR.d.ts} +3 -3
- package/dist/{hub-DkiKVWJX.d.ts.map → hub-CRteFmOR.d.ts.map} +1 -1
- package/dist/{hub-Du6wsA1o.js → hub-DnPkr4xn.js} +2 -1
- package/dist/hub-DnPkr4xn.js.map +1 -0
- package/dist/hub.d.ts +1 -1
- package/dist/hub.js +1 -1
- package/dist/{index-BFK-G6g1.d.ts → index-BAI3O7bc.d.ts} +2 -2
- package/dist/{index-BFK-G6g1.d.ts.map → index-BAI3O7bc.d.ts.map} +1 -1
- package/dist/{index-poLalSQ6.d.ts → index-BbluAb0U.d.ts} +3 -12
- package/dist/index-BbluAb0U.d.ts.map +1 -0
- package/dist/{index-HBXVPkSs.d.ts → index-C5W0VfzQ.d.ts} +19 -194
- package/dist/index-C5W0VfzQ.d.ts.map +1 -0
- package/dist/{index-CkCYzn8f.d.ts → index-CezgaMuD.d.ts} +3 -3
- package/dist/{index-CkCYzn8f.d.ts.map → index-CezgaMuD.d.ts.map} +1 -1
- package/dist/{index-DoJFdW9K.d.ts → index-Dev4r3_u.d.ts} +3 -3
- package/dist/{index-DoJFdW9K.d.ts.map → index-Dev4r3_u.d.ts.map} +1 -1
- package/dist/index.d.ts +19 -20
- package/dist/index.js +11 -11
- package/dist/internal/bundled-manifest-runtime.d.ts +1 -1
- package/dist/internal/bundled-manifest-runtime.js +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +2 -2
- package/dist/middleware/index.d.ts +1 -1
- package/dist/{oauth-DoUCpYU_.d.ts → oauth-Br5r5Ms0.d.ts} +2 -2
- package/dist/{oauth-DoUCpYU_.d.ts.map → oauth-Br5r5Ms0.d.ts.map} +1 -1
- package/dist/{policy-C8jynxf9.d.ts → policy-BH4ZAZ4s.d.ts} +3 -14
- package/dist/policy-BH4ZAZ4s.d.ts.map +1 -0
- package/dist/{policy-UOPcZqdE.js → policy-C0XpcajG.js} +5 -30
- package/dist/policy-C0XpcajG.js.map +1 -0
- package/dist/{redaction-B6R-ZeWT.js → redaction-dXj4op-I.js} +16 -2
- package/dist/redaction-dXj4op-I.js.map +1 -0
- package/dist/{registry-0xWMSBUu.d.ts → registry-CJFl46d3.d.ts} +3 -3
- package/dist/{registry-0xWMSBUu.d.ts.map → registry-CJFl46d3.d.ts.map} +1 -1
- package/dist/{registry-core-B1ApiG47.d.ts → registry-core-_BnkpeSe.d.ts} +2 -2
- package/dist/{registry-core-B1ApiG47.d.ts.map → registry-core-_BnkpeSe.d.ts.map} +1 -1
- package/dist/registry.d.ts +2 -2
- package/dist/registry.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/sandbox.d.ts +2 -2
- package/dist/sandbox.js +5 -20
- package/dist/sandbox.js.map +1 -1
- package/dist/{specs-B7c5wARo.js → specs-BQHb_KgP.js} +4 -23
- package/dist/specs-BQHb_KgP.js.map +1 -0
- package/dist/specs.d.ts +2 -2
- package/dist/specs.js +2 -2
- package/dist/{src-ZNpLV5ka.js → src-BZmlzQzN.js} +8 -186
- package/dist/src-BZmlzQzN.js.map +1 -0
- package/dist/stripe/index.d.ts +3 -79
- package/dist/stripe/index.d.ts.map +1 -1
- package/dist/stripe/index.js +5 -52
- package/dist/stripe/index.js.map +1 -1
- package/dist/{tangle-id-BW5dTiGi.d.ts → tangle-id-BnzGOA_W.d.ts} +2 -2
- package/dist/{tangle-id-BW5dTiGi.d.ts.map → tangle-id-BnzGOA_W.d.ts.map} +1 -1
- package/dist/types-CjrugGcd.js.map +1 -1
- package/dist/worker.d.ts +3 -3
- package/dist/worker.js +2 -2
- package/docs/external-product-integration.md +14 -5
- package/docs/integration-coverage-checklist.md +1 -12
- package/docs/private-audio-transcription.md +1 -1
- package/package.json +2 -1
- package/dist/billing-access-policy-CtvuHvM8.d.ts.map +0 -1
- package/dist/catalog-CFvKzwVj.js.map +0 -1
- package/dist/consumer-PHOoRorX.d.ts.map +0 -1
- package/dist/core-types-0BenSoZJ.d.ts +0 -365
- package/dist/core-types-0BenSoZJ.d.ts.map +0 -1
- package/dist/errors-8ePwEZRM.d.ts.map +0 -1
- package/dist/errors-CvO_y8JO.js.map +0 -1
- package/dist/hub-Du6wsA1o.js.map +0 -1
- package/dist/index-HBXVPkSs.d.ts.map +0 -1
- package/dist/index-poLalSQ6.d.ts.map +0 -1
- package/dist/policy-C8jynxf9.d.ts.map +0 -1
- package/dist/policy-UOPcZqdE.js.map +0 -1
- package/dist/redaction-B6R-ZeWT.js.map +0 -1
- package/dist/specs-B7c5wARo.js.map +0 -1
- package/dist/src-ZNpLV5ka.js.map +0 -1
- package/dist/types-Bq85dJDW.d.ts.map +0 -1
- package/docs/generated-integration-coverage-checklist.md +0 -156
package/dist/stripe/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as IdempotencyRuntime, n as AtomicIdempotencyStore,
|
|
2
|
-
import {
|
|
3
|
-
import { n as IntegrationRuntimeError, r as IntegrationUserAction } from "../errors-
|
|
1
|
+
import { a as IdempotencyRuntime, n as AtomicIdempotencyStore, r as FileSystemAtomicIdempotencyStore } from "../idempotency-ByVGykkH.js";
|
|
2
|
+
import { u as TrustedPlatformEvidence } from "../billing-access-policy-Ce3WWxG5.js";
|
|
3
|
+
import { n as IntegrationRuntimeError, r as IntegrationUserAction } from "../errors-CvjrGB5r.js";
|
|
4
4
|
import { o as WebhookEnvelope } from "../router-D9qd9HmR.js";
|
|
5
5
|
//#region src/stripe/subscription-state.d.ts
|
|
6
6
|
/**
|
|
@@ -317,8 +317,6 @@ export type StripeBillingEvent = {
|
|
|
317
317
|
* resolving. A throw releases the claim and reaches the HTTP boundary. */
|
|
318
318
|
export type StripeBillingListener = (event: StripeBillingEvent) => void | Promise<void>;
|
|
319
319
|
export interface StripeEventIdempotencyStore extends AtomicIdempotencyStore {}
|
|
320
|
-
/** Process-local store for direct dispatcher use and tests. */
|
|
321
|
-
export declare class InMemoryStripeEventIdempotencyStore extends InMemoryAtomicIdempotencyStore implements StripeEventIdempotencyStore {}
|
|
322
320
|
/** Durable store for workers that share the same filesystem directory. */
|
|
323
321
|
export declare class FileSystemStripeEventIdempotencyStore extends FileSystemAtomicIdempotencyStore implements StripeEventIdempotencyStore {}
|
|
324
322
|
export interface StripeBillingDispatcherOptions {
|
|
@@ -672,79 +670,5 @@ export type SubscriptionGateResult = {
|
|
|
672
670
|
* `BillingError` for any other state.
|
|
673
671
|
*/
|
|
674
672
|
export declare function requireActiveSubscription(input: RequireActiveSubscriptionInput): Promise<SubscriptionGateResult>;
|
|
675
|
-
/** Legacy workspace timestamp store retained for source compatibility. */
|
|
676
|
-
export interface TrialStore {
|
|
677
|
-
/** Returns a workspace creation timestamp (ms epoch), or null. */
|
|
678
|
-
getCreatedAt(workspaceId: string): Promise<number | null> | number | null;
|
|
679
|
-
}
|
|
680
|
-
export interface WithTrialAccessInput {
|
|
681
|
-
workspaceId: string;
|
|
682
|
-
/** Trial length in days from workspace creation. */
|
|
683
|
-
days: number;
|
|
684
|
-
trialStore: TrialStore;
|
|
685
|
-
/** Optional `now` override for tests. */
|
|
686
|
-
now?: () => number;
|
|
687
|
-
}
|
|
688
|
-
export interface TrialAccessResult {
|
|
689
|
-
/** Always false while product-funded trials are disabled. */
|
|
690
|
-
inTrial: boolean;
|
|
691
|
-
/** Always zero while product-funded trials are disabled. */
|
|
692
|
-
daysRemaining: number;
|
|
693
|
-
/** Always null while product-funded trials are disabled. */
|
|
694
|
-
trialEndsAt: number | null;
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Legacy compatibility helper. Product-funded trials are disabled, so this
|
|
698
|
-
* function always returns a denied trial result without reading the store.
|
|
699
|
-
*
|
|
700
|
-
* Callers must use `requireActiveSubscription` for product access.
|
|
701
|
-
*/
|
|
702
|
-
export declare function withTrialAccess(input: WithTrialAccessInput): Promise<TrialAccessResult>;
|
|
703
|
-
/** Legacy read-only counter store retained for source compatibility. */
|
|
704
|
-
export interface FreeTierStore {
|
|
705
|
-
/** Returns `{ used, total }` for a workspace. */
|
|
706
|
-
getUsage(workspaceId: string): Promise<{
|
|
707
|
-
used: number;
|
|
708
|
-
total: number;
|
|
709
|
-
}> | {
|
|
710
|
-
used: number;
|
|
711
|
-
total: number;
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
export interface GetRemainingFreeTierInput {
|
|
715
|
-
workspaceId: string;
|
|
716
|
-
freeTierStore: FreeTierStore;
|
|
717
|
-
}
|
|
718
|
-
export interface FreeTierResult {
|
|
719
|
-
/** Units (whatever the product counts: API calls, tokens, generations) still allowed. */
|
|
720
|
-
remaining: number;
|
|
721
|
-
/** Total quota. */
|
|
722
|
-
total: number;
|
|
723
|
-
/** Whether the quota is exhausted. */
|
|
724
|
-
exhausted: boolean;
|
|
725
|
-
}
|
|
726
|
-
/**
|
|
727
|
-
* Legacy compatibility helper. Product-funded free-tier quota is disabled,
|
|
728
|
-
* so this function always returns zero without reading the consumer store.
|
|
729
|
-
*/
|
|
730
|
-
export declare function getRemainingFreeTier(input: GetRemainingFreeTierInput): Promise<FreeTierResult>;
|
|
731
|
-
export interface ComposedGateInput {
|
|
732
|
-
workspaceId: string;
|
|
733
|
-
store: SubscriptionStore;
|
|
734
|
-
accessEvidence?: TrustedPlatformEvidence;
|
|
735
|
-
expectedUserId?: string;
|
|
736
|
-
trialStore?: TrialStore;
|
|
737
|
-
trialDays?: number;
|
|
738
|
-
denyPastDue?: boolean;
|
|
739
|
-
now?: () => number;
|
|
740
|
-
}
|
|
741
|
-
/**
|
|
742
|
-
* Legacy compatibility helper. Trial inputs are ignored and access depends
|
|
743
|
-
* only on the paid subscription state.
|
|
744
|
-
*/
|
|
745
|
-
export declare function gateSubscriptionOrTrial(input: ComposedGateInput): Promise<SubscriptionGateResult & {
|
|
746
|
-
viaTrial?: boolean;
|
|
747
|
-
daysRemaining?: number;
|
|
748
|
-
}>;
|
|
749
673
|
//#endregion
|
|
750
674
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["_$___billing_access_policy_js0.TrustedPlatformEvidence"],"sources":["../../src/stripe/subscription-state.ts","../../src/stripe/errors.ts","../../src/stripe/webhooks.ts","../../src/stripe/tenant-config.ts","../../src/stripe/pricing.ts","../../src/stripe/middleware.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA0CY;;qBAWC,8BAA8B;;;YAa/B;EACN;EAAe;;EACf;EAAgB;;iBAEL;;;;EAIf;;EAEA;;EAEA;;EAEA,OAAO;;EAEP;;;EAGA;;EAEA;;;EAGA;;;EAGA;;;EAGA;;EAEA;;;EAGA,yBAAyB;;;EAGzB;;EAEA;;;;;iBAMe;EACf,KAAK,sBAAsB,QAAQ;EACnC,KAAK,QAAQ,qBAAqB;;;;;EAKlC,cAAc,QAAQ,oBAAoB,0BAA0B;;;;;wBAmBtD,kBAAkB,MAAM,mBAAmB,IAAI;;;;wBAQ/C,gBACd,SAAS,oBACT,MAAM,QAAQ;EAAwB,OAAO;GAC7C;EACE;EACA;EACA;EACA;IAED;;;;;;;;;;;;;;;;;;wBA6Ca,WAAW,OAAO,oBAAoB;;;;;;qBA4BzC,qCAAqC;mBAC/B;EAEX,KAAK,sBAAsB,QAAQ;EAKnC,KAAK,QAAQ,qBAAqB;EAIlC,cAAc,QAAQ,oBAAoB,0BAA0B;;;;;;;;;;;;;;;qBA0B/D,uCAAuC;mBACrB;EAA7B,YAA6B;EAIvB,KAAK,sBAAsB,QAAQ;EAmCnC,KAAK,QAAQ,qBAAqB;EAwBlC,cAAc,QAAQ,oBAAoB,0BAA0B;UAW5D;UAgBA;UA4BA;;;;UAQN;;;;;wBAmBM,uBAAuB;EACrC;EACA;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACE;;;YC1YQ;iBAmBK;EACf;EACA;EACA;EACA,oBAAoB;EACpB;EACA;;qBAGW,qBAAqB;WACvB,aAAa;WACb,SAAS;EAElB,YAAY;IACV,MAAM;IACN;IACA,UAAU;IACV,aAAa;;;;;;;qBAmBJ,oBAAoB;EAC/B,YAAY;IAAS;IAAiB,UAAU;;;;;;;;iBCXjC;EACf;EACA;EACA;IAAqB;;EACrB;EACA;EACA;EACA;IACE,OAAO;MAAQ;QAAU;;;;;;;EAK3B,WAAW;;;;;YA2CD;EAEN;EACA;EACA,QAAQ;;EAGR;EACA;EACA,QAAQ;;EAGR;EACA;EACA,eAAe;EACf,QAAQ;;EAGR;EACA;EACA,QAAQ;;EAGR;EACA;EACA,QAAQ;EACR;;EAGA;EACA;EACA,QAAQ;;EAGR;EACA;EACA,QAAQ;;EAGR;EACA;EACA,QAAQ;EACR;EACA;;EAGA;EACA;EACA;EACA;;EAGA;EACA;EACA,QAAQ;EACR;EACA;;EAGA;EACA;EACA;;EAGA;EACA;EACA;;EAGA;EACA;EACA;EACA;;;;YAKM,yBAAyB,OAAO,8BAA8B;iBAEzD,oCAAoC;;qBAGxC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$___billing_access_policy_js0.TrustedPlatformEvidence"],"sources":["../../src/stripe/subscription-state.ts","../../src/stripe/err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
+
import { FileSystemAtomicIdempotencyStore, resolveAtomicIdempotencyStore } from "../idempotency.js";
|
|
2
2
|
import { o as assertNoProductFreeTrial, s as decideBillingAccess } from "../billing-access-policy-DJ63AxZ5.js";
|
|
3
|
-
import { t as IntegrationRuntimeError } from "../errors-
|
|
3
|
+
import { t as IntegrationRuntimeError } from "../errors-DSdeYms8.js";
|
|
4
4
|
//#region src/stripe/errors.ts
|
|
5
5
|
/**
|
|
6
6
|
* Stripe billing error taxonomy.
|
|
@@ -525,8 +525,6 @@ async function syncDirectory(directory) {
|
|
|
525
525
|
}
|
|
526
526
|
//#endregion
|
|
527
527
|
//#region src/stripe/webhooks.ts
|
|
528
|
-
/** Process-local store for direct dispatcher use and tests. */
|
|
529
|
-
var InMemoryStripeEventIdempotencyStore = class extends InMemoryAtomicIdempotencyStore {};
|
|
530
528
|
/** Durable store for workers that share the same filesystem directory. */
|
|
531
529
|
var FileSystemStripeEventIdempotencyStore = class extends FileSystemAtomicIdempotencyStore {};
|
|
532
530
|
/**
|
|
@@ -1478,19 +1476,13 @@ function envKey(productId) {
|
|
|
1478
1476
|
/**
|
|
1479
1477
|
* Drop-in middleware for product agents.
|
|
1480
1478
|
*
|
|
1481
|
-
*
|
|
1479
|
+
* One primitive consumers wire into their HTTP layer (Hono, Express,
|
|
1482
1480
|
* raw Workers `fetch` handler — middleware here is framework-neutral,
|
|
1483
|
-
* returns a `BillingGate` value the consumer chooses how to respond to)
|
|
1481
|
+
* returns a `BillingGate` value the consumer chooses how to respond to):
|
|
1484
1482
|
*
|
|
1485
1483
|
* requireActiveSubscription({ workspaceId, store })
|
|
1486
1484
|
* → 'allow' | { allowed: false, error: BillingError }
|
|
1487
1485
|
*
|
|
1488
|
-
* withTrialAccess({ workspaceId, days, trialStore })
|
|
1489
|
-
* → always deny product-funded trial access
|
|
1490
|
-
*
|
|
1491
|
-
* getRemainingFreeTier({ workspaceId, freeTierStore })
|
|
1492
|
-
* → always { remaining: 0, total: 0, exhausted: true }
|
|
1493
|
-
*
|
|
1494
1486
|
* Frameworks: we don't import Hono / Express. The middleware shape is a
|
|
1495
1487
|
* pure async function returning a decision. The product wires it into
|
|
1496
1488
|
* its framework with a 3-line adapter (see `examples/hono.ts`).
|
|
@@ -1581,46 +1573,7 @@ async function requireActiveSubscription(input) {
|
|
|
1581
1573
|
warn: decision.warn
|
|
1582
1574
|
};
|
|
1583
1575
|
}
|
|
1584
|
-
/**
|
|
1585
|
-
* Legacy compatibility helper. Product-funded trials are disabled, so this
|
|
1586
|
-
* function always returns a denied trial result without reading the store.
|
|
1587
|
-
*
|
|
1588
|
-
* Callers must use `requireActiveSubscription` for product access.
|
|
1589
|
-
*/
|
|
1590
|
-
async function withTrialAccess(input) {
|
|
1591
|
-
if (decideBillingAccess({}).allowed) throw new Error("billing: unexpected trial access allowance");
|
|
1592
|
-
return {
|
|
1593
|
-
inTrial: false,
|
|
1594
|
-
daysRemaining: 0,
|
|
1595
|
-
trialEndsAt: null
|
|
1596
|
-
};
|
|
1597
|
-
}
|
|
1598
|
-
/**
|
|
1599
|
-
* Legacy compatibility helper. Product-funded free-tier quota is disabled,
|
|
1600
|
-
* so this function always returns zero without reading the consumer store.
|
|
1601
|
-
*/
|
|
1602
|
-
async function getRemainingFreeTier(input) {
|
|
1603
|
-
if (decideBillingAccess({}).allowed) throw new Error("billing: unexpected free-tier allowance");
|
|
1604
|
-
return {
|
|
1605
|
-
remaining: 0,
|
|
1606
|
-
total: 0,
|
|
1607
|
-
exhausted: true
|
|
1608
|
-
};
|
|
1609
|
-
}
|
|
1610
|
-
/**
|
|
1611
|
-
* Legacy compatibility helper. Trial inputs are ignored and access depends
|
|
1612
|
-
* only on the paid subscription state.
|
|
1613
|
-
*/
|
|
1614
|
-
async function gateSubscriptionOrTrial(input) {
|
|
1615
|
-
return requireActiveSubscription({
|
|
1616
|
-
workspaceId: input.workspaceId,
|
|
1617
|
-
store: input.store,
|
|
1618
|
-
accessEvidence: input.accessEvidence,
|
|
1619
|
-
expectedUserId: input.expectedUserId,
|
|
1620
|
-
denyPastDue: input.denyPastDue
|
|
1621
|
-
});
|
|
1622
|
-
}
|
|
1623
1576
|
//#endregion
|
|
1624
|
-
export { BillingError, ConfigError, EnvTenantConfigResolver, FileSystemStripeEventIdempotencyStore, FileSystemSubscriptionStore,
|
|
1577
|
+
export { BillingError, ConfigError, EnvTenantConfigResolver, FileSystemStripeEventIdempotencyStore, FileSystemSubscriptionStore, InMemorySubscriptionStore, PRODUCT_IDS, SUBSCRIPTION_STATES, StaticTenantConfigResolver, StripeBillingDispatcher, applyTransition, buildStripeClient, combineListeners, createBillingPortalUrl, createCheckoutUrl, findPlan, gateAccess, getStripeClient, isValidTransition, makeStripeSecretResolver, makeSubscriptionRecord, memoizeResolver, requireActiveSubscription, requirePlan };
|
|
1625
1578
|
|
|
1626
1579
|
//# sourceMappingURL=index.js.map
|