@xylabs/base 4.13.14 β 4.13.16
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 +22 -31
- package/dist/neutral/Base.d.ts +45 -0
- package/dist/neutral/Base.d.ts.map +1 -0
- package/dist/neutral/globallyUnique.d.ts +9 -0
- package/dist/neutral/globallyUnique.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +3 -57
- package/dist/neutral/index.d.ts.map +1 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,63 +1,54 @@
|
|
|
1
|
-
[![logo][]](https://xylabs.com)
|
|
2
|
-
|
|
3
1
|
# @xylabs/base
|
|
4
2
|
|
|
3
|
+
[![logo][]](https://xylabs.com)
|
|
4
|
+
|
|
5
|
+
[![main-build][]][main-build-link]
|
|
5
6
|
[![npm-badge][]][npm-link]
|
|
6
7
|
[![npm-downloads-badge][]][npm-link]
|
|
7
8
|
[![jsdelivr-badge][]][jsdelivr-link]
|
|
8
9
|
[![npm-license-badge][]](LICENSE)
|
|
10
|
+
[![codacy-badge][]][codacy-link]
|
|
11
|
+
[![codeclimate-badge][]][codeclimate-link]
|
|
12
|
+
[![snyk-badge][]][snyk-link]
|
|
9
13
|
[![socket-badge][]][socket-link]
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Table of Contents
|
|
14
|
-
|
|
15
|
-
- [Description](#description)
|
|
16
|
-
- [Install](#install)
|
|
17
|
-
- [Maintainers](#maintainers)
|
|
18
|
-
- [License](#license)
|
|
19
|
-
- [Credits](#credits)
|
|
20
|
-
|
|
21
|
-
## Description
|
|
15
|
+
Version: 4.13.15
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
Primary SDK for using XYO Protocol 2.0
|
|
24
18
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
Using npm:
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
npm i --save @xylabs/base
|
|
31
|
-
```
|
|
19
|
+
## Documentation
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
Coming Soon!
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
yarn add @xylabs/base
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Documentation
|
|
40
|
-
[Developer Reference](https://xylabs.github.io/sdk-js)
|
|
23
|
+
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
|
41
24
|
|
|
42
25
|
## Maintainers
|
|
43
26
|
|
|
44
27
|
- [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
|
|
45
|
-
- [Joel Carter](https://github.com/JoelBCarter)
|
|
46
28
|
- [Matt Jones](https://github.com/jonesmac)
|
|
29
|
+
- [Joel Carter](https://github.com/JoelBCarter)
|
|
47
30
|
- [Jordan Trouw](https://github.com/jordantrouw)
|
|
48
31
|
|
|
49
32
|
## License
|
|
50
33
|
|
|
51
|
-
See the [LICENSE](LICENSE) file for license details
|
|
34
|
+
> See the [LICENSE](LICENSE) file for license details
|
|
52
35
|
|
|
53
36
|
## Credits
|
|
54
37
|
|
|
55
|
-
[Made with π₯and βοΈ by
|
|
38
|
+
[Made with π₯ and βοΈ by XYLabs](https://xylabs.com)
|
|
56
39
|
|
|
57
40
|
[logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
|
|
58
41
|
|
|
42
|
+
[main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
|
|
43
|
+
[main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
|
|
59
44
|
[npm-badge]: https://img.shields.io/npm/v/@xylabs/base.svg
|
|
60
45
|
[npm-link]: https://www.npmjs.com/package/@xylabs/base
|
|
46
|
+
[codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
|
|
47
|
+
[codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
|
|
48
|
+
[codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
|
|
49
|
+
[codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
|
|
50
|
+
[snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
|
|
51
|
+
[snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
|
|
61
52
|
|
|
62
53
|
[npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/base
|
|
63
54
|
[npm-license-badge]: https://img.shields.io/npm/l/@xylabs/base
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meter, MeterProvider, Tracer, TracerProvider } from '@opentelemetry/api';
|
|
2
|
+
import type { Logger } from '@xylabs/logger';
|
|
3
|
+
import type { EmptyObject } from '@xylabs/object';
|
|
4
|
+
export type BaseClassName = Exclude<string, 'base-class-name-reserved-32546239486'>;
|
|
5
|
+
export type BaseParamsFields = {
|
|
6
|
+
logger?: Logger;
|
|
7
|
+
meterProvider?: MeterProvider;
|
|
8
|
+
traceProvider?: TracerProvider;
|
|
9
|
+
};
|
|
10
|
+
export type BaseParams<TAdditionalParams extends EmptyObject = EmptyObject> = TAdditionalParams & BaseParamsFields;
|
|
11
|
+
export declare abstract class Base<TParams extends BaseParams = BaseParams> {
|
|
12
|
+
static defaultLogger?: Logger;
|
|
13
|
+
static readonly globalInstances: Record<BaseClassName, WeakRef<Base>[]>;
|
|
14
|
+
static readonly globalInstancesCountHistory: Record<BaseClassName, number[]>;
|
|
15
|
+
static readonly uniqueName: string;
|
|
16
|
+
private static _historyInterval;
|
|
17
|
+
private static _historyTime;
|
|
18
|
+
private static _historyTimeout?;
|
|
19
|
+
private static _lastGC;
|
|
20
|
+
private static _maxGcFrequency;
|
|
21
|
+
private _params;
|
|
22
|
+
constructor(params: BaseParams<TParams>);
|
|
23
|
+
static get historyInterval(): number;
|
|
24
|
+
static set historyInterval(value: number);
|
|
25
|
+
static get historyTime(): number;
|
|
26
|
+
static set historyTime(value: number);
|
|
27
|
+
static get maxGcFrequency(): number;
|
|
28
|
+
static set maxGcFrequency(value: number);
|
|
29
|
+
static get maxHistoryDepth(): number;
|
|
30
|
+
get logger(): Logger | undefined;
|
|
31
|
+
get meter(): Meter | undefined;
|
|
32
|
+
get params(): BaseParams<TParams>;
|
|
33
|
+
get tracer(): Tracer | undefined;
|
|
34
|
+
static gc(force?: boolean): void;
|
|
35
|
+
static gc(className: string): void;
|
|
36
|
+
static instanceCount(className: string): number;
|
|
37
|
+
static instanceCounts(): Record<BaseClassName, number>;
|
|
38
|
+
static startHistory(): void;
|
|
39
|
+
static stopHistory(): void;
|
|
40
|
+
private static addToHistory;
|
|
41
|
+
private static gcAll;
|
|
42
|
+
private static gcClass;
|
|
43
|
+
private recordInstance;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=Base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../src/Base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EAAE,MAAM,EAAE,cAAc,EACtC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAUjD,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,sCAAsC,CAAC,CAAA;AAEnF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,aAAa,CAAC,EAAE,cAAc,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,UAAU,CAAC,iBAAiB,SAAS,WAAW,GAAG,WAAW,IAAI,iBAAiB,GAAG,gBAAgB,CAAA;AAElH,8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AG,IAAI;IAWlC,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI/C,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC;IAOtD,MAAM,CAAC,YAAY,IAAI,IAAI;IAe3B,MAAM,CAAC,WAAW,IAAI,IAAI;IAO1B,OAAO,CAAC,MAAM,CAAC,YAAY;IAQ3B,OAAO,CAAC,MAAM,CAAC,KAAK;IAMpB,OAAO,CAAC,MAAM,CAAC,OAAO;IAKtB,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var xylabs: {
|
|
3
|
+
unique: Record<string, unknown>;
|
|
4
|
+
uniqueDisabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export declare const disableGloballyUnique: () => void;
|
|
8
|
+
export declare const globallyUnique: (name: string, value: unknown, domain?: string) => string;
|
|
9
|
+
//# sourceMappingURL=globallyUnique.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globallyUnique.d.ts","sourceRoot":"","sources":["../../src/globallyUnique.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,MAAM,EAAE;QACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC/B,cAAc,CAAC,EAAE,OAAO,CAAA;KACzB,CAAA;CACF;AAOD,eAAO,MAAM,qBAAqB,YAEjC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,OAAO,OAAO,EAAE,eAAiB,WAgB7E,CAAA"}
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,57 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type BaseClassName = Exclude<string, 'base-class-name-reserved-32546239486'>;
|
|
6
|
-
type BaseParamsFields = {
|
|
7
|
-
logger?: Logger;
|
|
8
|
-
meterProvider?: MeterProvider;
|
|
9
|
-
traceProvider?: TracerProvider;
|
|
10
|
-
};
|
|
11
|
-
type BaseParams<TAdditionalParams extends EmptyObject = EmptyObject> = TAdditionalParams & BaseParamsFields;
|
|
12
|
-
declare abstract class Base<TParams extends BaseParams = BaseParams> {
|
|
13
|
-
static defaultLogger?: Logger;
|
|
14
|
-
static readonly globalInstances: Record<BaseClassName, WeakRef<Base>[]>;
|
|
15
|
-
static readonly globalInstancesCountHistory: Record<BaseClassName, number[]>;
|
|
16
|
-
static readonly uniqueName: string;
|
|
17
|
-
private static _historyInterval;
|
|
18
|
-
private static _historyTime;
|
|
19
|
-
private static _historyTimeout?;
|
|
20
|
-
private static _lastGC;
|
|
21
|
-
private static _maxGcFrequency;
|
|
22
|
-
private _params;
|
|
23
|
-
constructor(params: BaseParams<TParams>);
|
|
24
|
-
static get historyInterval(): number;
|
|
25
|
-
static set historyInterval(value: number);
|
|
26
|
-
static get historyTime(): number;
|
|
27
|
-
static set historyTime(value: number);
|
|
28
|
-
static get maxGcFrequency(): number;
|
|
29
|
-
static set maxGcFrequency(value: number);
|
|
30
|
-
static get maxHistoryDepth(): number;
|
|
31
|
-
get logger(): Logger | undefined;
|
|
32
|
-
get meter(): Meter | undefined;
|
|
33
|
-
get params(): BaseParams<TParams>;
|
|
34
|
-
get tracer(): Tracer | undefined;
|
|
35
|
-
static gc(force?: boolean): void;
|
|
36
|
-
static gc(className: string): void;
|
|
37
|
-
static instanceCount(className: string): number;
|
|
38
|
-
static instanceCounts(): Record<BaseClassName, number>;
|
|
39
|
-
static startHistory(): void;
|
|
40
|
-
static stopHistory(): void;
|
|
41
|
-
private static addToHistory;
|
|
42
|
-
private static gcAll;
|
|
43
|
-
private static gcClass;
|
|
44
|
-
private recordInstance;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare global {
|
|
48
|
-
var xylabs: {
|
|
49
|
-
unique: Record<string, unknown>;
|
|
50
|
-
uniqueDisabled?: boolean;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
declare const disableGloballyUnique: () => void;
|
|
54
|
-
declare const globallyUnique: (name: string, value: unknown, domain?: string) => string;
|
|
55
|
-
|
|
56
|
-
export { Base, disableGloballyUnique, globallyUnique };
|
|
57
|
-
export type { BaseClassName, BaseParams, BaseParamsFields };
|
|
1
|
+
export * from './Base.ts';
|
|
2
|
+
export * from './globallyUnique.ts';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/base",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.16",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@opentelemetry/api": "^1.9.0",
|
|
33
|
-
"@xylabs/assert": "^4.13.
|
|
34
|
-
"@xylabs/logger": "^4.13.
|
|
35
|
-
"@xylabs/object": "^4.13.
|
|
33
|
+
"@xylabs/assert": "^4.13.16",
|
|
34
|
+
"@xylabs/logger": "^4.13.16",
|
|
35
|
+
"@xylabs/object": "^4.13.16"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.
|
|
39
|
-
"@xylabs/tsconfig": "^7.0.0-rc.
|
|
38
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
|
|
39
|
+
"@xylabs/tsconfig": "^7.0.0-rc.27",
|
|
40
40
|
"tslib": "^2.8.1",
|
|
41
41
|
"typescript": "^5.8.3"
|
|
42
42
|
},
|