@authhero/aws-adapter 0.36.14 → 0.36.16

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 (50) hide show
  1. package/dist/aws-adapter.cjs +1 -0
  2. package/dist/aws-adapter.d.ts +393 -0
  3. package/dist/aws-adapter.mjs +2882 -0
  4. package/dist/tsconfig.types.tsbuildinfo +1 -0
  5. package/dist/types/adapters/actionExecutions.d.ts +9 -0
  6. package/dist/types/adapters/actionVersions.d.ts +8 -0
  7. package/dist/types/adapters/actions.d.ts +9 -0
  8. package/dist/types/adapters/authenticationMethods.d.ts +3 -0
  9. package/dist/types/adapters/branding.d.ts +3 -0
  10. package/dist/types/adapters/clientConnections.d.ts +3 -0
  11. package/dist/types/adapters/clientGrants.d.ts +3 -0
  12. package/dist/types/adapters/clientRegistrationTokens.d.ts +3 -0
  13. package/dist/types/adapters/clients.d.ts +3 -0
  14. package/dist/types/adapters/codes.d.ts +3 -0
  15. package/dist/types/adapters/connections.d.ts +3 -0
  16. package/dist/types/adapters/customDomains.d.ts +3 -0
  17. package/dist/types/adapters/customText.d.ts +3 -0
  18. package/dist/types/adapters/emailProviders.d.ts +3 -0
  19. package/dist/types/adapters/emailTemplates.d.ts +3 -0
  20. package/dist/types/adapters/flows.d.ts +3 -0
  21. package/dist/types/adapters/forms.d.ts +3 -0
  22. package/dist/types/adapters/hookCode.d.ts +3 -0
  23. package/dist/types/adapters/hooks.d.ts +3 -0
  24. package/dist/types/adapters/invites.d.ts +3 -0
  25. package/dist/types/adapters/keys.d.ts +3 -0
  26. package/dist/types/adapters/loginSessions.d.ts +3 -0
  27. package/dist/types/adapters/logs.d.ts +3 -0
  28. package/dist/types/adapters/organizationConnections.d.ts +3 -0
  29. package/dist/types/adapters/organizations.d.ts +3 -0
  30. package/dist/types/adapters/passwords.d.ts +3 -0
  31. package/dist/types/adapters/promptSettings.d.ts +3 -0
  32. package/dist/types/adapters/proxyData.d.ts +3 -0
  33. package/dist/types/adapters/proxyRoutes.d.ts +3 -0
  34. package/dist/types/adapters/refreshTokens.d.ts +3 -0
  35. package/dist/types/adapters/resourceServers.d.ts +3 -0
  36. package/dist/types/adapters/rolePermissions.d.ts +3 -0
  37. package/dist/types/adapters/roles.d.ts +3 -0
  38. package/dist/types/adapters/sessions.d.ts +3 -0
  39. package/dist/types/adapters/tenants.d.ts +3 -0
  40. package/dist/types/adapters/themes.d.ts +3 -0
  41. package/dist/types/adapters/universalLoginTemplates.d.ts +3 -0
  42. package/dist/types/adapters/userOrganizations.d.ts +3 -0
  43. package/dist/types/adapters/userPermissions.d.ts +3 -0
  44. package/dist/types/adapters/userRoles.d.ts +3 -0
  45. package/dist/types/adapters/users.d.ts +3 -0
  46. package/dist/types/index.d.ts +61 -0
  47. package/dist/types/keys.d.ts +202 -0
  48. package/dist/types/types.d.ts +27 -0
  49. package/dist/types/utils.d.ts +69 -0
  50. package/package.json +3 -3
