@xyo-network/api-call-witness 3.1.2 → 3.2.0-rc.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.
@@ -1,5 +1,5 @@
1
1
  export declare const asApiCall: {
2
- <TType extends import("../index.ts").ApiCall>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
3
- <TType extends import("../index.ts").ApiCall>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("../index.ts").ApiCall>, config?: import("@xylabs/object").TypeCheckConfig): TType;
2
+ <TType extends import("../index.ts").ApiCall>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
3
+ <TType extends import("../index.ts").ApiCall>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("../index.ts").ApiCall>, config?: import("@xylabs/object").TypeCheckConfig): TType;
4
4
  };
5
5
  //# sourceMappingURL=asApiCall.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asApiCall.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCall.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;gEAC4E,qDAAiB,iCAAiC,gBAAoB;gEAA+E,qDAAiB,wHAAgG,gBAAoB;CADlU,CAAA"}
1
+ {"version":3,"file":"asApiCall.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCall.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;gEAC2E,sDAAiB,iCAAiC,gBAAoB;gEAA+E,sDAAiB,wHAAgG,gBAAoB;CADjU,CAAA"}
@@ -1,23 +1,20 @@
1
1
  export declare const asApiCallBase64Result: {
2
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
2
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
3
+ schema: "network.xyo.api.call.result";
3
4
  call: import("@xylabs/hex").Hash;
4
- contentType: Exclude<Exclude<string, import("../index.ts").ApiCallJsonResult["contentType"]>, import("../index.ts").ApiCallXmlResult["contentType"]>;
5
+ contentType: Exclude<Exclude<string, "application/json">, import("../index.ts").ApiCallXmlResult["contentType"]>;
5
6
  data: string;
6
- } & {
7
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
8
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
7
9
  schema: "network.xyo.api.call.result";
8
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
9
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
10
10
  call: import("@xylabs/hex").Hash;
11
- contentType: Exclude<Exclude<string, import("../index.ts").ApiCallJsonResult["contentType"]>, import("../index.ts").ApiCallXmlResult["contentType"]>;
11
+ contentType: Exclude<Exclude<string, "application/json">, import("../index.ts").ApiCallXmlResult["contentType"]>;
12
12
  data: string;
13
- } & {
13
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
14
14
  schema: "network.xyo.api.call.result";
15
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
16
15
  call: import("@xylabs/hex").Hash;
17
- contentType: Exclude<Exclude<string, import("../index.ts").ApiCallJsonResult["contentType"]>, import("../index.ts").ApiCallXmlResult["contentType"]>;
16
+ contentType: Exclude<Exclude<string, "application/json">, import("../index.ts").ApiCallXmlResult["contentType"]>;
18
17
  data: string;
19
- } & {
20
- schema: "network.xyo.api.call.result";
21
- }>, config?: import("@xylabs/object").TypeCheckConfig): TType;
18
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
22
19
  };
23
20
  //# sourceMappingURL=asApiCallBase64Result.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asApiCallBase64Result.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCallBase64Result.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;;;;;qBACgB,qDAAiB,iCAAiC,gBAAoB;;;;;;;qBAA+E,qDAAiB;;;;;;wBAAgG,gBAAoB;CAD1P,CAAA"}
1
+ {"version":3,"file":"asApiCallBase64Result.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCallBase64Result.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;;;;sBACe,sDAAiB,iCAAiC,gBAAoB;;;;;;sBAA+E,sDAAiB;;;;;yBAAgG,gBAAoB;CADzP,CAAA"}
@@ -1,5 +1,5 @@
1
1
  export declare const asApiCallResult: {
2
- <TType extends import("../index.ts").ApiCallResult>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
3
- <TType extends import("../index.ts").ApiCallResult>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("../index.ts").ApiCallResult>, config?: import("@xylabs/object").TypeCheckConfig): TType;
2
+ <TType extends import("../index.ts").ApiCallResult>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
3
+ <TType extends import("../index.ts").ApiCallResult>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("../index.ts").ApiCallResult>, config?: import("@xylabs/object").TypeCheckConfig): TType;
4
4
  };
5
5
  //# sourceMappingURL=asApiCallResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asApiCallResult.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCallResult.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;sEAC8C,qDAAiB,iCAAiC,gBAAoB;sEAA+E,qDAAiB,8HAAgG,gBAAoB;CAD9R,CAAA"}
1
+ {"version":3,"file":"asApiCallResult.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCallResult.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;sEAC6C,sDAAiB,iCAAiC,gBAAoB;sEAA+E,sDAAiB,8HAAgG,gBAAoB;CAD7R,CAAA"}
@@ -1,23 +1,20 @@
1
1
  export declare const asApiCallXmlResult: {
2
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
2
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
3
+ schema: "network.xyo.api.call.result";
3
4
  call: import("@xylabs/hex").Hash;
4
5
  contentType: "application/xml" | "text/xml";
5
6
  data: string;
6
- } & {
7
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
8
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
7
9
  schema: "network.xyo.api.call.result";
8
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
9
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
10
10
  call: import("@xylabs/hex").Hash;
11
11
  contentType: "application/xml" | "text/xml";
12
12
  data: string;
13
- } & {
13
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
14
14
  schema: "network.xyo.api.call.result";
15
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
16
15
  call: import("@xylabs/hex").Hash;
17
16
  contentType: "application/xml" | "text/xml";
18
17
  data: string;
19
- } & {
20
- schema: "network.xyo.api.call.result";
21
- }>, config?: import("@xylabs/object").TypeCheckConfig): TType;
18
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
22
19
  };
23
20
  //# sourceMappingURL=asApiCallXmlResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asApiCallXmlResult.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCallXmlResult.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;;qBAC+B,qDAAiB,iCAAiC,gBAAoB;;;;;;;qBAA+E,qDAAiB;;;;;;wBAAgG,gBAAoB;CAD5Q,CAAA"}
