@strimz/shared-types 0.9.0 → 0.10.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/dist/agents.cjs +42 -13
- package/dist/agents.cjs.map +1 -1
- package/dist/agents.d.cts +37 -37
- package/dist/agents.d.ts +37 -37
- package/dist/agents.js +42 -13
- package/dist/agents.js.map +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.d.cts +78 -78
- package/dist/analytics.d.ts +78 -78
- package/dist/analytics.js +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/api-keys.cjs +1 -1
- package/dist/api-keys.cjs.map +1 -1
- package/dist/api-keys.js +1 -1
- package/dist/api-keys.js.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.d.cts +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/common.js.map +1 -1
- package/dist/compliance.cjs +1 -1
- package/dist/compliance.cjs.map +1 -1
- package/dist/compliance.js +1 -1
- package/dist/compliance.js.map +1 -1
- package/dist/customers.cjs +1 -1
- package/dist/customers.cjs.map +1 -1
- package/dist/customers.js +1 -1
- package/dist/customers.js.map +1 -1
- package/dist/events.cjs +43 -14
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +90 -90
- package/dist/events.d.ts +90 -90
- package/dist/events.js +43 -14
- package/dist/events.js.map +1 -1
- package/dist/index.cjs +42 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -13
- package/dist/index.js.map +1 -1
- package/dist/invoices.cjs +1 -1
- package/dist/invoices.cjs.map +1 -1
- package/dist/invoices.d.cts +5 -5
- package/dist/invoices.d.ts +5 -5
- package/dist/invoices.js +1 -1
- package/dist/invoices.js.map +1 -1
- package/dist/merchants.cjs +1 -1
- package/dist/merchants.cjs.map +1 -1
- package/dist/merchants.js +1 -1
- package/dist/merchants.js.map +1 -1
- package/dist/payment-sessions.cjs +1 -1
- package/dist/payment-sessions.cjs.map +1 -1
- package/dist/payment-sessions.d.cts +4 -4
- package/dist/payment-sessions.d.ts +4 -4
- package/dist/payment-sessions.js +1 -1
- package/dist/payment-sessions.js.map +1 -1
- package/dist/refunds.cjs +1 -1
- package/dist/refunds.cjs.map +1 -1
- package/dist/refunds.d.cts +5 -5
- package/dist/refunds.d.ts +5 -5
- package/dist/refunds.js +1 -1
- package/dist/refunds.js.map +1 -1
- package/dist/storefronts.cjs +1 -1
- package/dist/storefronts.cjs.map +1 -1
- package/dist/storefronts.d.cts +2 -2
- package/dist/storefronts.d.ts +2 -2
- package/dist/storefronts.js +1 -1
- package/dist/storefronts.js.map +1 -1
- package/dist/subscriptions.cjs +1 -1
- package/dist/subscriptions.cjs.map +1 -1
- package/dist/subscriptions.d.cts +4 -4
- package/dist/subscriptions.d.ts +4 -4
- package/dist/subscriptions.js +1 -1
- package/dist/subscriptions.js.map +1 -1
- package/dist/transactions.cjs +1 -1
- package/dist/transactions.cjs.map +1 -1
- package/dist/transactions.d.cts +3 -3
- package/dist/transactions.d.ts +3 -3
- package/dist/transactions.js +1 -1
- package/dist/transactions.js.map +1 -1
- package/dist/webhooks.cjs +1 -1
- package/dist/webhooks.cjs.map +1 -1
- package/dist/webhooks.js +1 -1
- package/dist/webhooks.js.map +1 -1
- package/package.json +1 -1
- package/src/agents.ts +49 -14
- package/src/common.ts +0 -1
package/src/agents.ts
CHANGED
|
@@ -39,32 +39,67 @@ export const agentCapabilitySchema = z.enum([
|
|
|
39
39
|
])
|
|
40
40
|
export type AgentCapability = z.infer<typeof agentCapabilitySchema>
|
|
41
41
|
|
|
42
|
+
const enabledCapabilitiesSchema = z.array(agentCapabilitySchema)
|
|
43
|
+
const recoveryGracePeriodHoursSchema = z.union([z.literal(24), z.literal(48), z.literal(72)])
|
|
44
|
+
const recoveryStrategySchema = z.enum(['once', 'twice', 'until_grace_ends'])
|
|
45
|
+
const recoveryNotificationTemplateSchema = z.string().max(2000).nullable()
|
|
46
|
+
const cashflowDigestEnabledSchema = z.boolean()
|
|
47
|
+
const cashflowAnomalySensitivitySchema = z.enum(['low', 'medium', 'high'])
|
|
48
|
+
const cashflowAutoConvertToYieldSchema = z.boolean()
|
|
49
|
+
const cashflowMinimumLiquidReserveCentsSchema = z.number().int().nonnegative()
|
|
50
|
+
const commerceRequireHumanApprovalAboveUsdCentsSchema = z.number().int().nonnegative()
|
|
51
|
+
const commerceApprovedVendorsSchema = z.array(evmAddressSchema)
|
|
52
|
+
const commerceMonthlySpendCapUsdCentsSchema = z.number().int().nonnegative().nullable()
|
|
53
|
+
|
|
42
54
|
export const agentMerchantConfigSchema = z.object({
|
|
43
55
|
merchantId: idSchema,
|
|
44
|
-
enabledCapabilities:
|
|
56
|
+
enabledCapabilities: enabledCapabilitiesSchema.default([]),
|
|
45
57
|
recovery: z.object({
|
|
46
|
-
gracePeriodHours:
|
|
47
|
-
strategy:
|
|
48
|
-
notificationTemplate:
|
|
58
|
+
gracePeriodHours: recoveryGracePeriodHoursSchema.default(48),
|
|
59
|
+
strategy: recoveryStrategySchema.default('twice'),
|
|
60
|
+
notificationTemplate: recoveryNotificationTemplateSchema,
|
|
49
61
|
}),
|
|
50
62
|
cashflow: z.object({
|
|
51
|
-
digestEnabled:
|
|
52
|
-
anomalySensitivity:
|
|
53
|
-
autoConvertToYield:
|
|
54
|
-
minimumLiquidReserveCents:
|
|
63
|
+
digestEnabled: cashflowDigestEnabledSchema.default(false),
|
|
64
|
+
anomalySensitivity: cashflowAnomalySensitivitySchema.default('medium'),
|
|
65
|
+
autoConvertToYield: cashflowAutoConvertToYieldSchema.default(false),
|
|
66
|
+
minimumLiquidReserveCents: cashflowMinimumLiquidReserveCentsSchema.default(100_000),
|
|
55
67
|
}),
|
|
56
68
|
commerce: z.object({
|
|
57
|
-
requireHumanApprovalAboveUsdCents:
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
requireHumanApprovalAboveUsdCents:
|
|
70
|
+
commerceRequireHumanApprovalAboveUsdCentsSchema.default(100_000),
|
|
71
|
+
approvedVendors: commerceApprovedVendorsSchema.default([]),
|
|
72
|
+
monthlySpendCapUsdCents: commerceMonthlySpendCapUsdCentsSchema,
|
|
60
73
|
}),
|
|
61
74
|
updatedAt: isoTimestampSchema,
|
|
62
75
|
})
|
|
63
76
|
export type AgentMerchantConfig = z.infer<typeof agentMerchantConfigSchema>
|
|
64
77
|
|
|
65
|
-
export const updateAgentConfigInputSchema =
|
|
66
|
-
.
|
|
67
|
-
|
|
78
|
+
export const updateAgentConfigInputSchema = z.object({
|
|
79
|
+
enabledCapabilities: enabledCapabilitiesSchema.optional(),
|
|
80
|
+
recovery: z
|
|
81
|
+
.object({
|
|
82
|
+
gracePeriodHours: recoveryGracePeriodHoursSchema.optional(),
|
|
83
|
+
strategy: recoveryStrategySchema.optional(),
|
|
84
|
+
notificationTemplate: recoveryNotificationTemplateSchema.optional(),
|
|
85
|
+
})
|
|
86
|
+
.optional(),
|
|
87
|
+
cashflow: z
|
|
88
|
+
.object({
|
|
89
|
+
digestEnabled: cashflowDigestEnabledSchema.optional(),
|
|
90
|
+
anomalySensitivity: cashflowAnomalySensitivitySchema.optional(),
|
|
91
|
+
autoConvertToYield: cashflowAutoConvertToYieldSchema.optional(),
|
|
92
|
+
minimumLiquidReserveCents: cashflowMinimumLiquidReserveCentsSchema.optional(),
|
|
93
|
+
})
|
|
94
|
+
.optional(),
|
|
95
|
+
commerce: z
|
|
96
|
+
.object({
|
|
97
|
+
requireHumanApprovalAboveUsdCents: commerceRequireHumanApprovalAboveUsdCentsSchema.optional(),
|
|
98
|
+
approvedVendors: commerceApprovedVendorsSchema.optional(),
|
|
99
|
+
monthlySpendCapUsdCents: commerceMonthlySpendCapUsdCentsSchema.optional(),
|
|
100
|
+
})
|
|
101
|
+
.optional(),
|
|
102
|
+
})
|
|
68
103
|
export type UpdateAgentConfigInput = z.input<typeof updateAgentConfigInputSchema>
|
|
69
104
|
export type UpdateAgentConfigParsed = z.output<typeof updateAgentConfigInputSchema>
|
|
70
105
|
|
package/src/common.ts
CHANGED
|
@@ -45,7 +45,6 @@ export const httpUrlSchema = z.string().url()
|
|
|
45
45
|
export const tokenAmountSchema = z
|
|
46
46
|
.string()
|
|
47
47
|
.regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')
|
|
48
|
-
.refine((v) => BigInt(v) >= 0n, 'must be >= 0')
|
|
49
48
|
|
|
50
49
|
/** Unsigned integer up to 2^53 - 1; validated and returned as number. */
|
|
51
50
|
export const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
|