@geonosis/document 0.9.0 → 0.9.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/core/actor.cjs +48 -0
  3. package/dist/core/actor.d.cts +3 -0
  4. package/dist/core/actor.d.ts +3 -0
  5. package/dist/core/actor.js +8 -0
  6. package/dist/core/body-version.cjs +75 -0
  7. package/dist/core/body-version.d.cts +25 -0
  8. package/dist/core/body-version.d.ts +25 -0
  9. package/dist/core/body-version.js +35 -0
  10. package/dist/core/canonical.cjs +55 -0
  11. package/dist/core/canonical.d.cts +5 -0
  12. package/dist/core/canonical.d.ts +5 -0
  13. package/dist/core/canonical.js +15 -0
  14. package/dist/core/document.cjs +136 -0
  15. package/dist/core/document.d.cts +137 -0
  16. package/dist/core/document.d.ts +137 -0
  17. package/dist/core/document.js +96 -0
  18. package/dist/core/entities.cjs +68 -0
  19. package/dist/core/entities.d.cts +42 -0
  20. package/dist/core/entities.d.ts +42 -0
  21. package/dist/core/entities.js +28 -0
  22. package/dist/core/naming.cjs +56 -0
  23. package/dist/core/naming.d.cts +17 -0
  24. package/dist/core/naming.d.ts +17 -0
  25. package/dist/core/naming.js +16 -0
  26. package/dist/core/numbering.cjs +41 -0
  27. package/dist/core/numbering.d.cts +12 -0
  28. package/dist/core/numbering.d.ts +12 -0
  29. package/dist/core/numbering.js +0 -0
  30. package/dist/core/ports.cjs +41 -0
  31. package/dist/core/ports.d.cts +29 -0
  32. package/dist/core/ports.d.ts +29 -0
  33. package/dist/core/ports.js +0 -0
  34. package/dist/core/schema.cjs +173 -0
  35. package/dist/core/schema.d.cts +33 -0
  36. package/dist/core/schema.d.ts +33 -0
  37. package/dist/{chunk-NA3DLROL.js → core/schema.js} +34 -72
  38. package/dist/core/status.cjs +47 -0
  39. package/dist/core/status.d.cts +8 -0
  40. package/dist/core/status.d.ts +8 -0
  41. package/dist/core/status.js +7 -0
  42. package/dist/index.cjs +70 -398
  43. package/dist/index.d.cts +11 -32
  44. package/dist/index.d.ts +11 -32
  45. package/dist/index.js +13 -25
  46. package/dist/store/ddl.cjs +209 -0
  47. package/dist/store/ddl.d.cts +56 -0
  48. package/dist/store/ddl.d.ts +56 -0
  49. package/dist/store/ddl.js +175 -0
  50. package/dist/store/hash.cjs +50 -0
  51. package/dist/store/hash.d.cts +2 -0
  52. package/dist/store/hash.d.ts +2 -0
  53. package/dist/store/hash.js +10 -0
  54. package/dist/store/store.cjs +606 -0
  55. package/dist/store/store.d.cts +169 -0
  56. package/dist/store/store.d.ts +169 -0
  57. package/dist/store/store.js +578 -0
  58. package/dist/store.cjs +51 -1358
  59. package/dist/store.d.cts +4 -277
  60. package/dist/store.d.ts +4 -277
  61. package/dist/store.js +17 -1114
  62. package/dist/surface/table.cjs +326 -0
  63. package/dist/surface/table.d.cts +70 -0
  64. package/dist/surface/table.d.ts +70 -0
  65. package/dist/surface/table.js +296 -0
  66. package/dist/workflows/document-workflows.cjs +314 -0
  67. package/dist/workflows/document-workflows.d.cts +112 -0
  68. package/dist/workflows/document-workflows.d.ts +112 -0
  69. package/dist/workflows/document-workflows.js +281 -0
  70. package/dist/workflows/effects.cjs +41 -0
  71. package/dist/workflows/effects.d.cts +68 -0
  72. package/dist/workflows/effects.d.ts +68 -0
  73. package/dist/workflows/effects.js +0 -0
  74. package/dist/workflows/ports.cjs +50 -0
  75. package/dist/workflows/ports.d.cts +72 -0
  76. package/dist/workflows/ports.d.ts +72 -0
  77. package/dist/workflows/ports.js +10 -0
  78. package/dist/workflows/refusals.cjs +80 -0
  79. package/dist/workflows/refusals.d.cts +59 -0
  80. package/dist/workflows/refusals.d.ts +59 -0
  81. package/dist/workflows/refusals.js +40 -0
  82. package/dist/workflows.cjs +52 -504
  83. package/dist/workflows.d.cts +4 -310
  84. package/dist/workflows.d.ts +4 -310
  85. package/dist/workflows.js +21 -368
  86. package/package.json +8 -8
  87. package/dist/chunk-A6ZU4QU3.js +0 -171
  88. package/dist/entities-DTNJMeVf.d.cts +0 -205
  89. package/dist/entities-DTNJMeVf.d.ts +0 -205
  90. package/dist/ports-C_OfflMQ.d.cts +0 -66
  91. package/dist/ports-C_OfflMQ.d.ts +0 -66
