@payark/sdk-effect 0.1.6 → 0.1.9

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.
@@ -13,6 +13,10 @@ declare const CheckoutSessionId: Schema.brand<typeof Schema.String, "CheckoutSes
13
13
  type CheckoutSessionId = Schema.Schema.Type<typeof CheckoutSessionId>;
14
14
  declare const SubscriptionId: Schema.brand<typeof Schema.String, "SubscriptionId">;
15
15
  type SubscriptionId = Schema.Schema.Type<typeof SubscriptionId>;
16
+ declare const MandateId: Schema.brand<typeof Schema.String, "MandateId">;
17
+ type MandateId = Schema.Schema.Type<typeof MandateId>;
18
+ declare const AgentSessionId: Schema.brand<typeof Schema.String, "AgentSessionId">;
19
+ type AgentSessionId = Schema.Schema.Type<typeof AgentSessionId>;
16
20
  declare const CustomerId: Schema.brand<typeof Schema.String, "CustomerId">;
17
21
  type CustomerId = Schema.Schema.Type<typeof CustomerId>;
18
22
  declare const TokenId: Schema.brand<typeof Schema.String, "TokenId">;
@@ -34,14 +38,23 @@ type Timestamps = Schema.Schema.Type<typeof Timestamps>;
34
38
  /**
35
39
  * ── Enums ──
36
40
  */
37
- declare const Provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
41
+ declare const Provider: Schema.Literal<["esewa", "khalti", "hamropay", "connectips", "imepay", "fonepay", "sandbox"]>;
38
42
  type Provider = Schema.Schema.Type<typeof Provider>;
39
43
  declare const PaymentStatus: Schema.Literal<["pending", "success", "failed"]>;
40
44
  type PaymentStatus = Schema.Schema.Type<typeof PaymentStatus>;
41
- declare const SubscriptionStatus: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
45
+ declare const SubscriptionStatus: Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>;
42
46
  type SubscriptionStatus = Schema.Schema.Type<typeof SubscriptionStatus>;
43
47
  declare const SubscriptionInterval: Schema.Literal<["month", "year", "week"]>;
44
48
  type SubscriptionInterval = Schema.Schema.Type<typeof SubscriptionInterval>;
49
+ declare const CustomerLifecycle: Schema.Literal<["new", "active", "loyal", "at_risk", "churned"]>;
50
+ type CustomerLifecycle = Schema.Schema.Type<typeof CustomerLifecycle>;
51
+ /**
52
+ * ── AP2 Mandate Enums ──
53
+ */
54
+ declare const MandateType: Schema.Literal<["intent", "cart"]>;
55
+ type MandateType = Schema.Schema.Type<typeof MandateType>;
56
+ declare const MandateStatus: Schema.Literal<["active", "consumed", "expired", "violated"]>;
57
+ type MandateStatus = Schema.Schema.Type<typeof MandateStatus>;
45
58
  /**
46
59
  * ── Models ──
47
60
  */
@@ -53,6 +66,11 @@ declare const Customer: Schema.Struct<{
53
66
  phone: Schema.NullOr<typeof Schema.String>;
54
67
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
55
68
  metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
69
+ total_ltv: Schema.optional<typeof Schema.Number>;
70
+ is_high_value: Schema.optional<typeof Schema.Boolean>;
71
+ lifecycle_stage: Schema.optional<Schema.Literal<["new", "active", "loyal", "at_risk", "churned"]>>;
72
+ ltv_cents: Schema.optional<typeof Schema.Number>;
73
+ tier: Schema.NullOr<typeof Schema.String>;
56
74
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
57
75
  updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
58
76
  }>;
