@wordrhyme/db 0.1.0-alpha.14

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 (98) hide show
  1. package/README.md +66 -0
  2. package/dist/acl-policy.d.ts +86 -0
  3. package/dist/acl-policy.d.ts.map +1 -0
  4. package/dist/chunk-3TTVLSF5.js +3390 -0
  5. package/dist/chunk-3TTVLSF5.js.map +1 -0
  6. package/dist/chunk-DCJM6GN5.js +264 -0
  7. package/dist/chunk-DCJM6GN5.js.map +1 -0
  8. package/dist/chunk-KWWJRUIK.js +54 -0
  9. package/dist/chunk-KWWJRUIK.js.map +1 -0
  10. package/dist/chunk-XAIEVBMU.js +212 -0
  11. package/dist/chunk-XAIEVBMU.js.map +1 -0
  12. package/dist/delete-policy.d.ts +11 -0
  13. package/dist/delete-policy.d.ts.map +1 -0
  14. package/dist/index.d.ts +31 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +545 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/plugin.d.ts +110 -0
  19. package/dist/plugin.d.ts.map +1 -0
  20. package/dist/plugin.js +21 -0
  21. package/dist/plugin.js.map +1 -0
  22. package/dist/relations/index.d.ts +105 -0
  23. package/dist/relations/index.d.ts.map +1 -0
  24. package/dist/relations/index.js +9 -0
  25. package/dist/relations/index.js.map +1 -0
  26. package/dist/schema/action-journal.d.ts +386 -0
  27. package/dist/schema/action-journal.d.ts.map +1 -0
  28. package/dist/schema/audit-archive.d.ts +934 -0
  29. package/dist/schema/audit-archive.d.ts.map +1 -0
  30. package/dist/schema/audit-events.d.ts +502 -0
  31. package/dist/schema/audit-events.d.ts.map +1 -0
  32. package/dist/schema/audit-logs.d.ts +418 -0
  33. package/dist/schema/audit-logs.d.ts.map +1 -0
  34. package/dist/schema/auth.d.ts +2727 -0
  35. package/dist/schema/auth.d.ts.map +1 -0
  36. package/dist/schema/billing.d.ts +3969 -0
  37. package/dist/schema/billing.d.ts.map +1 -0
  38. package/dist/schema/common.d.ts +87 -0
  39. package/dist/schema/common.d.ts.map +1 -0
  40. package/dist/schema/currency.d.ts +791 -0
  41. package/dist/schema/currency.d.ts.map +1 -0
  42. package/dist/schema/entity-extensions.d.ts +314 -0
  43. package/dist/schema/entity-extensions.d.ts.map +1 -0
  44. package/dist/schema/entity-ownerships.d.ts +862 -0
  45. package/dist/schema/entity-ownerships.d.ts.map +1 -0
  46. package/dist/schema/feature-flags.d.ts +770 -0
  47. package/dist/schema/feature-flags.d.ts.map +1 -0
  48. package/dist/schema/geo.d.ts +824 -0
  49. package/dist/schema/geo.d.ts.map +1 -0
  50. package/dist/schema/i18n.d.ts +1109 -0
  51. package/dist/schema/i18n.d.ts.map +1 -0
  52. package/dist/schema/index.d.ts +43 -0
  53. package/dist/schema/index.d.ts.map +1 -0
  54. package/dist/schema/index.js +507 -0
  55. package/dist/schema/index.js.map +1 -0
  56. package/dist/schema/media.d.ts +1147 -0
  57. package/dist/schema/media.d.ts.map +1 -0
  58. package/dist/schema/menus.d.ts +636 -0
  59. package/dist/schema/menus.d.ts.map +1 -0
  60. package/dist/schema/notification-channels.d.ts +288 -0
  61. package/dist/schema/notification-channels.d.ts.map +1 -0
  62. package/dist/schema/notification-preferences.d.ts +300 -0
  63. package/dist/schema/notification-preferences.d.ts.map +1 -0
  64. package/dist/schema/notification-templates.d.ts +476 -0
  65. package/dist/schema/notification-templates.d.ts.map +1 -0
  66. package/dist/schema/notifications.d.ts +1139 -0
  67. package/dist/schema/notifications.d.ts.map +1 -0
  68. package/dist/schema/permission-fields.d.ts +96 -0
  69. package/dist/schema/permission-fields.d.ts.map +1 -0
  70. package/dist/schema/permissions.d.ts +173 -0
  71. package/dist/schema/permissions.d.ts.map +1 -0
  72. package/dist/schema/plugin-migrations.d.ts +204 -0
  73. package/dist/schema/plugin-migrations.d.ts.map +1 -0
  74. package/dist/schema/plugins.d.ts +1977 -0
  75. package/dist/schema/plugins.d.ts.map +1 -0
  76. package/dist/schema/relationships.d.ts +221 -0
  77. package/dist/schema/relationships.d.ts.map +1 -0
  78. package/dist/schema/role-permissions.d.ts +305 -0
  79. package/dist/schema/role-permissions.d.ts.map +1 -0
  80. package/dist/schema/roles.d.ts +260 -0
  81. package/dist/schema/roles.d.ts.map +1 -0
  82. package/dist/schema/scheduled-tasks.d.ts +1334 -0
  83. package/dist/schema/scheduled-tasks.d.ts.map +1 -0
  84. package/dist/schema/settings.d.ts +819 -0
  85. package/dist/schema/settings.d.ts.map +1 -0
  86. package/dist/schema/site-presentation.d.ts +1587 -0
  87. package/dist/schema/site-presentation.d.ts.map +1 -0
  88. package/dist/schema/teams.d.ts +381 -0
  89. package/dist/schema/teams.d.ts.map +1 -0
  90. package/dist/schema/web-design.d.ts +1542 -0
  91. package/dist/schema/web-design.d.ts.map +1 -0
  92. package/dist/schema/webhooks.d.ts +1016 -0
  93. package/dist/schema/webhooks.d.ts.map +1 -0
  94. package/dist/zod/index.d.ts +2 -0
  95. package/dist/zod/index.d.ts.map +1 -0
  96. package/dist/zod/index.js +6 -0
  97. package/dist/zod/index.js.map +1 -0
  98. package/package.json +63 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/schema/notifications.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;CAiBvB,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9D;;G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AE,iBAAiB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,iBAAiB,EAAE,CAAC;KACnC,CAAC;IACF,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Permission Fields Database Schema
