@timardex/cluemart-server-shared 1.1.38 → 1.1.39
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/{Affiliate-xCVhO2Cy.d.mts → Affiliate-BLh0EcNI.d.mts} +18 -5
- package/dist/{Affiliate-CZKOOaz_.d.ts → Affiliate-CBp0M850.d.ts} +18 -5
- package/dist/{chunk-DJHOLZ3J.mjs → chunk-6RUQHYTK.mjs} +636 -287
- package/dist/chunk-6RUQHYTK.mjs.map +1 -0
- package/dist/{Chat-Wn7yfc3v.d.mts → index-zC8a3adw.d.mts} +34 -34
- package/dist/{Chat-Wn7yfc3v.d.ts → index-zC8a3adw.d.ts} +34 -34
- package/dist/index.cjs +694 -307
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +111 -56
- package/dist/index.d.ts +111 -56
- package/dist/index.mjs +688 -306
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +638 -286
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +46 -6
- package/dist/mongoose/index.d.ts +46 -6
- package/dist/mongoose/index.mjs +9 -1
- package/dist/service/index.cjs +627 -306
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +12 -10
- package/dist/service/index.d.ts +12 -10
- package/dist/service/index.mjs +51 -16
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-DJHOLZ3J.mjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponParticipantUserType } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, BillingCatalogPriceHistoryEntry, BillingCatalogEntryType, EnumBillingPeriod, EnumUserLicence, BILLING_CATALOG_KEYS, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponParticipantUserType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose__default from 'mongoose';
|
|
4
|
-
import { O as ObjectId } from '../
|
|
5
|
-
export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../
|
|
6
|
-
import { S as SchemaOwnerType } from '../Affiliate-
|
|
7
|
-
export { A as AffiliateModel, C as CategorySchema, c as ContactDetailsSchema, O as OwnerTypeSchema, k as RelationModel, j as RelationTypeSchema, R as ResourceImageTypeSchema,
|
|
4
|
+
import { O as ObjectId } from '../index-zC8a3adw.mjs';
|
|
5
|
+
export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../index-zC8a3adw.mjs';
|
|
6
|
+
import { S as SchemaOwnerType } from '../Affiliate-BLh0EcNI.mjs';
|
|
7
|
+
export { A as AffiliateModel, C as CategorySchema, c as ContactDetailsSchema, O as OwnerTypeSchema, k as RelationModel, j as RelationTypeSchema, R as ResourceImageTypeSchema, q as SchemaAffiliateResourceType, p as SchemaAffiliateReward, a as SchemaRelatedPostType, i as SchemaRelationType, o as SchemaStripeSubscription, m as SchemaUserActivityEvent, n as SchemaUserType, b as SocialMediaTypeSchema, U as UserModel, g as baseResourceFields, d as dateTimeSchema, l as locationGeoSchema, e as locationsSchema, f as relatedPostSchema, h as relationDatesSchema, r as resourceRelationsSchema, s as socialShareResourceSchema, t as termsAgreementSchema, u as userLicenseSchema } from '../Affiliate-BLh0EcNI.mjs';
|
|
8
8
|
import '@timardex/cluemart-shared/types';
|
|
9
9
|
import 'express';
|
|
10
10
|
|
|
@@ -14,6 +14,46 @@ declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__def
|
|
|
14
14
|
__v: number;
|
|
15
15
|
}, any>;
|
|
16
16
|
|
|
17
|
+
declare const BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
|
|
18
|
+
type SchemaBillingCatalogPriceHistoryEntry = Omit<BillingCatalogPriceHistoryEntry, "changedBy"> & {
|
|
19
|
+
changedBy?: ObjectId | null;
|
|
20
|
+
};
|
|
21
|
+
type SchemaBillingCatalogEntry = Omit<BillingCatalogEntryType, "_id" | "priceHistory" | "updatedBy"> & {
|
|
22
|
+
_id: ObjectId;
|
|
23
|
+
priceHistory: SchemaBillingCatalogPriceHistoryEntry[];
|
|
24
|
+
updatedBy?: ObjectId | null;
|
|
25
|
+
};
|
|
26
|
+
declare const BillingCatalogModel: mongoose__default.Model<SchemaBillingCatalogEntry, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaBillingCatalogEntry, {}, {}> & Omit<BillingCatalogEntryType, "_id" | "priceHistory" | "updatedBy"> & {
|
|
27
|
+
_id: ObjectId;
|
|
28
|
+
priceHistory: SchemaBillingCatalogPriceHistoryEntry[];
|
|
29
|
+
updatedBy?: ObjectId | null;
|
|
30
|
+
} & Required<{
|
|
31
|
+
_id: mongoose__default.Types.ObjectId;
|
|
32
|
+
}> & {
|
|
33
|
+
__v: number;
|
|
34
|
+
}, any>;
|
|
35
|
+
/**
|
|
36
|
+
* Produces the four records used for an idempotent `$setOnInsert` catalogue
|
|
37
|
+
* initialisation. Stripe identifiers deliberately start empty and are attached
|
|
38
|
+
* only after Stripe successfully creates the matching Product and Price.
|
|
39
|
+
*/
|
|
40
|
+
declare function buildInitialBillingCatalogEntries(now?: Date): {
|
|
41
|
+
active: boolean;
|
|
42
|
+
billingPeriod: EnumBillingPeriod;
|
|
43
|
+
currency: "nzd";
|
|
44
|
+
effectiveFrom: Date;
|
|
45
|
+
key: _timardex_cluemart_shared.BillingCatalogKey;
|
|
46
|
+
licenceType: EnumUserLicence.PRO_PLUS_VENDOR | EnumUserLicence.PRO_VENDOR;
|
|
47
|
+
priceHistory: never[];
|
|
48
|
+
revision: number;
|
|
49
|
+
stripePriceId: null;
|
|
50
|
+
stripeProductId: null;
|
|
51
|
+
taxInclusive: boolean;
|
|
52
|
+
unitAmount: number;
|
|
53
|
+
updatedBy: null;
|
|
54
|
+
}[];
|
|
55
|
+
declare function getBillingCatalogDefinition(key: (typeof BILLING_CATALOG_KEYS)[number]): _timardex_cluemart_shared.BillingCatalogDefinition;
|
|
56
|
+
|
|
17
57
|
type SchemaChatReportType = Omit<ReportChatUser, "reporterUserId" | "reportedUserId" | "chatId"> & {
|
|
18
58
|
reporterUserId: ObjectId;
|
|
19
59
|
reportedUserId: ObjectId;
|
|
@@ -257,4 +297,4 @@ declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, m
|
|
|
257
297
|
__v: number;
|
|
258
298
|
}, any>;
|
|
259
299
|
|
|
260
|
-
export { APP_SETTINGS_ID, AdModel, AppSettingModel, ChatReportModel, type CouponDocument, CouponModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, refundPolicySchema, vendorProductTypeSchema };
|
|
300
|
+
export { APP_SETTINGS_ID, AdModel, AppSettingModel, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, ChatReportModel, type CouponDocument, CouponModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, buildInitialBillingCatalogEntries, getBillingCatalogDefinition, refundPolicySchema, vendorProductTypeSchema };
|
package/dist/mongoose/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponParticipantUserType } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, BillingCatalogPriceHistoryEntry, BillingCatalogEntryType, EnumBillingPeriod, EnumUserLicence, BILLING_CATALOG_KEYS, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponParticipantUserType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose__default from 'mongoose';
|
|
4
|
-
import { O as ObjectId } from '../
|
|
5
|
-
export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../
|
|
6
|
-
import { S as SchemaOwnerType } from '../Affiliate-
|
|
7
|
-
export { A as AffiliateModel, C as CategorySchema, c as ContactDetailsSchema, O as OwnerTypeSchema, k as RelationModel, j as RelationTypeSchema, R as ResourceImageTypeSchema,
|
|
4
|
+
import { O as ObjectId } from '../index-zC8a3adw.js';
|
|
5
|
+
export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../index-zC8a3adw.js';
|
|
6
|
+
import { S as SchemaOwnerType } from '../Affiliate-CBp0M850.js';
|
|
7
|
+
export { A as AffiliateModel, C as CategorySchema, c as ContactDetailsSchema, O as OwnerTypeSchema, k as RelationModel, j as RelationTypeSchema, R as ResourceImageTypeSchema, q as SchemaAffiliateResourceType, p as SchemaAffiliateReward, a as SchemaRelatedPostType, i as SchemaRelationType, o as SchemaStripeSubscription, m as SchemaUserActivityEvent, n as SchemaUserType, b as SocialMediaTypeSchema, U as UserModel, g as baseResourceFields, d as dateTimeSchema, l as locationGeoSchema, e as locationsSchema, f as relatedPostSchema, h as relationDatesSchema, r as resourceRelationsSchema, s as socialShareResourceSchema, t as termsAgreementSchema, u as userLicenseSchema } from '../Affiliate-CBp0M850.js';
|
|
8
8
|
import '@timardex/cluemart-shared/types';
|
|
9
9
|
import 'express';
|
|
10
10
|
|
|
@@ -14,6 +14,46 @@ declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__def
|
|
|
14
14
|
__v: number;
|
|
15
15
|
}, any>;
|
|
16
16
|
|
|
17
|
+
declare const BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
|
|
18
|
+
type SchemaBillingCatalogPriceHistoryEntry = Omit<BillingCatalogPriceHistoryEntry, "changedBy"> & {
|
|
19
|
+
changedBy?: ObjectId | null;
|
|
20
|
+
};
|
|
21
|
+
type SchemaBillingCatalogEntry = Omit<BillingCatalogEntryType, "_id" | "priceHistory" | "updatedBy"> & {
|
|
22
|
+
_id: ObjectId;
|
|
23
|
+
priceHistory: SchemaBillingCatalogPriceHistoryEntry[];
|
|
24
|
+
updatedBy?: ObjectId | null;
|
|
25
|
+
};
|
|
26
|
+
declare const BillingCatalogModel: mongoose__default.Model<SchemaBillingCatalogEntry, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaBillingCatalogEntry, {}, {}> & Omit<BillingCatalogEntryType, "_id" | "priceHistory" | "updatedBy"> & {
|
|
27
|
+
_id: ObjectId;
|
|
28
|
+
priceHistory: SchemaBillingCatalogPriceHistoryEntry[];
|
|
29
|
+
updatedBy?: ObjectId | null;
|
|
30
|
+
} & Required<{
|
|
31
|
+
_id: mongoose__default.Types.ObjectId;
|
|
32
|
+
}> & {
|
|
33
|
+
__v: number;
|
|
34
|
+
}, any>;
|
|
35
|
+
/**
|
|
36
|
+
* Produces the four records used for an idempotent `$setOnInsert` catalogue
|
|
37
|
+
* initialisation. Stripe identifiers deliberately start empty and are attached
|
|
38
|
+
* only after Stripe successfully creates the matching Product and Price.
|
|
39
|
+
*/
|
|
40
|
+
declare function buildInitialBillingCatalogEntries(now?: Date): {
|
|
41
|
+
active: boolean;
|
|
42
|
+
billingPeriod: EnumBillingPeriod;
|
|
43
|
+
currency: "nzd";
|
|
44
|
+
effectiveFrom: Date;
|
|
45
|
+
key: _timardex_cluemart_shared.BillingCatalogKey;
|
|
46
|
+
licenceType: EnumUserLicence.PRO_PLUS_VENDOR | EnumUserLicence.PRO_VENDOR;
|
|
47
|
+
priceHistory: never[];
|
|
48
|
+
revision: number;
|
|
49
|
+
stripePriceId: null;
|
|
50
|
+
stripeProductId: null;
|
|
51
|
+
taxInclusive: boolean;
|
|
52
|
+
unitAmount: number;
|
|
53
|
+
updatedBy: null;
|
|
54
|
+
}[];
|
|
55
|
+
declare function getBillingCatalogDefinition(key: (typeof BILLING_CATALOG_KEYS)[number]): _timardex_cluemart_shared.BillingCatalogDefinition;
|
|
56
|
+
|
|
17
57
|
type SchemaChatReportType = Omit<ReportChatUser, "reporterUserId" | "reportedUserId" | "chatId"> & {
|
|
18
58
|
reporterUserId: ObjectId;
|
|
19
59
|
reportedUserId: ObjectId;
|
|
@@ -257,4 +297,4 @@ declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, m
|
|
|
257
297
|
__v: number;
|
|
258
298
|
}, any>;
|
|
259
299
|
|
|
260
|
-
export { APP_SETTINGS_ID, AdModel, AppSettingModel, ChatReportModel, type CouponDocument, CouponModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, refundPolicySchema, vendorProductTypeSchema };
|
|
300
|
+
export { APP_SETTINGS_ID, AdModel, AppSettingModel, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, ChatReportModel, type CouponDocument, CouponModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, buildInitialBillingCatalogEntries, getBillingCatalogDefinition, refundPolicySchema, vendorProductTypeSchema };
|
package/dist/mongoose/index.mjs
CHANGED
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
AdModel,
|
|
4
4
|
AffiliateModel,
|
|
5
5
|
AppSettingModel,
|
|
6
|
+
BILLING_CATALOG_COLLECTION_NAME,
|
|
7
|
+
BillingCatalogModel,
|
|
6
8
|
CategorySchema,
|
|
7
9
|
ChatModel,
|
|
8
10
|
ChatReportModel,
|
|
@@ -30,7 +32,9 @@ import {
|
|
|
30
32
|
VendorModel,
|
|
31
33
|
VerificationTokenModel,
|
|
32
34
|
baseResourceFields,
|
|
35
|
+
buildInitialBillingCatalogEntries,
|
|
33
36
|
dateTimeSchema,
|
|
37
|
+
getBillingCatalogDefinition,
|
|
34
38
|
locationGeoSchema,
|
|
35
39
|
locationsSchema,
|
|
36
40
|
refundPolicySchema,
|
|
@@ -41,12 +45,14 @@ import {
|
|
|
41
45
|
termsAgreementSchema,
|
|
42
46
|
userLicenseSchema,
|
|
43
47
|
vendorProductTypeSchema
|
|
44
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-6RUQHYTK.mjs";
|
|
45
49
|
export {
|
|
46
50
|
APP_SETTINGS_ID,
|
|
47
51
|
AdModel,
|
|
48
52
|
AffiliateModel,
|
|
49
53
|
AppSettingModel,
|
|
54
|
+
BILLING_CATALOG_COLLECTION_NAME,
|
|
55
|
+
BillingCatalogModel,
|
|
50
56
|
CategorySchema,
|
|
51
57
|
ChatModel,
|
|
52
58
|
ChatReportModel,
|
|
@@ -74,7 +80,9 @@ export {
|
|
|
74
80
|
VendorModel,
|
|
75
81
|
VerificationTokenModel,
|
|
76
82
|
baseResourceFields,
|
|
83
|
+
buildInitialBillingCatalogEntries,
|
|
77
84
|
dateTimeSchema,
|
|
85
|
+
getBillingCatalogDefinition,
|
|
78
86
|
locationGeoSchema,
|
|
79
87
|
locationsSchema,
|
|
80
88
|
refundPolicySchema,
|