@brimble/models 3.8.213 → 3.8.215
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/credit-wallet-transaction.d.ts +9 -0
- package/dist/credit-wallet-transaction.js +45 -0
- package/dist/credit-wallet.d.ts +9 -0
- package/dist/credit-wallet.js +25 -0
- package/dist/enum/index.d.ts +34 -0
- package/dist/enum/index.js +41 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +15 -3
- package/dist/plan_configuration.js +1 -1
- package/dist/project/index.js +13 -0
- package/dist/types/credit-wallet-transaction.d.ts +20 -0
- package/dist/types/credit-wallet-transaction.js +2 -0
- package/dist/types/credit-wallet.d.ts +12 -0
- package/dist/types/credit-wallet.js +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/wallet-funding-payment.d.ts +23 -0
- package/dist/types/wallet-funding-payment.js +2 -0
- package/dist/wallet-funding-payment.d.ts +9 -0
- package/dist/wallet-funding-payment.js +49 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICreditWalletTransaction } from "./types/credit-wallet-transaction";
|
|
2
|
+
declare const _default: import("mongoose").Model<ICreditWalletTransaction, {}, {}, {}, import("mongoose").Document<unknown, {}, ICreditWalletTransaction, {}, import("mongoose").DefaultSchemaOptions> & ICreditWalletTransaction & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ICreditWalletTransaction>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const creditWalletTransactionSchema = new mongoose_1.Schema({
|
|
6
|
+
wallet_id: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
ref: "CreditWallet",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
owner_type: {
|
|
12
|
+
type: String,
|
|
13
|
+
enum: Object.values(enum_1.WalletOwnerType),
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
owner_id: { type: String, required: true },
|
|
17
|
+
amount: { type: Number, required: true },
|
|
18
|
+
direction: {
|
|
19
|
+
type: String,
|
|
20
|
+
enum: Object.values(enum_1.WalletTransactionDirection),
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
type: String,
|
|
25
|
+
enum: Object.values(enum_1.WalletTransactionType),
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
balance_after: { type: Number, required: true },
|
|
29
|
+
seq: { type: Number, required: true, min: 1 },
|
|
30
|
+
reference_type: { type: String, default: null },
|
|
31
|
+
reference_id: { type: String, default: null },
|
|
32
|
+
payment_provider: {
|
|
33
|
+
type: String,
|
|
34
|
+
enum: Object.values(enum_1.PaymentProviderName),
|
|
35
|
+
default: null,
|
|
36
|
+
},
|
|
37
|
+
provider_reference: { type: String, default: null },
|
|
38
|
+
description: { type: String, default: null },
|
|
39
|
+
idempotency_key: { type: String, required: true },
|
|
40
|
+
metadata: { type: mongoose_1.Schema.Types.Mixed, default: null },
|
|
41
|
+
}, {
|
|
42
|
+
timestamps: { createdAt: "created_at", updatedAt: false },
|
|
43
|
+
collection: "credit_wallet_transactions",
|
|
44
|
+
});
|
|
45
|
+
exports.default = (0, mongoose_1.model)("CreditWalletTransaction", creditWalletTransactionSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICreditWallet } from "./types/credit-wallet";
|
|
2
|
+
declare const _default: import("mongoose").Model<ICreditWallet, {}, {}, {}, import("mongoose").Document<unknown, {}, ICreditWallet, {}, import("mongoose").DefaultSchemaOptions> & ICreditWallet & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ICreditWallet>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const creditWalletSchema = new mongoose_1.Schema({
|
|
6
|
+
owner_type: {
|
|
7
|
+
type: String,
|
|
8
|
+
enum: Object.values(enum_1.WalletOwnerType),
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
owner_id: { type: String, required: true },
|
|
12
|
+
currency: {
|
|
13
|
+
type: String,
|
|
14
|
+
enum: Object.values(enum_1.WalletCurrency),
|
|
15
|
+
default: enum_1.WalletCurrency.USD,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
balance: { type: Number, required: true, min: 0, default: 0 },
|
|
19
|
+
seq: { type: Number, min: 0, default: 0 },
|
|
20
|
+
wallet_first: { type: Boolean, default: false },
|
|
21
|
+
}, {
|
|
22
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
23
|
+
collection: "credit_wallets",
|
|
24
|
+
});
|
|
25
|
+
exports.default = (0, mongoose_1.model)("CreditWallet", creditWalletSchema);
|
package/dist/enum/index.d.ts
CHANGED
|
@@ -612,3 +612,37 @@ export declare enum BuildDispatch {
|
|
|
612
612
|
Builder = "builder",
|
|
613
613
|
Sandbox = "sandbox"
|
|
614
614
|
}
|
|
615
|
+
export declare enum WalletOwnerType {
|
|
616
|
+
User = "user",
|
|
617
|
+
Team = "team"
|
|
618
|
+
}
|
|
619
|
+
export declare enum WalletCurrency {
|
|
620
|
+
USD = "USD"
|
|
621
|
+
}
|
|
622
|
+
export declare enum WalletTransactionDirection {
|
|
623
|
+
Credit = "credit",
|
|
624
|
+
Debit = "debit"
|
|
625
|
+
}
|
|
626
|
+
export declare enum WalletTransactionType {
|
|
627
|
+
WalletFunding = "wallet_funding",
|
|
628
|
+
SubscriptionPayment = "subscription_payment",
|
|
629
|
+
DomainPurchase = "domain_purchase",
|
|
630
|
+
BuildMinutes = "build_minutes",
|
|
631
|
+
AddonPurchase = "addon_purchase",
|
|
632
|
+
PromotionalCredit = "promotional_credit",
|
|
633
|
+
Refund = "refund",
|
|
634
|
+
Reversal = "reversal",
|
|
635
|
+
ManualAdjustment = "manual_adjustment"
|
|
636
|
+
}
|
|
637
|
+
export declare enum PaymentProviderName {
|
|
638
|
+
Stripe = "stripe",
|
|
639
|
+
Bachs = "bachs"
|
|
640
|
+
}
|
|
641
|
+
export declare enum PaymentStatus {
|
|
642
|
+
Pending = "pending",
|
|
643
|
+
Processing = "processing",
|
|
644
|
+
Succeeded = "succeeded",
|
|
645
|
+
Failed = "failed",
|
|
646
|
+
Expired = "expired",
|
|
647
|
+
NeedsReview = "needs_review"
|
|
648
|
+
}
|
package/dist/enum/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_SOURCE = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.EmailDeadLetterStatus = exports.DatabaseInsightsScope = exports.HaMemberRole = exports.DatabasePasswordMode = exports.DatabasePasswordChangeMode = exports.DatabaseEngine = exports.ServiceType = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.ROLES = exports.DNS_MANAGED_BY = exports.EMAIL_FORWARD_STATUS = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.DatabaseProvisionStep = exports.DatabaseProvisionOperation = exports.DatabaseProvisionPhase = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.CONFIG_FILE_VISIBILITY = exports.ENVIRONMENT = exports.TEAM_ACTIVATION_STATUS = exports.SPENDING_LIMIT_ACTION = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
|
|
4
4
|
exports.AGENT_CHAT_STATUS = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.DatabaseUserStatus = exports.DatabaseUserPermission = exports.WorkbenchMode = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.BACKUP_DESTINATION_TYPE = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = void 0;
|
|
5
|
-
exports.BuildDispatch = exports.BuildProviderType = exports.BuildMethod = exports.BuildUseCase = exports.AGENT_DESIGN_SKILL_VERDICT = exports.AGENT_DESIGN_SKILL_TRUST_LEVEL = exports.AGENT_DESIGN_SKILL_STATUS = exports.AGENT_WEBSITE_SNAPSHOT_STATUS = exports.AGENT_WEBSITE_STATUS = exports.AGENT_CHAT_MESSAGE_ROLE = void 0;
|
|
5
|
+
exports.PaymentStatus = exports.PaymentProviderName = exports.WalletTransactionType = exports.WalletTransactionDirection = exports.WalletCurrency = exports.WalletOwnerType = exports.BuildDispatch = exports.BuildProviderType = exports.BuildMethod = exports.BuildUseCase = exports.AGENT_DESIGN_SKILL_VERDICT = exports.AGENT_DESIGN_SKILL_TRUST_LEVEL = exports.AGENT_DESIGN_SKILL_STATUS = exports.AGENT_WEBSITE_SNAPSHOT_STATUS = exports.AGENT_WEBSITE_STATUS = exports.AGENT_CHAT_MESSAGE_ROLE = void 0;
|
|
6
6
|
var GIT_TYPE;
|
|
7
7
|
(function (GIT_TYPE) {
|
|
8
8
|
GIT_TYPE["GITHUB"] = "GITHUB";
|
|
@@ -743,3 +743,43 @@ var BuildDispatch;
|
|
|
743
743
|
BuildDispatch["Builder"] = "builder";
|
|
744
744
|
BuildDispatch["Sandbox"] = "sandbox";
|
|
745
745
|
})(BuildDispatch || (exports.BuildDispatch = BuildDispatch = {}));
|
|
746
|
+
var WalletOwnerType;
|
|
747
|
+
(function (WalletOwnerType) {
|
|
748
|
+
WalletOwnerType["User"] = "user";
|
|
749
|
+
WalletOwnerType["Team"] = "team";
|
|
750
|
+
})(WalletOwnerType || (exports.WalletOwnerType = WalletOwnerType = {}));
|
|
751
|
+
var WalletCurrency;
|
|
752
|
+
(function (WalletCurrency) {
|
|
753
|
+
WalletCurrency["USD"] = "USD";
|
|
754
|
+
})(WalletCurrency || (exports.WalletCurrency = WalletCurrency = {}));
|
|
755
|
+
var WalletTransactionDirection;
|
|
756
|
+
(function (WalletTransactionDirection) {
|
|
757
|
+
WalletTransactionDirection["Credit"] = "credit";
|
|
758
|
+
WalletTransactionDirection["Debit"] = "debit";
|
|
759
|
+
})(WalletTransactionDirection || (exports.WalletTransactionDirection = WalletTransactionDirection = {}));
|
|
760
|
+
var WalletTransactionType;
|
|
761
|
+
(function (WalletTransactionType) {
|
|
762
|
+
WalletTransactionType["WalletFunding"] = "wallet_funding";
|
|
763
|
+
WalletTransactionType["SubscriptionPayment"] = "subscription_payment";
|
|
764
|
+
WalletTransactionType["DomainPurchase"] = "domain_purchase";
|
|
765
|
+
WalletTransactionType["BuildMinutes"] = "build_minutes";
|
|
766
|
+
WalletTransactionType["AddonPurchase"] = "addon_purchase";
|
|
767
|
+
WalletTransactionType["PromotionalCredit"] = "promotional_credit";
|
|
768
|
+
WalletTransactionType["Refund"] = "refund";
|
|
769
|
+
WalletTransactionType["Reversal"] = "reversal";
|
|
770
|
+
WalletTransactionType["ManualAdjustment"] = "manual_adjustment";
|
|
771
|
+
})(WalletTransactionType || (exports.WalletTransactionType = WalletTransactionType = {}));
|
|
772
|
+
var PaymentProviderName;
|
|
773
|
+
(function (PaymentProviderName) {
|
|
774
|
+
PaymentProviderName["Stripe"] = "stripe";
|
|
775
|
+
PaymentProviderName["Bachs"] = "bachs";
|
|
776
|
+
})(PaymentProviderName || (exports.PaymentProviderName = PaymentProviderName = {}));
|
|
777
|
+
var PaymentStatus;
|
|
778
|
+
(function (PaymentStatus) {
|
|
779
|
+
PaymentStatus["Pending"] = "pending";
|
|
780
|
+
PaymentStatus["Processing"] = "processing";
|
|
781
|
+
PaymentStatus["Succeeded"] = "succeeded";
|
|
782
|
+
PaymentStatus["Failed"] = "failed";
|
|
783
|
+
PaymentStatus["Expired"] = "expired";
|
|
784
|
+
PaymentStatus["NeedsReview"] = "needs_review";
|
|
785
|
+
})(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -105,8 +105,11 @@ export { default as AgentWebsiteSnapshot } from "./agent-website-snapshot";
|
|
|
105
105
|
export { default as AgentWebsiteFileOverlay } from "./agent-website-file-overlay";
|
|
106
106
|
export { default as AgentDesignSkill } from "./agent-design-skill";
|
|
107
107
|
export { default as AgentDesignSkillRevision } from "./agent-design-skill-revision";
|
|
108
|
-
export {
|
|
109
|
-
export {
|
|
108
|
+
export { default as CreditWallet } from "./credit-wallet";
|
|
109
|
+
export { default as CreditWalletTransaction } from "./credit-wallet-transaction";
|
|
110
|
+
export { default as WalletFundingPayment } from "./wallet-funding-payment";
|
|
111
|
+
export { IUser, IGit, IOrigin, IProject, IDedicatedEgress, IDatabaseProvisionProgress, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IPlatformApiKey, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IPaymentMethod, IDns, IDnsChangeLog, IEmailForward, IRole, IWallet, ICreditWallet, ICreditWalletTransaction, IWalletFundingPayment, IDbImage, IDbImageConnection, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, BuildProviderRoute, BuildSandboxPoolConfig, BuildSandboxConfig, BuildProviderMeta, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice, ITag, IProjectTagAssignment, ICashierSubscription, ICashierSubscriptionItem, IProjectEnvironment, IEnvironmentVariable, IProjectConfigFile, IActivityLog, IAlertRule, IAlertRuleState, IAlertEvent, IAlertNotificationResult, IDrain, IProjectDrainSubscription, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxActivity, ISandboxImage, ISandboxSize, ISandboxSnapshot, IBackupHistory, IDatabaseUser, IRestoreHistory, IWorkerRun, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, IIdempotencyRecord, IStorageBucket, IStorageBucketConnection, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, IStreak, IStreakMilestoneRef, IStreakEvent, IStreakDay, IStreakMilestone, IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, IQuestParticipation, IQuestCriterionProgress, IQuestRewardIssuance, IQuestIssuedReward, ICoupon, ICouponRedemption, ITicket, ICareerRole, IBlogPost, IChangelogEntry, IChangelogCampaign, ChangelogEmailPayloadEntry, IAgentChat, IAgentChatMessage, IAgentChatFile, IAgentChatModel, IAgentWebsite, IAgentWebsiteSnapshot, IAgentWebsiteFileOverlay, IAgentDesignSkill, IAgentDesignSkillRevision, IAgentDesignSkillFile, IAgentDesignSkillInspection, IAgentDesignSkillLicense, } from "./types";
|
|
112
|
+
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, AlertMetric, AlertCondition, AlertRuleState, AlertChannelMode, AlertEventStatus, DrainType, DrainStatus, LogSource, DrainEventType, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, DNS_CHANGE_TYPE, DNS_CHANGE_SOURCE, EMAIL_FORWARD_STATUS, DNS_MANAGED_BY, ServiceType, BuildUseCase, BuildMethod, BuildProviderType, BuildDispatch, SCALING_SOURCE, DatabaseEngine, DatabasePasswordChangeMode, DatabasePasswordMode, HaMemberRole, DatabaseInsightsScope, DatabaseProvisionPhase, DatabaseProvisionOperation, DatabaseProvisionStep, EmailDeadLetterStatus, JobStatus, LicenseStatus, REGION_CONTINENT, VOLUME_BACKEND, BUILD_DISABLED_BY, PROJECT_DISABLED_BY, SPENDING_LIMIT_ACTION, TEAM_ACTIVATION_STATUS, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE, SANDBOX_TEMPLATE, SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_EGRESS_MODE, SANDBOX_SNAPSHOT_STATUS, BACKUP_STATUS, BACKUP_DESTINATION_TYPE, DatabaseUserPermission, DatabaseUserStatus, WorkerRunStatus, WorkerRunTrigger, RESTORE_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, PlatformApiKeyStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, XFrameOptions, XContentTypeOptions, XRobotsTag, QualifyingActionType, MilestoneType, QUEST_COUNTABLE_MILESTONES, ACTION_TO_MILESTONE, EligibilityType, RewardType, QuestRewardStatus, QuestCriterionType, QuestEntity, QuestRequirementType, QUEST_CLAIM_REQUIREMENTS, QUEST_TARGETLESS_REQUIREMENTS, WorkbenchMode, CouponDiscountType, CouponScope, CouponRedemptionStatus, CONFIG_FILE_VISIBILITY, AGENT_CHAT_STATUS, AGENT_CHAT_MESSAGE_ROLE, AGENT_WEBSITE_STATUS, AGENT_WEBSITE_SNAPSHOT_STATUS, AGENT_DESIGN_SKILL_STATUS, AGENT_DESIGN_SKILL_TRUST_LEVEL, AGENT_DESIGN_SKILL_VERDICT, WalletOwnerType, WalletCurrency, WalletTransactionDirection, WalletTransactionType, PaymentProviderName, PaymentStatus, } from "./enum";
|
|
110
113
|
import mongoose from "mongoose";
|
|
111
114
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
112
115
|
export declare const db: mongoose.Connection;
|
package/dist/index.js
CHANGED
|
@@ -14,9 +14,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = exports.DomainTransfer = exports.DomainRenewal = exports.LoadBalancerPort = exports.Settings = exports.Framework = exports.Volume = exports.Region = exports.ComputeChange = exports.AutoScalingGroup = exports.PlanConfiguration = exports.Liscense = exports.Job = exports.EmailDeadLetter = exports.DbImage = exports.Wallet = exports.Server = exports.Card = exports.Subscription = exports.Log = exports.Role = exports.PaymentMethod = exports.Member = exports.Team = exports.PlatformApiKey = exports.Token = exports.Env = exports.EmailForward = exports.DnsChangeLog = exports.Dns = exports.Domain = exports.Integration = exports.Following = exports.Ratelimit = exports.ProjectNetworkSettings = exports.ProjectConnection = exports.Preview = exports.ProjectAnalytics = exports.DeletedProject = exports.Project = exports.User = void 0;
|
|
16
16
|
exports.CouponRedemption = exports.Coupon = exports.QuestRewardIssuance = exports.QuestParticipation = exports.QuestCampaign = exports.StreakMilestone = exports.StreakDay = exports.StreakEvent = exports.Streak = exports.StorageMigration = exports.StorageCredential = exports.StorageToken = exports.StorageUpload = exports.StorageObject = exports.StorageBucketConnection = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.PgBouncerUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.WorkerRun = exports.RestoreHistory = exports.DatabaseUser = exports.BackupHistory = exports.SandboxSnapshot = exports.SandboxWarmPoolMember = exports.SandboxWarmPool = exports.SandboxSize = exports.SandboxImage = exports.SandboxActivity = exports.Sandbox = exports.OwnershipTransfer = exports.ProjectDrainSubscription = exports.Drain = exports.AlertEvent = exports.AlertRuleStateModel = exports.AlertRule = exports.ActivityLog = exports.ProjectConfigFile = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = exports.CollabPushSubscription = void 0;
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.AGENT_DESIGN_SKILL_VERDICT = exports.AGENT_DESIGN_SKILL_TRUST_LEVEL = exports.AGENT_DESIGN_SKILL_STATUS = exports.AGENT_WEBSITE_SNAPSHOT_STATUS = exports.AGENT_WEBSITE_STATUS = exports.AGENT_CHAT_MESSAGE_ROLE = exports.AGENT_CHAT_STATUS = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = void 0;
|
|
17
|
+
exports.DatabasePasswordChangeMode = exports.DatabaseEngine = exports.SCALING_SOURCE = exports.BuildDispatch = exports.BuildProviderType = exports.BuildMethod = exports.BuildUseCase = exports.ServiceType = exports.DNS_MANAGED_BY = exports.EMAIL_FORWARD_STATUS = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.PROJECT_STATUS = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.WalletFundingPayment = exports.CreditWalletTransaction = exports.CreditWallet = exports.AgentDesignSkillRevision = exports.AgentDesignSkill = exports.AgentWebsiteFileOverlay = exports.AgentWebsiteSnapshot = exports.AgentWebsite = exports.AgentChatModel = exports.AgentChatFile = exports.AgentChatMessage = exports.AgentChat = exports.ChangelogCampaign = exports.ChangelogEntry = exports.BlogPost = exports.CareerRole = exports.Ticket = void 0;
|
|
18
|
+
exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.DatabaseUserStatus = exports.DatabaseUserPermission = exports.BACKUP_DESTINATION_TYPE = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.TEAM_ACTIVATION_STATUS = exports.SPENDING_LIMIT_ACTION = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.EmailDeadLetterStatus = exports.DatabaseProvisionStep = exports.DatabaseProvisionOperation = exports.DatabaseProvisionPhase = exports.DatabaseInsightsScope = exports.HaMemberRole = exports.DatabasePasswordMode = void 0;
|
|
19
|
+
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.PaymentStatus = exports.PaymentProviderName = exports.WalletTransactionType = exports.WalletTransactionDirection = exports.WalletCurrency = exports.WalletOwnerType = exports.AGENT_DESIGN_SKILL_VERDICT = exports.AGENT_DESIGN_SKILL_TRUST_LEVEL = exports.AGENT_DESIGN_SKILL_STATUS = exports.AGENT_WEBSITE_SNAPSHOT_STATUS = exports.AGENT_WEBSITE_STATUS = exports.AGENT_CHAT_MESSAGE_ROLE = exports.AGENT_CHAT_STATUS = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = void 0;
|
|
20
20
|
var user_1 = require("./user");
|
|
21
21
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
|
22
22
|
var project_1 = require("./project");
|
|
@@ -238,6 +238,12 @@ var agent_design_skill_1 = require("./agent-design-skill");
|
|
|
238
238
|
Object.defineProperty(exports, "AgentDesignSkill", { enumerable: true, get: function () { return __importDefault(agent_design_skill_1).default; } });
|
|
239
239
|
var agent_design_skill_revision_1 = require("./agent-design-skill-revision");
|
|
240
240
|
Object.defineProperty(exports, "AgentDesignSkillRevision", { enumerable: true, get: function () { return __importDefault(agent_design_skill_revision_1).default; } });
|
|
241
|
+
var credit_wallet_1 = require("./credit-wallet");
|
|
242
|
+
Object.defineProperty(exports, "CreditWallet", { enumerable: true, get: function () { return __importDefault(credit_wallet_1).default; } });
|
|
243
|
+
var credit_wallet_transaction_1 = require("./credit-wallet-transaction");
|
|
244
|
+
Object.defineProperty(exports, "CreditWalletTransaction", { enumerable: true, get: function () { return __importDefault(credit_wallet_transaction_1).default; } });
|
|
245
|
+
var wallet_funding_payment_1 = require("./wallet-funding-payment");
|
|
246
|
+
Object.defineProperty(exports, "WalletFundingPayment", { enumerable: true, get: function () { return __importDefault(wallet_funding_payment_1).default; } });
|
|
241
247
|
var enum_1 = require("./enum");
|
|
242
248
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
243
249
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -347,6 +353,12 @@ Object.defineProperty(exports, "AGENT_WEBSITE_SNAPSHOT_STATUS", { enumerable: tr
|
|
|
347
353
|
Object.defineProperty(exports, "AGENT_DESIGN_SKILL_STATUS", { enumerable: true, get: function () { return enum_1.AGENT_DESIGN_SKILL_STATUS; } });
|
|
348
354
|
Object.defineProperty(exports, "AGENT_DESIGN_SKILL_TRUST_LEVEL", { enumerable: true, get: function () { return enum_1.AGENT_DESIGN_SKILL_TRUST_LEVEL; } });
|
|
349
355
|
Object.defineProperty(exports, "AGENT_DESIGN_SKILL_VERDICT", { enumerable: true, get: function () { return enum_1.AGENT_DESIGN_SKILL_VERDICT; } });
|
|
356
|
+
Object.defineProperty(exports, "WalletOwnerType", { enumerable: true, get: function () { return enum_1.WalletOwnerType; } });
|
|
357
|
+
Object.defineProperty(exports, "WalletCurrency", { enumerable: true, get: function () { return enum_1.WalletCurrency; } });
|
|
358
|
+
Object.defineProperty(exports, "WalletTransactionDirection", { enumerable: true, get: function () { return enum_1.WalletTransactionDirection; } });
|
|
359
|
+
Object.defineProperty(exports, "WalletTransactionType", { enumerable: true, get: function () { return enum_1.WalletTransactionType; } });
|
|
360
|
+
Object.defineProperty(exports, "PaymentProviderName", { enumerable: true, get: function () { return enum_1.PaymentProviderName; } });
|
|
361
|
+
Object.defineProperty(exports, "PaymentStatus", { enumerable: true, get: function () { return enum_1.PaymentStatus; } });
|
|
350
362
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
351
363
|
const utils_1 = require("@brimble/utils");
|
|
352
364
|
const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -8,7 +8,7 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
|
|
|
8
8
|
drain: { type: Boolean, default: false },
|
|
9
9
|
slack_support: { type: Boolean, default: false },
|
|
10
10
|
concurrent_builds: { type: Number, required: true },
|
|
11
|
-
max_concurrent_builds_per_project: { type: Number, required: false
|
|
11
|
+
max_concurrent_builds_per_project: { type: Number, required: false },
|
|
12
12
|
project_limit: { type: Number, required: true },
|
|
13
13
|
deploy_private_organization: { type: Boolean, default: false },
|
|
14
14
|
preview_comments: { type: Boolean, default: false },
|
package/dist/project/index.js
CHANGED
|
@@ -3,6 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeletedProject = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const enum_1 = require("../enum");
|
|
6
|
+
const runsCompute = function () {
|
|
7
|
+
return Boolean(this.serviceType) && this.serviceType !== enum_1.ServiceType.Static;
|
|
8
|
+
};
|
|
9
|
+
const minCpu = 0.2;
|
|
10
|
+
const minMemoryGb = 0.5;
|
|
11
|
+
const minimumComputeSpec = (label, minimum, unit) => ({
|
|
12
|
+
validator: function (value) {
|
|
13
|
+
return !runsCompute.call(this) || value >= minimum;
|
|
14
|
+
},
|
|
15
|
+
message: `${label} must be at least ${minimum}${unit} for projects that run compute`,
|
|
16
|
+
});
|
|
6
17
|
const projectSchema = new mongoose_1.Schema({
|
|
7
18
|
name: {
|
|
8
19
|
type: String,
|
|
@@ -404,10 +415,12 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
404
415
|
memory: {
|
|
405
416
|
type: Number,
|
|
406
417
|
default: 0.5,
|
|
418
|
+
validate: minimumComputeSpec("Memory", minMemoryGb, " GB"),
|
|
407
419
|
},
|
|
408
420
|
cpu: {
|
|
409
421
|
type: Number,
|
|
410
422
|
default: 0.2,
|
|
423
|
+
validate: minimumComputeSpec("CPU", minCpu, " vCPU"),
|
|
411
424
|
},
|
|
412
425
|
storage: {
|
|
413
426
|
type: Number,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { PaymentProviderName, WalletOwnerType, WalletTransactionDirection, WalletTransactionType } from "../enum";
|
|
3
|
+
export interface ICreditWalletTransaction extends Document {
|
|
4
|
+
wallet_id: Types.ObjectId;
|
|
5
|
+
owner_type: WalletOwnerType;
|
|
6
|
+
owner_id: string;
|
|
7
|
+
amount: number;
|
|
8
|
+
direction: WalletTransactionDirection;
|
|
9
|
+
type: WalletTransactionType;
|
|
10
|
+
balance_after: number;
|
|
11
|
+
seq: number;
|
|
12
|
+
reference_type?: string | null;
|
|
13
|
+
reference_id?: string | null;
|
|
14
|
+
payment_provider?: PaymentProviderName | null;
|
|
15
|
+
provider_reference?: string | null;
|
|
16
|
+
description?: string | null;
|
|
17
|
+
idempotency_key: string;
|
|
18
|
+
metadata?: Record<string, unknown> | null;
|
|
19
|
+
created_at: Date;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { WalletCurrency, WalletOwnerType } from "../enum";
|
|
3
|
+
export interface ICreditWallet extends Document {
|
|
4
|
+
owner_type: WalletOwnerType;
|
|
5
|
+
owner_id: string;
|
|
6
|
+
currency: WalletCurrency;
|
|
7
|
+
balance: number;
|
|
8
|
+
seq: number;
|
|
9
|
+
wallet_first: boolean;
|
|
10
|
+
created_at?: Date;
|
|
11
|
+
updated_at?: Date;
|
|
12
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -42,6 +42,9 @@ export type { IPlatformApiKey } from "./platform-api-key";
|
|
|
42
42
|
export type { IUser } from "./user";
|
|
43
43
|
export type { IVolume } from "./volume";
|
|
44
44
|
export type { IWallet } from "./wallet";
|
|
45
|
+
export type { ICreditWallet } from "./credit-wallet";
|
|
46
|
+
export type { ICreditWalletTransaction } from "./credit-wallet-transaction";
|
|
47
|
+
export type { IWalletFundingPayment } from "./wallet-funding-payment";
|
|
45
48
|
export type { IWebhookCategory } from "./webhook-category";
|
|
46
49
|
export type { IWebhookEvent } from "./webhook-event";
|
|
47
50
|
export type { IWebhookSetting } from "./webhook-setting";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { PaymentProviderName, PaymentStatus, WalletCurrency, WalletOwnerType } from "../enum";
|
|
3
|
+
export interface IWalletFundingPayment extends Document {
|
|
4
|
+
wallet_id: Types.ObjectId;
|
|
5
|
+
owner_type: WalletOwnerType;
|
|
6
|
+
owner_id: string;
|
|
7
|
+
initiated_by: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
currency: WalletCurrency;
|
|
10
|
+
provider: PaymentProviderName;
|
|
11
|
+
provider_session_id?: string | null;
|
|
12
|
+
provider_payment_id?: string | null;
|
|
13
|
+
checkout_url?: string | null;
|
|
14
|
+
paid_amount?: number | null;
|
|
15
|
+
paid_currency?: string | null;
|
|
16
|
+
status: PaymentStatus;
|
|
17
|
+
wallet_transaction_id?: string | null;
|
|
18
|
+
failure_reason?: string | null;
|
|
19
|
+
metadata?: Record<string, unknown> | null;
|
|
20
|
+
last_verified_at?: Date | null;
|
|
21
|
+
created_at?: Date;
|
|
22
|
+
updated_at?: Date;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IWalletFundingPayment } from "./types/wallet-funding-payment";
|
|
2
|
+
declare const _default: import("mongoose").Model<IWalletFundingPayment, {}, {}, {}, import("mongoose").Document<unknown, {}, IWalletFundingPayment, {}, import("mongoose").DefaultSchemaOptions> & IWalletFundingPayment & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IWalletFundingPayment>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const walletFundingPaymentSchema = new mongoose_1.Schema({
|
|
6
|
+
wallet_id: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
ref: "CreditWallet",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
owner_type: {
|
|
12
|
+
type: String,
|
|
13
|
+
enum: Object.values(enum_1.WalletOwnerType),
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
owner_id: { type: String, required: true },
|
|
17
|
+
initiated_by: { type: String, required: true },
|
|
18
|
+
amount: { type: Number, required: true, min: 1 },
|
|
19
|
+
currency: {
|
|
20
|
+
type: String,
|
|
21
|
+
enum: Object.values(enum_1.WalletCurrency),
|
|
22
|
+
default: enum_1.WalletCurrency.USD,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
provider: {
|
|
26
|
+
type: String,
|
|
27
|
+
enum: Object.values(enum_1.PaymentProviderName),
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
provider_session_id: { type: String, default: null },
|
|
31
|
+
provider_payment_id: { type: String, default: null },
|
|
32
|
+
checkout_url: { type: String, default: null },
|
|
33
|
+
paid_amount: { type: Number, default: null },
|
|
34
|
+
paid_currency: { type: String, default: null },
|
|
35
|
+
status: {
|
|
36
|
+
type: String,
|
|
37
|
+
enum: Object.values(enum_1.PaymentStatus),
|
|
38
|
+
default: enum_1.PaymentStatus.Pending,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
wallet_transaction_id: { type: String, default: null },
|
|
42
|
+
failure_reason: { type: String, default: null },
|
|
43
|
+
metadata: { type: mongoose_1.Schema.Types.Mixed, default: null },
|
|
44
|
+
last_verified_at: { type: Date, default: null },
|
|
45
|
+
}, {
|
|
46
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
47
|
+
collection: "wallet_funding_payments",
|
|
48
|
+
});
|
|
49
|
+
exports.default = (0, mongoose_1.model)("WalletFundingPayment", walletFundingPaymentSchema);
|