1
+ {"version":3,"file":"asApiCallXmlResult.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiCallXmlResult.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;sBAC8B,sDAAiB,iCAAiC,gBAAoB;;;;;;sBAA+E,sDAAiB;;;;;yBAAgG,gBAAoB;CAD3Q,CAAA"}
@@ -1,17 +1,35 @@
1
1
  export declare const asApiUriCall: {
2
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("../index.ts").ApiCallFields & {
3
- uri: string;
4
- } & {
2
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
5
3
  schema: "network.xyo.api.call";
6
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
7
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("../index.ts").ApiCallFields & {
4
+ headers?: {
5
+ [x: string]: string | undefined;
6
+ } | undefined;
7
+ queries?: {
8
+ [x: string]: string;
9
+ } | undefined;
10
+ verb?: import("../index.ts").Verb | undefined;
8
11
  uri: string;
9
- } & {
12
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
13
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
10
14
  schema: "network.xyo.api.call";
11
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("../index.ts").ApiCallFields & {
15
+ headers?: {
16
+ [x: string]: string | undefined;
17
+ } | undefined;
18
+ queries?: {
19
+ [x: string]: string;
20
+ } | undefined;
21
+ verb?: import("../index.ts").Verb | undefined;
12
22
  uri: string;
13
- } & {
23
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
14
24
  schema: "network.xyo.api.call";
15
- }>, config?: import("@xylabs/object").TypeCheckConfig): TType;
25
+ headers?: {
26
+ [x: string]: string | undefined;
27
+ } | undefined;
28
+ queries?: {
29
+ [x: string]: string;
30
+ } | undefined;
31
+ verb?: import("../index.ts").Verb | undefined;
32
+ uri: string;
33
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
16
34
  };
17
35
  //# sourceMappingURL=asApiUriCall.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asApiUriCall.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiUriCall.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;;;;qBAC6D,qDAAiB,iCAAiC,gBAAoB;;;;;qBAA+E,qDAAiB;;;;wBAAgG,gBAAoB;CADhT,CAAA"}
1
+ {"version":3,"file":"asApiUriCall.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiUriCall.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;;;;;;;;;;sBAC4D,sDAAiB,iCAAiC,gBAAoB;;;;;;;;;;;sBAA+E,sDAAiB;;;;;;;;;;yBAAgG,gBAAoB;CAD/S,CAAA"}
@@ -1,20 +1,44 @@
1
1
  export declare const asApiUriTemplateCall: {
2
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("../index.ts").ApiCallFields & {
3
- params?: Record<string, string>;
4
- uriTemplate?: string;
5
- } & {
2
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
6
3
  schema: "network.xyo.api.call";
7
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
8
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("../index.ts").ApiCallFields & {
9
- params?: Record<string, string>;
10
- uriTemplate?: string;
11
- } & {
4
+ headers?: {
5
+ [x: string]: string | undefined;
6
+ } | undefined;
7
+ queries?: {
8
+ [x: string]: string;
9
+ } | undefined;
10
+ verb?: import("../index.ts").Verb | undefined;
11
+ params?: {
12
+ [x: string]: string;
13
+ } | undefined;
14
+ uriTemplate?: string | undefined;
15
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
16
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
12
17
  schema: "network.xyo.api.call";
13
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("../index.ts").ApiCallFields & {
14
- params?: Record<string, string>;
15
- uriTemplate?: string;
16
- } & {
18
+ headers?: {
19
+ [x: string]: string | undefined;
20
+ } | undefined;
21
+ queries?: {
22
+ [x: string]: string;
23
+ } | undefined;
24
+ verb?: import("../index.ts").Verb | undefined;
25
+ params?: {
26
+ [x: string]: string;
27
+ } | undefined;
28
+ uriTemplate?: string | undefined;
29
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
17
30
  schema: "network.xyo.api.call";
18
- }>, config?: import("@xylabs/object").TypeCheckConfig): TType;
31
+ headers?: {
32
+ [x: string]: string | undefined;
33
+ } | undefined;
34
+ queries?: {
35
+ [x: string]: string;
36
+ } | undefined;
37
+ verb?: import("../index.ts").Verb | undefined;
38
+ params?: {
39
+ [x: string]: string;
40
+ } | undefined;
41
+ uriTemplate?: string | undefined;
42
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
19
43
  };
20
44
  //# sourceMappingURL=asApiUriTemplateCall.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asApiUriTemplateCall.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiUriTemplateCall.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;;;qBACqB,qDAAiB,iCAAiC,gBAAoB;;;;;;qBAA+E,qDAAiB;;;;;wBAAgG,gBAAoB;CADhQ,CAAA"}
1
+ {"version":3,"file":"asApiUriTemplateCall.d.ts","sourceRoot":"","sources":["../../../../src/Payload/identity/asApiUriTemplateCall.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;sBACoB,sDAAiB,iCAAiC,gBAAoB;;;;;;;;;;;;;;sBAA+E,sDAAiB;;;;;;;;;;;;;yBAAgG,gBAAoB;CAD/P,CAAA"}
@@ -10,25 +10,94 @@ export type ApiCallJsonResult<T extends ApiCallJsonResultType = ApiCallJsonResul
10
10
  }, ApiCallResultSchema>;
11
11
  export declare const isApiCallJsonResult: <T extends ApiCallJsonResultType = ApiCallJsonResultType>(x?: unknown | null) => x is ApiCallJsonResult<T>;
12
12
  export declare const asApiCallJsonResult: {
13
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
13
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
14
+ schema: "network.xyo.api.call.result";
14
15
  call: Hash;
15
16
  contentType: "application/json";
16
- data: ApiCallJsonResultType;
17
- } & {
17
+ data: (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
18
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
19
+ } | null)[] | {
20
+ [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
21
+ } | null)[] | {
22
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
23
+ } | null)[] | {
24
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
25
+ } | null)[] | {
26
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
27
+ } | null)[] | {
28
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
29
+ } | null)[] | {
30
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
31
+ } | null)[] | {
32
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
33
+ } | null)[] | {
34
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
35
+ } | null)[] | {
36
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
37
+ } | null)[] | {
38
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
39
+ } | null)[] | {
40
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
41
+ };
42
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
43
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
18
44
  schema: "network.xyo.api.call.result";
19
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
20
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
21
45
  call: Hash;
22
46
  contentType: "application/json";
23
- data: ApiCallJsonResultType;
24
- } & {
47
+ data: (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
48
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
49
+ } | null)[] | {
50
+ [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
51
+ } | null)[] | {
52
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
53
+ } | null)[] | {
54
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
55
+ } | null)[] | {
56
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
57
+ } | null)[] | {
58
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
59
+ } | null)[] | {
60
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
61
+ } | null)[] | {
62
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
63
+ } | null)[] | {
64
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
65
+ } | null)[] | {
66
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
67
+ } | null)[] | {
68
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
69
+ } | null)[] | {
70
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
71
+ };
72
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
25
73
  schema: "network.xyo.api.call.result";
26
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
27
74
  call: Hash;
28
75
  contentType: "application/json";
29
- data: ApiCallJsonResultType;
30
- } & {
31
- schema: "network.xyo.api.call.result";
32
- }>, config?: import("@xylabs/object").TypeCheckConfig): TType;
76
+ data: (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
77
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
78
+ } | null)[] | {
79
+ [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
80
+ } | null)[] | {
81
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
82
+ } | null)[] | {
83
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
84
+ } | null)[] | {
85
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
86
+ } | null)[] | {
87
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
88
+ } | null)[] | {
89
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
90
+ } | null)[] | {
91
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
92
+ } | null)[] | {
93
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
94
+ } | null)[] | {
95
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
96
+ } | null)[] | {
97
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
98
+ } | null)[] | {
99
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
100
+ };
101
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
33
102
  };
34
103
  //# sourceMappingURL=ApiCallJsonResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiCallJsonResult.d.ts","sourceRoot":"","sources":["../../../../src/Payload/types/ApiCallJsonResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAElD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,UAAU,CAAA;AAE1D,MAAM,MAAM,iBAAiB,CAAC,CAA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,eAAO,MAAM,mBAAmB;;;cAVtB,IAAI;qBACG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;sBATQ,sDAAiB,iCAEnC,gBAAoB;;;cAMnC,IAAI;qBACG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHvB,sDAAiB;;cAEnB,IAAI;qBACG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3B,gBAAoB;CASkD,CAAA"}
@@ -19,122 +19,296 @@ export type ApiUriTemplateCallWitnessConfig = WitnessConfig<ApiCallWitnessConfig
19
19
  export type ApiCallWitnessConfig = ApiUriCallWitnessConfig | ApiUriTemplateCallWitnessConfig | ApiCallWitnessConfigBase;
20
20
  export declare const isApiCallWitnessConfig: (x?: unknown | null) => x is ApiCallWitnessConfig;
21
21
  export declare const asApiCallWitnessConfig: {
22
- <TType extends ApiCallWitnessConfig>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
23
- <TType extends ApiCallWitnessConfig>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<ApiCallWitnessConfig>, config?: import("@xylabs/object").TypeCheckConfig): TType;
22
+ <TType extends ApiCallWitnessConfig>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
23
+ <TType extends ApiCallWitnessConfig>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<ApiCallWitnessConfig>, config?: import("@xylabs/object").TypeCheckConfig): TType;
24
24
  };
25
25
  export declare const isApiUriCallWitnessConfig: (value?: unknown) => value is ApiUriCallWitnessConfig;
