streamby-core 0.15.0 → 0.16.0

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/config.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export declare const config: {
2
- mongoUri: string;
3
2
  s3: {
4
3
  accessKeyId: string;
5
4
  secretAccessKey: string;
@@ -14,5 +13,6 @@ export declare const config: {
14
13
  local: {
15
14
  storagePath: string;
16
15
  };
17
- supabaseString: string;
16
+ mongooseString: string;
17
+ prismaString: string;
18
18
  };
package/dist/config.js CHANGED
@@ -7,7 +7,6 @@ exports.config = void 0;
7
7
  const dotenv_1 = __importDefault(require("dotenv"));
8
8
  dotenv_1.default.config();
9
9
  exports.config = {
10
- mongoUri: process.env.MONGO_URI || '',
11
10
  s3: {
12
11
  accessKeyId: process.env.AWS_ACCESS_KEY_ID || '',
13
12
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || '',
@@ -22,5 +21,6 @@ exports.config = {
22
21
  local: {
23
22
  storagePath: process.env.LOCAL_STORAGE_PATH || './uploads',
24
23
  },
25
- supabaseString: process.env.SUPABASE_STRING || '',
24
+ mongooseString: process.env.MONGOOSE_STRING || '',
25
+ prismaString: process.env.PRISMA_STRING || '',
26
26
  };
@@ -128,8 +128,9 @@ function createStreamByRouter(config) {
128
128
  }
129
129
  catch (error) { /* ignore */ }
130
130
  }
131
+ return null; // If dbType was provided and no project found in that specific provider, return null.
131
132
  }
132
- // Fallback to searching all providers if dbType is not provided or project not found in specific dbType
133
+ // If dbType is not provided, search both nosql and sql
133
134
  if (projectProviders.nosql) {
134
135
  try {
135
136
  const project = await projectProviders.nosql.getById(projectId, true);
@@ -146,15 +147,7 @@ function createStreamByRouter(config) {
146
147
  }
147
148
  catch (error) { /* ignore */ }
148
149
  }
149
- if (projectProviders.default) {
150
- try {
151
- const project = await projectProviders.default.getById(projectId, true);
152
- if (project)
153
- return projectProviders.default;
154
- }
155
- catch (error) { /* ignore */ }
156
- }
157
- return null;
150
+ return null; // If not found in either nosql or sql, return null.
158
151
  }
159
152
  router.get('/projects', async (req, res) => {
160
153
  try {
@@ -0,0 +1,61 @@
1
+ import mongoose from 'mongoose';
2
+ export declare function initExportModel(connection: mongoose.Connection): mongoose.Model<{
3
+ createdAt: NativeDate;
4
+ updatedAt: NativeDate;
5
+ } & {
6
+ name: string;
7
+ collectionName: string;
8
+ projectId: mongoose.Types.ObjectId;
9
+ description?: string | null | undefined;
10
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
11
+ createdAt: NativeDate;
12
+ updatedAt: NativeDate;
13
+ } & {
14
+ name: string;
15
+ collectionName: string;
16
+ projectId: mongoose.Types.ObjectId;
17
+ description?: string | null | undefined;
18
+ }, {}> & {
19
+ createdAt: NativeDate;
20
+ updatedAt: NativeDate;
21
+ } & {
22
+ name: string;
23
+ collectionName: string;
24
+ projectId: mongoose.Types.ObjectId;
25
+ description?: string | null | undefined;
26
+ } & {
27
+ _id: mongoose.Types.ObjectId;
28
+ } & {
29
+ __v: number;
30
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
+ timestamps: true;
32
+ collection: string;
33
+ }, {
34
+ createdAt: NativeDate;
35
+ updatedAt: NativeDate;
36
+ } & {
37
+ name: string;
38
+ collectionName: string;
39
+ projectId: mongoose.Types.ObjectId;
40
+ description?: string | null | undefined;
41
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
42
+ createdAt: NativeDate;
43
+ updatedAt: NativeDate;
44
+ } & {
45
+ name: string;
46
+ collectionName: string;
47
+ projectId: mongoose.Types.ObjectId;
48
+ description?: string | null | undefined;
49
+ }>, {}> & mongoose.FlatRecord<{
50
+ createdAt: NativeDate;
51
+ updatedAt: NativeDate;
52
+ } & {
53
+ name: string;
54
+ collectionName: string;
55
+ projectId: mongoose.Types.ObjectId;
56
+ description?: string | null | undefined;
57
+ }> & {
58
+ _id: mongoose.Types.ObjectId;
59
+ } & {
60
+ __v: number;
61
+ }>>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.initExportModel = initExportModel;
7
+ const mongoose_1 = __importDefault(require("mongoose"));
8
+ function initExportModel(connection) {
9
+ const exportSchema = new mongoose_1.default.Schema({
10
+ name: { type: String, required: true },
11
+ description: { type: String },
12
+ collectionName: { type: String, required: true },
13
+ projectId: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'Project', required: true },
14
+ }, {
15
+ timestamps: true,
16
+ collection: 'streamby_exports'
17
+ });
18
+ return connection.model('Export', exportSchema);
19
+ }