pipework 0.54.0 → 0.55.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/CHANGELOG.md +10 -0
- package/REFERENCE.md +65 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +11 -0
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/core/config/namespace.d.ts +1 -0
- package/dist/core/config/namespace.d.ts.map +1 -1
- package/dist/core/config/schema.d.ts +3 -0
- package/dist/core/config/schema.d.ts.map +1 -1
- package/dist/core/config/schema.js +2 -0
- package/dist/core/config/schema.js.map +1 -1
- package/dist/data/migrate/internal-definitions.d.ts.map +1 -1
- package/dist/data/migrate/internal-definitions.js +6 -0
- package/dist/data/migrate/internal-definitions.js.map +1 -1
- package/dist/data/migrate/provision-framework.d.ts +22 -3
- package/dist/data/migrate/provision-framework.d.ts.map +1 -1
- package/dist/data/migrate/provision-framework.js +69 -14
- package/dist/data/migrate/provision-framework.js.map +1 -1
- package/dist/data/migrate/run.d.ts +3 -0
- package/dist/data/migrate/run.d.ts.map +1 -1
- package/dist/data/migrate/run.js +13 -0
- package/dist/data/migrate/run.js.map +1 -1
- package/dist/data/valve/schema/valve-crossing-fields.d.ts +1 -1
- package/dist/data/valve/schema/valve-crossing.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/infra/access-links/code.d.ts +20 -0
- package/dist/infra/access-links/code.d.ts.map +1 -0
- package/dist/infra/access-links/code.js +47 -0
- package/dist/infra/access-links/code.js.map +1 -0
- package/dist/infra/access-links/handle.d.ts +127 -0
- package/dist/infra/access-links/handle.d.ts.map +1 -0
- package/dist/infra/access-links/handle.js +413 -0
- package/dist/infra/access-links/handle.js.map +1 -0
- package/dist/infra/access-links/index.d.ts +5 -0
- package/dist/infra/access-links/index.d.ts.map +1 -0
- package/dist/infra/access-links/index.js +2 -0
- package/dist/infra/access-links/index.js.map +1 -0
- package/dist/infra/access-links/namespace.d.ts +7 -0
- package/dist/infra/access-links/namespace.d.ts.map +1 -0
- package/dist/infra/access-links/namespace.js +7 -0
- package/dist/infra/access-links/namespace.js.map +1 -0
- package/dist/infra/access-links/rate-limit.d.ts +10 -0
- package/dist/infra/access-links/rate-limit.d.ts.map +1 -0
- package/dist/infra/access-links/rate-limit.js +28 -0
- package/dist/infra/access-links/rate-limit.js.map +1 -0
- package/dist/infra/access-links/schema.d.ts +117 -0
- package/dist/infra/access-links/schema.d.ts.map +1 -0
- package/dist/infra/access-links/schema.js +50 -0
- package/dist/infra/access-links/schema.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export declare const ACCESS_LINK_USE_STATUSES: readonly ["pending", "completed", "abandoned"];
|
|
2
|
+
export declare const accessLinkCode: import("../../data/domain/types.js").DefinedTable<{
|
|
3
|
+
code: import("../../data/domain/types.js").FieldDescriptor<string, {
|
|
4
|
+
primaryKey: true;
|
|
5
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string, {
|
|
6
|
+
primaryKey: true;
|
|
7
|
+
}>;
|
|
8
|
+
tenantId: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
9
|
+
linkId: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
10
|
+
createdAt: import("../../data/domain/types.js").FieldDescriptor<Date, {
|
|
11
|
+
hasDefault: true;
|
|
12
|
+
}> & import("../../data/domain/field.js").FieldModifiers<Date, {
|
|
13
|
+
hasDefault: true;
|
|
14
|
+
}>;
|
|
15
|
+
}, "access_link_code">;
|
|
16
|
+
export declare const accessLink: import("../../data/domain/types.js").DefinedTable<{
|
|
17
|
+
id: import("../../data/domain/types.js").FieldDescriptor<string, {
|
|
18
|
+
defaultRandom: true;
|
|
19
|
+
hasDefault: true;
|
|
20
|
+
} & {
|
|
21
|
+
primaryKey: true;
|
|
22
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string, {
|
|
23
|
+
defaultRandom: true;
|
|
24
|
+
hasDefault: true;
|
|
25
|
+
} & {
|
|
26
|
+
primaryKey: true;
|
|
27
|
+
}>;
|
|
28
|
+
tenantId: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
29
|
+
code: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
30
|
+
targetType: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
31
|
+
targetId: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
32
|
+
permissions: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType, {}> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType, {}>;
|
|
33
|
+
note: import("../../data/domain/types.js").FieldDescriptor<string | null, {
|
|
34
|
+
nullable: true;
|
|
35
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string | null, {
|
|
36
|
+
nullable: true;
|
|
37
|
+
}>;
|
|
38
|
+
createdBy: import("../../data/domain/types.js").FieldDescriptor<string | null, {
|
|
39
|
+
nullable: true;
|
|
40
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string | null, {
|
|
41
|
+
nullable: true;
|
|
42
|
+
}>;
|
|
43
|
+
createdAt: import("../../data/domain/types.js").FieldDescriptor<Date, {
|
|
44
|
+
hasDefault: true;
|
|
45
|
+
}> & import("../../data/domain/field.js").FieldModifiers<Date, {
|
|
46
|
+
hasDefault: true;
|
|
47
|
+
}>;
|
|
48
|
+
expiresAt: import("../../data/domain/types.js").FieldDescriptor<Date | null, {
|
|
49
|
+
nullable: true;
|
|
50
|
+
}> & import("../../data/domain/field.js").FieldModifiers<Date | null, {
|
|
51
|
+
nullable: true;
|
|
52
|
+
}>;
|
|
53
|
+
maxUses: import("../../data/domain/types.js").FieldDescriptor<number | null, {
|
|
54
|
+
nullable: true;
|
|
55
|
+
}> & import("../../data/domain/field.js").FieldModifiers<number | null, {
|
|
56
|
+
nullable: true;
|
|
57
|
+
}>;
|
|
58
|
+
requireChecks: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType, {
|
|
59
|
+
hasDefault: true;
|
|
60
|
+
}> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType, {
|
|
61
|
+
hasDefault: true;
|
|
62
|
+
}>;
|
|
63
|
+
checkData: import("../../data/domain/types.js").FieldDescriptor<import("zod/v4").JSONType, {
|
|
64
|
+
nullable: true;
|
|
65
|
+
}> & import("../../data/domain/field.js").FieldModifiers<import("zod/v4").JSONType, {
|
|
66
|
+
nullable: true;
|
|
67
|
+
}>;
|
|
68
|
+
revokedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null, {
|
|
69
|
+
nullable: true;
|
|
70
|
+
}> & import("../../data/domain/field.js").FieldModifiers<Date | null, {
|
|
71
|
+
nullable: true;
|
|
72
|
+
}>;
|
|
73
|
+
revokedBy: import("../../data/domain/types.js").FieldDescriptor<string | null, {
|
|
74
|
+
nullable: true;
|
|
75
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string | null, {
|
|
76
|
+
nullable: true;
|
|
77
|
+
}>;
|
|
78
|
+
}, "access_link">;
|
|
79
|
+
export declare const accessLinkUse: import("../../data/domain/types.js").DefinedTable<{
|
|
80
|
+
id: import("../../data/domain/types.js").FieldDescriptor<string, {
|
|
81
|
+
defaultRandom: true;
|
|
82
|
+
hasDefault: true;
|
|
83
|
+
} & {
|
|
84
|
+
primaryKey: true;
|
|
85
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string, {
|
|
86
|
+
defaultRandom: true;
|
|
87
|
+
hasDefault: true;
|
|
88
|
+
} & {
|
|
89
|
+
primaryKey: true;
|
|
90
|
+
}>;
|
|
91
|
+
tenantId: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
92
|
+
linkId: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
93
|
+
kind: import("../../data/domain/types.js").FieldDescriptor<string, {}> & import("../../data/domain/field.js").FieldModifiers<string, {}>;
|
|
94
|
+
status: import("../../data/domain/types.js").FieldDescriptor<"completed" | "pending" | "abandoned", {}> & import("../../data/domain/field.js").FieldModifiers<"completed" | "pending" | "abandoned", {}>;
|
|
95
|
+
startedAt: import("../../data/domain/types.js").FieldDescriptor<Date, {
|
|
96
|
+
hasDefault: true;
|
|
97
|
+
}> & import("../../data/domain/field.js").FieldModifiers<Date, {
|
|
98
|
+
hasDefault: true;
|
|
99
|
+
}>;
|
|
100
|
+
reservedUntil: import("../../data/domain/types.js").FieldDescriptor<Date, {}> & import("../../data/domain/field.js").FieldModifiers<Date, {}>;
|
|
101
|
+
completedAt: import("../../data/domain/types.js").FieldDescriptor<Date | null, {
|
|
102
|
+
nullable: true;
|
|
103
|
+
}> & import("../../data/domain/field.js").FieldModifiers<Date | null, {
|
|
104
|
+
nullable: true;
|
|
105
|
+
}>;
|
|
106
|
+
client: import("../../data/domain/types.js").FieldDescriptor<string | null, {
|
|
107
|
+
nullable: true;
|
|
108
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string | null, {
|
|
109
|
+
nullable: true;
|
|
110
|
+
}>;
|
|
111
|
+
location: import("../../data/domain/types.js").FieldDescriptor<string | null, {
|
|
112
|
+
nullable: true;
|
|
113
|
+
}> & import("../../data/domain/field.js").FieldModifiers<string | null, {
|
|
114
|
+
nullable: true;
|
|
115
|
+
}>;
|
|
116
|
+
}, "access_link_use">;
|
|
117
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/infra/access-links/schema.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,wBAAwB,gDAAiD,CAAA;AAEtF,eAAO,MAAM,cAAc;;;;;;;;;;;;;sBAKzB,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgBrB,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAexB,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// The three tables behind access links. `access_link_code` is deliberately NOT
|
|
2
|
+
// tenant-scoped: it maps a code to its tenant so a request with no tenant can
|
|
3
|
+
// find where to look, and holds nothing else. `access_link` and
|
|
4
|
+
// `access_link_use` carry a `.tenant()` key, so generated migrations put them
|
|
5
|
+
// under forced row-level security.
|
|
6
|
+
import { define } from '../../data/domain/index.js';
|
|
7
|
+
import { field } from '../../data/domain/field.js';
|
|
8
|
+
import { schema } from '../../data/schema/namespace.js';
|
|
9
|
+
import { index } from '../../data/db/idx/index.js';
|
|
10
|
+
export const ACCESS_LINK_USE_STATUSES = ['pending', 'completed', 'abandoned'];
|
|
11
|
+
export const accessLinkCode = define('access_link_code', {
|
|
12
|
+
code: field.text().primaryKey(),
|
|
13
|
+
tenantId: field.uuid(),
|
|
14
|
+
linkId: field.uuid(),
|
|
15
|
+
createdAt: field.timestamp().default('now'),
|
|
16
|
+
});
|
|
17
|
+
export const accessLink = define('access_link', {
|
|
18
|
+
id: field.uuid().defaultRandom().primaryKey(),
|
|
19
|
+
tenantId: field.uuid().tenant(),
|
|
20
|
+
code: field.text().unique(),
|
|
21
|
+
targetType: field.text(),
|
|
22
|
+
targetId: field.text(),
|
|
23
|
+
permissions: field.jsonb(schema.check.json()),
|
|
24
|
+
note: field.text().nullable(),
|
|
25
|
+
createdBy: field.text().nullable(),
|
|
26
|
+
createdAt: field.timestamp().default('now'),
|
|
27
|
+
expiresAt: field.timestamp().nullable(),
|
|
28
|
+
maxUses: field.integer().nullable(),
|
|
29
|
+
requireChecks: field.jsonb(schema.check.json()).default([]),
|
|
30
|
+
checkData: field.jsonb(schema.check.json()).nullable(),
|
|
31
|
+
revokedAt: field.timestamp().nullable(),
|
|
32
|
+
revokedBy: field.text().nullable(),
|
|
33
|
+
});
|
|
34
|
+
export const accessLinkUse = define('access_link_use', {
|
|
35
|
+
id: field.uuid().defaultRandom().primaryKey(),
|
|
36
|
+
tenantId: field.uuid().tenant(),
|
|
37
|
+
linkId: field.uuid(),
|
|
38
|
+
kind: field.text(),
|
|
39
|
+
status: field.enum(ACCESS_LINK_USE_STATUSES),
|
|
40
|
+
startedAt: field.timestamp().default('now'),
|
|
41
|
+
reservedUntil: field.timestamp(),
|
|
42
|
+
completedAt: field.timestamp().nullable(),
|
|
43
|
+
client: field.text().nullable(),
|
|
44
|
+
location: field.text().nullable(),
|
|
45
|
+
}, {
|
|
46
|
+
indexes: (t) => ({
|
|
47
|
+
byLink: index('idx_access_link_use_link').on(t['linkId'], t['status']),
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/infra/access-links/schema.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,gEAAgE;AAChE,8EAA8E;AAC9E,mCAAmC;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAElD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAU,CAAA;AAEtF,MAAM,CAAC,MAAM,cAAc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