26
26
  export declare const asApiUriCallWitnessConfig: {
27
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
27
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
28
28
  schema: "network.xyo.api.call.witness.config";
29
- } & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
30
- schema: "network.xyo.api.call.witness.config";
31
- } & {
32
- accept?: MimeTypes;
33
- headers?: Record<string, string | undefined>;
34
- queries?: ApiCall["queries"];
35
- schema: ApiCallWitnessConfigSchema;
36
- timeout?: number;
37
- verb?: ApiCall["verb"];
38
- }, "schema"> & {
39
- schema: "network.xyo.api.call.witness.config";
40
- } & {
29
+ headers?: {
30
+ [x: string]: string | undefined;
31
+ } | undefined;
32
+ queries?: {
33
+ [x: string]: string;
34
+ } | undefined;
35
+ verb?: import("../Payload/index.ts").Verb | undefined;
41
36
  uri: ApiUriCall["uri"];
42
- }, "schema"> & {
43
- schema: "network.xyo.api.call.witness.config";
44
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
45
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
46
- schema: "network.xyo.api.call.witness.config";
47
- } & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
48
- schema: "network.xyo.api.call.witness.config";
49
- } & {
50
- accept?: MimeTypes;
51
- headers?: Record<string, string | undefined>;
52
- queries?: ApiCall["queries"];
53
- schema: ApiCallWitnessConfigSchema;
54
- timeout?: number;
55
- verb?: ApiCall["verb"];
56
- }, "schema"> & {
37
+ readonly archiving?: {
38
+ readonly archivists?: string[] | undefined;
39
+ readonly queries?: string[] | undefined;
40
+ } | undefined;
41
+ readonly allowedQueries?: string[] | undefined;
42
+ readonly archivist?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleIdentifier | undefined;
43
+ readonly consoleLogger?: import(".store/@xylabs-logger-npm-4.4.24-da15b744dd/package").LogLevel | undefined;
44
+ readonly labels?: {
45
+ [x: string]: string | undefined;
46
+ } | undefined;
47
+ readonly name?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleName | undefined;
48
+ readonly paging?: {
49
+ [x: string]: {
50
+ size?: number | undefined;
51
+ };
52
+ } | undefined;
53
+ readonly retry?: {
54
+ backoff?: number | undefined;
55
+ interval?: number | undefined;
56
+ retries?: number | undefined;
57
+ } | undefined;
58
+ readonly security?: {
59
+ readonly allowAnonymous?: boolean | undefined;
60
+ readonly allowed?: {
61
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
62
+ } | undefined;
63
+ readonly disallowed?: {
64
+ [x: string]: Lowercase<string>[];
65
+ } | undefined;
66
+ } | undefined;
67
+ readonly sign?: boolean | undefined;
68
+ readonly storeQueries?: boolean | undefined;
69
+ readonly timestamp?: boolean | undefined;
70
+ accept?: MimeTypes | undefined;
71
+ timeout?: number | undefined;
72
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
73
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
57
74
  schema: "network.xyo.api.call.witness.config";
58
- } & {
75
+ headers?: {
76
+ [x: string]: string | undefined;
77
+ } | undefined;
78
+ queries?: {
79
+ [x: string]: string;
80
+ } | undefined;
81
+ verb?: import("../Payload/index.ts").Verb | undefined;
59
82
  uri: ApiUriCall["uri"];
60
- }, "schema"> & {
83
+ readonly archiving?: {
84
+ readonly archivists?: string[] | undefined;
85
+ readonly queries?: string[] | undefined;
86
+ } | undefined;
87
+ readonly allowedQueries?: string[] | undefined;
88
+ readonly archivist?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleIdentifier | undefined;
89
+ readonly consoleLogger?: import(".store/@xylabs-logger-npm-4.4.24-da15b744dd/package").LogLevel | undefined;
90
+ readonly labels?: {
91
+ [x: string]: string | undefined;
92
+ } | undefined;
93
+ readonly name?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleName | undefined;
94
+ readonly paging?: {
95
+ [x: string]: {
96
+ size?: number | undefined;
97
+ };
98
+ } | undefined;
99
+ readonly retry?: {
100
+ backoff?: number | undefined;
101
+ interval?: number | undefined;
102
+ retries?: number | undefined;
103
+ } | undefined;
104
+ readonly security?: {
105
+ readonly allowAnonymous?: boolean | undefined;
106
+ readonly allowed?: {
107
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
108
+ } | undefined;
109
+ readonly disallowed?: {
110
+ [x: string]: Lowercase<string>[];
111
+ } | undefined;
112
+ } | undefined;
113
+ readonly sign?: boolean | undefined;
114
+ readonly storeQueries?: boolean | undefined;
115
+ readonly timestamp?: boolean | undefined;
116
+ accept?: MimeTypes | undefined;
117
+ timeout?: number | undefined;
118
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
61
119
  schema: "network.xyo.api.call.witness.config";
62
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
63
- schema: "network.xyo.api.call.witness.config";
64
- } & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
65
- schema: "network.xyo.api.call.witness.config";
66
- } & {
67
- accept?: MimeTypes;
68
- headers?: Record<string, string | undefined>;
69
- queries?: ApiCall["queries"];
70
- schema: ApiCallWitnessConfigSchema;
71
- timeout?: number;
72
- verb?: ApiCall["verb"];
73
- }, "schema"> & {
74
- schema: "network.xyo.api.call.witness.config";
75
- } & {
120
+ headers?: {
121
+ [x: string]: string | undefined;
122
+ } | undefined;
123
+ queries?: {
124
+ [x: string]: string;
125
+ } | undefined;
126
+ verb?: import("../Payload/index.ts").Verb | undefined;
76
127
  uri: ApiUriCall["uri"];
77
- }, "schema"> & {
78
- schema: "network.xyo.api.call.witness.config";
79
- }>, config?: import("@xylabs/object").TypeCheckConfig): TType;
128
+ readonly archiving?: {
129
+ readonly archivists?: string[] | undefined;
130
+ readonly queries?: string[] | undefined;
131
+ } | undefined;
132
+ readonly allowedQueries?: string[] | undefined;
133
+ readonly archivist?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleIdentifier | undefined;
134
+ readonly consoleLogger?: import(".store/@xylabs-logger-npm-4.4.24-da15b744dd/package").LogLevel | undefined;
135
+ readonly labels?: {
136
+ [x: string]: string | undefined;
137
+ } | undefined;
138
+ readonly name?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleName | undefined;
139
+ readonly paging?: {
140
+ [x: string]: {
141
+ size?: number | undefined;
142
+ };
143
+ } | undefined;
144
+ readonly retry?: {
145
+ backoff?: number | undefined;
146
+ interval?: number | undefined;
147
+ retries?: number | undefined;
148
+ } | undefined;
149
+ readonly security?: {
150
+ readonly allowAnonymous?: boolean | undefined;
151
+ readonly allowed?: {
152
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
153
+ } | undefined;
154
+ readonly disallowed?: {
155
+ [x: string]: Lowercase<string>[];
156
+ } | undefined;
157
+ } | undefined;
158
+ readonly sign?: boolean | undefined;
159
+ readonly storeQueries?: boolean | undefined;
160
+ readonly timestamp?: boolean | undefined;
161
+ accept?: MimeTypes | undefined;
162
+ timeout?: number | undefined;
163
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
80
164
  };
81
165
  export declare const isApiUriTemplateCallWitnessConfig: (value?: unknown) => value is ApiUriTemplateCallWitnessConfig;
