@fantastic.dev/better-stripe 0.109.1 → 0.111.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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshActor.d.ts +41 -0
- package/dist/client/billing/renewalAttach/internal/observation/freshActor.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshActor.js +40 -3
- package/dist/client/billing/renewalAttach/internal/observation/freshActor.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.d.ts +10 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.js +162 -57
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/invoiceAuthorization.d.ts +14 -0
- package/dist/client/billing/renewalAttach/internal/observation/invoiceAuthorization.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/invoiceAuthorization.js +109 -0
- package/dist/client/billing/renewalAttach/internal/observation/invoiceAuthorization.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/invoicePlan.d.ts +20 -0
- package/dist/client/billing/renewalAttach/internal/observation/invoicePlan.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/invoicePlan.js +176 -0
- package/dist/client/billing/renewalAttach/internal/observation/invoicePlan.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/profile.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/types.d.ts +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/types.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/types.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.d.ts +24 -0
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.js +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/sourceOperations.js.map +1 -1
- package/dist/client/billing/renewalObservation/evidence-invoice.d.ts.map +1 -1
- package/dist/client/billing/renewalObservation/evidence-invoice.js +3 -0
- package/dist/client/billing/renewalObservation/evidence-invoice.js.map +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +84 -32
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +42 -16
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +52 -0
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +26 -0
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
- package/dist/component/balanceFunding/mutations.d.ts +27 -27
- package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
- package/dist/component/balanceFunding/queries.d.ts +1 -1
- package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
- package/dist/component/earnings/triggers.d.ts +44 -0
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/renewalWitnesses/eligibility.d.ts +36 -0
- package/dist/component/renewalWitnesses/eligibility.d.ts.map +1 -0
- package/dist/component/renewalWitnesses/eligibility.js +60 -0
- package/dist/component/renewalWitnesses/eligibility.js.map +1 -0
- package/dist/component/renewalWitnesses/protocol.d.ts +75 -0
- package/dist/component/renewalWitnesses/protocol.d.ts.map +1 -0
- package/dist/component/renewalWitnesses/protocol.js +82 -0
- package/dist/component/renewalWitnesses/protocol.js.map +1 -0
- package/dist/component/renewalWitnesses/schema.d.ts +99 -0
- package/dist/component/renewalWitnesses/schema.d.ts.map +1 -0
- package/dist/component/renewalWitnesses/schema.js +36 -0
- package/dist/component/renewalWitnesses/schema.js.map +1 -0
- package/dist/component/renewalWitnesses/source.d.ts +22 -0
- package/dist/component/renewalWitnesses/source.d.ts.map +1 -0
- package/dist/component/renewalWitnesses/source.js +108 -0
- package/dist/component/renewalWitnesses/source.js.map +1 -0
- package/dist/component/schema.d.ts +42 -16
- package/dist/component/schema.js +2 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/component/usage/allowance.fixtures.d.ts +26 -0
- package/dist/component/usage/allowance.fixtures.d.ts.map +1 -1
- package/dist/component/usageCredits/accounting.fixtures.d.ts +42 -16
- package/dist/component/usageCredits/accounting.fixtures.d.ts.map +1 -1
- package/dist/shared/renewalWitness.d.ts +51 -0
- package/dist/shared/renewalWitness.d.ts.map +1 -0
- package/dist/shared/renewalWitness.js +127 -0
- package/dist/shared/renewalWitness.js.map +1 -0
- package/docs/renewal-invoice-reads.md +85 -0
- package/docs/renewal-witness-protocol.md +88 -0
- package/package.json +1 -1
- package/src/client/billing/renewalAttach/internal/observation/freshActor.ts +69 -3
- package/src/client/billing/renewalAttach/internal/observation/freshTransport.ts +189 -59
- package/src/client/billing/renewalAttach/internal/observation/invoiceActor.integration.test.ts +142 -0
- package/src/client/billing/renewalAttach/internal/observation/invoiceActorControls.integration.test.ts +495 -0
- package/src/client/billing/renewalAttach/internal/observation/invoiceAuthorization.ts +145 -0
- package/src/client/billing/renewalAttach/internal/observation/invoicePlan.ts +284 -0
- package/src/client/billing/renewalAttach/internal/observation/profile.ts +1 -1
- package/src/client/billing/renewalAttach/internal/observation/types.ts +7 -1
- package/src/client/billing/renewalAttach/internal/operations/sourceOperations.ts +30 -0
- package/src/client/billing/renewalAttach/internal/producer/producerConfigureWriteControls.integration.test.ts +74 -62
- package/src/client/billing/renewalAttach/internal/test-fixtures/invoiceObservation.ts +158 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/producerConfigureAdmission.ts +11 -1
- package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialOperation.ts +4 -0
- package/src/client/billing/renewalObservation/evidence-invoice-identity.test.ts +13 -0
- package/src/client/billing/renewalObservation/evidence-invoice.ts +8 -0
- package/src/component/renewalOperations/configureJournal.fixtures.ts +25 -3
- package/src/component/renewalWitnesses/bounds.test.ts +204 -0
- package/src/component/renewalWitnesses/codec.test.ts +84 -0
- package/src/component/renewalWitnesses/controls.test.ts +250 -0
- package/src/component/renewalWitnesses/eligibility.ts +78 -0
- package/src/component/renewalWitnesses/protocol.test.ts +63 -0
- package/src/component/renewalWitnesses/protocol.ts +103 -0
- package/src/component/renewalWitnesses/schema.ts +36 -0
- package/src/component/renewalWitnesses/source.ts +157 -0
- package/src/component/schema.ts +2 -0
- package/src/shared/renewalWitness.ts +179 -0
|
@@ -595,6 +595,22 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
|
|
|
595
595
|
} & {
|
|
596
596
|
providerAction: string;
|
|
597
597
|
}, Promise<{
|
|
598
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
599
|
+
retryable: false;
|
|
600
|
+
status: "unknown";
|
|
601
|
+
} | {
|
|
602
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
603
|
+
retryable: false;
|
|
604
|
+
status: "conflict";
|
|
605
|
+
} | {
|
|
606
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
607
|
+
retryable: false;
|
|
608
|
+
status: "rejected";
|
|
609
|
+
} | {
|
|
610
|
+
reason: "provider_pending";
|
|
611
|
+
retryable: true;
|
|
612
|
+
status: "not_ready";
|
|
613
|
+
} | {
|
|
598
614
|
operation: {
|
|
599
615
|
accountId: string;
|
|
600
616
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -611,7 +627,16 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
|
|
|
611
627
|
version: number;
|
|
612
628
|
};
|
|
613
629
|
status: "canceled";
|
|
614
|
-
}
|
|
630
|
+
}>>;
|
|
631
|
+
export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
|
|
632
|
+
accountId: string;
|
|
633
|
+
definitionVersion: string;
|
|
634
|
+
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
635
|
+
providerApiVersion: string;
|
|
636
|
+
scopeKey: string;
|
|
637
|
+
stripeSubscriptionId: string;
|
|
638
|
+
version: number;
|
|
639
|
+
}, Promise<{
|
|
615
640
|
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
616
641
|
retryable: false;
|
|
617
642
|
status: "unknown";
|
|
@@ -627,16 +652,7 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
|
|
|
627
652
|
reason: "provider_pending";
|
|
628
653
|
retryable: true;
|
|
629
654
|
status: "not_ready";
|
|
630
|
-
}
|
|
631
|
-
export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
|
|
632
|
-
accountId: string;
|
|
633
|
-
definitionVersion: string;
|
|
634
|
-
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
635
|
-
providerApiVersion: string;
|
|
636
|
-
scopeKey: string;
|
|
637
|
-
stripeSubscriptionId: string;
|
|
638
|
-
version: number;
|
|
639
|
-
}, Promise<{
|
|
655
|
+
} | {
|
|
640
656
|
operation: {
|
|
641
657
|
accountId: string;
|
|
642
658
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -653,22 +669,6 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
|
|
|
653
669
|
version: number;
|
|
654
670
|
};
|
|
655
671
|
status: "canceled";
|
|
656
|
-
} | {
|
|
657
|
-
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
658
|
-
retryable: false;
|
|
659
|
-
status: "unknown";
|
|
660
|
-
} | {
|
|
661
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
662
|
-
retryable: false;
|
|
663
|
-
status: "conflict";
|
|
664
|
-
} | {
|
|
665
|
-
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
666
|
-
retryable: false;
|
|
667
|
-
status: "rejected";
|
|
668
|
-
} | {
|
|
669
|
-
reason: "provider_pending";
|
|
670
|
-
retryable: true;
|
|
671
|
-
status: "not_ready";
|
|
672
672
|
}>>;
|
|
673
673
|
export declare const cancelWorkflow: import("convex/server").RegisteredMutation<"public", {
|
|
674
674
|
accountId: string;
|
|
@@ -2,14 +2,6 @@ import type { Infer } from "convex/values";
|
|
|
2
2
|
import type { MutationCtx } from "../_generated/server.js";
|
|
3
3
|
import { prepareArgs, finishPreparationArgs } from "./mutationValidators.js";
|
|
4
4
|
export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prepareArgs>): Promise<{
|
|
5
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
6
|
-
retryable: false;
|
|
7
|
-
status: "conflict";
|
|
8
|
-
} | {
|
|
9
|
-
reason: "policy_invalid";
|
|
10
|
-
retryable: false;
|
|
11
|
-
status: "rejected";
|
|
12
|
-
} | {
|
|
13
5
|
operation: {
|
|
14
6
|
accountId: string;
|
|
15
7
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -20,6 +12,14 @@ export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prep
|
|
|
20
12
|
} | {
|
|
21
13
|
enabled: boolean;
|
|
22
14
|
status: "unchanged";
|
|
15
|
+
} | {
|
|
16
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
17
|
+
retryable: false;
|
|
18
|
+
status: "conflict";
|
|
19
|
+
} | {
|
|
20
|
+
reason: "policy_invalid";
|
|
21
|
+
retryable: false;
|
|
22
|
+
status: "rejected";
|
|
23
23
|
} | {
|
|
24
24
|
reason: "provider_pending";
|
|
25
25
|
retryable: true;
|
|
@@ -180,11 +180,11 @@ export declare const findPreparationOperation: import("convex/server").Registere
|
|
|
180
180
|
retryable: false;
|
|
181
181
|
} | {
|
|
182
182
|
reason?: undefined;
|
|
183
|
-
retryable?: undefined;
|
|
184
183
|
accountId: string;
|
|
185
184
|
scopeKey: string;
|
|
186
185
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
187
186
|
version: number;
|
|
187
|
+
retryable?: undefined;
|
|
188
188
|
status?: undefined;
|
|
189
189
|
state: "canceled" | "failed" | "pending" | "running" | "succeeded" | "unknown";
|
|
190
190
|
cancelRequested: boolean;
|
|
@@ -60,22 +60,6 @@ export declare const phaseRef: import("convex/values").VObject<{
|
|
|
60
60
|
}, "required", "accountId" | "definitionVersion" | "operationId" | "phase" | "providerApiVersion" | "providerKey" | "scopeKey" | "stripeSubscriptionId" | "version">;
|
|
61
61
|
export type FundingPhaseRef = Infer<typeof phaseRef>;
|
|
62
62
|
export declare const workflowStartResult: import("convex/values").VUnion<{
|
|
63
|
-
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
64
|
-
retryable: false;
|
|
65
|
-
status: "unknown";
|
|
66
|
-
} | {
|
|
67
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
68
|
-
retryable: false;
|
|
69
|
-
status: "conflict";
|
|
70
|
-
} | {
|
|
71
|
-
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
72
|
-
retryable: false;
|
|
73
|
-
status: "rejected";
|
|
74
|
-
} | {
|
|
75
|
-
reason: "provider_pending";
|
|
76
|
-
retryable: true;
|
|
77
|
-
status: "not_ready";
|
|
78
|
-
} | {
|
|
79
63
|
operation: {
|
|
80
64
|
accountId: string;
|
|
81
65
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -92,6 +76,22 @@ export declare const workflowStartResult: import("convex/values").VUnion<{
|
|
|
92
76
|
version: number;
|
|
93
77
|
};
|
|
94
78
|
status: "canceled";
|
|
79
|
+
} | {
|
|
80
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
81
|
+
retryable: false;
|
|
82
|
+
status: "unknown";
|
|
83
|
+
} | {
|
|
84
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
85
|
+
retryable: false;
|
|
86
|
+
status: "conflict";
|
|
87
|
+
} | {
|
|
88
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
89
|
+
retryable: false;
|
|
90
|
+
status: "rejected";
|
|
91
|
+
} | {
|
|
92
|
+
reason: "provider_pending";
|
|
93
|
+
retryable: true;
|
|
94
|
+
status: "not_ready";
|
|
95
95
|
}, [import("convex/values").VObject<{
|
|
96
96
|
operation: {
|
|
97
97
|
accountId: string;
|
|
@@ -2005,6 +2005,28 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
2005
2005
|
searchIndexes: {};
|
|
2006
2006
|
vectorIndexes: {};
|
|
2007
2007
|
};
|
|
2008
|
+
renewalObservationWitnesses: {
|
|
2009
|
+
document: {
|
|
2010
|
+
_creationTime: number;
|
|
2011
|
+
_id: import("convex/values").GenericId<"renewalObservationWitnesses">;
|
|
2012
|
+
identity: {
|
|
2013
|
+
componentScope: string;
|
|
2014
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
2015
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
2016
|
+
witnessId: string;
|
|
2017
|
+
};
|
|
2018
|
+
payloadBinding: string;
|
|
2019
|
+
payloadJSON: string;
|
|
2020
|
+
};
|
|
2021
|
+
fieldPaths: "_id" | ("_creationTime" | "identity" | "identity.componentScope" | "identity.operationId" | "identity.parentOperationId" | "identity.witnessId" | "payloadBinding" | "payloadJSON");
|
|
2022
|
+
indexes: {
|
|
2023
|
+
by_id: ["_id"];
|
|
2024
|
+
by_creation_time: ["_creationTime"];
|
|
2025
|
+
by_componentScope_and_witnessId: ["identity.componentScope", "identity.witnessId", "_creationTime"];
|
|
2026
|
+
};
|
|
2027
|
+
searchIndexes: {};
|
|
2028
|
+
vectorIndexes: {};
|
|
2029
|
+
};
|
|
2008
2030
|
renewalOperationAttempts: {
|
|
2009
2031
|
document: {
|
|
2010
2032
|
_creationTime: number;
|
|
@@ -5050,6 +5072,28 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
|
|
|
5050
5072
|
searchIndexes: {};
|
|
5051
5073
|
vectorIndexes: {};
|
|
5052
5074
|
};
|
|
5075
|
+
renewalObservationWitnesses: {
|
|
5076
|
+
document: {
|
|
5077
|
+
_creationTime: number;
|
|
5078
|
+
_id: import("convex/values").GenericId<"renewalObservationWitnesses">;
|
|
5079
|
+
identity: {
|
|
5080
|
+
componentScope: string;
|
|
5081
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
5082
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
5083
|
+
witnessId: string;
|
|
5084
|
+
};
|
|
5085
|
+
payloadBinding: string;
|
|
5086
|
+
payloadJSON: string;
|
|
5087
|
+
};
|
|
5088
|
+
fieldPaths: "_id" | ("_creationTime" | "identity" | "identity.componentScope" | "identity.operationId" | "identity.parentOperationId" | "identity.witnessId" | "payloadBinding" | "payloadJSON");
|
|
5089
|
+
indexes: {
|
|
5090
|
+
by_id: ["_id"];
|
|
5091
|
+
by_creation_time: ["_creationTime"];
|
|
5092
|
+
by_componentScope_and_witnessId: ["identity.componentScope", "identity.witnessId", "_creationTime"];
|
|
5093
|
+
};
|
|
5094
|
+
searchIndexes: {};
|
|
5095
|
+
vectorIndexes: {};
|
|
5096
|
+
};
|
|
5053
5097
|
renewalOperationAttempts: {
|
|
5054
5098
|
document: {
|
|
5055
5099
|
_creationTime: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/component/earnings/triggers.ts"],"names":[],"mappings":"AA6GA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/component/earnings/triggers.ts"],"names":[],"mappings":"AA6GA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAA0D,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { QueryCtx } from "../_generated/server.js";
|
|
2
|
+
import { type WitnessPayload } from "../../shared/renewalWitness.js";
|
|
3
|
+
/** Full material and exact source qualify unsigned storage DATA, not provider provenance. */
|
|
4
|
+
export declare function validateWitness(ctx: Pick<QueryCtx, "db">, raw: string): Promise<{
|
|
5
|
+
payload: Readonly<{
|
|
6
|
+
json: string;
|
|
7
|
+
value: WitnessPayload;
|
|
8
|
+
}>;
|
|
9
|
+
fields: {
|
|
10
|
+
version: 1;
|
|
11
|
+
identity: {
|
|
12
|
+
componentScope: string;
|
|
13
|
+
witnessId: string;
|
|
14
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
15
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
16
|
+
};
|
|
17
|
+
capturedSubject: string;
|
|
18
|
+
observedAtMs: number;
|
|
19
|
+
customerAccountId: string;
|
|
20
|
+
customerId: string;
|
|
21
|
+
livemode: boolean;
|
|
22
|
+
subscriptionId: string;
|
|
23
|
+
scheduleId: string;
|
|
24
|
+
observedItemId: string;
|
|
25
|
+
nativePeriod: Readonly<{
|
|
26
|
+
start: number;
|
|
27
|
+
end: number;
|
|
28
|
+
}>;
|
|
29
|
+
operationalAuthority: false;
|
|
30
|
+
authenticationEstablished: false;
|
|
31
|
+
publicDeliveryEstablished: false;
|
|
32
|
+
providerQualificationRequired: true;
|
|
33
|
+
};
|
|
34
|
+
payloadBinding: string;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=eligibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eligibility.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/eligibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,gCAAgC,CAAC;AAkBxC,6FAA6F;AAC7F,wBAAsB,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM;;;;;;iBAwB/D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;GA4Bb"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { inspectRenewalEvidenceV1 } from "../../client/billing/renewalObservation/evidence-v1.js";
|
|
2
|
+
import { canonicalWitnessJSON, witnessNeed as need, } from "../../shared/renewalWitness.js";
|
|
3
|
+
import { validateWitnessSource } from "./source.js";
|
|
4
|
+
function configureInput(value, configuration, dispatch) {
|
|
5
|
+
const known = value.source.configure.acknowledgement;
|
|
6
|
+
return known === null
|
|
7
|
+
? null
|
|
8
|
+
: {
|
|
9
|
+
configuration,
|
|
10
|
+
actualDispatch: dispatch,
|
|
11
|
+
providerSnapshot: known.receipt.providerSnapshot,
|
|
12
|
+
transport: known.receipt.transport,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Full material and exact source qualify unsigned storage DATA, not provider provenance. */
|
|
16
|
+
export async function validateWitness(ctx, raw) {
|
|
17
|
+
const payload = canonicalWitnessJSON(raw);
|
|
18
|
+
const source = await validateWitnessSource(ctx, payload.value);
|
|
19
|
+
const evidence = await inspectRenewalEvidenceV1({
|
|
20
|
+
version: 1,
|
|
21
|
+
apiVersion: "2026-09-30.endive",
|
|
22
|
+
configuration: source.configuration,
|
|
23
|
+
configureReceipt: configureInput(payload.value, source.configuration, source.dispatch),
|
|
24
|
+
reads: payload.value.reads,
|
|
25
|
+
invoiceContext: payload.value.invoiceContext,
|
|
26
|
+
historicalSnapshot: null,
|
|
27
|
+
});
|
|
28
|
+
need(evidence.identity &&
|
|
29
|
+
evidence.currentMaterial.predicate === "current_target_material_match");
|
|
30
|
+
if (payload.value.invoiceContext !== null)
|
|
31
|
+
need(evidence.invoiceEvidence.predicate === "invoice_lines_correlated");
|
|
32
|
+
const { identity } = evidence;
|
|
33
|
+
const fields = {
|
|
34
|
+
version: 1,
|
|
35
|
+
identity: source.identity,
|
|
36
|
+
capturedSubject: payload.value.capturedSubject,
|
|
37
|
+
observedAtMs: payload.value.acquisition.observedAtMs,
|
|
38
|
+
customerAccountId: identity.customerAccountId,
|
|
39
|
+
customerId: identity.customerId,
|
|
40
|
+
livemode: identity.livemode,
|
|
41
|
+
subscriptionId: identity.subscriptionId,
|
|
42
|
+
scheduleId: identity.scheduleId,
|
|
43
|
+
observedItemId: evidence.currentMaterial.observedItemId,
|
|
44
|
+
nativePeriod: evidence.currentMaterial.nativePeriod,
|
|
45
|
+
operationalAuthority: false,
|
|
46
|
+
authenticationEstablished: false,
|
|
47
|
+
publicDeliveryEstablished: false,
|
|
48
|
+
providerQualificationRequired: true,
|
|
49
|
+
};
|
|
50
|
+
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode("renewal-witness:v1\u0000" + payload.json));
|
|
51
|
+
const hex = [...new Uint8Array(digest)]
|
|
52
|
+
.map((n) => n.toString(16).padStart(2, "0"))
|
|
53
|
+
.join("");
|
|
54
|
+
return {
|
|
55
|
+
payload,
|
|
56
|
+
fields,
|
|
57
|
+
payloadBinding: "renewal-witness:v1:sha256:" + hex,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=eligibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eligibility.js","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/eligibility.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EACL,oBAAoB,EACpB,WAAW,IAAI,IAAI,GAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,SAAS,cAAc,CACrB,KAAqB,EACrB,aAAsB,EACtB,QAAiB;IAEjB,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;IACrD,OAAO,KAAK,KAAK,IAAI;QACnB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC;YACE,aAAa;YACb,cAAc,EAAE,QAAQ;YACxB,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,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,UAAU;QAC/B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,cAAc,EAAE,QAAQ,CAAC,eAAe,CAAC,cAAc;QACvD,YAAY,EAAE,QAAQ,CAAC,eAAe,CAAC,YAAY;QACnD,oBAAoB,EAAE,KAAc;QACpC,yBAAyB,EAAE,KAAc;QACzC,yBAAyB,EAAE,KAAc;QACzC,6BAA6B,EAAE,IAAa;KAC7C,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CACvC,SAAS,EACT,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CACpE,CAAC;IACF,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO;QACL,OAAO;QACP,MAAM;QACN,cAAc,EAAE,4BAA4B,GAAG,GAAG;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { MutationCtx, QueryCtx } from "../_generated/server.js";
|
|
2
|
+
import { type WitnessIdentity } from "../../shared/renewalWitness.js";
|
|
3
|
+
type Reader = Pick<QueryCtx, "db">;
|
|
4
|
+
/** Trusted component helper only. A host retention capability and live capture remain required. */
|
|
5
|
+
export declare function retainWitness(ctx: Pick<MutationCtx, "db">, args: {
|
|
6
|
+
identity: WitnessIdentity;
|
|
7
|
+
payloadJSON: string;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
status: "conflict";
|
|
10
|
+
reason: "identity_changed";
|
|
11
|
+
descriptor?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
reason?: undefined;
|
|
14
|
+
status: "retained";
|
|
15
|
+
descriptor: {
|
|
16
|
+
version: 1;
|
|
17
|
+
identity: {
|
|
18
|
+
componentScope: string;
|
|
19
|
+
witnessId: string;
|
|
20
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
21
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
22
|
+
};
|
|
23
|
+
capturedSubject: string;
|
|
24
|
+
observedAtMs: number;
|
|
25
|
+
customerAccountId: string;
|
|
26
|
+
customerId: string;
|
|
27
|
+
livemode: boolean;
|
|
28
|
+
subscriptionId: string;
|
|
29
|
+
scheduleId: string;
|
|
30
|
+
observedItemId: string;
|
|
31
|
+
nativePeriod: Readonly<{
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
}>;
|
|
35
|
+
operationalAuthority: false;
|
|
36
|
+
authenticationEstablished: false;
|
|
37
|
+
publicDeliveryEstablished: false;
|
|
38
|
+
providerQualificationRequired: true;
|
|
39
|
+
payloadBinding: string;
|
|
40
|
+
witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
43
|
+
/** Fresh host read authorization belongs to the caller; this cannot establish public ACK delivery. */
|
|
44
|
+
export declare function readWitness(ctx: Reader, raw: WitnessIdentity): Promise<{
|
|
45
|
+
descriptor: {
|
|
46
|
+
version: 1;
|
|
47
|
+
identity: {
|
|
48
|
+
componentScope: string;
|
|
49
|
+
witnessId: string;
|
|
50
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
51
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
52
|
+
};
|
|
53
|
+
capturedSubject: string;
|
|
54
|
+
observedAtMs: number;
|
|
55
|
+
customerAccountId: string;
|
|
56
|
+
customerId: string;
|
|
57
|
+
livemode: boolean;
|
|
58
|
+
subscriptionId: string;
|
|
59
|
+
scheduleId: string;
|
|
60
|
+
observedItemId: string;
|
|
61
|
+
nativePeriod: Readonly<{
|
|
62
|
+
start: number;
|
|
63
|
+
end: number;
|
|
64
|
+
}>;
|
|
65
|
+
operationalAuthority: false;
|
|
66
|
+
authenticationEstablished: false;
|
|
67
|
+
publicDeliveryEstablished: false;
|
|
68
|
+
providerQualificationRequired: true;
|
|
69
|
+
payloadBinding: string;
|
|
70
|
+
witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
|
|
71
|
+
};
|
|
72
|
+
payloadJSON: string;
|
|
73
|
+
} | null>;
|
|
74
|
+
export {};
|
|
75
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/protocol.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAIxC,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAiDnC,mGAAmG;AACnG,wBAAsB,aAAa,CACjC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAC5B,IAAI,EAAE;IAAE,QAAQ,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;YAc1C,UAAU;YACV,kBAAkB;;;;YAEb,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAe9B;AACD,sGAAsG;AACtG,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAKlE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { getConvexSize } from "convex/values";
|
|
2
|
+
import { sameJSON } from "../renewalOperations/attachValidation.js";
|
|
3
|
+
import { witnessNeed as need, witnessIdentity, } from "../../shared/renewalWitness.js";
|
|
4
|
+
import { normalizedWitnessIdentity } from "./source.js";
|
|
5
|
+
import { validateWitness } from "./eligibility.js";
|
|
6
|
+
async function find(ctx, identity) {
|
|
7
|
+
const rows = await ctx.db
|
|
8
|
+
.query("renewalObservationWitnesses")
|
|
9
|
+
.withIndex("by_componentScope_and_witnessId", (q) => q
|
|
10
|
+
.eq("identity.componentScope", identity.componentScope)
|
|
11
|
+
.eq("identity.witnessId", identity.witnessId))
|
|
12
|
+
.take(2);
|
|
13
|
+
need(rows.length <= 1);
|
|
14
|
+
return rows[0] ?? null;
|
|
15
|
+
}
|
|
16
|
+
function budget(admitted) {
|
|
17
|
+
const { payload, fields, payloadBinding } = admitted;
|
|
18
|
+
need(getConvexSize({
|
|
19
|
+
identity: fields.identity,
|
|
20
|
+
payloadJSON: payload.json,
|
|
21
|
+
payloadBinding,
|
|
22
|
+
}) <= 500000);
|
|
23
|
+
// Reserve the maximum admitted opaque ID length before making any insert.
|
|
24
|
+
need(getConvexSize({
|
|
25
|
+
descriptor: { ...fields, payloadBinding, witnessRowId: "x".repeat(255) },
|
|
26
|
+
payloadJSON: payload.json,
|
|
27
|
+
}) <= 500000);
|
|
28
|
+
}
|
|
29
|
+
async function checked(ctx, row) {
|
|
30
|
+
const admitted = await validateWitness(ctx, row.payloadJSON);
|
|
31
|
+
budget(admitted);
|
|
32
|
+
need(sameJSON(admitted.fields.identity, row.identity) &&
|
|
33
|
+
admitted.payloadBinding === row.payloadBinding);
|
|
34
|
+
return {
|
|
35
|
+
descriptor: {
|
|
36
|
+
...admitted.fields,
|
|
37
|
+
payloadBinding: admitted.payloadBinding,
|
|
38
|
+
witnessRowId: row._id,
|
|
39
|
+
},
|
|
40
|
+
payloadJSON: admitted.payload.json,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Trusted component helper only. A host retention capability and live capture remain required. */
|
|
44
|
+
export async function retainWitness(ctx, args) {
|
|
45
|
+
const identity = normalizedWitnessIdentity(ctx, args.identity);
|
|
46
|
+
const admitted = await validateWitness(ctx, args.payloadJSON);
|
|
47
|
+
need(sameJSON(admitted.fields.identity, identity));
|
|
48
|
+
budget(admitted);
|
|
49
|
+
const existing = await find(ctx, identity);
|
|
50
|
+
if (existing) {
|
|
51
|
+
const original = await checked(ctx, existing);
|
|
52
|
+
if (existing.payloadJSON !== admitted.payload.json ||
|
|
53
|
+
!sameJSON(existing.identity, identity))
|
|
54
|
+
return {
|
|
55
|
+
status: "conflict",
|
|
56
|
+
reason: "identity_changed",
|
|
57
|
+
};
|
|
58
|
+
return { status: "retained", descriptor: original.descriptor };
|
|
59
|
+
}
|
|
60
|
+
const witnessRowId = await ctx.db.insert("renewalObservationWitnesses", {
|
|
61
|
+
identity,
|
|
62
|
+
payloadJSON: admitted.payload.json,
|
|
63
|
+
payloadBinding: admitted.payloadBinding,
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
status: "retained",
|
|
67
|
+
descriptor: {
|
|
68
|
+
...admitted.fields,
|
|
69
|
+
payloadBinding: admitted.payloadBinding,
|
|
70
|
+
witnessRowId,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Fresh host read authorization belongs to the caller; this cannot establish public ACK delivery. */
|
|
75
|
+
export async function readWitness(ctx, raw) {
|
|
76
|
+
const identity = witnessIdentity(raw);
|
|
77
|
+
const row = await find(ctx, identity);
|
|
78
|
+
if (!row || !sameJSON(row.identity, identity))
|
|
79
|
+
return null;
|
|
80
|
+
return checked(ctx, row);
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;A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O,EAAE,MAAM,EAAE,UAAmB,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC1E,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,6BAA6B,EAAE;QACtE,QAAQ;QACR,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;QAClC,cAAc,EAAE,QAAQ,CAAC,cAAc;KACxC,CAAC,CAAC;IACH,OAAO;QACL,MAAM,EAAE,UAAmB;QAC3B,UAAU,EAAE;YACV,GAAG,QAAQ,CAAC,MAAM;YAClB,cAAc,EAAE,QAAQ,CAAC,cAAc;YACvC,YAAY;SACb;KACF,CAAC;AACJ,CAAC;AACD,sGAAsG;AACtG,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,GAAoB;IACjE,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3D,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const identity: import("convex/values").VObject<{
|
|
2
|
+
componentScope: string;
|
|
3
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
4
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
5
|
+
witnessId: string;
|
|
6
|
+
}, {
|
|
7
|
+
componentScope: import("convex/values").VString<string, "required">;
|
|
8
|
+
witnessId: import("convex/values").VString<string, "required">;
|
|
9
|
+
parentOperationId: import("convex/values").VId<import("convex/values").GenericId<"renewalOperations">, "required">;
|
|
10
|
+
operationId: import("convex/values").VId<import("convex/values").GenericId<"renewalOperations">, "required">;
|
|
11
|
+
}, "required", "componentScope" | "operationId" | "parentOperationId" | "witnessId">;
|
|
12
|
+
export declare const descriptor: import("convex/values").VObject<{
|
|
13
|
+
authenticationEstablished: false;
|
|
14
|
+
capturedSubject: string;
|
|
15
|
+
customerAccountId: string;
|
|
16
|
+
customerId: string;
|
|
17
|
+
identity: {
|
|
18
|
+
componentScope: string;
|
|
19
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
20
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
21
|
+
witnessId: string;
|
|
22
|
+
};
|
|
23
|
+
livemode: boolean;
|
|
24
|
+
nativePeriod: {
|
|
25
|
+
end: number;
|
|
26
|
+
start: number;
|
|
27
|
+
};
|
|
28
|
+
observedAtMs: number;
|
|
29
|
+
observedItemId: string;
|
|
30
|
+
operationalAuthority: false;
|
|
31
|
+
payloadBinding: string;
|
|
32
|
+
providerQualificationRequired: true;
|
|
33
|
+
publicDeliveryEstablished: false;
|
|
34
|
+
scheduleId: string;
|
|
35
|
+
subscriptionId: string;
|
|
36
|
+
version: 1;
|
|
37
|
+
witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
|
|
38
|
+
}, {
|
|
39
|
+
version: import("convex/values").VLiteral<1, "required">;
|
|
40
|
+
witnessRowId: import("convex/values").VId<import("convex/values").GenericId<"renewalObservationWitnesses">, "required">;
|
|
41
|
+
identity: import("convex/values").VObject<{
|
|
42
|
+
componentScope: string;
|
|
43
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
44
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
45
|
+
witnessId: string;
|
|
46
|
+
}, {
|
|
47
|
+
componentScope: import("convex/values").VString<string, "required">;
|
|
48
|
+
witnessId: import("convex/values").VString<string, "required">;
|
|
49
|
+
parentOperationId: import("convex/values").VId<import("convex/values").GenericId<"renewalOperations">, "required">;
|
|
50
|
+
operationId: import("convex/values").VId<import("convex/values").GenericId<"renewalOperations">, "required">;
|
|
51
|
+
}, "required", "componentScope" | "operationId" | "parentOperationId" | "witnessId">;
|
|
52
|
+
payloadBinding: import("convex/values").VString<string, "required">;
|
|
53
|
+
capturedSubject: import("convex/values").VString<string, "required">;
|
|
54
|
+
observedAtMs: import("convex/values").VFloat64<number, "required">;
|
|
55
|
+
customerAccountId: import("convex/values").VString<string, "required">;
|
|
56
|
+
customerId: import("convex/values").VString<string, "required">;
|
|
57
|
+
livemode: import("convex/values").VBoolean<boolean, "required">;
|
|
58
|
+
subscriptionId: import("convex/values").VString<string, "required">;
|
|
59
|
+
scheduleId: import("convex/values").VString<string, "required">;
|
|
60
|
+
observedItemId: import("convex/values").VString<string, "required">;
|
|
61
|
+
nativePeriod: import("convex/values").VObject<{
|
|
62
|
+
end: number;
|
|
63
|
+
start: number;
|
|
64
|
+
}, {
|
|
65
|
+
start: import("convex/values").VFloat64<number, "required">;
|
|
66
|
+
end: import("convex/values").VFloat64<number, "required">;
|
|
67
|
+
}, "required", "end" | "start">;
|
|
68
|
+
operationalAuthority: import("convex/values").VLiteral<false, "required">;
|
|
69
|
+
authenticationEstablished: import("convex/values").VLiteral<false, "required">;
|
|
70
|
+
publicDeliveryEstablished: import("convex/values").VLiteral<false, "required">;
|
|
71
|
+
providerQualificationRequired: import("convex/values").VLiteral<true, "required">;
|
|
72
|
+
}, "required", "authenticationEstablished" | "capturedSubject" | "customerAccountId" | "customerId" | "identity" | "identity.componentScope" | "identity.operationId" | "identity.parentOperationId" | "identity.witnessId" | "livemode" | "nativePeriod" | "nativePeriod.end" | "nativePeriod.start" | "observedAtMs" | "observedItemId" | "operationalAuthority" | "payloadBinding" | "providerQualificationRequired" | "publicDeliveryEstablished" | "scheduleId" | "subscriptionId" | "version" | "witnessRowId">;
|
|
73
|
+
export declare const witnessesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
74
|
+
identity: {
|
|
75
|
+
componentScope: string;
|
|
76
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
77
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
78
|
+
witnessId: string;
|
|
79
|
+
};
|
|
80
|
+
payloadBinding: string;
|
|
81
|
+
payloadJSON: string;
|
|
82
|
+
}, {
|
|
83
|
+
identity: import("convex/values").VObject<{
|
|
84
|
+
componentScope: string;
|
|
85
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
86
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
87
|
+
witnessId: string;
|
|
88
|
+
}, {
|
|
89
|
+
componentScope: import("convex/values").VString<string, "required">;
|
|
90
|
+
witnessId: import("convex/values").VString<string, "required">;
|
|
91
|
+
parentOperationId: import("convex/values").VId<import("convex/values").GenericId<"renewalOperations">, "required">;
|
|
92
|
+
operationId: import("convex/values").VId<import("convex/values").GenericId<"renewalOperations">, "required">;
|
|
93
|
+
}, "required", "componentScope" | "operationId" | "parentOperationId" | "witnessId">;
|
|
94
|
+
payloadJSON: import("convex/values").VString<string, "required">;
|
|
95
|
+
payloadBinding: import("convex/values").VString<string, "required">;
|
|
96
|
+
}, "required", "identity" | "identity.componentScope" | "identity.operationId" | "identity.parentOperationId" | "identity.witnessId" | "payloadBinding" | "payloadJSON">, {
|
|
97
|
+
by_componentScope_and_witnessId: ["identity.componentScope", "identity.witnessId", "_creationTime"];
|
|
98
|
+
}, {}, {}>;
|
|
99
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/schema.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;;;;;;;;;oFAKnB,CAAC;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qfAkBrB,CAAC;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;UAOzB,CAAC"}
|