@fantastic.dev/better-stripe 0.111.0 → 0.113.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 +564 -0
- package/dist/client/billing/renewalAttach/internal/observation/freshActor.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshActor.js +103 -21
- package/dist/client/billing/renewalAttach/internal/observation/freshActor.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.d.ts +18 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.js +54 -1
- package/dist/client/billing/renewalAttach/internal/observation/freshTransport.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/invocation.d.ts +4 -0
- package/dist/client/billing/renewalAttach/internal/observation/invocation.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/invocation.js +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/invocation.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.d.ts +4 -0
- package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.js +6 -1
- package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.d.ts +38 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.js +172 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessData.d.ts +135 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessData.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessData.js +143 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessData.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.d.ts +85 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.js +121 -0
- package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.d.ts +44 -0
- package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.js +4 -0
- package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/producer/configureJournalWork.d.ts +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/configureLineage.d.ts +21 -21
- package/dist/client/billing/renewalAttach/internal/producer/journalWorkFactory.d.ts +3 -3
- package/dist/client/billing/renewalAttach/internal/producer/operationFactory.d.ts +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +32 -32
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +16 -16
- package/dist/component/_generated/api.d.ts +24 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +94 -10
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
- package/dist/component/balanceFunding/queries.d.ts +1 -1
- package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
- package/dist/component/renewalWitnesses/mutations.d.ts +45 -0
- package/dist/component/renewalWitnesses/mutations.d.ts.map +1 -0
- package/dist/component/renewalWitnesses/mutations.js +14 -0
- package/dist/component/renewalWitnesses/mutations.js.map +1 -0
- package/dist/component/renewalWitnesses/queries.d.ts +39 -0
- package/dist/component/renewalWitnesses/queries.d.ts.map +1 -0
- package/dist/component/renewalWitnesses/queries.js +11 -0
- package/dist/component/renewalWitnesses/queries.js.map +1 -0
- package/dist/component/usage/allowance.fixtures.d.ts +16 -16
- package/docs/renewal-example-authorization.md +74 -0
- package/docs/renewal-witness-protocol.md +61 -10
- package/package.json +1 -1
- package/src/client/billing/renewalAttach/internal/observation/freshActor.ts +142 -19
- package/src/client/billing/renewalAttach/internal/observation/freshTransport.ts +90 -1
- package/src/client/billing/renewalAttach/internal/observation/invocation.ts +2 -0
- package/src/client/billing/renewalAttach/internal/observation/readerAuthorization.ts +6 -1
- package/src/client/billing/renewalAttach/internal/observation/witnessAcquisition.integration.test.ts +348 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessActor.integration.test.ts +204 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessAuthorization.ts +239 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessCapabilities.integration.test.ts +231 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessData.ts +189 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessHistorical.integration.test.ts +98 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessImmutable.integration.test.ts +78 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessInvoice.integration.test.ts +85 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessLifecycle.integration.test.ts +264 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessOperation.ts +205 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessProfile.integration.test.ts +93 -0
- package/src/client/billing/renewalAttach/internal/observation/witnessRPCControls.integration.test.ts +256 -0
- package/src/client/billing/renewalAttach/internal/operations/witnessProfiles.ts +58 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/invoiceObservation.ts +3 -1
- package/src/client/billing/renewalAttach/internal/test-fixtures/producerConfigureAdmission.ts +8 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialOperation.ts +28 -11
- package/src/client/billing/renewalAttach/internal/test-fixtures/witnessHistory.ts +70 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/witnessObservation.ts +353 -0
- package/src/component/_generated/api.ts +24 -0
- package/src/component/_generated/component.ts +98 -10
- package/src/component/renewalWitnesses/mutations.ts +17 -0
- package/src/component/renewalWitnesses/queries.ts +11 -0
- package/src/component/renewalWitnesses/routes.test.ts +154 -0
|
@@ -2,6 +2,14 @@ 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
|
+
} | {
|
|
5
13
|
operation: {
|
|
6
14
|
accountId: string;
|
|
7
15
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -12,14 +20,6 @@ export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prep
|
|
|
12
20
|
} | {
|
|
13
21
|
enabled: boolean;
|
|
14
22
|
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;
|
|
183
184
|
accountId: string;
|
|
184
185
|
scopeKey: string;
|
|
185
186
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
186
187
|
version: number;
|
|
187
|
-
retryable?: undefined;
|
|
188
188
|
status?: undefined;
|
|
189
189
|
state: "canceled" | "failed" | "pending" | "running" | "succeeded" | "unknown";
|
|
190
190
|
cancelRequested: boolean;
|
|
@@ -9,9 +9,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
|
|
|
9
9
|
orgId: string | undefined;
|
|
10
10
|
ownershipStatus: "ambiguous";
|
|
11
11
|
} | {
|
|
12
|
-
registrationId?: undefined;
|
|
13
12
|
userId?: undefined;
|
|
14
13
|
orgId?: undefined;
|
|
14
|
+
registrationId?: undefined;
|
|
15
15
|
ownershipStatus: "ambiguous";
|
|
16
16
|
} | {
|
|
17
17
|
registrationId: import("convex/values").GenericId<"financialOwnership">;
|
|
@@ -19,9 +19,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
|
|
|
19
19
|
orgId: string | undefined;
|
|
20
20
|
ownershipStatus: "unknown";
|
|
21
21
|
} | {
|
|
22
|
-
registrationId?: undefined;
|
|
23
22
|
userId?: undefined;
|
|
24
23
|
orgId?: undefined;
|
|
24
|
+
registrationId?: undefined;
|
|
25
25
|
ownershipStatus: "unknown";
|
|
26
26
|
} | {
|
|
27
27
|
registrationId: import("convex/values").GenericId<"financialOwnership">;
|
|
@@ -29,9 +29,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
|
|
|
29
29
|
orgId: string | undefined;
|
|
30
30
|
ownershipStatus: "contradictory";
|
|
31
31
|
} | {
|
|
32
|
-
registrationId?: undefined;
|
|
33
32
|
userId?: undefined;
|
|
34
33
|
orgId?: undefined;
|
|
34
|
+
registrationId?: undefined;
|
|
35
35
|
ownershipStatus: "contradictory";
|
|
36
36
|
} | {
|
|
37
37
|
registrationId: import("convex/values").GenericId<"financialOwnership">;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Trusted host component API. Host authorization and live capture remain separate requirements. */
|
|
2
|
+
export declare const retainAuthorizedWitness: import("convex/server").RegisteredMutation<"public", {
|
|
3
|
+
identity: {
|
|
4
|
+
componentScope: string;
|
|
5
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
6
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
7
|
+
witnessId: string;
|
|
8
|
+
};
|
|
9
|
+
payloadJSON: string;
|
|
10
|
+
}, Promise<{
|
|
11
|
+
status: "conflict";
|
|
12
|
+
reason: "identity_changed";
|
|
13
|
+
descriptor?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
reason?: undefined;
|
|
16
|
+
status: "retained";
|
|
17
|
+
descriptor: {
|
|
18
|
+
version: 1;
|
|
19
|
+
identity: {
|
|
20
|
+
componentScope: string;
|
|
21
|
+
witnessId: string;
|
|
22
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
23
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
24
|
+
};
|
|
25
|
+
capturedSubject: string;
|
|
26
|
+
observedAtMs: number;
|
|
27
|
+
customerAccountId: string;
|
|
28
|
+
customerId: string;
|
|
29
|
+
livemode: boolean;
|
|
30
|
+
subscriptionId: string;
|
|
31
|
+
scheduleId: string;
|
|
32
|
+
observedItemId: string;
|
|
33
|
+
nativePeriod: Readonly<{
|
|
34
|
+
start: number;
|
|
35
|
+
end: number;
|
|
36
|
+
}>;
|
|
37
|
+
operationalAuthority: false;
|
|
38
|
+
authenticationEstablished: false;
|
|
39
|
+
publicDeliveryEstablished: false;
|
|
40
|
+
providerQualificationRequired: true;
|
|
41
|
+
payloadBinding: string;
|
|
42
|
+
witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
|
|
43
|
+
};
|
|
44
|
+
}>>;
|
|
45
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/mutations.ts"],"names":[],"mappings":"AAKA,oGAAoG;AACpG,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUlC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { mutation } from "../_generated/server.js";
|
|
3
|
+
import { descriptor, identity } from "./schema.js";
|
|
4
|
+
import { retainWitness } from "./protocol.js";
|
|
5
|
+
/** Trusted host component API. Host authorization and live capture remain separate requirements. */
|
|
6
|
+
export const retainAuthorizedWitness = mutation({
|
|
7
|
+
args: { identity, payloadJSON: v.string() },
|
|
8
|
+
returns: v.union(v.object({ status: v.literal("retained"), descriptor }), v.object({
|
|
9
|
+
status: v.literal("conflict"),
|
|
10
|
+
reason: v.literal("identity_changed"),
|
|
11
|
+
})),
|
|
12
|
+
handler: retainWitness,
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,oGAAoG;AACpG,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC9C,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CACd,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC,EACvD,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC7B,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;KACtC,CAAC,CACH;IACD,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Trusted host component API. A fresh host read grant must precede any external release. */
|
|
2
|
+
export declare const readAuthorizedWitness: import("convex/server").RegisteredQuery<"public", {
|
|
3
|
+
identity: {
|
|
4
|
+
componentScope: string;
|
|
5
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
6
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
7
|
+
witnessId: string;
|
|
8
|
+
};
|
|
9
|
+
}, Promise<{
|
|
10
|
+
descriptor: {
|
|
11
|
+
version: 1;
|
|
12
|
+
identity: {
|
|
13
|
+
componentScope: string;
|
|
14
|
+
witnessId: string;
|
|
15
|
+
parentOperationId: import("convex/values").GenericId<"renewalOperations">;
|
|
16
|
+
operationId: import("convex/values").GenericId<"renewalOperations">;
|
|
17
|
+
};
|
|
18
|
+
capturedSubject: string;
|
|
19
|
+
observedAtMs: number;
|
|
20
|
+
customerAccountId: string;
|
|
21
|
+
customerId: string;
|
|
22
|
+
livemode: boolean;
|
|
23
|
+
subscriptionId: string;
|
|
24
|
+
scheduleId: string;
|
|
25
|
+
observedItemId: string;
|
|
26
|
+
nativePeriod: Readonly<{
|
|
27
|
+
start: number;
|
|
28
|
+
end: number;
|
|
29
|
+
}>;
|
|
30
|
+
operationalAuthority: false;
|
|
31
|
+
authenticationEstablished: false;
|
|
32
|
+
publicDeliveryEstablished: false;
|
|
33
|
+
providerQualificationRequired: true;
|
|
34
|
+
payloadBinding: string;
|
|
35
|
+
witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
|
|
36
|
+
};
|
|
37
|
+
payloadJSON: string;
|
|
38
|
+
} | null>>;
|
|
39
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/queries.ts"],"names":[],"mappings":"AAKA,6FAA6F;AAC7F,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIhC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { query } from "../_generated/server.js";
|
|
3
|
+
import { descriptor, identity } from "./schema.js";
|
|
4
|
+
import { readWitness } from "./protocol.js";
|
|
5
|
+
/** Trusted host component API. A fresh host read grant must precede any external release. */
|
|
6
|
+
export const readAuthorizedWitness = query({
|
|
7
|
+
args: { identity },
|
|
8
|
+
returns: v.union(v.null(), v.object({ descriptor, payloadJSON: v.string() })),
|
|
9
|
+
handler: (ctx, args) => readWitness(ctx, args.identity),
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,6FAA6F;AAC7F,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;IACzC,IAAI,EAAE,EAAE,QAAQ,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7E,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC;CACxD,CAAC,CAAC"}
|
|
@@ -2658,6 +2658,14 @@ export declare function setupAllowance(): Promise<{
|
|
|
2658
2658
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
2659
2659
|
requestKey: string;
|
|
2660
2660
|
result?: {
|
|
2661
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2662
|
+
retryable: false;
|
|
2663
|
+
status: "conflict";
|
|
2664
|
+
} | {
|
|
2665
|
+
reason: "policy_invalid";
|
|
2666
|
+
retryable: false;
|
|
2667
|
+
status: "rejected";
|
|
2668
|
+
} | {
|
|
2661
2669
|
operation: {
|
|
2662
2670
|
accountId: string;
|
|
2663
2671
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2668,14 +2676,6 @@ export declare function setupAllowance(): Promise<{
|
|
|
2668
2676
|
} | {
|
|
2669
2677
|
enabled: boolean;
|
|
2670
2678
|
status: "unchanged";
|
|
2671
|
-
} | {
|
|
2672
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2673
|
-
retryable: false;
|
|
2674
|
-
status: "conflict";
|
|
2675
|
-
} | {
|
|
2676
|
-
reason: "policy_invalid";
|
|
2677
|
-
retryable: false;
|
|
2678
|
-
status: "rejected";
|
|
2679
2679
|
} | {
|
|
2680
2680
|
reason: "provider_pending";
|
|
2681
2681
|
retryable: true;
|
|
@@ -2686,6 +2686,14 @@ export declare function setupAllowance(): Promise<{
|
|
|
2686
2686
|
payload: import("convex/values").VString<string, "required">;
|
|
2687
2687
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
2688
2688
|
result: import("convex/values").VUnion<{
|
|
2689
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2690
|
+
retryable: false;
|
|
2691
|
+
status: "conflict";
|
|
2692
|
+
} | {
|
|
2693
|
+
reason: "policy_invalid";
|
|
2694
|
+
retryable: false;
|
|
2695
|
+
status: "rejected";
|
|
2696
|
+
} | {
|
|
2689
2697
|
operation: {
|
|
2690
2698
|
accountId: string;
|
|
2691
2699
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2696,14 +2704,6 @@ export declare function setupAllowance(): Promise<{
|
|
|
2696
2704
|
} | {
|
|
2697
2705
|
enabled: boolean;
|
|
2698
2706
|
status: "unchanged";
|
|
2699
|
-
} | {
|
|
2700
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2701
|
-
retryable: false;
|
|
2702
|
-
status: "conflict";
|
|
2703
|
-
} | {
|
|
2704
|
-
reason: "policy_invalid";
|
|
2705
|
-
retryable: false;
|
|
2706
|
-
status: "rejected";
|
|
2707
2707
|
} | {
|
|
2708
2708
|
reason: "provider_pending";
|
|
2709
2709
|
retryable: true;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Renewal authorization in the example app
|
|
2
|
+
|
|
3
|
+
The existing `example/` app is the host for renewal component integration tests.
|
|
4
|
+
Its renewal authorization queries require `ctx.auth.getUserIdentity()` and reuse
|
|
5
|
+
the authenticated billing-history actor lookup. Exactly one buyer or customer
|
|
6
|
+
must map to the identity's `tokenIdentifier`. Missing identity, ambiguous mappings
|
|
7
|
+
and other persona roles reject.
|
|
8
|
+
|
|
9
|
+
The example UI still uses unauthenticated demo personas. Choosing a persona does
|
|
10
|
+
not authenticate a request or grant renewal permission. These queries demonstrate
|
|
11
|
+
an opt-in authenticated host boundary; they do not configure a production identity
|
|
12
|
+
provider or implement a consent flow.
|
|
13
|
+
|
|
14
|
+
## Fixed query capabilities
|
|
15
|
+
|
|
16
|
+
All four functions are internal queries in
|
|
17
|
+
`example/convex/renewalAuthorization/queries.ts`:
|
|
18
|
+
|
|
19
|
+
| Query | Permission and exact scope |
|
|
20
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
21
|
+
| `observe` | Installation, attachment and configure operation IDs, plus the server-owned platform/account/mode, customer-account, subscription and schedule scope. |
|
|
22
|
+
| `invoices` | An independent invoice permission for the same operations, complete provider scope including Customer ID, and the exact original/current invoice pair. |
|
|
23
|
+
| `retainWitness` | An independent retention permission for the complete witness identity, provider scope, configure request binding, observed item and native period. |
|
|
24
|
+
| `readWitness` | An independent read permission for that immutable scope and the exact stored witness row and payload digest. |
|
|
25
|
+
|
|
26
|
+
The query arguments contain operation/resource selectors, never a caller-chosen
|
|
27
|
+
user ID or authorization snapshot. The authenticated subject is resolved by the
|
|
28
|
+
host. Base observation does not imply invoice, retention or read permission.
|
|
29
|
+
Retention does not imply later read permission.
|
|
30
|
+
|
|
31
|
+
The returned snapshots match the SDK's fixed query contracts. Base observation
|
|
32
|
+
omits Customer ID, while invoice and witness scopes include it. Authorization
|
|
33
|
+
IDs, revisions and expiry timestamps come from the retained permission records
|
|
34
|
+
and are returned unchanged. A query never creates a sliding expiry.
|
|
35
|
+
|
|
36
|
+
## Trusted permission records
|
|
37
|
+
|
|
38
|
+
`renewalOperationGrants` and `renewalWitnessGrants` are indexed host-owned tables.
|
|
39
|
+
Their indexes include the authenticated user and exact operation or witness
|
|
40
|
+
selection. The query reads at most two matching rows. Duplicate detection occurs
|
|
41
|
+
before expiry or revocation checks, so a revoked duplicate cannot hide an
|
|
42
|
+
ambiguous permission record.
|
|
43
|
+
|
|
44
|
+
Each record also retains the original `tokenIdentifier`. Remapping a user row to
|
|
45
|
+
another subject does not transfer an existing grant. Each capability has its own
|
|
46
|
+
authorization ID, positive safe-integer revision, safe-integer expiry and
|
|
47
|
+
revocation flag. Missing, revoked, expired or malformed permission refuses.
|
|
48
|
+
Witness-read permission additionally binds the exact row ID and versioned
|
|
49
|
+
SHA-256 payload binding.
|
|
50
|
+
|
|
51
|
+
This example increment supplies no public grant-issuing endpoint. The controlled
|
|
52
|
+
tests insert permission rows through trusted `convex-test` setup. Such fixtures
|
|
53
|
+
exercise query behavior; they do not prove real consent or production grant
|
|
54
|
+
issuance. An actual application must issue and revoke grants under its own
|
|
55
|
+
authenticated authorization policy.
|
|
56
|
+
|
|
57
|
+
## SDK and component integration
|
|
58
|
+
|
|
59
|
+
The SDK reauthorizes through the fixed query and compares complete snapshots.
|
|
60
|
+
A single query cannot detect a revision change that happens later. The example
|
|
61
|
+
integration tests change the revision or provider scope between actual query
|
|
62
|
+
calls and verify that the SDK refuses the changed authorization.
|
|
63
|
+
|
|
64
|
+
The controlled round trips use the example schema and registered BetterStripe
|
|
65
|
+
component, actual example authorization queries, maintained private SDK capture
|
|
66
|
+
and historical-read consumers, complete invoice context and optional configure
|
|
67
|
+
acknowledgement. They verify separate retention/read permission and full stored
|
|
68
|
+
witness identity. Provider responses and grant issuance in these tests are
|
|
69
|
+
controlled fixtures.
|
|
70
|
+
|
|
71
|
+
Production SDK profiles remain empty. Ordinary tests establish neither serving
|
|
72
|
+
deployment compatibility nor provider qualification, payment, entitlement,
|
|
73
|
+
public delivery or Dojo adoption. Native/backend and provider testing require
|
|
74
|
+
their separately approved windows and use this same example app.
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# Immutable renewal witness protocol
|
|
2
2
|
|
|
3
|
-
This component protocol stores complete unsigned renewal snapshot DATA.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
This component protocol stores complete unsigned renewal snapshot DATA. Its
|
|
4
|
+
trusted host component routes retain and read immutable witnesses through strict
|
|
5
|
+
argument and return validators. Host authentication and authorization must precede
|
|
6
|
+
component calls; storage DATA does not supply either permission.
|
|
7
|
+
|
|
8
|
+
Private source wrappers connect the protocol to a fresh observation invocation.
|
|
9
|
+
Their production capture and read profiles remain frozen and EMPTY. Genuine
|
|
10
|
+
generated references, qualified host bindings, deployed compatibility and provider
|
|
11
|
+
qualification remain required before activation. These private wrappers are not
|
|
12
|
+
public SDK entrypoints.
|
|
9
13
|
|
|
10
14
|
## Payload and source checks
|
|
11
15
|
|
|
@@ -65,6 +69,34 @@ transaction concurrency provides the first-wins behavior across calls.
|
|
|
65
69
|
|
|
66
70
|
## Retention and historical meaning
|
|
67
71
|
|
|
72
|
+
The private capture wrapper uses the actual fresh Action, selected SDK and original
|
|
73
|
+
30-second observation lifetime. It accepts the operation pair and one fixed
|
|
74
|
+
witness identity, acquires complete current reads, and requires
|
|
75
|
+
`current_target_material_match`. A selected invoice profile must acquire its full
|
|
76
|
+
context and establish complete paired correlation. The existing base and invoice
|
|
77
|
+
wrappers retain their own outputs and provider GET bounds.
|
|
78
|
+
|
|
79
|
+
The original transport privately registers one acquisition cell per invocation
|
|
80
|
+
after actual SDK selection. It records only its settled original GET bodies and
|
|
81
|
+
complete fenced invoice context. Retention consumes that acquisition once; it
|
|
82
|
+
accepts no supplied reads, invoice context or guard callback. A fresh invocation,
|
|
83
|
+
selected SDK or copied observation DATA alone cannot create this receipt. Partial
|
|
84
|
+
reads and a second transport under the same invocation refuse.
|
|
85
|
+
|
|
86
|
+
A separate fixed host retention capability binds installation, current subject,
|
|
87
|
+
operation pair, Customer/account/mode, schedule/subscription, complete C7 request
|
|
88
|
+
binding, successor item and native period. Invoice permission does not imply
|
|
89
|
+
retention permission. The wrapper awaits the original native mutation Promise,
|
|
90
|
+
checks the complete descriptor, reads back the exact full payload, then rechecks
|
|
91
|
+
the base, applicable invoice and retention grants before returning retention DATA.
|
|
92
|
+
Public `.then` substitutions and copied replies cannot replace the original RPC
|
|
93
|
+
settlement. Pending or rejected replies do not become acknowledgements. The wrapper
|
|
94
|
+
does not retry a lost reply or choose another witness identity.
|
|
95
|
+
|
|
96
|
+
Acquisition metadata measures the same fresh lifetime used for those reads. It
|
|
97
|
+
does not reuse the old write Owner or restart a deadline. Its wall and monotonic
|
|
98
|
+
durations remain unsigned host observation metadata.
|
|
99
|
+
|
|
68
100
|
A successful transaction returns a row descriptor and full payload binding. It
|
|
69
101
|
does not prove that an external caller received that result. A lost response can
|
|
70
102
|
leave a durable row with no returned public acknowledgement. An explicit later
|
|
@@ -82,7 +114,26 @@ not revive a write Owner, manufacture a native past observation, prove atomic
|
|
|
82
114
|
acquisition or establish exclusive causality. Fetching an old invoice later is
|
|
83
115
|
not a substitute for the complete active snapshot.
|
|
84
116
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
A later fresh invocation obtains a distinct host read grant before loading the
|
|
118
|
+
complete stored witness. The grant binds its full scope, row identity and payload
|
|
119
|
+
digest and is rechecked before release. A separately authorized later subject can
|
|
120
|
+
read without replacing the immutable captured subject. Source/material/digest
|
|
121
|
+
checks and the current immutable C7 context still apply.
|
|
122
|
+
|
|
123
|
+
Current and lifecycle analysis use the later invocation's current C9 context.
|
|
124
|
+
Historical material analysis uses the witness's own stored C7 and nullable C9
|
|
125
|
+
context. A C9 retained later is not injected into a captured-null witness. This
|
|
126
|
+
keeps historical material independent of current settings, terminal status or
|
|
127
|
+
invoice-read availability while preserving the existing seven-field evidence
|
|
128
|
+
input and twelve-field result. The stored full invoice context can establish
|
|
129
|
+
historical material even when the later invocation has no invoice-read capability.
|
|
130
|
+
If live acquisition fails before intent identity can be reconstructed, the read
|
|
131
|
+
wrapper preserves the already validated immutable C7 identity. Current and
|
|
132
|
+
lifecycle evidence remain unknown; stored historical material does not replace
|
|
133
|
+
those axes.
|
|
134
|
+
|
|
135
|
+
The controlled tests exercise actual registered component transactions, complete
|
|
136
|
+
journal records and private Action/SDK capture and readback. Genuine route
|
|
137
|
+
generation, deployment, native/provider qualification, complete integration and
|
|
138
|
+
release acceptance and Dojo adoption remain separate requirements. Existing
|
|
139
|
+
execution holds remain in force.
|
package/package.json
CHANGED