@pax2pay/model-banking 0.1.628 → 0.1.630
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/.github/workflows/bump.yml +4 -5
- package/.github/workflows/ci.yml +47 -27
- package/.github/workflows/publish.yml +9 -9
- package/Client/Users/Invites.ts +10 -8
- package/User/index.ts +23 -8
- package/dist/cjs/Client/Users/Invites.d.ts +4 -4
- package/dist/cjs/Client/Users/Invites.js +2 -2
- package/dist/cjs/Client/Users/Invites.js.map +1 -1
- package/dist/cjs/User/index.d.ts +21 -8
- package/dist/cjs/User/index.js +15 -2
- package/dist/cjs/User/index.js.map +1 -1
- package/dist/mjs/Client/Users/Invites.d.ts +4 -4
- package/dist/mjs/Client/Users/Invites.js +2 -2
- package/dist/mjs/Client/Users/Invites.js.map +1 -1
- package/dist/mjs/User/index.d.ts +21 -8
- package/dist/mjs/User/index.js +15 -2
- package/dist/mjs/User/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,17 +13,16 @@ jobs:
|
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
15
|
- name: "Checkout source code"
|
|
16
|
-
uses:
|
|
16
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
17
17
|
with:
|
|
18
18
|
token: ${{ secrets.ADMIN_TOKEN }}
|
|
19
19
|
- name: "Setup Node"
|
|
20
|
-
uses:
|
|
20
|
+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
21
21
|
with:
|
|
22
|
-
node-version: 24
|
|
23
|
-
cache: 'npm'
|
|
22
|
+
node-version: 24.16
|
|
24
23
|
- name: "Version Bump"
|
|
25
24
|
id: version-bump
|
|
26
|
-
uses:
|
|
25
|
+
uses: phips28/gh-action-bump-version@215e27a882516826c59df7f09da8c67d5f375cbd # v11.1.5
|
|
27
26
|
with:
|
|
28
27
|
tag-prefix: 'release-'
|
|
29
28
|
env:
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -2,60 +2,80 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
pull_request:
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
jobs:
|
|
7
7
|
build:
|
|
8
8
|
name: Build
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
|
-
- uses: actions/checkout@
|
|
12
|
-
-
|
|
11
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
12
|
+
- name: Setup Socket Dev
|
|
13
|
+
uses: SocketDev/action@2d3f25590c6ed6ba11a9a14c064d962a3a04698f # v1.3.1
|
|
14
|
+
with:
|
|
15
|
+
mode: firewall-free
|
|
16
|
+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
13
17
|
with:
|
|
14
|
-
node-version: 24
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
node-version: 24.16
|
|
19
|
+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
20
|
+
id: node-modules-cache
|
|
17
21
|
with:
|
|
18
22
|
path: '**/node_modules'
|
|
19
|
-
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
|
20
|
-
-
|
|
23
|
+
key: node_modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/package-lock.json') }}
|
|
24
|
+
- name: Install dependencies on cache miss
|
|
25
|
+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
|
|
26
|
+
run: sfw --verbose npm ci
|
|
21
27
|
- run: npm run build
|
|
28
|
+
|
|
22
29
|
test:
|
|
23
30
|
name: Test
|
|
24
31
|
runs-on: ubuntu-latest
|
|
25
32
|
steps:
|
|
26
|
-
- uses: actions/checkout@
|
|
27
|
-
-
|
|
33
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
34
|
+
- name: Setup Socket Dev
|
|
35
|
+
uses: SocketDev/action@2d3f25590c6ed6ba11a9a14c064d962a3a04698f # v1.3.1
|
|
36
|
+
with:
|
|
37
|
+
mode: firewall-free
|
|
38
|
+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
28
39
|
with:
|
|
29
|
-
node-version: 24
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
node-version: 24.16
|
|
41
|
+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
42
|
+
id: node-modules-cache
|
|
32
43
|
with:
|
|
33
44
|
path: '**/node_modules'
|
|
34
|
-
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
|
35
|
-
-
|
|
45
|
+
key: node_modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/package-lock.json') }}
|
|
46
|
+
- name: Install dependencies on cache miss
|
|
47
|
+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
|
|
48
|
+
run: sfw --verbose npm ci
|
|
36
49
|
- run: npm run test
|
|
50
|
+
|
|
37
51
|
lint:
|
|
38
52
|
name: Lint
|
|
39
53
|
runs-on: ubuntu-latest
|
|
40
54
|
steps:
|
|
41
|
-
- uses: actions/checkout@
|
|
42
|
-
-
|
|
55
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
56
|
+
- name: Setup Socket Dev
|
|
57
|
+
uses: SocketDev/action@2d3f25590c6ed6ba11a9a14c064d962a3a04698f # v1.3.1
|
|
58
|
+
with:
|
|
59
|
+
mode: firewall-free
|
|
60
|
+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
43
61
|
with:
|
|
44
|
-
node-version: 24
|
|
45
|
-
|
|
46
|
-
|
|
62
|
+
node-version: 24.16
|
|
63
|
+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
64
|
+
id: node-modules-cache
|
|
47
65
|
with:
|
|
48
66
|
path: '**/node_modules'
|
|
49
|
-
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
|
50
|
-
-
|
|
67
|
+
key: node_modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/package-lock.json') }}
|
|
68
|
+
- name: Install dependencies on cache miss
|
|
69
|
+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
|
|
70
|
+
run: sfw --verbose npm ci
|
|
51
71
|
- run: npm run lint
|
|
72
|
+
|
|
52
73
|
audit:
|
|
53
74
|
name: Audit
|
|
54
75
|
runs-on: ubuntu-latest
|
|
55
76
|
steps:
|
|
56
|
-
- uses: actions/checkout@
|
|
57
|
-
- uses: actions/setup-node@
|
|
77
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
78
|
+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
58
79
|
with:
|
|
59
|
-
node-version: 24
|
|
60
|
-
|
|
61
|
-
- run: npm audit --omit=dev
|
|
80
|
+
node-version: 24.16
|
|
81
|
+
- run: npm audit --omit dev
|
|
@@ -11,18 +11,18 @@ jobs:
|
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
steps:
|
|
13
13
|
- name: "Checkout source code"
|
|
14
|
-
uses:
|
|
15
|
-
- name:
|
|
16
|
-
uses:
|
|
14
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
15
|
+
- name: Setup Socket Dev
|
|
16
|
+
uses: SocketDev/action@2d3f25590c6ed6ba11a9a14c064d962a3a04698f # v1.3.1
|
|
17
17
|
with:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
mode: firewall-free
|
|
19
|
+
- name: "Setup Node"
|
|
20
|
+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
21
21
|
with:
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
node-version: 24.16
|
|
23
|
+
package-manager-cache: false
|
|
24
24
|
- name: Install
|
|
25
|
-
run: npm
|
|
25
|
+
run: sfw --verbose npm ci
|
|
26
26
|
- name: Build
|
|
27
27
|
run: npm run build
|
|
28
28
|
- name: Publish
|
package/Client/Users/Invites.ts
CHANGED
|
@@ -5,16 +5,18 @@ import { User } from "../../User"
|
|
|
5
5
|
export class Invites {
|
|
6
6
|
constructor(private readonly client: http.Client) {}
|
|
7
7
|
|
|
8
|
-
async create(creatable: User.Invite.Creatable): Promise<User.Invite | gracely.Error> {
|
|
9
|
-
|
|
8
|
+
async create(creatable: User.Invite.Creatable): Promise<User.Invite.Storable | gracely.Error> {
|
|
9
|
+
// TODO: update type without token
|
|
10
|
+
return await this.client.post<User.Invite.Storable>("/user/invite", creatable)
|
|
10
11
|
}
|
|
11
|
-
async fetch(
|
|
12
|
-
return await this.client.get<User.Invite>(`/user/invite/${
|
|
12
|
+
async fetch(emailHash: string, token: string): Promise<User.Invite | gracely.Error> {
|
|
13
|
+
return await this.client.get<User.Invite>(`/user/invite/${emailHash}/${token}`)
|
|
13
14
|
}
|
|
14
|
-
async list(): Promise<User.Invite[] | gracely.Error> {
|
|
15
|
-
return
|
|
15
|
+
async list(): Promise<User.Invite.Storable[] | gracely.Error> {
|
|
16
|
+
// TODO: update return type without token
|
|
17
|
+
return await this.client.get<User.Invite.Storable[]>("/user/invite")
|
|
16
18
|
}
|
|
17
|
-
async remove(identifier: string): Promise<
|
|
18
|
-
return await this.client.delete<
|
|
19
|
+
async remove(identifier: string): Promise<gracely.Result | gracely.Error> {
|
|
20
|
+
return await this.client.delete<gracely.Result>(`/user/invite/${identifier}`)
|
|
19
21
|
}
|
|
20
22
|
}
|
package/User/index.ts
CHANGED
|
@@ -30,16 +30,31 @@ export namespace User {
|
|
|
30
30
|
}
|
|
31
31
|
export type Creatable = zod.infer<typeof Creatable.typeZod>
|
|
32
32
|
export namespace Creatable {
|
|
33
|
-
export const type = isly.object<Creatable>({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
export const type = isly.object<Creatable>({
|
|
34
|
+
invite: isly.object({ emailHash: isly.string(), token: isly.string() }),
|
|
35
|
+
password: Password.Creatable.type,
|
|
36
|
+
})
|
|
37
|
+
export const typeZod = zod.object({
|
|
38
|
+
invite: zod.object({ emailHash: zod.string(), token: zod.string() }),
|
|
39
|
+
password: Password.Creatable.typeZod,
|
|
40
|
+
})
|
|
41
41
|
}
|
|
42
|
+
export type Invite = Omit<Invite.Storable, "emailHash" | "token" | "messageId">
|
|
42
43
|
export namespace Invite {
|
|
44
|
+
export interface Storable {
|
|
45
|
+
emailHash: string
|
|
46
|
+
token: string
|
|
47
|
+
email: string
|
|
48
|
+
access: Access
|
|
49
|
+
messageId?: string
|
|
50
|
+
created: isoly.DateTime
|
|
51
|
+
expires: isoly.DateTime
|
|
52
|
+
}
|
|
53
|
+
export namespace Storable {
|
|
54
|
+
export function toModel({ emailHash, token, messageId, ...rest }: Storable): Invite {
|
|
55
|
+
return { ...rest }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
43
58
|
export type Creatable = zod.infer<typeof Creatable.typeZod>
|
|
44
59
|
export namespace Creatable {
|
|
45
60
|
export const typeZod = zod.object({ email: zod.string(), access: Access.typeZod })
|
|
@@ -4,8 +4,8 @@ import { User } from "../../User";
|
|
|
4
4
|
export declare class Invites {
|
|
5
5
|
private readonly client;
|
|
6
6
|
constructor(client: http.Client);
|
|
7
|
-
create(creatable: User.Invite.Creatable): Promise<User.Invite | gracely.Error>;
|
|
8
|
-
fetch(
|
|
9
|
-
list(): Promise<User.Invite[] | gracely.Error>;
|
|
10
|
-
remove(identifier: string): Promise<
|
|
7
|
+
create(creatable: User.Invite.Creatable): Promise<User.Invite.Storable | gracely.Error>;
|
|
8
|
+
fetch(emailHash: string, token: string): Promise<User.Invite | gracely.Error>;
|
|
9
|
+
list(): Promise<User.Invite.Storable[] | gracely.Error>;
|
|
10
|
+
remove(identifier: string): Promise<gracely.Result | gracely.Error>;
|
|
11
11
|
}
|
|
@@ -9,8 +9,8 @@ class Invites {
|
|
|
9
9
|
async create(creatable) {
|
|
10
10
|
return await this.client.post("/user/invite", creatable);
|
|
11
11
|
}
|
|
12
|
-
async fetch(
|
|
13
|
-
return await this.client.get(`/user/invite/${
|
|
12
|
+
async fetch(emailHash, token) {
|
|
13
|
+
return await this.client.get(`/user/invite/${emailHash}/${token}`);
|
|
14
14
|
}
|
|
15
15
|
async list() {
|
|
16
16
|
return await this.client.get("/user/invite");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invites.js","sourceRoot":"","sources":["../../../../Client/Users/Invites.ts"],"names":[],"mappings":";;;AAIA,MAAa,OAAO;IACU;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,SAAgC;
|
|
1
|
+
{"version":3,"file":"Invites.js","sourceRoot":"","sources":["../../../../Client/Users/Invites.ts"],"names":[],"mappings":";;;AAIA,MAAa,OAAO;IACU;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,SAAgC;QAE5C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,cAAc,EAAE,SAAS,CAAC,CAAA;IAC/E,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,SAAiB,EAAE,KAAa;QAC3C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,gBAAgB,SAAS,IAAI,KAAK,EAAE,CAAC,CAAA;IAChF,CAAC;IACD,KAAK,CAAC,IAAI;QAET,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,cAAc,CAAC,CAAA;IACrE,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC9B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAiB,gBAAgB,UAAU,EAAE,CAAC,CAAA;IAC9E,CAAC;CACD;AAjBD,0BAiBC"}
|
package/dist/cjs/User/index.d.ts
CHANGED
|
@@ -26,7 +26,10 @@ export declare namespace User {
|
|
|
26
26
|
type Creatable = zod.infer<typeof Creatable.typeZod>;
|
|
27
27
|
namespace Creatable {
|
|
28
28
|
const type: import("isly/dist/cjs/object").IslyObject<{
|
|
29
|
-
invite:
|
|
29
|
+
invite: {
|
|
30
|
+
emailHash: string;
|
|
31
|
+
token: string;
|
|
32
|
+
};
|
|
30
33
|
password: {
|
|
31
34
|
new: string;
|
|
32
35
|
repeat: string;
|
|
@@ -34,7 +37,10 @@ export declare namespace User {
|
|
|
34
37
|
};
|
|
35
38
|
}, object>;
|
|
36
39
|
const typeZod: zod.ZodObject<{
|
|
37
|
-
invite: zod.
|
|
40
|
+
invite: zod.ZodObject<{
|
|
41
|
+
emailHash: zod.ZodString;
|
|
42
|
+
token: zod.ZodString;
|
|
43
|
+
}, zod.z.core.$strip>;
|
|
38
44
|
password: zod.ZodObject<{
|
|
39
45
|
current: zod.ZodOptional<zod.ZodString>;
|
|
40
46
|
new: zod.ZodString;
|
|
@@ -42,13 +48,20 @@ export declare namespace User {
|
|
|
42
48
|
}, zod.z.core.$strip>;
|
|
43
49
|
}, zod.z.core.$strip>;
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
id: string;
|
|
47
|
-
email: string;
|
|
48
|
-
access: Access;
|
|
49
|
-
messageId?: string;
|
|
50
|
-
}
|
|
51
|
+
type Invite = Omit<Invite.Storable, "emailHash" | "token" | "messageId">;
|
|
51
52
|
namespace Invite {
|
|
53
|
+
interface Storable {
|
|
54
|
+
emailHash: string;
|
|
55
|
+
token: string;
|
|
56
|
+
email: string;
|
|
57
|
+
access: Access;
|
|
58
|
+
messageId?: string;
|
|
59
|
+
created: isoly.DateTime;
|
|
60
|
+
expires: isoly.DateTime;
|
|
61
|
+
}
|
|
62
|
+
namespace Storable {
|
|
63
|
+
function toModel({ emailHash, token, messageId, ...rest }: Storable): Invite;
|
|
64
|
+
}
|
|
52
65
|
type Creatable = zod.infer<typeof Creatable.typeZod>;
|
|
53
66
|
namespace Creatable {
|
|
54
67
|
const typeZod: zod.ZodObject<{
|
package/dist/cjs/User/index.js
CHANGED
|
@@ -27,11 +27,24 @@ var User;
|
|
|
27
27
|
User.toJWTPayloadCreatable = toJWTPayloadCreatable;
|
|
28
28
|
let Creatable;
|
|
29
29
|
(function (Creatable) {
|
|
30
|
-
Creatable.type = isly_1.isly.object({
|
|
31
|
-
|
|
30
|
+
Creatable.type = isly_1.isly.object({
|
|
31
|
+
invite: isly_1.isly.object({ emailHash: isly_1.isly.string(), token: isly_1.isly.string() }),
|
|
32
|
+
password: User.Password.Creatable.type,
|
|
33
|
+
});
|
|
34
|
+
Creatable.typeZod = zod_1.zod.object({
|
|
35
|
+
invite: zod_1.zod.object({ emailHash: zod_1.zod.string(), token: zod_1.zod.string() }),
|
|
36
|
+
password: User.Password.Creatable.typeZod,
|
|
37
|
+
});
|
|
32
38
|
})(Creatable = User.Creatable || (User.Creatable = {}));
|
|
33
39
|
let Invite;
|
|
34
40
|
(function (Invite) {
|
|
41
|
+
let Storable;
|
|
42
|
+
(function (Storable) {
|
|
43
|
+
function toModel({ emailHash, token, messageId, ...rest }) {
|
|
44
|
+
return { ...rest };
|
|
45
|
+
}
|
|
46
|
+
Storable.toModel = toModel;
|
|
47
|
+
})(Storable = Invite.Storable || (Invite.Storable = {}));
|
|
35
48
|
let Creatable;
|
|
36
49
|
(function (Creatable) {
|
|
37
50
|
Creatable.typeZod = zod_1.zod.object({ email: zod_1.zod.string(), access: User.Access.typeZod });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../User/index.ts"],"names":[],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;QAC1F,CAAC,EAHgB,SAAS,GAAT,gBAAS,KAAT,gBAAS,QAGzB;IACF,CAAC,EApBgB,MAAM,GAAN,WAAM,KAAN,WAAM,QAoBtB;AACF,CAAC,EA9CgB,IAAI,oBAAJ,IAAI,QA8CpB"}
|
|
@@ -4,8 +4,8 @@ import { User } from "../../User";
|
|
|
4
4
|
export declare class Invites {
|
|
5
5
|
private readonly client;
|
|
6
6
|
constructor(client: http.Client);
|
|
7
|
-
create(creatable: User.Invite.Creatable): Promise<User.Invite | gracely.Error>;
|
|
8
|
-
fetch(
|
|
9
|
-
list(): Promise<User.Invite[] | gracely.Error>;
|
|
10
|
-
remove(identifier: string): Promise<
|
|
7
|
+
create(creatable: User.Invite.Creatable): Promise<User.Invite.Storable | gracely.Error>;
|
|
8
|
+
fetch(emailHash: string, token: string): Promise<User.Invite | gracely.Error>;
|
|
9
|
+
list(): Promise<User.Invite.Storable[] | gracely.Error>;
|
|
10
|
+
remove(identifier: string): Promise<gracely.Result | gracely.Error>;
|
|
11
11
|
}
|
|
@@ -6,8 +6,8 @@ export class Invites {
|
|
|
6
6
|
async create(creatable) {
|
|
7
7
|
return await this.client.post("/user/invite", creatable);
|
|
8
8
|
}
|
|
9
|
-
async fetch(
|
|
10
|
-
return await this.client.get(`/user/invite/${
|
|
9
|
+
async fetch(emailHash, token) {
|
|
10
|
+
return await this.client.get(`/user/invite/${emailHash}/${token}`);
|
|
11
11
|
}
|
|
12
12
|
async list() {
|
|
13
13
|
return await this.client.get("/user/invite");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invites.js","sourceRoot":"","sources":["../../../../Client/Users/Invites.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,OAAO;IACU;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,SAAgC;
|
|
1
|
+
{"version":3,"file":"Invites.js","sourceRoot":"","sources":["../../../../Client/Users/Invites.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,OAAO;IACU;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,SAAgC;QAE5C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,cAAc,EAAE,SAAS,CAAC,CAAA;IAC/E,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,SAAiB,EAAE,KAAa;QAC3C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,gBAAgB,SAAS,IAAI,KAAK,EAAE,CAAC,CAAA;IAChF,CAAC;IACD,KAAK,CAAC,IAAI;QAET,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,cAAc,CAAC,CAAA;IACrE,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC9B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAiB,gBAAgB,UAAU,EAAE,CAAC,CAAA;IAC9E,CAAC;CACD"}
|
package/dist/mjs/User/index.d.ts
CHANGED
|
@@ -26,7 +26,10 @@ export declare namespace User {
|
|
|
26
26
|
type Creatable = zod.infer<typeof Creatable.typeZod>;
|
|
27
27
|
namespace Creatable {
|
|
28
28
|
const type: import("isly/dist/cjs/object").IslyObject<{
|
|
29
|
-
invite:
|
|
29
|
+
invite: {
|
|
30
|
+
emailHash: string;
|
|
31
|
+
token: string;
|
|
32
|
+
};
|
|
30
33
|
password: {
|
|
31
34
|
new: string;
|
|
32
35
|
repeat: string;
|
|
@@ -34,7 +37,10 @@ export declare namespace User {
|
|
|
34
37
|
};
|
|
35
38
|
}, object>;
|
|
36
39
|
const typeZod: zod.ZodObject<{
|
|
37
|
-
invite: zod.
|
|
40
|
+
invite: zod.ZodObject<{
|
|
41
|
+
emailHash: zod.ZodString;
|
|
42
|
+
token: zod.ZodString;
|
|
43
|
+
}, zod.z.core.$strip>;
|
|
38
44
|
password: zod.ZodObject<{
|
|
39
45
|
current: zod.ZodOptional<zod.ZodString>;
|
|
40
46
|
new: zod.ZodString;
|
|
@@ -42,13 +48,20 @@ export declare namespace User {
|
|
|
42
48
|
}, zod.z.core.$strip>;
|
|
43
49
|
}, zod.z.core.$strip>;
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
id: string;
|
|
47
|
-
email: string;
|
|
48
|
-
access: Access;
|
|
49
|
-
messageId?: string;
|
|
50
|
-
}
|
|
51
|
+
type Invite = Omit<Invite.Storable, "emailHash" | "token" | "messageId">;
|
|
51
52
|
namespace Invite {
|
|
53
|
+
interface Storable {
|
|
54
|
+
emailHash: string;
|
|
55
|
+
token: string;
|
|
56
|
+
email: string;
|
|
57
|
+
access: Access;
|
|
58
|
+
messageId?: string;
|
|
59
|
+
created: isoly.DateTime;
|
|
60
|
+
expires: isoly.DateTime;
|
|
61
|
+
}
|
|
62
|
+
namespace Storable {
|
|
63
|
+
function toModel({ emailHash, token, messageId, ...rest }: Storable): Invite;
|
|
64
|
+
}
|
|
52
65
|
type Creatable = zod.infer<typeof Creatable.typeZod>;
|
|
53
66
|
namespace Creatable {
|
|
54
67
|
const typeZod: zod.ZodObject<{
|
package/dist/mjs/User/index.js
CHANGED
|
@@ -24,11 +24,24 @@ export var User;
|
|
|
24
24
|
User.toJWTPayloadCreatable = toJWTPayloadCreatable;
|
|
25
25
|
let Creatable;
|
|
26
26
|
(function (Creatable) {
|
|
27
|
-
Creatable.type = isly.object({
|
|
28
|
-
|
|
27
|
+
Creatable.type = isly.object({
|
|
28
|
+
invite: isly.object({ emailHash: isly.string(), token: isly.string() }),
|
|
29
|
+
password: User.Password.Creatable.type,
|
|
30
|
+
});
|
|
31
|
+
Creatable.typeZod = zod.object({
|
|
32
|
+
invite: zod.object({ emailHash: zod.string(), token: zod.string() }),
|
|
33
|
+
password: User.Password.Creatable.typeZod,
|
|
34
|
+
});
|
|
29
35
|
})(Creatable = User.Creatable || (User.Creatable = {}));
|
|
30
36
|
let Invite;
|
|
31
37
|
(function (Invite) {
|
|
38
|
+
let Storable;
|
|
39
|
+
(function (Storable) {
|
|
40
|
+
function toModel({ emailHash, token, messageId, ...rest }) {
|
|
41
|
+
return { ...rest };
|
|
42
|
+
}
|
|
43
|
+
Storable.toModel = toModel;
|
|
44
|
+
})(Storable = Invite.Storable || (Invite.Storable = {}));
|
|
32
45
|
let Creatable;
|
|
33
46
|
(function (Creatable) {
|
|
34
47
|
Creatable.typeZod = zod.object({ email: zod.string(), access: User.Access.typeZod });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../User/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA;AASrD,MAAM,KAAW,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../User/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,M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