@@ -0,0 +1,50 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ function __accessProp(key) {
6
+ return this[key];
7
+ }
8
+ var __toCommonJS = (from) => {
9
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
10
+ if (entry)
11
+ return entry;
12
+ entry = __defProp({}, "__esModule", { value: true });
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (var key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(entry, key))
16
+ __defProp(entry, key, {
17
+ get: __accessProp.bind(from, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ __moduleCache.set(from, entry);
22
+ return entry;
23
+ };
24
+ var __moduleCache;
25
+ var __returnValue = (v) => v;
26
+ function __exportSetter(name, newValue) {
27
+ this[name] = __returnValue.bind(null, newValue);
28
+ }
29
+ var __export = (target, all) => {
30
+ for (var name in all)
31
+ __defProp(target, name, {
32
+ get: all[name],
33
+ enumerable: true,
34
+ configurable: true,
35
+ set: __exportSetter.bind(all, name)
36
+ });
37
+ };
38
+
39
+ // src/workflows/ports.ts
40
+ var exports_ports = {};
41
+ __export(exports_ports, {
42
+ MAIL_UNDELIVERED_TAG: () => MAIL_UNDELIVERED_TAG,
43
+ MailUndelivered: () => MailUndelivered
44
+ });
45
+ module.exports = __toCommonJS(exports_ports);
46
+ var import_better_result = require("better-result");
47
+ var MAIL_UNDELIVERED_TAG = "DocumentMailUndelivered";
48
+
49
+ class MailUndelivered extends (/* @__PURE__ */ import_better_result.TaggedError(MAIL_UNDELIVERED_TAG)) {
50
+ }
@@ -0,0 +1,72 @@
1
+ import { type Result } from 'better-result';
2
+ export declare const MAIL_UNDELIVERED_TAG = "DocumentMailUndelivered";
3
+ declare const MailUndelivered_base: import("better-result").TaggedErrorClass<"DocumentMailUndelivered">;
4
+ /**
5
+ * What a mail port answers with when the message did not leave; the step it runs in fails on it.
6
+ * `TaggedError` is aliased the way observability aliases it: oxlint reads the bare call as an
7
+ * error thrown without `new`.
8
+ */
9
+ export declare class MailUndelivered extends /* @__PURE__ */ MailUndelivered_base<{
10
+ to: string;
11
+ cause: unknown;
12
+ }> {
13
+ }
14
+ /**
15
+ * One entity's rows, bound to the run's organisation by the host: `stepsOf` over a store door is
16
+ * the shape, so every call is a journalled step in a durable run. `body` is `never` on purpose —
17
+ * the factory writes what the entity decided and a door typed to one body still fits.
18
+ */
19
+ export type DocumentDoorPort = {
20
+ get: (params: {
21
+ ref: string;
22
+ }) => Promise<{
23
+ body: unknown;
24
+ } | null>;
25
+ commit: (params: {
26
+ actor: string;
27
+ body: never;
28
+ ref: string;
29
+ }) => Promise<unknown>;
30
+ retire: (params: {
31
+ actor: string;
32
+ ref: string;
33
+ }) => Promise<unknown>;
34
+ };
35
+ /**
36
+ * What a host answers the generic body with. Three are the host's alone — its doors, its links,
37
+ * its mail — and the rest default: `counter` is asked for only by an entity numbered from one,
38
+ * `actor` reads a string `actor` off the context or names the system, `guard` allows, `now` is
39
+ * the clock, and `seed` refuses a template. Plain functions — the factory makes the steps of the
40
+ * two that reach the outside world, so the durable-body law holds on every host.
41
+ */
42
+ export type DocumentWorkflowPorts<Ctx> = {
43
+ door: (ctx: Ctx, entity: string) => DocumentDoorPort;
44
+ link: (ctx: Ctx, link: {
45
+ entity: string;
46
+ ref: string;
47
+ now: number;
48
+ ttlDays?: number;
49
+ }) => Promise<{
50
+ token: string;
51
+ url: string;
52
+ expiresAt: number;
53
+ ttlDays: number;
54
+ }>;
55
+ mail: (ctx: Ctx, mail: {
56
+ to: string;
57
+ subject: string;
58
+ text: string;
59
+ }) => Promise<Result<void, MailUndelivered>>;
60
+ actor?: (ctx: Ctx, workflowName: string) => string;
61
+ counter?: (ctx: Ctx, key: string) => Promise<{
62
+ number: number;
63
+ }>;
64
+ guard?: (ctx: Ctx) => Promise<unknown>;
65
+ now?: () => string;
66
+ seed?: (ctx: Ctx, seeding: {
67
+ entity: string;
68
+ templateId: string | undefined;
69
+ input: Record<string, unknown>;
70
+ }) => Promise<Record<string, unknown>>;
71
+ };
72
+ export {};
@@ -0,0 +1,72 @@
1
+ import { type Result } from 'better-result';
2
+ export declare const MAIL_UNDELIVERED_TAG = "DocumentMailUndelivered";
3
+ declare const MailUndelivered_base: import("better-result").TaggedErrorClass<"DocumentMailUndelivered">;
4
+ /**
5
+ * What a mail port answers with when the message did not leave; the step it runs in fails on it.
6
+ * `TaggedError` is aliased the way observability aliases it: oxlint reads the bare call as an
7
+ * error thrown without `new`.
8
+ */
9
+ export declare class MailUndelivered extends /* @__PURE__ */ MailUndelivered_base<{
10
+ to: string;
11
+ cause: unknown;
12
+ }> {
13
+ }
14
+ /**
15
+ * One entity's rows, bound to the run's organisation by the host: `stepsOf` over a store door is
16
+ * the shape, so every call is a journalled step in a durable run. `body` is `never` on purpose —
17
+ * the factory writes what the entity decided and a door typed to one body still fits.
18
+ */
19
+ export type DocumentDoorPort = {
20
+ get: (params: {
21
+ ref: string;
22
+ }) => Promise<{
23
+ body: unknown;
24
+ } | null>;
25
+ commit: (params: {
26
+ actor: string;
27
+ body: never;
28
+ ref: string;
29
+ }) => Promise<unknown>;
30
+ retire: (params: {
31
+ actor: string;
32
+ ref: string;
33
+ }) => Promise<unknown>;
34
+ };
35
+ /**
36
+ * What a host answers the generic body with. Three are the host's alone — its doors, its links,
37
+ * its mail — and the rest default: `counter` is asked for only by an entity numbered from one,
38
+ * `actor` reads a string `actor` off the context or names the system, `guard` allows, `now` is
39
+ * the clock, and `seed` refuses a template. Plain functions — the factory makes the steps of the
40
+ * two that reach the outside world, so the durable-body law holds on every host.
41
+ */
42
+ export type DocumentWorkflowPorts<Ctx> = {
43
+ door: (ctx: Ctx, entity: string) => DocumentDoorPort;
44
+ link: (ctx: Ctx, link: {
45
+ entity: string;
46
+ ref: string;
47
+ now: number;
48
+ ttlDays?: number;
49
+ }) => Promise<{
50
+ token: string;
51
+ url: string;
52
+ expiresAt: number;
53
+ ttlDays: number;
54
+ }>;
55
+ mail: (ctx: Ctx, mail: {
56
+ to: string;
57
+ subject: string;
58
+ text: string;
59
+ }) => Promise<Result<void, MailUndelivered>>;
60
+ actor?: (ctx: Ctx, workflowName: string) => string;
61
+ counter?: (ctx: Ctx, key: string) => Promise<{
62
+ number: number;
63
+ }>;
64
+ guard?: (ctx: Ctx) => Promise<unknown>;
65
+ now?: () => string;
66
+ seed?: (ctx: Ctx, seeding: {
67
+ entity: string;
68
+ templateId: string | undefined;
69
+ input: Record<string, unknown>;
70
+ }) => Promise<Record<string, unknown>>;
71
+ };
72
+ export {};
@@ -0,0 +1,10 @@
1
+ // src/workflows/ports.ts
2
+ import { TaggedError as tagged } from "better-result";
3
+ var MAIL_UNDELIVERED_TAG = "DocumentMailUndelivered";
4
+
5
+ class MailUndelivered extends (/* @__PURE__ */ tagged(MAIL_UNDELIVERED_TAG)) {
6
+ }
7
+ export {
8
+ MAIL_UNDELIVERED_TAG,
9
+ MailUndelivered
10
+ };
@@ -0,0 +1,80 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ function __accessProp(key) {
6
+ return this[key];
7
+ }
8
+ var __toCommonJS = (from) => {
9
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
10
+ if (entry)
11
+ return entry;
12
+ entry = __defProp({}, "__esModule", { value: true });
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (var key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(entry, key))
16
+ __defProp(entry, key, {
17
+ get: __accessProp.bind(from, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ __moduleCache.set(from, entry);
22
+ return entry;
23
+ };
24
+ var __moduleCache;
25
+ var __returnValue = (v) => v;
26
+ function __exportSetter(name, newValue) {
27
+ this[name] = __returnValue.bind(null, newValue);
28
+ }
29
+ var __export = (target, all) => {
30
+ for (var name in all)
31
+ __defProp(target, name, {
32
+ get: all[name],
33
+ enumerable: true,
34
+ configurable: true,
35
+ set: __exportSetter.bind(all, name)
36
+ });
37
+ };
38
+
39
+ // src/workflows/refusals.ts
40
+ var exports_refusals = {};
41
+ __export(exports_refusals, {
42
+ CONVERSION_REFUSED_TAG: () => CONVERSION_REFUSED_TAG,
43
+ ConversionRefused: () => ConversionRefused,
44
+ DOCUMENT_NOT_FOUND_TAG: () => DOCUMENT_NOT_FOUND_TAG,
45
+ DOCUMENT_NOT_REMOVABLE_TAG: () => DOCUMENT_NOT_REMOVABLE_TAG,
46
+ DOCUMENT_TAKEN_TAG: () => DOCUMENT_TAKEN_TAG,
47
+ DocumentNotFound: () => DocumentNotFound,
48
+ DocumentNotRemovable: () => DocumentNotRemovable,
49
+ DocumentTaken: () => DocumentTaken,
50
+ NUMBERING_REFUSED_TAG: () => NUMBERING_REFUSED_TAG,
51
+ NumberingRefused: () => NumberingRefused,
52
+ TRANSITION_REFUSED_TAG: () => TRANSITION_REFUSED_TAG,
53
+ TransitionRefused: () => TransitionRefused
54
+ });
55
+ module.exports = __toCommonJS(exports_refusals);
56
+ var import_better_result = require("better-result");
57
+ var DOCUMENT_NOT_FOUND_TAG = "DocumentNotFound";
58
+ var DOCUMENT_TAKEN_TAG = "DocumentTaken";
59
+ var NUMBERING_REFUSED_TAG = "NumberingRefused";
60
+ var TRANSITION_REFUSED_TAG = "TransitionRefused";
61
+ var DOCUMENT_NOT_REMOVABLE_TAG = "DocumentNotRemovable";
62
+ var CONVERSION_REFUSED_TAG = "ConversionRefused";
63
+
64
+ class DocumentNotFound extends (/* @__PURE__ */ import_better_result.TaggedError(DOCUMENT_NOT_FOUND_TAG)) {
65
+ }
66
+
67
+ class DocumentTaken extends (/* @__PURE__ */ import_better_result.TaggedError(DOCUMENT_TAKEN_TAG)) {
68
+ }
69
+
70
+ class NumberingRefused extends (/* @__PURE__ */ import_better_result.TaggedError(NUMBERING_REFUSED_TAG)) {
71
+ }
72
+
73
+ class TransitionRefused extends (/* @__PURE__ */ import_better_result.TaggedError(TRANSITION_REFUSED_TAG)) {
74
+ }
75
+
76
+ class DocumentNotRemovable extends (/* @__PURE__ */ import_better_result.TaggedError(DOCUMENT_NOT_REMOVABLE_TAG)) {
77
+ }
78
+
79
+ class ConversionRefused extends (/* @__PURE__ */ import_better_result.TaggedError(CONVERSION_REFUSED_TAG)) {
80
+ }
@@ -0,0 +1,59 @@
1
+ export declare const DOCUMENT_NOT_FOUND_TAG = "DocumentNotFound";
2
+ export declare const DOCUMENT_TAKEN_TAG = "DocumentTaken";
3
+ export declare const NUMBERING_REFUSED_TAG = "NumberingRefused";
4
+ export declare const TRANSITION_REFUSED_TAG = "TransitionRefused";
5
+ export declare const DOCUMENT_NOT_REMOVABLE_TAG = "DocumentNotRemovable";
6
+ export declare const CONVERSION_REFUSED_TAG = "ConversionRefused";
7
+ declare const DocumentNotFound_base: import("better-result").TaggedErrorClass<"DocumentNotFound">;
8
+ /**
9
+ * What a document workflow refuses, named. The engine wraps whatever a body throws in its own
10
+ * `RunFailedError` with the refusal as `cause`, so a host reads the name off the cause and answers
11
+ * with it — 404 for a document that is not there, 409 for a ref that is taken or a move the machine
12
+ * refuses, 400 for a numbering it cannot honour — instead of a 500 with the sentence inside it.
13
+ * Aliased the way `MailUndelivered` is: oxlint reads the bare call as an error thrown without `new`.
14
+ */
15
+ export declare class DocumentNotFound extends /* @__PURE__ */ DocumentNotFound_base<{
16
+ entity: string;
17
+ message: string;
18
+ ref: string;
19
+ }> {
20
+ }
21
+ declare const DocumentTaken_base: import("better-result").TaggedErrorClass<"DocumentTaken">;
22
+ export declare class DocumentTaken extends /* @__PURE__ */ DocumentTaken_base<{
23
+ entity: string;
24
+ message: string;
25
+ ref: string;
26
+ }> {
27
+ }
28
+ declare const NumberingRefused_base: import("better-result").TaggedErrorClass<"NumberingRefused">;
29
+ /** `given` — a number the caller had to supply and did not; `counter` — one the caller supplied to an entity that mints its own, or the host declares no counter. */
30
+ export declare class NumberingRefused extends /* @__PURE__ */ NumberingRefused_base<{
31
+ entity: string;
32
+ message: string;
33
+ mode: 'counter' | 'given';
34
+ }> {
35
+ }
36
+ declare const TransitionRefused_base: import("better-result").TaggedErrorClass<"TransitionRefused">;
37
+ export declare class TransitionRefused extends /* @__PURE__ */ TransitionRefused_base<{
38
+ entity: string;
39
+ from: string;
40
+ message: string;
41
+ ref: string;
42
+ to: string;
43
+ }> {
44
+ }
45
+ declare const DocumentNotRemovable_base: import("better-result").TaggedErrorClass<"DocumentNotRemovable">;
46
+ export declare class DocumentNotRemovable extends /* @__PURE__ */ DocumentNotRemovable_base<{
47
+ entity: string;
48
+ message: string;
49
+ }> {
50
+ }
51
+ declare const ConversionRefused_base: import("better-result").TaggedErrorClass<"ConversionRefused">;
52
+ export declare class ConversionRefused extends /* @__PURE__ */ ConversionRefused_base<{
53
+ entity: string;
54
+ message: string;
55
+ ref: string;
56
+ }> {
57
+ }
58
+ export type DocumentRefusal = ConversionRefused | DocumentNotFound | DocumentNotRemovable | DocumentTaken | NumberingRefused | TransitionRefused;
59
+ export {};
@@ -0,0 +1,59 @@
1
+ export declare const DOCUMENT_NOT_FOUND_TAG = "DocumentNotFound";
2
+ export declare const DOCUMENT_TAKEN_TAG = "DocumentTaken";
3
+ export declare const NUMBERING_REFUSED_TAG = "NumberingRefused";
4
+ export declare const TRANSITION_REFUSED_TAG = "TransitionRefused";
5
+ export declare const DOCUMENT_NOT_REMOVABLE_TAG = "DocumentNotRemovable";
6
+ export declare const CONVERSION_REFUSED_TAG = "ConversionRefused";
7
+ declare const DocumentNotFound_base: import("better-result").TaggedErrorClass<"DocumentNotFound">;
8
+ /**
9
+ * What a document workflow refuses, named. The engine wraps whatever a body throws in its own
10
+ * `RunFailedError` with the refusal as `cause`, so a host reads the name off the cause and answers
11
+ * with it — 404 for a document that is not there, 409 for a ref that is taken or a move the machine
12
+ * refuses, 400 for a numbering it cannot honour — instead of a 500 with the sentence inside it.
13
+ * Aliased the way `MailUndelivered` is: oxlint reads the bare call as an error thrown without `new`.
14
+ */
15
+ export declare class DocumentNotFound extends /* @__PURE__ */ DocumentNotFound_base<{
16
+ entity: string;
17
+ message: string;
18
+ ref: string;
19
+ }> {
20
+ }
21
+ declare const DocumentTaken_base: import("better-result").TaggedErrorClass<"DocumentTaken">;
22
+ export declare class DocumentTaken extends /* @__PURE__ */ DocumentTaken_base<{
23
+ entity: string;
24
+ message: string;
25
+ ref: string;
26
+ }> {
27
+ }
28
+ declare const NumberingRefused_base: import("better-result").TaggedErrorClass<"NumberingRefused">;
29
+ /** `given` — a number the caller had to supply and did not; `counter` — one the caller supplied to an entity that mints its own, or the host declares no counter. */
30
+ export declare class NumberingRefused extends /* @__PURE__ */ NumberingRefused_base<{
31
+ entity: string;
32
+ message: string;
33
+ mode: 'counter' | 'given';
34
+ }> {
35
+ }
36
+ declare const TransitionRefused_base: import("better-result").TaggedErrorClass<"TransitionRefused">;
37
+ export declare class TransitionRefused extends /* @__PURE__ */ TransitionRefused_base<{
38
+ entity: string;
39
+ from: string;
40
+ message: string;
41
+ ref: string;
42
+ to: string;
43
+ }> {
44
+ }
45
+ declare const DocumentNotRemovable_base: import("better-result").TaggedErrorClass<"DocumentNotRemovable">;
46
+ export declare class DocumentNotRemovable extends /* @__PURE__ */ DocumentNotRemovable_base<{
47
+ entity: string;
48
+ message: string;
49
+ }> {
50
+ }
51
+ declare const ConversionRefused_base: import("better-result").TaggedErrorClass<"ConversionRefused">;
52
+ export declare class ConversionRefused extends /* @__PURE__ */ ConversionRefused_base<{
53
+ entity: string;
54
+ message: string;
55
+ ref: string;
56
+ }> {
57
+ }
58
+ export type DocumentRefusal = ConversionRefused | DocumentNotFound | DocumentNotRemovable | DocumentTaken | NumberingRefused | TransitionRefused;
59
+ export {};
@@ -0,0 +1,40 @@
1
+ // src/workflows/refusals.ts
2
+ import { TaggedError as tagged } from "better-result";
3
+ var DOCUMENT_NOT_FOUND_TAG = "DocumentNotFound";
4
+ var DOCUMENT_TAKEN_TAG = "DocumentTaken";
5
+ var NUMBERING_REFUSED_TAG = "NumberingRefused";
6
+ var TRANSITION_REFUSED_TAG = "TransitionRefused";
7
+ var DOCUMENT_NOT_REMOVABLE_TAG = "DocumentNotRemovable";
8
+ var CONVERSION_REFUSED_TAG = "ConversionRefused";
9
+
10
+ class DocumentNotFound extends (/* @__PURE__ */ tagged(DOCUMENT_NOT_FOUND_TAG)) {
11
+ }
12
+
13
+ class DocumentTaken extends (/* @__PURE__ */ tagged(DOCUMENT_TAKEN_TAG)) {
14
+ }
15
+
16
+ class NumberingRefused extends (/* @__PURE__ */ tagged(NUMBERING_REFUSED_TAG)) {
17
+ }
18
+
19
+ class TransitionRefused extends (/* @__PURE__ */ tagged(TRANSITION_REFUSED_TAG)) {
20
+ }
21
+
22
+ class DocumentNotRemovable extends (/* @__PURE__ */ tagged(DOCUMENT_NOT_REMOVABLE_TAG)) {
23
+ }
24
+
25
+ class ConversionRefused extends (/* @__PURE__ */ tagged(CONVERSION_REFUSED_TAG)) {
26
+ }
27
+ export {
28
+ CONVERSION_REFUSED_TAG,
29
+ ConversionRefused,
30
+ DOCUMENT_NOT_FOUND_TAG,
31
+ DOCUMENT_NOT_REMOVABLE_TAG,
32
+ DOCUMENT_TAKEN_TAG,
33
+ DocumentNotFound,
34
+ DocumentNotRemovable,
35
+ DocumentTaken,
36
+ NUMBERING_REFUSED_TAG,
37
+ NumberingRefused,
38
+ TRANSITION_REFUSED_TAG,
39
+ TransitionRefused
40
+ };