@regojs/erp-sdk 1.0.0 → 1.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/browser/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/server/constants/enums.d.ts +1 -0
- package/dist/server/constants/index.d.ts +2 -0
- package/dist/server/constants/variables.d.ts +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/providers/app.d.ts +24 -0
- package/dist/server/providers/client.d.ts +15 -0
- package/dist/server/providers/cms.app.d.ts +16 -0
- package/dist/server/providers/crm.app.d.ts +13 -0
- package/dist/server/providers/index.d.ts +2 -0
- package/dist/server/providers/pim.app.d.ts +13 -0
- package/dist/server/types/app.d.ts +12 -0
- package/dist/server/types/client.d.ts +13 -0
- package/dist/server/types/cms.app.d.ts +19 -0
- package/dist/server/types/crm.app.d.ts +3 -0
- package/dist/server/types/index.d.ts +6 -0
- package/dist/server/types/pim.app.d.ts +3 -0
- package/dist/server/types/response.d.ts +3 -0
- package/package.json +3 -3
- package/src/server/index.ts +0 -1
- package/src/server/types/{cms.app.d.ts → cms.app.ts} +1 -1
- package/src/server/types/index.ts +6 -0
- package/src/server/types/index.d.ts +0 -6
- /package/src/server/types/{app.d.ts → app.ts} +0 -0
- /package/src/server/types/{client.d.ts → client.ts} +0 -0
- /package/src/server/types/{crm.app.d.ts → crm.app.ts} +0 -0
- /package/src/server/types/{pim.app.d.ts → pim.app.ts} +0 -0
- /package/src/server/types/{response.d.ts → response.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const baseUri = "https://api.regosolution.com";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IApp, TCredential, TOptions } from "../types";
|
|
2
|
+
export declare class App implements IApp {
|
|
3
|
+
protected readonly params: Readonly<{
|
|
4
|
+
credential: TCredential;
|
|
5
|
+
options?: TOptions;
|
|
6
|
+
}>;
|
|
7
|
+
protected appName: string;
|
|
8
|
+
protected defaultVersion: number;
|
|
9
|
+
protected token?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Initialize Rego ERP client instance
|
|
12
|
+
* @param configs
|
|
13
|
+
* @param options
|
|
14
|
+
*/
|
|
15
|
+
constructor(params: Readonly<{
|
|
16
|
+
credential: TCredential;
|
|
17
|
+
options?: TOptions;
|
|
18
|
+
}>);
|
|
19
|
+
/**
|
|
20
|
+
* Sign JWT token with Ed25519 algorithm
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
signToken(): Promise<string>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IClient, TApps, TCredential, TOptions } from "../types";
|
|
2
|
+
import { App } from "./app";
|
|
3
|
+
export declare class Client extends App implements IClient {
|
|
4
|
+
#private;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize Rego ERP client instance
|
|
7
|
+
* @param configs
|
|
8
|
+
* @param options
|
|
9
|
+
*/
|
|
10
|
+
constructor(params: Readonly<{
|
|
11
|
+
credential: TCredential;
|
|
12
|
+
options?: TOptions;
|
|
13
|
+
}>);
|
|
14
|
+
use<T extends keyof TApps = "CMS" | "CRM" | "PIM">(domain: T): TApps[T];
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ICmsApp, TCredential, TOptions } from "../types";
|
|
2
|
+
import { App } from "./app";
|
|
3
|
+
export declare class CmsApp extends App implements ICmsApp {
|
|
4
|
+
#private;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize Rego ERP CMS app instance
|
|
7
|
+
* @param configs
|
|
8
|
+
* @param options
|
|
9
|
+
*/
|
|
10
|
+
constructor(params: Readonly<{
|
|
11
|
+
credential: TCredential;
|
|
12
|
+
options?: TOptions;
|
|
13
|
+
}>);
|
|
14
|
+
register(payload: Parameters<ICmsApp["register"]>[number]): ReturnType<ICmsApp["register"]>;
|
|
15
|
+
getRoutes(): ReturnType<ICmsApp["getRoutes"]>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ICrmApp, TCredential, TOptions } from "../types";
|
|
2
|
+
import { App } from "./app";
|
|
3
|
+
export declare class CrmApp extends App implements ICrmApp {
|
|
4
|
+
/**
|
|
5
|
+
* Initialize Rego ERP PIM app instance
|
|
6
|
+
* @param configs
|
|
7
|
+
* @param options
|
|
8
|
+
*/
|
|
9
|
+
constructor(params: Readonly<{
|
|
10
|
+
credential: TCredential;
|
|
11
|
+
options?: TOptions;
|
|
12
|
+
}>);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IPimApp, TCredential, TOptions } from "../types";
|
|
2
|
+
import { App } from "./app";
|
|
3
|
+
export declare class PimApp extends App implements IPimApp {
|
|
4
|
+
/**
|
|
5
|
+
* Initialize Rego ERP PIM app instance
|
|
6
|
+
* @param configs
|
|
7
|
+
* @param options
|
|
8
|
+
*/
|
|
9
|
+
constructor(params: Readonly<{
|
|
10
|
+
credential: TCredential;
|
|
11
|
+
options?: TOptions;
|
|
12
|
+
}>);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IApp } from "./app";
|
|
2
|
+
import type { ICmsApp } from "./cms.app";
|
|
3
|
+
import type { ICrmApp } from "./crm.app";
|
|
4
|
+
import type { IPimApp } from "./pim.app";
|
|
5
|
+
export type TApps = {
|
|
6
|
+
CMS: ICmsApp;
|
|
7
|
+
CRM: ICrmApp;
|
|
8
|
+
PIM: IPimApp;
|
|
9
|
+
};
|
|
10
|
+
export type TDomains = "CMS" | "CRM" | "PIM";
|
|
11
|
+
export interface IClient extends IApp {
|
|
12
|
+
use<T extends keyof TApps = "CMS" | "CRM" | "PIM">(domain: T): TApps[T];
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IApp } from "./app";
|
|
2
|
+
export type TBlueprintRoute = {
|
|
3
|
+
path: string;
|
|
4
|
+
index?: boolean;
|
|
5
|
+
component?: string;
|
|
6
|
+
};
|
|
7
|
+
export interface ICmsApp extends IApp {
|
|
8
|
+
register(payload: {
|
|
9
|
+
blueprintId?: string;
|
|
10
|
+
}): ICmsApp;
|
|
11
|
+
getRoutes(): Promise<{
|
|
12
|
+
hostname?: string | null;
|
|
13
|
+
routes?: Array<TBlueprintRoute> | null;
|
|
14
|
+
data?: {
|
|
15
|
+
metadata?: Record<string, string> | null;
|
|
16
|
+
dynamicData?: unknown;
|
|
17
|
+
} | null;
|
|
18
|
+
} | null>;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"url": "git+https://github.com/rego-solution/erp-sdk"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build:browser": "tsc --noEmit && APP=\"browser\" bun run ./app.build.ts",
|
|
40
|
-
"build:server": "tsc --noEmit && APP=\"server\" bun run ./app.build.ts",
|
|
39
|
+
"build:browser": "tsc --noEmit && APP=\"browser\" bun run ./app.build.ts && tsc --emitDeclarationOnly",
|
|
40
|
+
"build:server": "tsc --noEmit && APP=\"server\" bun run ./app.build.ts && tsc --emitDeclarationOnly",
|
|
41
41
|
"format": "prettier \"./src/**/*.ts\" --write",
|
|
42
42
|
"test": "bun --hot run __test/index.ts"
|
|
43
43
|
},
|
|
44
44
|
"types": "./dist/index.d.ts",
|
|
45
|
-
"version": "1.0.
|
|
45
|
+
"version": "1.0.2",
|
|
46
46
|
"exports": {
|
|
47
47
|
".": {
|
|
48
48
|
"import": "./dist/index.js",
|
package/src/server/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type TBlueprintRoute = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export interface ICmsApp extends IApp {
|
|
10
|
-
register(payload: { blueprintId?: string }
|
|
10
|
+
register(payload: { blueprintId?: string }): ICmsApp;
|
|
11
11
|
getRoutes(): Promise<{
|
|
12
12
|
hostname?: string | null;
|
|
13
13
|
routes?: Array<TBlueprintRoute> | null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|