@x12i/files-ingest 0.1.0 → 0.1.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.
- package/LICENSE +21 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -5
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 x12i
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IngestArtifact, type IngestClient } from "@x12i/files-core";
|
|
2
2
|
export type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class X12iIngestClient implements IngestClient {
|
|
4
4
|
private readonly options;
|
|
5
5
|
private readonly fetchImpl;
|
|
6
6
|
constructor(options: {
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjF,qBAAa,gBAAiB,YAAW,YAAY;IAGvC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAET,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,SAAS,CAAA;KAAE;IAIrF,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAqCpD"}
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { idempotencyKey, PermanentFileError, RetryableSyncError, } from "@x12i/files-core";
|
|
2
|
-
|
|
2
|
+
import { isStoredIngestResponse } from "@x12i/consumer-contract";
|
|
3
|
+
export class X12iIngestClient {
|
|
3
4
|
options;
|
|
4
5
|
fetchImpl;
|
|
5
6
|
constructor(options) {
|
|
@@ -22,17 +23,27 @@ export class NowroxIngestClient {
|
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
catch (error) {
|
|
25
|
-
throw new RetryableSyncError(error instanceof Error ? error.message : "
|
|
26
|
+
throw new RetryableSyncError(error instanceof Error ? error.message : "X12i ingest network error");
|
|
26
27
|
}
|
|
27
28
|
if (response.status >= 200 && response.status < 300) {
|
|
28
|
-
await response.
|
|
29
|
+
const raw = await response.text();
|
|
30
|
+
let parsed;
|
|
31
|
+
try {
|
|
32
|
+
parsed = JSON.parse(raw);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
throw new RetryableSyncError("X12i ingest returned a malformed success");
|
|
36
|
+
}
|
|
37
|
+
if (!isStoredIngestResponse(parsed)) {
|
|
38
|
+
throw new RetryableSyncError("X12i ingest returned an unexpected success");
|
|
39
|
+
}
|
|
29
40
|
return;
|
|
30
41
|
}
|
|
31
42
|
await response.body?.cancel();
|
|
32
43
|
if (response.status === 401 || response.status === 429 || response.status >= 500) {
|
|
33
|
-
throw new RetryableSyncError(`
|
|
44
|
+
throw new RetryableSyncError(`X12i ingest failed with ${response.status}`, response.status);
|
|
34
45
|
}
|
|
35
|
-
throw new PermanentFileError("ingest_rejected", `
|
|
46
|
+
throw new PermanentFileError("ingest_rejected", `X12i ingest rejected the file with ${response.status}`);
|
|
36
47
|
}
|
|
37
48
|
}
|
|
38
49
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GAGnB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAA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YACpB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,IAAI,kBAAkB,CAAC,0CAA0C,CAAC,CAAC;YAC3E,CAAC;YACD,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpC,MAAM,IAAI,kBAAkB,CAAC,4CAA4C,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO;QACT,CAAC;QACD,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAC9B,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;YACjF,MAAM,IAAI,kBAAkB,CAAC,2BAA2B,QAAQ,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9F,CAAC;QACD,MAAM,IAAI,kBAAkB,CAAC,iBAAiB,EAAE,sCAAsC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3G,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { X12iIngestClient, type FetchLike } from "./client.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { X12iIngestClient } from "./client.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAkB,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/files-ingest",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -9,14 +9,12 @@
|
|
|
9
9
|
"import": "./dist/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "tsc -p tsconfig.json"
|
|
14
|
-
},
|
|
15
12
|
"dependencies": {
|
|
16
|
-
"@x12i/files-core": "
|
|
13
|
+
"@x12i/files-core": "0.1.1",
|
|
14
|
+
"@x12i/consumer-contract": "0.1.1"
|
|
17
15
|
},
|
|
18
16
|
"devDependencies": {
|
|
19
|
-
"@x12i/platform": "
|
|
17
|
+
"@x12i/platform": "0.1.1"
|
|
20
18
|
},
|
|
21
19
|
"files": [
|
|
22
20
|
"dist"
|
|
@@ -33,5 +31,8 @@
|
|
|
33
31
|
"url": "https://github.com/x12i/collaboration-connectors/issues"
|
|
34
32
|
},
|
|
35
33
|
"homepage": "https://github.com/x12i/collaboration-connectors#readme",
|
|
36
|
-
"license": "MIT"
|
|
37
|
-
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json"
|
|
37
|
+
}
|
|
38
|
+
}
|