@xyo-network/api-models 3.9.17 → 3.9.19

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.
@@ -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 { AxiosError } from 'axios';
2
+ export interface ApiError<T = any, D = any> extends AxiosError<T, D> {
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,UAAU,EAAE,MAAM,OAAO,CAAA;AAGvC,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAE,SAAQ,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,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 { AxiosResponse } from 'axios';
2
+ import type { ApiEnvelope } from './Envelope.ts';
3
+ export type ApiResponse<T = unknown, D = unknown> = AxiosResponse<T, D>;
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,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAEvE,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,47 +1,7 @@
1
- import { AxiosError, AxiosResponse } from 'axios';
2
-
3
- interface ApiError<T = any, D = any> extends AxiosError<T, D> {
4
- isError: true;
5
- }
6
-
7
- type ApiWarning = Error;
8
-
9
- interface ApiEnvelopeBase {
10
- warning?: ApiWarning[];
11
- }
12
- interface ApiEnvelopeSuccess<T> extends ApiEnvelopeBase {
13
- data: T;
14
- errors: never;
15
- }
16
- interface ApiEnvelopeError extends ApiEnvelopeBase {
17
- data: never;
18
- errors: ApiError[];
19
- }
20
- type ApiEnvelope<T> = ApiEnvelopeSuccess<T> | ApiEnvelopeError;
21
-
22
- type ApiResponse<T = unknown, D = unknown> = AxiosResponse<T, D>;
23
- type ApiResponseBody<T> = T | undefined;
24
- type ApiResponseTuple<T> = [T | undefined, ApiEnvelope<T | undefined>, ApiResponse<ApiEnvelope<T | undefined>>];
25
- type ApiResponseTupleOrBody<T> = ApiResponseTuple<T> | ApiResponseBody<T>;
26
- type ApiResponseType = 'body' | 'tuple';
27
-
28
- interface ApiReportable {
29
- onError?: (error: ApiError, depth: number) => void;
30
- onFailure?: (response: ApiResponse, depth: number) => void;
31
- onSuccess?: (response: ApiResponse, depth: number) => void;
32
- }
33
-
34
- interface ApiConfig extends ApiReportable {
35
- apiDomain: string;
36
- apiKey?: string;
37
- compressionThreshold?: number;
38
- jwtToken?: string;
39
- query?: string;
40
- reportableParent?: ApiReportable;
41
- root?: string;
42
- throwError?: boolean;
43
- throwFailure?: boolean;
44
- userid?: string;
45
- }
46
-
47
- export type { ApiConfig, ApiEnvelope, ApiEnvelopeBase, ApiEnvelopeError, ApiEnvelopeSuccess, ApiError, ApiReportable, ApiResponse, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType, ApiWarning };
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';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/api-models",
3
- "version": "3.9.17",
3
+ "version": "3.9.19",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,12 +29,12 @@
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "axios": "^1.7.9"
32
+ "axios": "^1.8.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@xylabs/ts-scripts-yarn3": "^5.0.24",
36
- "@xylabs/tsconfig": "^5.0.24",
37
- "typescript": "^5.7.3"
35
+ "@xylabs/ts-scripts-yarn3": "^5.0.39",
36
+ "@xylabs/tsconfig": "^5.0.39",
37
+ "typescript": "^5.8.2"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"