proto.io 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/adapters/file/database.d.ts +2 -2
- package/dist/adapters/file/database.js +2 -2
- package/dist/adapters/file/database.mjs +2 -2
- package/dist/adapters/file/filesystem.d.ts +2 -2
- package/dist/adapters/file/google-cloud-storage.d.ts +2 -2
- package/dist/adapters/storage/progres.d.ts +2 -2
- package/dist/adapters/storage/progres.js +3 -3
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +3 -3
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/client.mjs +3 -3
- package/dist/index.d.ts +75 -3
- package/dist/index.js +121 -261
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +123 -263
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{index-Cpv1DoEI.d.ts → index-B9CWU0y7.d.ts} +32 -2
- package/dist/internals/index-B9CWU0y7.d.ts.map +1 -0
- package/dist/internals/{index-BZNPlw1L.mjs → index-BPbXumUi.mjs} +286 -44
- package/dist/internals/index-BPbXumUi.mjs.map +1 -0
- package/dist/internals/{index-BJnQhKf3.d.ts → index-BQqYdjaH.d.ts} +2 -2
- package/dist/internals/index-BQqYdjaH.d.ts.map +1 -0
- package/dist/internals/{index-lX-M76Tn.d.ts → index-BYZpj31o.d.ts} +1062 -33
- package/dist/internals/index-BYZpj31o.d.ts.map +1 -0
- package/dist/internals/{index-BYbMU-Ao.mjs → index-CTsc042s.mjs} +140 -2
- package/dist/internals/index-CTsc042s.mjs.map +1 -0
- package/dist/internals/{index-CIecB6mS.js → index-CvA0tbwx.js} +286 -44
- package/dist/internals/index-CvA0tbwx.js.map +1 -0
- package/dist/internals/{index-B1wqSio6.mjs → index-DHQhYGsJ.mjs} +2 -2
- package/dist/internals/{index-B1wqSio6.mjs.map → index-DHQhYGsJ.mjs.map} +1 -1
- package/dist/internals/{index-CVutVPmd.js → index-DXuW8UiB.js} +139 -1
- package/dist/internals/index-DXuW8UiB.js.map +1 -0
- package/dist/internals/{index-CzfsyXvb.js → index-Dc3V_Bzw.js} +2 -2
- package/dist/internals/{index-CzfsyXvb.js.map → index-Dc3V_Bzw.js.map} +1 -1
- package/dist/internals/{random-BCpwYpyw.mjs → random-BMQpRlGH.mjs} +3 -3
- package/dist/internals/{random-BCpwYpyw.mjs.map → random-BMQpRlGH.mjs.map} +1 -1
- package/dist/internals/{random-Dytum6Nh.js → random-DVOUDDGg.js} +3 -3
- package/dist/internals/{random-Dytum6Nh.js.map → random-DVOUDDGg.js.map} +1 -1
- package/package.json +1 -1
- package/dist/internals/index-BJnQhKf3.d.ts.map +0 -1
- package/dist/internals/index-BYbMU-Ao.mjs.map +0 -1
- package/dist/internals/index-BZNPlw1L.mjs.map +0 -1
- package/dist/internals/index-CIecB6mS.js.map +0 -1
- package/dist/internals/index-CVutVPmd.js.map +0 -1
- package/dist/internals/index-Cpv1DoEI.d.ts.map +0 -1
- package/dist/internals/index-lX-M76Tn.d.ts.map +0 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as ProtoClient } from './internals/index-
|
|
2
|
-
export { c as classExtends, e as isFile, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-
|
|
1
|
+
import { P as ProtoClient } from './internals/index-B9CWU0y7.js';
|
|
2
|
+
export { c as classExtends, e as isFile, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-B9CWU0y7.js';
|
|
3
3
|
export { Decimal } from 'decimal.js';
|
|
4
|
-
export { D as DeserializeOptions, S as SerializeOptions, d as TSerializable, e as deserialize, s as serialize } from './internals/index-
|
|
4
|
+
export { D as DeserializeOptions, S as SerializeOptions, d as TSerializable, e as deserialize, s as serialize } from './internals/index-BYZpj31o.js';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'socket.io-client';
|
|
7
7
|
import '@socket.io/component-emitter';
|
package/dist/client.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./internals/index-
|
|
5
|
+
var index = require('./internals/index-CvA0tbwx.js');
|
|
6
6
|
var Decimal = require('decimal.js');
|
|
7
|
-
require('./internals/index-
|
|
7
|
+
require('./internals/index-DXuW8UiB.js');
|
|
8
8
|
require('lodash');
|
|
9
9
|
require('./internals/private-CSB1Ep4g.js');
|
|
10
10
|
require('@o2ter/utils-js');
|
package/dist/client.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as ProtoClient } from './internals/index-
|
|
2
|
-
export { e as classExtends, d as deserialize, j as isFile, f as isObject, i as isQuery, h as isRole, g as isUser, s as serialize } from './internals/index-
|
|
1
|
+
import { c as ProtoClient } from './internals/index-BPbXumUi.mjs';
|
|
2
|
+
export { e as classExtends, d as deserialize, j as isFile, f as isObject, i as isQuery, h as isRole, g as isUser, s as serialize } from './internals/index-BPbXumUi.mjs';
|
|
3
3
|
export { Decimal } from 'decimal.js';
|
|
4
|
-
import './internals/index-
|
|
4
|
+
import './internals/index-CTsc042s.mjs';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import './internals/private-BUpLAMZi.mjs';
|
|
7
7
|
import '@o2ter/utils-js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as socket_io from 'socket.io';
|
|
2
2
|
import { Router } from 'express';
|
|
3
3
|
import { Server } from '@o2ter/server-js';
|
|
4
|
-
import { T as TSchema, _ as _TValue, P as ProtoService, a as ProtoServiceOptions, b as ProtoServiceKeyOptions } from './internals/index-
|
|
5
|
-
export { D as DeserializeOptions, S as SerializeOptions, c as TFileStorage, d as TSerializable, e as deserialize, s as serialize } from './internals/index-
|
|
4
|
+
import { T as TSchema, _ as _TValue, P as ProtoService, a as ProtoServiceOptions, b as ProtoServiceKeyOptions } from './internals/index-BYZpj31o.js';
|
|
5
|
+
export { D as DeserializeOptions, S as SerializeOptions, c as TFileStorage, d as TSerializable, e as deserialize, s as serialize } from './internals/index-BYZpj31o.js';
|
|
6
6
|
import Decimal from 'decimal.js';
|
|
7
7
|
export { Decimal } from 'decimal.js';
|
|
8
|
-
export { P as ProtoClient, c as classExtends, e as isFile, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-
|
|
8
|
+
export { P as ProtoClient, c as classExtends, e as isFile, a as isObject, i as isQuery, d as isRole, b as isUser } from './internals/index-B9CWU0y7.js';
|
|
9
9
|
import '@o2ter/utils-js';
|
|
10
10
|
import 'jsonwebtoken';
|
|
11
11
|
import 'lodash';
|
|
@@ -13,57 +13,129 @@ import 'node:stream';
|
|
|
13
13
|
import 'socket.io-client';
|
|
14
14
|
import '@socket.io/component-emitter';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Schema definition utility functions.
|
|
18
|
+
*/
|
|
16
19
|
declare const schema: ((x: Record<string, TSchema>) => Record<string, TSchema>) & {
|
|
20
|
+
/**
|
|
21
|
+
* Defines a boolean schema.
|
|
22
|
+
* @param defaultValue - The default value for the boolean.
|
|
23
|
+
* @returns The boolean schema.
|
|
24
|
+
*/
|
|
17
25
|
boolean: (defaultValue?: boolean) => {
|
|
18
26
|
readonly type: "boolean";
|
|
19
27
|
readonly default: boolean | undefined;
|
|
20
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Defines a number schema.
|
|
31
|
+
* @param defaultValue - The default value for the number.
|
|
32
|
+
* @returns The number schema.
|
|
33
|
+
*/
|
|
21
34
|
number: (defaultValue?: number) => {
|
|
22
35
|
readonly type: "number";
|
|
23
36
|
readonly default: number | undefined;
|
|
24
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Defines a decimal schema.
|
|
40
|
+
* @param defaultValue - The default value for the decimal.
|
|
41
|
+
* @returns The decimal schema.
|
|
42
|
+
*/
|
|
25
43
|
decimal: (defaultValue?: Decimal) => {
|
|
26
44
|
readonly type: "decimal";
|
|
27
45
|
readonly default: Decimal | undefined;
|
|
28
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Defines a string schema.
|
|
49
|
+
* @param defaultValue - The default value for the string.
|
|
50
|
+
* @returns The string schema.
|
|
51
|
+
*/
|
|
29
52
|
string: (defaultValue?: string) => {
|
|
30
53
|
readonly type: "string";
|
|
31
54
|
readonly default: string | undefined;
|
|
32
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Defines a date schema.
|
|
58
|
+
* @param defaultValue - The default value for the date.
|
|
59
|
+
* @returns The date schema.
|
|
60
|
+
*/
|
|
33
61
|
date: (defaultValue?: Date) => {
|
|
34
62
|
readonly type: "date";
|
|
35
63
|
readonly default: Date | undefined;
|
|
36
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Defines an object schema.
|
|
67
|
+
* @param defaultValue - The default value for the object.
|
|
68
|
+
* @returns The object schema.
|
|
69
|
+
*/
|
|
37
70
|
object: <T extends Record<string, _TValue>>(defaultValue?: T) => {
|
|
38
71
|
readonly type: "object";
|
|
39
72
|
readonly default: T | undefined;
|
|
40
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Defines an array schema.
|
|
76
|
+
* @param defaultValue - The default value for the array.
|
|
77
|
+
* @returns The array schema.
|
|
78
|
+
*/
|
|
41
79
|
array: <T extends _TValue[]>(defaultValue?: T) => {
|
|
42
80
|
readonly type: "array";
|
|
43
81
|
readonly default: T | undefined;
|
|
44
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Defines a vector schema.
|
|
85
|
+
* @param dimension - The dimension of the vector.
|
|
86
|
+
* @param defaultValue - The default value for the vector.
|
|
87
|
+
* @returns The vector schema.
|
|
88
|
+
*/
|
|
45
89
|
vector: (dimension: number, defaultValue?: number[]) => {
|
|
46
90
|
readonly type: "vector";
|
|
47
91
|
readonly dimension: number;
|
|
48
92
|
readonly default: number[] | undefined;
|
|
49
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* Defines a shape schema.
|
|
96
|
+
* @param shape - The shape definition.
|
|
97
|
+
* @returns The shape schema.
|
|
98
|
+
*/
|
|
50
99
|
shape: (shape: Record<string, TSchema.DataType>) => {
|
|
51
100
|
readonly type: "shape";
|
|
52
101
|
readonly shape: Record<string, TSchema.DataType>;
|
|
53
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* Defines a pointer schema.
|
|
105
|
+
* @param target - The target of the pointer.
|
|
106
|
+
* @returns The pointer schema.
|
|
107
|
+
*/
|
|
54
108
|
pointer: (target: string) => {
|
|
55
109
|
readonly type: "pointer";
|
|
56
110
|
readonly target: string;
|
|
57
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* Defines a relation schema.
|
|
114
|
+
* @param target - The target of the relation.
|
|
115
|
+
* @param foreignField - The foreign field of the relation.
|
|
116
|
+
* @returns The relation schema.
|
|
117
|
+
*/
|
|
58
118
|
relation: (target: string, foreignField?: string) => {
|
|
59
119
|
readonly type: "relation";
|
|
60
120
|
readonly target: string;
|
|
61
121
|
readonly foreignField: string | undefined;
|
|
62
122
|
};
|
|
63
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* Creates a ProtoRoute.
|
|
126
|
+
* @param options - The options for the ProtoRoute.
|
|
127
|
+
* @returns A promise that resolves to a Router.
|
|
128
|
+
*/
|
|
64
129
|
declare const ProtoRoute: <E>(options: {
|
|
65
130
|
proto: ProtoService<E> | (ProtoServiceOptions<E> & ProtoServiceKeyOptions);
|
|
66
131
|
}) => Promise<Router>;
|
|
132
|
+
/**
|
|
133
|
+
* Registers a ProtoSocket.
|
|
134
|
+
* @param proto - The ProtoService instance.
|
|
135
|
+
* @param server - The server instance.
|
|
136
|
+
* @param endpoint - The optional endpoint.
|
|
137
|
+
* @returns The socket.io instance.
|
|
138
|
+
*/
|
|
67
139
|
declare const registerProtoSocket: <E>(proto: ProtoService<E>, server: Server, endpoint?: string) => socket_io.Server<socket_io.DefaultEventsMap, socket_io.DefaultEventsMap, socket_io.DefaultEventsMap, any> | socket_io.Namespace<socket_io.DefaultEventsMap, socket_io.DefaultEventsMap, socket_io.DefaultEventsMap, any>;
|
|
68
140
|
|
|
69
141
|
export { ProtoRoute, ProtoService, ProtoRoute as default, registerProtoSocket, schema };
|