@@ -0,0 +1,9 @@
1
+ import { ActionExecutionsAdapter } from "@authhero/adapter-interfaces";
2
+ /**
3
+ * Stub action-executions adapter for the DynamoDB backend.
4
+ *
5
+ * Mirrors the actions/actionVersions adapters — the Actions feature is not
6
+ * implemented in AWS. Any call throws so the gap is obvious rather than
7
+ * silently returning empty results.
8
+ */
9
+ export declare function createActionExecutionsAdapter(): ActionExecutionsAdapter;
@@ -0,0 +1,8 @@
1
+ import { ActionVersionsAdapter } from "@authhero/adapter-interfaces";
2
+ /**
3
+ * Stub action-versions adapter for the DynamoDB backend.
4
+ *
5
+ * Mirrors the actions adapter — both are unimplemented in AWS. Any call
6
+ * throws so the gap is obvious rather than silently returning empty results.
7
+ */
8
+ export declare function createActionVersionsAdapter(): ActionVersionsAdapter;
@@ -0,0 +1,9 @@
1
+ import { ActionsAdapter } from "@authhero/adapter-interfaces";
2
+ /**
3
+ * Stub actions adapter for the DynamoDB backend.
4
+ *
5
+ * The Actions feature has not yet been implemented for DynamoDB. Any attempt
6
+ * to read or write actions on this backend throws at runtime so the gap is
7
+ * obvious rather than silently returning empty results.
8
+ */
9
+ export declare function createActionsAdapter(): ActionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { AuthenticationMethodsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createAuthenticationMethodsAdapter(ctx: DynamoDBContext): AuthenticationMethodsAdapter;
@@ -0,0 +1,3 @@
1
+ import { BrandingAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createBrandingAdapter(ctx: DynamoDBContext): BrandingAdapter;
@@ -0,0 +1,3 @@
1
+ import { ClientConnectionsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createClientConnectionsAdapter(ctx: DynamoDBContext): ClientConnectionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { ClientGrantsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createClientGrantsAdapter(ctx: DynamoDBContext): ClientGrantsAdapter;
@@ -0,0 +1,3 @@
1
+ import { ClientRegistrationTokensAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createClientRegistrationTokensAdapter(ctx: DynamoDBContext): ClientRegistrationTokensAdapter;
@@ -0,0 +1,3 @@
1
+ import { ClientsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createClientsAdapter(ctx: DynamoDBContext): ClientsAdapter;
@@ -0,0 +1,3 @@
1
+ import { CodesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createCodesAdapter(ctx: DynamoDBContext): CodesAdapter;
@@ -0,0 +1,3 @@
1
+ import { ConnectionsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createConnectionsAdapter(ctx: DynamoDBContext): ConnectionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { CustomDomainsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createCustomDomainsAdapter(ctx: DynamoDBContext): CustomDomainsAdapter;
@@ -0,0 +1,3 @@
1
+ import { CustomTextAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createCustomTextAdapter(ctx: DynamoDBContext): CustomTextAdapter;
@@ -0,0 +1,3 @@
1
+ import { EmailProvidersAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createEmailProvidersAdapter(ctx: DynamoDBContext): EmailProvidersAdapter;
@@ -0,0 +1,3 @@
1
+ import { EmailTemplatesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createEmailTemplatesAdapter(ctx: DynamoDBContext): EmailTemplatesAdapter;
@@ -0,0 +1,3 @@
1
+ import { FlowsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createFlowsAdapter(ctx: DynamoDBContext): FlowsAdapter;
@@ -0,0 +1,3 @@
1
+ import { FormsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createFormsAdapter(ctx: DynamoDBContext): FormsAdapter;
@@ -0,0 +1,3 @@
1
+ import { HookCodeAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createHookCodeAdapter(ctx: DynamoDBContext): HookCodeAdapter;
@@ -0,0 +1,3 @@
1
+ import { HooksAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createHooksAdapter(ctx: DynamoDBContext): HooksAdapter;
@@ -0,0 +1,3 @@
1
+ import { InvitesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createInvitesAdapter(ctx: DynamoDBContext): InvitesAdapter;
@@ -0,0 +1,3 @@
1
+ import { KeysAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createKeysAdapter(ctx: DynamoDBContext): KeysAdapter;
@@ -0,0 +1,3 @@
1
+ import { LoginSessionsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createLoginSessionsAdapter(ctx: DynamoDBContext): LoginSessionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { LogsDataAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createLogsAdapter(ctx: DynamoDBContext): LogsDataAdapter;
@@ -0,0 +1,3 @@
1
+ import { OrganizationConnectionsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createOrganizationConnectionsAdapter(ctx: DynamoDBContext): OrganizationConnectionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { OrganizationsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createOrganizationsAdapter(ctx: DynamoDBContext): OrganizationsAdapter;
@@ -0,0 +1,3 @@
1
+ import { PasswordsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createPasswordsAdapter(ctx: DynamoDBContext): PasswordsAdapter;
@@ -0,0 +1,3 @@
1
+ import { PromptSettingsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createPromptSettingsAdapter(ctx: DynamoDBContext): PromptSettingsAdapter;
@@ -0,0 +1,3 @@
1
+ import type { ProxyDataAdapter } from "@authhero/proxy";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createProxyDataAdapter(ctx: DynamoDBContext): ProxyDataAdapter;
@@ -0,0 +1,3 @@
1
+ import type { ProxyRoutesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createProxyRoutesAdapter(ctx: DynamoDBContext): ProxyRoutesAdapter;
@@ -0,0 +1,3 @@
1
+ import { RefreshTokensAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createRefreshTokensAdapter(ctx: DynamoDBContext): RefreshTokensAdapter;
@@ -0,0 +1,3 @@
1
+ import { ResourceServersAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createResourceServersAdapter(ctx: DynamoDBContext): ResourceServersAdapter;
@@ -0,0 +1,3 @@
1
+ import { RolePermissionsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createRolePermissionsAdapter(ctx: DynamoDBContext): RolePermissionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { RolesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createRolesAdapter(ctx: DynamoDBContext): RolesAdapter;
@@ -0,0 +1,3 @@
1
+ import { SessionsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createSessionsAdapter(ctx: DynamoDBContext): SessionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { TenantsDataAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createTenantsAdapter(ctx: DynamoDBContext): TenantsDataAdapter;
@@ -0,0 +1,3 @@
1
+ import { ThemesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createThemesAdapter(ctx: DynamoDBContext): ThemesAdapter;
@@ -0,0 +1,3 @@
1
+ import { UniversalLoginTemplatesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createUniversalLoginTemplatesAdapter(ctx: DynamoDBContext): UniversalLoginTemplatesAdapter;
@@ -0,0 +1,3 @@
1
+ import { UserOrganizationsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createUserOrganizationsAdapter(ctx: DynamoDBContext): UserOrganizationsAdapter;
@@ -0,0 +1,3 @@
1
+ import { UserPermissionsAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createUserPermissionsAdapter(ctx: DynamoDBContext): UserPermissionsAdapter;
@@ -0,0 +1,3 @@
1
+ import { UserRolesAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createUserRolesAdapter(ctx: DynamoDBContext): UserRolesAdapter;
@@ -0,0 +1,3 @@
1
+ import { UserDataAdapter } from "@authhero/adapter-interfaces";
2
+ import { DynamoDBContext } from "../types";
3
+ export declare function createUsersAdapter(ctx: DynamoDBContext): UserDataAdapter;
@@ -0,0 +1,61 @@
1
+ import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
2
+ import { DataAdapters } from "@authhero/adapter-interfaces";
3
+ import { DynamoDBConfig } from "./types";
4
+ export type { DynamoDBConfig, DynamoDBContext } from "./types";
5
+ export { createProxyRoutesAdapter } from "./adapters/proxyRoutes";
6
+ export { createProxyDataAdapter } from "./adapters/proxyData";
7
+ /**
8
+ * Create all DynamoDB adapters for AuthHero
9
+ *
10
+ * @param client - DynamoDB Document Client instance
11
+ * @param config - Configuration options including table name
12
+ * @returns DataAdapters object with all adapter implementations
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
17
+ * import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
18
+ * import createAdapters from "@authhero/aws-adapter";
19
+ *
20
+ * const client = new DynamoDBClient({});
21
+ * const docClient = DynamoDBDocumentClient.from(client);
22
+ *
23
+ * const adapters = createAdapters(docClient, {
24
+ * tableName: "authhero",
25
+ * });
26
+ * ```
27
+ */
28
+ export default function createAdapters(client: DynamoDBDocumentClient, config: DynamoDBConfig): DataAdapters;
29
+ export { createTenantsAdapter } from "./adapters/tenants";
30
+ export { createUsersAdapter } from "./adapters/users";
31
+ export { createSessionsAdapter } from "./adapters/sessions";
32
+ export { createPasswordsAdapter } from "./adapters/passwords";
33
+ export { createCodesAdapter } from "./adapters/codes";
34
+ export { createClientsAdapter } from "./adapters/clients";
35
+ export { createClientGrantsAdapter } from "./adapters/clientGrants";
36
+ export { createClientConnectionsAdapter } from "./adapters/clientConnections";
37
+ export { createConnectionsAdapter } from "./adapters/connections";
38
+ export { createLoginSessionsAdapter } from "./adapters/loginSessions";
39
+ export { createBrandingAdapter } from "./adapters/branding";
40
+ export { createHooksAdapter } from "./adapters/hooks";
41
+ export { createKeysAdapter } from "./adapters/keys";
42
+ export { createCustomDomainsAdapter } from "./adapters/customDomains";
43
+ export { createLogsAdapter } from "./adapters/logs";
44
+ export { createThemesAdapter } from "./adapters/themes";
45
+ export { createPromptSettingsAdapter } from "./adapters/promptSettings";
46
+ export { createEmailProvidersAdapter } from "./adapters/emailProviders";
47
+ export { createRefreshTokensAdapter } from "./adapters/refreshTokens";
48
+ export { createFormsAdapter } from "./adapters/forms";
49
+ export { createResourceServersAdapter } from "./adapters/resourceServers";
50
+ export { createRolesAdapter } from "./adapters/roles";
51
+ export { createRolePermissionsAdapter } from "./adapters/rolePermissions";
52
+ export { createUserPermissionsAdapter } from "./adapters/userPermissions";
53
+ export { createUserRolesAdapter } from "./adapters/userRoles";
54
+ export { createOrganizationsAdapter } from "./adapters/organizations";
55
+ export { createOrganizationConnectionsAdapter } from "./adapters/organizationConnections";
56
+ export { createUserOrganizationsAdapter } from "./adapters/userOrganizations";
57
+ export { createInvitesAdapter } from "./adapters/invites";
58
+ export { createFlowsAdapter } from "./adapters/flows";
59
+ export { createAuthenticationMethodsAdapter } from "./adapters/authenticationMethods";
60
+ export * from "./keys";
61
+ export * from "./utils";
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Key generation utilities for single-table DynamoDB design
3
+ */
4
+ export declare const tenantKeys: {
5
+ pk: (tenantId: string) => string;
6
+ sk: () => string;
7
+ gsi1pk: () => string;
8
+ gsi1sk: (tenantId: string) => string;
9
+ };
10
+ export declare const userKeys: {
11
+ pk: (tenantId: string) => string;
12
+ sk: (userId: string) => string;
13
+ gsi1pk: (tenantId: string, email: string) => string;
14
+ gsi1sk: () => string;
15
+ gsi2pk: (tenantId: string, connection: string) => string;
16
+ gsi2sk: (userId: string) => string;
17
+ };
18
+ export declare const sessionKeys: {
19
+ pk: (tenantId: string) => string;
20
+ sk: (sessionId: string) => string;
21
+ gsi1pk: (tenantId: string, userId: string) => string;
22
+ gsi1sk: (sessionId: string) => string;
23
+ };
24
+ export declare const loginSessionKeys: {
25
+ pk: (tenantId: string) => string;
26
+ sk: (loginSessionId: string) => string;
27
+ };
28
+ export declare const clientKeys: {
29
+ pk: (tenantId: string) => string;
30
+ sk: (clientId: string) => string;
31
+ };
32
+ export declare const clientGrantKeys: {
33
+ pk: (tenantId: string) => string;
34
+ sk: (clientGrantId: string) => string;
35
+ gsi1pk: (tenantId: string, clientId: string) => string;
36
+ gsi1sk: (audience: string) => string;
37
+ };
38
+ export declare const connectionKeys: {
39
+ pk: (tenantId: string) => string;
40
+ sk: (connectionId: string) => string;
41
+ gsi1pk: (tenantId: string, connectionName: string) => string;
42
+ gsi1sk: () => string;
43
+ };
44
+ export declare const codeKeys: {
45
+ pk: (tenantId: string) => string;
46
+ sk: (codeId: string, codeType: string) => string;
47
+ skPrefixByCodeId: (codeId: string) => string;
48
+ };
49
+ export declare const passwordKeys: {
50
+ pk: (tenantId: string, userId: string) => string;
51
+ sk: (passwordId: string) => string;
52
+ skPrefix: () => string;
53
+ };
54
+ export declare const brandingKeys: {
55
+ pk: (tenantId: string) => string;
56
+ sk: () => string;
57
+ };
58
+ export declare const universalLoginTemplateKeys: {
59
+ pk: (tenantId: string) => string;
60
+ sk: () => string;
61
+ };
62
+ export declare const themeKeys: {
63
+ pk: (tenantId: string) => string;
64
+ sk: (themeId: string) => string;
65
+ };
66
+ export declare const hookKeys: {
67
+ pk: (tenantId: string) => string;
68
+ sk: (hookId: string) => string;
69
+ };
70
+ export declare const keyKeys: {
71
+ pk: () => string;
72
+ sk: (kid: string) => string;
73
+ };
74
+ export declare const customDomainKeys: {
75
+ pk: (tenantId: string) => string;
76
+ sk: (customDomainId: string) => string;
77
+ gsi1pk: (domain: string) => string;
78
+ gsi1sk: () => string;
79
+ };
80
+ export declare const proxyRouteKeys: {
81
+ pk: (tenantId: string) => string;
82
+ sk: (proxyRouteId: string) => string;
83
+ gsi1pk: (tenantId: string, customDomainId: string) => string;
84
+ gsi1sk: (proxyRouteId: string) => string;
85
+ };
86
+ export declare const logKeys: {
87
+ pk: (tenantId: string) => string;
88
+ sk: (logId: string) => string;
89
+ gsi1pk: (tenantId: string, date: string) => string;
90
+ gsi1sk: (logId: string) => string;
91
+ };
92
+ export declare const emailProviderKeys: {
93
+ pk: (tenantId: string) => string;
94
+ sk: () => string;
95
+ };
96
+ export declare const emailTemplateKeys: {
97
+ pk: (tenantId: string) => string;
98
+ sk: (templateName: string) => string;
99
+ skPrefix: () => string;
100
+ };
101
+ export declare const promptSettingsKeys: {
102
+ pk: (tenantId: string) => string;
103
+ sk: () => string;
104
+ };
105
+ export declare const refreshTokenKeys: {
106
+ pk: (tenantId: string) => string;
107
+ sk: (tokenId: string) => string;
108
+ gsi1pk: (tenantId: string, userId: string) => string;
109
+ gsi1sk: (tokenId: string) => string;
110
+ gsi2pk: (tenantId: string, tokenLookup: string) => string;
111
+ gsi2sk: () => string;
112
+ };
113
+ export declare const formKeys: {
114
+ pk: (tenantId: string) => string;
115
+ sk: (formId: string) => string;
116
+ };
117
+ export declare const flowKeys: {
118
+ pk: (tenantId: string) => string;
119
+ sk: (flowId: string) => string;
120
+ };
121
+ export declare const resourceServerKeys: {
122
+ pk: (tenantId: string) => string;
123
+ sk: (resourceServerId: string) => string;
124
+ gsi1pk: (tenantId: string, identifier: string) => string;
125
+ gsi1sk: () => string;
126
+ };
127
+ export declare const roleKeys: {
128
+ pk: (tenantId: string) => string;
129
+ sk: (roleId: string) => string;
130
+ };
131
+ export declare const rolePermissionKeys: {
132
+ pk: (tenantId: string, roleId: string) => string;
133
+ sk: (resourceServerIdentifier: string, permissionName: string) => string;
134
+ skPrefix: () => string;
135
+ };
136
+ export declare const userPermissionKeys: {
137
+ pk: (tenantId: string, userId: string, organizationId?: string) => string;
138
+ sk: (resourceServerIdentifier: string, permissionName: string) => string;
139
+ skPrefix: () => string;
140
+ };
141
+ export declare const userRoleKeys: {
142
+ pk: (tenantId: string, userId: string, organizationId?: string) => string;
143
+ sk: (roleId: string) => string;
144
+ skPrefix: () => string;
145
+ };
146
+ export declare const organizationKeys: {
147
+ pk: (tenantId: string) => string;
148
+ sk: (organizationId: string) => string;
149
+ gsi1pk: (tenantId: string, organizationName: string) => string;
150
+ gsi1sk: () => string;
151
+ };
152
+ export declare const userOrganizationKeys: {
153
+ pk: (tenantId: string) => string;
154
+ sk: (userOrganizationId: string) => string;
155
+ gsi1pk: (tenantId: string, userId: string) => string;
156
+ gsi1sk: (organizationId: string) => string;
157
+ gsi2pk: (tenantId: string, organizationId: string) => string;
158
+ gsi2sk: (userId: string) => string;
159
+ };
160
+ export declare const organizationConnectionKeys: {
161
+ pk: (tenantId: string, organizationId: string) => string;
162
+ sk: (connectionId: string) => string;
163
+ skPrefix: () => string;
164
+ };
165
+ export declare const inviteKeys: {
166
+ pk: (tenantId: string) => string;
167
+ sk: (inviteId: string) => string;
168
+ gsi1pk: (tenantId: string, organizationId: string) => string;
169
+ gsi1sk: (inviteId: string) => string;
170
+ };
171
+ export declare const legacyClientKeys: {
172
+ pk: () => string;
173
+ sk: (clientId: string) => string;
174
+ };
175
+ export declare const clientConnectionKeys: {
176
+ pk: (tenantId: string, clientId: string) => string;
177
+ sk: (connectionId: string, order: number) => string;
178
+ skPrefix: () => string;
179
+ gsi1pk: (tenantId: string, connectionId: string) => string;
180
+ gsi1sk: (clientId: string) => string;
181
+ };
182
+ export declare const authenticationMethodKeys: {
183
+ pk: (tenantId: string) => string;
184
+ sk: (methodId: string) => string;
185
+ gsi1pk: (tenantId: string, userId: string) => string;
186
+ gsi1sk: (methodId: string) => string;
187
+ gsi1skPrefix: () => string;
188
+ };
189
+ export declare const clientRegistrationTokenKeys: {
190
+ pk: (tenantId: string) => string;
191
+ sk: (tokenId: string) => string;
192
+ skPrefix: () => string;
193
+ gsi1pk: (tenantId: string, tokenHash: string) => string;
194
+ gsi1sk: () => string;
195
+ gsi2pk: (tenantId: string, clientId: string) => string;
196
+ gsi2sk: (tokenId: string) => string;
197
+ };
198
+ export declare const customTextKeys: {
199
+ pk: (tenantId: string) => string;
200
+ sk: (prompt: string, language: string) => string;
201
+ skPrefix: () => string;
202
+ };
@@ -0,0 +1,27 @@
1
+ import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
2
+ export interface DynamoDBConfig {
3
+ tableName: string;
4
+ }
5
+ export interface DynamoDBContext {
6
+ client: DynamoDBDocumentClient;
7
+ tableName: string;
8
+ }
9
+ /**
10
+ * Entity types for single-table design
11
+ */
12
+ export type EntityType = "FLOW" | "TENANT" | "USER" | "SESSION" | "LOGIN_SESSION" | "CLIENT" | "CLIENT_GRANT" | "CONNECTION" | "CODE" | "PASSWORD" | "BRANDING" | "THEME" | "HOOK" | "KEY" | "CUSTOM_DOMAIN" | "LOG" | "EMAIL_PROVIDER" | "EMAIL_TEMPLATE" | "PROMPT_SETTING" | "REFRESH_TOKEN" | "FORM" | "RESOURCE_SERVER" | "ROLE" | "ROLE_PERMISSION" | "USER_PERMISSION" | "USER_ROLE" | "ORGANIZATION" | "ORGANIZATION_CONNECTION" | "USER_ORGANIZATION" | "INVITE" | "LEGACY_CLIENT" | "CLIENT_CONNECTION" | "UNIVERSAL_LOGIN_TEMPLATE" | "CUSTOM_TEXT" | "AUTHENTICATION_METHOD" | "HOOK_CODE" | "CLIENT_REGISTRATION_TOKEN" | "PROXY_ROUTE";
13
+ /**
14
+ * Base DynamoDB item structure for single-table design
15
+ */
16
+ export interface DynamoDBBaseItem {
17
+ PK: string;
18
+ SK: string;
19
+ entityType: EntityType;
20
+ GSI1PK?: string;
21
+ GSI1SK?: string;
22
+ GSI2PK?: string;
23
+ GSI2SK?: string;
24
+ created_at: string;
25
+ updated_at: string;
26
+ ttl?: number;
27
+ }
@@ -0,0 +1,69 @@
1
+ import { DynamoDBContext, DynamoDBBaseItem } from "./types";
2
+ import { ListParams } from "@authhero/adapter-interfaces";
3
+ /**
4
+ * Transactional write operation for DynamoDB
5
+ * Allows multiple put/delete operations to be atomic
6
+ */
7
+ export declare function transactWriteItems(ctx: DynamoDBContext, items: Array<{
8
+ type: "put" | "delete";
9
+ item?: DynamoDBBaseItem;
10
+ pk?: string;
11
+ sk?: string;
12
+ conditionExpression?: string;
13
+ }>): Promise<void>;
14
+ /**
15
+ * Generic get operation for DynamoDB
16
+ */
17
+ export declare function getItem<T>(ctx: DynamoDBContext, pk: string, sk: string): Promise<T | null>;
18
+ /**
19
+ * Generic put operation for DynamoDB
20
+ * @param dynamoItem - The DynamoDB item with PK, SK, etc.
21
+ * @param options - Optional settings including condition expression
22
+ */
23
+ export declare function putItem(ctx: DynamoDBContext, dynamoItem: DynamoDBBaseItem, options?: {
24
+ conditionExpression?: string;
25
+ }): Promise<void>;
26
+ /**
27
+ * Generic delete operation for DynamoDB
28
+ */
29
+ export declare function deleteItem(ctx: DynamoDBContext, pk: string, sk: string): Promise<boolean>;
30
+ /**
31
+ * Generic query operation for DynamoDB
32
+ */
33
+ export declare function queryItems<T>(ctx: DynamoDBContext, pk: string, options?: {
34
+ skPrefix?: string;
35
+ skValue?: string;
36
+ indexName?: string;
37
+ limit?: number;
38
+ startKey?: Record<string, unknown>;
39
+ scanIndexForward?: boolean;
40
+ }): Promise<{
41
+ items: T[];
42
+ lastKey?: Record<string, unknown>;
43
+ }>;
44
+ /**
45
+ * Query with pagination support
46
+ */
47
+ export declare function queryWithPagination<T>(ctx: DynamoDBContext, pk: string, params?: ListParams, options?: {
48
+ skPrefix?: string;
49
+ indexName?: string;
50
+ scanIndexForward?: boolean;
51
+ }): Promise<{
52
+ items: T[];
53
+ start: number;
54
+ limit: number;
55
+ length: number;
56
+ total?: number;
57
+ }>;
58
+ /**
59
+ * Generic update operation for DynamoDB
60
+ */
61
+ export declare function updateItem(ctx: DynamoDBContext, pk: string, sk: string, updates: Record<string, unknown>): Promise<boolean>;
62
+ /**
63
+ * Remove DynamoDB metadata fields from an item
64
+ */
65
+ export declare function stripDynamoDBFields<T>(item: T): Omit<T, "PK" | "SK" | "GSI1PK" | "GSI1SK" | "GSI2PK" | "GSI2SK" | "entityType" | "ttl">;
66
+ /**
67
+ * Remove null/undefined properties from an object
68
+ */
69
+ export declare function removeNullProperties<T>(obj: T): T;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "0.36.14",
14
+ "version": "0.36.16",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -44,8 +44,8 @@
44
44
  "@aws-sdk/client-dynamodb": "^3.700.0",
45
45
  "@aws-sdk/lib-dynamodb": "^3.700.0",
46
46
  "nanoid": "^5.1.11",
47
- "@authhero/adapter-interfaces": "3.1.1",
48
- "@authhero/proxy": "0.7.1"
47
+ "@authhero/adapter-interfaces": "3.3.0",
48
+ "@authhero/proxy": "0.7.3"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "vite build && tsc -p tsconfig.types.json && rollup -c rollup.dts.config.mjs",