@serve.zone/platformclient 1.0.2 → 1.0.6
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_ts/00_commitinfo_data.d.ts +1 -1
- package/dist_ts/00_commitinfo_data.js +2 -2
- package/dist_ts/classes.platformclient.d.ts +2 -2
- package/dist_ts/classes.platformclient.js +8 -2
- package/dist_ts/index.d.ts +1 -4
- package/dist_ts/index.js +3 -5
- package/package.json +11 -11
- package/readme.hints.md +0 -0
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/classes.platformclient.ts +5 -2
- package/ts/index.ts +3 -4
- package/ts/classes.serviceserver.ts +0 -51
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* autocreated commitinfo by @
|
|
2
|
+
* autocreated commitinfo by @push.rocks/commitinfo
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@serve.zone/platformclient',
|
|
6
|
-
version: '1.0.
|
|
6
|
+
version: '1.0.6',
|
|
7
7
|
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSw0QkFBNEI7SUFDbEMsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLG1GQUFtRjtDQUNqRyxDQUFBIn0=
|
|
@@ -8,7 +8,7 @@ export declare class SzPlatformClient {
|
|
|
8
8
|
private qenvInstance;
|
|
9
9
|
emailConnector: SzEmailConnector;
|
|
10
10
|
smsConnector: SzSmsConnector;
|
|
11
|
-
constructor(authorizationStringArg
|
|
12
|
-
init(): Promise<void>;
|
|
11
|
+
constructor(authorizationStringArg?: string);
|
|
12
|
+
init(authorizationStringArg?: string): Promise<void>;
|
|
13
13
|
private getConnectionAddress;
|
|
14
14
|
}
|
|
@@ -9,7 +9,13 @@ export class SzPlatformClient {
|
|
|
9
9
|
this.smsConnector = new SzSmsConnector(this);
|
|
10
10
|
this.authorizationString = authorizationStringArg;
|
|
11
11
|
}
|
|
12
|
-
async init() {
|
|
12
|
+
async init(authorizationStringArg) {
|
|
13
|
+
if (authorizationStringArg)
|
|
14
|
+
this.authorizationString = authorizationStringArg;
|
|
15
|
+
if (!this.authorizationString)
|
|
16
|
+
this.authorizationString = process.env.SERVEZONE_PLATFROM_AUTHORIZATION;
|
|
17
|
+
if (!this.authorizationString)
|
|
18
|
+
throw new Error('authorizationString is required');
|
|
13
19
|
this.typedsocket = await plugins.typedsocket.TypedSocket.createClient(this.typedrouter, await this.getConnectionAddress());
|
|
14
20
|
}
|
|
15
21
|
async getConnectionAddress() {
|
|
@@ -17,4 +23,4 @@ export class SzPlatformClient {
|
|
|
17
23
|
return connectionAddress;
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5wbGF0Zm9ybWNsaWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2NsYXNzZXMucGxhdGZvcm1jbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDckUsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxPQUFPLE1BQU0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QWlCLENBQUMsc0JBQXNCLENBQUMsQ0FBQztRQUM1RixPQUFPLGlCQUFpQixDQUFDO0lBQzNCLENBQUM7Q0FDRiJ9
|
package/dist_ts/index.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export * from './classes.
|
|
2
|
-
import { servertools } from '@api.global/typedserver';
|
|
3
|
-
declare const Handler: typeof servertools.Handler, HandlerTypedRouter: typeof servertools.HandlerTypedRouter;
|
|
4
|
-
export { Handler, HandlerTypedRouter };
|
|
1
|
+
export * from './classes.platformclient.js';
|
package/dist_ts/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export * from './classes.
|
|
1
|
+
export * from './classes.platformclient.js';
|
|
2
2
|
// Things for building a server
|
|
3
|
-
import { servertools } from '@api.global/typedserver';
|
|
4
|
-
|
|
5
|
-
export { Handler, HandlerTypedRouter };
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDRCQUE0QixDQUFDO0FBRTNDLCtCQUErQjtBQUMvQixPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDdEQsTUFBTSxFQUFFLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxHQUFHLFdBQVcsQ0FBQztBQUNwRCxPQUFPLEVBQUUsT0FBTyxFQUFFLGtCQUFrQixFQUFFLENBQUMifQ==
|
|
3
|
+
import { servertools, utilityservers } from '@api.global/typedserver';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDZCQUE2QixDQUFDO0FBRTVDLCtCQUErQjtBQUMvQixPQUFPLEVBQUUsV0FBVyxFQUFFLGNBQWMsRUFBRyxNQUFNLHlCQUF5QixDQUFDIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serve.zone/platformclient",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "a module that makes it really easy to use the serve.zone platform inside your app",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
"author": "Task Venture Capital GmbH",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@git.zone/tsbuild": "^2.1.
|
|
12
|
+
"@git.zone/tsbuild": "^2.1.84",
|
|
13
13
|
"@git.zone/tsbundle": "^2.0.5",
|
|
14
|
-
"@git.zone/tsrun": "^1.2.
|
|
15
|
-
"@git.zone/tstest": "^1.0.
|
|
16
|
-
"@push.rocks/tapbundle": "^5.0.
|
|
17
|
-
"@types/node": "^20.
|
|
14
|
+
"@git.zone/tsrun": "^1.2.49",
|
|
15
|
+
"@git.zone/tstest": "^1.0.90",
|
|
16
|
+
"@push.rocks/tapbundle": "^5.0.23",
|
|
17
|
+
"@types/node": "^20.14.12"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@api.global/typedrequest": "^3.0.
|
|
21
|
-
"@api.global/typedserver": "^3.0.
|
|
22
|
-
"@api.global/typedsocket": "^3.0.
|
|
20
|
+
"@api.global/typedrequest": "^3.0.30",
|
|
21
|
+
"@api.global/typedserver": "^3.0.50",
|
|
22
|
+
"@api.global/typedsocket": "^3.0.1",
|
|
23
23
|
"@push.rocks/qenv": "^6.0.5",
|
|
24
|
-
"@push.rocks/smartlog": "^3.0.
|
|
24
|
+
"@push.rocks/smartlog": "^3.0.7",
|
|
25
25
|
"@push.rocks/smartntml": "^2.0.4",
|
|
26
|
-
"@serve.zone/interfaces": "^1.0.
|
|
26
|
+
"@serve.zone/interfaces": "^1.0.74"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|
package/readme.hints.md
ADDED
|
File without changes
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* autocreated commitinfo by @
|
|
2
|
+
* autocreated commitinfo by @push.rocks/commitinfo
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@serve.zone/platformclient',
|
|
6
|
-
version: '1.0.
|
|
6
|
+
version: '1.0.6',
|
|
7
7
|
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
|
|
8
8
|
}
|
|
@@ -11,11 +11,14 @@ export class SzPlatformClient {
|
|
|
11
11
|
public emailConnector = new SzEmailConnector(this);
|
|
12
12
|
public smsConnector = new SzSmsConnector(this);
|
|
13
13
|
|
|
14
|
-
constructor(authorizationStringArg
|
|
14
|
+
constructor(authorizationStringArg?: string) {
|
|
15
15
|
this.authorizationString = authorizationStringArg;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
public async init() {
|
|
18
|
+
public async init(authorizationStringArg?: string) {
|
|
19
|
+
if (authorizationStringArg) this.authorizationString = authorizationStringArg;
|
|
20
|
+
if (!this.authorizationString) this.authorizationString = process.env.SERVEZONE_PLATFROM_AUTHORIZATION;
|
|
21
|
+
if (!this.authorizationString) throw new Error('authorizationString is required');
|
|
19
22
|
this.typedsocket = await plugins.typedsocket.TypedSocket.createClient(this.typedrouter, await this.getConnectionAddress());
|
|
20
23
|
}
|
|
21
24
|
|
package/ts/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export * from './classes.
|
|
1
|
+
export * from './classes.platformclient.js';
|
|
2
2
|
|
|
3
3
|
// Things for building a server
|
|
4
|
-
import { servertools } from '@api.global/typedserver';
|
|
5
|
-
|
|
6
|
-
export { Handler, HandlerTypedRouter };
|
|
4
|
+
import { servertools, utilityservers } from '@api.global/typedserver';
|
|
5
|
+
|
|
7
6
|
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as plugins from './plugins.js';
|
|
2
|
-
import { InfoHtml } from './infohtml/index.js';
|
|
3
|
-
|
|
4
|
-
export interface IServiceServerConstructorOptions {
|
|
5
|
-
addCustomRoutes?: (serverArg: plugins.typedserver.servertools.Server) => Promise<any>;
|
|
6
|
-
serviceName: string;
|
|
7
|
-
serviceVersion: string;
|
|
8
|
-
serviceDomain: string;
|
|
9
|
-
port?: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* a server for serving your app to the outside world
|
|
14
|
-
*/
|
|
15
|
-
export class ServiceServer {
|
|
16
|
-
public options: IServiceServerConstructorOptions;
|
|
17
|
-
public typedServer: plugins.typedserver.TypedServer;
|
|
18
|
-
|
|
19
|
-
constructor(optionsArg: IServiceServerConstructorOptions) {
|
|
20
|
-
this.options = optionsArg;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public async start() {
|
|
24
|
-
console.log('starting lole-serviceserver...')
|
|
25
|
-
this.typedServer = new plugins.typedserver.TypedServer({
|
|
26
|
-
cors: true,
|
|
27
|
-
domain: this.options.serviceDomain,
|
|
28
|
-
forceSsl: false,
|
|
29
|
-
port: this.options.port || 3000,
|
|
30
|
-
robots: true,
|
|
31
|
-
defaultAnswer: async () => {
|
|
32
|
-
return (
|
|
33
|
-
await InfoHtml.fromSimpleText(
|
|
34
|
-
`${this.options.serviceName} (version ${this.options.serviceVersion})`
|
|
35
|
-
)
|
|
36
|
-
).htmlString;
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// lets add any custom routes
|
|
41
|
-
if (this.options.addCustomRoutes) {
|
|
42
|
-
await this.options.addCustomRoutes(this.typedServer.server);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
await this.typedServer.start();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public async stop() {
|
|
49
|
-
await this.typedServer.stop();
|
|
50
|
-
}
|
|
51
|
-
}
|