@arkstack/contract 0.2.4 → 0.3.1
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/LICENSE +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Toneflix Technologies Limited
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare abstract class ArkstackKitDriver<TApp, TMiddleware> {
|
|
|
22
22
|
abstract createApp(): TApp;
|
|
23
23
|
abstract mountPublicAssets(app: TApp, publicPath: string): PromiseOrValue<void>;
|
|
24
24
|
abstract bindRouter(app: TApp): PromiseOrValue<void>;
|
|
25
|
+
abstract applyMiddleware(app: TApp, middleware: ArkstackMiddlewareConfig<TMiddleware>): PromiseOrValue<void>;
|
|
25
26
|
abstract applyMiddleware(app: TApp, middleware: TMiddleware): PromiseOrValue<void>;
|
|
26
27
|
registerErrorHandler(_app: TApp): PromiseOrValue<void>;
|
|
27
28
|
abstract start(app: TApp, port: number): PromiseOrValue<void>;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export type PromiseOrValue<T> = T | Promise<T>;\n\nexport interface ArkstackMiddlewareConfig<TMiddleware> {\n global: TMiddleware[];\n before: TMiddleware[];\n after: TMiddleware[];\n}\n\nexport interface ArkstackRouteListOptions {\n path?: string;\n}\n\nexport interface ArkstackRouterContract<TApp, TRoutes = unknown> {\n bind (app: TApp): PromiseOrValue<unknown>;\n list (options?: ArkstackRouteListOptions, app?: TApp): PromiseOrValue<TRoutes>;\n}\n\nexport interface ArkstackRouterAwareCore<TApp, TRoutes = unknown> {\n getAppInstance (): TApp;\n getRouter (): ArkstackRouterContract<TApp, TRoutes>;\n}\n\n/**\n * The ArkstackKitDriver class defines the contract for a driver \n * that can be used with the ArkstackKitContract. \n */\nexport abstract class ArkstackKitDriver<TApp, TMiddleware> {\n abstract readonly name: string;\n abstract createApp (): TApp;\n abstract mountPublicAssets (app: TApp, publicPath: string): PromiseOrValue<void>;\n abstract bindRouter (app: TApp): PromiseOrValue<void>;\n abstract applyMiddleware (app: TApp, middleware: TMiddleware): PromiseOrValue<void>;\n registerErrorHandler (_app: TApp): PromiseOrValue<void> {\n return\n }\n abstract start (app: TApp, port: number): PromiseOrValue<void>;\n}\n\n/**\n * The ArkstackKitContract class defines the contract for an \n * application that uses the ArkstackKitDriver.\n */\nexport abstract class ArkstackKitContract<TApp, TMiddleware> {\n abstract app: TApp;\n abstract driver: ArkstackKitDriver<TApp, TMiddleware>;\n abstract middleware: ArkstackMiddlewareConfig<TMiddleware>;\n abstract boot (port: number): Promise<void>;\n abstract shutdown (): Promise<void>;\n}\n"],"mappings":";;;;;AA0BA,IAAsB,oBAAtB,MAA2D;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export type PromiseOrValue<T> = T | Promise<T>;\n\nexport interface ArkstackMiddlewareConfig<TMiddleware> {\n global: TMiddleware[];\n before: TMiddleware[];\n after: TMiddleware[];\n}\n\nexport interface ArkstackRouteListOptions {\n path?: string;\n}\n\nexport interface ArkstackRouterContract<TApp, TRoutes = unknown> {\n bind (app: TApp): PromiseOrValue<unknown>;\n list (options?: ArkstackRouteListOptions, app?: TApp): PromiseOrValue<TRoutes>;\n}\n\nexport interface ArkstackRouterAwareCore<TApp, TRoutes = unknown> {\n getAppInstance (): TApp;\n getRouter (): ArkstackRouterContract<TApp, TRoutes>;\n}\n\n/**\n * The ArkstackKitDriver class defines the contract for a driver \n * that can be used with the ArkstackKitContract. \n */\nexport abstract class ArkstackKitDriver<TApp, TMiddleware> {\n abstract readonly name: string;\n abstract createApp (): TApp;\n abstract mountPublicAssets (app: TApp, publicPath: string): PromiseOrValue<void>;\n abstract bindRouter (app: TApp): PromiseOrValue<void>;\n abstract applyMiddleware (app: TApp, middleware: ArkstackMiddlewareConfig<TMiddleware>): PromiseOrValue<void>;\n abstract applyMiddleware (app: TApp, middleware: TMiddleware): PromiseOrValue<void>;\n registerErrorHandler (_app: TApp): PromiseOrValue<void> {\n return\n }\n abstract start (app: TApp, port: number): PromiseOrValue<void>;\n}\n\n/**\n * The ArkstackKitContract class defines the contract for an \n * application that uses the ArkstackKitDriver.\n */\nexport abstract class ArkstackKitContract<TApp, TMiddleware> {\n abstract app: TApp;\n abstract driver: ArkstackKitDriver<TApp, TMiddleware>;\n abstract middleware: ArkstackMiddlewareConfig<TMiddleware>;\n abstract boot (port: number): Promise<void>;\n abstract shutdown (): Promise<void>;\n}\n"],"mappings":";;;;;AA0BA,IAAsB,oBAAtB,MAA2D;CAOzD,qBAAsB,MAAkC;;;;;;AAU1D,IAAsB,sBAAtB,MAA6D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Contract package for Arkstack providing contract-specific implementations of core Arkstack features such as routing, middleware, and database integration.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net",
|