@roadmanjs/firebase-admin-serverless 1.0.6
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/README.md +27 -0
- package/dist/_utils/file.utils.d.ts +7 -0
- package/dist/_utils/file.utils.d.ts.map +1 -0
- package/dist/_utils/file.utils.js +13 -0
- package/dist/_utils/file.utils.js.map +1 -0
- package/dist/_utils/uuid.d.ts +2 -0
- package/dist/_utils/uuid.d.ts.map +1 -0
- package/dist/_utils/uuid.js +9 -0
- package/dist/_utils/uuid.js.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -0
- package/dist/firebase/index.d.ts +10 -0
- package/dist/firebase/index.d.ts.map +1 -0
- package/dist/firebase/index.js +29 -0
- package/dist/firebase/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/media/file.input.d.ts +12 -0
- package/dist/media/file.input.d.ts.map +1 -0
- package/dist/media/file.input.js +41 -0
- package/dist/media/file.input.js.map +1 -0
- package/dist/media/media.model.d.ts +22 -0
- package/dist/media/media.model.d.ts.map +1 -0
- package/dist/media/media.model.js +65 -0
- package/dist/media/media.model.js.map +1 -0
- package/dist/roadman.d.ts +8 -0
- package/dist/roadman.d.ts.map +1 -0
- package/dist/roadman.js +21 -0
- package/dist/roadman.js.map +1 -0
- package/dist/test.d.ts +2 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +6 -0
- package/dist/test.js.map +1 -0
- package/docs/starterpack.jpeg +0 -0
- package/package.json +52 -0
- package/register/index.js +1 -0
- package/register/transpile-only.js +3 -0
- package/register/type-check.js +3 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
<p align="center">
|
|
3
|
+
<h1 align="center"> Roadman - <a href="https://firebase.google.com" target="_blank">Firebase Admin</a> </h1>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## A roadman for firebase-admin.
|
|
8
|
+
|
|
9
|
+
### How to use
|
|
10
|
+
```
|
|
11
|
+
yarn add @roadmanjs/firebase-admin
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
app.ts
|
|
15
|
+
```ts
|
|
16
|
+
import {roadman} from 'roadman'
|
|
17
|
+
import {firebaseRoadman} from '@roadmanjs/firebase-admin';
|
|
18
|
+
|
|
19
|
+
await roadman({
|
|
20
|
+
roadmen: [firebaseRoadman]
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
#### Env required
|
|
25
|
+
```sh
|
|
26
|
+
FIREBASE_SA=
|
|
27
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.utils.d.ts","sourceRoot":"","sources":["../../src/_utils/file.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,aAAc,MAAM,WAEhD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFileExtension = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get file extension
|
|
6
|
+
* @param mimetype
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
const getFileExtension = (mimetype) => {
|
|
10
|
+
return (mimetype || 'image/png').split('/')[1];
|
|
11
|
+
};
|
|
12
|
+
exports.getFileExtension = getFileExtension;
|
|
13
|
+
//# sourceMappingURL=file.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.utils.js","sourceRoot":"","sources":["../../src/_utils/file.utils.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,OAAO,CAAC,QAAQ,IAAI,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/_utils/uuid.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,QAAO,MAE/B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateUUID = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const generateUUID = () => {
|
|
6
|
+
return (0, uuid_1.v4)();
|
|
7
|
+
};
|
|
8
|
+
exports.generateUUID = generateUUID;
|
|
9
|
+
//# sourceMappingURL=uuid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src/_utils/uuid.ts"],"names":[],"mappings":";;;AAAA,+BAAkC;AAE3B,MAAM,YAAY,GAAG,GAAW,EAAE;IACrC,OAAO,IAAA,SAAM,GAAE,CAAC;AACpB,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAElD,eAAe,MAAM,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AAAA,MAAM,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC;AAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAElD,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { app } from 'firebase-admin';
|
|
2
|
+
export interface FirebaseConfig {
|
|
3
|
+
appOptions: any;
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FirebaseProject extends app.App {
|
|
7
|
+
projectId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const configureFirebase: (fbconfig?: FirebaseConfig) => Promise<FirebaseProject>;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/firebase/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AAExC,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,GAAG,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,eAAgB,SAAQ,GAAG,CAAC,GAAG;IAC5C,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,cAAqB,cAAc,KAAG,OAAO,CAAC,eAAe,CAsB1F,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.configureFirebase = void 0;
|
|
7
|
+
const flarebase_auth_1 = require("@marplex/flarebase-auth");
|
|
8
|
+
const config_1 = __importDefault(require("../config"));
|
|
9
|
+
const configureFirebase = async (fbconfig) => {
|
|
10
|
+
const initAndReturn = async (_config) => {
|
|
11
|
+
const auth = () => new flarebase_auth_1.FlarebaseAuth({
|
|
12
|
+
apiKey: _config.appOptions.apiKey,
|
|
13
|
+
projectId: _config.appOptions.project_id,
|
|
14
|
+
privateKey: _config.appOptions.private_key,
|
|
15
|
+
serviceAccountEmail: _config.appOptions.client_email,
|
|
16
|
+
});
|
|
17
|
+
// initialize app
|
|
18
|
+
return {
|
|
19
|
+
projectId: _config.name || _config.appOptions.project_id,
|
|
20
|
+
auth,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
if (fbconfig) {
|
|
24
|
+
return initAndReturn(fbconfig);
|
|
25
|
+
}
|
|
26
|
+
return initAndReturn(config_1.default);
|
|
27
|
+
};
|
|
28
|
+
exports.configureFirebase = configureFirebase;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/firebase/index.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAsD;AAEtD,uDAA+B;AAWxB,MAAM,iBAAiB,GAAG,KAAK,EAAE,QAAyB,EAA4B,EAAE;IAC3F,MAAM,aAAa,GAAG,KAAK,EAAE,OAAwB,EAAE,EAAE;QACrD,MAAM,IAAI,GAAG,GAAG,EAAE,CACd,IAAI,8BAAa,CAAC;YACd,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;YACjC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;YACxC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;YAC1C,mBAAmB,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY;SACvD,CAAC,CAAC;QAEP,iBAAiB;QACjB,OAAO;YACH,SAAS,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU;YACxD,IAAI;SACuB,CAAC;IACpC,CAAC,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,aAAa,CAAC,gBAAM,CAAC,CAAC;AACjC,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./firebase"), exports);
|
|
18
|
+
__exportStar(require("./roadman"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,4CAA0B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MediaDataType } from './media.model';
|
|
2
|
+
export declare class FileInput implements Partial<MediaDataType & File> {
|
|
3
|
+
filename: string;
|
|
4
|
+
mimetype: string;
|
|
5
|
+
encoding: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class FileStringInput {
|
|
8
|
+
filename: string;
|
|
9
|
+
mimetype: string;
|
|
10
|
+
uri: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=file.input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.input.d.ts","sourceRoot":"","sources":["../../src/media/file.input.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAE5C,qBACa,SAAU,YAAW,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,MAAM,CAAC;CAC3D;AAED,qBACa,eAAe;IACe,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,MAAM,CAAC;IAEjB,GAAG,EAAE,MAAM,CAAC;CACtD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.FileStringInput = exports.FileInput = void 0;
|
|
10
|
+
const type_graphql_1 = require("type-graphql");
|
|
11
|
+
let FileInput = class FileInput {
|
|
12
|
+
};
|
|
13
|
+
exports.FileInput = FileInput;
|
|
14
|
+
__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
16
|
+
], FileInput.prototype, "filename", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
19
|
+
], FileInput.prototype, "mimetype", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
22
|
+
], FileInput.prototype, "encoding", void 0);
|
|
23
|
+
exports.FileInput = FileInput = __decorate([
|
|
24
|
+
(0, type_graphql_1.InputType)()
|
|
25
|
+
], FileInput);
|
|
26
|
+
let FileStringInput = class FileStringInput {
|
|
27
|
+
};
|
|
28
|
+
exports.FileStringInput = FileStringInput;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
31
|
+
], FileStringInput.prototype, "filename", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
34
|
+
], FileStringInput.prototype, "mimetype", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
37
|
+
], FileStringInput.prototype, "uri", void 0);
|
|
38
|
+
exports.FileStringInput = FileStringInput = __decorate([
|
|
39
|
+
(0, type_graphql_1.InputType)('FileStringInput')
|
|
40
|
+
], FileStringInput);
|
|
41
|
+
//# sourceMappingURL=file.input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.input.js","sourceRoot":"","sources":["../../src/media/file.input.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAA8C;AAKvC,IAAM,SAAS,GAAf,MAAM,SAAS;CAMrB,CAAA;AANY,8BAAS;AACqB;IAAtC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;2CAAkB;AAEjB;IAAtC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;2CAAkB;AAEjB;IAAtC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;2CAAkB;oBAL/C,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CAMrB;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AACe;IAAtC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;iDAAkB;AAEjB;IAAtC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;iDAAkB;AAEjB;IAAtC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;4CAAa;0BAL1C,eAAe;IAD3B,IAAA,wBAAS,EAAC,iBAAiB,CAAC;GAChB,eAAe,CAM3B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Types start
|
|
3
|
+
*/
|
|
4
|
+
export declare class MediaDataType {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
filename?: string;
|
|
8
|
+
mimetype?: string;
|
|
9
|
+
encoding?: string;
|
|
10
|
+
server?: string;
|
|
11
|
+
size?: number;
|
|
12
|
+
path?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
owner?: string;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* GraphQL Types end
|
|
20
|
+
*/
|
|
21
|
+
export default MediaDataType;
|
|
22
|
+
//# sourceMappingURL=media.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.model.d.ts","sourceRoot":"","sources":["../../src/media/media.model.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBACa,aAAa;IAEtB,EAAE,CAAC,EAAE,MAAM,CAAC;IAGZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,GAAG,CAAC,EAAE,MAAM,CAAC;IAGb,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,IAAI,CAAC;CACpB;AAED;;GAEG;AAIH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.MediaDataType = void 0;
|
|
10
|
+
const type_graphql_1 = require("type-graphql");
|
|
11
|
+
// const modelName = 'Media';
|
|
12
|
+
/**
|
|
13
|
+
* GraphQL Types start
|
|
14
|
+
*/
|
|
15
|
+
let MediaDataType = class MediaDataType {
|
|
16
|
+
};
|
|
17
|
+
exports.MediaDataType = MediaDataType;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
20
|
+
], MediaDataType.prototype, "id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
23
|
+
], MediaDataType.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
26
|
+
], MediaDataType.prototype, "filename", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
29
|
+
], MediaDataType.prototype, "mimetype", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
32
|
+
], MediaDataType.prototype, "encoding", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
35
|
+
nullable: true,
|
|
36
|
+
description: 'The server where the file is stored, e.g fastdfs',
|
|
37
|
+
})
|
|
38
|
+
], MediaDataType.prototype, "server", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)(() => Number, { nullable: true })
|
|
41
|
+
], MediaDataType.prototype, "size", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
44
|
+
], MediaDataType.prototype, "path", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
47
|
+
], MediaDataType.prototype, "url", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true })
|
|
50
|
+
], MediaDataType.prototype, "owner", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, type_graphql_1.Field)(() => Date, { nullable: true })
|
|
53
|
+
], MediaDataType.prototype, "createdAt", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, type_graphql_1.Field)(() => Date, { nullable: true })
|
|
56
|
+
], MediaDataType.prototype, "updatedAt", void 0);
|
|
57
|
+
exports.MediaDataType = MediaDataType = __decorate([
|
|
58
|
+
(0, type_graphql_1.ObjectType)()
|
|
59
|
+
], MediaDataType);
|
|
60
|
+
/**
|
|
61
|
+
* GraphQL Types end
|
|
62
|
+
*/
|
|
63
|
+
// export const MediaDataModel: Model = new Model(modelName);
|
|
64
|
+
exports.default = MediaDataType;
|
|
65
|
+
//# sourceMappingURL=media.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.model.js","sourceRoot":"","sources":["../../src/media/media.model.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAA+C;AAE/C,6BAA6B;AAC7B;;GAEG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAa;CAuCzB,CAAA;AAvCY,sCAAa;AAEtB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;yCAC1B;AAGZ;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;2CACxB;AAGd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;+CACpB;AAGlB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;+CACpB;AAGlB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;+CACpB;AAMlB;IAJC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,kDAAkD;KAClE,CAAC;6CACc;AAGhB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;2CACxB;AAGd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;2CACxB;AAGd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;0CACzB;AAGb;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;4CACvB;AAGf;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;gDACnB;AAGjB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;gDACnB;wBAtCR,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAuCzB;AAED;;GAEG;AAEH,6DAA6D;AAE7D,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roadman.d.ts","sourceRoot":"","sources":["../src/roadman.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAe,MAAM,iBAAiB,CAAC;AAQ3D;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAU7B,CAAC"}
|
package/dist/roadman.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firebaseRoadman = void 0;
|
|
4
|
+
// import MediaResolver from './media/media.resolver';
|
|
5
|
+
// import MediaResolverFastdfs from './media/media.resolver.fastdfs';
|
|
6
|
+
const firebase_1 = require("./firebase");
|
|
7
|
+
// import {isEmpty} from 'lodash';
|
|
8
|
+
const logs_1 = require("@roadmanjs/logs");
|
|
9
|
+
/**
|
|
10
|
+
* A firebase roadman
|
|
11
|
+
* @param RoadmanBuild
|
|
12
|
+
* TODO mediaRoadman
|
|
13
|
+
*/
|
|
14
|
+
const firebaseRoadman = async (args) => {
|
|
15
|
+
const { projectId } = await (0, firebase_1.configureFirebase)();
|
|
16
|
+
(0, logs_1.log)('ROADMAN: Firebase', '**************************************ProjectID********************', projectId);
|
|
17
|
+
return args;
|
|
18
|
+
};
|
|
19
|
+
exports.firebaseRoadman = firebaseRoadman;
|
|
20
|
+
// export const getMediaFileUploadResolvers = () => [MediaResolver];
|
|
21
|
+
//# sourceMappingURL=roadman.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roadman.js","sourceRoot":"","sources":["../src/roadman.ts"],"names":[],"mappings":";;;AAEA,sDAAsD;AACtD,qEAAqE;AACrE,yCAA6C;AAC7C,kCAAkC;AAClC,0CAAoC;AAEpC;;;;GAIG;AACI,MAAM,eAAe,GAAY,KAAK,EAAE,IAAkB,EAAyB,EAAE;IACxF,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,IAAA,4BAAiB,GAAE,CAAC;IAE9C,IAAA,UAAG,EACC,mBAAmB,EACnB,qEAAqE,EACrE,SAAS,CACZ,CAAC;IAEF,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAVW,QAAA,eAAe,mBAU1B;AAEF,oEAAoE"}
|
package/dist/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
package/dist/test.js
ADDED
package/dist/test.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";;AAAA,4BAA0B;AAE1B,mCAAwC;AAExC,IAAA,uBAAe,EAAC,IAAI,CAAC,CAAC"}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@roadmanjs/firebase-admin-serverless",
|
|
3
|
+
"description": "A roadman for firebase-admin",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"docs/",
|
|
8
|
+
"dist/",
|
|
9
|
+
"register/",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Ceddy Muhoza",
|
|
14
|
+
"email": "ceddymuhoza@gmail.com",
|
|
15
|
+
"url": "https://ceddy.org"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"private": false,
|
|
19
|
+
"scripts": {
|
|
20
|
+
"lint": "tslint \"src/**/*.ts\" --project tsconfig.json",
|
|
21
|
+
"build": "rm -rf dist && tsc --skipLibCheck",
|
|
22
|
+
"client": "node dist/script.js",
|
|
23
|
+
"test": "ts-node src/test.ts",
|
|
24
|
+
"fb:test": "mocha src/firebase/*test.ts --exit",
|
|
25
|
+
"eslint": "eslint ./src --fix --ext=ts"
|
|
26
|
+
},
|
|
27
|
+
"lint-staged": {
|
|
28
|
+
"*.{ts,tsx}": [
|
|
29
|
+
"npm run eslint"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"husky": {
|
|
33
|
+
"hooks": {
|
|
34
|
+
"pre-commit": "lint-staged"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"firebase-admin": "^12.6.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@marplex/flarebase-auth": "^1.2.0",
|
|
42
|
+
"@roadmanjs/core": "*",
|
|
43
|
+
"@roadmanjs/logs": "*",
|
|
44
|
+
"@roadmanjs/utils": "*",
|
|
45
|
+
"@stoqey/client-graphql": "^1.1.13",
|
|
46
|
+
"debug": "^4.3.1",
|
|
47
|
+
"lodash": "^4.17.20",
|
|
48
|
+
"type-graphql": "^ 2.0.0-rc.2",
|
|
49
|
+
"uuid": "^8.3.2"
|
|
50
|
+
},
|
|
51
|
+
"version": "1.0.6"
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../').register()
|