@coursebuilder/adapter-drizzle 0.5.1 → 0.5.2
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/{chunk-7ISZNMPU.js → chunk-27UC2HEP.js} +2 -2
- package/dist/{chunk-UK6EHYS5.js → chunk-6SLQW6OM.js} +2 -2
- package/dist/{chunk-7X7TMG4A.js → chunk-EFVZ7IN4.js} +2 -2
- package/dist/{chunk-UHH4OVKA.js → chunk-JW2PFVLO.js} +482 -210
- package/dist/{chunk-QPXUGIXO.js → chunk-QQA7STVO.js} +2 -2
- package/dist/{chunk-DAP5KOAO.js → chunk-XJXCDN7B.js} +2 -2
- package/dist/{chunk-KDOSK7KN.js → chunk-YMFPIZMO.js} +2 -2
- package/dist/{chunk-VUS77FG3.js → chunk-ZYQYJNLK.js} +88 -12
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -8
- package/dist/lib/mysql/index.cjs +878 -546
- package/dist/lib/mysql/index.cjs.map +1 -1
- package/dist/lib/mysql/index.d.cts +3123 -80
- package/dist/lib/mysql/index.d.ts +3123 -80
- package/dist/lib/mysql/index.js +8 -8
- package/dist/lib/mysql/schemas/auth/accounts.cjs +87 -71
- package/dist/lib/mysql/schemas/auth/accounts.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/accounts.d.cts +58 -1
- package/dist/lib/mysql/schemas/auth/accounts.d.ts +58 -1
- package/dist/lib/mysql/schemas/auth/accounts.js +1 -1
- package/dist/lib/mysql/schemas/auth/device-access-token.cjs +79 -63
- package/dist/lib/mysql/schemas/auth/device-access-token.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/device-access-token.d.cts +12 -0
- package/dist/lib/mysql/schemas/auth/device-access-token.d.ts +12 -0
- package/dist/lib/mysql/schemas/auth/device-access-token.js +2 -2
- package/dist/lib/mysql/schemas/auth/device-verification.cjs +81 -65
- package/dist/lib/mysql/schemas/auth/device-verification.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/device-verification.d.cts +24 -0
- package/dist/lib/mysql/schemas/auth/device-verification.d.ts +24 -0
- package/dist/lib/mysql/schemas/auth/device-verification.js +2 -2
- package/dist/lib/mysql/schemas/auth/permissions.d.cts +28 -0
- package/dist/lib/mysql/schemas/auth/permissions.d.ts +28 -0
- package/dist/lib/mysql/schemas/auth/role-permissions.cjs +76 -60
- package/dist/lib/mysql/schemas/auth/role-permissions.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/role-permissions.d.cts +24 -0
- package/dist/lib/mysql/schemas/auth/role-permissions.d.ts +24 -0
- package/dist/lib/mysql/schemas/auth/role-permissions.js +2 -2
- package/dist/lib/mysql/schemas/auth/roles.cjs +76 -60
- package/dist/lib/mysql/schemas/auth/roles.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/roles.d.cts +28 -0
- package/dist/lib/mysql/schemas/auth/roles.d.ts +28 -0
- package/dist/lib/mysql/schemas/auth/roles.js +1 -1
- package/dist/lib/mysql/schemas/auth/sessions.cjs +77 -61
- package/dist/lib/mysql/schemas/auth/sessions.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/sessions.d.cts +12 -0
- package/dist/lib/mysql/schemas/auth/sessions.d.ts +12 -0
- package/dist/lib/mysql/schemas/auth/sessions.js +2 -2
- package/dist/lib/mysql/schemas/auth/user-permissions.cjs +78 -62
- package/dist/lib/mysql/schemas/auth/user-permissions.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/user-permissions.d.cts +24 -0
- package/dist/lib/mysql/schemas/auth/user-permissions.d.ts +24 -0
- package/dist/lib/mysql/schemas/auth/user-permissions.js +1 -1
- package/dist/lib/mysql/schemas/auth/user-prefs.cjs +82 -66
- package/dist/lib/mysql/schemas/auth/user-prefs.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/user-prefs.d.cts +28 -0
- package/dist/lib/mysql/schemas/auth/user-prefs.d.ts +28 -0
- package/dist/lib/mysql/schemas/auth/user-prefs.js +1 -1
- package/dist/lib/mysql/schemas/auth/user-roles.cjs +78 -62
- package/dist/lib/mysql/schemas/auth/user-roles.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/user-roles.d.cts +24 -0
- package/dist/lib/mysql/schemas/auth/user-roles.d.ts +24 -0
- package/dist/lib/mysql/schemas/auth/user-roles.js +1 -1
- package/dist/lib/mysql/schemas/auth/users.cjs +179 -159
- package/dist/lib/mysql/schemas/auth/users.cjs.map +1 -1
- package/dist/lib/mysql/schemas/auth/users.d.cts +32 -0
- package/dist/lib/mysql/schemas/auth/users.d.ts +32 -0
- package/dist/lib/mysql/schemas/auth/users.js +1 -1
- package/dist/lib/mysql/schemas/auth/verification-tokens.d.cts +16 -0
- package/dist/lib/mysql/schemas/auth/verification-tokens.d.ts +16 -0
- package/dist/lib/mysql/schemas/commerce/coupon.cjs +54 -38
- package/dist/lib/mysql/schemas/commerce/coupon.cjs.map +1 -1
- package/dist/lib/mysql/schemas/commerce/coupon.d.cts +48 -0
- package/dist/lib/mysql/schemas/commerce/coupon.d.ts +48 -0
- package/dist/lib/mysql/schemas/commerce/coupon.js +1 -1
- package/dist/lib/mysql/schemas/commerce/merchant-account.d.cts +20 -0
- package/dist/lib/mysql/schemas/commerce/merchant-account.d.ts +20 -0
- package/dist/lib/mysql/schemas/commerce/merchant-charge.d.cts +32 -0
- package/dist/lib/mysql/schemas/commerce/merchant-charge.d.ts +32 -0
- package/dist/lib/mysql/schemas/commerce/merchant-coupon.d.cts +24 -0
- package/dist/lib/mysql/schemas/commerce/merchant-coupon.d.ts +24 -0
- package/dist/lib/mysql/schemas/commerce/merchant-customer.d.cts +24 -0
- package/dist/lib/mysql/schemas/commerce/merchant-customer.d.ts +24 -0
- package/dist/lib/mysql/schemas/commerce/merchant-price.d.cts +28 -0
- package/dist/lib/mysql/schemas/commerce/merchant-price.d.ts +28 -0
- package/dist/lib/mysql/schemas/commerce/merchant-product.d.cts +24 -0
- package/dist/lib/mysql/schemas/commerce/merchant-product.d.ts +24 -0
- package/dist/lib/mysql/schemas/commerce/merchant-session.d.cts +12 -0
- package/dist/lib/mysql/schemas/commerce/merchant-session.d.ts +12 -0
- package/dist/lib/mysql/schemas/commerce/price.cjs +44 -28
- package/dist/lib/mysql/schemas/commerce/price.cjs.map +1 -1
- package/dist/lib/mysql/schemas/commerce/price.d.cts +28 -0
- package/dist/lib/mysql/schemas/commerce/price.d.ts +28 -0
- package/dist/lib/mysql/schemas/commerce/price.js +1 -1
- package/dist/lib/mysql/schemas/commerce/product.cjs +58 -42
- package/dist/lib/mysql/schemas/commerce/product.cjs.map +1 -1
- package/dist/lib/mysql/schemas/commerce/product.d.cts +32 -0
- package/dist/lib/mysql/schemas/commerce/product.d.ts +32 -0
- package/dist/lib/mysql/schemas/commerce/product.js +1 -1
- package/dist/lib/mysql/schemas/commerce/purchase-user-transfer.cjs +106 -90
- package/dist/lib/mysql/schemas/commerce/purchase-user-transfer.cjs.map +1 -1
- package/dist/lib/mysql/schemas/commerce/purchase-user-transfer.d.cts +40 -0
- package/dist/lib/mysql/schemas/commerce/purchase-user-transfer.d.ts +40 -0
- package/dist/lib/mysql/schemas/commerce/purchase-user-transfer.js +2 -2
- package/dist/lib/mysql/schemas/commerce/purchase.cjs +110 -94
- package/dist/lib/mysql/schemas/commerce/purchase.cjs.map +1 -1
- package/dist/lib/mysql/schemas/commerce/purchase.d.cts +68 -0
- package/dist/lib/mysql/schemas/commerce/purchase.d.ts +68 -0
- package/dist/lib/mysql/schemas/commerce/purchase.js +1 -1
- package/dist/lib/mysql/schemas/commerce/upgradable-products.cjs +50 -34
- package/dist/lib/mysql/schemas/commerce/upgradable-products.cjs.map +1 -1
- package/dist/lib/mysql/schemas/commerce/upgradable-products.d.cts +28 -0
- package/dist/lib/mysql/schemas/commerce/upgradable-products.d.ts +28 -0
- package/dist/lib/mysql/schemas/commerce/upgradable-products.js +2 -2
- package/dist/lib/mysql/schemas/communication/comment.cjs +82 -66
- package/dist/lib/mysql/schemas/communication/comment.cjs.map +1 -1
- package/dist/lib/mysql/schemas/communication/comment.d.cts +28 -0
- package/dist/lib/mysql/schemas/communication/comment.d.ts +28 -0
- package/dist/lib/mysql/schemas/communication/comment.js +1 -1
- package/dist/lib/mysql/schemas/communication/communication-channel.d.cts +28 -0
- package/dist/lib/mysql/schemas/communication/communication-channel.d.ts +28 -0
- package/dist/lib/mysql/schemas/communication/communication-preference-types.d.cts +28 -0
- package/dist/lib/mysql/schemas/communication/communication-preference-types.d.ts +28 -0
- package/dist/lib/mysql/schemas/communication/communication-preferences.cjs +100 -84
- package/dist/lib/mysql/schemas/communication/communication-preferences.cjs.map +1 -1
- package/dist/lib/mysql/schemas/communication/communication-preferences.d.cts +44 -0
- package/dist/lib/mysql/schemas/communication/communication-preferences.d.ts +44 -0
- package/dist/lib/mysql/schemas/communication/communication-preferences.js +1 -1
- package/dist/lib/mysql/schemas/content/content-contributions.cjs +112 -92
- package/dist/lib/mysql/schemas/content/content-contributions.cjs.map +1 -1
- package/dist/lib/mysql/schemas/content/content-contributions.d.cts +32 -0
- package/dist/lib/mysql/schemas/content/content-contributions.d.ts +32 -0
- package/dist/lib/mysql/schemas/content/content-contributions.js +1 -1
- package/dist/lib/mysql/schemas/content/content-resource-product.cjs +49 -29
- package/dist/lib/mysql/schemas/content/content-resource-product.cjs.map +1 -1
- package/dist/lib/mysql/schemas/content/content-resource-product.d.cts +28 -0
- package/dist/lib/mysql/schemas/content/content-resource-product.d.ts +28 -0
- package/dist/lib/mysql/schemas/content/content-resource-product.js +1 -1
- package/dist/lib/mysql/schemas/content/content-resource-resource.cjs +49 -29
- package/dist/lib/mysql/schemas/content/content-resource-resource.cjs.map +1 -1
- package/dist/lib/mysql/schemas/content/content-resource-resource.d.cts +28 -0
- package/dist/lib/mysql/schemas/content/content-resource-resource.d.ts +28 -0
- package/dist/lib/mysql/schemas/content/content-resource-resource.js +1 -1
- package/dist/lib/mysql/schemas/content/content-resource-tag.cjs +274 -0
- package/dist/lib/mysql/schemas/content/content-resource-tag.cjs.map +1 -0
- package/dist/lib/mysql/schemas/content/content-resource-tag.d.cts +97 -0
- package/dist/lib/mysql/schemas/content/content-resource-tag.d.ts +97 -0
- package/dist/lib/mysql/schemas/content/content-resource-tag.js +21 -0
- package/dist/lib/mysql/schemas/content/content-resource-tag.js.map +1 -0
- package/dist/lib/mysql/schemas/content/content-resource-version.cjs +288 -0
- package/dist/lib/mysql/schemas/content/content-resource-version.cjs.map +1 -0
- package/dist/lib/mysql/schemas/content/content-resource-version.d.cts +130 -0
- package/dist/lib/mysql/schemas/content/content-resource-version.d.ts +130 -0
- package/dist/lib/mysql/schemas/content/content-resource-version.js +21 -0
- package/dist/lib/mysql/schemas/content/content-resource-version.js.map +1 -0
- package/dist/lib/mysql/schemas/content/content-resource.cjs +141 -15
- package/dist/lib/mysql/schemas/content/content-resource.cjs.map +1 -1
- package/dist/lib/mysql/schemas/content/content-resource.d.cts +47 -0
- package/dist/lib/mysql/schemas/content/content-resource.d.ts +47 -0
- package/dist/lib/mysql/schemas/content/content-resource.js +1 -1
- package/dist/lib/mysql/schemas/content/contribution-types.d.cts +32 -0
- package/dist/lib/mysql/schemas/content/contribution-types.d.ts +32 -0
- package/dist/lib/mysql/schemas/content/lesson-progress.d.cts +40 -0
- package/dist/lib/mysql/schemas/content/lesson-progress.d.ts +40 -0
- package/dist/lib/mysql/schemas/content/resource-progress.d.cts +24 -0
- package/dist/lib/mysql/schemas/content/resource-progress.d.ts +24 -0
- package/dist/lib/mysql/schemas/content/tag-tag.cjs +241 -0
- package/dist/lib/mysql/schemas/content/tag-tag.cjs.map +1 -0
- package/dist/lib/mysql/schemas/content/tag-tag.d.cts +129 -0
- package/dist/lib/mysql/schemas/content/tag-tag.d.ts +129 -0
- package/dist/lib/mysql/schemas/content/tag-tag.js +21 -0
- package/dist/lib/mysql/schemas/content/tag-tag.js.map +1 -0
- package/dist/lib/mysql/schemas/content/tag.cjs +263 -0
- package/dist/lib/mysql/schemas/content/tag.cjs.map +1 -0
- package/dist/lib/mysql/schemas/content/tag.d.cts +114 -0
- package/dist/lib/mysql/schemas/content/tag.d.ts +114 -0
- package/dist/lib/mysql/schemas/content/tag.js +21 -0
- package/dist/lib/mysql/schemas/content/tag.js.map +1 -0
- package/dist/lib/mysql/utils.d.cts +1 -0
- package/dist/lib/mysql/utils.d.ts +1 -0
- package/dist/lib/utils.d.cts +1 -0
- package/dist/lib/utils.d.ts +1 -0
- package/package.json +6 -6
- package/src/lib/mysql/index.ts +117 -0
- package/src/lib/mysql/schemas/content/content-resource-tag.ts +59 -0
- package/src/lib/mysql/schemas/content/content-resource-version.ts +69 -0
- package/src/lib/mysql/schemas/content/content-resource.ts +17 -0
- package/src/lib/mysql/schemas/content/tag-tag.ts +59 -0
- package/src/lib/mysql/schemas/content/tag.ts +48 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRolesSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JW2PFVLO.js";
|
|
4
4
|
import {
|
|
5
5
|
getPermissionsSchema
|
|
6
6
|
} from "./chunk-LZHZDFNZ.js";
|
|
@@ -75,4 +75,4 @@ export {
|
|
|
75
75
|
getRolePermissionsSchema,
|
|
76
76
|
getRolePermissionsRelationsSchema
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-QQA7STVO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPurchaseSchema,
|
|
3
3
|
getUsersSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JW2PFVLO.js";
|
|
5
5
|
import {
|
|
6
6
|
__name
|
|
7
7
|
} from "./chunk-H736K5TN.js";
|
|
@@ -104,4 +104,4 @@ export {
|
|
|
104
104
|
getPurchaseUserTransferSchema,
|
|
105
105
|
getPurchaseUserTransferRelationsSchema
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-XJXCDN7B.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getUsersSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JW2PFVLO.js";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-H736K5TN.js";
|
|
@@ -59,4 +59,4 @@ export {
|
|
|
59
59
|
getDeviceVerificationSchema,
|
|
60
60
|
getDeviceVerificationRelationsSchema
|
|
61
61
|
};
|
|
62
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-YMFPIZMO.js.map
|
|
@@ -7,30 +7,30 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
getPurchaseUserTransferRelationsSchema,
|
|
9
9
|
getPurchaseUserTransferSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XJXCDN7B.js";
|
|
11
11
|
import {
|
|
12
12
|
getUpgradableProductsRelationsSchema,
|
|
13
13
|
getUpgradableProductsSchema
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-27UC2HEP.js";
|
|
15
15
|
import {
|
|
16
16
|
getRolePermissionsRelationsSchema,
|
|
17
17
|
getRolePermissionsSchema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QQA7STVO.js";
|
|
19
19
|
import {
|
|
20
20
|
getSessionRelationsSchema,
|
|
21
21
|
getSessionsSchema
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EFVZ7IN4.js";
|
|
23
23
|
import {
|
|
24
24
|
getVerificationTokensSchema
|
|
25
25
|
} from "./chunk-LERR6HQ3.js";
|
|
26
26
|
import {
|
|
27
27
|
getDeviceAccessTokenRelationsSchema,
|
|
28
28
|
getDeviceAccessTokenSchema
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6SLQW6OM.js";
|
|
30
30
|
import {
|
|
31
31
|
getDeviceVerificationRelationsSchema,
|
|
32
32
|
getDeviceVerificationSchema
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-YMFPIZMO.js";
|
|
34
34
|
import {
|
|
35
35
|
getAccountsRelationsSchema,
|
|
36
36
|
getAccountsSchema,
|
|
@@ -46,6 +46,10 @@ import {
|
|
|
46
46
|
getContentResourceResourceRelationsSchema,
|
|
47
47
|
getContentResourceResourceSchema,
|
|
48
48
|
getContentResourceSchema,
|
|
49
|
+
getContentResourceTagRelationsSchema,
|
|
50
|
+
getContentResourceTagSchema,
|
|
51
|
+
getContentResourceVersionRelationsSchema,
|
|
52
|
+
getContentResourceVersionSchema,
|
|
49
53
|
getCouponRelationsSchema,
|
|
50
54
|
getCouponSchema,
|
|
51
55
|
getPriceSchema,
|
|
@@ -55,6 +59,10 @@ import {
|
|
|
55
59
|
getPurchaseSchema,
|
|
56
60
|
getRolesRelationsSchema,
|
|
57
61
|
getRolesSchema,
|
|
62
|
+
getTagRelationsSchema,
|
|
63
|
+
getTagSchema,
|
|
64
|
+
getTagTagRelationsSchema,
|
|
65
|
+
getTagTagSchema,
|
|
58
66
|
getUserPermissionsRelationsSchema,
|
|
59
67
|
getUserPermissionsSchema,
|
|
60
68
|
getUserPrefsRelationsSchema,
|
|
@@ -63,7 +71,7 @@ import {
|
|
|
63
71
|
getUserRolesSchema,
|
|
64
72
|
getUsersRelationsSchema,
|
|
65
73
|
getUsersSchema
|
|
66
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-JW2PFVLO.js";
|
|
67
75
|
import {
|
|
68
76
|
getContributionTypesRelationsSchema,
|
|
69
77
|
getContributionTypesSchema
|
|
@@ -8182,7 +8190,7 @@ var priceSchema = z2.object({
|
|
|
8182
8190
|
fields: z2.record(z2.any()).default({})
|
|
8183
8191
|
});
|
|
8184
8192
|
|
|
8185
|
-
// ../core/dist/chunk-
|
|
8193
|
+
// ../core/dist/chunk-6BXXN6IV.js
|
|
8186
8194
|
var ContentResourceResourceSchema = z2.object({
|
|
8187
8195
|
resourceId: z2.string(),
|
|
8188
8196
|
resourceOfId: z2.string(),
|
|
@@ -8197,6 +8205,7 @@ var ContentResourceSchema = z2.object({
|
|
|
8197
8205
|
id: z2.string(),
|
|
8198
8206
|
type: z2.string(),
|
|
8199
8207
|
createdById: z2.string(),
|
|
8208
|
+
currentVersionId: z2.string().nullish(),
|
|
8200
8209
|
fields: z2.record(z2.string(), z2.any()).default({}).nullable().optional(),
|
|
8201
8210
|
createdAt: z2.coerce.date().nullable(),
|
|
8202
8211
|
updatedAt: z2.coerce.date().nullable(),
|
|
@@ -8226,7 +8235,7 @@ var ResourceVisibilitySchema = z2.union([
|
|
|
8226
8235
|
z2.literal("unlisted")
|
|
8227
8236
|
]);
|
|
8228
8237
|
|
|
8229
|
-
// ../core/dist/chunk-
|
|
8238
|
+
// ../core/dist/chunk-LVVTCZ7P.js
|
|
8230
8239
|
var productSchema = z2.object({
|
|
8231
8240
|
id: z2.string().max(191),
|
|
8232
8241
|
name: z2.string().max(191),
|
|
@@ -8292,7 +8301,7 @@ var couponSchema = z2.object({
|
|
|
8292
8301
|
bulkPurchaseId: z2.string().max(191).optional().nullable()
|
|
8293
8302
|
});
|
|
8294
8303
|
|
|
8295
|
-
// ../core/dist/chunk-
|
|
8304
|
+
// ../core/dist/chunk-ACXDXYNY.js
|
|
8296
8305
|
var purchaseSchema = z2.object({
|
|
8297
8306
|
id: z2.string().max(191),
|
|
8298
8307
|
userId: z2.string().max(191).optional().nullable(),
|
|
@@ -8341,7 +8350,7 @@ var purchaseUserTransferSchema = z2.object({
|
|
|
8341
8350
|
completedAt: z2.date().nullable()
|
|
8342
8351
|
});
|
|
8343
8352
|
|
|
8344
|
-
// ../core/dist/chunk-
|
|
8353
|
+
// ../core/dist/chunk-6BTTEQD2.js
|
|
8345
8354
|
var resourceProgressSchema = z2.object({
|
|
8346
8355
|
userId: z2.string().max(191),
|
|
8347
8356
|
resourceId: z2.string().max(191).optional().nullable(),
|
|
@@ -8605,9 +8614,13 @@ function getCourseBuilderSchema(mysqlTable) {
|
|
|
8605
8614
|
contentContributions: getContentContributionsSchema(mysqlTable),
|
|
8606
8615
|
contentContributionRelations: getContentContributionRelationsSchema(mysqlTable),
|
|
8607
8616
|
contentResource: getContentResourceSchema(mysqlTable),
|
|
8617
|
+
contentResourceVersion: getContentResourceVersionSchema(mysqlTable),
|
|
8618
|
+
contentResourceVersionRelations: getContentResourceVersionRelationsSchema(mysqlTable),
|
|
8608
8619
|
contentResourceRelations: getContentResourceRelationsSchema(mysqlTable),
|
|
8609
8620
|
contentResourceResource: getContentResourceResourceSchema(mysqlTable),
|
|
8610
8621
|
contentResourceResourceRelations: getContentResourceResourceRelationsSchema(mysqlTable),
|
|
8622
|
+
contentResourceTag: getContentResourceTagSchema(mysqlTable),
|
|
8623
|
+
contentResourceTagRelations: getContentResourceTagRelationsSchema(mysqlTable),
|
|
8611
8624
|
contributionTypes: getContributionTypesSchema(mysqlTable),
|
|
8612
8625
|
contributionTypesRelations: getContributionTypesRelationsSchema(mysqlTable),
|
|
8613
8626
|
resourceProgress: getResourceProgressSchema(mysqlTable),
|
|
@@ -8622,6 +8635,10 @@ function getCourseBuilderSchema(mysqlTable) {
|
|
|
8622
8635
|
deviceVerificationRelations: getDeviceVerificationRelationsSchema(mysqlTable),
|
|
8623
8636
|
deviceAccessToken: getDeviceAccessTokenSchema(mysqlTable),
|
|
8624
8637
|
deviceAccessTokenRelations: getDeviceAccessTokenRelationsSchema(mysqlTable),
|
|
8638
|
+
tag: getTagSchema(mysqlTable),
|
|
8639
|
+
tagRelations: getTagRelationsSchema(mysqlTable),
|
|
8640
|
+
tagTag: getTagTagSchema(mysqlTable),
|
|
8641
|
+
tagTagRelations: getTagTagRelationsSchema(mysqlTable),
|
|
8625
8642
|
userPrefs: getUserPrefsSchema(mysqlTable),
|
|
8626
8643
|
userPrefsRelations: getUserPrefsRelationsSchema(mysqlTable)
|
|
8627
8644
|
};
|
|
@@ -9725,6 +9742,65 @@ function mySqlDrizzleAdapter(client, tableFn = defaultMySqlTableFn, paymentProvi
|
|
|
9725
9742
|
}
|
|
9726
9743
|
return parsedLessonProgress.data;
|
|
9727
9744
|
},
|
|
9745
|
+
transferPurchaseToUser: async (options) => {
|
|
9746
|
+
const { purchaseId, targetUserId, sourceUserId } = options;
|
|
9747
|
+
const transferId = `put_${v4()}`;
|
|
9748
|
+
let purchase = await adapter.getPurchase(purchaseId);
|
|
9749
|
+
if (!purchase)
|
|
9750
|
+
throw new Error("No purchase found");
|
|
9751
|
+
if (purchase.userId !== sourceUserId)
|
|
9752
|
+
throw new Error("Invalid source user");
|
|
9753
|
+
await client.transaction(async (trx) => {
|
|
9754
|
+
if (!purchase)
|
|
9755
|
+
throw new Error("No purchase found");
|
|
9756
|
+
await trx.update(purchaseTable).set({
|
|
9757
|
+
userId: targetUserId
|
|
9758
|
+
}).where(eq(purchaseTable.id, purchase.id));
|
|
9759
|
+
await trx.insert(purchaseUserTransfer).values({
|
|
9760
|
+
id: transferId,
|
|
9761
|
+
purchaseId: purchase.id,
|
|
9762
|
+
sourceUserId,
|
|
9763
|
+
targetUserId,
|
|
9764
|
+
transferState: "COMPLETED",
|
|
9765
|
+
completedAt: /* @__PURE__ */ new Date()
|
|
9766
|
+
});
|
|
9767
|
+
purchase = await adapter.getPurchase(purchaseId);
|
|
9768
|
+
if (!purchase)
|
|
9769
|
+
throw new Error("No purchase found");
|
|
9770
|
+
if (paymentProvider && purchase.merchantChargeId) {
|
|
9771
|
+
await trx.update(merchantCharge).set({
|
|
9772
|
+
userId: targetUserId
|
|
9773
|
+
}).where(eq(merchantCharge.id, purchase.merchantChargeId));
|
|
9774
|
+
const updatedMerchantCharge = await adapter.getMerchantCharge(purchase.merchantChargeId);
|
|
9775
|
+
if (!updatedMerchantCharge)
|
|
9776
|
+
throw new Error("No merchant charge found");
|
|
9777
|
+
await trx.update(merchantCustomer).set({
|
|
9778
|
+
userId: targetUserId
|
|
9779
|
+
}).where(eq(merchantCustomer.id, updatedMerchantCharge.merchantCustomerId));
|
|
9780
|
+
const updatedMerchantCustomer = merchantCustomerSchema.parse(await client.query.merchantCustomer.findFirst({
|
|
9781
|
+
where: eq(merchantCustomer.id, updatedMerchantCharge.merchantCustomerId)
|
|
9782
|
+
}));
|
|
9783
|
+
const targetUser = userSchema.parse(await client.query.users.findFirst({
|
|
9784
|
+
where: eq(users.id, targetUserId)
|
|
9785
|
+
}));
|
|
9786
|
+
const sourceUser = userSchema.parse(await client.query.users.findFirst({
|
|
9787
|
+
where: eq(users.id, sourceUserId)
|
|
9788
|
+
}));
|
|
9789
|
+
await paymentProvider.updateCustomer(updatedMerchantCustomer.identifier, {
|
|
9790
|
+
email: targetUser.email,
|
|
9791
|
+
name: targetUser.name || sourceUser.name || "",
|
|
9792
|
+
metadata: {
|
|
9793
|
+
transferId,
|
|
9794
|
+
transferredFrom: sourceUser.email,
|
|
9795
|
+
transferredOn: (/* @__PURE__ */ new Date()).toISOString()
|
|
9796
|
+
}
|
|
9797
|
+
});
|
|
9798
|
+
}
|
|
9799
|
+
});
|
|
9800
|
+
return await adapter.getPurchaseUserTransferById({
|
|
9801
|
+
id: transferId
|
|
9802
|
+
});
|
|
9803
|
+
},
|
|
9728
9804
|
transferPurchasesToNewUser(options) {
|
|
9729
9805
|
throw new Error("Method not implemented.");
|
|
9730
9806
|
},
|
|
@@ -10047,4 +10123,4 @@ export {
|
|
|
10047
10123
|
createTables,
|
|
10048
10124
|
mySqlDrizzleAdapter
|
|
10049
10125
|
};
|
|
10050
|
-
//# sourceMappingURL=chunk-
|
|
10126
|
+
//# sourceMappingURL=chunk-ZYQYJNLK.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { PaymentsProviderConfig } from '@coursebuilder/core/types';
|
|
|
3
3
|
export { createTables as createMySqlTables } from './lib/mysql/index.js';
|
|
4
4
|
import { SqlFlavorOptions, TableFn } from './lib/utils.js';
|
|
5
5
|
import 'drizzle-orm';
|
|
6
|
+
import '@auth/core/adapters';
|
|
6
7
|
import 'drizzle-orm/mysql-core';
|
|
7
8
|
import 'drizzle-orm/pg-core';
|
|
8
9
|
import 'drizzle-orm/sqlite-core';
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createTables,
|
|
3
3
|
mySqlDrizzleAdapter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZYQYJNLK.js";
|
|
5
5
|
import "./chunk-YVVXDJHI.js";
|
|
6
6
|
import "./chunk-XIGJFVUM.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-XJXCDN7B.js";
|
|
8
|
+
import "./chunk-27UC2HEP.js";
|
|
9
|
+
import "./chunk-QQA7STVO.js";
|
|
10
|
+
import "./chunk-EFVZ7IN4.js";
|
|
11
11
|
import "./chunk-LERR6HQ3.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-6SLQW6OM.js";
|
|
13
|
+
import "./chunk-YMFPIZMO.js";
|
|
14
|
+
import "./chunk-JW2PFVLO.js";
|
|
15
15
|
import "./chunk-KDEWFXEP.js";
|
|
16
16
|
import "./chunk-GINRTL6J.js";
|
|
17
17
|
import "./chunk-P4VXXTVA.js";
|