@printwithsynergy/artwork-pdf 0.2.1

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 ADDED
@@ -0,0 +1,62 @@
1
+ artworkPDF — WYSIWYG label & packaging artwork editor
2
+ Copyright (C) 2024-2026 Think Neverland LLC
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public
15
+ License along with this program. If not, see
16
+ <https://www.gnu.org/licenses/>.
17
+
18
+ ---
19
+
20
+ GNU AFFERO GENERAL PUBLIC LICENSE
21
+ Version 3, 19 November 2007
22
+
23
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
24
+ Everyone is permitted to copy and distribute verbatim copies
25
+ of this license document, but changing it is not allowed.
26
+
27
+ Preamble
28
+
29
+ The GNU Affero General Public License is a free, copyleft license for
30
+ software and other kinds of works, specifically designed to ensure
31
+ cooperation with the community in the case of network server software.
32
+
33
+ The licenses for most software and other practical works are designed
34
+ to take away your freedom to share and change the works. By contrast,
35
+ our General Public Licenses are intended to guarantee your freedom to
36
+ share and change all versions of a program--to make sure it remains free
37
+ software for all its users.
38
+
39
+ When we speak of free software, we are referring to freedom, not
40
+ price. Our General Public Licenses are designed to make sure that you
41
+ have the freedom to distribute copies of free software (and charge for
42
+ them if you wish), to help you ensure that you receive source code or can
43
+ get it if you want it, to help you ensure that you can give other people
44
+ a copy of it, and let you know you can do these things.
45
+
46
+ Developers that use our General Public Licenses protect your rights
47
+ with two steps: (1) assert copyright on the software, and (2) offer
48
+ you this License which gives you legal permission to copy, distribute
49
+ and/or modify the software.
50
+
51
+ A secondary benefit of defending all users' freedom is that
52
+ improvements made in individual component, which are widely deployed on
53
+ network servers, become available to improve those servers too. Whether
54
+ this happens depends on what the server software does with the
55
+ modifications made in it. The GNU Affero General Public License
56
+ requires that modified source code be made available to the users.
57
+ In the case of a network server, this is relatively easy to achieve.
58
+
59
+ The precise terms and conditions for copying, distribution and
60
+ modification follow.
61
+
62
+ See <https://www.gnu.org/licenses/agpl-3.0.txt> for the full license text.
@@ -0,0 +1,23 @@
1
+ export type WorkflowStage = {
2
+ nodeType: string;
3
+ config?: Record<string, unknown>;
4
+ };
5
+ export type WorkflowSubmitRequest = {
6
+ stages: WorkflowStage[];
7
+ input: Record<string, unknown>;
8
+ };
9
+ export type WorkflowRun = {
10
+ id: string;
11
+ status: "queued" | "running" | "done" | "failed";
12
+ stages: Array<{
13
+ nodeType: string;
14
+ status: string;
15
+ }>;
16
+ };
17
+ export declare class SynergyClient {
18
+ #private;
19
+ constructor(baseUrl: string, apiKey: string);
20
+ submitWorkflow(req: WorkflowSubmitRequest): Promise<WorkflowRun>;
21
+ getWorkflow(id: string): Promise<WorkflowRun>;
22
+ }
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACjD,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD,CAAC;AAEF,qBAAa,aAAa;;gBAIZ,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAKrC,cAAc,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC;IAahE,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAOpD"}
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ export class SynergyClient {
3
+ #baseUrl;
4
+ #apiKey;
5
+ constructor(baseUrl, apiKey) {
6
+ this.#baseUrl = baseUrl;
7
+ this.#apiKey = apiKey;
8
+ }
9
+ async submitWorkflow(req) {
10
+ const res = await fetch(`${this.#baseUrl}/api/v1/workflows`, {
11
+ method: "POST",
12
+ headers: {
13
+ "Content-Type": "application/json",
14
+ "x-api-key": this.#apiKey,
15
+ },
16
+ body: JSON.stringify(req),
17
+ });
18
+ if (!res.ok)
19
+ throw new Error(`synergy error: ${res.status}`);
20
+ return res.json();
21
+ }
22
+ async getWorkflow(id) {
23
+ const res = await fetch(`${this.#baseUrl}/api/v1/workflows/${id}`, {
24
+ headers: { "x-api-key": this.#apiKey },
25
+ });
26
+ if (!res.ok)
27
+ throw new Error(`synergy error: ${res.status}`);
28
+ return res.json();
29
+ }
30
+ }
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAkB7C,MAAM,OAAO,aAAa;IACf,QAAQ,CAAS;IACjB,OAAO,CAAS;IAEzB,YAAY,OAAe,EAAE,MAAc;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,GAA0B;QAC7C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,QAAQ,mBAAmB,EAAE;YAC3D,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,WAAW,EAAE,IAAI,CAAC,OAAO;aAC1B;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;SAC1B,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7D,OAAO,GAAG,CAAC,IAAI,EAA0B,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAU;QAC1B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,QAAQ,qBAAqB,EAAE,EAAE,EAAE;YACjE,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE;SACvC,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7D,OAAO,GAAG,CAAC,IAAI,EAA0B,CAAC;IAC5C,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@printwithsynergy/artwork-pdf",
3
+ "version": "0.2.1",
4
+ "description": "Typed client for the artworkPDF synergy node",
5
+ "license": "AGPL-3.0-or-later",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.7.0",
19
+ "vitest": "^2.1.0"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "typecheck": "tsc --noEmit",
24
+ "test": "vitest run --passWithNoTests"
25
+ }
26
+ }
package/src/index.ts ADDED
@@ -0,0 +1,48 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+
3
+ export type WorkflowStage = {
4
+ nodeType: string;
5
+ config?: Record<string, unknown>;
6
+ };
7
+
8
+ export type WorkflowSubmitRequest = {
9
+ stages: WorkflowStage[];
10
+ input: Record<string, unknown>;
11
+ };
12
+
13
+ export type WorkflowRun = {
14
+ id: string;
15
+ status: "queued" | "running" | "done" | "failed";
16
+ stages: Array<{ nodeType: string; status: string }>;
17
+ };
18
+
19
+ export class SynergyClient {
20
+ readonly #baseUrl: string;
21
+ readonly #apiKey: string;
22
+
23
+ constructor(baseUrl: string, apiKey: string) {
24
+ this.#baseUrl = baseUrl;
25
+ this.#apiKey = apiKey;
26
+ }
27
+
28
+ async submitWorkflow(req: WorkflowSubmitRequest): Promise<WorkflowRun> {
29
+ const res = await fetch(`${this.#baseUrl}/api/v1/workflows`, {
30
+ method: "POST",
31
+ headers: {
32
+ "Content-Type": "application/json",
33
+ "x-api-key": this.#apiKey,
34
+ },
35
+ body: JSON.stringify(req),
36
+ });
37
+ if (!res.ok) throw new Error(`synergy error: ${res.status}`);
38
+ return res.json() as Promise<WorkflowRun>;
39
+ }
40
+
41
+ async getWorkflow(id: string): Promise<WorkflowRun> {
42
+ const res = await fetch(`${this.#baseUrl}/api/v1/workflows/${id}`, {
43
+ headers: { "x-api-key": this.#apiKey },
44
+ });
45
+ if (!res.ok) throw new Error(`synergy error: ${res.status}`);
46
+ return res.json() as Promise<WorkflowRun>;
47
+ }
48
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": { "outDir": "dist", "rootDir": "src" },
4
+ "include": ["src"]
5
+ }