Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
7d0925ad33 | |||
63700c3754 | |||
274bffb318 | |||
1ed33efec1 | |||
8300532de4 | |||
606d46acf8 | |||
9c84205633 | |||
a71d5f1bde | |||
e19a5b6195 | |||
02d204e606 | |||
7d9d023d6b | |||
07a3df944a |
49
changelog.md
Normal file
49
changelog.md
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-10-02 - 1.0.10 - fix(build)
|
||||||
|
Fix build script configuration and plugins import path
|
||||||
|
|
||||||
|
- Corrected the build script in package.json to include tsfolders parameter
|
||||||
|
- Fixed the import path for plugins in classes.infohtml.ts
|
||||||
|
|
||||||
|
## 2024-10-02 - 1.0.9 - fix(infohtml)
|
||||||
|
Refactor infohtml module and fix import paths
|
||||||
|
|
||||||
|
- Refactored ts_infohtml module.
|
||||||
|
- Fixed incorrect import paths in ts_infohtml module.
|
||||||
|
- Ensured that the InfoHtml class and related templates are properly imported and used.
|
||||||
|
|
||||||
|
## 2024-10-02 - 1.0.8 - fix(core)
|
||||||
|
Maintain dependencies, update metadata
|
||||||
|
|
||||||
|
- No changes detected
|
||||||
|
|
||||||
|
## 2024-10-02 - 1.0.7 - fix(core)
|
||||||
|
Update dependencies and add logging for email and SMS functions
|
||||||
|
|
||||||
|
- Updated devDependencies and dependencies in package.json
|
||||||
|
- Added logger import and logging statements in classes.emailconnector.ts and classes.smsconnector.ts
|
||||||
|
- Fixed formatting issues in test/test.ts
|
||||||
|
- Cleaned up and removed unused imports in index.ts and plugins.ts
|
||||||
|
|
||||||
|
## 2024-07-26 - 1.0.6 - fix(core)
|
||||||
|
Update @types/node dependency version
|
||||||
|
|
||||||
|
- Dependencies updated: @types/node updated from ^20.14.11 to ^20.14.12
|
||||||
|
|
||||||
|
## 2024-07-23 - 1.0.5 - fix(dependencies)
|
||||||
|
Updated dependencies to latest versions and removed unused service server class
|
||||||
|
|
||||||
|
- Updated devDependencies and dependencies to their latest versions in package.json
|
||||||
|
- Removed the unused ServiceServer class
|
||||||
|
- Updated index.ts to reflect changes in imports
|
||||||
|
|
||||||
|
## 2024-05-11 - 1.0.3 to 1.0.4 - General Updates
|
||||||
|
Maintenance updates
|
||||||
|
|
||||||
|
- Fix(core): update
|
||||||
|
|
||||||
|
## 2024-02-17 - 1.0.1 to 1.0.3 - General Updates
|
||||||
|
Maintenance updates
|
||||||
|
|
||||||
|
- Fix(core): update
|
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/platformclient",
|
"name": "@serve.zone/platformclient",
|
||||||
"version": "1.0.4",
|
"version": "1.0.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a module that makes it really easy to use the serve.zone platform inside your app",
|
"description": "a module that makes it really easy to use the serve.zone platform inside your app",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -10,25 +10,25 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild --web --allowimplicitany)",
|
"build": "(tsbuild tsfolders --web --allowimplicitany)",
|
||||||
"localPublish": "gitzone commit && pnpm run build && pnpm publish && pnpm publish --access public --registry=\"https://registry.npmjs.org\""
|
"localPublish": "gitzone commit && pnpm run build && pnpm publish && pnpm publish --access public --registry=\"https://registry.npmjs.org\""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.25",
|
"@git.zone/tsbuild": "^2.1.84",
|
||||||
"@git.zone/tsbundle": "^2.0.5",
|
"@git.zone/tsbundle": "^2.0.5",
|
||||||
"@git.zone/tsrun": "^1.2.46",
|
"@git.zone/tsrun": "^1.2.49",
|
||||||
"@git.zone/tstest": "^1.0.44",
|
"@git.zone/tstest": "^1.0.90",
|
||||||
"@push.rocks/tapbundle": "^5.0.15",
|
"@push.rocks/tapbundle": "^5.3.0",
|
||||||
"@types/node": "^20.11.19"
|
"@types/node": "^22.7.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@api.global/typedrequest": "^3.0.4",
|
"@api.global/typedrequest": "^3.0.32",
|
||||||
"@api.global/typedserver": "^3.0.20",
|
"@api.global/typedserver": "^3.0.51",
|
||||||
"@api.global/typedsocket": "^3.0.0",
|
"@api.global/typedsocket": "^3.0.1",
|
||||||
"@push.rocks/qenv": "^6.0.5",
|
"@push.rocks/qenv": "^6.0.5",
|
||||||
"@push.rocks/smartlog": "^3.0.3",
|
"@push.rocks/smartlog": "^3.0.7",
|
||||||
"@push.rocks/smartntml": "^2.0.4",
|
"@push.rocks/smartntml": "^2.0.4",
|
||||||
"@serve.zone/interfaces": "^1.0.35"
|
"@serve.zone/interfaces": "^1.0.81"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
8509
pnpm-lock.yaml
generated
8509
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
0
readme.hints.md
Normal file
0
readme.hints.md
Normal file
@ -1,8 +1,8 @@
|
|||||||
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
||||||
import * as platformclient from '../ts/index.js'
|
import * as platformclient from '../ts/index.js';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
console.log(platformclient)
|
console.log(platformclient);
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.start()
|
tap.start();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* autocreated commitinfo by @pushrocks/commitinfo
|
* autocreated commitinfo by @push.rocks/commitinfo
|
||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/platformclient',
|
name: '@serve.zone/platformclient',
|
||||||
version: '1.0.4',
|
version: '1.0.10',
|
||||||
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
|
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
|
||||||
}
|
}
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
import * as plugins from './plugins.js';
|
|
||||||
import { InfoHtml } from './infohtml/index.js';
|
|
||||||
|
|
||||||
export interface IServiceServerConstructorOptions {
|
|
||||||
addCustomRoutes?: (serverArg: plugins.typedserver.servertools.Server) => Promise<any>;
|
|
||||||
serviceName: string;
|
|
||||||
serviceVersion: string;
|
|
||||||
serviceDomain: string;
|
|
||||||
port?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* a server for serving your app to the outside world
|
|
||||||
*/
|
|
||||||
export class ServiceServer {
|
|
||||||
public options: IServiceServerConstructorOptions;
|
|
||||||
public typedServer: plugins.typedserver.TypedServer;
|
|
||||||
|
|
||||||
constructor(optionsArg: IServiceServerConstructorOptions) {
|
|
||||||
this.options = optionsArg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async start() {
|
|
||||||
console.log('starting lole-serviceserver...')
|
|
||||||
this.typedServer = new plugins.typedserver.TypedServer({
|
|
||||||
cors: true,
|
|
||||||
domain: this.options.serviceDomain,
|
|
||||||
forceSsl: false,
|
|
||||||
port: this.options.port || 3000,
|
|
||||||
robots: true,
|
|
||||||
defaultAnswer: async () => {
|
|
||||||
return (
|
|
||||||
await InfoHtml.fromSimpleText(
|
|
||||||
`${this.options.serviceName} (version ${this.options.serviceVersion})`
|
|
||||||
)
|
|
||||||
).htmlString;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// lets add any custom routes
|
|
||||||
if (this.options.addCustomRoutes) {
|
|
||||||
await this.options.addCustomRoutes(this.typedServer.server);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.typedServer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async stop() {
|
|
||||||
await this.typedServer.stop();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,8 @@
|
|||||||
import type { SzPlatformClient } from '../classes.platformclient.js';
|
import type { SzPlatformClient } from '../classes.platformclient.js';
|
||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
|
|
||||||
|
import { logger } from '../logger.js';
|
||||||
|
|
||||||
export class SzEmailConnector {
|
export class SzEmailConnector {
|
||||||
public platformClientRef: SzPlatformClient;
|
public platformClientRef: SzPlatformClient;
|
||||||
|
|
||||||
@ -16,6 +18,15 @@ export class SzEmailConnector {
|
|||||||
'sendEmail'
|
'sendEmail'
|
||||||
);
|
);
|
||||||
const response = await typedRequest.fire(optionsArg);
|
const response = await typedRequest.fire(optionsArg);
|
||||||
|
|
||||||
|
if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) {
|
||||||
|
logger.log('info', `sent email with subject ${optionsArg.title} to ${optionsArg.to}
|
||||||
|
body:
|
||||||
|
${optionsArg.body.split('\n').map(line => ` ${line}`).join('\n')}
|
||||||
|
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendNotification(optionsArg: { toArg: string; subject: string; text: string }) {}
|
public async sendNotification(optionsArg: { toArg: string; subject: string; text: string }) {}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import type { SzPlatformClient } from '../classes.platformclient.js';
|
import type { SzPlatformClient } from '../classes.platformclient.js';
|
||||||
|
import { logger } from '../logger.js';
|
||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
|
|
||||||
export class SzSmsConnector {
|
export class SzSmsConnector {
|
||||||
@ -13,6 +14,16 @@ export class SzSmsConnector {
|
|||||||
'sendSms'
|
'sendSms'
|
||||||
);
|
);
|
||||||
const response = await typedrequest.fire(messageArg);
|
const response = await typedrequest.fire(messageArg);
|
||||||
|
|
||||||
|
if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) {
|
||||||
|
logger.log('info', `sent sms to ${messageArg.toNumber}}
|
||||||
|
body:
|
||||||
|
${messageArg.messageText.split('\n').map(line => ` ${line}`).join('\n')}
|
||||||
|
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return response.status;
|
return response.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1 @@
|
|||||||
export * from './classes.serviceserver.js';
|
export * from './classes.platformclient.js';
|
||||||
|
|
||||||
// Things for building a server
|
|
||||||
import { servertools } from '@api.global/typedserver';
|
|
||||||
const { Handler, HandlerTypedRouter } = servertools;
|
|
||||||
export { Handler, HandlerTypedRouter };
|
|
||||||
|
|
||||||
|
@ -6,4 +6,6 @@ export const logger = new plugins.smartlog.Smartlog({
|
|||||||
runtime: 'node',
|
runtime: 'node',
|
||||||
zone: 'serve.zone',
|
zone: 'serve.zone',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
logger.enableConsole();
|
@ -8,12 +8,10 @@ export {
|
|||||||
// @push.rocks scope
|
// @push.rocks scope
|
||||||
import * as qenv from '@push.rocks/qenv';
|
import * as qenv from '@push.rocks/qenv';
|
||||||
import * as smartlog from '@push.rocks/smartlog';
|
import * as smartlog from '@push.rocks/smartlog';
|
||||||
import * as smartntml from '@push.rocks/smartntml';
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
qenv,
|
qenv,
|
||||||
smartlog,
|
smartlog,
|
||||||
smartntml,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
|
|
||||||
import { simpleInfo } from './template.js';
|
import { simpleInfo } from './template.js';
|
||||||
|
|
5
ts_infohtml/plugins.ts
Normal file
5
ts_infohtml/plugins.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import * as smartntml from '@push.rocks/smartntml';
|
||||||
|
|
||||||
|
export {
|
||||||
|
smartntml,
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
import { type IHtmlInfoOptions } from './classes.infohtml.js';
|
import { type IHtmlInfoOptions } from './classes.infohtml.js';
|
||||||
|
|
||||||
export const simpleInfo = async (
|
export const simpleInfo = async (
|
Reference in New Issue
Block a user