@brimble/models 3.8.77 → 3.8.79

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.
Files changed (300) hide show
  1. package/dist/activity-log.d.ts +6 -27
  2. package/dist/alert-event.d.ts +9 -0
  3. package/dist/alert-event.js +78 -0
  4. package/dist/alert-rule-state.d.ts +9 -0
  5. package/dist/alert-rule-state.js +49 -0
  6. package/dist/alert-rule.d.ts +9 -0
  7. package/dist/alert-rule.js +77 -0
  8. package/dist/app-message.d.ts +6 -27
  9. package/dist/app-message.js +2 -2
  10. package/dist/auto-scaling.d.ts +6 -27
  11. package/dist/card.d.ts +6 -27
  12. package/dist/cashier_subscription.d.ts +6 -27
  13. package/dist/cashier_subscription_item.d.ts +6 -27
  14. package/dist/collab-annotation.d.ts +6 -27
  15. package/dist/collab-comment.d.ts +6 -27
  16. package/dist/collab-integration.d.ts +6 -27
  17. package/dist/collab-push-subscription.d.ts +6 -27
  18. package/dist/collab-settings.d.ts +6 -27
  19. package/dist/collab-share-token.d.ts +6 -27
  20. package/dist/compute.d.ts +6 -27
  21. package/dist/compute.js +6 -0
  22. package/dist/db-image.d.ts +6 -27
  23. package/dist/db-image.js +19 -0
  24. package/dist/domain/dns-changelog.d.ts +9 -0
  25. package/dist/domain/dns-changelog.js +82 -0
  26. package/dist/domain/dns.d.ts +6 -27
  27. package/dist/domain/index.d.ts +6 -27
  28. package/dist/domain/index.js +4 -0
  29. package/dist/domain/renewal.d.ts +6 -27
  30. package/dist/domain/transfer.d.ts +6 -27
  31. package/dist/enum/index.d.ts +184 -0
  32. package/dist/enum/index.js +273 -37
  33. package/dist/env.d.ts +6 -27
  34. package/dist/environment-variable.d.ts +6 -27
  35. package/dist/environment-variable.js +8 -0
  36. package/dist/follower.d.ts +6 -27
  37. package/dist/following.d.ts +6 -27
  38. package/dist/framework.d.ts +6 -27
  39. package/dist/idempotency.d.ts +9 -0
  40. package/dist/idempotency.js +17 -0
  41. package/dist/index.d.ts +25 -2
  42. package/dist/index.js +92 -3
  43. package/dist/integration.d.ts +6 -27
  44. package/dist/intention.d.ts +6 -27
  45. package/dist/invoice.d.ts +6 -27
  46. package/dist/job.d.ts +6 -2
  47. package/dist/job.js +17 -7
  48. package/dist/license.d.ts +6 -27
  49. package/dist/load-balancer-port.d.ts +6 -27
  50. package/dist/logs.d.ts +6 -27
  51. package/dist/logs.js +0 -2
  52. package/dist/member-permission.d.ts +6 -27
  53. package/dist/member.d.ts +6 -27
  54. package/dist/object-storage-usage-segment.d.ts +9 -0
  55. package/dist/object-storage-usage-segment.js +46 -0
  56. package/dist/ownership-transfer.d.ts +6 -27
  57. package/dist/permission.d.ts +6 -27
  58. package/dist/plan_configuration.d.ts +6 -2
  59. package/dist/plan_configuration.js +22 -0
  60. package/dist/project/connection.d.ts +6 -27
  61. package/dist/project/index.d.ts +12 -29
  62. package/dist/project/index.js +29 -0
  63. package/dist/project/preview.d.ts +6 -27
  64. package/dist/project-environment.d.ts +6 -27
  65. package/dist/project-network-settings.d.ts +9 -0
  66. package/dist/project-network-settings.js +34 -0
  67. package/dist/project-tag-assignment.d.ts +6 -27
  68. package/dist/project_analytics.d.ts +6 -27
  69. package/dist/provider.d.ts +6 -27
  70. package/dist/provider.js +1 -0
  71. package/dist/quest-campaign.d.ts +9 -0
  72. package/dist/quest-campaign.js +39 -0
  73. package/dist/quest-participation.d.ts +9 -0
  74. package/dist/quest-participation.js +21 -0
  75. package/dist/quest-reward-issuance.d.ts +9 -0
  76. package/dist/quest-reward-issuance.js +19 -0
  77. package/dist/ratelimit.d.ts +9 -0
  78. package/dist/ratelimit.js +36 -0
  79. package/dist/region.d.ts +7 -28
  80. package/dist/role.d.ts +6 -27
  81. package/dist/sandbox-activity.d.ts +9 -0
  82. package/dist/sandbox-activity.js +49 -0
  83. package/dist/sandbox-image.d.ts +9 -0
  84. package/dist/sandbox-image.js +31 -0
  85. package/dist/sandbox-snapshot-usage-segment.d.ts +9 -0
  86. package/dist/sandbox-snapshot-usage-segment.js +49 -0
  87. package/dist/sandbox-snapshot.d.ts +9 -0
  88. package/dist/sandbox-snapshot.js +51 -0
  89. package/dist/sandbox-usage-segment.d.ts +9 -0
  90. package/dist/sandbox-usage-segment.js +57 -0
  91. package/dist/sandbox.d.ts +9 -0
  92. package/dist/sandbox.js +142 -0
  93. package/dist/server.d.ts +6 -27
  94. package/dist/settings.d.ts +6 -27
  95. package/dist/storage.d.ts +43 -0
  96. package/dist/storage.js +118 -0
  97. package/dist/streak-day.d.ts +9 -0
  98. package/dist/streak-day.js +11 -0
  99. package/dist/streak-event.d.ts +9 -0
  100. package/dist/streak-event.js +18 -0
  101. package/dist/streak-milestone.d.ts +9 -0
  102. package/dist/streak-milestone.js +11 -0
  103. package/dist/streak.d.ts +9 -0
  104. package/dist/streak.js +17 -0
  105. package/dist/subscription.d.ts +6 -27
  106. package/dist/tag.d.ts +6 -27
  107. package/dist/team.d.ts +6 -27
  108. package/dist/team.js +26 -0
  109. package/dist/token.d.ts +6 -27
  110. package/dist/types/alert-event.d.ts +23 -0
  111. package/dist/types/alert-event.js +2 -0
  112. package/dist/types/alert-rule-state.d.ts +13 -0
  113. package/dist/types/alert-rule-state.js +2 -0
  114. package/dist/types/alert-rule.d.ts +21 -0
  115. package/dist/types/alert-rule.js +2 -0
  116. package/dist/types/app-message.d.ts +2 -2
  117. package/dist/types/auto-scaling-group.d.ts +1 -1
  118. package/dist/types/compute.d.ts +3 -1
  119. package/dist/types/db-image.d.ts +5 -1
  120. package/dist/types/domain/dns-changelog.d.ts +20 -0
  121. package/dist/types/domain/dns-changelog.js +2 -0
  122. package/dist/types/domain/index.d.ts +1 -0
  123. package/dist/types/environment-variable.d.ts +2 -0
  124. package/dist/types/idempotency.d.ts +10 -0
  125. package/dist/types/idempotency.js +2 -0
  126. package/dist/types/index.d.ts +23 -0
  127. package/dist/types/object-storage-usage-segment.d.ts +23 -0
  128. package/dist/types/object-storage-usage-segment.js +2 -0
  129. package/dist/types/plan_configuration.d.ts +22 -0
  130. package/dist/types/project/index.d.ts +7 -0
  131. package/dist/types/project-network-settings.d.ts +28 -0
  132. package/dist/types/project-network-settings.js +2 -0
  133. package/dist/types/provider.d.ts +1 -0
  134. package/dist/types/quest-campaign.d.ts +38 -0
  135. package/dist/types/quest-campaign.js +2 -0
  136. package/dist/types/quest-participation.d.ts +19 -0
  137. package/dist/types/quest-participation.js +2 -0
  138. package/dist/types/quest-reward-issuance.d.ts +17 -0
  139. package/dist/types/quest-reward-issuance.js +2 -0
  140. package/dist/types/ratelimit.d.ts +41 -0
  141. package/dist/types/ratelimit.js +2 -0
  142. package/dist/types/region.d.ts +2 -2
  143. package/dist/types/sandbox-activity.d.ts +14 -0
  144. package/dist/types/sandbox-activity.js +2 -0
  145. package/dist/types/sandbox-image.d.ts +9 -0
  146. package/dist/types/sandbox-image.js +2 -0
  147. package/dist/types/sandbox-snapshot-usage-segment.d.ts +16 -0
  148. package/dist/types/sandbox-snapshot-usage-segment.js +2 -0
  149. package/dist/types/sandbox-snapshot.d.ts +16 -0
  150. package/dist/types/sandbox-snapshot.js +2 -0
  151. package/dist/types/sandbox-usage-segment.d.ts +25 -0
  152. package/dist/types/sandbox-usage-segment.js +2 -0
  153. package/dist/types/sandbox.d.ts +46 -0
  154. package/dist/types/sandbox.js +2 -0
  155. package/dist/types/storage.d.ts +131 -0
  156. package/dist/types/storage.js +2 -0
  157. package/dist/types/streak-day.d.ts +9 -0
  158. package/dist/types/streak-day.js +2 -0
  159. package/dist/types/streak-event.d.ts +13 -0
  160. package/dist/types/streak-event.js +2 -0
  161. package/dist/types/streak-milestone.d.ts +10 -0
  162. package/dist/types/streak-milestone.js +2 -0
  163. package/dist/types/streak.d.ts +17 -0
  164. package/dist/types/streak.js +2 -0
  165. package/dist/types/team.d.ts +8 -2
  166. package/dist/types/user.d.ts +4 -0
  167. package/dist/types/volume-usage-segment.d.ts +16 -0
  168. package/dist/types/volume-usage-segment.js +2 -0
  169. package/dist/types/volume.d.ts +9 -3
  170. package/dist/types/wallet.d.ts +1 -0
  171. package/dist/user.d.ts +6 -27
  172. package/dist/user.js +14 -0
  173. package/dist/volume-usage-segment.d.ts +9 -0
  174. package/dist/volume-usage-segment.js +46 -0
  175. package/dist/volume.d.ts +6 -27
  176. package/dist/volume.js +21 -4
  177. package/dist/wallet.d.ts +6 -27
  178. package/dist/wallet.js +4 -0
  179. package/dist/webhook-category.d.ts +6 -27
  180. package/dist/webhook-event.d.ts +6 -27
  181. package/dist/webhook-setting.d.ts +6 -27
  182. package/package.json +9 -5
  183. package/.claude/settings.local.json +0 -7
  184. package/.eslintrc.js +0 -26
  185. package/.prettierrc +0 -4
  186. package/activity-log.ts +0 -66
  187. package/app-message.ts +0 -18
  188. package/auto-scaling.ts +0 -72
  189. package/card.ts +0 -45
  190. package/cashier_subscription.ts +0 -35
  191. package/cashier_subscription_item.ts +0 -25
  192. package/collab-annotation.ts +0 -36
  193. package/collab-comment.ts +0 -27
  194. package/collab-integration.ts +0 -21
  195. package/collab-push-subscription.ts +0 -19
  196. package/collab-settings.ts +0 -29
  197. package/collab-share-token.ts +0 -15
  198. package/compute.ts +0 -88
  199. package/db-image.ts +0 -66
  200. package/domain/dns.ts +0 -34
  201. package/domain/index.ts +0 -109
  202. package/domain/renewal.ts +0 -25
  203. package/domain/transfer.ts +0 -112
  204. package/enum/index.ts +0 -257
  205. package/env.ts +0 -38
  206. package/environment-variable.ts +0 -21
  207. package/follower.ts +0 -19
  208. package/following.ts +0 -19
  209. package/framework.ts +0 -88
  210. package/index.ts +0 -199
  211. package/integration.ts +0 -39
  212. package/intention.ts +0 -40
  213. package/invoice.ts +0 -36
  214. package/job.ts +0 -30
  215. package/load-balancer-port.ts +0 -31
  216. package/logs.ts +0 -47
  217. package/member-permission.ts +0 -13
  218. package/member.ts +0 -44
  219. package/ownership-transfer.ts +0 -42
  220. package/permission.ts +0 -13
  221. package/plan_configuration.ts +0 -48
  222. package/project/connection.ts +0 -21
  223. package/project/index.ts +0 -238
  224. package/project/preview.ts +0 -41
  225. package/project-environment.ts +0 -18
  226. package/project-tag-assignment.ts +0 -40
  227. package/project_analytics.ts +0 -26
  228. package/provider.ts +0 -11
  229. package/region.ts +0 -18
  230. package/role.ts +0 -12
  231. package/server.ts +0 -105
  232. package/settings.ts +0 -53
  233. package/subscription.ts +0 -86
  234. package/tag.ts +0 -34
  235. package/team.ts +0 -60
  236. package/token.ts +0 -40
  237. package/tsconfig.json +0 -14
  238. package/types/activity-log.ts +0 -19
  239. package/types/app-message.ts +0 -16
  240. package/types/auto-scaling-group.ts +0 -21
  241. package/types/card.ts +0 -20
  242. package/types/cashier_subscription.ts +0 -29
  243. package/types/collab-annotation.ts +0 -28
  244. package/types/collab-comment.ts +0 -22
  245. package/types/collab-integration.ts +0 -14
  246. package/types/collab-push-subscription.ts +0 -10
  247. package/types/collab-settings.ts +0 -17
  248. package/types/collab-share-token.ts +0 -13
  249. package/types/compute.ts +0 -51
  250. package/types/db-image.ts +0 -18
  251. package/types/domain/dns.ts +0 -13
  252. package/types/domain/index.ts +0 -35
  253. package/types/domain/renewal.ts +0 -11
  254. package/types/domain/transfer.ts +0 -32
  255. package/types/env.ts +0 -14
  256. package/types/environment-variable.ts +0 -13
  257. package/types/following.ts +0 -6
  258. package/types/framework.ts +0 -41
  259. package/types/git.ts +0 -15
  260. package/types/index.ts +0 -56
  261. package/types/installed_integration.ts +0 -9
  262. package/types/integration.ts +0 -24
  263. package/types/intention.ts +0 -14
  264. package/types/invoice.ts +0 -16
  265. package/types/job.ts +0 -20
  266. package/types/license.ts +0 -19
  267. package/types/load-balancer-port.ts +0 -13
  268. package/types/logs.ts +0 -36
  269. package/types/member-permission.ts +0 -11
  270. package/types/member.ts +0 -19
  271. package/types/ownership-transfer.ts +0 -13
  272. package/types/permission.ts +0 -19
  273. package/types/plan_configuration.ts +0 -35
  274. package/types/project/connection.ts +0 -7
  275. package/types/project/index.ts +0 -96
  276. package/types/project/preview.ts +0 -22
  277. package/types/project-environment.ts +0 -14
  278. package/types/project-tag-assignment.ts +0 -14
  279. package/types/project_analytics.ts +0 -12
  280. package/types/provider.ts +0 -8
  281. package/types/region.ts +0 -16
  282. package/types/role.ts +0 -13
  283. package/types/server.ts +0 -59
  284. package/types/settings.ts +0 -19
  285. package/types/subscription.ts +0 -34
  286. package/types/tag.ts +0 -12
  287. package/types/team.ts +0 -19
  288. package/types/token.ts +0 -12
  289. package/types/user.ts +0 -41
  290. package/types/volume.ts +0 -15
  291. package/types/wallet.ts +0 -8
  292. package/types/webhook-category.ts +0 -5
  293. package/types/webhook-event.ts +0 -8
  294. package/types/webhook-setting.ts +0 -17
  295. package/user.ts +0 -61
  296. package/volume.ts +0 -36
  297. package/wallet.ts +0 -23
  298. package/webhook-category.ts +0 -11
  299. package/webhook-event.ts +0 -20
  300. package/webhook-setting.ts +0 -48