82
166
  export declare const asApiUriTemplateCallWitnessConfig: {
83
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
167
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
84
168
  schema: "network.xyo.api.call.witness.config";
85
- } & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
86
- schema: "network.xyo.api.call.witness.config";
87
- } & {
88
- accept?: MimeTypes;
89
- headers?: Record<string, string | undefined>;
90
- queries?: ApiCall["queries"];
91
- schema: ApiCallWitnessConfigSchema;
92
- timeout?: number;
93
- verb?: ApiCall["verb"];
94
- }, "schema"> & {
95
- schema: "network.xyo.api.call.witness.config";
96
- } & {
97
- params?: Record<string, string>;
169
+ headers?: {
170
+ [x: string]: string | undefined;
171
+ } | undefined;
172
+ queries?: {
173
+ [x: string]: string;
174
+ } | undefined;
175
+ verb?: import("../Payload/index.ts").Verb | undefined;
176
+ params?: {
177
+ [x: string]: string;
178
+ } | undefined;
98
179
  uriTemplate: ApiUriTemplateCall["uriTemplate"];
99
- }, "schema"> & {
100
- schema: "network.xyo.api.call.witness.config";
101
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
102
- <TType extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
103
- schema: "network.xyo.api.call.witness.config";
104
- } & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
105
- schema: "network.xyo.api.call.witness.config";
106
- } & {
107
- accept?: MimeTypes;
108
- headers?: Record<string, string | undefined>;
109
- queries?: ApiCall["queries"];
110
- schema: ApiCallWitnessConfigSchema;
111
- timeout?: number;
112
- verb?: ApiCall["verb"];
113
- }, "schema"> & {
180
+ readonly archiving?: {
181
+ readonly archivists?: string[] | undefined;
182
+ readonly queries?: string[] | undefined;
183
+ } | undefined;
184
+ readonly allowedQueries?: string[] | undefined;
185
+ readonly archivist?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleIdentifier | undefined;
186
+ readonly consoleLogger?: import(".store/@xylabs-logger-npm-4.4.24-da15b744dd/package").LogLevel | undefined;
187
+ readonly labels?: {
188
+ [x: string]: string | undefined;
189
+ } | undefined;
190
+ readonly name?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleName | undefined;
191
+ readonly paging?: {
192
+ [x: string]: {
193
+ size?: number | undefined;
194
+ };
195
+ } | undefined;
196
+ readonly retry?: {
197
+ backoff?: number | undefined;
198
+ interval?: number | undefined;
199
+ retries?: number | undefined;
200
+ } | undefined;
201
+ readonly security?: {
202
+ readonly allowAnonymous?: boolean | undefined;
203
+ readonly allowed?: {
204
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
205
+ } | undefined;
206
+ readonly disallowed?: {
207
+ [x: string]: Lowercase<string>[];
208
+ } | undefined;
209
+ } | undefined;
210
+ readonly sign?: boolean | undefined;
211
+ readonly storeQueries?: boolean | undefined;
212
+ readonly timestamp?: boolean | undefined;
213
+ accept?: MimeTypes | undefined;
214
+ timeout?: number | undefined;
215
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
216
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
114
217
  schema: "network.xyo.api.call.witness.config";
115
- } & {
116
- params?: Record<string, string>;
218
+ headers?: {
219
+ [x: string]: string | undefined;
220
+ } | undefined;
221
+ queries?: {
222
+ [x: string]: string;
223
+ } | undefined;
224
+ verb?: import("../Payload/index.ts").Verb | undefined;
225
+ params?: {
226
+ [x: string]: string;
227
+ } | undefined;
117
228
  uriTemplate: ApiUriTemplateCall["uriTemplate"];
118
- }, "schema"> & {
229
+ readonly archiving?: {
230
+ readonly archivists?: string[] | undefined;
231
+ readonly queries?: string[] | undefined;
232
+ } | undefined;
233
+ readonly allowedQueries?: string[] | undefined;
234
+ readonly archivist?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleIdentifier | undefined;
235
+ readonly consoleLogger?: import(".store/@xylabs-logger-npm-4.4.24-da15b744dd/package").LogLevel | undefined;
236
+ readonly labels?: {
237
+ [x: string]: string | undefined;
238
+ } | undefined;
239
+ readonly name?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleName | undefined;
240
+ readonly paging?: {
241
+ [x: string]: {
242
+ size?: number | undefined;
243
+ };
244
+ } | undefined;
245
+ readonly retry?: {
246
+ backoff?: number | undefined;
247
+ interval?: number | undefined;
248
+ retries?: number | undefined;
249
+ } | undefined;
250
+ readonly security?: {
251
+ readonly allowAnonymous?: boolean | undefined;
252
+ readonly allowed?: {
253
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
254
+ } | undefined;
255
+ readonly disallowed?: {
256
+ [x: string]: Lowercase<string>[];
257
+ } | undefined;
258
+ } | undefined;
259
+ readonly sign?: boolean | undefined;
260
+ readonly storeQueries?: boolean | undefined;
261
+ readonly timestamp?: boolean | undefined;
262
+ accept?: MimeTypes | undefined;
263
+ timeout?: number | undefined;
264
+ }>>(value: import(".store/@xylabs-promise-npm-4.4.24-9401eba71a/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
119
265
  schema: "network.xyo.api.call.witness.config";
120
- }>(value: import(".store/@xylabs-promise-npm-4.4.9-454de9ac63/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
121
- schema: "network.xyo.api.call.witness.config";
122
- } & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ArchivingModuleConfig & import(".store/@xyo-network-module-model-npm-3.5.1-1b7fa05ed7/package").ModuleConfigFields & {
123
- schema: "network.xyo.api.call.witness.config";
124
- } & {
125
- accept?: MimeTypes;
126
- headers?: Record<string, string | undefined>;
127
- queries?: ApiCall["queries"];
128
- schema: ApiCallWitnessConfigSchema;
129
- timeout?: number;
130
- verb?: ApiCall["verb"];
131
- }, "schema"> & {
132
- schema: "network.xyo.api.call.witness.config";
133
- } & {
134
- params?: Record<string, string>;
266
+ headers?: {
267
+ [x: string]: string | undefined;
268
+ } | undefined;
269
+ queries?: {
270
+ [x: string]: string;
271
+ } | undefined;
272
+ verb?: import("../Payload/index.ts").Verb | undefined;
273
+ params?: {
274
+ [x: string]: string;
275
+ } | undefined;
135
276
  uriTemplate: ApiUriTemplateCall["uriTemplate"];
136
- }, "schema"> & {
137
- schema: "network.xyo.api.call.witness.config";
138
- }>, config?: import("@xylabs/object").TypeCheckConfig): TType;
277
+ readonly archiving?: {
278
+ readonly archivists?: string[] | undefined;
279
+ readonly queries?: string[] | undefined;
280
+ } | undefined;
281
+ readonly allowedQueries?: string[] | undefined;
282
+ readonly archivist?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleIdentifier | undefined;
283
+ readonly consoleLogger?: import(".store/@xylabs-logger-npm-4.4.24-da15b744dd/package").LogLevel | undefined;
284
+ readonly labels?: {
285
+ [x: string]: string | undefined;
286
+ } | undefined;
287
+ readonly name?: import(".store/@xyo-network-module-model-npm-3.6.0-rc.11-3e8447a54c/package").ModuleName | undefined;
288
+ readonly paging?: {
289
+ [x: string]: {
290
+ size?: number | undefined;
291
+ };
292
+ } | undefined;
293
+ readonly retry?: {
294
+ backoff?: number | undefined;
295
+ interval?: number | undefined;
296
+ retries?: number | undefined;
297
+ } | undefined;
298
+ readonly security?: {
299
+ readonly allowAnonymous?: boolean | undefined;
300
+ readonly allowed?: {
301
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
302
+ } | undefined;
303
+ readonly disallowed?: {
304
+ [x: string]: Lowercase<string>[];
305
+ } | undefined;
306
+ } | undefined;
307
+ readonly sign?: boolean | undefined;
308
+ readonly storeQueries?: boolean | undefined;
309
+ readonly timestamp?: boolean | undefined;
310
+ accept?: MimeTypes | undefined;
311
+ timeout?: number | undefined;
312
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
139
313
  };
140
314
  //# sourceMappingURL=Config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/Witness/Config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EACV,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EACnD,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAExD,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC;IACnD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC5B,MAAM,EAAE,0BAA0B,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACvB,CAAC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,aAAa,CACjD,wBAAwB,GAAG;IACzB,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;CACvB,CACF,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,aAAa,CACzD,wBAAwB,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAA;CAC/C,CACF,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,GAAG,+BAA+B,GAAG,wBAAwB,CAAA;AAEvH,eAAO,MAAM,sBAAsB,mDAA0E,CA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,gBAAoB;;;;;;;;;;;;;qBAoBzB,kBAAkB,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAjBvC,SAAS;kBAIR,MAAM;sBAJV,sDACJ;;;;;;;;;;;;qBAgBa,kBAAkB,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAjBvC,SAAS;kBAIR,MAAM;yBADI,gBACjB;CA4BqG,CAAA"}
