pecunia-core 0.0.5 → 0.0.6
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/db/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as UsageAggregation, E as SubscriptionStatus, S as ProrationBehavior, b as PricingModel, c as BillingInterval, d as CollectionMethod, f as Currency, p as DiscountType, x as ProductType, y as PriceType } from "../errors-vpD21Iku.mjs";
|
|
2
|
-
import { a as initGetFieldAttributes, c as initGetDefaultModelName, i as initGetModelName, n as deepmerge, o as initGetIdField, r as withApplyDefault, s as initGetDefaultFieldName, t as getPaymentTables } from "../get-payment-tables-
|
|
2
|
+
import { a as initGetFieldAttributes, c as initGetDefaultModelName, i as initGetModelName, n as deepmerge, o as initGetIdField, r as withApplyDefault, s as initGetDefaultFieldName, t as getPaymentTables } from "../get-payment-tables-CAAnHVns.mjs";
|
|
3
3
|
import "../generate-id-D3ZvbbXn.mjs";
|
|
4
4
|
import z$1, { z } from "zod";
|
|
5
5
|
|
|
@@ -227,7 +227,7 @@ const getPaymentTables = (options) => {
|
|
|
227
227
|
required: false,
|
|
228
228
|
fieldName: "paymentMethodId",
|
|
229
229
|
references: {
|
|
230
|
-
model: "
|
|
230
|
+
model: "payment_method",
|
|
231
231
|
field: "id",
|
|
232
232
|
onDelete: "set null"
|
|
233
233
|
},
|
|
@@ -263,7 +263,7 @@ const getPaymentTables = (options) => {
|
|
|
263
263
|
relations: {
|
|
264
264
|
paymentMethods: {
|
|
265
265
|
kind: "many",
|
|
266
|
-
model: "
|
|
266
|
+
model: "payment_method",
|
|
267
267
|
foreignKey: "customerId"
|
|
268
268
|
},
|
|
269
269
|
paymentIntents: {
|
|
@@ -283,12 +283,12 @@ const getPaymentTables = (options) => {
|
|
|
283
283
|
},
|
|
284
284
|
transactions: {
|
|
285
285
|
kind: "many",
|
|
286
|
-
model: "
|
|
286
|
+
model: "transaction",
|
|
287
287
|
foreignKey: "customerId"
|
|
288
288
|
},
|
|
289
289
|
defaultPaymentMethod: {
|
|
290
290
|
kind: "one",
|
|
291
|
-
model: "
|
|
291
|
+
model: "payment_method",
|
|
292
292
|
foreignKey: "paymentMethodId"
|
|
293
293
|
}
|
|
294
294
|
},
|
|
@@ -393,7 +393,7 @@ const getPaymentTables = (options) => {
|
|
|
393
393
|
}
|
|
394
394
|
},
|
|
395
395
|
payment_method: {
|
|
396
|
-
modelName: "
|
|
396
|
+
modelName: "payment_method",
|
|
397
397
|
order: 2,
|
|
398
398
|
fields: {
|
|
399
399
|
id: {
|
|
@@ -1005,7 +1005,7 @@ const getPaymentTables = (options) => {
|
|
|
1005
1005
|
fieldName: "payment_method_id",
|
|
1006
1006
|
required: false,
|
|
1007
1007
|
references: {
|
|
1008
|
-
model: "
|
|
1008
|
+
model: "payment_method",
|
|
1009
1009
|
field: "id",
|
|
1010
1010
|
onDelete: "set null"
|
|
1011
1011
|
},
|
|
@@ -1241,7 +1241,7 @@ const getPaymentTables = (options) => {
|
|
|
1241
1241
|
},
|
|
1242
1242
|
checkoutSession: {
|
|
1243
1243
|
kind: "one",
|
|
1244
|
-
model: "
|
|
1244
|
+
model: "checkout_session",
|
|
1245
1245
|
foreignKey: "id"
|
|
1246
1246
|
},
|
|
1247
1247
|
customer: {
|
|
@@ -1251,7 +1251,7 @@ const getPaymentTables = (options) => {
|
|
|
1251
1251
|
},
|
|
1252
1252
|
paymentMethod: {
|
|
1253
1253
|
kind: "one",
|
|
1254
|
-
model: "
|
|
1254
|
+
model: "payment_method",
|
|
1255
1255
|
foreignKey: "paymentMethodId"
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
@@ -1645,8 +1645,8 @@ const getPaymentTables = (options) => {
|
|
|
1645
1645
|
defaultValue: Currency.KES,
|
|
1646
1646
|
sortable: true,
|
|
1647
1647
|
validator: {
|
|
1648
|
-
input: z.
|
|
1649
|
-
output: z.
|
|
1648
|
+
input: z.enum(Currency).optional(),
|
|
1649
|
+
output: z.enum(Currency)
|
|
1650
1650
|
}
|
|
1651
1651
|
},
|
|
1652
1652
|
invoiceBillingPeriodStart: {
|
|
@@ -2104,7 +2104,7 @@ const getPaymentTables = (options) => {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
},
|
|
2106
2106
|
webHookEndpoint: {
|
|
2107
|
-
modelName: "
|
|
2107
|
+
modelName: "webhook_endpoint",
|
|
2108
2108
|
order: 1,
|
|
2109
2109
|
fields: {
|
|
2110
2110
|
id: {
|
|
@@ -2244,7 +2244,7 @@ const getPaymentTables = (options) => {
|
|
|
2244
2244
|
fieldName: "endpoint_id",
|
|
2245
2245
|
required: true,
|
|
2246
2246
|
references: {
|
|
2247
|
-
model: "
|
|
2247
|
+
model: "webhook_endpoint",
|
|
2248
2248
|
field: "id",
|
|
2249
2249
|
onDelete: "cascade"
|
|
2250
2250
|
},
|
|
@@ -2259,7 +2259,7 @@ const getPaymentTables = (options) => {
|
|
|
2259
2259
|
fieldName: "event_id",
|
|
2260
2260
|
required: true,
|
|
2261
2261
|
references: {
|
|
2262
|
-
model: "
|
|
2262
|
+
model: "event",
|
|
2263
2263
|
field: "id",
|
|
2264
2264
|
onDelete: "cascade"
|
|
2265
2265
|
},
|
|
@@ -2423,7 +2423,7 @@ const getPaymentTables = (options) => {
|
|
|
2423
2423
|
relations: {
|
|
2424
2424
|
endpoint: {
|
|
2425
2425
|
kind: "one",
|
|
2426
|
-
model: "
|
|
2426
|
+
model: "webhook_endpoint",
|
|
2427
2427
|
foreignKey: "endpointId"
|
|
2428
2428
|
},
|
|
2429
2429
|
event: {
|
|
@@ -2624,13 +2624,13 @@ const getPaymentTables = (options) => {
|
|
|
2624
2624
|
},
|
|
2625
2625
|
sessionEvents: {
|
|
2626
2626
|
kind: "many",
|
|
2627
|
-
model: "
|
|
2627
|
+
model: "session_event",
|
|
2628
2628
|
foreignKey: "eventId"
|
|
2629
2629
|
}
|
|
2630
2630
|
}
|
|
2631
2631
|
},
|
|
2632
2632
|
sessionEvent: {
|
|
2633
|
-
modelName: "
|
|
2633
|
+
modelName: "session_event",
|
|
2634
2634
|
order: 1,
|
|
2635
2635
|
fields: {
|
|
2636
2636
|
id: {
|
|
@@ -2647,7 +2647,7 @@ const getPaymentTables = (options) => {
|
|
|
2647
2647
|
fieldName: "session_id",
|
|
2648
2648
|
required: true,
|
|
2649
2649
|
references: {
|
|
2650
|
-
model: "
|
|
2650
|
+
model: "checkout_session",
|
|
2651
2651
|
field: "id",
|
|
2652
2652
|
onDelete: "cascade"
|
|
2653
2653
|
},
|
|
@@ -2693,7 +2693,7 @@ const getPaymentTables = (options) => {
|
|
|
2693
2693
|
relations: {
|
|
2694
2694
|
session: {
|
|
2695
2695
|
kind: "one",
|
|
2696
|
-
model: "
|
|
2696
|
+
model: "checkout_session",
|
|
2697
2697
|
foreignKey: "sessionId"
|
|
2698
2698
|
},
|
|
2699
2699
|
event: {
|
|
@@ -2704,7 +2704,7 @@ const getPaymentTables = (options) => {
|
|
|
2704
2704
|
}
|
|
2705
2705
|
},
|
|
2706
2706
|
checkoutSession: {
|
|
2707
|
-
modelName: "
|
|
2707
|
+
modelName: "checkout_session",
|
|
2708
2708
|
order: 1,
|
|
2709
2709
|
fields: {
|
|
2710
2710
|
id: {
|
|
@@ -2785,7 +2785,7 @@ const getPaymentTables = (options) => {
|
|
|
2785
2785
|
fieldName: "payment_intent_id",
|
|
2786
2786
|
required: true,
|
|
2787
2787
|
references: {
|
|
2788
|
-
model: "
|
|
2788
|
+
model: "payment_intent",
|
|
2789
2789
|
field: "id",
|
|
2790
2790
|
onDelete: "cascade"
|
|
2791
2791
|
},
|
|
@@ -2870,7 +2870,7 @@ const getPaymentTables = (options) => {
|
|
|
2870
2870
|
relations: {
|
|
2871
2871
|
events: {
|
|
2872
2872
|
kind: "many",
|
|
2873
|
-
model: "
|
|
2873
|
+
model: "session_event",
|
|
2874
2874
|
foreignKey: "sessionId"
|
|
2875
2875
|
},
|
|
2876
2876
|
customer: {
|
|
@@ -3141,18 +3141,18 @@ const getPaymentTables = (options) => {
|
|
|
3141
3141
|
},
|
|
3142
3142
|
checkoutSession: {
|
|
3143
3143
|
kind: "one",
|
|
3144
|
-
model: "
|
|
3144
|
+
model: "checkout_session",
|
|
3145
3145
|
foreignKey: "id"
|
|
3146
3146
|
},
|
|
3147
3147
|
transaction: {
|
|
3148
3148
|
kind: "one",
|
|
3149
|
-
model: "
|
|
3149
|
+
model: "transaction",
|
|
3150
3150
|
foreignKey: "id"
|
|
3151
3151
|
}
|
|
3152
3152
|
}
|
|
3153
3153
|
},
|
|
3154
3154
|
transaction: {
|
|
3155
|
-
modelName: "
|
|
3155
|
+
modelName: "transaction",
|
|
3156
3156
|
order: 1,
|
|
3157
3157
|
fields: {
|
|
3158
3158
|
id: {
|
|
@@ -3356,18 +3356,18 @@ const getPaymentTables = (options) => {
|
|
|
3356
3356
|
},
|
|
3357
3357
|
reversedBy: {
|
|
3358
3358
|
kind: "one",
|
|
3359
|
-
model: "
|
|
3359
|
+
model: "transaction",
|
|
3360
3360
|
foreignKey: "reversedById"
|
|
3361
3361
|
},
|
|
3362
3362
|
reverses: {
|
|
3363
3363
|
kind: "many",
|
|
3364
|
-
model: "
|
|
3364
|
+
model: "transaction",
|
|
3365
3365
|
foreignKey: "reversedById"
|
|
3366
3366
|
}
|
|
3367
3367
|
}
|
|
3368
3368
|
},
|
|
3369
3369
|
scheduledTask: {
|
|
3370
|
-
modelName: "
|
|
3370
|
+
modelName: "scheduled_task",
|
|
3371
3371
|
order: 1,
|
|
3372
3372
|
fields: {
|
|
3373
3373
|
id: {
|
|
@@ -3545,7 +3545,7 @@ const getPaymentTables = (options) => {
|
|
|
3545
3545
|
}]
|
|
3546
3546
|
},
|
|
3547
3547
|
auditLog: {
|
|
3548
|
-
modelName: "
|
|
3548
|
+
modelName: "audit_log",
|
|
3549
3549
|
order: 1,
|
|
3550
3550
|
fields: {
|
|
3551
3551
|
id: {
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { a as defineRequestState, c as hasRequestState, d as getCurrentPaymentCo
|
|
|
2
2
|
import { t as getAsyncLocalStorage } from "./async_hooks-D8vqDJIk.mjs";
|
|
3
3
|
import { i as useMiddleware, n as createPecuniaMiddleware, r as optionsMiddleware, t as createPaymentEndpoint } from "./api-BlJV5ZQo.mjs";
|
|
4
4
|
import { A as UsageAggregation, C as ScheduleStatus, D as TransactionStatus, E as SubscriptionStatus, M as WebHookEventStatus, N as statusCodes, O as TransactionType, P as ErrorType, S as ProrationBehavior, T as ScheduledTaskType, _ as PaymentIntentStatus, a as AccountType, b as PricingModel, c as BillingInterval, d as CollectionMethod, f as Currency, g as LedgerEntryType, h as InvoiceStatus, i as createProviderError, j as WebHookDeliveryTrigger, k as UsageAction, l as CheckoutSessionMode, m as ERROR_REGISTRY, n as PecuniaError, o as Actor, p as DiscountType, r as ValidationError, s as AuditAction, t as ApiError, u as CheckoutSessionStatus, v as PaymentProviders, w as ScheduledTaskStatus, x as ProductType, y as PriceType } from "./errors-vpD21Iku.mjs";
|
|
5
|
-
import { a as initGetFieldAttributes, c as initGetDefaultModelName, i as initGetModelName, n as deepmerge, o as initGetIdField, r as withApplyDefault, s as initGetDefaultFieldName, t as getPaymentTables } from "./get-payment-tables-
|
|
5
|
+
import { a as initGetFieldAttributes, c as initGetDefaultModelName, i as initGetModelName, n as deepmerge, o as initGetIdField, r as withApplyDefault, s as initGetDefaultFieldName, t as getPaymentTables } from "./get-payment-tables-CAAnHVns.mjs";
|
|
6
6
|
import { t as generateId } from "./generate-id-D3ZvbbXn.mjs";
|
|
7
7
|
import { customerSchema, discountSchema, initGetFieldName, priceSchema, productSchema, sharedCoreSchema, sharedDeletableSchema, subscriptionSchema } from "./db/index.mjs";
|
|
8
8
|
import { a as shouldPublishLog, c as env, d as isDevelopment, f as isProduction, i as logger, l as getBooleanEnvVar, m as nodeENV, n as createLogger, o as getColorDepth, p as isTest, r as levels, s as ENV, t as TTY_COLORS, u as getEnvVar } from "./env-ChlcfGdT.mjs";
|
package/dist/types/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { f as runWithEndpointContext } from "../context-COLduJme.mjs";
|
|
|
2
2
|
import "../async_hooks-D8vqDJIk.mjs";
|
|
3
3
|
import { i as useMiddleware } from "../api-BlJV5ZQo.mjs";
|
|
4
4
|
import { P as ErrorType, n as PecuniaError } from "../errors-vpD21Iku.mjs";
|
|
5
|
-
import { a as initGetFieldAttributes, c as initGetDefaultModelName, i as initGetModelName, o as initGetIdField, r as withApplyDefault, s as initGetDefaultFieldName, t as getPaymentTables } from "../get-payment-tables-
|
|
5
|
+
import { a as initGetFieldAttributes, c as initGetDefaultModelName, i as initGetModelName, o as initGetIdField, r as withApplyDefault, s as initGetDefaultFieldName, t as getPaymentTables } from "../get-payment-tables-CAAnHVns.mjs";
|
|
6
6
|
import "../generate-id-D3ZvbbXn.mjs";
|
|
7
7
|
import "../env-ChlcfGdT.mjs";
|
|
8
8
|
import { n as safeJSONParse } from "../utils-BtfYqMRX.mjs";
|