@@ -1,30 +1,9 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose" />
25
- /// <reference types="mongoose/types/inferschematype" />
26
1
  import { IProjectAnalytics } from "./types/project_analytics";
27
- declare const _default: import("mongoose").Model<IProjectAnalytics, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectAnalytics> & IProjectAnalytics & {
2
+ declare const _default: import("mongoose").Model<IProjectAnalytics, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectAnalytics, {}, import("mongoose").DefaultSchemaOptions> & IProjectAnalytics & Required<{
28
3
  _id: import("mongoose").Types.ObjectId;
29
- }, any>;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IProjectAnalytics>;
30
9
  export default _default;
@@ -1,30 +1,9 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose" />
25
- /// <reference types="mongoose/types/inferschematype" />
26
1
  import { IProvider } from "./types/provider";
27
- declare const _default: import("mongoose").Model<IProvider, {}, {}, {}, import("mongoose").Document<unknown, {}, IProvider> & IProvider & {
2
+ declare const _default: import("mongoose").Model<IProvider, {}, {}, {}, import("mongoose").Document<unknown, {}, IProvider, {}, import("mongoose").DefaultSchemaOptions> & IProvider & Required<{
28
3
  _id: import("mongoose").Types.ObjectId;
29
- }, any>;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IProvider>;
30
9
  export default _default;
package/dist/provider.js CHANGED
@@ -6,5 +6,6 @@ const providerSchema = new mongoose_1.Schema({
6
6
  slug: { type: String, required: true, unique: true },
7
7
  logo: { type: String, required: true },
8
8
  enabled: { type: Boolean, default: true },
9
+ suffix: { type: String, required: false },
9
10
  });
10
11
  exports.default = (0, mongoose_1.model)("Provider", providerSchema, "providers");
@@ -0,0 +1,9 @@
1
+ import { IQuestCampaign } from "./types";
2
+ declare const _default: import("mongoose").Model<IQuestCampaign, {}, {}, {}, import("mongoose").Document<unknown, {}, IQuestCampaign, {}, import("mongoose").DefaultSchemaOptions> & IQuestCampaign & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IQuestCampaign>;
9
+ export default _default;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const questCriterionSchema = new mongoose_1.Schema({
5
+ type: { type: String, required: true },
6
+ label: { type: String, required: true },
7
+ target: { type: Number, required: true },
8
+ entity: { type: String, default: null },
9
+ action: { type: String, default: null },
10
+ service_type: { type: String, default: null },
11
+ distinct: { type: Boolean, default: false },
12
+ milestones: { type: [String], default: [] },
13
+ }, { _id: false });
14
+ const questRequirementSchema = new mongoose_1.Schema({
15
+ type: { type: String, required: true },
16
+ target: { type: Number, default: 0 },
17
+ message: { type: String, default: null },
18
+ }, { _id: false });
19
+ const questRewardSchema = new mongoose_1.Schema({
20
+ type: { type: String, required: true },
21
+ metadata: { type: mongoose_1.Schema.Types.Mixed, default: {} },
22
+ }, { _id: false });
23
+ const questCampaignSchema = new mongoose_1.Schema({
24
+ name: { type: String, required: true },
25
+ slug: { type: String, required: true, unique: true },
26
+ start_at: { type: Date, required: true },
27
+ end_at: { type: Date, required: true },
28
+ eligibility_type: { type: String, required: true },
29
+ min_streak_to_join: { type: Number, default: 0 },
30
+ slots_total: { type: Number, required: true },
31
+ slots_remaining: { type: Number, required: true },
32
+ criteria: { type: [questCriterionSchema], default: [] },
33
+ requirements: { type: [questRequirementSchema], default: [] },
34
+ rewards: { type: [questRewardSchema], default: [] },
35
+ active: { type: Boolean, default: true, index: true },
36
+ auto_expire: { type: Boolean, default: true },
37
+ }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "quest_campaigns" });
38
+ questCampaignSchema.index({ active: 1, start_at: 1, end_at: 1 });
39
+ exports.default = (0, mongoose_1.model)("QuestCampaign", questCampaignSchema);
@@ -0,0 +1,9 @@
1
+ import { IQuestParticipation } from "./types";
2
+ declare const _default: import("mongoose").Model<IQuestParticipation, {}, {}, {}, import("mongoose").Document<unknown, {}, IQuestParticipation, {}, import("mongoose").DefaultSchemaOptions> & IQuestParticipation & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IQuestParticipation>;
9
+ export default _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const questCriterionProgressSchema = new mongoose_1.Schema({
5
+ key: { type: String, required: true },
6
+ current: { type: Number, default: 0 },
7
+ target: { type: Number, required: true },
8
+ met: { type: Boolean, default: false },
9
+ }, { _id: false });
10
+ const questParticipationSchema = new mongoose_1.Schema({
11
+ campaign_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "QuestCampaign", required: true, index: true },
12
+ user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
13
+ joined_at: { type: Date, required: true },
14
+ slot_number: { type: Number, required: true },
15
+ streak_deducted: { type: Number, default: 0 },
16
+ criteria_progress: { type: [questCriterionProgressSchema], default: [] },
17
+ qualifier_met: { type: Boolean, default: false },
18
+ claimed_at: { type: Date, default: null },
19
+ }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "quest_participations" });
20
+ questParticipationSchema.index({ campaign_id: 1, user_id: 1 }, { unique: true });
21
+ exports.default = (0, mongoose_1.model)("QuestParticipation", questParticipationSchema);
@@ -0,0 +1,9 @@
1
+ import { IQuestRewardIssuance } from "./types";
2
+ declare const _default: import("mongoose").Model<IQuestRewardIssuance, {}, {}, {}, import("mongoose").Document<unknown, {}, IQuestRewardIssuance, {}, import("mongoose").DefaultSchemaOptions> & IQuestRewardIssuance & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IQuestRewardIssuance>;
9
+ export default _default;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const enum_1 = require("./enum");
5
+ const questIssuedRewardSchema = new mongoose_1.Schema({
6
+ type: { type: String, required: true },
7
+ metadata: { type: mongoose_1.Schema.Types.Mixed, default: {} },
8
+ }, { _id: false });
9
+ const questRewardIssuanceSchema = new mongoose_1.Schema({
10
+ participation_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "QuestParticipation", required: true, index: true },
11
+ campaign_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "QuestCampaign", required: true, index: true },
12
+ user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
13
+ rewards: { type: [questIssuedRewardSchema], default: [] },
14
+ status: { type: String, required: true, default: enum_1.QuestRewardStatus.Claimed },
15
+ claimed_at: { type: Date, required: true },
16
+ fulfilled_at: { type: Date, default: null },
17
+ }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "quest_reward_issuances" });
18
+ questRewardIssuanceSchema.index({ campaign_id: 1, user_id: 1 }, { unique: true });
19
+ exports.default = (0, mongoose_1.model)("QuestRewardIssuance", questRewardIssuanceSchema);
@@ -0,0 +1,9 @@
1
+ import { IRatelimit } from "./types";
2
+ declare const _default: import("mongoose").Model<IRatelimit, {}, {}, {}, import("mongoose").Document<unknown, {}, IRatelimit, {}, import("mongoose").DefaultSchemaOptions> & IRatelimit & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IRatelimit>;
9
+ export default _default;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const ratelimitSchema = new mongoose_1.Schema({
5
+ project: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true },
6
+ enabled: { type: Boolean, default: true },
7
+ zones: {
8
+ type: [
9
+ {
10
+ name: { type: String, required: true },
11
+ key: { type: String, required: true },
12
+ window: { type: String, required: true },
13
+ events: { type: Number, required: true },
14
+ matcher: {
15
+ methods: [{ type: String }],
16
+ paths: [{ type: String }],
17
+ },
18
+ ipv4Prefix: Number,
19
+ ipv6Prefix: Number,
20
+ },
21
+ ],
22
+ default: [],
23
+ },
24
+ distributed: {
25
+ enabled: { type: Boolean, default: false },
26
+ readInterval: String,
27
+ writeInterval: String,
28
+ purgeAge: String,
29
+ },
30
+ logKey: { type: Boolean, default: false },
31
+ disableMetrics: { type: Boolean, default: false },
32
+ jitter: Number,
33
+ sweepInterval: String,
34
+ }, { timestamps: true });
35
+ ratelimitSchema.index({ project: 1 }, { unique: true });
36
+ exports.default = (0, mongoose_1.model)("Ratelimit", ratelimitSchema, "ratelimits");
package/dist/region.d.ts CHANGED
@@ -1,30 +1,9 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
- import { Schema } from "mongoose";
26
1
  import { IRegion } from "./types/region";
