easywork-common-lib 1.0.180 → 1.0.182

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/.gitattributes CHANGED
@@ -1,2 +1,2 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -1,13 +1,13 @@
1
- {
2
- "autoBarrel.language.defaultLanguage": "TypeScript",
3
- "autoBarrel.files.disableRecursiveBarrelling": false,
4
- "autoBarrel.files.includeExtensionOnExport": ["ts", "tsx", "vue"],
5
- "autoBarrel.files.ignoreFilePathPatternOnExport": ["**/*.spec.*", "**/*.test.*"],
6
- "autoBarrel.files.keepExtensionOnExport": false,
7
- "autoBarrel.files.detectExportsInFiles": false,
8
- "autoBarrel.files.exportDefaultFilename": "filename",
9
- "autoBarrel.formatting.excludeSemiColonAtEndOfLine": false,
10
- "autoBarrel.formatting.useSingleQuotes": true,
11
- "autoBarrel.formatting.endOfLine": "lf",
12
- "autoBarrel.formatting.insertFinalNewline": true,
1
+ {
2
+ "autoBarrel.language.defaultLanguage": "TypeScript",
3
+ "autoBarrel.files.disableRecursiveBarrelling": false,
4
+ "autoBarrel.files.includeExtensionOnExport": ["ts", "tsx", "vue"],
5
+ "autoBarrel.files.ignoreFilePathPatternOnExport": ["**/*.spec.*", "**/*.test.*"],
6
+ "autoBarrel.files.keepExtensionOnExport": false,
7
+ "autoBarrel.files.detectExportsInFiles": false,
8
+ "autoBarrel.files.exportDefaultFilename": "filename",
9
+ "autoBarrel.formatting.excludeSemiColonAtEndOfLine": false,
10
+ "autoBarrel.formatting.useSingleQuotes": true,
11
+ "autoBarrel.formatting.endOfLine": "lf",
12
+ "autoBarrel.formatting.insertFinalNewline": true,
13
13
  }
@@ -0,0 +1,6 @@
1
+ import { User } from "../user.entity";
2
+ import { BaseEntitySimple } from "../../common";
3
+ export declare class PushToken extends BaseEntitySimple {
4
+ token: string;
5
+ user?: User;
6
+ }
@@ -0,0 +1,36 @@
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
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PushToken = void 0;
13
+ const user_entity_1 = require("../user.entity");
14
+ const common_1 = require("../../common");
15
+ const typeorm_1 = require("typeorm");
16
+ let PushToken = class PushToken extends common_1.BaseEntitySimple {
17
+ token;
18
+ user;
19
+ };
20
+ exports.PushToken = PushToken;
21
+ __decorate([
22
+ (0, typeorm_1.Column)({ type: "text" }),
23
+ __metadata("design:type", String)
24
+ ], PushToken.prototype, "token", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, {
27
+ onDelete: "SET NULL",
28
+ onUpdate: "CASCADE",
29
+ nullable: true,
30
+ }),
31
+ __metadata("design:type", user_entity_1.User)
32
+ ], PushToken.prototype, "user", void 0);
33
+ exports.PushToken = PushToken = __decorate([
34
+ (0, typeorm_1.Entity)()
35
+ ], PushToken);
36
+ //# sourceMappingURL=push-token.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-token.entity.js","sourceRoot":"","sources":["../../../src/entities/notifications/push-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAsC;AACtC,yCAAgD;AAChD,qCAAoD;AAG7C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,yBAAgB;IAE3C,KAAK,CAAS;IAQd,IAAI,CAAQ;CACf,CAAA;AAXY,8BAAS;AAElB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACX;AAQd;IALC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE;QACnB,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,IAAI;KACjB,CAAC;8BACK,kBAAI;uCAAC;oBAVH,SAAS;IADrB,IAAA,gBAAM,GAAE;GACI,SAAS,CAWrB"}
@@ -2,6 +2,7 @@ import { BaseEntity } from "../common/database";
2
2
  import { Profile } from "./profile.entity";
3
3
  import { Role } from "./role.entity";
4
4
  import { Tag } from "./tag.entity";
