@based/server 7.0.1 → 7.1.0-alpha
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/auth/defaultConfig.js.map +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/parseAuthState.js.map +1 -1
- package/dist/auth/parseJSONAuthState.js.map +1 -1
- package/dist/authorize.js +1 -1
- package/dist/authorize.js.map +1 -1
- package/dist/channel/cleanup.js.map +1 -1
- package/dist/channel/create.js.map +1 -1
- package/dist/channel/destroy.js.map +1 -1
- package/dist/channel/extend.js.map +1 -1
- package/dist/channel/start.js +2 -1
- package/dist/channel/start.js.map +1 -1
- package/dist/channel/subscribe.js.map +1 -1
- package/dist/channel/unsub.js.map +1 -1
- package/dist/compress.js.map +1 -1
- package/dist/error/index.d.ts +1 -13
- package/dist/error/index.js +2 -25
- package/dist/error/index.js.map +1 -1
- package/dist/functionApi/callFunction.js +2 -1
- package/dist/functionApi/callFunction.js.map +1 -1
- package/dist/functionApi/channelSubscribe.js +2 -1
- package/dist/functionApi/channelSubscribe.js.map +1 -1
- package/dist/functionApi/client/channel.js.map +1 -1
- package/dist/functionApi/client/index.js.map +1 -1
- package/dist/functionApi/client/query.js.map +1 -1
- package/dist/functionApi/get.js +2 -1
- package/dist/functionApi/get.js.map +1 -1
- package/dist/functionApi/observe.js +2 -1
- package/dist/functionApi/observe.js.map +1 -1
- package/dist/functionApi/publish.js +2 -1
- package/dist/functionApi/publish.js.map +1 -1
- package/dist/functionApi/stream.js +2 -1
- package/dist/functionApi/stream.js.map +1 -1
- package/dist/functions/genVersion.js.map +1 -1
- package/dist/functions/index.js +1 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/timeout.js.map +1 -1
- package/dist/incoming/http/function.js +1 -1
- package/dist/incoming/http/function.js.map +1 -1
- package/dist/incoming/http/handleRequest.js.map +1 -1
- package/dist/incoming/http/index.js +1 -1
- package/dist/incoming/http/index.js.map +1 -1
- package/dist/incoming/http/parseQuery.js.map +1 -1
- package/dist/incoming/http/publish.js +1 -1
- package/dist/incoming/http/publish.js.map +1 -1
- package/dist/incoming/http/query.js +1 -1
- package/dist/incoming/http/query.js.map +1 -1
- package/dist/incoming/http/readBody.js +13 -1
- package/dist/incoming/http/readBody.js.map +1 -1
- package/dist/incoming/http/streamFunction/getExtension.js.map +1 -1
- package/dist/incoming/http/streamFunction/index.js +1 -1
- package/dist/incoming/http/streamFunction/index.js.map +1 -1
- package/dist/incoming/http/streamFunction/multiPart/index.js +1 -1
- package/dist/incoming/http/streamFunction/multiPart/index.js.map +1 -1
- package/dist/incoming/http/streamFunction/multiPart/readFormData.js +1 -1
- package/dist/incoming/http/streamFunction/multiPart/readFormData.js.map +1 -1
- package/dist/incoming/http/streamFunction/stream/createStream.js +1 -1
- package/dist/incoming/http/streamFunction/stream/createStream.js.map +1 -1
- package/dist/incoming/http/streamFunction/stream/index.js +1 -1
- package/dist/incoming/http/streamFunction/stream/index.js.map +1 -1
- package/dist/incoming/index.js +1 -1
- package/dist/incoming/index.js.map +1 -1
- package/dist/incoming/upgrade.js.map +1 -1
- package/dist/incoming/ws/auth.js.map +1 -1
- package/dist/incoming/ws/channelPublish.js +1 -1
- package/dist/incoming/ws/channelPublish.js.map +1 -1
- package/dist/incoming/ws/channelSubscribe.js +1 -1
- package/dist/incoming/ws/channelSubscribe.js.map +1 -1
- package/dist/incoming/ws/function.js +1 -1
- package/dist/incoming/ws/function.js.map +1 -1
- package/dist/incoming/ws/get.js +1 -1
- package/dist/incoming/ws/get.js.map +1 -1
- package/dist/incoming/ws/index.js +2 -1
- package/dist/incoming/ws/index.js.map +1 -1
- package/dist/incoming/ws/query.js +1 -1
- package/dist/incoming/ws/query.js.map +1 -1
- package/dist/installFn.js +1 -1
- package/dist/installFn.js.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/query/cleanup.js.map +1 -1
- package/dist/query/create.js.map +1 -1
- package/dist/query/destroy.js.map +1 -1
- package/dist/query/extendCache.js.map +1 -1
- package/dist/query/genObservableId.js.map +1 -1
- package/dist/query/send.js.map +1 -1
- package/dist/query/start/error.js +2 -1
- package/dist/query/start/error.js.map +1 -1
- package/dist/query/start/index.js.map +1 -1
- package/dist/query/start/update.js.map +1 -1
- package/dist/query/subscribe.d.ts +1 -1
- package/dist/query/subscribe.js.map +1 -1
- package/dist/query/types.d.ts +1 -1
- package/dist/query/unsub.js.map +1 -1
- package/dist/security.js +1 -1
- package/dist/security.js.map +1 -1
- package/dist/sendError.d.ts +1 -1
- package/dist/sendError.js.map +1 -1
- package/dist/sendHttpResponse.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -3
- package/dist/server.js.map +1 -1
- package/dist/verifyRoute.js +2 -1
- package/dist/verifyRoute.js.map +1 -1
- package/package.json +3 -4
- package/dist/error/errorTypeHandlers.d.ts +0 -6
- package/dist/error/errorTypeHandlers.js +0 -121
- package/dist/error/errorTypeHandlers.js.map +0 -1
- package/dist/error/types.d.ts +0 -95
- package/dist/error/types.js +0 -27
- package/dist/error/types.js.map +0 -1
package/dist/error/types.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { BasedRoute } from '@based/functions';
|
|
2
|
-
export declare const EMPTY_ROUTE: BasedRoute;
|
|
3
|
-
export declare enum BasedErrorCode {
|
|
4
|
-
FunctionError = 50001,
|
|
5
|
-
AuthorizeFunctionError = 50002,
|
|
6
|
-
NoOservableCacheAvailable = 50003,
|
|
7
|
-
ObserveCallbackError = 50005,
|
|
8
|
-
FunctionNotFound = 40401,
|
|
9
|
-
FunctionIsWrongType = 40402,
|
|
10
|
-
AuthorizeRejectedError = 40301,
|
|
11
|
-
InvalidPayload = 40001,
|
|
12
|
-
PayloadTooLarge = 40002,
|
|
13
|
-
ChunkTooLarge = 40003,
|
|
14
|
-
UnsupportedContentEncoding = 40004,
|
|
15
|
-
NoBinaryProtocol = 40005,
|
|
16
|
-
LengthRequired = 41101,
|
|
17
|
-
MethodNotAllowed = 40501,
|
|
18
|
-
RateLimit = 40029,
|
|
19
|
-
MissingAuthStateProtocolHeader = 40030,
|
|
20
|
-
IncorrectAccessKey = 40031,
|
|
21
|
-
Block = 90001
|
|
22
|
-
}
|
|
23
|
-
type FunctionErrorProps = {
|
|
24
|
-
err: Error | string;
|
|
25
|
-
requestId?: number;
|
|
26
|
-
route: BasedRoute;
|
|
27
|
-
};
|
|
28
|
-
type ObservableFunctionErrorProps = {
|
|
29
|
-
observableId: number;
|
|
30
|
-
err: Error | string;
|
|
31
|
-
route: BasedRoute;
|
|
32
|
-
};
|
|
33
|
-
type ChannelFunctionErrorProps = {
|
|
34
|
-
channelId: number;
|
|
35
|
-
err: Error | string;
|
|
36
|
-
route: BasedRoute;
|
|
37
|
-
};
|
|
38
|
-
type BasedErrorPayload = {
|
|
39
|
-
observableId: number;
|
|
40
|
-
route: BasedRoute;
|
|
41
|
-
} | {
|
|
42
|
-
requestId: number;
|
|
43
|
-
route: BasedRoute;
|
|
44
|
-
} | {
|
|
45
|
-
channelId: number;
|
|
46
|
-
route: BasedRoute;
|
|
47
|
-
} | {
|
|
48
|
-
route: BasedRoute;
|
|
49
|
-
};
|
|
50
|
-
type BasedFunctionError = FunctionErrorProps | ObservableFunctionErrorProps | ChannelFunctionErrorProps;
|
|
51
|
-
export type ErrorPayload = {
|
|
52
|
-
[BasedErrorCode.FunctionNotFound]: BasedErrorPayload;
|
|
53
|
-
[BasedErrorCode.RateLimit]: {};
|
|
54
|
-
[BasedErrorCode.Block]: {};
|
|
55
|
-
[BasedErrorCode.IncorrectAccessKey]: {};
|
|
56
|
-
[BasedErrorCode.MissingAuthStateProtocolHeader]: {};
|
|
57
|
-
[BasedErrorCode.NoBinaryProtocol]: {
|
|
58
|
-
buffer: ArrayBuffer;
|
|
59
|
-
};
|
|
60
|
-
[BasedErrorCode.FunctionError]: BasedFunctionError;
|
|
61
|
-
[BasedErrorCode.AuthorizeFunctionError]: BasedFunctionError;
|
|
62
|
-
[BasedErrorCode.AuthorizeRejectedError]: BasedErrorPayload;
|
|
63
|
-
[BasedErrorCode.ObserveCallbackError]: {
|
|
64
|
-
err: Error;
|
|
65
|
-
observableId: number;
|
|
66
|
-
route: BasedRoute;
|
|
67
|
-
};
|
|
68
|
-
[BasedErrorCode.NoOservableCacheAvailable]: {
|
|
69
|
-
observableId: number;
|
|
70
|
-
route: BasedRoute;
|
|
71
|
-
};
|
|
72
|
-
[BasedErrorCode.FunctionIsWrongType]: BasedErrorPayload;
|
|
73
|
-
[BasedErrorCode.InvalidPayload]: BasedErrorPayload;
|
|
74
|
-
[BasedErrorCode.PayloadTooLarge]: BasedErrorPayload;
|
|
75
|
-
[BasedErrorCode.ChunkTooLarge]: BasedRoute;
|
|
76
|
-
[BasedErrorCode.UnsupportedContentEncoding]: BasedRoute;
|
|
77
|
-
[BasedErrorCode.LengthRequired]: BasedRoute;
|
|
78
|
-
[BasedErrorCode.MethodNotAllowed]: BasedRoute;
|
|
79
|
-
};
|
|
80
|
-
export type ErrorHandler<T extends BasedErrorCode> = {
|
|
81
|
-
statusCode: number;
|
|
82
|
-
statusMessage: string;
|
|
83
|
-
message: (payload: ErrorPayload[T]) => string;
|
|
84
|
-
};
|
|
85
|
-
export type BasedErrorData<T extends BasedErrorCode = BasedErrorCode> = {
|
|
86
|
-
route: BasedRoute;
|
|
87
|
-
message: string;
|
|
88
|
-
code: T;
|
|
89
|
-
statusCode: number;
|
|
90
|
-
statusMessage: string;
|
|
91
|
-
requestId?: number;
|
|
92
|
-
observableId?: number;
|
|
93
|
-
channelId?: number;
|
|
94
|
-
};
|
|
95
|
-
export {};
|
package/dist/error/types.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const EMPTY_ROUTE = {
|
|
2
|
-
name: 'no-route',
|
|
3
|
-
path: '',
|
|
4
|
-
type: 'function',
|
|
5
|
-
};
|
|
6
|
-
export var BasedErrorCode;
|
|
7
|
-
(function (BasedErrorCode) {
|
|
8
|
-
BasedErrorCode[BasedErrorCode["FunctionError"] = 50001] = "FunctionError";
|
|
9
|
-
BasedErrorCode[BasedErrorCode["AuthorizeFunctionError"] = 50002] = "AuthorizeFunctionError";
|
|
10
|
-
BasedErrorCode[BasedErrorCode["NoOservableCacheAvailable"] = 50003] = "NoOservableCacheAvailable";
|
|
11
|
-
BasedErrorCode[BasedErrorCode["ObserveCallbackError"] = 50005] = "ObserveCallbackError";
|
|
12
|
-
BasedErrorCode[BasedErrorCode["FunctionNotFound"] = 40401] = "FunctionNotFound";
|
|
13
|
-
BasedErrorCode[BasedErrorCode["FunctionIsWrongType"] = 40402] = "FunctionIsWrongType";
|
|
14
|
-
BasedErrorCode[BasedErrorCode["AuthorizeRejectedError"] = 40301] = "AuthorizeRejectedError";
|
|
15
|
-
BasedErrorCode[BasedErrorCode["InvalidPayload"] = 40001] = "InvalidPayload";
|
|
16
|
-
BasedErrorCode[BasedErrorCode["PayloadTooLarge"] = 40002] = "PayloadTooLarge";
|
|
17
|
-
BasedErrorCode[BasedErrorCode["ChunkTooLarge"] = 40003] = "ChunkTooLarge";
|
|
18
|
-
BasedErrorCode[BasedErrorCode["UnsupportedContentEncoding"] = 40004] = "UnsupportedContentEncoding";
|
|
19
|
-
BasedErrorCode[BasedErrorCode["NoBinaryProtocol"] = 40005] = "NoBinaryProtocol";
|
|
20
|
-
BasedErrorCode[BasedErrorCode["LengthRequired"] = 41101] = "LengthRequired";
|
|
21
|
-
BasedErrorCode[BasedErrorCode["MethodNotAllowed"] = 40501] = "MethodNotAllowed";
|
|
22
|
-
BasedErrorCode[BasedErrorCode["RateLimit"] = 40029] = "RateLimit";
|
|
23
|
-
BasedErrorCode[BasedErrorCode["MissingAuthStateProtocolHeader"] = 40030] = "MissingAuthStateProtocolHeader";
|
|
24
|
-
BasedErrorCode[BasedErrorCode["IncorrectAccessKey"] = 40031] = "IncorrectAccessKey";
|
|
25
|
-
BasedErrorCode[BasedErrorCode["Block"] = 90001] = "Block";
|
|
26
|
-
})(BasedErrorCode || (BasedErrorCode = {}));
|
|
27
|
-
//# sourceMappingURL=types.js.map
|
package/dist/error/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/error/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,UAAU;CACjB,CAAA;AAED,MAAM,CAAN,IAAY,cAmBX;AAnBD,WAAY,cAAc;IACxB,yEAAqB,CAAA;IACrB,2FAA8B,CAAA;IAC9B,iGAAiC,CAAA;IACjC,uFAA4B,CAAA;IAC5B,+EAAwB,CAAA;IACxB,qFAA2B,CAAA;IAC3B,2FAA8B,CAAA;IAC9B,2EAAsB,CAAA;IACtB,6EAAuB,CAAA;IACvB,yEAAqB,CAAA;IACrB,mGAAkC,CAAA;IAClC,+EAAwB,CAAA;IACxB,2EAAsB,CAAA;IACtB,+EAAwB,CAAA;IACxB,iEAAiB,CAAA;IACjB,2GAAsC,CAAA;IACtC,mFAA0B,CAAA;IAC1B,yDAAa,CAAA;AACf,CAAC,EAnBW,cAAc,KAAd,cAAc,QAmBzB"}
|