@aeriajs/types 0.0.20 → 0.0.22

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.
@@ -1,28 +1,26 @@
1
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
13
- }
14
- export var ACErrors;
15
- (function(ACErrors) {
16
- ACErrors["AssetNotFound"] = "ASSET_NOT_FOUND";
17
- ACErrors["AuthenticationError"] = "AUTHENTICATION_ERROR";
18
- ACErrors["AuthorizationError"] = "AUTHORIZATION_ERROR";
19
- ACErrors["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
20
- ACErrors["ImmutabilityIncorrectChild"] = "IMMUTABILITY_INCORRECT_CHILD";
21
- ACErrors["ImmutabilityParentNotFound"] = "IMMUTABILITY_PARENT_NOT_FOUND";
22
- ACErrors["ImmutabilityTargetImmutable"] = "IMMUTABILITY_TARGET_IMMUTABLE";
23
- ACErrors["InvalidLimit"] = "INVALID_LIMIT";
24
- ACErrors["OwnershipError"] = "OWNERSHIP_ERROR";
25
- ACErrors["ResourceNotFound"] = "RESOURCE_NOT_FOUND";
26
- })(ACErrors || (ACErrors = {}));
27
- var _obj;
28
- export var ACErrorMessages = (_obj = {}, _define_property(_obj, "ASSET_NOT_FOUND", "collection has no registered functions"), _define_property(_obj, "AUTHENTICATION_ERROR", "you have insufficient privileges"), _define_property(_obj, "AUTHORIZATION_ERROR", "you have insufficient privileges"), _define_property(_obj, "FUNCTION_NOT_FOUND", "function not found"), _define_property(_obj, "IMMUTABILITY_INCORRECT_CHILD", "specified limit is invalid"), _define_property(_obj, "IMMUTABILITY_PARENT_NOT_FOUND", "specified limit is invalid"), _define_property(_obj, "IMMUTABILITY_TARGET_IMMUTABLE", "specified limit is invalid"), _define_property(_obj, "INVALID_LIMIT", "specified limit is invalid"), _define_property(_obj, "OWNERSHIP_ERROR", "you have insufficient privileges"), _define_property(_obj, "RESOURCE_NOT_FOUND", "collection not found"), _obj);
1
+ "use strict";
2
+ export var ACErrors = /* @__PURE__ */ ((ACErrors2) => {
3
+ ACErrors2["AssetNotFound"] = "ASSET_NOT_FOUND";
4
+ ACErrors2["AuthenticationError"] = "AUTHENTICATION_ERROR";
5
+ ACErrors2["AuthorizationError"] = "AUTHORIZATION_ERROR";
6
+ ACErrors2["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
7
+ ACErrors2["ImmutabilityIncorrectChild"] = "IMMUTABILITY_INCORRECT_CHILD";
8
+ ACErrors2["ImmutabilityParentNotFound"] = "IMMUTABILITY_PARENT_NOT_FOUND";
9
+ ACErrors2["ImmutabilityTargetImmutable"] = "IMMUTABILITY_TARGET_IMMUTABLE";
10
+ ACErrors2["InvalidLimit"] = "INVALID_LIMIT";
11
+ ACErrors2["OwnershipError"] = "OWNERSHIP_ERROR";
12
+ ACErrors2["ResourceNotFound"] = "RESOURCE_NOT_FOUND";
13
+ return ACErrors2;
14
+ })(ACErrors || {});
15
+ export const ACErrorMessages = {
16
+ ["ASSET_NOT_FOUND" /* AssetNotFound */]: "collection has no registered functions",
17
+ ["AUTHENTICATION_ERROR" /* AuthenticationError */]: "you have insufficient privileges",
18
+ ["AUTHORIZATION_ERROR" /* AuthorizationError */]: "you have insufficient privileges",
19
+ ["FUNCTION_NOT_FOUND" /* FunctionNotFound */]: "function not found",
20
+ ["IMMUTABILITY_INCORRECT_CHILD" /* ImmutabilityIncorrectChild */]: "specified limit is invalid",
21
+ ["IMMUTABILITY_PARENT_NOT_FOUND" /* ImmutabilityParentNotFound */]: "specified limit is invalid",
22
+ ["IMMUTABILITY_TARGET_IMMUTABLE" /* ImmutabilityTargetImmutable */]: "specified limit is invalid",
23
+ ["INVALID_LIMIT" /* InvalidLimit */]: "specified limit is invalid",
24
+ ["OWNERSHIP_ERROR" /* OwnershipError */]: "you have insufficient privileges",
25
+ ["RESOURCE_NOT_FOUND" /* ResourceNotFound */]: "collection not found"
26
+ };
package/dist/api.mjs CHANGED
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
package/dist/config.d.ts CHANGED
@@ -7,6 +7,7 @@ export type ApiConfig = {
7
7
  database?: {
8
8
  mongodbUrl?: string;
9
9
  noDatabase?: boolean;
10
+ logQueries?: boolean;
10
11
  };
11
12
  storage?: {
12
13
  fs?: string;
package/dist/config.mjs CHANGED
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
package/dist/context.mjs CHANGED
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
package/dist/contract.mjs CHANGED
@@ -1,3 +1,4 @@
1
- export var defineContract = function(contract) {
2
- return contract;
1
+ "use strict";
2
+ export const defineContract = (contract) => {
3
+ return contract;
3
4
  };
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
package/dist/either.mjs CHANGED
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
package/dist/http.mjs CHANGED
@@ -1,11 +1,12 @@
1
- export var REQUEST_METHODS = [
2
- "GET",
3
- "HEAD",
4
- "POST",
5
- "PUT",
6
- "DELETE",
7
- "OPTIONS",
8
- "PATCH",
9
- "TRACE",
10
- "SEARCH"
1
+ "use strict";
2
+ export const REQUEST_METHODS = [
3
+ "GET",
4
+ "HEAD",
5
+ "POST",
6
+ "PUT",
7
+ "DELETE",
8
+ "OPTIONS",
9
+ "PATCH",
10
+ "TRACE",
11
+ "SEARCH"
11
12
  ];
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  export * from "./accessControl.mjs";
2
3
  export * from "./api.mjs";
3
4
  export * from "./condition.mjs";
package/dist/property.mjs CHANGED
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
package/dist/schema.d.ts CHANGED
@@ -33,7 +33,7 @@ export type InferProperty<T> = T extends TestType<{
33
33
  items: infer K;
34
34
  }> ? InferProperty<K>[] : T extends TestType<{
35
35
  getter: (doc: any) => infer K;
36
- }> ? K : T extends TestType<{
36
+ }> ? Awaited<K> : T extends TestType<{
37
37
  const: infer K;
38
38
  }> ? K : never;
39
39
  export type InferSchema<TSchema> = MergeReferences<TSchema> extends infer MappedTypes ? TSchema extends {
package/dist/schema.mjs CHANGED
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
package/dist/security.mjs CHANGED
@@ -1 +1 @@
1
- export { };
1
+ "use strict";
@@ -1,6 +1,7 @@
1
- export var ValidationErrorCodes;
2
- (function(ValidationErrorCodes) {
3
- ValidationErrorCodes["InvalidProperties"] = "INVALID_PROPERTIES";
4
- ValidationErrorCodes["MissingProperties"] = "MISSING_PROPERTIES";
5
- ValidationErrorCodes["EmptyTarget"] = "EMPTY_TARGET";
6
- })(ValidationErrorCodes || (ValidationErrorCodes = {}));
1
+ "use strict";
2
+ export var ValidationErrorCodes = /* @__PURE__ */ ((ValidationErrorCodes2) => {
3
+ ValidationErrorCodes2["InvalidProperties"] = "INVALID_PROPERTIES";
4
+ ValidationErrorCodes2["MissingProperties"] = "MISSING_PROPERTIES";
5
+ ValidationErrorCodes2["EmptyTarget"] = "EMPTY_TARGET";
6
+ return ValidationErrorCodes2;
7
+ })(ValidationErrorCodes || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,7 +30,7 @@
30
30
  "lint:fix": "eslint src --fix",
31
31
  "build": "pnpm build:cjs && pnpm build:esm",
32
32
  "build:cjs": "tsc",
33
- "build:esm": "swc src/* -d dist --strip-leading-paths -C module.type=es6 --out-file-extension=mjs && pnpm build:esm-transform",
33
+ "build:esm": "esbuild './src/**/*.ts' --outdir=dist --out-extension:.js=.mjs && pnpm build:esm-transform",
34
34
  "build:esm-transform": "pnpm -w esm-transform $PWD/dist"
35
35
  }
36
36
  }