5
+ import { PushToken } from "./notifications/push-token.entity";
5
6
  export declare class User extends BaseEntity {
6
7
  username: string;
7
8
  email: string;
@@ -16,5 +17,6 @@ export declare class User extends BaseEntity {
16
17
  profile: Profile;
17
18
  roles?: Role[];
18
19
  tags: Tag[];
20
+ pushTokens: PushToken[];
19
21
  get name(): string;
20
22
  }
@@ -16,6 +16,7 @@ const class_transformer_1 = require("class-transformer");
16
16
  const profile_entity_1 = require("./profile.entity");
17
17
  const role_entity_1 = require("./role.entity");
18
18
  const tag_entity_1 = require("./tag.entity");
19
+ const push_token_entity_1 = require("./notifications/push-token.entity");
19
20
  let User = class User extends database_1.BaseEntity {
20
21
  username;
21
22
  email;
@@ -30,6 +31,7 @@ let User = class User extends database_1.BaseEntity {
30
31
  profile;
31
32
  roles;
32
33
  tags;
34
+ pushTokens;
33
35
  get name() {
34
36
  return `${this.profile?.firstName ?? ''} ${this.profile?.lastName ?? ''}`.trim();
35
37
  }
@@ -98,6 +100,10 @@ __decorate([
98
100
  (0, typeorm_1.OneToMany)(() => tag_entity_1.Tag, (tag) => tag.user),
99
101
  __metadata("design:type", Array)
100
102
  ], User.prototype, "tags", void 0);
103
+ __decorate([
104
+ (0, typeorm_1.OneToMany)(() => push_token_entity_1.PushToken, (pushToken) => pushToken.user),
105
+ __metadata("design:type", Array)
106
+ ], User.prototype, "pushTokens", void 0);
101
107
  exports.User = User = __decorate([
102
108
  (0, typeorm_1.Entity)()
103
109
  ], User);
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAgD;AAChD,qCAAiG;AACjG,yDAA4C;AAC5C,qDAA2C;AAC3C,+CAAqC;AACrC,6CAAmC;AAG5B,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qBAAU;IAElC,QAAQ,CAAU;IAGlB,KAAK,CAAU;IAGf,GAAG,CAAU;IAGb,MAAM,CAAU;IAIhB,IAAI,CAAU;IAId,eAAe,CAAU;IAGzB,kBAAkB,CAAW;IAG7B,KAAK,CAAU;IAGf,UAAU,CAAW;IAGrB,SAAS,CAAQ;IAQjB,OAAO,CAAU;IAOjB,KAAK,CAAU;IAIf,IAAI,CAAO;IAEX,IAAI,IAAI;QACN,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IACnF,CAAC;CACF,CAAA;AAvDY,oBAAI;AAEf;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;sCACP;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;mCACV;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iCACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCACT;AAIhB;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kCACX;A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IAAI,EAAE,CAAC;8BAClC,IAAI;uCAAC;AAQjB;IANC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,wBAAO,EAAE;QACvB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,IAAI;KACZ,CAAC;IACD,IAAA,oBAAU,GAAE;8BACJ,wBAAO;qCAAC;AAOjB;IALC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE;QACtB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,mBAAS,GAAE;;mCACG;AAIf;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gBAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;;kCAC7B;AAIX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6BAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC;;wCACnC;eAtDZ,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CA2DhB"}
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
- {
2
- "name": "easywork-common-lib",
3
- "version": "1.0.180",
4
- "description": "Librería común de Easywork",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "build": "tsc",
8
- "bump": "./scripts/bump.sh"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/criptopreto/easywork-common-lib.git"
13
- },
14
- "keywords": [
15
- "nodejs"
16
- ],
17
- "author": "Rosmer Campos",
18
- "license": "MIT",
19
- "bugs": {
20
- "url": "https://github.com/criptopreto/easywork-common-lib/issues"
21
- },
22
- "homepage": "https://github.com/criptopreto/easywork-common-lib#readme",
23
- "dependencies": {
24
- "@nestjs/common": "^10.3.8",
25
- "@nestjs/typeorm": "^10.0.2",
26
- "class-transformer": "^0.5.1",
27
- "class-validator": "^0.14.1",
28
- "rxjs": "^7.8.1",
29
- "typeorm": "^0.3.20"
30
- },
31
- "devDependencies": {
32
- "@rubiin/tsconfig": "^1.1.2",
33
- "@types/node": "^20.12.12",
34
- "ts-loader": "^9.5.1",
35
- "typescript": "^5.4.5"
36
- }
37
- }
1
+ {
2
+ "name": "easywork-common-lib",
3
+ "version": "1.0.182",
4
+ "description": "Librería común de Easywork",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "bump": "./scripts/bump.sh"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/criptopreto/easywork-common-lib.git"
13
+ },
14
+ "keywords": [
15
+ "nodejs"
16
+ ],
17
+ "author": "Rosmer Campos",
18
+ "license": "MIT",
19
+ "bugs": {
20
+ "url": "https://github.com/criptopreto/easywork-common-lib/issues"
21
+ },
22
+ "homepage": "https://github.com/criptopreto/easywork-common-lib#readme",
23
+ "dependencies": {
24
+ "@nestjs/common": "^10.3.8",
25
+ "@nestjs/typeorm": "^10.0.2",
26
+ "class-transformer": "^0.5.1",
27
+ "class-validator": "^0.14.1",
28
+ "rxjs": "^7.8.1",
29
+ "typeorm": "^0.3.20"
30
+ },
31
+ "devDependencies": {
32
+ "@rubiin/tsconfig": "^1.1.2",
33
+ "@types/node": "^20.12.12",
34
+ "ts-loader": "^9.5.1",
35
+ "typescript": "^5.4.5"
36
+ }
37
+ }
package/scripts/bump.sh CHANGED
@@ -1,6 +1,6 @@
1
- git add .
2
- git commit -m "bump version"
3
- git push
4
- npm version patch
5
- yarn build
1
+ git add .
2
+ git commit -m "bump version"
3
+ git push
4
+ npm version patch
5
+ yarn build
6
6
  npm publish
package/test.bat CHANGED
@@ -1,16 +1,16 @@
1
- @echo off
2
- setlocal enabledelayedexpansion
3
-
4
- rem Define the root directory
5
- set "root=C:\Users\ROSME\Documents\GitHub\easywork-common-lib"
6
-
7
- rem Iterate through all directories and subdirectories
8
- for /f "delims=" %%d in ('dir "%root%" /ad /b /s') do (
9
- rem Check if the directory name contains node_modules
10
- echo %%d | findstr /i /c:"\node_modules" >nul
11
- echo %%d | findstr /i /c:"\.git" >nul
12
- if errorlevel 1 (
13
- rem If not, list the directory contents
14
- dir "%%d"
15
- )
1
+ @echo off
2
+ setlocal enabledelayedexpansion
3
+
4
+ rem Define the root directory
5
+ set "root=C:\Users\ROSME\Documents\GitHub\easywork-common-lib"
6
+
7
+ rem Iterate through all directories and subdirectories
8
+ for /f "delims=" %%d in ('dir "%root%" /ad /b /s') do (
9
+ rem Check if the directory name contains node_modules
10
+ echo %%d | findstr /i /c:"\node_modules" >nul
11
+ echo %%d | findstr /i /c:"\.git" >nul
12
+ if errorlevel 1 (
13
+ rem If not, list the directory contents
14
+ dir "%%d"
15
+ )
16
16
  )
@@ -1,4 +1,4 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["node_modules", "test", "dist", "**/*spec.ts", "eslint.config.js"]
4
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["node_modules", "test", "dist", "**/*spec.ts", "eslint.config.js"]
4
+ }
package/tsconfig.json CHANGED
@@ -1,26 +1,26 @@
1
- {
2
- "extends": "@rubiin/tsconfig",
3
- "compilerOptions": {
4
- "module": "commonjs",
5
- "declaration": true,
6
- "removeComments": true,
7
- "emitDecoratorMetadata": true,
8
- "experimentalDecorators": true,
9
- "allowSyntheticDefaultImports": true,
10
- "target": "ES2022",
11
- "sourceMap": true,
12
- "outDir": "./dist",
13
- "rootDir": "./src",
14
- "baseUrl": "./src",
15
- "incremental": true,
16
- "strict": true,
17
- "skipLibCheck": true,
18
- "strictNullChecks": false,
19
- "noImplicitAny": false,
20
- "strictBindCallApply": false,
21
- "forceConsistentCasingInFileNames": true,
22
- "noFallthroughCasesInSwitch": false
23
- },
24
- "include": ["test/**/*", "src/**/*", "eslint.config.js"],
25
- "typeRoots": ["./src/common/@types/typings"]
26
- }
1
+ {
2
+ "extends": "@rubiin/tsconfig",
3
+ "compilerOptions": {
4
+ "module": "commonjs",
5
+ "declaration": true,
6
+ "removeComments": true,
7
+ "emitDecoratorMetadata": true,
8
+ "experimentalDecorators": true,
9
+ "allowSyntheticDefaultImports": true,
10
+ "target": "ES2022",
11
+ "sourceMap": true,
12
+ "outDir": "./dist",
13
+ "rootDir": "./src",
14
+ "baseUrl": "./src",
15
+ "incremental": true,
16
+ "strict": true,
17
+ "skipLibCheck": true,
18
+ "strictNullChecks": false,
19
+ "noImplicitAny": false,
20
+ "strictBindCallApply": false,
21
+ "forceConsistentCasingInFileNames": true,
22
+ "noFallthroughCasesInSwitch": false
23
+ },
24
+ "include": ["test/**/*", "src/**/*", "eslint.config.js"],
25
+ "typeRoots": ["./src/common/@types/typings"]
26
+ }