@intx/db 0.1.2 → 0.3.0
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 +176 -0
- package/README.md +23 -4
- package/dist/approval-store.d.ts +52 -0
- package/dist/approval-store.js +79 -0
- package/dist/asset-resolution.d.ts +52 -0
- package/dist/asset-resolution.js +66 -0
- package/dist/catalog-resolution.d.ts +76 -0
- package/dist/catalog-resolution.js +151 -0
- package/dist/client.d.ts +19 -0
- package/dist/client.js +18 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.js +16 -0
- package/dist/connection.d.ts +3 -0
- package/dist/connection.js +26 -0
- package/dist/credential-resolution.d.ts +222 -0
- package/dist/credential-resolution.js +255 -0
- package/dist/grant-store.d.ts +3 -0
- package/dist/grant-store.js +59 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +20 -0
- package/dist/migrate.d.ts +36 -0
- package/dist/migrate.js +135 -0
- package/dist/model-source-resolution.d.ts +115 -0
- package/dist/model-source-resolution.js +291 -0
- package/dist/parse-row.d.ts +373 -0
- package/dist/parse-row.js +232 -0
- package/dist/pg-error.d.ts +3 -0
- package/dist/pg-error.js +19 -0
- package/dist/pricing.d.ts +15 -0
- package/dist/pricing.js +24 -0
- package/dist/rekey-credential-secrets.d.ts +13 -0
- package/dist/rekey-credential-secrets.js +61 -0
- package/dist/schema/approvals.d.ts +245 -0
- package/dist/schema/approvals.js +52 -0
- package/dist/schema/assets.d.ts +143 -0
- package/{src/schema/assets.ts → dist/schema/assets.js} +7 -16
- package/dist/schema/auth.d.ts +606 -0
- package/dist/schema/auth.js +47 -0
- package/dist/schema/catalog.d.ts +811 -0
- package/dist/schema/catalog.js +108 -0
- package/dist/schema/column-types.d.ts +26 -0
- package/dist/schema/column-types.js +15 -0
- package/dist/schema/credentials.d.ts +305 -0
- package/{src/schema/credentials.ts → dist/schema/credentials.js} +16 -22
- package/dist/schema/git-tokens.d.ts +256 -0
- package/{src/schema/git-tokens.ts → dist/schema/git-tokens.js} +16 -39
- package/dist/schema/grants.d.ts +211 -0
- package/dist/schema/grants.js +30 -0
- package/dist/schema/index.d.ts +25 -0
- package/dist/schema/index.js +25 -0
- package/dist/schema/messages.d.ts +414 -0
- package/dist/schema/messages.js +82 -0
- package/dist/schema/oauth-clients.d.ts +246 -0
- package/{src/schema/oauth-clients.ts → dist/schema/oauth-clients.js} +8 -14
- package/dist/schema/offerings.d.ts +160 -0
- package/dist/schema/offerings.js +24 -0
- package/dist/schema/principals.d.ts +128 -0
- package/dist/schema/principals.js +23 -0
- package/dist/schema/providers.d.ts +237 -0
- package/dist/schema/providers.js +22 -0
- package/dist/schema/roles.d.ts +242 -0
- package/dist/schema/roles.js +37 -0
- package/dist/schema/session-assets.d.ts +92 -0
- package/dist/schema/session-assets.js +45 -0
- package/dist/schema/sessions.d.ts +143 -0
- package/dist/schema/sessions.js +29 -0
- package/dist/schema/sidecar-allocation.d.ts +406 -0
- package/dist/schema/sidecar-allocation.js +57 -0
- package/dist/schema/sidecar.d.ts +145 -0
- package/dist/schema/sidecar.js +28 -0
- package/dist/schema/signal-correlations.d.ts +177 -0
- package/dist/schema/signal-correlations.js +31 -0
- package/dist/schema/tenants.d.ts +235 -0
- package/{src/schema/tenants.ts → dist/schema/tenants.js} +10 -27
- package/dist/schema/wallets.d.ts +354 -0
- package/dist/schema/wallets.js +43 -0
- package/dist/schema/workflow-definitions.d.ts +371 -0
- package/dist/schema/workflow-definitions.js +97 -0
- package/dist/schema/workflow-run-dispatch.d.ts +328 -0
- package/dist/schema/workflow-run-dispatch.js +56 -0
- package/dist/schema/workflow-run-execution.d.ts +126 -0
- package/dist/schema/workflow-run-execution.js +48 -0
- package/dist/schema/workflow-run-launch-spec.d.ts +200 -0
- package/dist/schema/workflow-run-launch-spec.js +26 -0
- package/dist/schema/workflow-run.d.ts +230 -0
- package/dist/schema/workflow-run.js +102 -0
- package/dist/sidecar-allocation-store.d.ts +171 -0
- package/dist/sidecar-allocation-store.js +512 -0
- package/dist/signal-correlation-store.d.ts +36 -0
- package/dist/signal-correlation-store.js +63 -0
- package/dist/tenant-hierarchy.d.ts +23 -0
- package/dist/tenant-hierarchy.js +60 -0
- package/dist/workflow-definition-store.d.ts +55 -0
- package/dist/workflow-definition-store.js +93 -0
- package/dist/workflow-run-dispatch-store.d.ts +80 -0
- package/dist/workflow-run-dispatch-store.js +298 -0
- package/dist/workflow-run-launch-spec-store.d.ts +13 -0
- package/dist/workflow-run-launch-spec-store.js +30 -0
- package/dist/workflow-run-store.d.ts +54 -0
- package/dist/workflow-run-store.js +85 -0
- package/migrations/0029_loose_warlock.sql +1 -0
- package/migrations/0030_session_asset_audit_split.sql +5 -0
- package/migrations/0031_gigantic_nicolaos.sql +68 -0
- package/migrations/0032_lethal_misty_knight.sql +1 -0
- package/migrations/0033_old_payback.sql +1 -0
- package/migrations/0034_sleepy_songbird.sql +11 -0
- package/migrations/0035_violet_giant_man.sql +3 -0
- package/migrations/0036_sharp_the_executioner.sql +2 -0
- package/migrations/0037_credential_use_backfill.sql +39 -0
- package/migrations/0038_chilly_blacklash.sql +37 -0
- package/migrations/0039_quick_carnage.sql +2 -0
- package/migrations/0040_reshape_approval_origin.sql +24 -0
- package/migrations/0041_make_approval_timeout_at_nullable.sql +1 -0
- package/migrations/0042_youthful_mantis.sql +2 -0
- package/migrations/0043_signal_correlation_deployment_fk.sql +1 -0
- package/migrations/0044_model_offering_quirks.sql +1 -0
- package/migrations/0045_create_workflow_run.sql +13 -0
- package/migrations/0046_approval_signal_correlation_run_fk.sql +2 -0
- package/migrations/0047_create_workflow_definition.sql +30 -0
- package/migrations/0048_workflow_definition_origin_agent_id.sql +2 -0
- package/migrations/0049_curly_omega_flight.sql +2 -0
- package/migrations/0050_late_crystal.sql +10 -0
- package/migrations/0051_funny_madelyne_pryor.sql +1 -0
- package/migrations/0052_drop_inference_turn_instance_fk.sql +1 -0
- package/migrations/0053_session_mail_session_id_index.sql +1 -0
- package/migrations/0054_rekey_instance_grants_to_workflow_run.sql +10 -0
- package/migrations/0055_backfill_anchor_workflow_runs.sql +69 -0
- package/migrations/0056_repoint_deployment_fks_to_anchor_run.sql +32 -0
- package/migrations/0057_drop_workflow_deployment_projection.sql +22 -0
- package/migrations/0058_repoint_offering_fk_to_definition.sql +41 -0
- package/migrations/0059_repoint_transaction_fk_to_run.sql +10 -0
- package/migrations/0060_drop_session_mail_instance_fk.sql +6 -0
- package/migrations/0061_drop_session_asset_instance_fk.sql +7 -0
- package/migrations/0062_drop_agent_asset_table.sql +11 -0
- package/migrations/0063_repoint_agent_role_fk_to_definition.sql +39 -0
- package/migrations/0064_repoint_agent_session_fk_to_definition.sql +47 -0
- package/migrations/0065_add_workflow_definition_model_requirements.sql +37 -0
- package/migrations/0066_rekey_agent_definition_principals_to_workflow.sql +27 -0
- package/migrations/0067_add_workflow_definition_kind.sql +10 -0
- package/migrations/0068_drop_agent_tables_and_origin_agent_id.sql +31 -0
- package/migrations/0069_drop_workflow_definition_kind.sql +10 -0
- package/migrations/0070_flashy_proteus.sql +13 -0
- package/migrations/0072_add_workflow_definition_credential_bindings.sql +1 -0
- package/migrations/0073_grant_target_exactly_one_check.sql +13 -0
- package/migrations/0074_add_provider_api_base_url.sql +1 -0
- package/migrations/0075_workflow_run_launch_spec.sql +17 -0
- package/migrations/0076_sidecar_allocation.sql +40 -0
- package/migrations/0077_workflow_run_dispatch.sql +29 -0
- package/migrations/0078_workflow_run_dispatch_kind.sql +2 -0
- package/migrations/0079_rename_workflow_run_deployment_id_to_anchor_run_id.sql +4 -0
- package/migrations/0080_rename_correlation_approval_deployment_id_to_anchor_run_id.sql +9 -0
- package/migrations/0081_workflow_definition_content_hash_and_approved_wire_hash.sql +4 -0
- package/migrations/0082_blue_black_queen.sql +1 -0
- package/migrations/0083_replace_launch_spec_snapshot_with_frozen_bundle.sql +3 -0
- package/migrations/0084_delete_orphaned_credential_grants.sql +22 -0
- package/migrations/meta/0029_snapshot.json +2664 -0
- package/migrations/meta/0030_snapshot.json +2670 -0
- package/migrations/meta/0031_snapshot.json +3100 -0
- package/migrations/meta/0032_snapshot.json +3106 -0
- package/migrations/meta/0033_snapshot.json +3112 -0
- package/migrations/meta/0034_snapshot.json +3198 -0
- package/migrations/meta/0035_snapshot.json +3225 -0
- package/migrations/meta/0036_snapshot.json +3237 -0
- package/migrations/meta/0037_snapshot.json +3237 -0
- package/migrations/meta/0038_snapshot.json +3470 -0
- package/migrations/meta/0039_snapshot.json +3470 -0
- package/migrations/meta/0040_snapshot.json +3489 -0
- package/migrations/meta/0041_snapshot.json +3489 -0
- package/migrations/meta/0042_snapshot.json +3489 -0
- package/migrations/meta/0043_snapshot.json +3498 -0
- package/migrations/meta/0044_snapshot.json +3504 -0
- package/migrations/meta/0045_snapshot.json +3589 -0
- package/migrations/meta/0046_snapshot.json +3607 -0
- package/migrations/meta/0047_snapshot.json +3832 -0
- package/migrations/meta/0048_snapshot.json +3853 -0
- package/migrations/meta/0049_snapshot.json +3854 -0
- package/migrations/meta/0050_snapshot.json +3924 -0
- package/migrations/meta/0051_snapshot.json +3940 -0
- package/migrations/meta/0052_snapshot.json +3931 -0
- package/migrations/meta/0053_snapshot.json +3952 -0
- package/migrations/meta/0054_snapshot.json +3952 -0
- package/migrations/meta/0055_snapshot.json +3952 -0
- package/migrations/meta/0056_snapshot.json +3952 -0
- package/migrations/meta/0057_snapshot.json +3839 -0
- package/migrations/meta/0058_snapshot.json +3839 -0
- package/migrations/meta/0059_snapshot.json +3839 -0
- package/migrations/meta/0060_snapshot.json +3830 -0
- package/migrations/meta/0061_snapshot.json +3821 -0
- package/migrations/meta/0062_snapshot.json +3723 -0
- package/migrations/meta/0063_snapshot.json +3723 -0
- package/migrations/meta/0064_snapshot.json +3723 -0
- package/migrations/meta/0065_snapshot.json +3729 -0
- package/migrations/meta/0066_snapshot.json +3729 -0
- package/migrations/meta/0067_snapshot.json +3736 -0
- package/migrations/meta/0068_snapshot.json +3347 -0
- package/migrations/meta/0069_snapshot.json +3340 -0
- package/migrations/meta/0070_snapshot.json +3444 -0
- package/migrations/meta/0072_snapshot.json +3450 -0
- package/migrations/meta/0073_snapshot.json +3455 -0
- package/migrations/meta/0074_snapshot.json +3461 -0
- package/migrations/meta/0075_snapshot.json +3567 -0
- package/migrations/meta/0076_snapshot.json +3851 -0
- package/migrations/meta/0077_snapshot.json +4067 -0
- package/migrations/meta/0078_snapshot.json +4078 -0
- package/migrations/meta/0079_snapshot.json +4078 -0
- package/migrations/meta/0080_snapshot.json +4078 -0
- package/migrations/meta/0081_snapshot.json +4096 -0
- package/migrations/meta/0082_snapshot.json +4102 -0
- package/migrations/meta/0083_snapshot.json +4096 -0
- package/migrations/meta/0084_snapshot.json +4096 -0
- package/migrations/meta/_journal.json +385 -0
- package/package.json +25 -11
- package/drizzle.config.ts +0 -23
- package/src/client.ts +0 -24
- package/src/config.ts +0 -19
- package/src/connection.ts +0 -27
- package/src/credential-resolution.ts +0 -378
- package/src/grant-store.ts +0 -51
- package/src/index.ts +0 -32
- package/src/migrate.test.ts +0 -35
- package/src/migrate.ts +0 -168
- package/src/parse-row.test.ts +0 -113
- package/src/parse-row.ts +0 -185
- package/src/schema/agent-assets.ts +0 -21
- package/src/schema/agents.ts +0 -49
- package/src/schema/auth.ts +0 -51
- package/src/schema/grants.ts +0 -26
- package/src/schema/index.ts +0 -19
- package/src/schema/instances.ts +0 -36
- package/src/schema/messages.ts +0 -108
- package/src/schema/offerings.ts +0 -20
- package/src/schema/principals.ts +0 -28
- package/src/schema/providers.ts +0 -23
- package/src/schema/roles.ts +0 -51
- package/src/schema/session-assets.ts +0 -49
- package/src/schema/sessions.ts +0 -26
- package/src/schema/sidecar.ts +0 -14
- package/src/schema/wallets.ts +0 -44
- package/src/tenant-hierarchy.ts +0 -34
- package/tsconfig.json +0 -4
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
export declare const gitToken: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
+
name: "git_token";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
+
name: "id";
|
|
7
|
+
tableName: "git_token";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "PgText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: false;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
tenantId: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "tenant_id";
|
|
24
|
+
tableName: "git_token";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgText";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: false;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: [string, ...string[]];
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
userId: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "user_id";
|
|
41
|
+
tableName: "git_token";
|
|
42
|
+
dataType: "string";
|
|
43
|
+
columnType: "PgText";
|
|
44
|
+
data: string;
|
|
45
|
+
driverParam: string;
|
|
46
|
+
notNull: true;
|
|
47
|
+
hasDefault: false;
|
|
48
|
+
isPrimaryKey: false;
|
|
49
|
+
isAutoincrement: false;
|
|
50
|
+
hasRuntimeDefault: false;
|
|
51
|
+
enumValues: [string, ...string[]];
|
|
52
|
+
baseColumn: never;
|
|
53
|
+
identity: undefined;
|
|
54
|
+
generated: undefined;
|
|
55
|
+
}, {}, {}>;
|
|
56
|
+
principalId: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
+
name: "principal_id";
|
|
58
|
+
tableName: "git_token";
|
|
59
|
+
dataType: "string";
|
|
60
|
+
columnType: "PgText";
|
|
61
|
+
data: string;
|
|
62
|
+
driverParam: string;
|
|
63
|
+
notNull: false;
|
|
64
|
+
hasDefault: false;
|
|
65
|
+
isPrimaryKey: false;
|
|
66
|
+
isAutoincrement: false;
|
|
67
|
+
hasRuntimeDefault: false;
|
|
68
|
+
enumValues: [string, ...string[]];
|
|
69
|
+
baseColumn: never;
|
|
70
|
+
identity: undefined;
|
|
71
|
+
generated: undefined;
|
|
72
|
+
}, {}, {}>;
|
|
73
|
+
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
+
name: "name";
|
|
75
|
+
tableName: "git_token";
|
|
76
|
+
dataType: "string";
|
|
77
|
+
columnType: "PgText";
|
|
78
|
+
data: string;
|
|
79
|
+
driverParam: string;
|
|
80
|
+
notNull: true;
|
|
81
|
+
hasDefault: false;
|
|
82
|
+
isPrimaryKey: false;
|
|
83
|
+
isAutoincrement: false;
|
|
84
|
+
hasRuntimeDefault: false;
|
|
85
|
+
enumValues: [string, ...string[]];
|
|
86
|
+
baseColumn: never;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}, {}, {}>;
|
|
90
|
+
kind: import("drizzle-orm/pg-core").PgColumn<{
|
|
91
|
+
name: "kind";
|
|
92
|
+
tableName: "git_token";
|
|
93
|
+
dataType: "string";
|
|
94
|
+
columnType: "PgText";
|
|
95
|
+
data: "pat" | "svc";
|
|
96
|
+
driverParam: string;
|
|
97
|
+
notNull: true;
|
|
98
|
+
hasDefault: false;
|
|
99
|
+
isPrimaryKey: false;
|
|
100
|
+
isAutoincrement: false;
|
|
101
|
+
hasRuntimeDefault: false;
|
|
102
|
+
enumValues: ["pat", "svc"];
|
|
103
|
+
baseColumn: never;
|
|
104
|
+
identity: undefined;
|
|
105
|
+
generated: undefined;
|
|
106
|
+
}, {}, {}>;
|
|
107
|
+
tokenHashSha256: import("drizzle-orm/pg-core").PgColumn<{
|
|
108
|
+
name: "token_hash_sha256";
|
|
109
|
+
tableName: "git_token";
|
|
110
|
+
dataType: "custom";
|
|
111
|
+
columnType: "PgCustomColumn";
|
|
112
|
+
data: Uint8Array<ArrayBufferLike>;
|
|
113
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
114
|
+
notNull: true;
|
|
115
|
+
hasDefault: false;
|
|
116
|
+
isPrimaryKey: false;
|
|
117
|
+
isAutoincrement: false;
|
|
118
|
+
hasRuntimeDefault: false;
|
|
119
|
+
enumValues: undefined;
|
|
120
|
+
baseColumn: never;
|
|
121
|
+
identity: undefined;
|
|
122
|
+
generated: undefined;
|
|
123
|
+
}, {}, {
|
|
124
|
+
pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
|
|
125
|
+
}>;
|
|
126
|
+
resource: import("drizzle-orm/pg-core").PgColumn<{
|
|
127
|
+
name: "resource";
|
|
128
|
+
tableName: "git_token";
|
|
129
|
+
dataType: "string";
|
|
130
|
+
columnType: "PgText";
|
|
131
|
+
data: string;
|
|
132
|
+
driverParam: string;
|
|
133
|
+
notNull: true;
|
|
134
|
+
hasDefault: false;
|
|
135
|
+
isPrimaryKey: false;
|
|
136
|
+
isAutoincrement: false;
|
|
137
|
+
hasRuntimeDefault: false;
|
|
138
|
+
enumValues: [string, ...string[]];
|
|
139
|
+
baseColumn: never;
|
|
140
|
+
identity: undefined;
|
|
141
|
+
generated: undefined;
|
|
142
|
+
}, {}, {}>;
|
|
143
|
+
refPattern: import("drizzle-orm/pg-core").PgColumn<{
|
|
144
|
+
name: "ref_pattern";
|
|
145
|
+
tableName: "git_token";
|
|
146
|
+
dataType: "string";
|
|
147
|
+
columnType: "PgText";
|
|
148
|
+
data: string;
|
|
149
|
+
driverParam: string;
|
|
150
|
+
notNull: true;
|
|
151
|
+
hasDefault: false;
|
|
152
|
+
isPrimaryKey: false;
|
|
153
|
+
isAutoincrement: false;
|
|
154
|
+
hasRuntimeDefault: false;
|
|
155
|
+
enumValues: [string, ...string[]];
|
|
156
|
+
baseColumn: never;
|
|
157
|
+
identity: undefined;
|
|
158
|
+
generated: undefined;
|
|
159
|
+
}, {}, {}>;
|
|
160
|
+
actions: import("drizzle-orm/pg-core").PgColumn<{
|
|
161
|
+
name: "actions";
|
|
162
|
+
tableName: "git_token";
|
|
163
|
+
dataType: "array";
|
|
164
|
+
columnType: "PgArray";
|
|
165
|
+
data: string[];
|
|
166
|
+
driverParam: string | string[];
|
|
167
|
+
notNull: true;
|
|
168
|
+
hasDefault: false;
|
|
169
|
+
isPrimaryKey: false;
|
|
170
|
+
isAutoincrement: false;
|
|
171
|
+
hasRuntimeDefault: false;
|
|
172
|
+
enumValues: [string, ...string[]];
|
|
173
|
+
baseColumn: import("drizzle-orm").Column<{
|
|
174
|
+
name: "actions";
|
|
175
|
+
tableName: "git_token";
|
|
176
|
+
dataType: "string";
|
|
177
|
+
columnType: "PgText";
|
|
178
|
+
data: string;
|
|
179
|
+
driverParam: string;
|
|
180
|
+
notNull: false;
|
|
181
|
+
hasDefault: false;
|
|
182
|
+
isPrimaryKey: false;
|
|
183
|
+
isAutoincrement: false;
|
|
184
|
+
hasRuntimeDefault: false;
|
|
185
|
+
enumValues: [string, ...string[]];
|
|
186
|
+
baseColumn: never;
|
|
187
|
+
identity: undefined;
|
|
188
|
+
generated: undefined;
|
|
189
|
+
}, {}, {}>;
|
|
190
|
+
identity: undefined;
|
|
191
|
+
generated: undefined;
|
|
192
|
+
}, {}, {
|
|
193
|
+
baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
|
|
194
|
+
name: "actions";
|
|
195
|
+
dataType: "string";
|
|
196
|
+
columnType: "PgText";
|
|
197
|
+
data: string;
|
|
198
|
+
enumValues: [string, ...string[]];
|
|
199
|
+
driverParam: string;
|
|
200
|
+
}, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
|
|
201
|
+
size: undefined;
|
|
202
|
+
}>;
|
|
203
|
+
expiresAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
204
|
+
name: "expires_at";
|
|
205
|
+
tableName: "git_token";
|
|
206
|
+
dataType: "date";
|
|
207
|
+
columnType: "PgTimestamp";
|
|
208
|
+
data: Date;
|
|
209
|
+
driverParam: string;
|
|
210
|
+
notNull: true;
|
|
211
|
+
hasDefault: false;
|
|
212
|
+
isPrimaryKey: false;
|
|
213
|
+
isAutoincrement: false;
|
|
214
|
+
hasRuntimeDefault: false;
|
|
215
|
+
enumValues: undefined;
|
|
216
|
+
baseColumn: never;
|
|
217
|
+
identity: undefined;
|
|
218
|
+
generated: undefined;
|
|
219
|
+
}, {}, {}>;
|
|
220
|
+
revokedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
221
|
+
name: "revoked_at";
|
|
222
|
+
tableName: "git_token";
|
|
223
|
+
dataType: "date";
|
|
224
|
+
columnType: "PgTimestamp";
|
|
225
|
+
data: Date;
|
|
226
|
+
driverParam: string;
|
|
227
|
+
notNull: false;
|
|
228
|
+
hasDefault: false;
|
|
229
|
+
isPrimaryKey: false;
|
|
230
|
+
isAutoincrement: false;
|
|
231
|
+
hasRuntimeDefault: false;
|
|
232
|
+
enumValues: undefined;
|
|
233
|
+
baseColumn: never;
|
|
234
|
+
identity: undefined;
|
|
235
|
+
generated: undefined;
|
|
236
|
+
}, {}, {}>;
|
|
237
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
238
|
+
name: "created_at";
|
|
239
|
+
tableName: "git_token";
|
|
240
|
+
dataType: "date";
|
|
241
|
+
columnType: "PgTimestamp";
|
|
242
|
+
data: Date;
|
|
243
|
+
driverParam: string;
|
|
244
|
+
notNull: true;
|
|
245
|
+
hasDefault: true;
|
|
246
|
+
isPrimaryKey: false;
|
|
247
|
+
isAutoincrement: false;
|
|
248
|
+
hasRuntimeDefault: false;
|
|
249
|
+
enumValues: undefined;
|
|
250
|
+
baseColumn: never;
|
|
251
|
+
identity: undefined;
|
|
252
|
+
generated: undefined;
|
|
253
|
+
}, {}, {}>;
|
|
254
|
+
};
|
|
255
|
+
dialect: "pg";
|
|
256
|
+
}>;
|
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
import { sql } from "drizzle-orm";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
uniqueIndex,
|
|
8
|
-
} from "drizzle-orm/pg-core";
|
|
9
|
-
|
|
10
|
-
import { user } from "./auth";
|
|
11
|
-
import { principal } from "./principals";
|
|
12
|
-
import { tenant } from "./tenants";
|
|
13
|
-
|
|
14
|
-
const bytea = customType<{ data: Uint8Array; driverData: Buffer }>({
|
|
15
|
-
dataType() {
|
|
16
|
-
return "bytea";
|
|
17
|
-
},
|
|
18
|
-
toDriver(value) {
|
|
19
|
-
return Buffer.from(value);
|
|
20
|
-
},
|
|
21
|
-
fromDriver(value) {
|
|
22
|
-
return new Uint8Array(value);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
|
|
2
|
+
import { pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
3
|
+
import { user } from "./auth.js";
|
|
4
|
+
import { bytea } from "./column-types.js";
|
|
5
|
+
import { principal } from "./principals.js";
|
|
6
|
+
import { tenant } from "./tenants.js";
|
|
26
7
|
// Hub-issued bearer tokens for the smart-HTTP git endpoints. Opaque
|
|
27
8
|
// tokens of the form `itx_pat_<base64>` or `itx_svc_<base64>` whose
|
|
28
9
|
// SHA-256 digest is stored as `tokenHashSha256` (the raw secret is
|
|
@@ -43,7 +24,7 @@ const bytea = customType<{ data: Uint8Array; driverData: Buffer }>({
|
|
|
43
24
|
// (`receivePack`, `createPack`, `resolveRef`, ...). The mint API
|
|
44
25
|
// translates user-facing aliases to canonical names before insert.
|
|
45
26
|
// `resource` is the single substrate authz resource string
|
|
46
|
-
// (e.g. `agent-state:
|
|
27
|
+
// (e.g. `agent-state:run_xxx`, `asset:def_yyy`) that the token grants
|
|
47
28
|
// access to. `refPattern` is a glob restricting which refs within the
|
|
48
29
|
// resource the token may read or write.
|
|
49
30
|
//
|
|
@@ -52,16 +33,14 @@ const bytea = customType<{ data: Uint8Array; driverData: Buffer }>({
|
|
|
52
33
|
// `(user_id, name)` filtered by `revoked_at is null` lets a user
|
|
53
34
|
// reuse a friendly name (e.g. "laptop") after revoking the old
|
|
54
35
|
// token bearing that name.
|
|
55
|
-
export const gitToken = pgTable(
|
|
56
|
-
"git_token",
|
|
57
|
-
{
|
|
36
|
+
export const gitToken = pgTable("git_token", {
|
|
58
37
|
id: text("id").primaryKey(),
|
|
59
38
|
tenantId: text("tenant_id").references(() => tenant.id),
|
|
60
39
|
userId: text("user_id")
|
|
61
|
-
|
|
62
|
-
|
|
40
|
+
.notNull()
|
|
41
|
+
.references(() => user.id, { onDelete: "cascade" }),
|
|
63
42
|
principalId: text("principal_id").references(() => principal.id, {
|
|
64
|
-
|
|
43
|
+
onDelete: "cascade",
|
|
65
44
|
}),
|
|
66
45
|
name: text("name").notNull(),
|
|
67
46
|
kind: text("kind", { enum: ["pat", "svc"] }).notNull(),
|
|
@@ -72,12 +51,10 @@ export const gitToken = pgTable(
|
|
|
72
51
|
expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
|
|
73
52
|
revokedAt: timestamp("revoked_at", { withTimezone: true }),
|
|
74
53
|
createdAt: timestamp("created_at", { withTimezone: true })
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(t) => [
|
|
54
|
+
.notNull()
|
|
55
|
+
.defaultNow(),
|
|
56
|
+
}, (t) => [
|
|
79
57
|
uniqueIndex("git_token_user_id_name_active_idx")
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
);
|
|
58
|
+
.on(t.userId, t.name)
|
|
59
|
+
.where(sql `${t.revokedAt} is null`),
|
|
60
|
+
]);
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export declare const grant: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
+
name: "grant";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
+
name: "id";
|
|
7
|
+
tableName: "grant";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "PgText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: false;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
tenantId: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "tenant_id";
|
|
24
|
+
tableName: "grant";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgText";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: true;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: [string, ...string[]];
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
roleId: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
+
name: "role_id";
|
|
41
|
+
tableName: "grant";
|
|
42
|
+
dataType: "string";
|
|
43
|
+
columnType: "PgText";
|
|
44
|
+
data: string;
|
|
45
|
+
driverParam: string;
|
|
46
|
+
notNull: false;
|
|
47
|
+
hasDefault: false;
|
|
48
|
+
isPrimaryKey: false;
|
|
49
|
+
isAutoincrement: false;
|
|
50
|
+
hasRuntimeDefault: false;
|
|
51
|
+
enumValues: [string, ...string[]];
|
|
52
|
+
baseColumn: never;
|
|
53
|
+
identity: undefined;
|
|
54
|
+
generated: undefined;
|
|
55
|
+
}, {}, {}>;
|
|
56
|
+
principalId: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
+
name: "principal_id";
|
|
58
|
+
tableName: "grant";
|
|
59
|
+
dataType: "string";
|
|
60
|
+
columnType: "PgText";
|
|
61
|
+
data: string;
|
|
62
|
+
driverParam: string;
|
|
63
|
+
notNull: false;
|
|
64
|
+
hasDefault: false;
|
|
65
|
+
isPrimaryKey: false;
|
|
66
|
+
isAutoincrement: false;
|
|
67
|
+
hasRuntimeDefault: false;
|
|
68
|
+
enumValues: [string, ...string[]];
|
|
69
|
+
baseColumn: never;
|
|
70
|
+
identity: undefined;
|
|
71
|
+
generated: undefined;
|
|
72
|
+
}, {}, {}>;
|
|
73
|
+
resource: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
+
name: "resource";
|
|
75
|
+
tableName: "grant";
|
|
76
|
+
dataType: "string";
|
|
77
|
+
columnType: "PgText";
|
|
78
|
+
data: string;
|
|
79
|
+
driverParam: string;
|
|
80
|
+
notNull: true;
|
|
81
|
+
hasDefault: false;
|
|
82
|
+
isPrimaryKey: false;
|
|
83
|
+
isAutoincrement: false;
|
|
84
|
+
hasRuntimeDefault: false;
|
|
85
|
+
enumValues: [string, ...string[]];
|
|
86
|
+
baseColumn: never;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}, {}, {}>;
|
|
90
|
+
action: import("drizzle-orm/pg-core").PgColumn<{
|
|
91
|
+
name: "action";
|
|
92
|
+
tableName: "grant";
|
|
93
|
+
dataType: "string";
|
|
94
|
+
columnType: "PgText";
|
|
95
|
+
data: string;
|
|
96
|
+
driverParam: string;
|
|
97
|
+
notNull: true;
|
|
98
|
+
hasDefault: false;
|
|
99
|
+
isPrimaryKey: false;
|
|
100
|
+
isAutoincrement: false;
|
|
101
|
+
hasRuntimeDefault: false;
|
|
102
|
+
enumValues: [string, ...string[]];
|
|
103
|
+
baseColumn: never;
|
|
104
|
+
identity: undefined;
|
|
105
|
+
generated: undefined;
|
|
106
|
+
}, {}, {}>;
|
|
107
|
+
effect: import("drizzle-orm/pg-core").PgColumn<{
|
|
108
|
+
name: "effect";
|
|
109
|
+
tableName: "grant";
|
|
110
|
+
dataType: "string";
|
|
111
|
+
columnType: "PgText";
|
|
112
|
+
data: "allow" | "deny" | "ask";
|
|
113
|
+
driverParam: string;
|
|
114
|
+
notNull: true;
|
|
115
|
+
hasDefault: false;
|
|
116
|
+
isPrimaryKey: false;
|
|
117
|
+
isAutoincrement: false;
|
|
118
|
+
hasRuntimeDefault: false;
|
|
119
|
+
enumValues: ["allow", "deny", "ask"];
|
|
120
|
+
baseColumn: never;
|
|
121
|
+
identity: undefined;
|
|
122
|
+
generated: undefined;
|
|
123
|
+
}, {}, {}>;
|
|
124
|
+
conditions: import("drizzle-orm/pg-core").PgColumn<{
|
|
125
|
+
name: "conditions";
|
|
126
|
+
tableName: "grant";
|
|
127
|
+
dataType: "json";
|
|
128
|
+
columnType: "PgJsonb";
|
|
129
|
+
data: unknown;
|
|
130
|
+
driverParam: unknown;
|
|
131
|
+
notNull: false;
|
|
132
|
+
hasDefault: false;
|
|
133
|
+
isPrimaryKey: false;
|
|
134
|
+
isAutoincrement: false;
|
|
135
|
+
hasRuntimeDefault: false;
|
|
136
|
+
enumValues: undefined;
|
|
137
|
+
baseColumn: never;
|
|
138
|
+
identity: undefined;
|
|
139
|
+
generated: undefined;
|
|
140
|
+
}, {}, {}>;
|
|
141
|
+
origin: import("drizzle-orm/pg-core").PgColumn<{
|
|
142
|
+
name: "origin";
|
|
143
|
+
tableName: "grant";
|
|
144
|
+
dataType: "string";
|
|
145
|
+
columnType: "PgText";
|
|
146
|
+
data: "role" | "system" | "creator" | "invoker";
|
|
147
|
+
driverParam: string;
|
|
148
|
+
notNull: true;
|
|
149
|
+
hasDefault: false;
|
|
150
|
+
isPrimaryKey: false;
|
|
151
|
+
isAutoincrement: false;
|
|
152
|
+
hasRuntimeDefault: false;
|
|
153
|
+
enumValues: ["system", "role", "creator", "invoker"];
|
|
154
|
+
baseColumn: never;
|
|
155
|
+
identity: undefined;
|
|
156
|
+
generated: undefined;
|
|
157
|
+
}, {}, {}>;
|
|
158
|
+
expiresAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
159
|
+
name: "expires_at";
|
|
160
|
+
tableName: "grant";
|
|
161
|
+
dataType: "date";
|
|
162
|
+
columnType: "PgTimestamp";
|
|
163
|
+
data: Date;
|
|
164
|
+
driverParam: string;
|
|
165
|
+
notNull: false;
|
|
166
|
+
hasDefault: false;
|
|
167
|
+
isPrimaryKey: false;
|
|
168
|
+
isAutoincrement: false;
|
|
169
|
+
hasRuntimeDefault: false;
|
|
170
|
+
enumValues: undefined;
|
|
171
|
+
baseColumn: never;
|
|
172
|
+
identity: undefined;
|
|
173
|
+
generated: undefined;
|
|
174
|
+
}, {}, {}>;
|
|
175
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
176
|
+
name: "created_at";
|
|
177
|
+
tableName: "grant";
|
|
178
|
+
dataType: "date";
|
|
179
|
+
columnType: "PgTimestamp";
|
|
180
|
+
data: Date;
|
|
181
|
+
driverParam: string;
|
|
182
|
+
notNull: true;
|
|
183
|
+
hasDefault: true;
|
|
184
|
+
isPrimaryKey: false;
|
|
185
|
+
isAutoincrement: false;
|
|
186
|
+
hasRuntimeDefault: false;
|
|
187
|
+
enumValues: undefined;
|
|
188
|
+
baseColumn: never;
|
|
189
|
+
identity: undefined;
|
|
190
|
+
generated: undefined;
|
|
191
|
+
}, {}, {}>;
|
|
192
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
193
|
+
name: "updated_at";
|
|
194
|
+
tableName: "grant";
|
|
195
|
+
dataType: "date";
|
|
196
|
+
columnType: "PgTimestamp";
|
|
197
|
+
data: Date;
|
|
198
|
+
driverParam: string;
|
|
199
|
+
notNull: true;
|
|
200
|
+
hasDefault: true;
|
|
201
|
+
isPrimaryKey: false;
|
|
202
|
+
isAutoincrement: false;
|
|
203
|
+
hasRuntimeDefault: false;
|
|
204
|
+
enumValues: undefined;
|
|
205
|
+
baseColumn: never;
|
|
206
|
+
identity: undefined;
|
|
207
|
+
generated: undefined;
|
|
208
|
+
}, {}, {}>;
|
|
209
|
+
};
|
|
210
|
+
dialect: "pg";
|
|
211
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { check, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
2
|
+
import { sql } from "drizzle-orm";
|
|
3
|
+
import { principal } from "./principals.js";
|
|
4
|
+
import { role } from "./roles.js";
|
|
5
|
+
import { tenant } from "./tenants.js";
|
|
6
|
+
export const grant = pgTable("grant", {
|
|
7
|
+
id: text("id").primaryKey(),
|
|
8
|
+
tenantId: text("tenant_id")
|
|
9
|
+
.notNull()
|
|
10
|
+
.references(() => tenant.id, { onDelete: "cascade" }),
|
|
11
|
+
roleId: text("role_id").references(() => role.id, { onDelete: "cascade" }),
|
|
12
|
+
principalId: text("principal_id").references(() => principal.id, {
|
|
13
|
+
onDelete: "cascade",
|
|
14
|
+
}),
|
|
15
|
+
resource: text("resource").notNull(),
|
|
16
|
+
action: text("action").notNull(),
|
|
17
|
+
effect: text("effect", { enum: ["allow", "deny", "ask"] }).notNull(),
|
|
18
|
+
conditions: jsonb("conditions"),
|
|
19
|
+
origin: text("origin", {
|
|
20
|
+
enum: ["system", "role", "creator", "invoker"],
|
|
21
|
+
}).notNull(),
|
|
22
|
+
expiresAt: timestamp("expires_at"),
|
|
23
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
24
|
+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
25
|
+
}, (t) => [
|
|
26
|
+
// Exactly one target: a grant hangs off a role OR a principal, never both
|
|
27
|
+
// and never neither. Documented in AUTH.md; enforced in the DB so a
|
|
28
|
+
// malformed row is rejected at write rather than silently mis-targeted.
|
|
29
|
+
check("grant_target_exactly_one", sql `num_nonnulls(${t.principalId}, ${t.roleId}) = 1`),
|
|
30
|
+
]);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from "./auth.js";
|
|
2
|
+
export * from "./tenants.js";
|
|
3
|
+
export * from "./principals.js";
|
|
4
|
+
export * from "./roles.js";
|
|
5
|
+
export * from "./grants.js";
|
|
6
|
+
export * from "./approvals.js";
|
|
7
|
+
export * from "./signal-correlations.js";
|
|
8
|
+
export * from "./providers.js";
|
|
9
|
+
export * from "./oauth-clients.js";
|
|
10
|
+
export * from "./credentials.js";
|
|
11
|
+
export * from "./assets.js";
|
|
12
|
+
export * from "./wallets.js";
|
|
13
|
+
export * from "./offerings.js";
|
|
14
|
+
export * from "./catalog.js";
|
|
15
|
+
export * from "./sidecar.js";
|
|
16
|
+
export * from "./sidecar-allocation.js";
|
|
17
|
+
export * from "./sessions.js";
|
|
18
|
+
export * from "./session-assets.js";
|
|
19
|
+
export * from "./messages.js";
|
|
20
|
+
export * from "./git-tokens.js";
|
|
21
|
+
export * from "./workflow-definitions.js";
|
|
22
|
+
export * from "./workflow-run.js";
|
|
23
|
+
export * from "./workflow-run-dispatch.js";
|
|
24
|
+
export * from "./workflow-run-launch-spec.js";
|
|
25
|
+
export * from "./workflow-run-execution.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from "./auth.js";
|
|
2
|
+
export * from "./tenants.js";
|
|
3
|
+
export * from "./principals.js";
|
|
4
|
+
export * from "./roles.js";
|
|
5
|
+
export * from "./grants.js";
|
|
6
|
+
export * from "./approvals.js";
|
|
7
|
+
export * from "./signal-correlations.js";
|
|
8
|
+
export * from "./providers.js";
|
|
9
|
+
export * from "./oauth-clients.js";
|
|
10
|
+
export * from "./credentials.js";
|
|
11
|
+
export * from "./assets.js";
|
|
12
|
+
export * from "./wallets.js";
|
|
13
|
+
export * from "./offerings.js";
|
|
14
|
+
export * from "./catalog.js";
|
|
15
|
+
export * from "./sidecar.js";
|
|
16
|
+
export * from "./sidecar-allocation.js";
|
|
17
|
+
export * from "./sessions.js";
|
|
18
|
+
export * from "./session-assets.js";
|
|
19
|
+
export * from "./messages.js";
|
|
20
|
+
export * from "./git-tokens.js";
|
|
21
|
+
export * from "./workflow-definitions.js";
|
|
22
|
+
export * from "./workflow-run.js";
|
|
23
|
+
export * from "./workflow-run-dispatch.js";
|
|
24
|
+
export * from "./workflow-run-launch-spec.js";
|
|
25
|
+
export * from "./workflow-run-execution.js";
|