@collctiv/l2s-models 1.0.86 → 1.0.87

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.
@@ -0,0 +1,12 @@
1
+ import type { ICreatable, IDataEntity } from "../global/interfaces.js";
2
+ export declare class Token implements IDataEntity, ICreatable {
3
+ id: string;
4
+ create_date: Date;
5
+ value: string;
6
+ redeemed: boolean;
7
+ user_id: string;
8
+ expiry_date: Date;
9
+ constructor(args?: Partial<Token>);
10
+ isValid(): boolean;
11
+ }
12
+ //# sourceMappingURL=token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../entities/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAIvE,qBACa,KAAM,YAAW,WAAW,EAAE,UAAU;IAE1C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,IAAI,CAAc;IAC/B,KAAK,EAAE,MAAM,CAAY;IACzB,QAAQ,EAAE,OAAO,CAAS;IAG1B,OAAO,EAAE,MAAM,CAAC;IAEhB,WAAW,EAAE,IAAI,CAAC;gBAEN,IAAI,GAAE,OAAO,CAAC,KAAK,CAAM;IAIrC,OAAO,IAAI,OAAO;CAI5B"}
@@ -0,0 +1,35 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { ObjectId, Collection } from "../global/decorators.js";
11
+ import { uuidv7 } from "uuidv7";
12
+ let Token = class Token {
13
+ id;
14
+ create_date = new Date();
15
+ value = uuidv7();
16
+ redeemed = false;
17
+ user_id;
18
+ expiry_date;
19
+ constructor(args = {}) {
20
+ Object.assign(this, args);
21
+ }
22
+ isValid() {
23
+ return this.redeemed === false
24
+ && (!this.expiry_date || this.expiry_date > new Date());
25
+ }
26
+ };
27
+ __decorate([
28
+ ObjectId(),
29
+ __metadata("design:type", String)
30
+ ], Token.prototype, "user_id", void 0);
31
+ Token = __decorate([
32
+ Collection("tokens"),
33
+ __metadata("design:paramtypes", [Object])
34
+ ], Token);
35
+ export { Token };
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from "./entities/payment.js";
11
11
  export * from "./entities/paymentRequest.js";
12
12
  export * from "./entities/pot.js";
13
13
  export * from "./entities/settings.js";
14
+ export * from "./entities/token.js";
14
15
  export * from "./entities/user.js";
15
16
  export * from "./events/notifications.js";
16
17
  export * from "./global/balance.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ export * from "./entities/payment.js";
11
11
  export * from "./entities/paymentRequest.js";
12
12
  export * from "./entities/pot.js";
13
13
  export * from "./entities/settings.js";
14
+ export * from "./entities/token.js";
14
15
  export * from "./entities/user.js";
15
16
  export * from "./events/notifications.js";
16
17
  export * from "./global/balance.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collctiv/l2s-models",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "L2S models, interfaces, types and enums",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -18,7 +18,9 @@
18
18
  },
19
19
  "homepage": "https://github.com/Collctiv/l2s-models#readme",
20
20
  "dependencies": {
21
- "reflect-metadata": "^0.2.2"
21
+ "date-fns": "^4.4.0",
22
+ "reflect-metadata": "^0.2.2",
23
+ "uuidv7": "^1.2.1"
22
24
  },
23
25
  "devDependencies": {
24
26
  "@types/node": "^25.6.0",