@pome-sh/checks 0.1.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 +17 -0
- package/README.md +88 -0
- package/dist/_types/sdk/check-discrimination.d.ts +7 -0
- package/dist/_types/sdk/check-state-path.d.ts +71 -0
- package/dist/_types/sdk/checks.d.ts +93 -0
- package/dist/_types/sdk/db.d.ts +44 -0
- package/dist/_types/sdk/failure-injection-rules.d.ts +32 -0
- package/dist/_types/twin-github/src/check-kind.d.ts +3 -0
- package/dist/_types/twin-github/src/check-state.d.ts +77 -0
- package/dist/_types/twin-github/src/checks.d.ts +50 -0
- package/dist/_types/twin-github/src/seed.d.ts +92 -0
- package/dist/_types/twin-github/src/types.d.ts +244 -0
- package/dist/_types/twin-gmail/src/check-kind.d.ts +3 -0
- package/dist/_types/twin-gmail/src/check-state.d.ts +138 -0
- package/dist/_types/twin-gmail/src/checks.d.ts +19 -0
- package/dist/_types/twin-gmail/src/faults.d.ts +21 -0
- package/dist/_types/twin-gmail/src/seed.d.ts +247 -0
- package/dist/_types/twin-gmail/src/types.d.ts +150 -0
- package/dist/_types/twin-linear/src/check-kind.d.ts +3 -0
- package/dist/_types/twin-linear/src/check-state.d.ts +123 -0
- package/dist/_types/twin-linear/src/checks.d.ts +29 -0
- package/dist/_types/twin-linear/src/seed.d.ts +166 -0
- package/dist/_types/twin-linear/src/types.d.ts +366 -0
- package/dist/_types/twin-slack/src/check-kind.d.ts +3 -0
- package/dist/_types/twin-slack/src/check-state.d.ts +107 -0
- package/dist/_types/twin-slack/src/checks.d.ts +14 -0
- package/dist/_types/twin-slack/src/seed.d.ts +62 -0
- package/dist/_types/twin-slack/src/types.d.ts +182 -0
- package/dist/_types/twin-stripe/src/check-kind.d.ts +3 -0
- package/dist/_types/twin-stripe/src/check-state.d.ts +107 -0
- package/dist/_types/twin-stripe/src/checks.d.ts +22 -0
- package/dist/_types/twin-stripe/src/seed.d.ts +213 -0
- package/dist/_types/twin-stripe/src/types.d.ts +252 -0
- package/dist/_types/wire/index.d.ts +23 -0
- package/dist/_types/wire/otel/event-schema.d.ts +424 -0
- package/dist/_types/wire/otel/index.d.ts +25 -0
- package/dist/_types/wire/otel/legacy-shim.d.ts +105 -0
- package/dist/_types/wire/otel/map-span.d.ts +64 -0
- package/dist/_types/wire/otel/nano.d.ts +26 -0
- package/dist/_types/wire/otel/project.d.ts +42 -0
- package/dist/_types/wire/otel/semconv.d.ts +57 -0
- package/dist/_types/wire/otel/span-event.d.ts +198 -0
- package/dist/_types/wire/recorder-events.d.ts +526 -0
- package/dist/_types/wire/redaction.d.ts +2 -0
- package/dist/chunk-4WXX5VPA.js +238 -0
- package/dist/chunk-5SJ4PVO5.js +981 -0
- package/dist/chunk-GYFGMULG.js +1138 -0
- package/dist/chunk-IVENH4KX.js +814 -0
- package/dist/chunk-NORTPYDQ.js +1015 -0
- package/dist/chunk-SJ6SVRAA.js +432 -0
- package/dist/chunk-ZXE6LAM3.js +1 -0
- package/dist/dsl.d.ts +11 -0
- package/dist/dsl.js +2 -0
- package/dist/github.d.ts +2 -0
- package/dist/github.js +2 -0
- package/dist/gmail.d.ts +2 -0
- package/dist/gmail.js +2 -0
- package/dist/index.d.ts +163 -0
- package/dist/index.js +24 -0
- package/dist/linear.d.ts +2 -0
- package/dist/linear.js +2 -0
- package/dist/slack.d.ts +2 -0
- package/dist/slack.js +2 -0
- package/dist/stripe.d.ts +2 -0
- package/dist/stripe.js +2 -0
- package/package.json +93 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { TwinDatabase } from "../../sdk/db.js";
|
|
2
|
+
export type { RecorderEvent } from "../../wire/index.js";
|
|
3
|
+
export type SlackTwinDatabase = TwinDatabase;
|
|
4
|
+
export type SeedTeam = {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
domain?: string;
|
|
8
|
+
};
|
|
9
|
+
export type SeedUser = {
|
|
10
|
+
id?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
real_name?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
is_bot?: boolean;
|
|
15
|
+
is_admin?: boolean;
|
|
16
|
+
tz?: string;
|
|
17
|
+
profile?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
export type SeedReaction = {
|
|
20
|
+
name: string;
|
|
21
|
+
user: string;
|
|
22
|
+
};
|
|
23
|
+
export type SeedMessage = {
|
|
24
|
+
ts?: string;
|
|
25
|
+
user: string;
|
|
26
|
+
text: string;
|
|
27
|
+
thread_ts?: string;
|
|
28
|
+
reactions?: SeedReaction[];
|
|
29
|
+
};
|
|
30
|
+
export type SeedChannel = {
|
|
31
|
+
id?: string;
|
|
32
|
+
name: string;
|
|
33
|
+
is_private?: boolean;
|
|
34
|
+
topic?: string;
|
|
35
|
+
purpose?: string;
|
|
36
|
+
creator?: string;
|
|
37
|
+
members?: string[];
|
|
38
|
+
messages?: SeedMessage[];
|
|
39
|
+
};
|
|
40
|
+
export type SeedEmoji = {
|
|
41
|
+
name: string;
|
|
42
|
+
/** Absolute image URL. Ignored when `alias` is set. */
|
|
43
|
+
url?: string;
|
|
44
|
+
/** Alias target name → stored as `alias:<name>`. */
|
|
45
|
+
alias?: string;
|
|
46
|
+
};
|
|
47
|
+
export type SlackStateSeed = {
|
|
48
|
+
team?: SeedTeam;
|
|
49
|
+
users?: SeedUser[];
|
|
50
|
+
channels?: SeedChannel[];
|
|
51
|
+
emoji?: SeedEmoji[];
|
|
52
|
+
};
|
|
53
|
+
export type WorkspaceRow = {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
domain: string;
|
|
57
|
+
url: string;
|
|
58
|
+
enterprise_id: string | null;
|
|
59
|
+
created_at: string;
|
|
60
|
+
entity_counter: number;
|
|
61
|
+
};
|
|
62
|
+
export type UserRow = {
|
|
63
|
+
id: string;
|
|
64
|
+
team_id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
real_name: string;
|
|
67
|
+
display_name: string;
|
|
68
|
+
email: string | null;
|
|
69
|
+
is_bot: 0 | 1;
|
|
70
|
+
is_admin: 0 | 1;
|
|
71
|
+
deleted: 0 | 1;
|
|
72
|
+
tz: string;
|
|
73
|
+
profile_json: string;
|
|
74
|
+
created_at: string;
|
|
75
|
+
updated_at: string;
|
|
76
|
+
};
|
|
77
|
+
export type ChannelRow = {
|
|
78
|
+
id: string;
|
|
79
|
+
team_id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
is_channel: 0 | 1;
|
|
82
|
+
is_group: 0 | 1;
|
|
83
|
+
is_im: 0 | 1;
|
|
84
|
+
is_mpim: 0 | 1;
|
|
85
|
+
is_private: 0 | 1;
|
|
86
|
+
is_archived: 0 | 1;
|
|
87
|
+
topic: string;
|
|
88
|
+
purpose: string;
|
|
89
|
+
creator: string;
|
|
90
|
+
created_at: string;
|
|
91
|
+
ts_counter: number;
|
|
92
|
+
dm_signature: string | null;
|
|
93
|
+
};
|
|
94
|
+
export type ChannelMemberRow = {
|
|
95
|
+
channel_id: string;
|
|
96
|
+
user_id: string;
|
|
97
|
+
joined_at: string;
|
|
98
|
+
last_read: string;
|
|
99
|
+
};
|
|
100
|
+
export type MessageRow = {
|
|
101
|
+
channel_id: string;
|
|
102
|
+
ts: string;
|
|
103
|
+
user_id: string;
|
|
104
|
+
text: string;
|
|
105
|
+
subtype: string | null;
|
|
106
|
+
thread_ts: string | null;
|
|
107
|
+
reply_count: number;
|
|
108
|
+
reply_users_count: number;
|
|
109
|
+
latest_reply: string | null;
|
|
110
|
+
edited_user_id: string | null;
|
|
111
|
+
edited_ts: string | null;
|
|
112
|
+
blocks_json: string;
|
|
113
|
+
attachments_json: string;
|
|
114
|
+
bot_id: string | null;
|
|
115
|
+
app_id: string | null;
|
|
116
|
+
username: string | null;
|
|
117
|
+
icon_url: string | null;
|
|
118
|
+
icon_emoji: string | null;
|
|
119
|
+
};
|
|
120
|
+
export type ReactionRow = {
|
|
121
|
+
channel_id: string;
|
|
122
|
+
message_ts: string;
|
|
123
|
+
name: string;
|
|
124
|
+
user_id: string;
|
|
125
|
+
added_at: string;
|
|
126
|
+
};
|
|
127
|
+
export type PinRow = {
|
|
128
|
+
channel_id: string;
|
|
129
|
+
message_ts: string;
|
|
130
|
+
pinned_by: string;
|
|
131
|
+
pinned_at: string;
|
|
132
|
+
};
|
|
133
|
+
export type FileRow = {
|
|
134
|
+
id: string;
|
|
135
|
+
team_id: string;
|
|
136
|
+
user_id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
title: string;
|
|
139
|
+
mimetype: string;
|
|
140
|
+
filetype: string;
|
|
141
|
+
size: number;
|
|
142
|
+
url_private: string;
|
|
143
|
+
channels_json: string;
|
|
144
|
+
deleted: 0 | 1;
|
|
145
|
+
content: string | null;
|
|
146
|
+
created_at: string;
|
|
147
|
+
};
|
|
148
|
+
export type BookmarkRow = {
|
|
149
|
+
id: string;
|
|
150
|
+
channel_id: string;
|
|
151
|
+
title: string;
|
|
152
|
+
link: string;
|
|
153
|
+
emoji: string | null;
|
|
154
|
+
type: string;
|
|
155
|
+
created_by: string;
|
|
156
|
+
created_at: string;
|
|
157
|
+
};
|
|
158
|
+
export type ScheduledMessageRow = {
|
|
159
|
+
id: string;
|
|
160
|
+
channel_id: string;
|
|
161
|
+
user_id: string;
|
|
162
|
+
text: string;
|
|
163
|
+
thread_ts: string | null;
|
|
164
|
+
post_at: number;
|
|
165
|
+
date_created: number;
|
|
166
|
+
blocks_json: string;
|
|
167
|
+
};
|
|
168
|
+
export type CanvasRow = {
|
|
169
|
+
id: string;
|
|
170
|
+
team_id: string;
|
|
171
|
+
title: string;
|
|
172
|
+
markdown: string;
|
|
173
|
+
channel_id: string | null;
|
|
174
|
+
created_by: string;
|
|
175
|
+
created_at: string;
|
|
176
|
+
updated_at: string;
|
|
177
|
+
};
|
|
178
|
+
export type EmojiRow = {
|
|
179
|
+
team_id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
value: string;
|
|
182
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { type CheckOutcome } from "../../sdk/checks.js";
|
|
2
|
+
export interface StripeCheckStatePaymentIntent {
|
|
3
|
+
id?: string;
|
|
4
|
+
amount?: number;
|
|
5
|
+
currency?: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
latest_charge?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface StripeCheckStateCharge {
|
|
10
|
+
id?: string;
|
|
11
|
+
amount?: number;
|
|
12
|
+
amount_refunded?: number;
|
|
13
|
+
currency?: string;
|
|
14
|
+
status?: string;
|
|
15
|
+
refunded?: boolean;
|
|
16
|
+
paid?: boolean;
|
|
17
|
+
payment_intent?: string | null;
|
|
18
|
+
balance_transaction?: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface StripeCheckStateBalanceTransaction {
|
|
21
|
+
id?: string;
|
|
22
|
+
amount?: number;
|
|
23
|
+
source?: string | null;
|
|
24
|
+
status?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface StripeCheckStateEvent {
|
|
28
|
+
id?: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
data?: {
|
|
31
|
+
object?: unknown;
|
|
32
|
+
} | null;
|
|
33
|
+
created?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface StripeCheckStateRefund {
|
|
36
|
+
id?: string;
|
|
37
|
+
amount?: number;
|
|
38
|
+
currency?: string;
|
|
39
|
+
status?: string;
|
|
40
|
+
charge?: string | null;
|
|
41
|
+
payment_intent?: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface StripeCheckState {
|
|
44
|
+
payment_intents?: StripeCheckStatePaymentIntent[] | null;
|
|
45
|
+
charges?: StripeCheckStateCharge[] | null;
|
|
46
|
+
balance_transactions?: StripeCheckStateBalanceTransaction[] | null;
|
|
47
|
+
events?: StripeCheckStateEvent[] | null;
|
|
48
|
+
refunds?: StripeCheckStateRefund[] | null;
|
|
49
|
+
}
|
|
50
|
+
/** twin-github's and twin-slack's verdict type, same shape and same reason: a
|
|
51
|
+
* resolver must be able to say WHY it found nothing, because the ways of
|
|
52
|
+
* finding nothing get different verdicts.
|
|
53
|
+
*
|
|
54
|
+
* F-1197 added the pointers, also twin-github's: `path` is where the resolution
|
|
55
|
+
* landed, `searched` is the collection a failed lookup scanned — absent when the
|
|
56
|
+
* export carried no such collection, because a citation that resolves to
|
|
57
|
+
* nothing is the affordance-to-nowhere that ticket removes. */
|
|
58
|
+
export type Resolved<T> = {
|
|
59
|
+
found: T;
|
|
60
|
+
path: string;
|
|
61
|
+
} | {
|
|
62
|
+
missing: string;
|
|
63
|
+
searched?: string;
|
|
64
|
+
};
|
|
65
|
+
/** The exported collections a pointer can address (F-1197). Named because seven
|
|
66
|
+
* declarations reach for them, and because these are WIRE names — `refunds`,
|
|
67
|
+
* not `refund_rows` — which is exactly the distinction this file's header
|
|
68
|
+
* spends thirty lines on. A literal typed out at each call site is a chance to
|
|
69
|
+
* reintroduce a row-column name that resolves to nothing. */
|
|
70
|
+
export declare const PAYMENT_INTENTS_PATH: string;
|
|
71
|
+
export declare const CHARGES_PATH: string;
|
|
72
|
+
export declare const EVENTS_PATH: string;
|
|
73
|
+
export declare const REFUNDS_PATH: string;
|
|
74
|
+
/** The `skipped` outcome an unresolvable lookup produces, citing where it
|
|
75
|
+
* looked. Stripe abstains where twin-github fails, on twin-slack's precedent
|
|
76
|
+
* (see `resolveCharge`), so this is `missOutcome` with `skipped`. */
|
|
77
|
+
export declare function missSkip(miss: {
|
|
78
|
+
missing: string;
|
|
79
|
+
searched?: string;
|
|
80
|
+
}): CheckOutcome;
|
|
81
|
+
/**
|
|
82
|
+
* The charge a criterion names, with the three outcomes a refund assertion has
|
|
83
|
+
* to tell apart:
|
|
84
|
+
* - no `charges` key at all → `state_incomplete`; nothing can be attested
|
|
85
|
+
* - present but this charge absent → `charge_not_found`. A SKIP rather than a
|
|
86
|
+
* verdict, on twin-slack's `resolveChannel` precedent: we cannot attest a
|
|
87
|
+
* positive over state we do not have, and for a negative a missing selector
|
|
88
|
+
* would hand a wrong agent a free pass.
|
|
89
|
+
* - found → the predicate evaluates. A present charge with zero refunds is a
|
|
90
|
+
* TRUE vacuous pass for a negative and a TRUE fail for a positive.
|
|
91
|
+
*
|
|
92
|
+
* Comparison is EXACT. A Stripe charge id is an opaque identifier the twin
|
|
93
|
+
* minted, not a human-typed name, so the case-insensitive `#`-tolerant matching
|
|
94
|
+
* twin-slack does for channel names would only widen what a typo can hit.
|
|
95
|
+
*/
|
|
96
|
+
export declare function resolveCharge(state: StripeCheckState, chargeId: string): Resolved<StripeCheckStateCharge>;
|
|
97
|
+
/**
|
|
98
|
+
* Every refund row against a charge, or the reason we cannot say.
|
|
99
|
+
*
|
|
100
|
+
* Resolves the CHARGE first and skips when it is missing, so "this charge has
|
|
101
|
+
* no refunds" and "there is no such charge" never reach the same verdict —
|
|
102
|
+
* they are the two answers a count assertion must not conflate.
|
|
103
|
+
*
|
|
104
|
+
* An EMPTY list is a real answer, deliberately distinct from either skip: a
|
|
105
|
+
* seeded charge nobody refunded really does have zero refunds.
|
|
106
|
+
*/
|
|
107
|
+
export declare function refundsOnCharge(state: StripeCheckState, chargeId: string): Resolved<StripeCheckStateRefund[]>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { Check } from "./check-kind.js";
|
|
2
|
+
export type { StripeCheckState, StripeCheckStateBalanceTransaction, StripeCheckStateCharge, StripeCheckStateEvent, StripeCheckStatePaymentIntent, StripeCheckStateRefund, } from "./check-state.js";
|
|
3
|
+
export declare const STRIPE_CHECKS: readonly [import("./check-kind.js").Check<{
|
|
4
|
+
amount: string;
|
|
5
|
+
}>, import("./check-kind.js").Check<{
|
|
6
|
+
status: string;
|
|
7
|
+
}>, import("./check-kind.js").Check<{
|
|
8
|
+
status: string;
|
|
9
|
+
}>, import("./check-kind.js").Check<{
|
|
10
|
+
status: string;
|
|
11
|
+
}>, import("./check-kind.js").Check<{
|
|
12
|
+
event_type: string;
|
|
13
|
+
}>, import("./check-kind.js").Check<{
|
|
14
|
+
charge: string;
|
|
15
|
+
}>, import("./check-kind.js").Check<{
|
|
16
|
+
charge: string;
|
|
17
|
+
count: string;
|
|
18
|
+
}>, import("./check-kind.js").Check<{
|
|
19
|
+
charge: string;
|
|
20
|
+
}>, import("./check-kind.js").Check<{
|
|
21
|
+
error_type: string;
|
|
22
|
+
}>, import("./check-kind.js").Check<Record<string, never>>, import("./check-kind.js").Check<Record<string, never>>];
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type FailureInjectionStore } from "../../sdk/failure-injection-rules.js";
|
|
3
|
+
import type { SeedState, TwinStripeDatabase } from "./types.js";
|
|
4
|
+
export type { SeedState } from "./types.js";
|
|
5
|
+
export declare const DEFAULT_SID = "default";
|
|
6
|
+
export declare const DEFAULT_API_KEY = "sk_test_pome_default";
|
|
7
|
+
declare const paymentIntentSeedSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
account_id: z.ZodString;
|
|
10
|
+
amount: z.ZodNumber;
|
|
11
|
+
currency: z.ZodString;
|
|
12
|
+
status: z.ZodEnum<{
|
|
13
|
+
requires_payment_method: "requires_payment_method";
|
|
14
|
+
requires_confirmation: "requires_confirmation";
|
|
15
|
+
requires_action: "requires_action";
|
|
16
|
+
processing: "processing";
|
|
17
|
+
requires_capture: "requires_capture";
|
|
18
|
+
canceled: "canceled";
|
|
19
|
+
succeeded: "succeeded";
|
|
20
|
+
}>;
|
|
21
|
+
payment_method_types: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
22
|
+
next_action: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
23
|
+
latest_charge_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
capture_method: z.ZodDefault<z.ZodString>;
|
|
25
|
+
confirmation_method: z.ZodDefault<z.ZodString>;
|
|
26
|
+
idempotency_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
|
+
crypto_deposit: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
29
|
+
client_secret: z.ZodString;
|
|
30
|
+
created: z.ZodNumber;
|
|
31
|
+
updated: z.ZodNumber;
|
|
32
|
+
canceled_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
33
|
+
captured_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
declare const chargeSeedSchema: z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
account_id: z.ZodString;
|
|
38
|
+
payment_intent_id: z.ZodString;
|
|
39
|
+
amount: z.ZodNumber;
|
|
40
|
+
amount_captured: z.ZodDefault<z.ZodNumber>;
|
|
41
|
+
amount_refunded: z.ZodDefault<z.ZodNumber>;
|
|
42
|
+
status: z.ZodEnum<{
|
|
43
|
+
succeeded: "succeeded";
|
|
44
|
+
pending: "pending";
|
|
45
|
+
failed: "failed";
|
|
46
|
+
}>;
|
|
47
|
+
balance_transaction_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
captured: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
currency: z.ZodString;
|
|
50
|
+
created: z.ZodNumber;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
declare const refundSeedSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
account_id: z.ZodString;
|
|
55
|
+
charge_id: z.ZodString;
|
|
56
|
+
payment_intent_id: z.ZodString;
|
|
57
|
+
amount: z.ZodNumber;
|
|
58
|
+
currency: z.ZodString;
|
|
59
|
+
status: z.ZodEnum<{
|
|
60
|
+
canceled: "canceled";
|
|
61
|
+
succeeded: "succeeded";
|
|
62
|
+
pending: "pending";
|
|
63
|
+
failed: "failed";
|
|
64
|
+
}>;
|
|
65
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
balance_transaction_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
idempotency_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
created: z.ZodNumber;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
declare const balanceTransactionSeedSchema: z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
account_id: z.ZodString;
|
|
73
|
+
type: z.ZodString;
|
|
74
|
+
amount: z.ZodNumber;
|
|
75
|
+
fee: z.ZodDefault<z.ZodNumber>;
|
|
76
|
+
net: z.ZodNumber;
|
|
77
|
+
currency: z.ZodString;
|
|
78
|
+
source_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
source_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
available_on: z.ZodNumber;
|
|
81
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
82
|
+
pending: "pending";
|
|
83
|
+
available: "available";
|
|
84
|
+
}>>;
|
|
85
|
+
created: z.ZodNumber;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export type PaymentIntentSeed = z.infer<typeof paymentIntentSeedSchema>;
|
|
88
|
+
export type ChargeSeed = z.infer<typeof chargeSeedSchema>;
|
|
89
|
+
export type RefundSeed = z.infer<typeof refundSeedSchema>;
|
|
90
|
+
export type BalanceTransactionSeed = z.infer<typeof balanceTransactionSeedSchema>;
|
|
91
|
+
export declare const seedSchema: z.ZodObject<{
|
|
92
|
+
api_keys: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
93
|
+
key: z.ZodString;
|
|
94
|
+
sid: z.ZodString;
|
|
95
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>>>;
|
|
97
|
+
failure_injection: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
98
|
+
method: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
99
|
+
path: z.ZodString;
|
|
100
|
+
attempt: z.ZodNumber;
|
|
101
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
102
|
+
before_handler: "before_handler";
|
|
103
|
+
after_handler: "after_handler";
|
|
104
|
+
}>>;
|
|
105
|
+
status: z.ZodNumber;
|
|
106
|
+
body: z.ZodUnknown;
|
|
107
|
+
}, z.core.$strip>>>;
|
|
108
|
+
payment_intents: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
account_id: z.ZodString;
|
|
111
|
+
amount: z.ZodNumber;
|
|
112
|
+
currency: z.ZodString;
|
|
113
|
+
status: z.ZodEnum<{
|
|
114
|
+
requires_payment_method: "requires_payment_method";
|
|
115
|
+
requires_confirmation: "requires_confirmation";
|
|
116
|
+
requires_action: "requires_action";
|
|
117
|
+
processing: "processing";
|
|
118
|
+
requires_capture: "requires_capture";
|
|
119
|
+
canceled: "canceled";
|
|
120
|
+
succeeded: "succeeded";
|
|
121
|
+
}>;
|
|
122
|
+
payment_method_types: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
123
|
+
next_action: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
124
|
+
latest_charge_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
capture_method: z.ZodDefault<z.ZodString>;
|
|
126
|
+
confirmation_method: z.ZodDefault<z.ZodString>;
|
|
127
|
+
idempotency_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
129
|
+
crypto_deposit: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
130
|
+
client_secret: z.ZodString;
|
|
131
|
+
created: z.ZodNumber;
|
|
132
|
+
updated: z.ZodNumber;
|
|
133
|
+
canceled_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
134
|
+
captured_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
135
|
+
}, z.core.$strip>>>;
|
|
136
|
+
charges: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
137
|
+
id: z.ZodString;
|
|
138
|
+
account_id: z.ZodString;
|
|
139
|
+
payment_intent_id: z.ZodString;
|
|
140
|
+
amount: z.ZodNumber;
|
|
141
|
+
amount_captured: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
amount_refunded: z.ZodDefault<z.ZodNumber>;
|
|
143
|
+
status: z.ZodEnum<{
|
|
144
|
+
succeeded: "succeeded";
|
|
145
|
+
pending: "pending";
|
|
146
|
+
failed: "failed";
|
|
147
|
+
}>;
|
|
148
|
+
balance_transaction_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
149
|
+
captured: z.ZodDefault<z.ZodBoolean>;
|
|
150
|
+
currency: z.ZodString;
|
|
151
|
+
created: z.ZodNumber;
|
|
152
|
+
}, z.core.$strip>>>;
|
|
153
|
+
refunds: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
account_id: z.ZodString;
|
|
156
|
+
charge_id: z.ZodString;
|
|
157
|
+
payment_intent_id: z.ZodString;
|
|
158
|
+
amount: z.ZodNumber;
|
|
159
|
+
currency: z.ZodString;
|
|
160
|
+
status: z.ZodEnum<{
|
|
161
|
+
canceled: "canceled";
|
|
162
|
+
succeeded: "succeeded";
|
|
163
|
+
pending: "pending";
|
|
164
|
+
failed: "failed";
|
|
165
|
+
}>;
|
|
166
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
167
|
+
balance_transaction_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
idempotency_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
+
created: z.ZodNumber;
|
|
170
|
+
}, z.core.$strip>>>;
|
|
171
|
+
balance_transactions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
account_id: z.ZodString;
|
|
174
|
+
type: z.ZodString;
|
|
175
|
+
amount: z.ZodNumber;
|
|
176
|
+
fee: z.ZodDefault<z.ZodNumber>;
|
|
177
|
+
net: z.ZodNumber;
|
|
178
|
+
currency: z.ZodString;
|
|
179
|
+
source_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
|
+
source_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
+
available_on: z.ZodNumber;
|
|
182
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
183
|
+
pending: "pending";
|
|
184
|
+
available: "available";
|
|
185
|
+
}>>;
|
|
186
|
+
created: z.ZodNumber;
|
|
187
|
+
}, z.core.$strip>>>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
export declare function parseSeed(input: unknown): SeedState;
|
|
190
|
+
/**
|
|
191
|
+
* Boot-time seed loader: prefer `POME_SEED_JSON` env (set by the cloud
|
|
192
|
+
* control-plane from the CLI-supplied scenario seed; see FDRS-353 +
|
|
193
|
+
* FDRS-361) and fall back to `defaultSeed()` when the env is absent.
|
|
194
|
+
*
|
|
195
|
+
* Unwrap contract (FDRS-365 + FDRS-369): scenarios may send the
|
|
196
|
+
* canonical wrapped shape `{ stripe: { seed: {...} } }` (what scenario
|
|
197
|
+
* 14 uses) or the flat shape `{ payment_intents: [...], ... }`. We peel
|
|
198
|
+
* `body.stripe?.seed ?? body` so both shapes work end-to-end without
|
|
199
|
+
* a cloud-side rewrite. Throws on malformed JSON or schema-invalid
|
|
200
|
+
* seed, so a misconfigured cloud deploy fails the twin server's
|
|
201
|
+
* healthz instead of silently booting with an empty Stripe world.
|
|
202
|
+
*/
|
|
203
|
+
/**
|
|
204
|
+
* `Record<string, string | undefined>` rather than `NodeJS.ProcessEnv`, which is
|
|
205
|
+
* structurally the same thing but an AMBIENT global. This signature is vendored
|
|
206
|
+
* into `@pome-sh/checks`'s published declarations, and an ambient reference there
|
|
207
|
+
* makes a consumer's `tsc` fail with TS2503 unless they happen to have
|
|
208
|
+
* `@types/node` installed — a dependency this package should not impose to
|
|
209
|
+
* describe a plain string map.
|
|
210
|
+
*/
|
|
211
|
+
export declare function loadSeedFromEnv(env?: Record<string, string | undefined>): SeedState;
|
|
212
|
+
export declare function defaultSeed(): SeedState;
|
|
213
|
+
export declare function applySeed(db: TwinStripeDatabase, seed: SeedState, failureInjection?: FailureInjectionStore): void;
|