3
+ *
4
+ * Predefined fields for business tables that support LBAC.
5
+ * Core may not use all fields, but plugins can extend them.
6
+ *
7
+ * Usage:
8
+ * ```typescript
9
+ * export const articles = pgTable('articles', {
10
+ * id: text('id').primaryKey(),
11
+ * organizationId: text('organization_id').notNull(),
12
+ * title: text('title').notNull(),
13
+ * ...permissionFields, // Spread permission fields
14
+ * });
15
+ * ```
16
+ */
17
+ /**
18
+ * Scope ownership fields
19
+ * - spaceId: Resource space (used by Space plugin)
20
+ * - teamId: Team ownership
21
+ */
22
+ export declare const scopeFields: {
23
+ /** Resource space ID (used by Space plugin, reserved by Core) */
24
+ spaceId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
25
+ /** Team ID (used by Team feature) */
26
+ teamId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
27
+ };
28
+ /**
29
+ * Person ownership fields
30
+ * - ownerId: Current owner (transferable)
31
+ * - creatorId: Original creator (immutable, for audit)
32
+ */
33
+ export declare const ownerFields: {
34
+ /** Current owner ID */
35
+ ownerId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
36
+ /** Original creator ID (for audit, preserved after ownership transfer) */
37
+ creatorId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
38
+ };
39
+ /**
40
+ * LBAC fields
41
+ * - aclTags: List of tags that allow access
42
+ * - denyTags: List of tags that deny access (higher priority than aclTags)
43
+ *
44
+ * Tag format: '{prefix}:{id}'
45
+ * Examples: 'user:123', 'org:456', 'team:tech', 'space:marketing'
46
+ */
47
+ export declare const lbacFields: {
48
+ /** Allow list - match any tag to grant access */
49
+ aclTags: import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetDimensions<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, 1>>>;
50
+ /** Deny list - match any tag to deny access (higher priority than allow) */
51
+ denyTags: import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetDimensions<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, 1>>>;
52
+ };
53
+ /**
54
+ * Complete permission fields (recommended for business tables)
55
+ *
56
+ * Includes:
57
+ * - spaceId, teamId (scope ownership)
58
+ * - ownerId, creatorId (person ownership)
59
+ * - aclTags, denyTags (LBAC)
60
+ */
61
+ export declare const permissionFields: {
62
+ /** Allow list - match any tag to grant access */
63
+ aclTags: import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetDimensions<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, 1>>>;
64
+ /** Deny list - match any tag to deny access (higher priority than allow) */
65
+ denyTags: import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").SetDimensions<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, 1>>>;
66
+ /** Current owner ID */
67
+ ownerId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
68
+ /** Original creator ID (for audit, preserved after ownership transfer) */
69
+ creatorId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
70
+ /** Resource space ID (used by Space plugin, reserved by Core) */
71
+ spaceId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
72
+ /** Team ID (used by Team feature) */
73
+ teamId: import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>;
74
+ };
75
+ /**
76
+ * LBAC index SQL generator
77
+ *
78
+ * Creates GIN indexes for aclTags and denyTags to accelerate queries
79
+ *
80
+ * @param tableName - Table name
81
+ * @returns SQL statement
82
+ */
83
+ export declare const createLbacIndexes: (tableName: string) => string;
84
+ /**
85
+ * Tag prefix constants
86
+ */
87
+ export declare const TagPrefix: {
88
+ readonly USER: "user";
89
+ readonly ORG: "org";
90
+ readonly TEAM: "team";
91
+ readonly SPACE: "space";
92
+ readonly ROLE: "role";
93
+ readonly PUBLIC: "public";
94
+ };
95
+ export type TagPrefixType = (typeof TagPrefix)[keyof typeof TagPrefix];
96
+ //# sourceMappingURL=permission-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission-fields.d.ts","sourceRoot":"","sources":["../../src/schema/permission-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH;;;;GAIG;AACH,eAAO,MAAM,WAAW;IACtB,iEAAiE;;IAGjE,qCAAqC;;CAEtC,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,WAAW;IACtB,uBAAuB;;IAGvB,0EAA0E;;CAE3E,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;IACrB,iDAAiD;;IAGjD,4EAA4E;;CAE7E,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;IAnB3B,iDAAiD;;IAGjD,4EAA4E;;IAvB5E,uBAAuB;;IAGvB,0EAA0E;;IApB1E,iEAAiE;;IAGjE,qCAAqC;;CAyDtC,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,WAGlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Permissions Table
3
+ *
4
+ * Stores capability definitions (Core + Plugin).
5
+ */
6
+ export declare const permissions: import("drizzle-orm/pg-core").PgTableWithColumns<{
7
+ name: "permissions";
8
+ schema: undefined;
9
+ columns: {
10
+ id: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>>, {
11
+ name: string;
12
+ tableName: "permissions";
13
+ dataType: "string";
14
+ data: string;
15
+ driverParam: string;
16
+ notNull: true;
17
+ hasDefault: true;
18
+ isPrimaryKey: false;
19
+ isAutoincrement: false;
20
+ hasRuntimeDefault: false;
21
+ enumValues: undefined;
22
+ identity: undefined;
23
+ generated: undefined;
24
+ }>;
25
+ capability: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
26
+ name: string;
27
+ tableName: "permissions";
28
+ dataType: "string";
29
+ data: string;
30
+ driverParam: string;
31
+ notNull: true;
32
+ hasDefault: false;
33
+ isPrimaryKey: false;
34
+ isAutoincrement: false;
35
+ hasRuntimeDefault: false;
36
+ enumValues: undefined;
37
+ identity: undefined;
38
+ generated: undefined;
39
+ }>;
40
+ source: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
41
+ name: string;
42
+ tableName: "permissions";
43
+ dataType: "string";
44
+ data: string;
45
+ driverParam: string;
46
+ notNull: true;
47
+ hasDefault: false;
48
+ isPrimaryKey: false;
49
+ isAutoincrement: false;
50
+ hasRuntimeDefault: false;
51
+ enumValues: undefined;
52
+ identity: undefined;
53
+ generated: undefined;
54
+ }>;
55
+ description: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
56
+ name: string;
57
+ tableName: "permissions";
58
+ dataType: "string";
59
+ data: string;
60
+ driverParam: string;
61
+ notNull: false;
62
+ hasDefault: false;
63
+ isPrimaryKey: false;
64
+ isAutoincrement: false;
65
+ hasRuntimeDefault: false;
66
+ enumValues: undefined;
67
+ identity: undefined;
68
+ generated: undefined;
69
+ }>;
70
+ createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
71
+ name: string;
72
+ tableName: "permissions";
73
+ dataType: "object date";
74
+ data: Date;
75
+ driverParam: string;
76
+ notNull: true;
77
+ hasDefault: true;
78
+ isPrimaryKey: false;
79
+ isAutoincrement: false;
80
+ hasRuntimeDefault: false;
81
+ enumValues: undefined;
82
+ identity: undefined;
83
+ generated: undefined;
84
+ }>;
85
+ };
86
+ dialect: "pg";
87
+ }>;
88
+ export declare const permissionSchema: import("drizzle-orm/zod").BuildSchema<"insert", {
89
+ id: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>>, {
90
+ name: string;
91
+ tableName: "permissions";
92
+ dataType: "string";
93
+ data: string;
94
+ driverParam: string;
95
+ notNull: true;
96
+ hasDefault: true;
97
+ isPrimaryKey: false;
98
+ isAutoincrement: false;
99
+ hasRuntimeDefault: false;
100
+ enumValues: undefined;
101
+ identity: undefined;
102
+ generated: undefined;
103
+ }>;
104
+ capability: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
105
+ name: string;
106
+ tableName: "permissions";
107
+ dataType: "string";
108
+ data: string;
109
+ driverParam: string;
110
+ notNull: true;
111
+ hasDefault: false;
112
+ isPrimaryKey: false;
113
+ isAutoincrement: false;
114
+ hasRuntimeDefault: false;
115
+ enumValues: undefined;
116
+ identity: undefined;
117
+ generated: undefined;
118
+ }>;
119
+ source: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
120
+ name: string;
121
+ tableName: "permissions";
122
+ dataType: "string";
123
+ data: string;
124
+ driverParam: string;
125
+ notNull: true;
126
+ hasDefault: false;
127
+ isPrimaryKey: false;
128
+ isAutoincrement: false;
129
+ hasRuntimeDefault: false;
130
+ enumValues: undefined;
131
+ identity: undefined;
132
+ generated: undefined;
133
+ }>;
134
+ description: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
135
+ name: string;
136
+ tableName: "permissions";
137
+ dataType: "string";
138
+ data: string;
139
+ driverParam: string;
140
+ notNull: false;
141
+ hasDefault: false;
142
+ isPrimaryKey: false;
143
+ isAutoincrement: false;
144
+ hasRuntimeDefault: false;
145
+ enumValues: undefined;
146
+ identity: undefined;
147
+ generated: undefined;
148
+ }>;
149
+ createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"permissions", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
150
+ name: string;
151
+ tableName: "permissions";
152
+ dataType: "object date";
153
+ data: Date;
154
+ driverParam: string;
155
+ notNull: true;
156
+ hasDefault: true;
157
+ isPrimaryKey: false;
158
+ isAutoincrement: false;
159
+ hasRuntimeDefault: false;
160
+ enumValues: undefined;
161
+ identity: undefined;
162
+ generated: undefined;
163
+ }>;
164
+ }, undefined, undefined>;
165
+ export type Permission = typeof permissions.$inferSelect;
166
+ export type InsertPermission = typeof permissions.$inferInsert;
167
+ /**
168
+ * Role-Permission Mapping (MVP: In-memory constant)
169
+ *
170
+ * Maps roles to capabilities. In production, this would be a database table.
171
+ */
172
+ export declare const ROLE_PERMISSIONS: Record<string, string[]>;
173
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/schema/permissions.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQtB,CAAC;AAMH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAkC,CAAC;AAMhE,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,YAAY,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,OAAO,WAAW,CAAC,YAAY,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAMrD,CAAC"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Plugin Migrations Table
3
+ *
4
+ * Tracks applied plugin database migrations by migration owner.
5
+ *
6
+ * Current runtime default:
7
+ * - the `organization_id` column stores the instance migration owner key
8
+ * - the reserved value `'default'` means "current deployment instance"
9
+ *
10
+ * This preserves the current table shape while the runtime model converges on
11
+ * instance-scoped schema ownership.
12
+ */
13
+ export declare const pluginMigrations: import("drizzle-orm/pg-core").PgTableWithColumns<{
14
+ name: "plugin_migrations";
15
+ schema: undefined;
16
+ columns: {
17
+ id: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>>, {
18
+ name: string;
19
+ tableName: "plugin_migrations";
20
+ dataType: "string";
21
+ data: string;
22
+ driverParam: string;
23
+ notNull: true;
24
+ hasDefault: true;
25
+ isPrimaryKey: false;
26
+ isAutoincrement: false;
27
+ hasRuntimeDefault: false;
28
+ enumValues: undefined;
29
+ identity: undefined;
30
+ generated: undefined;
31
+ }>;
32
+ pluginId: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
33
+ name: string;
34
+ tableName: "plugin_migrations";
35
+ dataType: "string";
36
+ data: string;
37
+ driverParam: string;
38
+ notNull: true;
39
+ hasDefault: false;
40
+ isPrimaryKey: false;
41
+ isAutoincrement: false;
42
+ hasRuntimeDefault: false;
43
+ enumValues: undefined;
44
+ identity: undefined;
45
+ generated: undefined;
46
+ }>;
47
+ organizationId: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
48
+ name: string;
49
+ tableName: "plugin_migrations";
50
+ dataType: "string";
51
+ data: string;
52
+ driverParam: string;
53
+ notNull: true;
54
+ hasDefault: false;
55
+ isPrimaryKey: false;
56
+ isAutoincrement: false;
57
+ hasRuntimeDefault: false;
58
+ enumValues: undefined;
59
+ identity: undefined;
60
+ generated: undefined;
61
+ }>;
62
+ migrationFile: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
63
+ name: string;
64
+ tableName: "plugin_migrations";
65
+ dataType: "string";
66
+ data: string;
67
+ driverParam: string;
68
+ notNull: true;
69
+ hasDefault: false;
70
+ isPrimaryKey: false;
71
+ isAutoincrement: false;
72
+ hasRuntimeDefault: false;
73
+ enumValues: undefined;
74
+ identity: undefined;
75
+ generated: undefined;
76
+ }>;
77
+ appliedAt: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
78
+ name: string;
79
+ tableName: "plugin_migrations";
80
+ dataType: "object date";
81
+ data: Date;
82
+ driverParam: string;
83
+ notNull: true;
84
+ hasDefault: true;
85
+ isPrimaryKey: false;
86
+ isAutoincrement: false;
87
+ hasRuntimeDefault: false;
88
+ enumValues: undefined;
89
+ identity: undefined;
90
+ generated: undefined;
91
+ }>;
92
+ checksum: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
93
+ name: string;
94
+ tableName: "plugin_migrations";
95
+ dataType: "string";
96
+ data: string;
97
+ driverParam: string;
98
+ notNull: true;
99
+ hasDefault: false;
100
+ isPrimaryKey: false;
101
+ isAutoincrement: false;
102
+ hasRuntimeDefault: false;
103
+ enumValues: undefined;
104
+ identity: undefined;
105
+ generated: undefined;
106
+ }>;
107
+ };
108
+ dialect: "pg";
109
+ }>;
110
+ export declare const pluginMigrationSchema: import("drizzle-orm/zod").BuildSchema<"insert", {
111
+ id: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetHasRuntimeDefault<import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>>, {
112
+ name: string;
113
+ tableName: "plugin_migrations";
114
+ dataType: "string";
115
+ data: string;
116
+ driverParam: string;
117
+ notNull: true;
118
+ hasDefault: true;
119
+ isPrimaryKey: false;
120
+ isAutoincrement: false;
121
+ hasRuntimeDefault: false;
122
+ enumValues: undefined;
123
+ identity: undefined;
124
+ generated: undefined;
125
+ }>;
126
+ pluginId: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
127
+ name: string;
128
+ tableName: "plugin_migrations";
129
+ dataType: "string";
130
+ data: string;
131
+ driverParam: string;
132
+ notNull: true;
133
+ hasDefault: false;
134
+ isPrimaryKey: false;
135
+ isAutoincrement: false;
136
+ hasRuntimeDefault: false;
137
+ enumValues: undefined;
138
+ identity: undefined;
139
+ generated: undefined;
140
+ }>;
141
+ organizationId: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
142
+ name: string;
143
+ tableName: "plugin_migrations";
144
+ dataType: "string";
145
+ data: string;
146
+ driverParam: string;
147
+ notNull: true;
148
+ hasDefault: false;
149
+ isPrimaryKey: false;
150
+ isAutoincrement: false;
151
+ hasRuntimeDefault: false;
152
+ enumValues: undefined;
153
+ identity: undefined;
154
+ generated: undefined;
155
+ }>;
156
+ migrationFile: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
157
+ name: string;
158
+ tableName: "plugin_migrations";
159
+ dataType: "string";
160
+ data: string;
161
+ driverParam: string;
162
+ notNull: true;
163
+ hasDefault: false;
164
+ isPrimaryKey: false;
165
+ isAutoincrement: false;
166
+ hasRuntimeDefault: false;
167
+ enumValues: undefined;
168
+ identity: undefined;
169
+ generated: undefined;
170
+ }>;
171
+ appliedAt: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
172
+ name: string;
173
+ tableName: "plugin_migrations";
174
+ dataType: "object date";
175
+ data: Date;
176
+ driverParam: string;
177
+ notNull: true;
178
+ hasDefault: true;
179
+ isPrimaryKey: false;
180
+ isAutoincrement: false;
181
+ hasRuntimeDefault: false;
182
+ enumValues: undefined;
183
+ identity: undefined;
184
+ generated: undefined;
185
+ }>;
186
+ checksum: import("drizzle-orm/pg-core").PgBuildColumn<"plugin_migrations", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
187
+ name: string;
188
+ tableName: "plugin_migrations";
189
+ dataType: "string";
190
+ data: string;
191
+ driverParam: string;
192
+ notNull: true;
193
+ hasDefault: false;
194
+ isPrimaryKey: false;
195
+ isAutoincrement: false;
196
+ hasRuntimeDefault: false;
197
+ enumValues: undefined;
198
+ identity: undefined;
199
+ generated: undefined;
200
+ }>;
201
+ }, undefined, undefined>;
202
+ export type PluginMigration = typeof pluginMigrations.$inferSelect;
203
+ export type InsertPluginMigration = typeof pluginMigrations.$inferInsert;
204
+ //# sourceMappingURL=plugin-migrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-migrations.d.ts","sourceRoot":"","sources":["../../src/schema/plugin-migrations.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB5B,CAAC;AAMF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAuC,CAAC;AAM1E,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAC;AACnE,MAAM,MAAM,qBAAqB,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAC"}