@aeriajs/core 0.0.173 → 0.0.175
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/collection/reference.d.ts +1 -0
- package/dist/collection/reference.js +29 -11
- package/dist/collection/reference.mjs +32 -14
- package/dist/collection/traverseDocument.js +5 -0
- package/dist/collection/traverseDocument.mjs +5 -0
- package/dist/functions/upload.js +0 -5
- package/dist/functions/upload.mjs +0 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.mjs +0 -1
- package/dist/token.d.ts +1 -3
- package/dist/token.js +17 -17
- package/dist/token.mjs +16 -15
- package/package.json +5 -5
- package/dist/use.d.ts +0 -1
- package/dist/use.js +0 -18
- package/dist/use.mjs +0 -15
|
@@ -9,7 +9,7 @@ const getTempName = (path) => {
|
|
|
9
9
|
const referenceMemo = {};
|
|
10
10
|
const lookupMemo = {};
|
|
11
11
|
const getReferences = async (properties, options = {}) => {
|
|
12
|
-
const { depth = 0, maxDepth = 3, memoize, populate, } = options;
|
|
12
|
+
const { depth = 0, maxDepth = 3, memoize, populate, isArrayElement, } = options;
|
|
13
13
|
if (memoize) {
|
|
14
14
|
if (referenceMemo[memoize]) {
|
|
15
15
|
return referenceMemo[memoize];
|
|
@@ -33,6 +33,7 @@ const getReferences = async (properties, options = {}) => {
|
|
|
33
33
|
maxDepth: refProperty.populateDepth || maxDepth,
|
|
34
34
|
memoize: `${memoize}.${propName}`,
|
|
35
35
|
populate: Array.from(refProperty.populate),
|
|
36
|
+
isArrayElement: 'items' in property,
|
|
36
37
|
});
|
|
37
38
|
if (Object.keys(deepReferences).length > 0) {
|
|
38
39
|
reference.deepReferences = deepReferences;
|
|
@@ -68,6 +69,9 @@ const getReferences = async (properties, options = {}) => {
|
|
|
68
69
|
if ('items' in property) {
|
|
69
70
|
reference.isArray = true;
|
|
70
71
|
}
|
|
72
|
+
if (isArrayElement) {
|
|
73
|
+
reference.isArrayElement = true;
|
|
74
|
+
}
|
|
71
75
|
if (depth > 0) {
|
|
72
76
|
reference.isRecursive = true;
|
|
73
77
|
}
|
|
@@ -91,8 +95,9 @@ const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
91
95
|
noCond: false,
|
|
92
96
|
}) => {
|
|
93
97
|
const refName = path.at(-1);
|
|
98
|
+
const shouldUseArrayIndex = reference.isRecursive && !(reference.isArrayElement && reference.isArray === false);
|
|
94
99
|
let indexOfArray;
|
|
95
|
-
if (
|
|
100
|
+
if (shouldUseArrayIndex) {
|
|
96
101
|
indexOfArray = {
|
|
97
102
|
$indexOfArray: [
|
|
98
103
|
`$${getTempName(path)}._id`,
|
|
@@ -125,7 +130,6 @@ const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
125
130
|
mapIn = (0, exports.recurseSetStage)({
|
|
126
131
|
...reference,
|
|
127
132
|
isArray: false,
|
|
128
|
-
isArrayElement: true,
|
|
129
133
|
}, path, `$$${newElemName}`);
|
|
130
134
|
}
|
|
131
135
|
else {
|
|
@@ -135,19 +139,33 @@ const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
135
139
|
(0, exports.recurseSetStage)({
|
|
136
140
|
...reference,
|
|
137
141
|
isArray: false,
|
|
138
|
-
isArrayElement: true,
|
|
139
142
|
}, path, `$$${newElemName}`),
|
|
140
143
|
],
|
|
141
144
|
};
|
|
142
145
|
}
|
|
143
146
|
let mapInput = parentElem;
|
|
144
147
|
if (reference.isRecursive) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
if (reference.isArrayElement) {
|
|
149
|
+
mapInput = {
|
|
150
|
+
$arrayElemAt: [
|
|
151
|
+
`$${getTempName(path.slice(0, -1))}.${refName}`,
|
|
152
|
+
{
|
|
153
|
+
$indexOfArray: [
|
|
154
|
+
`$${getTempName(path.slice(0, -1))}._id`,
|
|
155
|
+
parentElem,
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
mapInput = {
|
|
163
|
+
$arrayElemAt: [
|
|
164
|
+
`$${getTempName(path.slice(0, -1))}.${refName}`,
|
|
165
|
+
indexOfArray,
|
|
166
|
+
],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
151
169
|
}
|
|
152
170
|
return {
|
|
153
171
|
$filter: {
|
|
@@ -172,7 +190,7 @@ const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
172
190
|
const stages = [];
|
|
173
191
|
for (const [subRefName, subReference] of Object.entries(reference.deepReferences)) {
|
|
174
192
|
let newElem;
|
|
175
|
-
if (
|
|
193
|
+
if (shouldUseArrayIndex) {
|
|
176
194
|
newElem = {
|
|
177
195
|
$arrayElemAt: [
|
|
178
196
|
`$${getTempName(path.slice(0, -1))}.${refName}`,
|
|
@@ -11,7 +11,8 @@ export const getReferences = async (properties, options = {}) => {
|
|
|
11
11
|
depth = 0,
|
|
12
12
|
maxDepth = 3,
|
|
13
13
|
memoize,
|
|
14
|
-
populate
|
|
14
|
+
populate,
|
|
15
|
+
isArrayElement
|
|
15
16
|
} = options;
|
|
16
17
|
if (memoize) {
|
|
17
18
|
if (referenceMemo[memoize]) {
|
|
@@ -35,7 +36,8 @@ export const getReferences = async (properties, options = {}) => {
|
|
|
35
36
|
depth: depth + 1,
|
|
36
37
|
maxDepth: refProperty.populateDepth || maxDepth,
|
|
37
38
|
memoize: `${memoize}.${propName}`,
|
|
38
|
-
populate: Array.from(refProperty.populate)
|
|
39
|
+
populate: Array.from(refProperty.populate),
|
|
40
|
+
isArrayElement: "items" in property
|
|
39
41
|
});
|
|
40
42
|
if (Object.keys(deepReferences).length > 0) {
|
|
41
43
|
reference.deepReferences = deepReferences;
|
|
@@ -61,6 +63,9 @@ export const getReferences = async (properties, options = {}) => {
|
|
|
61
63
|
if ("items" in property) {
|
|
62
64
|
reference.isArray = true;
|
|
63
65
|
}
|
|
66
|
+
if (isArrayElement) {
|
|
67
|
+
reference.isArrayElement = true;
|
|
68
|
+
}
|
|
64
69
|
if (depth > 0) {
|
|
65
70
|
reference.isRecursive = true;
|
|
66
71
|
}
|
|
@@ -83,8 +88,9 @@ export const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
83
88
|
noCond: false
|
|
84
89
|
}) => {
|
|
85
90
|
const refName = path.at(-1);
|
|
91
|
+
const shouldUseArrayIndex = reference.isRecursive && !(reference.isArrayElement && reference.isArray === false);
|
|
86
92
|
let indexOfArray;
|
|
87
|
-
if (
|
|
93
|
+
if (shouldUseArrayIndex) {
|
|
88
94
|
indexOfArray = {
|
|
89
95
|
$indexOfArray: [
|
|
90
96
|
`$${getTempName(path)}._id`,
|
|
@@ -115,8 +121,7 @@ export const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
115
121
|
if (reference.referencedCollection) {
|
|
116
122
|
mapIn = recurseSetStage({
|
|
117
123
|
...reference,
|
|
118
|
-
isArray: false
|
|
119
|
-
isArrayElement: true
|
|
124
|
+
isArray: false
|
|
120
125
|
}, path, `$$${newElemName}`);
|
|
121
126
|
} else {
|
|
122
127
|
mapIn = {
|
|
@@ -124,20 +129,33 @@ export const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
124
129
|
`$$${newElemName}`,
|
|
125
130
|
recurseSetStage({
|
|
126
131
|
...reference,
|
|
127
|
-
isArray: false
|
|
128
|
-
isArrayElement: true
|
|
132
|
+
isArray: false
|
|
129
133
|
}, path, `$$${newElemName}`)
|
|
130
134
|
]
|
|
131
135
|
};
|
|
132
136
|
}
|
|
133
137
|
let mapInput = parentElem;
|
|
134
138
|
if (reference.isRecursive) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
if (reference.isArrayElement) {
|
|
140
|
+
mapInput = {
|
|
141
|
+
$arrayElemAt: [
|
|
142
|
+
`$${getTempName(path.slice(0, -1))}.${refName}`,
|
|
143
|
+
{
|
|
144
|
+
$indexOfArray: [
|
|
145
|
+
`$${getTempName(path.slice(0, -1))}._id`,
|
|
146
|
+
parentElem
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
};
|
|
151
|
+
} else {
|
|
152
|
+
mapInput = {
|
|
153
|
+
$arrayElemAt: [
|
|
154
|
+
`$${getTempName(path.slice(0, -1))}.${refName}`,
|
|
155
|
+
indexOfArray
|
|
156
|
+
]
|
|
157
|
+
};
|
|
158
|
+
}
|
|
141
159
|
}
|
|
142
160
|
return {
|
|
143
161
|
$filter: {
|
|
@@ -162,7 +180,7 @@ export const recurseSetStage = (reference, path, parentElem, options = {
|
|
|
162
180
|
const stages = [];
|
|
163
181
|
for (const [subRefName, subReference] of Object.entries(reference.deepReferences)) {
|
|
164
182
|
let newElem;
|
|
165
|
-
if (
|
|
183
|
+
if (shouldUseArrayIndex) {
|
|
166
184
|
newElem = {
|
|
167
185
|
$arrayElemAt: [
|
|
168
186
|
`$${getTempName(path.slice(0, -1))}.${refName}`,
|
|
@@ -27,6 +27,7 @@ exports.traverseDocument = void 0;
|
|
|
27
27
|
const types_1 = require("@aeriajs/types");
|
|
28
28
|
const common_1 = require("@aeriajs/common");
|
|
29
29
|
const validation_1 = require("@aeriajs/validation");
|
|
30
|
+
const entrypoint_1 = require("@aeriajs/entrypoint");
|
|
30
31
|
const mongodb_1 = require("mongodb");
|
|
31
32
|
const assets_js_1 = require("../assets.js");
|
|
32
33
|
const preload_js_1 = require("./preload.js");
|
|
@@ -195,6 +196,10 @@ const moveFiles = async (value, ctx) => {
|
|
|
195
196
|
if (!('$ref' in ctx.property) || ctx.property.$ref !== 'file') {
|
|
196
197
|
return value;
|
|
197
198
|
}
|
|
199
|
+
const tempFileCollection = await (0, entrypoint_1.getCollection)('tempFile');
|
|
200
|
+
if (!tempFileCollection) {
|
|
201
|
+
throw new Error('The "tempFile" collection is absent, yet it is required to upload files.');
|
|
202
|
+
}
|
|
198
203
|
if (!isValidTempFile(value)) {
|
|
199
204
|
return types_1.Result.error(types_1.TraverseError.InvalidTempfile);
|
|
200
205
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Result, ACError, ValidationErrorCode, TraverseError } from "@aeriajs/types";
|
|
3
3
|
import { throwIfError, pipe, isReference, getValueFromPath, isObjectId, isError } from "@aeriajs/common";
|
|
4
4
|
import { makeValidationError, validateProperty, validateWholeness } from "@aeriajs/validation";
|
|
5
|
+
import { getCollection } from "@aeriajs/entrypoint";
|
|
5
6
|
import { ObjectId } from "mongodb";
|
|
6
7
|
import { getCollectionAsset } from "../assets.mjs";
|
|
7
8
|
import { preloadDescription } from "./preload.mjs";
|
|
@@ -160,6 +161,10 @@ const moveFiles = async (value, ctx) => {
|
|
|
160
161
|
if (!("$ref" in ctx.property) || ctx.property.$ref !== "file") {
|
|
161
162
|
return value;
|
|
162
163
|
}
|
|
164
|
+
const tempFileCollection = await getCollection("tempFile");
|
|
165
|
+
if (!tempFileCollection) {
|
|
166
|
+
throw new Error('The "tempFile" collection is absent, yet it is required to upload files.');
|
|
167
|
+
}
|
|
163
168
|
if (!isValidTempFile(value)) {
|
|
164
169
|
return Result.error(TraverseError.InvalidTempfile);
|
|
165
170
|
}
|
package/dist/functions/upload.js
CHANGED
|
@@ -25,7 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.upload = void 0;
|
|
27
27
|
const types_1 = require("@aeriajs/types");
|
|
28
|
-
const entrypoint_1 = require("@aeriajs/entrypoint");
|
|
29
28
|
const validation_1 = require("@aeriajs/validation");
|
|
30
29
|
const path = __importStar(require("path"));
|
|
31
30
|
const fs_1 = require("fs");
|
|
@@ -60,10 +59,6 @@ const streamToFs = (metadata, context) => {
|
|
|
60
59
|
});
|
|
61
60
|
};
|
|
62
61
|
const upload = async (_props, context) => {
|
|
63
|
-
const tempFileCollection = await (0, entrypoint_1.getCollection)('tempFile');
|
|
64
|
-
if (!tempFileCollection) {
|
|
65
|
-
throw new Error('The "tempFile" collection is absent, yet it is required to upload files.');
|
|
66
|
-
}
|
|
67
62
|
const { error: headersError } = (0, validation_1.validate)(context.request.headers, {
|
|
68
63
|
type: 'object',
|
|
69
64
|
additionalProperties: true,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { Result, ACError, HTTPStatus } from "@aeriajs/types";
|
|
3
|
-
import { getCollection } from "@aeriajs/entrypoint";
|
|
4
3
|
import { validate, validator } from "@aeriajs/validation";
|
|
5
4
|
import * as path from "path";
|
|
6
5
|
import { createWriteStream } from "fs";
|
|
@@ -29,10 +28,6 @@ const streamToFs = (metadata, context) => {
|
|
|
29
28
|
});
|
|
30
29
|
};
|
|
31
30
|
export const upload = async (_props, context) => {
|
|
32
|
-
const tempFileCollection = await getCollection("tempFile");
|
|
33
|
-
if (!tempFileCollection) {
|
|
34
|
-
throw new Error('The "tempFile" collection is absent, yet it is required to upload files.');
|
|
35
|
-
}
|
|
36
31
|
const { error: headersError } = validate(context.request.headers, {
|
|
37
32
|
type: "object",
|
|
38
33
|
additionalProperties: true,
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from './database.js';
|
|
|
6
6
|
export * from './functions/index.js';
|
|
7
7
|
export * from './endpoints.js';
|
|
8
8
|
export * from './token.js';
|
|
9
|
-
export * from './use.js';
|
|
10
9
|
export * from './functions/index.js';
|
|
11
10
|
export * as functions from './functions/index.js';
|
|
12
11
|
export { ObjectId, } from 'mongodb';
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,6 @@ __exportStar(require("./database.js"), exports);
|
|
|
35
35
|
__exportStar(require("./functions/index.js"), exports);
|
|
36
36
|
__exportStar(require("./endpoints.js"), exports);
|
|
37
37
|
__exportStar(require("./token.js"), exports);
|
|
38
|
-
__exportStar(require("./use.js"), exports);
|
|
39
38
|
__exportStar(require("./functions/index.js"), exports);
|
|
40
39
|
exports.functions = __importStar(require("./functions/index.js"));
|
|
41
40
|
var mongodb_1 = require("mongodb");
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,6 @@ export * from "./database.mjs";
|
|
|
7
7
|
export * from "./functions/index.mjs";
|
|
8
8
|
export * from "./endpoints.mjs";
|
|
9
9
|
export * from "./token.mjs";
|
|
10
|
-
export * from "./use.mjs";
|
|
11
10
|
export * from "./functions/index.mjs";
|
|
12
11
|
export * as functions from "./functions/index.mjs";
|
|
13
12
|
export {
|
package/dist/token.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { SignOptions } from 'jsonwebtoken';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const signToken: (_payload: Record<string, unknown>, secret?: string | null, options?: SignOptions) => Promise<string>;
|
|
4
|
-
export declare const verifyToken: <TToken>(token: string, secret?: string) => Promise<TToken>;
|
|
2
|
+
export declare const signToken: ({ iat, exp, ...payload }: Record<string, unknown>, secret?: string | null, options?: SignOptions) => Promise<string>;
|
|
5
3
|
export declare const decodeToken: <TToken>(token: string, secret?: string) => Promise<TToken>;
|
package/dist/token.js
CHANGED
|
@@ -3,32 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.decodeToken = exports.
|
|
6
|
+
exports.decodeToken = exports.signToken = void 0;
|
|
7
7
|
const entrypoint_1 = require("@aeriajs/entrypoint");
|
|
8
8
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
9
|
-
|
|
10
|
-
const getApplicationSecret = async () => {
|
|
9
|
+
const getTokenConfig = async () => {
|
|
11
10
|
const config = await (0, entrypoint_1.getConfig)();
|
|
12
11
|
if (!config.secret) {
|
|
13
12
|
throw new Error('application secret is not set');
|
|
14
13
|
}
|
|
15
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
name: config.name,
|
|
16
|
+
secret: config.secret,
|
|
17
|
+
tokenExpiration: config.security.tokenExpiration,
|
|
18
|
+
};
|
|
16
19
|
};
|
|
17
|
-
const signToken = async (
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const signToken = async ({ iat, exp, ...payload }, secret, options) => {
|
|
21
|
+
const tokenConfig = await getTokenConfig();
|
|
22
|
+
if (tokenConfig.name) {
|
|
23
|
+
payload.aud = tokenConfig.name;
|
|
24
|
+
}
|
|
25
|
+
return jsonwebtoken_1.default.sign(payload, secret || tokenConfig.secret, options || {
|
|
26
|
+
expiresIn: tokenConfig.tokenExpiration,
|
|
23
27
|
});
|
|
24
|
-
return signed;
|
|
25
28
|
};
|
|
26
29
|
exports.signToken = signToken;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.verifyToken = verifyToken;
|
|
31
|
-
const decodeToken = (token, secret) => {
|
|
32
|
-
return (0, exports.verifyToken)(token, secret);
|
|
30
|
+
const decodeToken = async (token, secret) => {
|
|
31
|
+
const tokenConfig = await getTokenConfig();
|
|
32
|
+
return jsonwebtoken_1.default.verify(token, secret || tokenConfig.secret);
|
|
33
33
|
};
|
|
34
34
|
exports.decodeToken = decodeToken;
|
package/dist/token.mjs
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { getConfig } from "@aeriajs/entrypoint";
|
|
3
3
|
import jwt from "jsonwebtoken";
|
|
4
|
-
|
|
5
|
-
const getApplicationSecret = async () => {
|
|
4
|
+
const getTokenConfig = async () => {
|
|
6
5
|
const config = await getConfig();
|
|
7
6
|
if (!config.secret) {
|
|
8
7
|
throw new Error("application secret is not set");
|
|
9
8
|
}
|
|
10
|
-
return
|
|
9
|
+
return {
|
|
10
|
+
name: config.name,
|
|
11
|
+
secret: config.secret,
|
|
12
|
+
tokenExpiration: config.security.tokenExpiration
|
|
13
|
+
};
|
|
11
14
|
};
|
|
12
|
-
export const signToken = async (
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
export const signToken = async ({ iat, exp, ...payload }, secret, options) => {
|
|
16
|
+
const tokenConfig = await getTokenConfig();
|
|
17
|
+
if (tokenConfig.name) {
|
|
18
|
+
payload.aud = tokenConfig.name;
|
|
19
|
+
}
|
|
20
|
+
return jwt.sign(payload, secret || tokenConfig.secret, options || {
|
|
21
|
+
expiresIn: tokenConfig.tokenExpiration
|
|
18
22
|
});
|
|
19
|
-
return signed;
|
|
20
|
-
};
|
|
21
|
-
export const verifyToken = async (token, secret) => {
|
|
22
|
-
return jwt.verify(token, secret || await getApplicationSecret());
|
|
23
23
|
};
|
|
24
|
-
export const decodeToken = (token, secret) => {
|
|
25
|
-
|
|
24
|
+
export const decodeToken = async (token, secret) => {
|
|
25
|
+
const tokenConfig = await getTokenConfig();
|
|
26
|
+
return jwt.verify(token, secret || tokenConfig.secret);
|
|
26
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.175",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"aeriaMain": "tests/fixtures/aeriaMain.js",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"mongodb-memory-server": "^9.2.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@aeriajs/builtins": "^0.0.
|
|
45
|
+
"@aeriajs/builtins": "^0.0.175",
|
|
46
46
|
"@aeriajs/common": "^0.0.105",
|
|
47
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
48
|
-
"@aeriajs/http": "^0.0.
|
|
49
|
-
"@aeriajs/security": "^0.0.
|
|
47
|
+
"@aeriajs/entrypoint": "^0.0.108",
|
|
48
|
+
"@aeriajs/http": "^0.0.119",
|
|
49
|
+
"@aeriajs/security": "^0.0.175",
|
|
50
50
|
"@aeriajs/types": "^0.0.88",
|
|
51
51
|
"@aeriajs/validation": "^0.0.108"
|
|
52
52
|
},
|
package/dist/use.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createAeria: () => Promise<import("@aeriajs/types").RouteContext>;
|
package/dist/use.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAeria = void 0;
|
|
4
|
-
const entrypoint_1 = require("@aeriajs/entrypoint");
|
|
5
|
-
const context_js_1 = require("./context.js");
|
|
6
|
-
const database_js_1 = require("./database.js");
|
|
7
|
-
const createAeria = async () => {
|
|
8
|
-
await (0, database_js_1.getDatabase)();
|
|
9
|
-
const context = await (0, context_js_1.createContext)({
|
|
10
|
-
config: await (0, entrypoint_1.getConfig)(),
|
|
11
|
-
token: {
|
|
12
|
-
authenticated: false,
|
|
13
|
-
sub: null,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
return context;
|
|
17
|
-
};
|
|
18
|
-
exports.createAeria = createAeria;
|
package/dist/use.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { getConfig } from "@aeriajs/entrypoint";
|
|
3
|
-
import { createContext } from "./context.mjs";
|
|
4
|
-
import { getDatabase } from "./database.mjs";
|
|
5
|
-
export const createAeria = async () => {
|
|
6
|
-
await getDatabase();
|
|
7
|
-
const context = await createContext({
|
|
8
|
-
config: await getConfig(),
|
|
9
|
-
token: {
|
|
10
|
-
authenticated: false,
|
|
11
|
-
sub: null
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
return context;
|
|
15
|
-
};
|