@xyo-network/api-models 7.0.12 → 7.0.14

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 CHANGED
@@ -1,3 +1,49 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/api-models
2
4
 
3
- Deprecated compatibility stub. Use `@xyo-network/sdk-protocol/api-models` instead.
5
+ [![npm][npm-badge]][npm-link]
6
+ [![license][license-badge]][license-link]
7
+
8
+ > Primary SDK for using XYO Protocol 2.0
9
+
10
+ ## Install
11
+
12
+ Using npm:
13
+
14
+ ```sh
15
+ npm install {{name}}
16
+ ```
17
+
18
+ Using yarn:
19
+
20
+ ```sh
21
+ yarn add {{name}}
22
+ ```
23
+
24
+ Using pnpm:
25
+
26
+ ```sh
27
+ pnpm add {{name}}
28
+ ```
29
+
30
+ Using bun:
31
+
32
+ ```sh
33
+ bun add {{name}}
34
+ ```
35
+
36
+
37
+ ## License
38
+
39
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
+
41
+ ## Credits
42
+
43
+ [Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
44
+
45
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/api-models.svg
46
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/api-models
47
+ [license-badge]: https://img.shields.io/npm/l/@xyo-network/api-models.svg
48
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
49
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
@@ -0,0 +1,25 @@
1
+ import type { ApiReportable } from './Reportable.ts';
2
+ interface ApiConfig extends ApiReportable {
3
+ /** @description The domain where the API is located */
4
+ apiDomain: string;
5
+ /** @description The apiKey used for authentication */
6
+ apiKey?: string;
7
+ /** @description Threshold for Content-Size to cause automatic gzip of request body [default = 1024] */
8
+ compressionThreshold?: number;
9
+ /** @description The jwtToken of the currently logged in user */
10
+ jwtToken?: string;
11
+ /** @description The query string, if any, that is added to the end of every request */
12
+ query?: string;
13
+ /** @description Parent that should also report events from this API */
14
+ reportableParent?: ApiReportable;
15
+ /** @description The location in the API tree where this API object is mounted */
16
+ root?: string;
17
+ /** @description Throw on error */
18
+ throwError?: boolean;
19
+ /** @description Throw on failures */
20
+ throwFailure?: boolean;
21
+ /** @deprecated use the jwtToken instead */
22
+ userid?: string;
23
+ }
24
+ export type { ApiConfig };
25
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,UAAU,SAAU,SAAQ,aAAa;IACvC,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAA;IAEjB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,aAAa,CAAA;IAEhC,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,kCAAkC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB,qCAAqC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,YAAY,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { ApiError } from './Error.ts';
2
+ import type { ApiWarning } from './Warning.ts';
3
+ export interface ApiEnvelopeBase {
4
+ warning?: ApiWarning[];
5
+ }
6
+ export interface ApiEnvelopeSuccess<T> extends ApiEnvelopeBase {
7
+ data: T;
8
+ errors: never;
9
+ }
10
+ export interface ApiEnvelopeError extends ApiEnvelopeBase {
11
+ data: never;
12
+ errors: ApiError[];
13
+ }
14
+ export type ApiEnvelope<T> = ApiEnvelopeSuccess<T> | ApiEnvelopeError;
15
+ //# sourceMappingURL=Envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Envelope.d.ts","sourceRoot":"","sources":["../../src/Envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,CAAE,SAAQ,eAAe;IAC5D,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,KAAK,CAAA;CACd;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,IAAI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,QAAQ,EAAE,CAAA;CACnB;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { FetchClientError } from '@ariestools/sdk';
2
+ export interface ApiError<T = unknown> extends FetchClientError<T> {
3
+ isError: true;
4
+ }
5
+ //# sourceMappingURL=Error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IAChE,OAAO,EAAE,IAAI,CAAA;CACd"}
@@ -0,0 +1,8 @@
1
+ import type { ApiError } from './Error.ts';
2
+ import type { ApiResponse } from './Response.ts';
3
+ export interface ApiReportable {
4
+ onError?: (error: ApiError, depth: number) => void;
5
+ onFailure?: (response: ApiResponse, depth: number) => void;
6
+ onSuccess?: (response: ApiResponse, depth: number) => void;
7
+ }
8
+ //# sourceMappingURL=Reportable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reportable.d.ts","sourceRoot":"","sources":["../../src/Reportable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAElD,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAE1D,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3D"}
@@ -0,0 +1,8 @@
1
+ import type { FetchJsonResponse } from '@ariestools/sdk';
2
+ import type { ApiEnvelope } from './Envelope.ts';
3
+ export type ApiResponse<T = unknown> = FetchJsonResponse<T>;
4
+ export type ApiResponseBody<T> = T | undefined;
5
+ export type ApiResponseTuple<T> = [T | undefined, ApiEnvelope<T | undefined>, ApiResponse<ApiEnvelope<T | undefined>>];
6
+ export type ApiResponseTupleOrBody<T> = ApiResponseTuple<T> | ApiResponseBody<T>;
7
+ export type ApiResponseType = 'body' | 'tuple';
8
+ //# sourceMappingURL=Response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../src/Response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAA;AAE3D,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;AAE9C,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,EAAE,WAAW,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;AAEtH,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;AAEhF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAA"}
@@ -0,0 +1,2 @@
1
+ export type ApiWarning = Error;
2
+ //# sourceMappingURL=Warning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Warning.d.ts","sourceRoot":"","sources":["../../src/Warning.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA"}
@@ -1,6 +1,7 @@
1
- /**
2
- * @deprecated Use `@xyo-network/sdk-protocol/api-models` instead.
3
- * `@xyo-network/api-models` is a backward-compatibility re-export stub.
4
- */
5
- export * from '@xyo-network/sdk-protocol/api-models';
1
+ export * from './Config.ts';
2
+ export * from './Envelope.ts';
3
+ export * from './Error.ts';
4
+ export * from './Reportable.ts';
5
+ export * from './Response.ts';
6
+ export * from './Warning.ts';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,sCAAsC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA"}
@@ -1,3 +1 @@
1
- // src/index.ts
2
- export * from "@xyo-network/sdk-protocol/api-models";
3
1
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["/**\n * @deprecated Use `@xyo-network/sdk-protocol/api-models` instead.\n * `@xyo-network/api-models` is a backward-compatibility re-export stub.\n */\nexport * from '@xyo-network/sdk-protocol/api-models'\n"],
5
- "mappings": ";AAIA,cAAc;",
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@xyo-network/api-models",
3
- "version": "7.0.12",
4
- "description": "DEPRECATED - use @xyo-network/sdk-protocol/api-models. Backward-compatibility re-export stub for @xyo-network/api-models.",
5
- "deprecated": "Use @xyo-network/sdk-protocol/api-models instead. @xyo-network/api-models is a backward-compatibility re-export stub and will not receive further updates.",
3
+ "version": "7.0.14",
4
+ "description": "Primary SDK for using XYO Protocol 2.0",
6
5
  "homepage": "https://xyo.network",
7
6
  "bugs": {
8
7
  "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues",
@@ -34,35 +33,24 @@
34
33
  "!**/*.test.*",
35
34
  "README.md"
36
35
  ],
37
- "dependencies": {
38
- "@xyo-network/sdk-protocol": "~7.0.12"
39
- },
40
36
  "devDependencies": {
41
- "@xylabs/toolchain": "~8.5.15",
42
- "@xylabs/tsconfig": "~8.5.15",
43
- "browserslist": "4.28.4",
44
- "eslint": "^10.6.0",
45
- "eslint-import-resolver-typescript": "^4.4.5",
46
- "typescript": "~6.0.3"
37
+ "@ariestools/sdk": "~8.0.2",
38
+ "@opentelemetry/api": "~1.9.1",
39
+ "@opentelemetry/sdk-trace-base": "~2.9.0",
40
+ "@xylabs/toolchain": "~8.6.3",
41
+ "@xylabs/tsconfig": "~8.6.3",
42
+ "async-mutex": "~0.5.0",
43
+ "eslint": "~10.6.0",
44
+ "eslint-import-resolver-typescript": "~4.4.5",
45
+ "typescript": "~6.0.3",
46
+ "zod": "~4.4.3"
47
47
  },
48
48
  "peerDependencies": {
49
- "@ariestools/sdk": "^7.0.4",
50
- "@bitauth/libauth": "~3.0",
51
- "@noble/post-quantum": "~0.6.1",
52
- "@opentelemetry/api": "^1.9",
53
- "@opentelemetry/sdk-trace-base": "^2.7",
54
- "@scure/base": "~2.2",
55
- "@scure/bip39": "~2.2",
56
- "@xylabs/geo": "^7.0",
57
- "@xylabs/threads": "^7.0",
58
- "ajv": "^8.20",
59
- "async-mutex": "^0.5",
60
- "debug": "^4.4",
61
- "ethers": "^6.16",
62
- "hash-wasm": "~4.12",
63
- "idb": "^8.0",
64
- "observable-fns": "^0.6",
65
- "zod": "^4.4"
49
+ "@ariestools/sdk": "^8.0.2",
50
+ "@opentelemetry/api": "^1.9.1",
51
+ "@opentelemetry/sdk-trace-base": "^2.9.0",
52
+ "async-mutex": "^0.5.0",
53
+ "zod": "^4.4.3"
66
54
  },
67
55
  "engines": {
68
56
  "node": "^24"