@@ -202,7 +202,7 @@ var ApiCallWitness = class extends AbstractWitness {
202
202
  const uri = this.getFullUri(call);
203
203
  const validatedUri = assertEx2(checkIpfsUrl(uri, this.ipfsGateway), () => "Invalid URI");
204
204
  if (verb === "get") {
205
- return this.httpGet(validatedUri, (await PayloadBuilder.build(call)).$hash);
205
+ return this.httpGet(validatedUri, await PayloadBuilder.dataHash(call));
206
206
  }
207
207
  const observation = {
208
208
  call: await PayloadHasher.hash(call),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Payload/identity/asApiCall.ts","../../src/Payload/identity/isApiCall.ts","../../src/Payload/Schema.ts","../../src/Payload/identity/asApiCallBase64Result.ts","../../src/Payload/identity/isApiCallBase64Result.ts","../../src/Payload/identity/asApiCallResult.ts","../../src/Payload/identity/isApiCallResult.ts","../../src/Payload/identity/asApiCallXmlResult.ts","../../src/Payload/identity/isApiCallXmlResult.ts","../../src/Payload/identity/asApiUriCall.ts","../../src/Payload/identity/isApiUriCall.ts","../../src/Payload/identity/asApiUriTemplateCall.ts","../../src/Payload/identity/isApiUriTemplateCall.ts","../../src/Payload/identity/isApiCallErrorResult.ts","../../src/Payload/types/ApiCallJsonResult.ts","../../src/Witness/Config.ts","../../src/Witness/Schema.ts","../../src/Witness/Witness.ts","../../src/lib/checkIpfsUrl.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCall } from './isApiCall.ts'\n\nexport const asApiCall = AsObjectFactory.create(isApiCall)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallSchema } from '../Schema.ts'\nimport type { ApiCall } from '../types/index.ts'\n\nexport const isApiCall = isPayloadOfSchemaType<ApiCall>(ApiCallSchema)\n","export const ApiCallSchema = 'network.xyo.api.call'\nexport type ApiCallSchema = typeof ApiCallSchema\n\nexport const ApiCallResultSchema = `${ApiCallSchema}.result`\nexport type ApiCallResultSchema = typeof ApiCallResultSchema\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCallBase64Result } from './isApiCallBase64Result.ts'\n\nexport const asApiCallBase64Result = AsObjectFactory.create(isApiCallBase64Result)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallBase64Result } from '../types/index.ts'\n\nexport const isApiCallBase64Result = (x?: unknown | null): x is ApiCallBase64Result => {\n return isPayloadOfSchemaType(ApiCallResultSchema)(x) && typeof (x as ApiCallBase64Result)?.data === 'string'\n}\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCallResult } from './isApiCallResult.ts'\n\nexport const asApiCallResult = AsObjectFactory.create(isApiCallResult)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallResult } from '../types/index.ts'\n\nexport const isApiCallResult = isPayloadOfSchemaType<ApiCallResult>(ApiCallResultSchema)\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCallXmlResult } from './isApiCallXmlResult.ts'\n\nexport const asApiCallXmlResult = AsObjectFactory.create(isApiCallXmlResult)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallXmlResult } from '../types/index.ts'\n\nexport const isApiCallXmlResult = (x?: unknown | null): x is ApiCallXmlResult => {\n return isPayloadOfSchemaType(ApiCallResultSchema)(x) && typeof (x as ApiCallXmlResult)?.data === 'string'\n}\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiUriCall } from './isApiUriCall.ts'\n\nexport const asApiUriCall = AsObjectFactory.create(isApiUriCall)\n","import type { ApiUriCall } from '../types/index.ts'\nimport { isApiCall } from './isApiCall.ts'\n\nexport const isApiUriCall = (value?: unknown): value is ApiUriCall => isApiCall(value) && !!(value as ApiUriCall).uri\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiUriTemplateCall } from './isApiUriTemplateCall.ts'\n\nexport const asApiUriTemplateCall = AsObjectFactory.create(isApiUriTemplateCall)\n","import type { ApiUriTemplateCall } from '../types/index.ts'\nimport { isApiCall } from './isApiCall.ts'\n\nexport const isApiUriTemplateCall = (value?: unknown): value is ApiUriTemplateCall =>\n isApiCall(value) && !!((value as ApiUriTemplateCall).uriTemplate || (value as ApiUriTemplateCall).params)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallErrorResult, ApiCallResult } from '../types/index.ts'\n\nexport const isApiCallErrorResult = (value: unknown): value is ApiCallErrorResult =>\n !!isPayloadOfSchemaType<ApiCallResult>(ApiCallResultSchema) && ((value as ApiCallErrorResult).http?.status ?? 200) >= 400\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonArray, JsonObject } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\n\nexport type ApiCallJsonResultType = JsonArray | JsonObject\n\nexport type ApiCallJsonResult<T extends ApiCallJsonResultType = ApiCallJsonResultType> = Payload<\n {\n call: Hash\n contentType: 'application/json'\n data: T\n },\n ApiCallResultSchema\n>\n\nexport const isApiCallJsonResult = <T extends ApiCallJsonResultType = ApiCallJsonResultType>(x?: unknown | null): x is ApiCallJsonResult<T> => {\n return isPayloadOfSchemaType(ApiCallResultSchema)(x) && (x as ApiCallJsonResult)?.contentType === 'application/json'\n}\nexport const asApiCallJsonResult = AsObjectFactory.create(isApiCallJsonResult)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nimport type {\n ApiCall, ApiUriCall, ApiUriTemplateCall, MimeTypes,\n} from '../Payload/index.ts'\nimport { ApiCallWitnessConfigSchema } from './Schema.ts'\n\nexport type ApiCallWitnessConfigBase = WitnessConfig<{\n accept?: MimeTypes\n headers?: Record<string, string | undefined>\n queries?: ApiCall['queries']\n schema: ApiCallWitnessConfigSchema\n timeout?: number\n verb?: ApiCall['verb']\n}>\n\nexport type ApiUriCallWitnessConfig = WitnessConfig<\n ApiCallWitnessConfigBase & {\n uri: ApiUriCall['uri']\n }\n>\n\nexport type ApiUriTemplateCallWitnessConfig = WitnessConfig<\n ApiCallWitnessConfigBase & {\n params?: Record<string, string>\n uriTemplate: ApiUriTemplateCall['uriTemplate']\n }\n>\n\nexport type ApiCallWitnessConfig = ApiUriCallWitnessConfig | ApiUriTemplateCallWitnessConfig | ApiCallWitnessConfigBase\n\nexport const isApiCallWitnessConfig = isPayloadOfSchemaType<ApiCallWitnessConfig>(ApiCallWitnessConfigSchema)\nexport const asApiCallWitnessConfig = AsObjectFactory.create(isApiCallWitnessConfig)\n\nexport const isApiUriCallWitnessConfig = (value?: unknown): value is ApiUriCallWitnessConfig =>\n isApiCallWitnessConfig(value) && !!(value as ApiUriCallWitnessConfig).uri\nexport const asApiUriCallWitnessConfig = AsObjectFactory.create(isApiUriCallWitnessConfig)\n\nexport const isApiUriTemplateCallWitnessConfig = (value?: unknown): value is ApiUriTemplateCallWitnessConfig =>\n isApiCallWitnessConfig(value) && !!(value as ApiUriTemplateCallWitnessConfig).uriTemplate\nexport const asApiUriTemplateCallWitnessConfig = AsObjectFactory.create(isApiUriTemplateCallWitnessConfig)\n","export const ApiCallWitnessConfigSchema = 'network.xyo.api.call.witness.config'\nexport type ApiCallWitnessConfigSchema = typeof ApiCallWitnessConfigSchema\n","/* eslint-disable max-statements */\nimport { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport type { Hash } from '@xylabs/hex'\nimport { URL } from '@xylabs/url'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { PayloadHasher } from '@xyo-network/hash'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Schema } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type { AxiosError } from 'axios'\nimport { Axios } from 'axios'\nimport { fromByteArray } from 'base64-js'\nimport fillTemplate from 'es6-dynamic-template'\n\nimport { checkIpfsUrl } from '../lib/index.ts'\nimport type {\n ApiCall,\n ApiCallBase64Result,\n ApiCallErrorResult,\n ApiCallJsonResult,\n ApiCallJsonResultType,\n ApiCallResult,\n ApiCallXmlResult,\n MimeTypes,\n} from '../Payload/index.ts'\nimport {\n ApiCallResultSchema,\n ApiCallSchema,\n asApiUriCall,\n asApiUriTemplateCall,\n} from '../Payload/index.ts'\nimport { asApiUriCallWitnessConfig, asApiUriTemplateCallWitnessConfig } from './Config.ts'\nimport type { ApiCallWitnessParams } from './Params.ts'\nimport { ApiCallWitnessConfigSchema } from './Schema.ts'\n\nexport class ApiCallWitness<TParams extends ApiCallWitnessParams = ApiCallWitnessParams> extends AbstractWitness<TParams, ApiCall, ApiCallResult> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiCallWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiCallWitnessConfigSchema\n\n get accept(): MimeTypes {\n return this.config.accept ?? 'application/json'\n }\n\n get ipfsGateway() {\n return this.params.ipfsGateway\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n getFullUri(call?: ApiCall): string {\n const { uri: callUri } = asApiUriCall(call) ?? {}\n const {\n uriTemplate: callUriTemplate, params: callParams, queries: callQueries,\n } = asApiUriTemplateCall(call) ?? {}\n const { uri: configUri } = asApiUriCallWitnessConfig(this.config) ?? {}\n const {\n uriTemplate: configUriTemplate, params: configParams, queries: configQueries,\n } = asApiUriTemplateCallWitnessConfig(this.config) ?? {}\n\n const params = { ...configParams, ...callParams }\n\n let url: URL | undefined = undefined\n\n if (callUri) {\n url = new URL(callUri)\n } else if (callUriTemplate) {\n url = new URL(fillTemplate(callUriTemplate, params))\n } else if (configUri) {\n url = new URL(configUri)\n } else if (configUriTemplate) {\n url = new URL(fillTemplate(configUriTemplate, params))\n }\n\n if (url) {\n const queries = Object.entries({ ...configQueries, ...callQueries })\n queries.map(([key, value]) => url?.searchParams.set(key, value))\n return url.href\n }\n\n throw new Error('Unable to determine uri. No uri/uriTemplate specified in either the call or config.')\n }\n\n getHeaders(headers?: Record<string, string | undefined>): Record<string, string | undefined> {\n return {\n ...this.params.headers, ...this.config.headers, ...headers,\n }\n }\n\n protected override async observeHandler(inPayloads: ApiCall[] = []): Promise<ApiCallResult[]> {\n await this.started('throw')\n try {\n const observations = await Promise.all(\n inPayloads.filter(isPayloadOfSchemaType(ApiCallSchema)).map(async (call) => {\n const { verb: callVerb } = call\n const { verb: configVerb } = this.config\n const verb = callVerb ?? configVerb ?? 'get'\n const uri = this.getFullUri(call)\n\n const validatedUri = assertEx(checkIpfsUrl(uri, this.ipfsGateway), () => 'Invalid URI')\n\n if (verb === 'get') {\n return this.httpGet(validatedUri, (await PayloadBuilder.build(call)).$hash)\n }\n\n const observation: ApiCallResult = {\n call: await PayloadHasher.hash(call),\n schema: ApiCallResultSchema,\n }\n return observation\n }),\n )\n return observations\n } catch (ex) {\n const error = ex as Error\n console.error(`Error [${this.config.name}]: ${error.message}`)\n console.log(error.stack)\n throw error\n }\n }\n\n // eslint-disable-next-line complexity\n private async httpGet(url: string, call: Hash, headers?: Record<string, string | undefined>): Promise<ApiCallResult> {\n const result: ApiCallResult = {\n call,\n schema: ApiCallResultSchema,\n }\n try {\n switch (this.accept) {\n case 'application/json': {\n const axios = new AxiosJson({ headers: { ...this.getHeaders(headers), Accept: 'application/json' }, timeout: this.timeout })\n const response = await axios.get<ApiCallJsonResultType>(url)\n if (response.status >= 200 && response.status < 300) {\n const jsonResult = result as ApiCallJsonResult\n jsonResult.data = response.data\n jsonResult.contentType = 'application/json'\n } else {\n const errorResult = result as ApiCallErrorResult\n errorResult.http = { status: response.status }\n }\n break\n }\n case 'application/xml':\n case 'text/xml': {\n const axios = new Axios({\n headers: { ...this.getHeaders(headers), Accept: this.accept },\n responseType: 'arraybuffer',\n timeout: this.timeout,\n })\n const response = await axios.get(url)\n if (response.status >= 200 && response.status < 300) {\n const xmlResult = result as ApiCallXmlResult\n xmlResult.data = Buffer.from(response.data, 'binary').toString('utf8')\n xmlResult.contentType = response.headers['content-type']?.toString() ?? 'application/xml'\n } else {\n const errorResult = result as ApiCallErrorResult\n errorResult.http = { status: response.status }\n }\n break\n }\n default: {\n const axios = new Axios({\n headers: this.params.headers, responseType: 'arraybuffer', timeout: this.timeout,\n })\n const response = await axios.get(url)\n if (response.status >= 200 && response.status < 300) {\n const jsonResult = result as ApiCallBase64Result\n jsonResult.data = fromByteArray(response.data)\n jsonResult.contentType = response.headers['content-type']?.toString() ?? 'application/octet-stream'\n } else {\n const errorResult = result as ApiCallErrorResult\n errorResult.http = { status: response.status }\n }\n break\n }\n }\n } catch (ex) {\n const axiosError = ex as AxiosError\n if (axiosError.isAxiosError) {\n if (axiosError?.response?.status !== undefined) {\n result.http = result.http ?? {}\n result.http.status = axiosError?.response?.status\n }\n if (axiosError?.code !== undefined) {\n result.http = result.http ?? {}\n result.http.code = axiosError?.code\n }\n return result\n } else {\n throw ex\n }\n }\n return result\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { URL } from '@xylabs/url'\n\nconst allowIpfsIoRepair = true\n\n/**\n * Returns the equivalent IPFS gateway URL for the supplied URL.\n * @param urlToCheck The URL to check\n * @returns If the supplied URL is an IPFS URL, it converts the URL to the\n * equivalent IPFS gateway URL. Otherwise, returns the original URL.\n */\nexport const checkIpfsUrl = (urlToCheck: string, ipfsGateway?: string): string => {\n try {\n const url = new URL(urlToCheck)\n let protocol = url.protocol\n let host = url.host\n let path = url.pathname\n const query = url.search\n if (protocol === 'ipfs:') {\n protocol = 'https:'\n host = assertEx(ipfsGateway, () => 'No ipfsGateway provided')\n path = url.host === 'ipfs' ? `ipfs${path}` : `ipfs/${url.host}${path}`\n const root = `${protocol}//${host}/${path}`\n return query?.length > 0 ? `${root}?${query}` : root\n } else if (allowIpfsIoRepair && protocol === 'https' && host === 'ipfs.io') {\n protocol = 'https:'\n host = assertEx(ipfsGateway, () => 'No ipfsGateway provided')\n const pathParts = path.split('/')\n if (pathParts[0] === 'ipfs') {\n pathParts.shift()\n }\n path = pathParts.join('/')\n const root = `${protocol}//${host}/${path}`\n return query?.length > 0 ? `${root}?${query}` : root\n } else {\n return urlToCheck\n }\n } catch {\n // const error = ex as Error\n // console.error(`${error.name}:${error.message} [${urlToCheck}]`)\n // console.log(error.stack)\n return urlToCheck\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;;;ACAhC,SAAS,6BAA6B;;;ACA/B,IAAM,gBAAgB;AAGtB,IAAM,sBAAsB,GAAG,aAAa;;;ADE5C,IAAM,YAAY,sBAA+B,aAAa;;;ADD9D,IAAM,YAAY,gBAAgB,OAAO,SAAS;;;AGJzD,SAAS,mBAAAA,wBAAuB;;;ACAhC,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,wBAAwB,CAAC,MAAiD;AACrF,SAAOC,uBAAsB,mBAAmB,EAAE,CAAC,KAAK,OAAQ,GAA2B,SAAS;AACtG;;;ADHO,IAAM,wBAAwBC,iBAAgB,OAAO,qBAAqB;;;AEJjF,SAAS,mBAAAC,wBAAuB;;;ACAhC,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,kBAAkBC,uBAAqC,mBAAmB;;;ADDhF,IAAM,kBAAkBC,iBAAgB,OAAO,eAAe;;;AEJrE,SAAS,mBAAAC,wBAAuB;;;ACAhC,SAAS,yBAAAC,8BAA6B;A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AC3E,OAAO;AACL,kBAAM,cAAc;AACpB,wBAAY,OAAO,EAAE,QAAQ,SAAS,OAAO;AAAA,UAC/C;AACA;AAAA,QACF;AAAA,MACF;AAAA,IACF,SAAS,IAAI;AACX,YAAM,aAAa;AACnB,UAAI,WAAW,cAAc;AAC3B,YAAI,YAAY,UAAU,WAAW,QAAW;AAC9C,iBAAO,OAAO,OAAO,QAAQ,CAAC;AAC9B,iBAAO,KAAK,SAAS,YAAY,UAAU;AAAA,QAC7C;AACA,YAAI,YAAY,SAAS,QAAW;AAClC,iBAAO,OAAO,OAAO,QAAQ,CAAC;AAC9B,iBAAO,KAAK,OAAO,YAAY;AAAA,QACjC;AACA,eAAO;AAAA,MACT,OAAO;AACL,cAAM;AAAA,MACR;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;","names":["AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","assertEx","URL","isPayloadOfSchemaType","URL","isPayloadOfSchemaType","assertEx"]}
1
+ {"version":3,"sources":["../../src/Payload/identity/asApiCall.ts","../../src/Payload/identity/isApiCall.ts","../../src/Payload/Schema.ts","../../src/Payload/identity/asApiCallBase64Result.ts","../../src/Payload/identity/isApiCallBase64Result.ts","../../src/Payload/identity/asApiCallResult.ts","../../src/Payload/identity/isApiCallResult.ts","../../src/Payload/identity/asApiCallXmlResult.ts","../../src/Payload/identity/isApiCallXmlResult.ts","../../src/Payload/identity/asApiUriCall.ts","../../src/Payload/identity/isApiUriCall.ts","../../src/Payload/identity/asApiUriTemplateCall.ts","../../src/Payload/identity/isApiUriTemplateCall.ts","../../src/Payload/identity/isApiCallErrorResult.ts","../../src/Payload/types/ApiCallJsonResult.ts","../../src/Witness/Config.ts","../../src/Witness/Schema.ts","../../src/Witness/Witness.ts","../../src/lib/checkIpfsUrl.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCall } from './isApiCall.ts'\n\nexport const asApiCall = AsObjectFactory.create(isApiCall)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallSchema } from '../Schema.ts'\nimport type { ApiCall } from '../types/index.ts'\n\nexport const isApiCall = isPayloadOfSchemaType<ApiCall>(ApiCallSchema)\n","export const ApiCallSchema = 'network.xyo.api.call'\nexport type ApiCallSchema = typeof ApiCallSchema\n\nexport const ApiCallResultSchema = `${ApiCallSchema}.result`\nexport type ApiCallResultSchema = typeof ApiCallResultSchema\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCallBase64Result } from './isApiCallBase64Result.ts'\n\nexport const asApiCallBase64Result = AsObjectFactory.create(isApiCallBase64Result)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallBase64Result } from '../types/index.ts'\n\nexport const isApiCallBase64Result = (x?: unknown | null): x is ApiCallBase64Result => {\n return isPayloadOfSchemaType(ApiCallResultSchema)(x) && typeof (x as ApiCallBase64Result)?.data === 'string'\n}\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCallResult } from './isApiCallResult.ts'\n\nexport const asApiCallResult = AsObjectFactory.create(isApiCallResult)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallResult } from '../types/index.ts'\n\nexport const isApiCallResult = isPayloadOfSchemaType<ApiCallResult>(ApiCallResultSchema)\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiCallXmlResult } from './isApiCallXmlResult.ts'\n\nexport const asApiCallXmlResult = AsObjectFactory.create(isApiCallXmlResult)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallXmlResult } from '../types/index.ts'\n\nexport const isApiCallXmlResult = (x?: unknown | null): x is ApiCallXmlResult => {\n return isPayloadOfSchemaType(ApiCallResultSchema)(x) && typeof (x as ApiCallXmlResult)?.data === 'string'\n}\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiUriCall } from './isApiUriCall.ts'\n\nexport const asApiUriCall = AsObjectFactory.create(isApiUriCall)\n","import type { ApiUriCall } from '../types/index.ts'\nimport { isApiCall } from './isApiCall.ts'\n\nexport const isApiUriCall = (value?: unknown): value is ApiUriCall => isApiCall(value) && !!(value as ApiUriCall).uri\n","import { AsObjectFactory } from '@xylabs/object'\n\nimport { isApiUriTemplateCall } from './isApiUriTemplateCall.ts'\n\nexport const asApiUriTemplateCall = AsObjectFactory.create(isApiUriTemplateCall)\n","import type { ApiUriTemplateCall } from '../types/index.ts'\nimport { isApiCall } from './isApiCall.ts'\n\nexport const isApiUriTemplateCall = (value?: unknown): value is ApiUriTemplateCall =>\n isApiCall(value) && !!((value as ApiUriTemplateCall).uriTemplate || (value as ApiUriTemplateCall).params)\n","import { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\nimport type { ApiCallErrorResult, ApiCallResult } from '../types/index.ts'\n\nexport const isApiCallErrorResult = (value: unknown): value is ApiCallErrorResult =>\n !!isPayloadOfSchemaType<ApiCallResult>(ApiCallResultSchema) && ((value as ApiCallErrorResult).http?.status ?? 200) >= 400\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonArray, JsonObject } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { ApiCallResultSchema } from '../Schema.ts'\n\nexport type ApiCallJsonResultType = JsonArray | JsonObject\n\nexport type ApiCallJsonResult<T extends ApiCallJsonResultType = ApiCallJsonResultType> = Payload<\n {\n call: Hash\n contentType: 'application/json'\n data: T\n },\n ApiCallResultSchema\n>\n\nexport const isApiCallJsonResult = <T extends ApiCallJsonResultType = ApiCallJsonResultType>(x?: unknown | null): x is ApiCallJsonResult<T> => {\n return isPayloadOfSchemaType(ApiCallResultSchema)(x) && (x as ApiCallJsonResult)?.contentType === 'application/json'\n}\nexport const asApiCallJsonResult = AsObjectFactory.create(isApiCallJsonResult)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nimport type {\n ApiCall, ApiUriCall, ApiUriTemplateCall, MimeTypes,\n} from '../Payload/index.ts'\nimport { ApiCallWitnessConfigSchema } from './Schema.ts'\n\nexport type ApiCallWitnessConfigBase = WitnessConfig<{\n accept?: MimeTypes\n headers?: Record<string, string | undefined>\n queries?: ApiCall['queries']\n schema: ApiCallWitnessConfigSchema\n timeout?: number\n verb?: ApiCall['verb']\n}>\n\nexport type ApiUriCallWitnessConfig = WitnessConfig<\n ApiCallWitnessConfigBase & {\n uri: ApiUriCall['uri']\n }\n>\n\nexport type ApiUriTemplateCallWitnessConfig = WitnessConfig<\n ApiCallWitnessConfigBase & {\n params?: Record<string, string>\n uriTemplate: ApiUriTemplateCall['uriTemplate']\n }\n>\n\nexport type ApiCallWitnessConfig = ApiUriCallWitnessConfig | ApiUriTemplateCallWitnessConfig | ApiCallWitnessConfigBase\n\nexport const isApiCallWitnessConfig = isPayloadOfSchemaType<ApiCallWitnessConfig>(ApiCallWitnessConfigSchema)\nexport const asApiCallWitnessConfig = AsObjectFactory.create(isApiCallWitnessConfig)\n\nexport const isApiUriCallWitnessConfig = (value?: unknown): value is ApiUriCallWitnessConfig =>\n isApiCallWitnessConfig(value) && !!(value as ApiUriCallWitnessConfig).uri\nexport const asApiUriCallWitnessConfig = AsObjectFactory.create(isApiUriCallWitnessConfig)\n\nexport const isApiUriTemplateCallWitnessConfig = (value?: unknown): value is ApiUriTemplateCallWitnessConfig =>\n isApiCallWitnessConfig(value) && !!(value as ApiUriTemplateCallWitnessConfig).uriTemplate\nexport const asApiUriTemplateCallWitnessConfig = AsObjectFactory.create(isApiUriTemplateCallWitnessConfig)\n","export const ApiCallWitnessConfigSchema = 'network.xyo.api.call.witness.config'\nexport type ApiCallWitnessConfigSchema = typeof ApiCallWitnessConfigSchema\n","/* eslint-disable max-statements */\nimport { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport type { Hash } from '@xylabs/hex'\nimport { URL } from '@xylabs/url'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { PayloadHasher } from '@xyo-network/hash'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Schema } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type { AxiosError } from 'axios'\nimport { Axios } from 'axios'\nimport { fromByteArray } from 'base64-js'\nimport fillTemplate from 'es6-dynamic-template'\n\nimport { checkIpfsUrl } from '../lib/index.ts'\nimport type {\n ApiCall,\n ApiCallBase64Result,\n ApiCallErrorResult,\n ApiCallJsonResult,\n ApiCallJsonResultType,\n ApiCallResult,\n ApiCallXmlResult,\n MimeTypes,\n} from '../Payload/index.ts'\nimport {\n ApiCallResultSchema,\n ApiCallSchema,\n asApiUriCall,\n asApiUriTemplateCall,\n} from '../Payload/index.ts'\nimport { asApiUriCallWitnessConfig, asApiUriTemplateCallWitnessConfig } from './Config.ts'\nimport type { ApiCallWitnessParams } from './Params.ts'\nimport { ApiCallWitnessConfigSchema } from './Schema.ts'\n\nexport class ApiCallWitness<TParams extends ApiCallWitnessParams = ApiCallWitnessParams> extends AbstractWitness<TParams, ApiCall, ApiCallResult> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ApiCallWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = ApiCallWitnessConfigSchema\n\n get accept(): MimeTypes {\n return this.config.accept ?? 'application/json'\n }\n\n get ipfsGateway() {\n return this.params.ipfsGateway\n }\n\n get timeout() {\n return this.config.timeout\n }\n\n getFullUri(call?: ApiCall): string {\n const { uri: callUri } = asApiUriCall(call) ?? {}\n const {\n uriTemplate: callUriTemplate, params: callParams, queries: callQueries,\n } = asApiUriTemplateCall(call) ?? {}\n const { uri: configUri } = asApiUriCallWitnessConfig(this.config) ?? {}\n const {\n uriTemplate: configUriTemplate, params: configParams, queries: configQueries,\n } = asApiUriTemplateCallWitnessConfig(this.config) ?? {}\n\n const params = { ...configParams, ...callParams }\n\n let url: URL | undefined = undefined\n\n if (callUri) {\n url = new URL(callUri)\n } else if (callUriTemplate) {\n url = new URL(fillTemplate(callUriTemplate, params))\n } else if (configUri) {\n url = new URL(configUri)\n } else if (configUriTemplate) {\n url = new URL(fillTemplate(configUriTemplate, params))\n }\n\n if (url) {\n const queries = Object.entries({ ...configQueries, ...callQueries })\n queries.map(([key, value]) => url?.searchParams.set(key, value))\n return url.href\n }\n\n throw new Error('Unable to determine uri. No uri/uriTemplate specified in either the call or config.')\n }\n\n getHeaders(headers?: Record<string, string | undefined>): Record<string, string | undefined> {\n return {\n ...this.params.headers, ...this.config.headers, ...headers,\n }\n }\n\n protected override async observeHandler(inPayloads: ApiCall[] = []): Promise<ApiCallResult[]> {\n await this.started('throw')\n try {\n const observations = await Promise.all(\n inPayloads.filter(isPayloadOfSchemaType(ApiCallSchema)).map(async (call) => {\n const { verb: callVerb } = call\n const { verb: configVerb } = this.config\n const verb = callVerb ?? configVerb ?? 'get'\n const uri = this.getFullUri(call)\n\n const validatedUri = assertEx(checkIpfsUrl(uri, this.ipfsGateway), () => 'Invalid URI')\n\n if (verb === 'get') {\n return this.httpGet(validatedUri, (await PayloadBuilder.dataHash(call)))\n }\n\n const observation: ApiCallResult = {\n call: await PayloadHasher.hash(call),\n schema: ApiCallResultSchema,\n }\n return observation\n }),\n )\n return observations\n } catch (ex) {\n const error = ex as Error\n console.error(`Error [${this.config.name}]: ${error.message}`)\n console.log(error.stack)\n throw error\n }\n }\n\n // eslint-disable-next-line complexity\n private async httpGet(url: string, call: Hash, headers?: Record<string, string | undefined>): Promise<ApiCallResult> {\n const result: ApiCallResult = {\n call,\n schema: ApiCallResultSchema,\n }\n try {\n switch (this.accept) {\n case 'application/json': {\n const axios = new AxiosJson({ headers: { ...this.getHeaders(headers), Accept: 'application/json' }, timeout: this.timeout })\n const response = await axios.get<ApiCallJsonResultType>(url)\n if (response.status >= 200 && response.status < 300) {\n const jsonResult = result as ApiCallJsonResult\n jsonResult.data = response.data\n jsonResult.contentType = 'application/json'\n } else {\n const errorResult = result as ApiCallErrorResult\n errorResult.http = { status: response.status }\n }\n break\n }\n case 'application/xml':\n case 'text/xml': {\n const axios = new Axios({\n headers: { ...this.getHeaders(headers), Accept: this.accept },\n responseType: 'arraybuffer',\n timeout: this.timeout,\n })\n const response = await axios.get(url)\n if (response.status >= 200 && response.status < 300) {\n const xmlResult = result as ApiCallXmlResult\n xmlResult.data = Buffer.from(response.data, 'binary').toString('utf8')\n xmlResult.contentType = response.headers['content-type']?.toString() ?? 'application/xml'\n } else {\n const errorResult = result as ApiCallErrorResult\n errorResult.http = { status: response.status }\n }\n break\n }\n default: {\n const axios = new Axios({\n headers: this.params.headers, responseType: 'arraybuffer', timeout: this.timeout,\n })\n const response = await axios.get(url)\n if (response.status >= 200 && response.status < 300) {\n const jsonResult = result as ApiCallBase64Result\n jsonResult.data = fromByteArray(response.data)\n jsonResult.contentType = response.headers['content-type']?.toString() ?? 'application/octet-stream'\n } else {\n const errorResult = result as ApiCallErrorResult\n errorResult.http = { status: response.status }\n }\n break\n }\n }\n } catch (ex) {\n const axiosError = ex as AxiosError\n if (axiosError.isAxiosError) {\n if (axiosError?.response?.status !== undefined) {\n result.http = result.http ?? {}\n result.http.status = axiosError?.response?.status\n }\n if (axiosError?.code !== undefined) {\n result.http = result.http ?? {}\n result.http.code = axiosError?.code\n }\n return result\n } else {\n throw ex\n }\n }\n return result\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { URL } from '@xylabs/url'\n\nconst allowIpfsIoRepair = true\n\n/**\n * Returns the equivalent IPFS gateway URL for the supplied URL.\n * @param urlToCheck The URL to check\n * @returns If the supplied URL is an IPFS URL, it converts the URL to the\n * equivalent IPFS gateway URL. Otherwise, returns the original URL.\n */\nexport const checkIpfsUrl = (urlToCheck: string, ipfsGateway?: string): string => {\n try {\n const url = new URL(urlToCheck)\n let protocol = url.protocol\n let host = url.host\n let path = url.pathname\n const query = url.search\n if (protocol === 'ipfs:') {\n protocol = 'https:'\n host = assertEx(ipfsGateway, () => 'No ipfsGateway provided')\n path = url.host === 'ipfs' ? `ipfs${path}` : `ipfs/${url.host}${path}`\n const root = `${protocol}//${host}/${path}`\n return query?.length > 0 ? `${root}?${query}` : root\n } else if (allowIpfsIoRepair && protocol === 'https' && host === 'ipfs.io') {\n protocol = 'https:'\n host = assertEx(ipfsGateway, () => 'No ipfsGateway provided')\n const pathParts = path.split('/')\n if (pathParts[0] === 'ipfs') {\n pathParts.shift()\n }\n path = pathParts.join('/')\n const root = `${protocol}//${host}/${path}`\n return query?.length > 0 ? `${root}?${query}` : root\n } else {\n return urlToCheck\n }\n } catch {\n // const error = ex as Error\n // console.error(`${error.name}:${error.message} [${urlToCheck}]`)\n // console.log(error.stack)\n return urlToCheck\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;;;ACAhC,SAAS,6BAA6B;;;ACA/B,IAAM,gBAAgB;AAGtB,IAAM,sBAAsB,GAAG,aAAa;;;ADE5C,IAAM,YAAY,sBAA+B,aAAa;;;ADD9D,IAAM,YAAY,gBAAgB,OAAO,SAAS;;;AGJzD,SAAS,mBAAAA,wBAAuB;;;ACAhC,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,wBAAwB,CAAC,MAAiD;AACrF,SAAOC,uBAAsB,mBAA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;AAAA,YACtB,SAAS,KAAK,OAAO;AAAA,YAAS,cAAc;AAAA,YAAe,SAAS,KAAK;AAAA,UAC3E,CAAC;AACD,gBAAM,WAAW,MAAM,MAAM,IAAI,GAAG;AACpC,cAAI,SAAS,UAAU,OAAO,SAAS,SAAS,KAAK;AACnD,kBAAM,aAAa;AACnB,uBAAW,OAAO,cAAc,SAAS,IAAI;AAC7C,uBAAW,cAAc,SAAS,QAAQ,cAAc,GAAG,SAAS,KAAK;AAAA,UAC3E,OAAO;AACL,kBAAM,cAAc;AACpB,wBAAY,OAAO,EAAE,QAAQ,SAAS,OAAO;AAAA,UAC/C;AACA;AAAA,QACF;AAAA,MACF;AAAA,IACF,SAAS,IAAI;AACX,YAAM,aAAa;AACnB,UAAI,WAAW,cAAc;AAC3B,YAAI,YAAY,UAAU,WAAW,QAAW;AAC9C,iBAAO,OAAO,OAAO,QAAQ,CAAC;AAC9B,iBAAO,KAAK,SAAS,YAAY,UAAU;AAAA,QAC7C;AACA,YAAI,YAAY,SAAS,QAAW;AAClC,iBAAO,OAAO,OAAO,QAAQ,CAAC;AAC9B,iBAAO,KAAK,OAAO,YAAY;AAAA,QACjC;AACA,eAAO;AAAA,MACT,OAAO;AACL,cAAM;AAAA,MACR;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;","names":["AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","assertEx","URL","isPayloadOfSchemaType","URL","isPayloadOfSchemaType","assertEx"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/api-call-witness",
3
- "version": "3.1.2",
3
+ "version": "3.2.0-rc.2",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,34 +29,35 @@
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.4.9",
33
- "@xylabs/axios": "^4.4.9",
34
- "@xylabs/hex": "^4.4.9",
35
- "@xylabs/object": "^4.4.9",
36
- "@xylabs/url": "^4.4.9",
37
- "@xyo-network/abstract-witness": "^3.5.1",
38
- "@xyo-network/hash": "^3.5.1",
39
- "@xyo-network/payload-builder": "^3.5.1",
40
- "@xyo-network/payload-model": "^3.5.1",
41
- "@xyo-network/witness-model": "^3.5.1",
42
- "axios": "^1.7.8",
32
+ "@xylabs/assert": "^4.4.24",
33
+ "@xylabs/axios": "^4.4.24",
34
+ "@xylabs/hex": "^4.4.24",
35
+ "@xylabs/object": "^4.4.24",
36
+ "@xylabs/url": "^4.4.24",
37
+ "@xyo-network/abstract-witness": "^3.6.0-rc.11",
38
+ "@xyo-network/hash": "^3.6.0-rc.11",
39
+ "@xyo-network/payload-builder": "^3.6.0-rc.11",
40
+ "@xyo-network/payload-model": "^3.6.0-rc.11",
41
+ "@xyo-network/witness-model": "^3.6.0-rc.11",
42
+ "axios": "^1.7.9",
43
43
  "base64-js": "^1.5.1",
44
44
  "es6-dynamic-template": "^2.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@xylabs/ts-scripts-yarn3": "^4.2.4",
48
- "@xylabs/tsconfig": "^4.2.4",
49
- "@xylabs/vitest-extended": "^4.4.9",
50
- "@xyo-network/account": "^3.5.1",
51
- "@xyo-network/manifest": "^3.5.1",
52
- "@xyo-network/module-factory-locator": "^3.5.1",
53
- "@xyo-network/module-model": "^3.5.1",
54
- "@xyo-network/sentinel-model": "^3.5.1",
47
+ "@xylabs/ts-scripts-yarn3": "^4.2.6",
48
+ "@xylabs/tsconfig": "^4.2.6",
49
+ "@xylabs/vitest-extended": "^4.4.24",
50
+ "@xyo-network/account": "^3.6.0-rc.11",
51
+ "@xyo-network/manifest": "^3.6.0-rc.11",
52
+ "@xyo-network/module-factory-locator": "^3.6.0-rc.11",
53
+ "@xyo-network/module-model": "^3.6.0-rc.11",
54
+ "@xyo-network/sentinel-model": "^3.6.0-rc.11",
55
55
  "ethers": "^6.13.4",
56
56
  "typescript": "^5.7.2",
57
- "vitest": "^2.1.6"
57
+ "vitest": "^2.1.8"
58
58
  },
59
59
  "publishConfig": {
60
60
  "access": "public"
61
- }
61
+ },
62
+ "stableVersion": "3.1.2"
62
63
  }
@@ -102,7 +102,7 @@ export class ApiCallWitness<TParams extends ApiCallWitnessParams = ApiCallWitnes
102
102
  const validatedUri = assertEx(checkIpfsUrl(uri, this.ipfsGateway), () => 'Invalid URI')
103
103
 
104
104
  if (verb === 'get') {
105
- return this.httpGet(validatedUri, (await PayloadBuilder.build(call)).$hash)
105
+ return this.httpGet(validatedUri, (await PayloadBuilder.dataHash(call)))
106
106
  }
107
107
 
108
108
  const observation: ApiCallResult = {