@@ -60,6 +78,7 @@ type Customer = Schema.Schema.Type<typeof Customer>;
60
78
  declare const Payment: Schema.Struct<{
61
79
  id: Schema.brand<typeof Schema.String, "PaymentId">;
62
80
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
81
+ customer_id: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "CustomerId">>>;
63
82
  amount: typeof Schema.Number;
64
83
  currency: typeof Schema.String;
65
84
  status: Schema.Literal<["pending", "success", "failed"]>;
@@ -74,7 +93,7 @@ declare const Subscription: Schema.Struct<{
74
93
  id: Schema.brand<typeof Schema.String, "SubscriptionId">;
75
94
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
76
95
  customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
77
- status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
96
+ status: Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>;
78
97
  amount: typeof Schema.Number;
79
98
  currency: typeof Schema.String;
80
99
  interval: Schema.Literal<["month", "year", "week"]>;
@@ -82,7 +101,9 @@ declare const Subscription: Schema.Struct<{
82
101
  current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
83
102
  current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
84
103
  payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
104
+ customer_email: Schema.optional<Schema.NullOr<typeof Schema.String>>;
85
105
  auto_send_link: typeof Schema.Boolean;
106
+ grace_days: Schema.optional<typeof Schema.Number>;
86
107
  metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
87
108
  canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
88
109
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
@@ -93,6 +114,9 @@ declare const Project: Schema.Struct<{
93
114
  id: Schema.brand<typeof Schema.String, "ProjectId">;
94
115
  name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
95
116
  api_key_secret: typeof Schema.String;
117
+ subscription_tier: Schema.optional<Schema.Literal<["free", "pro", "enterprise"]>>;
118
+ subscription_status: Schema.optional<Schema.Literal<["active", "past_due", "canceled", "incomplete"]>>;
119
+ expires_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
96
120
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
97
121
  }>;
98
122
  type Project = Schema.Schema.Type<typeof Project>;
@@ -105,6 +129,43 @@ declare const Token: Schema.Struct<{
105
129
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
106
130
  }>;
107
131
  type Token = Schema.Schema.Type<typeof Token>;
132
+ /**
133
+ * ── AP2 Models ──
134
+ */
135
+ declare const Mandate: Schema.Struct<{
136
+ id: Schema.brand<typeof Schema.String, "MandateId">;
137
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
138
+ customer_id: Schema.NullOr<Schema.brand<typeof Schema.String, "CustomerId">>;
139
+ type: Schema.Literal<["intent", "cart"]>;
140
+ status: Schema.Literal<["active", "consumed", "expired", "violated"]>;
141
+ principal_id: typeof Schema.String;
142
+ max_amount: typeof Schema.Number;
143
+ currency: typeof Schema.String;
144
+ permitted_vendors: Schema.NullOr<Schema.Array$<typeof Schema.String>>;
145
+ valid_from: Schema.brand<typeof Schema.String, "Timestamp">;
146
+ valid_until: Schema.brand<typeof Schema.String, "Timestamp">;
147
+ credential_jwt: typeof Schema.String;
148
+ public_key: typeof Schema.String;
149
+ signature: typeof Schema.String;
150
+ parent_mandate_id: Schema.NullOr<Schema.brand<typeof Schema.String, "MandateId">>;
151
+ payment_id: Schema.NullOr<Schema.brand<typeof Schema.String, "PaymentId">>;
152
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
153
+ consumed_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
154
+ metadata_json: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
155
+ }>;
156
+ type Mandate = Schema.Schema.Type<typeof Mandate>;
157
+ declare const AgentSession: Schema.Struct<{
158
+ id: Schema.brand<typeof Schema.String, "AgentSessionId">;
159
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
160
+ context_id: typeof Schema.String;
161
+ agent_card_url: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
162
+ capabilities: typeof Schema.Any;
163
+ auth_scheme: Schema.Literal<["bearer", "mandate"]>;
164
+ status: typeof Schema.String;
165
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
166
+ expires_at: Schema.brand<typeof Schema.String, "Timestamp">;
167
+ }>;
168
+ type AgentSession = Schema.Schema.Type<typeof AgentSession>;
108
169
  /**
109
170
  * ── Pagination ──
110
171
  */
@@ -129,14 +190,15 @@ interface PaginatedResponse<T> {
129
190
  /**
130
191
  * ── Webhooks ──
131
192
  */
132
- declare const WebhookEventType: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
193
+ declare const WebhookEventType: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.activated", "subscription.renewed", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
133
194
  type WebhookEventType = Schema.Schema.Type<typeof WebhookEventType>;
134
195
  declare const WebhookEvent: Schema.Struct<{
135
- type: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
196
+ type: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.activated", "subscription.renewed", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
136
197
  id: Schema.optional<typeof Schema.String>;
137
198
  data: Schema.Union<[Schema.Struct<{
138
199
  id: Schema.brand<typeof Schema.String, "PaymentId">;
139
200
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
201
+ customer_id: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "CustomerId">>>;
140
202
  amount: typeof Schema.Number;
141
203
  currency: typeof Schema.String;
142
204
  status: Schema.Literal<["pending", "success", "failed"]>;
@@ -149,7 +211,7 @@ declare const WebhookEvent: Schema.Struct<{
149
211
  id: Schema.brand<typeof Schema.String, "SubscriptionId">;
150
212
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
151
213
  customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
152
- status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
214
+ status: Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>;
153
215
  amount: typeof Schema.Number;
154
216
  currency: typeof Schema.String;
155
217
  interval: Schema.Literal<["month", "year", "week"]>;
@@ -157,7 +219,9 @@ declare const WebhookEvent: Schema.Struct<{
157
219
  current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
158
220
  current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
159
221
  payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
222
+ customer_email: Schema.optional<Schema.NullOr<typeof Schema.String>>;
160
223
  auto_send_link: typeof Schema.Boolean;
224
+ grace_days: Schema.optional<typeof Schema.Number>;
161
225
  metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
162
226
  canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
163
227
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
@@ -170,6 +234,11 @@ declare const WebhookEvent: Schema.Struct<{
170
234
  phone: Schema.NullOr<typeof Schema.String>;
171
235
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
172
236
  metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
237
+ total_ltv: Schema.optional<typeof Schema.Number>;
238
+ is_high_value: Schema.optional<typeof Schema.Boolean>;
239
+ lifecycle_stage: Schema.optional<Schema.Literal<["new", "active", "loyal", "at_risk", "churned"]>>;
240
+ ltv_cents: Schema.optional<typeof Schema.Number>;
241
+ tier: Schema.NullOr<typeof Schema.String>;
173
242
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
174
243
  updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
175
244
  }>, Schema.Struct<{
@@ -187,22 +256,25 @@ type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
187
256
  * ── Params & Inputs ──
188
257
  */
189
258
  declare const CreateCheckoutParams: Schema.filter<Schema.Struct<{
190
- amount: Schema.optional<Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">>;
259
+ amount: Schema.optional<Schema.brand<Schema.filter<typeof Schema.Number>, "NprAmount">>;
191
260
  currency: Schema.optionalWith<typeof Schema.String, {
192
261
  default: () => string;
193
262
  }>;
194
- provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
263
+ provider: Schema.Literal<["esewa", "khalti", "hamropay", "connectips", "imepay", "fonepay", "sandbox"]>;
195
264
  returnUrl: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
196
265
  cancelUrl: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
197
266
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
198
267
  subscriptionId: Schema.optional<Schema.brand<typeof Schema.String, "SubscriptionId">>;
268
+ customerId: Schema.optional<Schema.brand<typeof Schema.String, "CustomerId">>;
269
+ mandate_id: Schema.optional<Schema.brand<typeof Schema.String, "MandateId">>;
199
270
  }>>;
200
271
  type CreateCheckoutParams = Schema.Schema.Type<typeof CreateCheckoutParams>;
201
272
  declare const CheckoutSession: Schema.Struct<{
202
273
  id: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
203
274
  checkout_url: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
275
+ qr_string: Schema.optional<typeof Schema.String>;
204
276
  payment_method: Schema.Struct<{
205
- type: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
277
+ type: Schema.Literal<["esewa", "khalti", "hamropay", "connectips", "imepay", "fonepay", "sandbox"]>;
206
278
  url: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
207
279
  method: Schema.optional<Schema.Literal<["GET", "POST"]>>;
208
280
  fields: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
@@ -236,18 +308,21 @@ declare const UpdateCustomerParams: Schema.Struct<{
236
308
  email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
237
309
  name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
238
310
  phone: Schema.optional<typeof Schema.String>;
311
+ tier: Schema.optional<typeof Schema.String>;
312
+ merchant_customer_id: Schema.optional<typeof Schema.String>;
239
313
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
240
314
  }>;
241
315
  type UpdateCustomerParams = Schema.Schema.Type<typeof UpdateCustomerParams>;
242
316
  declare const CreateSubscriptionParams: Schema.Struct<{
243
317
  customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
244
- amount: Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">;
318
+ amount: Schema.brand<Schema.filter<typeof Schema.Number>, "NprAmount">;
245
319
  currency: Schema.optionalWith<typeof Schema.String, {
246
320
  default: () => string;
247
321
  }>;
248
322
  interval: Schema.Literal<["month", "year", "week"]>;
249
323
  interval_count: Schema.optional<typeof Schema.Number>;
250
324
  project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
325
+ customer_email: Schema.optional<typeof Schema.String>;
251
326
  auto_send_link: Schema.optional<typeof Schema.Boolean>;
252
327
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
253
328
  }>;
@@ -256,6 +331,8 @@ declare const CallbackQueryParams: Schema.Struct<{
256
331
  payment_id: Schema.optional<typeof Schema.String>;
257
332
  data: Schema.optional<typeof Schema.String>;
258
333
  pidx: Schema.optional<typeof Schema.String>;
334
+ /** HamroPay-specific: the gateway's own transactionId returned on callback. */
335
+ ref_id: Schema.optional<typeof Schema.String>;
259
336
  }>;
260
337
  type CallbackQueryParams = Schema.Schema.Type<typeof CallbackQueryParams>;
261
338
  declare const ListSubscriptionsParams: Schema.Struct<{
@@ -263,11 +340,11 @@ declare const ListSubscriptionsParams: Schema.Struct<{
263
340
  offset: Schema.optional<typeof Schema.NumberFromString>;
264
341
  projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
265
342
  customerId: Schema.optional<Schema.brand<typeof Schema.String, "CustomerId">>;
266
- status: Schema.optional<Schema.Literal<["active", "past_due", "canceled", "paused"]>>;
343
+ status: Schema.optional<Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>>;
267
344
  }>;
268
345
  type ListSubscriptionsParams = Schema.Schema.Type<typeof ListSubscriptionsParams>;
269
346
  declare const RealtimeTriggerPayload: Schema.Struct<{
270
- event: Schema.optional<Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>>;
347
+ event: Schema.optional<Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.activated", "subscription.renewed", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>>;
271
348
  data: Schema.optional<typeof Schema.Any>;
272
349
  }>;
273
350
  type RealtimeTriggerPayload = Schema.Schema.Type<typeof RealtimeTriggerPayload>;
@@ -280,6 +357,7 @@ declare const PayArkConfig: Schema.Struct<{
280
357
  timeout: Schema.optional<typeof Schema.Number>;
281
358
  maxRetries: Schema.optional<typeof Schema.Number>;
282
359
  sandbox: Schema.optional<typeof Schema.Boolean>;
360
+ signingPrivateKey: Schema.optional<typeof Schema.String>;
283
361
  }>;
284
362
  type PayArkConfig = Schema.Schema.Type<typeof PayArkConfig>;
285
363
  /**
@@ -291,4 +369,4 @@ declare const PayArkErrorBody: Schema.Struct<{
291
369
  }>;
292
370
  type PayArkErrorBody = Schema.Schema.Type<typeof PayArkErrorBody>;
293
371
 
294
- export { CallbackQueryParams, CheckoutSession, CheckoutSessionId, CreateCheckoutParams, CreateCustomerParams, CreateSubscriptionParams, Customer, CustomerId, Email, Id, ListCustomersParams, ListPaymentsParams, ListSubscriptionsParams, Metadata, PaginatedResponse, PaginationMeta, PayArkConfig, PayArkErrorBody, Payment, PaymentId, PaymentStatus, Project, ProjectId, Provider, RealtimeTriggerPayload, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, Timestamp, Timestamps, Token, TokenId, UpdateCustomerParams, WebhookEvent, WebhookEventType };
372
+ export { AgentSession, AgentSessionId, CallbackQueryParams, CheckoutSession, CheckoutSessionId, CreateCheckoutParams, CreateCustomerParams, CreateSubscriptionParams, Customer, CustomerId, CustomerLifecycle, Email, Id, ListCustomersParams, ListPaymentsParams, ListSubscriptionsParams, Mandate, MandateId, MandateStatus, MandateType, Metadata, PaginatedResponse, PaginationMeta, PayArkConfig, PayArkErrorBody, Payment, PaymentId, PaymentStatus, Project, ProjectId, Provider, RealtimeTriggerPayload, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, Timestamp, Timestamps, Token, TokenId, UpdateCustomerParams, WebhookEvent, WebhookEventType };
package/dist/schemas.d.ts CHANGED
@@ -13,6 +13,10 @@ declare const CheckoutSessionId: Schema.brand<typeof Schema.String, "CheckoutSes
13
13
  type CheckoutSessionId = Schema.Schema.Type<typeof CheckoutSessionId>;
14
14
  declare const SubscriptionId: Schema.brand<typeof Schema.String, "SubscriptionId">;
15
15
  type SubscriptionId = Schema.Schema.Type<typeof SubscriptionId>;
16
+ declare const MandateId: Schema.brand<typeof Schema.String, "MandateId">;
17
+ type MandateId = Schema.Schema.Type<typeof MandateId>;
18
+ declare const AgentSessionId: Schema.brand<typeof Schema.String, "AgentSessionId">;
19
+ type AgentSessionId = Schema.Schema.Type<typeof AgentSessionId>;
16
20
  declare const CustomerId: Schema.brand<typeof Schema.String, "CustomerId">;
17
21
  type CustomerId = Schema.Schema.Type<typeof CustomerId>;
18
22
  declare const TokenId: Schema.brand<typeof Schema.String, "TokenId">;
@@ -34,14 +38,23 @@ type Timestamps = Schema.Schema.Type<typeof Timestamps>;
34
38
  /**
35
39
  * ── Enums ──
36
40
  */
37
- declare const Provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
41
+ declare const Provider: Schema.Literal<["esewa", "khalti", "hamropay", "connectips", "imepay", "fonepay", "sandbox"]>;
38
42
  type Provider = Schema.Schema.Type<typeof Provider>;
39
43
  declare const PaymentStatus: Schema.Literal<["pending", "success", "failed"]>;
40
44
  type PaymentStatus = Schema.Schema.Type<typeof PaymentStatus>;
41
- declare const SubscriptionStatus: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
45
+ declare const SubscriptionStatus: Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>;
42
46
  type SubscriptionStatus = Schema.Schema.Type<typeof SubscriptionStatus>;
43
47
  declare const SubscriptionInterval: Schema.Literal<["month", "year", "week"]>;
44
48
  type SubscriptionInterval = Schema.Schema.Type<typeof SubscriptionInterval>;
49
+ declare const CustomerLifecycle: Schema.Literal<["new", "active", "loyal", "at_risk", "churned"]>;
50
+ type CustomerLifecycle = Schema.Schema.Type<typeof CustomerLifecycle>;
51
+ /**
52
+ * ── AP2 Mandate Enums ──
53
+ */
54
+ declare const MandateType: Schema.Literal<["intent", "cart"]>;
55
+ type MandateType = Schema.Schema.Type<typeof MandateType>;
56
+ declare const MandateStatus: Schema.Literal<["active", "consumed", "expired", "violated"]>;
57
+ type MandateStatus = Schema.Schema.Type<typeof MandateStatus>;
45
58
  /**
46
59
  * ── Models ──
47
60
  */
@@ -53,6 +66,11 @@ declare const Customer: Schema.Struct<{
53
66
  phone: Schema.NullOr<typeof Schema.String>;
54
67
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
55
68
  metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
69
+ total_ltv: Schema.optional<typeof Schema.Number>;
70
+ is_high_value: Schema.optional<typeof Schema.Boolean>;
71
+ lifecycle_stage: Schema.optional<Schema.Literal<["new", "active", "loyal", "at_risk", "churned"]>>;
72
+ ltv_cents: Schema.optional<typeof Schema.Number>;
73
+ tier: Schema.NullOr<typeof Schema.String>;
56
74
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
57
75
  updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
58
76
  }>;
@@ -60,6 +78,7 @@ type Customer = Schema.Schema.Type<typeof Customer>;
60
78
  declare const Payment: Schema.Struct<{
61
79
  id: Schema.brand<typeof Schema.String, "PaymentId">;
62
80
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
81
+ customer_id: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "CustomerId">>>;
63
82
  amount: typeof Schema.Number;
64
83
  currency: typeof Schema.String;
65
84
  status: Schema.Literal<["pending", "success", "failed"]>;
@@ -74,7 +93,7 @@ declare const Subscription: Schema.Struct<{
74
93
  id: Schema.brand<typeof Schema.String, "SubscriptionId">;
75
94
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
76
95
  customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
77
- status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
96
+ status: Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>;
78
97
  amount: typeof Schema.Number;
79
98
  currency: typeof Schema.String;
80
99
  interval: Schema.Literal<["month", "year", "week"]>;
@@ -82,7 +101,9 @@ declare const Subscription: Schema.Struct<{
82
101
  current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
83
102
  current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
84
103
  payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
104
+ customer_email: Schema.optional<Schema.NullOr<typeof Schema.String>>;
85
105
  auto_send_link: typeof Schema.Boolean;
106
+ grace_days: Schema.optional<typeof Schema.Number>;
86
107
  metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
87
108
  canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
88
109
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
@@ -93,6 +114,9 @@ declare const Project: Schema.Struct<{
93
114
  id: Schema.brand<typeof Schema.String, "ProjectId">;
94
115
  name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
95
116
  api_key_secret: typeof Schema.String;
117
+ subscription_tier: Schema.optional<Schema.Literal<["free", "pro", "enterprise"]>>;
118
+ subscription_status: Schema.optional<Schema.Literal<["active", "past_due", "canceled", "incomplete"]>>;
119
+ expires_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
96
120
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
97
121
  }>;
98
122
  type Project = Schema.Schema.Type<typeof Project>;
@@ -105,6 +129,43 @@ declare const Token: Schema.Struct<{
105
129
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
106
130
  }>;
107
131
  type Token = Schema.Schema.Type<typeof Token>;
132
+ /**
133
+ * ── AP2 Models ──
134
+ */
135
+ declare const Mandate: Schema.Struct<{
136
+ id: Schema.brand<typeof Schema.String, "MandateId">;
137
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
138
+ customer_id: Schema.NullOr<Schema.brand<typeof Schema.String, "CustomerId">>;
139
+ type: Schema.Literal<["intent", "cart"]>;
140
+ status: Schema.Literal<["active", "consumed", "expired", "violated"]>;
141
+ principal_id: typeof Schema.String;
142
+ max_amount: typeof Schema.Number;
143
+ currency: typeof Schema.String;
144
+ permitted_vendors: Schema.NullOr<Schema.Array$<typeof Schema.String>>;
145
+ valid_from: Schema.brand<typeof Schema.String, "Timestamp">;
146
+ valid_until: Schema.brand<typeof Schema.String, "Timestamp">;
147
+ credential_jwt: typeof Schema.String;
148
+ public_key: typeof Schema.String;
149
+ signature: typeof Schema.String;
150
+ parent_mandate_id: Schema.NullOr<Schema.brand<typeof Schema.String, "MandateId">>;
151
+ payment_id: Schema.NullOr<Schema.brand<typeof Schema.String, "PaymentId">>;
152
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
153
+ consumed_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
154
+ metadata_json: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
155
+ }>;
156
+ type Mandate = Schema.Schema.Type<typeof Mandate>;
157
+ declare const AgentSession: Schema.Struct<{
158
+ id: Schema.brand<typeof Schema.String, "AgentSessionId">;
159
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
160
+ context_id: typeof Schema.String;
161
+ agent_card_url: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
162
+ capabilities: typeof Schema.Any;
163
+ auth_scheme: Schema.Literal<["bearer", "mandate"]>;
164
+ status: typeof Schema.String;
165
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
166
+ expires_at: Schema.brand<typeof Schema.String, "Timestamp">;
167
+ }>;
168
+ type AgentSession = Schema.Schema.Type<typeof AgentSession>;
108
169
  /**
109
170
  * ── Pagination ──
110
171
  */
@@ -129,14 +190,15 @@ interface PaginatedResponse<T> {
129
190
  /**
130
191
  * ── Webhooks ──
131
192
  */
132
- declare const WebhookEventType: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
193
+ declare const WebhookEventType: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.activated", "subscription.renewed", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
133
194
  type WebhookEventType = Schema.Schema.Type<typeof WebhookEventType>;
134
195
  declare const WebhookEvent: Schema.Struct<{
135
- type: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
196
+ type: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.activated", "subscription.renewed", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
136
197
  id: Schema.optional<typeof Schema.String>;
137
198
  data: Schema.Union<[Schema.Struct<{
138
199
  id: Schema.brand<typeof Schema.String, "PaymentId">;
139
200
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
201
+ customer_id: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "CustomerId">>>;
140
202
  amount: typeof Schema.Number;
141
203
  currency: typeof Schema.String;
142
204
  status: Schema.Literal<["pending", "success", "failed"]>;
@@ -149,7 +211,7 @@ declare const WebhookEvent: Schema.Struct<{
149
211
  id: Schema.brand<typeof Schema.String, "SubscriptionId">;
150
212
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
151
213
  customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
152
- status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
214
+ status: Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>;
153
215
  amount: typeof Schema.Number;
154
216
  currency: typeof Schema.String;
155
217
  interval: Schema.Literal<["month", "year", "week"]>;
@@ -157,7 +219,9 @@ declare const WebhookEvent: Schema.Struct<{
157
219
  current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
158
220
  current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
159
221
  payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
222
+ customer_email: Schema.optional<Schema.NullOr<typeof Schema.String>>;
160
223
  auto_send_link: typeof Schema.Boolean;
224
+ grace_days: Schema.optional<typeof Schema.Number>;
161
225
  metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
162
226
  canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
163
227
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
@@ -170,6 +234,11 @@ declare const WebhookEvent: Schema.Struct<{
170
234
  phone: Schema.NullOr<typeof Schema.String>;
171
235
  project_id: Schema.brand<typeof Schema.String, "ProjectId">;
172
236
  metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
237
+ total_ltv: Schema.optional<typeof Schema.Number>;
238
+ is_high_value: Schema.optional<typeof Schema.Boolean>;
239
+ lifecycle_stage: Schema.optional<Schema.Literal<["new", "active", "loyal", "at_risk", "churned"]>>;
240
+ ltv_cents: Schema.optional<typeof Schema.Number>;
241
+ tier: Schema.NullOr<typeof Schema.String>;
173
242
  created_at: Schema.brand<typeof Schema.String, "Timestamp">;
174
243
  updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
175
244
  }>, Schema.Struct<{
@@ -187,22 +256,25 @@ type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
187
256
  * ── Params & Inputs ──
188
257
  */
189
258
  declare const CreateCheckoutParams: Schema.filter<Schema.Struct<{
190
- amount: Schema.optional<Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">>;
259
+ amount: Schema.optional<Schema.brand<Schema.filter<typeof Schema.Number>, "NprAmount">>;
191
260
  currency: Schema.optionalWith<typeof Schema.String, {
192
261
  default: () => string;
193
262
  }>;
194
- provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
263
+ provider: Schema.Literal<["esewa", "khalti", "hamropay", "connectips", "imepay", "fonepay", "sandbox"]>;
195
264
  returnUrl: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
196
265
  cancelUrl: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
197
266
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
198
267
  subscriptionId: Schema.optional<Schema.brand<typeof Schema.String, "SubscriptionId">>;
268
+ customerId: Schema.optional<Schema.brand<typeof Schema.String, "CustomerId">>;
269
+ mandate_id: Schema.optional<Schema.brand<typeof Schema.String, "MandateId">>;
199
270
  }>>;
200
271
  type CreateCheckoutParams = Schema.Schema.Type<typeof CreateCheckoutParams>;
201
272
  declare const CheckoutSession: Schema.Struct<{
202
273
  id: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
203
274
  checkout_url: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
275
+ qr_string: Schema.optional<typeof Schema.String>;
204
276
  payment_method: Schema.Struct<{
205
- type: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
277
+ type: Schema.Literal<["esewa", "khalti", "hamropay", "connectips", "imepay", "fonepay", "sandbox"]>;
206
278
  url: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
207
279
  method: Schema.optional<Schema.Literal<["GET", "POST"]>>;
208
280
  fields: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
@@ -236,18 +308,21 @@ declare const UpdateCustomerParams: Schema.Struct<{
236
308
  email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
237
309
  name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
238
310
  phone: Schema.optional<typeof Schema.String>;
311
+ tier: Schema.optional<typeof Schema.String>;
312
+ merchant_customer_id: Schema.optional<typeof Schema.String>;
239
313
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
240
314
  }>;
241
315
  type UpdateCustomerParams = Schema.Schema.Type<typeof UpdateCustomerParams>;
242
316
  declare const CreateSubscriptionParams: Schema.Struct<{
243
317
  customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
244
- amount: Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">;
318
+ amount: Schema.brand<Schema.filter<typeof Schema.Number>, "NprAmount">;
245
319
  currency: Schema.optionalWith<typeof Schema.String, {
246
320
  default: () => string;
247
321
  }>;
248
322
  interval: Schema.Literal<["month", "year", "week"]>;
249
323
  interval_count: Schema.optional<typeof Schema.Number>;
250
324
  project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
325
+ customer_email: Schema.optional<typeof Schema.String>;
251
326
  auto_send_link: Schema.optional<typeof Schema.Boolean>;
252
327
  metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
253
328
  }>;
@@ -256,6 +331,8 @@ declare const CallbackQueryParams: Schema.Struct<{
256
331
  payment_id: Schema.optional<typeof Schema.String>;
257
332
  data: Schema.optional<typeof Schema.String>;
258
333
  pidx: Schema.optional<typeof Schema.String>;
334
+ /** HamroPay-specific: the gateway's own transactionId returned on callback. */
335
+ ref_id: Schema.optional<typeof Schema.String>;
259
336
  }>;
260
337
  type CallbackQueryParams = Schema.Schema.Type<typeof CallbackQueryParams>;
261
338
  declare const ListSubscriptionsParams: Schema.Struct<{
@@ -263,11 +340,11 @@ declare const ListSubscriptionsParams: Schema.Struct<{
263
340
  offset: Schema.optional<typeof Schema.NumberFromString>;
264
341
  projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
265
342
  customerId: Schema.optional<Schema.brand<typeof Schema.String, "CustomerId">>;
266
- status: Schema.optional<Schema.Literal<["active", "past_due", "canceled", "paused"]>>;
343
+ status: Schema.optional<Schema.Literal<["pending_checkout", "active", "past_due", "canceled", "paused"]>>;
267
344
  }>;
268
345
  type ListSubscriptionsParams = Schema.Schema.Type<typeof ListSubscriptionsParams>;
269
346
  declare const RealtimeTriggerPayload: Schema.Struct<{
270
- event: Schema.optional<Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>>;
347
+ event: Schema.optional<Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.activated", "subscription.renewed", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>>;
271
348
  data: Schema.optional<typeof Schema.Any>;
272
349
  }>;
273
350
  type RealtimeTriggerPayload = Schema.Schema.Type<typeof RealtimeTriggerPayload>;
@@ -280,6 +357,7 @@ declare const PayArkConfig: Schema.Struct<{
280
357
  timeout: Schema.optional<typeof Schema.Number>;
281
358
  maxRetries: Schema.optional<typeof Schema.Number>;
282
359
  sandbox: Schema.optional<typeof Schema.Boolean>;
360
+ signingPrivateKey: Schema.optional<typeof Schema.String>;
283
361
  }>;
284
362
  type PayArkConfig = Schema.Schema.Type<typeof PayArkConfig>;
285
363
  /**
@@ -291,4 +369,4 @@ declare const PayArkErrorBody: Schema.Struct<{
291
369
  }>;
292
370
  type PayArkErrorBody = Schema.Schema.Type<typeof PayArkErrorBody>;
293
371
 
294
- export { CallbackQueryParams, CheckoutSession, CheckoutSessionId, CreateCheckoutParams, CreateCustomerParams, CreateSubscriptionParams, Customer, CustomerId, Email, Id, ListCustomersParams, ListPaymentsParams, ListSubscriptionsParams, Metadata, PaginatedResponse, PaginationMeta, PayArkConfig, PayArkErrorBody, Payment, PaymentId, PaymentStatus, Project, ProjectId, Provider, RealtimeTriggerPayload, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, Timestamp, Timestamps, Token, TokenId, UpdateCustomerParams, WebhookEvent, WebhookEventType };
372
+ export { AgentSession, AgentSessionId, CallbackQueryParams, CheckoutSession, CheckoutSessionId, CreateCheckoutParams, CreateCustomerParams, CreateSubscriptionParams, Customer, CustomerId, CustomerLifecycle, Email, Id, ListCustomersParams, ListPaymentsParams, ListSubscriptionsParams, Mandate, MandateId, MandateStatus, MandateType, Metadata, PaginatedResponse, PaginationMeta, PayArkConfig, PayArkErrorBody, Payment, PaymentId, PaymentStatus, Project, ProjectId, Provider, RealtimeTriggerPayload, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, Timestamp, Timestamps, Token, TokenId, UpdateCustomerParams, WebhookEvent, WebhookEventType };