@haatlabs-core/db-core 0.15.1 → 0.16.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/dist/cjs/columns.d.ts +21 -0
- package/dist/cjs/columns.js +16 -0
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/repositories/user-identity.repository.d.ts +30 -0
- package/dist/cjs/repositories/user-identity.repository.js +69 -0
- package/dist/columns.d.ts +21 -0
- package/dist/columns.js +18 -0
- package/dist/columns.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/repositories/user-identity.repository.d.ts +30 -0
- package/dist/repositories/user-identity.repository.js +56 -0
- package/dist/repositories/user-identity.repository.js.map +1 -0
- package/package.json +6 -6
package/dist/cjs/columns.d.ts
CHANGED
|
@@ -101,6 +101,26 @@ export declare const extensionKeyIndexes: (t: {
|
|
|
101
101
|
organizationId: AnyPgColumn;
|
|
102
102
|
userId: AnyPgColumn;
|
|
103
103
|
}) => import("drizzle-orm/pg-core").IndexBuilder[];
|
|
104
|
+
/**
|
|
105
|
+
* A sign-in provider's account (Google, GitHub) that signs in as a user. Only which provider
|
|
106
|
+
* and its stable ID are kept, and the email it vouched for when linked: never its tokens.
|
|
107
|
+
*/
|
|
108
|
+
export declare const userIdentityColumns: (refs: {
|
|
109
|
+
users: Ref;
|
|
110
|
+
}) => {
|
|
111
|
+
createdAt: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTimestampBuilderInitial<"created_at">>>;
|
|
112
|
+
updatedAt: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTimestampBuilderInitial<"updated_at">>>;
|
|
113
|
+
id: import("drizzle-orm").HasDefault<import("drizzle-orm").IsPrimaryKey<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgUUIDBuilderInitial<"id">>>>;
|
|
114
|
+
userId: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgUUIDBuilderInitial<"user_id">>;
|
|
115
|
+
provider: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTextBuilderInitial<"provider", [string, ...string[]]>>;
|
|
116
|
+
providerUserId: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTextBuilderInitial<"provider_user_id", [string, ...string[]]>>;
|
|
117
|
+
emailAtLink: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTextBuilderInitial<"email_at_link", [string, ...string[]]>>;
|
|
118
|
+
};
|
|
119
|
+
export declare const userIdentityIndexes: (t: {
|
|
120
|
+
provider: AnyPgColumn;
|
|
121
|
+
providerUserId: AnyPgColumn;
|
|
122
|
+
userId: AnyPgColumn;
|
|
123
|
+
}) => (import("drizzle-orm/pg-core").UniqueConstraintBuilder | import("drizzle-orm/pg-core").IndexBuilder)[];
|
|
104
124
|
export declare const webhookEventColumns: (refs: {
|
|
105
125
|
organizations: Ref;
|
|
106
126
|
stores: Ref;
|
|
@@ -353,6 +373,7 @@ export type UsersTable = TableOf<'users', ReturnType<typeof userColumns>>;
|
|
|
353
373
|
export type OrganizationsTable = TableOf<'organizations', ReturnType<typeof organizationColumns>>;
|
|
354
374
|
export type MembershipsTable = TableOf<'memberships', ReturnType<typeof membershipColumns>>;
|
|
355
375
|
export type ApiKeysTable = TableOf<'api_keys', ReturnType<typeof apiKeyColumns>>;
|
|
376
|
+
export type UserIdentitiesTable = TableOf<'user_identities', ReturnType<typeof userIdentityColumns>>;
|
|
356
377
|
export type ExtensionKeysTable = TableOf<'extension_keys', ReturnType<typeof extensionKeyColumns>>;
|
|
357
378
|
export type WebhookEventsTable = TableOf<'webhook_events', ReturnType<typeof webhookEventColumns>>;
|
|
358
379
|
export type OutboxMessagesTable = TableOf<'outbox_messages', ReturnType<typeof outboxMessageColumns>>;
|
package/dist/cjs/columns.js
CHANGED
|
@@ -51,6 +51,8 @@ __export(columns_exports, {
|
|
|
51
51
|
usageRecordColumns: () => usageRecordColumns,
|
|
52
52
|
usageRecordIndexes: () => usageRecordIndexes,
|
|
53
53
|
userColumns: () => userColumns,
|
|
54
|
+
userIdentityColumns: () => userIdentityColumns,
|
|
55
|
+
userIdentityIndexes: () => userIdentityIndexes,
|
|
54
56
|
webhookEventColumns: () => webhookEventColumns
|
|
55
57
|
});
|
|
56
58
|
module.exports = __toCommonJS(columns_exports);
|
|
@@ -122,6 +124,18 @@ const extensionKeyColumns = (refs) => ({
|
|
|
122
124
|
const extensionKeyIndexes = (t) => [
|
|
123
125
|
(0, import_pg_core.index)("extension_keys_org_user_idx").on(t.organizationId, t.userId)
|
|
124
126
|
];
|
|
127
|
+
const userIdentityColumns = (refs) => ({
|
|
128
|
+
id: (0, import_pg_core.uuid)("id").primaryKey().defaultRandom(),
|
|
129
|
+
userId: (0, import_pg_core.uuid)("user_id").notNull().references(() => refs.users.id, { onDelete: "cascade" }),
|
|
130
|
+
provider: (0, import_pg_core.text)("provider").notNull(),
|
|
131
|
+
providerUserId: (0, import_pg_core.text)("provider_user_id").notNull(),
|
|
132
|
+
emailAtLink: (0, import_pg_core.text)("email_at_link").notNull(),
|
|
133
|
+
...timestamps()
|
|
134
|
+
});
|
|
135
|
+
const userIdentityIndexes = (t) => [
|
|
136
|
+
(0, import_pg_core.unique)("user_identities_provider_user_unique").on(t.provider, t.providerUserId),
|
|
137
|
+
(0, import_pg_core.index)("user_identities_user_idx").on(t.userId)
|
|
138
|
+
];
|
|
125
139
|
const webhookEventColumns = (refs) => ({
|
|
126
140
|
id: (0, import_pg_core.uuid)("id").primaryKey().defaultRandom(),
|
|
127
141
|
organizationId: (0, import_pg_core.uuid)("organization_id").notNull().references(() => refs.organizations.id, { onDelete: "cascade" }),
|
|
@@ -365,5 +379,7 @@ $$;`;
|
|
|
365
379
|
usageRecordColumns,
|
|
366
380
|
usageRecordIndexes,
|
|
367
381
|
userColumns,
|
|
382
|
+
userIdentityColumns,
|
|
383
|
+
userIdentityIndexes,
|
|
368
384
|
webhookEventColumns
|
|
369
385
|
});
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createDatabase } from './client.js';
|
|
2
2
|
export type { Database, DatabaseHandle, DatabaseLogger, Tx } from './client.js';
|
|
3
|
-
export { ORGANIZATION_GOES_FIRST_SQL, apiKeyColumns, auditLogColumns, auditLogIndexes, membershipColumns, membershipIndexes, organizationColumns, organizationFeatureColumns, organizationFeatureIndexes, allowanceGrantColumns, allowanceGrantIndexes, organizationOriginEnum, outboxMessageColumns, outboxMessageIndexes, outboxPriorityColumn, paymentEventColumns, paymentEventIndexes, planColumns, planFeatureColumns, planFeatureIndexes, planIndexes, planPriceColumns, planPriceIndexes, platformAdminColumns, roleEnum, shopifyInstallationColumns, subscriptionColumns, subscriptionStatusEnum, timestamps, usageRecordColumns, usageRecordIndexes, userColumns, webhookEventColumns, extensionKeyColumns, extensionKeyIndexes, } from './columns.js';
|
|
4
|
-
export type { ApiKeysTable, ExtensionKeysTable, AuditLogsTable, MembershipsTable, OrganizationsTable, OrganizationFeaturesTable, AllowanceGrantsTable, OutboxMessagesTable, PaymentEventsTable, PlanFeaturesTable, PlanPricesTable, PlansTable, PlatformAdminsTable, ShopifyInstallationsTable, SubscriptionsTable, UsageRecordsTable, UsersTable, WebhookEventsTable, } from './columns.js';
|
|
3
|
+
export { ORGANIZATION_GOES_FIRST_SQL, apiKeyColumns, auditLogColumns, auditLogIndexes, membershipColumns, membershipIndexes, organizationColumns, organizationFeatureColumns, organizationFeatureIndexes, allowanceGrantColumns, allowanceGrantIndexes, organizationOriginEnum, outboxMessageColumns, outboxMessageIndexes, outboxPriorityColumn, paymentEventColumns, paymentEventIndexes, planColumns, planFeatureColumns, planFeatureIndexes, planIndexes, planPriceColumns, planPriceIndexes, platformAdminColumns, roleEnum, shopifyInstallationColumns, subscriptionColumns, subscriptionStatusEnum, timestamps, usageRecordColumns, usageRecordIndexes, userColumns, webhookEventColumns, extensionKeyColumns, userIdentityColumns, userIdentityIndexes, extensionKeyIndexes, } from './columns.js';
|
|
4
|
+
export type { ApiKeysTable, ExtensionKeysTable, UserIdentitiesTable, AuditLogsTable, MembershipsTable, OrganizationsTable, OrganizationFeaturesTable, AllowanceGrantsTable, OutboxMessagesTable, PaymentEventsTable, PlanFeaturesTable, PlanPricesTable, PlansTable, PlatformAdminsTable, ShopifyInstallationsTable, SubscriptionsTable, UsageRecordsTable, UsersTable, WebhookEventsTable, } from './columns.js';
|
|
5
5
|
export { isUniqueViolation } from './errors.js';
|
|
6
6
|
export { runMigrations, runMigrationsCli } from './migrate.js';
|
|
7
7
|
export { ApiKeyRepository } from './repositories/api-key.repository.js';
|
|
@@ -9,6 +9,7 @@ export type { ApiKeyRow } from './repositories/api-key.repository.js';
|
|
|
9
9
|
export { ExtensionKeyRepository } from './repositories/extension-key.repository.js';
|
|
10
10
|
export type { ExtensionKeyRow } from './repositories/extension-key.repository.js';
|
|
11
11
|
export { IdentityRepository } from './repositories/identity.repository.js';
|
|
12
|
+
export { UserIdentityRepository } from './repositories/user-identity.repository.js';
|
|
12
13
|
export type { Role } from './repositories/identity.repository.js';
|
|
13
14
|
export { OutboxRepository } from './repositories/outbox.repository.js';
|
|
14
15
|
export type { OutboxMessage } from './repositories/outbox.repository.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
OutboxRepository: () => import_outbox_repository.OutboxRepository,
|
|
26
26
|
PlatformAdminRepository: () => import_platform_admin_repository.PlatformAdminRepository,
|
|
27
27
|
TENANT_SETTING: () => import_tenant.TENANT_SETTING,
|
|
28
|
+
UserIdentityRepository: () => import_user_identity_repository.UserIdentityRepository,
|
|
28
29
|
WebhookEventRepository: () => import_webhook_event_repository.WebhookEventRepository,
|
|
29
30
|
allowanceGrantColumns: () => import_columns.allowanceGrantColumns,
|
|
30
31
|
allowanceGrantIndexes: () => import_columns.allowanceGrantIndexes,
|
|
@@ -65,6 +66,8 @@ __export(index_exports, {
|
|
|
65
66
|
usageRecordColumns: () => import_columns.usageRecordColumns,
|
|
66
67
|
usageRecordIndexes: () => import_columns.usageRecordIndexes,
|
|
67
68
|
userColumns: () => import_columns.userColumns,
|
|
69
|
+
userIdentityColumns: () => import_columns.userIdentityColumns,
|
|
70
|
+
userIdentityIndexes: () => import_columns.userIdentityIndexes,
|
|
68
71
|
webhookEventColumns: () => import_columns.webhookEventColumns,
|
|
69
72
|
withTenant: () => import_tenant.withTenant
|
|
70
73
|
});
|
|
@@ -76,6 +79,7 @@ var import_migrate = require("./migrate.js");
|
|
|
76
79
|
var import_api_key_repository = require("./repositories/api-key.repository.js");
|
|
77
80
|
var import_extension_key_repository = require("./repositories/extension-key.repository.js");
|
|
78
81
|
var import_identity_repository = require("./repositories/identity.repository.js");
|
|
82
|
+
var import_user_identity_repository = require("./repositories/user-identity.repository.js");
|
|
79
83
|
var import_outbox_repository = require("./repositories/outbox.repository.js");
|
|
80
84
|
var import_platform_admin_repository = require("./repositories/platform-admin.repository.js");
|
|
81
85
|
var import_webhook_event_repository = require("./repositories/webhook-event.repository.js");
|
|
@@ -91,6 +95,7 @@ var import_writers = require("./writers.js");
|
|
|
91
95
|
OutboxRepository,
|
|
92
96
|
PlatformAdminRepository,
|
|
93
97
|
TENANT_SETTING,
|
|
98
|
+
UserIdentityRepository,
|
|
94
99
|
WebhookEventRepository,
|
|
95
100
|
allowanceGrantColumns,
|
|
96
101
|
allowanceGrantIndexes,
|
|
@@ -131,6 +136,8 @@ var import_writers = require("./writers.js");
|
|
|
131
136
|
usageRecordColumns,
|
|
132
137
|
usageRecordIndexes,
|
|
133
138
|
userColumns,
|
|
139
|
+
userIdentityColumns,
|
|
140
|
+
userIdentityIndexes,
|
|
134
141
|
webhookEventColumns,
|
|
135
142
|
withTenant
|
|
136
143
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Database } from '../client.js';
|
|
2
|
+
import type { AuditLogsTable, UserIdentitiesTable } from '../columns.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which user a sign-in provider's account (Google, GitHub) signs in as. Through the system
|
|
5
|
+
* connection only: the runtime role has no access.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UserIdentityRepository {
|
|
8
|
+
private readonly systemDb;
|
|
9
|
+
private readonly tables;
|
|
10
|
+
private readonly insertAudit;
|
|
11
|
+
constructor(systemDb: Database, tables: {
|
|
12
|
+
userIdentities: UserIdentitiesTable;
|
|
13
|
+
auditLogs: AuditLogsTable;
|
|
14
|
+
});
|
|
15
|
+
/** The user this provider account signs in as, or null if it has never signed in. */
|
|
16
|
+
findUserId(provider: string, providerUserId: string): Promise<string | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Records that the provider account signs in as the user. An account already linked stays
|
|
19
|
+
* with its first user. A new link to an account that was there before (`existingAccount`) is
|
|
20
|
+
* written to the audit log: a new way into it. A brand-new account's first link is not.
|
|
21
|
+
*/
|
|
22
|
+
link(input: {
|
|
23
|
+
userId: string;
|
|
24
|
+
organizationId: string;
|
|
25
|
+
provider: string;
|
|
26
|
+
providerUserId: string;
|
|
27
|
+
email: string;
|
|
28
|
+
existingAccount: boolean;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var user_identity_repository_exports = {};
|
|
19
|
+
__export(user_identity_repository_exports, {
|
|
20
|
+
UserIdentityRepository: () => UserIdentityRepository
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(user_identity_repository_exports);
|
|
23
|
+
var import_drizzle_orm = require("drizzle-orm");
|
|
24
|
+
var import_writers = require("../writers.js");
|
|
25
|
+
class UserIdentityRepository {
|
|
26
|
+
systemDb;
|
|
27
|
+
tables;
|
|
28
|
+
insertAudit;
|
|
29
|
+
constructor(systemDb, tables) {
|
|
30
|
+
this.systemDb = systemDb;
|
|
31
|
+
this.tables = tables;
|
|
32
|
+
this.insertAudit = (0, import_writers.createAuditWriter)(tables);
|
|
33
|
+
}
|
|
34
|
+
/** The user this provider account signs in as, or null if it has never signed in. */
|
|
35
|
+
async findUserId(provider, providerUserId) {
|
|
36
|
+
const t = this.tables.userIdentities;
|
|
37
|
+
const [row] = await this.systemDb.select({ userId: t.userId }).from(t).where((0, import_drizzle_orm.and)((0, import_drizzle_orm.eq)(t.provider, provider), (0, import_drizzle_orm.eq)(t.providerUserId, providerUserId))).limit(1);
|
|
38
|
+
return row?.userId ?? null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Records that the provider account signs in as the user. An account already linked stays
|
|
42
|
+
* with its first user. A new link to an account that was there before (`existingAccount`) is
|
|
43
|
+
* written to the audit log: a new way into it. A brand-new account's first link is not.
|
|
44
|
+
*/
|
|
45
|
+
async link(input) {
|
|
46
|
+
await this.systemDb.transaction(async (tx) => {
|
|
47
|
+
const inserted = await tx.insert(this.tables.userIdentities).values({
|
|
48
|
+
userId: input.userId,
|
|
49
|
+
provider: input.provider,
|
|
50
|
+
providerUserId: input.providerUserId,
|
|
51
|
+
emailAtLink: input.email
|
|
52
|
+
}).onConflictDoNothing().returning({ id: this.tables.userIdentities.id });
|
|
53
|
+
if (inserted.length === 0 || !input.existingAccount)
|
|
54
|
+
return;
|
|
55
|
+
await this.insertAudit(tx, {
|
|
56
|
+
organizationId: input.organizationId,
|
|
57
|
+
actor: `user:${input.userId}`,
|
|
58
|
+
action: "sign_in.identity_linked",
|
|
59
|
+
entityType: "organization",
|
|
60
|
+
entityId: input.organizationId,
|
|
61
|
+
metadata: { provider: input.provider }
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
UserIdentityRepository
|
|
69
|
+
});
|
package/dist/columns.d.ts
CHANGED
|
@@ -101,6 +101,26 @@ export declare const extensionKeyIndexes: (t: {
|
|
|
101
101
|
organizationId: AnyPgColumn;
|
|
102
102
|
userId: AnyPgColumn;
|
|
103
103
|
}) => import("drizzle-orm/pg-core").IndexBuilder[];
|
|
104
|
+
/**
|
|
105
|
+
* A sign-in provider's account (Google, GitHub) that signs in as a user. Only which provider
|
|
106
|
+
* and its stable ID are kept, and the email it vouched for when linked: never its tokens.
|
|
107
|
+
*/
|
|
108
|
+
export declare const userIdentityColumns: (refs: {
|
|
109
|
+
users: Ref;
|
|
110
|
+
}) => {
|
|
111
|
+
createdAt: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTimestampBuilderInitial<"created_at">>>;
|
|
112
|
+
updatedAt: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTimestampBuilderInitial<"updated_at">>>;
|
|
113
|
+
id: import("drizzle-orm").HasDefault<import("drizzle-orm").IsPrimaryKey<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgUUIDBuilderInitial<"id">>>>;
|
|
114
|
+
userId: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgUUIDBuilderInitial<"user_id">>;
|
|
115
|
+
provider: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTextBuilderInitial<"provider", [string, ...string[]]>>;
|
|
116
|
+
providerUserId: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTextBuilderInitial<"provider_user_id", [string, ...string[]]>>;
|
|
117
|
+
emailAtLink: import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTextBuilderInitial<"email_at_link", [string, ...string[]]>>;
|
|
118
|
+
};
|
|
119
|
+
export declare const userIdentityIndexes: (t: {
|
|
120
|
+
provider: AnyPgColumn;
|
|
121
|
+
providerUserId: AnyPgColumn;
|
|
122
|
+
userId: AnyPgColumn;
|
|
123
|
+
}) => (import("drizzle-orm/pg-core").UniqueConstraintBuilder | import("drizzle-orm/pg-core").IndexBuilder)[];
|
|
104
124
|
export declare const webhookEventColumns: (refs: {
|
|
105
125
|
organizations: Ref;
|
|
106
126
|
stores: Ref;
|
|
@@ -353,6 +373,7 @@ export type UsersTable = TableOf<'users', ReturnType<typeof userColumns>>;
|
|
|
353
373
|
export type OrganizationsTable = TableOf<'organizations', ReturnType<typeof organizationColumns>>;
|
|
354
374
|
export type MembershipsTable = TableOf<'memberships', ReturnType<typeof membershipColumns>>;
|
|
355
375
|
export type ApiKeysTable = TableOf<'api_keys', ReturnType<typeof apiKeyColumns>>;
|
|
376
|
+
export type UserIdentitiesTable = TableOf<'user_identities', ReturnType<typeof userIdentityColumns>>;
|
|
356
377
|
export type ExtensionKeysTable = TableOf<'extension_keys', ReturnType<typeof extensionKeyColumns>>;
|
|
357
378
|
export type WebhookEventsTable = TableOf<'webhook_events', ReturnType<typeof webhookEventColumns>>;
|
|
358
379
|
export type OutboxMessagesTable = TableOf<'outbox_messages', ReturnType<typeof outboxMessageColumns>>;
|
package/dist/columns.js
CHANGED
|
@@ -95,6 +95,24 @@ export const extensionKeyColumns = (refs) => ({
|
|
|
95
95
|
export const extensionKeyIndexes = (t) => [
|
|
96
96
|
index('extension_keys_org_user_idx').on(t.organizationId, t.userId),
|
|
97
97
|
];
|
|
98
|
+
/**
|
|
99
|
+
* A sign-in provider's account (Google, GitHub) that signs in as a user. Only which provider
|
|
100
|
+
* and its stable ID are kept, and the email it vouched for when linked: never its tokens.
|
|
101
|
+
*/
|
|
102
|
+
export const userIdentityColumns = (refs) => ({
|
|
103
|
+
id: uuid('id').primaryKey().defaultRandom(),
|
|
104
|
+
userId: uuid('user_id')
|
|
105
|
+
.notNull()
|
|
106
|
+
.references(() => refs.users.id, { onDelete: 'cascade' }),
|
|
107
|
+
provider: text('provider').notNull(),
|
|
108
|
+
providerUserId: text('provider_user_id').notNull(),
|
|
109
|
+
emailAtLink: text('email_at_link').notNull(),
|
|
110
|
+
...timestamps(),
|
|
111
|
+
});
|
|
112
|
+
export const userIdentityIndexes = (t) => [
|
|
113
|
+
unique('user_identities_provider_user_unique').on(t.provider, t.providerUserId),
|
|
114
|
+
index('user_identities_user_idx').on(t.userId),
|
|
115
|
+
];
|
|
98
116
|
export const webhookEventColumns = (refs) => ({
|
|
99
117
|
id: uuid('id').primaryKey().defaultRandom(),
|
|
100
118
|
organizationId: uuid('organization_id')
|
package/dist/columns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../src/columns.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,IAAI,GACL,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC;IAC/B,SAAS,EAAE,SAAS,CA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AAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;CAClF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAKrC,EAAE,EAAE,CAAC;IACJ,KAAK,CAAC,6BAA6B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;IAC7E,KAAK,CAAC,oCAAoC,EAAE,GAAG,CAAA,GAAG,CAAC,CAAC,QAAQ,MAAM,CAAC;CACpE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CACvC,OAAO,CAAC,UAAU,CAAC;KAChB,OAAO,EAAE;KACT,OAAO,CAAC,GAAG,CAAA,2BAA2B,CAAC,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiCvC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createDatabase } from './client.js';
|
|
2
2
|
export type { Database, DatabaseHandle, DatabaseLogger, Tx } from './client.js';
|
|
3
|
-
export { ORGANIZATION_GOES_FIRST_SQL, apiKeyColumns, auditLogColumns, auditLogIndexes, membershipColumns, membershipIndexes, organizationColumns, organizationFeatureColumns, organizationFeatureIndexes, allowanceGrantColumns, allowanceGrantIndexes, organizationOriginEnum, outboxMessageColumns, outboxMessageIndexes, outboxPriorityColumn, paymentEventColumns, paymentEventIndexes, planColumns, planFeatureColumns, planFeatureIndexes, planIndexes, planPriceColumns, planPriceIndexes, platformAdminColumns, roleEnum, shopifyInstallationColumns, subscriptionColumns, subscriptionStatusEnum, timestamps, usageRecordColumns, usageRecordIndexes, userColumns, webhookEventColumns, extensionKeyColumns, extensionKeyIndexes, } from './columns.js';
|
|
4
|
-
export type { ApiKeysTable, ExtensionKeysTable, AuditLogsTable, MembershipsTable, OrganizationsTable, OrganizationFeaturesTable, AllowanceGrantsTable, OutboxMessagesTable, PaymentEventsTable, PlanFeaturesTable, PlanPricesTable, PlansTable, PlatformAdminsTable, ShopifyInstallationsTable, SubscriptionsTable, UsageRecordsTable, UsersTable, WebhookEventsTable, } from './columns.js';
|
|
3
|
+
export { ORGANIZATION_GOES_FIRST_SQL, apiKeyColumns, auditLogColumns, auditLogIndexes, membershipColumns, membershipIndexes, organizationColumns, organizationFeatureColumns, organizationFeatureIndexes, allowanceGrantColumns, allowanceGrantIndexes, organizationOriginEnum, outboxMessageColumns, outboxMessageIndexes, outboxPriorityColumn, paymentEventColumns, paymentEventIndexes, planColumns, planFeatureColumns, planFeatureIndexes, planIndexes, planPriceColumns, planPriceIndexes, platformAdminColumns, roleEnum, shopifyInstallationColumns, subscriptionColumns, subscriptionStatusEnum, timestamps, usageRecordColumns, usageRecordIndexes, userColumns, webhookEventColumns, extensionKeyColumns, userIdentityColumns, userIdentityIndexes, extensionKeyIndexes, } from './columns.js';
|
|
4
|
+
export type { ApiKeysTable, ExtensionKeysTable, UserIdentitiesTable, AuditLogsTable, MembershipsTable, OrganizationsTable, OrganizationFeaturesTable, AllowanceGrantsTable, OutboxMessagesTable, PaymentEventsTable, PlanFeaturesTable, PlanPricesTable, PlansTable, PlatformAdminsTable, ShopifyInstallationsTable, SubscriptionsTable, UsageRecordsTable, UsersTable, WebhookEventsTable, } from './columns.js';
|
|
5
5
|
export { isUniqueViolation } from './errors.js';
|
|
6
6
|
export { runMigrations, runMigrationsCli } from './migrate.js';
|
|
7
7
|
export { ApiKeyRepository } from './repositories/api-key.repository.js';
|
|
@@ -9,6 +9,7 @@ export type { ApiKeyRow } from './repositories/api-key.repository.js';
|
|
|
9
9
|
export { ExtensionKeyRepository } from './repositories/extension-key.repository.js';
|
|
10
10
|
export type { ExtensionKeyRow } from './repositories/extension-key.repository.js';
|
|
11
11
|
export { IdentityRepository } from './repositories/identity.repository.js';
|
|
12
|
+
export { UserIdentityRepository } from './repositories/user-identity.repository.js';
|
|
12
13
|
export type { Role } from './repositories/identity.repository.js';
|
|
13
14
|
export { OutboxRepository } from './repositories/outbox.repository.js';
|
|
14
15
|
export type { OutboxMessage } from './repositories/outbox.repository.js';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { createDatabase } from './client.js';
|
|
2
|
-
export { ORGANIZATION_GOES_FIRST_SQL, apiKeyColumns, auditLogColumns, auditLogIndexes, membershipColumns, membershipIndexes, organizationColumns, organizationFeatureColumns, organizationFeatureIndexes, allowanceGrantColumns, allowanceGrantIndexes, organizationOriginEnum, outboxMessageColumns, outboxMessageIndexes, outboxPriorityColumn, paymentEventColumns, paymentEventIndexes, planColumns, planFeatureColumns, planFeatureIndexes, planIndexes, planPriceColumns, planPriceIndexes, platformAdminColumns, roleEnum, shopifyInstallationColumns, subscriptionColumns, subscriptionStatusEnum, timestamps, usageRecordColumns, usageRecordIndexes, userColumns, webhookEventColumns, extensionKeyColumns, extensionKeyIndexes, } from './columns.js';
|
|
2
|
+
export { ORGANIZATION_GOES_FIRST_SQL, apiKeyColumns, auditLogColumns, auditLogIndexes, membershipColumns, membershipIndexes, organizationColumns, organizationFeatureColumns, organizationFeatureIndexes, allowanceGrantColumns, allowanceGrantIndexes, organizationOriginEnum, outboxMessageColumns, outboxMessageIndexes, outboxPriorityColumn, paymentEventColumns, paymentEventIndexes, planColumns, planFeatureColumns, planFeatureIndexes, planIndexes, planPriceColumns, planPriceIndexes, platformAdminColumns, roleEnum, shopifyInstallationColumns, subscriptionColumns, subscriptionStatusEnum, timestamps, usageRecordColumns, usageRecordIndexes, userColumns, webhookEventColumns, extensionKeyColumns, userIdentityColumns, userIdentityIndexes, extensionKeyIndexes, } from './columns.js';
|
|
3
3
|
export { isUniqueViolation } from './errors.js';
|
|
4
4
|
export { runMigrations, runMigrationsCli } from './migrate.js';
|
|
5
5
|
export { ApiKeyRepository } from './repositories/api-key.repository.js';
|
|
6
6
|
export { ExtensionKeyRepository } from './repositories/extension-key.repository.js';
|
|
7
7
|
export { IdentityRepository } from './repositories/identity.repository.js';
|
|
8
|
+
export { UserIdentityRepository } from './repositories/user-identity.repository.js';
|
|
8
9
|
export { OutboxRepository } from './repositories/outbox.repository.js';
|
|
9
10
|
export { PlatformAdminRepository } from './repositories/platform-admin.repository.js';
|
|
10
11
|
export { WebhookEventRepository } from './repositories/webhook-event.repository.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,2BAA2B,EAC3B,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,2BAA2B,EAC3B,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAsBtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Database } from '../client.js';
|
|
2
|
+
import type { AuditLogsTable, UserIdentitiesTable } from '../columns.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which user a sign-in provider's account (Google, GitHub) signs in as. Through the system
|
|
5
|
+
* connection only: the runtime role has no access.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UserIdentityRepository {
|
|
8
|
+
private readonly systemDb;
|
|
9
|
+
private readonly tables;
|
|
10
|
+
private readonly insertAudit;
|
|
11
|
+
constructor(systemDb: Database, tables: {
|
|
12
|
+
userIdentities: UserIdentitiesTable;
|
|
13
|
+
auditLogs: AuditLogsTable;
|
|
14
|
+
});
|
|
15
|
+
/** The user this provider account signs in as, or null if it has never signed in. */
|
|
16
|
+
findUserId(provider: string, providerUserId: string): Promise<string | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Records that the provider account signs in as the user. An account already linked stays
|
|
19
|
+
* with its first user. A new link to an account that was there before (`existingAccount`) is
|
|
20
|
+
* written to the audit log: a new way into it. A brand-new account's first link is not.
|
|
21
|
+
*/
|
|
22
|
+
link(input: {
|
|
23
|
+
userId: string;
|
|
24
|
+
organizationId: string;
|
|
25
|
+
provider: string;
|
|
26
|
+
providerUserId: string;
|
|
27
|
+
email: string;
|
|
28
|
+
existingAccount: boolean;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { and, eq } from 'drizzle-orm';
|
|
2
|
+
import { createAuditWriter } from '../writers.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which user a sign-in provider's account (Google, GitHub) signs in as. Through the system
|
|
5
|
+
* connection only: the runtime role has no access.
|
|
6
|
+
*/
|
|
7
|
+
export class UserIdentityRepository {
|
|
8
|
+
systemDb;
|
|
9
|
+
tables;
|
|
10
|
+
insertAudit;
|
|
11
|
+
constructor(systemDb, tables) {
|
|
12
|
+
this.systemDb = systemDb;
|
|
13
|
+
this.tables = tables;
|
|
14
|
+
this.insertAudit = createAuditWriter(tables);
|
|
15
|
+
}
|
|
16
|
+
/** The user this provider account signs in as, or null if it has never signed in. */
|
|
17
|
+
async findUserId(provider, providerUserId) {
|
|
18
|
+
const t = this.tables.userIdentities;
|
|
19
|
+
const [row] = await this.systemDb
|
|
20
|
+
.select({ userId: t.userId })
|
|
21
|
+
.from(t)
|
|
22
|
+
.where(and(eq(t.provider, provider), eq(t.providerUserId, providerUserId)))
|
|
23
|
+
.limit(1);
|
|
24
|
+
return row?.userId ?? null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Records that the provider account signs in as the user. An account already linked stays
|
|
28
|
+
* with its first user. A new link to an account that was there before (`existingAccount`) is
|
|
29
|
+
* written to the audit log: a new way into it. A brand-new account's first link is not.
|
|
30
|
+
*/
|
|
31
|
+
async link(input) {
|
|
32
|
+
await this.systemDb.transaction(async (tx) => {
|
|
33
|
+
const inserted = await tx
|
|
34
|
+
.insert(this.tables.userIdentities)
|
|
35
|
+
.values({
|
|
36
|
+
userId: input.userId,
|
|
37
|
+
provider: input.provider,
|
|
38
|
+
providerUserId: input.providerUserId,
|
|
39
|
+
emailAtLink: input.email,
|
|
40
|
+
})
|
|
41
|
+
.onConflictDoNothing()
|
|
42
|
+
.returning({ id: this.tables.userIdentities.id });
|
|
43
|
+
if (inserted.length === 0 || !input.existingAccount)
|
|
44
|
+
return;
|
|
45
|
+
await this.insertAudit(tx, {
|
|
46
|
+
organizationId: input.organizationId,
|
|
47
|
+
actor: `user:${input.userId}`,
|
|
48
|
+
action: 'sign_in.identity_linked',
|
|
49
|
+
entityType: 'organization',
|
|
50
|
+
entityId: input.organizationId,
|
|
51
|
+
metadata: { provider: input.provider },
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=user-identity.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-identity.repository.js","sourceRoot":"","sources":["../../src/repositories/user-identity.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAGtC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mB,EAAE;iBACrB,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC;YACpD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe;gBAAE,OAAO;YAC5D,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE;gBACzB,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,KAAK,EAAE,QAAQ,KAAK,CAAC,MAAM,EAAE;gBAC7B,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,cAAc;gBAC1B,QAAQ,EAAE,KAAK,CAAC,cAAc;gBAC9B,QAAQ,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;aACvC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haatlabs-core/db-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "PostgreSQL and drizzle building blocks: shared columns, organizations, row-level security, audit logs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"haatlabs",
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
"drizzle-orm": "^0.45.3",
|
|
56
56
|
"pg": "^8.23.1",
|
|
57
57
|
"testcontainers": "^12.2.0",
|
|
58
|
-
"@haatlabs-core/tsconfig": "0.
|
|
59
|
-
"@haatlabs-core/vitest-config": "0.
|
|
58
|
+
"@haatlabs-core/tsconfig": "0.16.0",
|
|
59
|
+
"@haatlabs-core/vitest-config": "0.16.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@haatlabs-core/errors": "0.
|
|
63
|
-
"@haatlabs-core/observability": "0.
|
|
64
|
-
"@haatlabs-core/queue": "0.
|
|
62
|
+
"@haatlabs-core/errors": "0.16.0",
|
|
63
|
+
"@haatlabs-core/observability": "0.16.0",
|
|
64
|
+
"@haatlabs-core/queue": "0.16.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"drizzle-orm": "^0.45.3",
|