tscommons-esm-socket-io-pseudo-http 0.0.2
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/index.d.mts +4 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/tcommons-socket-io-pseudo-decoded-response.d.mts +11 -0
- package/dist/types/tcommons-socket-io-pseudo-decoded-response.mjs +17 -0
- package/dist/types/tcommons-socket-io-pseudo-decoded-response.mjs.map +1 -0
- package/dist/types/tcommons-socket-io-pseudo-query.d.mts +11 -0
- package/dist/types/tcommons-socket-io-pseudo-query.mjs +21 -0
- package/dist/types/tcommons-socket-io-pseudo-query.mjs.map +1 -0
- package/dist/types/tcommons-socket-io-pseudo-response.d.mts +6 -0
- package/dist/types/tcommons-socket-io-pseudo-response.mjs +11 -0
- package/dist/types/tcommons-socket-io-pseudo-response.mjs.map +1 -0
- package/package.json +30 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TCommonsSocketIoPseudoQuery, isTCommonsSocketIoPseudoQuery } from './types/tcommons-socket-io-pseudo-query.mjs';
|
|
2
|
+
import { TCommonsSocketIoPseudoDecodedResponse, isTCommonsSocketIoPseudoDecodedResponse } from './types/tcommons-socket-io-pseudo-decoded-response.mjs';
|
|
3
|
+
import { TCommonsSocketIoPseudoResponse, isTCommonsSocketIoPseudoResponse } from './types/tcommons-socket-io-pseudo-response.mjs';
|
|
4
|
+
export { TCommonsSocketIoPseudoQuery, isTCommonsSocketIoPseudoQuery, TCommonsSocketIoPseudoDecodedResponse, isTCommonsSocketIoPseudoDecodedResponse, TCommonsSocketIoPseudoResponse, isTCommonsSocketIoPseudoResponse };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { isTCommonsSocketIoPseudoQuery } from './types/tcommons-socket-io-pseudo-query.mjs';
|
|
2
|
+
import { isTCommonsSocketIoPseudoDecodedResponse } from './types/tcommons-socket-io-pseudo-decoded-response.mjs';
|
|
3
|
+
import { isTCommonsSocketIoPseudoResponse } from './types/tcommons-socket-io-pseudo-response.mjs';
|
|
4
|
+
export { isTCommonsSocketIoPseudoQuery, isTCommonsSocketIoPseudoDecodedResponse, isTCommonsSocketIoPseudoResponse };
|
|
5
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AACzH,OAAO,EAAyC,uCAAuC,EAAE,MAAM,wDAAwD,CAAC;AACxJ,OAAO,EAAkC,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAClI,OAAO,EAEN,6BAA6B,EAE7B,uCAAuC,EAEvC,gCAAgC,EAChC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TPropertyObject } from 'tscommons-esm-core';
|
|
2
|
+
export type TCommonsSocketIoPseudoDecodedResponse = {
|
|
3
|
+
isEmpty: true;
|
|
4
|
+
headers: TPropertyObject<string>;
|
|
5
|
+
statusCode: number;
|
|
6
|
+
} | {
|
|
7
|
+
headers: TPropertyObject<string>;
|
|
8
|
+
statusCode: number;
|
|
9
|
+
body: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function isTCommonsSocketIoPseudoDecodedResponse(test: unknown): test is TCommonsSocketIoPseudoDecodedResponse;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { commonsTypeHasPropertyNumber, commonsTypeHasPropertyBooleanOrUndefined, commonsTypeHasPropertyStringOrUndefined, commonsTypeHasPropertyStringPropertyObjectT } from 'tscommons-esm-core';
|
|
2
|
+
export function isTCommonsSocketIoPseudoDecodedResponse(test) {
|
|
3
|
+
if (!commonsTypeHasPropertyBooleanOrUndefined(test, 'empty'))
|
|
4
|
+
return false;
|
|
5
|
+
if (test.empty === false)
|
|
6
|
+
return false;
|
|
7
|
+
if (!commonsTypeHasPropertyStringPropertyObjectT(test, 'headers'))
|
|
8
|
+
return false;
|
|
9
|
+
if (!commonsTypeHasPropertyNumber(test, 'statusCode'))
|
|
10
|
+
return false;
|
|
11
|
+
if (!commonsTypeHasPropertyStringOrUndefined(test, 'body'))
|
|
12
|
+
return false;
|
|
13
|
+
if (test.empty === true && test.body !== undefined)
|
|
14
|
+
return false;
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=tcommons-socket-io-pseudo-decoded-response.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tcommons-socket-io-pseudo-decoded-response.mjs","sourceRoot":"","sources":["../../src/types/tcommons-socket-io-pseudo-decoded-response.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,wCAAwC,EACxC,uCAAuC,EAEvC,2CAA2C,EAC5C,MAAM,oBAAoB,CAAC;AAY5B,MAAM,UAAU,uCAAuC,CAAC,IAAa;IACpE,IAAI,CAAC,wCAAwC,CAAC,IAAI,EAAE,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3E,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAEvC,IAAI,CAAC,2CAA2C,CAAC,IAAI,EAAE,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAChF,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,YAAY,CAAC;QAAE,OAAO,KAAK,CAAC;IAEpE,IAAI,CAAC,uCAAuC,CAAC,IAAI,EAAE,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACzE,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAEjE,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TEncodedObject, TPrimativeObject, TPropertyObject } from 'tscommons-esm-core';
|
|
2
|
+
export type TCommonsSocketIoPseudoQuery = {
|
|
3
|
+
pseudoDomain: string;
|
|
4
|
+
clientId: string;
|
|
5
|
+
queryUid: string;
|
|
6
|
+
url: string;
|
|
7
|
+
query: TPrimativeObject;
|
|
8
|
+
headers: TPropertyObject<string>;
|
|
9
|
+
body?: TEncodedObject;
|
|
10
|
+
};
|
|
11
|
+
export declare function isTCommonsSocketIoPseudoQuery(test: unknown): test is TCommonsSocketIoPseudoQuery;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { commonsBase62HasPropertyId, commonsTypeHasPropertyObject, commonsTypeHasPropertyObjectOrUndefined, commonsTypeHasPropertyString, commonsTypeHasPropertyStringPropertyObjectT, commonsTypeIsEncodedObject } from 'tscommons-esm-core';
|
|
2
|
+
export function isTCommonsSocketIoPseudoQuery(test) {
|
|
3
|
+
if (!commonsTypeHasPropertyString(test, 'pseudoDomain'))
|
|
4
|
+
return false;
|
|
5
|
+
if (!commonsBase62HasPropertyId(test, 'clientId'))
|
|
6
|
+
return false;
|
|
7
|
+
if (!commonsBase62HasPropertyId(test, 'queryUid'))
|
|
8
|
+
return false;
|
|
9
|
+
if (!commonsTypeHasPropertyString(test, 'url'))
|
|
10
|
+
return false;
|
|
11
|
+
if (!commonsTypeHasPropertyObject(test, 'query') || !commonsTypeIsEncodedObject(test.query))
|
|
12
|
+
return false;
|
|
13
|
+
if (!commonsTypeHasPropertyStringPropertyObjectT(test, 'headers'))
|
|
14
|
+
return false;
|
|
15
|
+
if (!commonsTypeHasPropertyObjectOrUndefined(test, 'body'))
|
|
16
|
+
return false;
|
|
17
|
+
if (commonsTypeHasPropertyObject(test, 'body') && !commonsTypeIsEncodedObject(test.body))
|
|
18
|
+
return false;
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=tcommons-socket-io-pseudo-query.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tcommons-socket-io-pseudo-query.mjs","sourceRoot":"","sources":["../../src/types/tcommons-socket-io-pseudo-query.mts"],"names":[],"mappings":"AAAA,OAAO,EAIL,0BAA0B,EAC1B,4BAA4B,EAC5B,uCAAuC,EACvC,4BAA4B,EAC5B,2CAA2C,EAC3C,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAY5B,MAAM,UAAU,6BAA6B,CAAC,IAAa;IAC1D,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,cAAc,CAAC;QAAE,OAAO,KAAK,CAAC;IACtE,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAChE,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAChE,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAE7D,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1G,IAAI,CAAC,2CAA2C,CAAC,IAAI,EAAE,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAChF,IAAI,CAAC,uCAAuC,CAAC,IAAI,EAAE,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACzE,IAAI,4BAA4B,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAEvG,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { commonsBase62HasPropertyId, commonsTypeHasPropertyString } from 'tscommons-esm-core';
|
|
2
|
+
export function isTCommonsSocketIoPseudoResponse(test) {
|
|
3
|
+
if (!commonsBase62HasPropertyId(test, 'clientId'))
|
|
4
|
+
return false;
|
|
5
|
+
if (!commonsBase62HasPropertyId(test, 'queryUid'))
|
|
6
|
+
return false;
|
|
7
|
+
if (!commonsTypeHasPropertyString(test, 'result'))
|
|
8
|
+
return false;
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tcommons-socket-io-pseudo-response.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tcommons-socket-io-pseudo-response.mjs","sourceRoot":"","sources":["../../src/types/tcommons-socket-io-pseudo-response.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAQ9F,MAAM,UAAU,gCAAgC,CAAC,IAAa;IAC7D,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAChE,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAChE,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IAEhE,OAAO,IAAI,CAAC;AACb,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tscommons-esm-socket-io-pseudo-http",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"tsc": "./node_modules/typescript/bin/tsc",
|
|
7
|
+
"preprepare": "rm -rf ./dist; php ~/Dev/etim.php src/ && npm run tsc",
|
|
8
|
+
"publish-major": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version major && npm install && npm publish && git add . && git commit -m 'publish'",
|
|
9
|
+
"publish-minor": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version minor && npm install && npm publish && git add . && git commit -m 'publish'",
|
|
10
|
+
"publish-patch": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version patch && npm install && npm publish && git add . && git commit -m 'publish'"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/index.mjs",
|
|
13
|
+
"types": "dist/index.d.mjs",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"author": "Pete Morris",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@stylistic/eslint-plugin-ts": "^2.10.1",
|
|
19
|
+
"eslint-plugin-import": "^2.31.0",
|
|
20
|
+
"eslint-plugin-prefer-arrow-functions": "^3.4.1",
|
|
21
|
+
"typescript": "^5.6.3",
|
|
22
|
+
"typescript-eslint": "^8.14.0"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/**/*"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"tscommons-esm-core": "^0.0.2"
|
|
29
|
+
}
|
|
30
|
+
}
|