@appneurox/performance-service-sdk 0.0.0-stage → 0.1.0
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/README.md +18 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -4
package/README.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @appneurox/performance-service-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Client for Performance Service. Works in Node 18+, browsers, React Native and edge runtimes.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createPerformanceServiceClient } from '@appneurox/performance-service-sdk';
|
|
7
|
+
|
|
8
|
+
// Standalone microservice
|
|
9
|
+
const direct = createPerformanceServiceClient({ token, tenantId });
|
|
10
|
+
|
|
11
|
+
// Same module through a brand API (modular monolith)
|
|
12
|
+
const viaBrand = createPerformanceServiceClient({ monolithUrl: 'https://<brand>-api.appneurox.com', token, tenantId });
|
|
13
|
+
|
|
14
|
+
await viaBrand.metadata();
|
|
15
|
+
await viaBrand.execute('<operation>', { /* payload */ });
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Errors throw `ApiError` (`status`, `code`, `requestId`). Brand SDKs (`@appneurox/<brand>-sdk`)
|
|
19
|
+
bundle this client with the other services that brand uses.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ServiceClient, ServiceClientOptions } from '@appneurox/sdk-core';
|
|
2
|
+
export { ApiError } from '@appneurox/sdk-core';
|
|
3
|
+
export type { ModuleMetadata, RequestOptions, ServiceClientOptions } from '@appneurox/sdk-core';
|
|
4
|
+
export declare const SERVICE_SLUG = "performance-service";
|
|
5
|
+
export declare const DEFAULT_BASE_URL = "https://performance-service.appneurox.com";
|
|
6
|
+
/** Add typed methods for this service's operations here as they are implemented. */
|
|
7
|
+
export type PerformanceServiceClient = ServiceClient;
|
|
8
|
+
/**
|
|
9
|
+
* Calls the standalone microservice by default. Pass `monolithUrl` to reach the same module
|
|
10
|
+
* through a brand API, which mounts it under `/performance-service`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createPerformanceServiceClient(options?: ServiceClientOptions): PerformanceServiceClient;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_BASE_URL = exports.SERVICE_SLUG = exports.ApiError = void 0;
|
|
4
|
+
exports.createPerformanceServiceClient = createPerformanceServiceClient;
|
|
5
|
+
// Scaffolded by nestjs-fleet scripts/service_packages.py. This file belongs to the service; edit it freely.
|
|
6
|
+
const sdk_core_1 = require("@appneurox/sdk-core");
|
|
7
|
+
var sdk_core_2 = require("@appneurox/sdk-core");
|
|
8
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return sdk_core_2.ApiError; } });
|
|
9
|
+
exports.SERVICE_SLUG = 'performance-service';
|
|
10
|
+
exports.DEFAULT_BASE_URL = 'https://performance-service.appneurox.com';
|
|
11
|
+
/**
|
|
12
|
+
* Calls the standalone microservice by default. Pass `monolithUrl` to reach the same module
|
|
13
|
+
* through a brand API, which mounts it under `/performance-service`.
|
|
14
|
+
*/
|
|
15
|
+
function createPerformanceServiceClient(options = {}) {
|
|
16
|
+
return (0, sdk_core_1.createServiceClient)(exports.SERVICE_SLUG, exports.DEFAULT_BASE_URL, options);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAiBA,wEAEC;AAnBD,4GAA4G;AAC5G,kDAA0D;AAG1D,gDAA+C;AAAtC,oGAAA,QAAQ,OAAA;AAGJ,QAAA,YAAY,GAAG,qBAAqB,CAAC;AACrC,QAAA,gBAAgB,GAAG,2CAA2C,CAAC;AAK5E;;;GAGG;AACH,SAAgB,8BAA8B,CAAC,UAAgC,EAAE;IAC/E,OAAO,IAAA,8BAAmB,EAAC,oBAAY,EAAE,wBAAgB,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appneurox/performance-service-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Performance Service client for the standalone microservice or any brand API that mounts it.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/APPNEURAL-Microservices/performance-service.git",
|
|
9
|
+
"directory": "packages/sdk"
|
|
10
|
+
},
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"require": "./dist/index.js",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.json",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@appneurox/sdk-core": "^0.1.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "5.9.3"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
}
|
|
41
|
+
}
|