27
- declare const _default: import("mongoose").Model<IRegion, {}, {}, {}, import("mongoose").Document<unknown, {}, IRegion> & IRegion & Required<{
28
- _id: Schema.Types.ObjectId;
29
- }>, any>;
2
+ declare const _default: import("mongoose").Model<IRegion, {}, {}, {}, import("mongoose").Document<unknown, {}, IRegion, {}, import("mongoose").DefaultSchemaOptions> & IRegion & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IRegion>;
30
9
  export default _default;
package/dist/role.d.ts CHANGED
@@ -1,30 +1,9 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose" />
25
- /// <reference types="mongoose/types/inferschematype" />
26
1
  import { IRole } from "./types/role";
27
- declare const _default: import("mongoose").Model<IRole, {}, {}, {}, import("mongoose").Document<unknown, {}, IRole> & IRole & {
2
+ declare const _default: import("mongoose").Model<IRole, {}, {}, {}, import("mongoose").Document<unknown, {}, IRole, {}, import("mongoose").DefaultSchemaOptions> & IRole & Required<{
28
3
  _id: import("mongoose").Types.ObjectId;
29
- }, any>;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IRole>;
30
9
  export default _default;
@@ -0,0 +1,9 @@
1
+ import { ISandboxActivity } from "./types/sandbox-activity";
2
+ declare const _default: import("mongoose").Model<ISandboxActivity, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxActivity, {}, import("mongoose").DefaultSchemaOptions> & ISandboxActivity & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, ISandboxActivity>;
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 sandboxActivitySchema = new mongoose_1.Schema({
5
+ sandbox_id: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "Sandbox",
8
+ required: true,
9
+ index: true,
10
+ },
11
+ user_id: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "User",
14
+ required: true,
15
+ index: true,
16
+ },
17
+ team: {
18
+ type: mongoose_1.Schema.Types.ObjectId,
19
+ ref: "Team",
20
+ default: null,
21
+ index: true,
22
+ },
23
+ command: {
24
+ type: String,
25
+ required: true,
26
+ },
27
+ started_at: {
28
+ type: Date,
29
+ required: true,
30
+ index: true,
31
+ },
32
+ ended_at: {
33
+ type: Date,
34
+ default: null,
35
+ },
36
+ exit_code: {
37
+ type: Number,
38
+ default: null,
39
+ },
40
+ duration_ms: {
41
+ type: Number,
42
+ default: null,
43
+ },
44
+ error: {
45
+ type: String,
46
+ default: null,
47
+ },
48
+ }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
49
+ exports.default = (0, mongoose_1.model)("SandboxActivity", sandboxActivitySchema);
@@ -0,0 +1,9 @@
1
+ import { ISandboxImage } from "./types/sandbox-image";
2
+ declare const _default: import("mongoose").Model<ISandboxImage, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxImage, {}, import("mongoose").DefaultSchemaOptions> & ISandboxImage & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, ISandboxImage>;
9
+ export default _default;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const sandboxImageSchema = new mongoose_1.Schema({
5
+ name: {
6
+ type: String,
7
+ required: true,
8
+ unique: true,
9
+ },
10
+ display_name: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ image: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ description: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ is_available: {
23
+ type: Boolean,
24
+ default: true,
25
+ },
26
+ is_default: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ }, { timestamps: true });
31
+ exports.default = (0, mongoose_1.model)("SandboxImage", sandboxImageSchema);
@@ -0,0 +1,9 @@
1
+ import { ISandboxSnapshotUsageSegment } from "./types/sandbox-snapshot-usage-segment";
2
+ declare const _default: import("mongoose").Model<ISandboxSnapshotUsageSegment, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxSnapshotUsageSegment, {}, import("mongoose").DefaultSchemaOptions> & ISandboxSnapshotUsageSegment & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, ISandboxSnapshotUsageSegment>;
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 sandboxSnapshotUsageSegmentSchema = new mongoose_1.Schema({
5
+ snapshot_id: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "SandboxSnapshot",
8
+ required: true,
9
+ index: true,
10
+ },
11
+ user_id: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "User",
14
+ required: true,
15
+ index: true,
16
+ },
17
+ team_id: {
18
+ type: mongoose_1.Schema.Types.ObjectId,
19
+ ref: "Team",
20
+ required: false,
21
+ default: null,
22
+ index: true,
23
+ },
24
+ size_gb: {
25
+ type: Number,
26
+ required: true,
27
+ default: 0,
28
+ },
29
+ costs: {
30
+ startDate: { type: Date, required: true },
31
+ endDate: { type: Date, default: null },
32
+ },
33
+ billed: {
34
+ type: Boolean,
35
+ default: false,
36
+ index: true,
37
+ },
38
+ }, {
39
+ timestamps: true,
40
+ });
41
+ sandboxSnapshotUsageSegmentSchema.index({ user_id: 1, billed: 1, "costs.endDate": 1 });
42
+ sandboxSnapshotUsageSegmentSchema.index({ team_id: 1, billed: 1, "costs.endDate": 1 });
43
+ sandboxSnapshotUsageSegmentSchema.index({ snapshot_id: 1, "costs.endDate": 1 });
44
+ sandboxSnapshotUsageSegmentSchema.index({ snapshot_id: 1 }, {
45
+ unique: true,
46
+ partialFilterExpression: { "costs.endDate": null },
47
+ name: "unique_open_segment_per_snapshot",
48
+ });
49
+ exports.default = (0, mongoose_1.model)("SandboxSnapshotUsageSegment", sandboxSnapshotUsageSegmentSchema, "sandbox_snapshot_usage_segments");
@@ -0,0 +1,9 @@
1
+ import { ISandboxSnapshot } from "./types/sandbox-snapshot";
2
+ declare const _default: import("mongoose").Model<ISandboxSnapshot, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxSnapshot, {}, import("mongoose").DefaultSchemaOptions> & ISandboxSnapshot & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, ISandboxSnapshot>;
9
+ export default _default;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const enum_1 = require("./enum");
5
+ const sandboxSnapshotSchema = new mongoose_1.Schema({
6
+ user_id: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "User",
9
+ required: true,
10
+ index: true,
11
+ },
12
+ team: {
13
+ type: mongoose_1.Schema.Types.ObjectId,
14
+ ref: "Team",
15
+ default: null,
16
+ index: true,
17
+ },
18
+ sandbox_id: {
19
+ type: mongoose_1.Schema.Types.ObjectId,
20
+ ref: "Sandbox",
21
+ required: true,
22
+ index: true,
23
+ },
24
+ name: {
25
+ type: String,
26
+ required: true,
27
+ match: /^[a-z0-9-]{1,40}$/,
28
+ },
29
+ image_tag: {
30
+ type: String,
31
+ required: true,
32
+ },
33
+ source_template: {
34
+ type: String,
35
+ required: true,
36
+ },
37
+ status: {
38
+ type: String,
39
+ enum: Object.values(enum_1.SANDBOX_SNAPSHOT_STATUS),
40
+ default: enum_1.SANDBOX_SNAPSHOT_STATUS.CREATING,
41
+ },
42
+ failure_reason: {
43
+ type: String,
44
+ default: null,
45
+ },
46
+ size_bytes: {
47
+ type: Number,
48
+ default: null,
49
+ },
50
+ }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
51
+ exports.default = (0, mongoose_1.model)("SandboxSnapshot", sandboxSnapshotSchema);
@@ -0,0 +1,9 @@
1
+ import { ISandboxUsageSegment } from "./types/sandbox-usage-segment";
2
+ declare const _default: import("mongoose").Model<ISandboxUsageSegment, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxUsageSegment, {}, import("mongoose").DefaultSchemaOptions> & ISandboxUsageSegment & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, ISandboxUsageSegment>;
9
+ export default _default;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const sandboxUsageSegmentSchema = new mongoose_1.Schema({
5
+ sandbox_id: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "Sandbox",
8
+ required: true,
9
+ index: true,
10
+ },
11
+ user_id: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "User",
14
+ required: true,
15
+ index: true,
16
+ },
17
+ team_id: {
18
+ type: mongoose_1.Schema.Types.ObjectId,
19
+ ref: "Team",
20
+ required: false,
21
+ index: true,
22
+ default: null,
23
+ },
24
+ current: {
25
+ cpu: { type: Number, required: true },
26
+ memory: { type: Number, required: true },
27
+ storage: { type: Number, required: true },
28
+ },
29
+ costs: {
30
+ startDate: { type: Date, required: true },
31
+ endDate: { type: Date, default: null },
32
+ },
33
+ billed: {
34
+ type: Boolean,
35
+ default: false,
36
+ index: true,
37
+ },
38
+ region: {
39
+ type: String,
40
+ required: false,
41
+ },
42
+ template: {
43
+ type: String,
44
+ required: false,
45
+ },
46
+ }, {
47
+ timestamps: true,
48
+ });
49
+ sandboxUsageSegmentSchema.index({ user_id: 1, billed: 1, "costs.endDate": 1 });
50
+ sandboxUsageSegmentSchema.index({ team_id: 1, billed: 1, "costs.endDate": 1 });
51
+ sandboxUsageSegmentSchema.index({ sandbox_id: 1, "costs.endDate": 1 });
52
+ sandboxUsageSegmentSchema.index({ sandbox_id: 1 }, {
53
+ unique: true,
54
+ partialFilterExpression: { "costs.endDate": null },
55
+ name: "uniq_open_sandbox_usage_segment_per_sandbox",
56
+ });
57
+ exports.default = (0, mongoose_1.model)("SandboxUsageSegment", sandboxUsageSegmentSchema, "sandbox_usage_segments");
@@ -0,0 +1,9 @@
1
+ import { ISandbox } from "./types/sandbox";
2
+ declare const _default: import("mongoose").Model<ISandbox, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandbox, {}, import("mongoose").DefaultSchemaOptions> & ISandbox & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, ISandbox>;
9
+ export default _default;