@withstudiocms/sdk 0.1.0-beta.1 → 0.1.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/consts.d.ts +10 -1
- package/dist/consts.js +12 -3
- package/dist/context.d.ts +36 -16
- package/dist/context.js +8 -1
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +6 -0
- package/dist/index.d.ts +341 -453
- package/dist/lib/pluginUtils.d.ts +4 -3
- package/dist/lib/pluginUtils.js +17 -10
- package/dist/lib/storage-manager.d.ts +10 -0
- package/dist/lib/storage-manager.js +17 -0
- package/dist/migrations/20251025T040912_init.d.ts +17 -0
- package/dist/migrations/20251025T040912_init.js +260 -0
- package/dist/migrations/20251130T150847_drop_deprecated.d.ts +13 -0
- package/dist/migrations/20251130T150847_drop_deprecated.js +262 -0
- package/dist/migrations/20251221T002125_url-mapping.d.ts +13 -0
- package/dist/migrations/20251221T002125_url-mapping.js +228 -0
- package/dist/migrator.d.ts +25 -0
- package/dist/migrator.js +21 -0
- package/dist/modules/auth/index.d.ts +60 -104
- package/dist/modules/auth/index.js +33 -9
- package/dist/modules/config/index.d.ts +5 -5
- package/dist/modules/config/index.js +26 -7
- package/dist/modules/delete/index.d.ts +2 -1
- package/dist/modules/delete/index.js +7 -2
- package/dist/modules/diffTracking/index.d.ts +8 -8
- package/dist/modules/diffTracking/index.js +7 -6
- package/dist/modules/get/index.d.ts +116 -16
- package/dist/modules/get/index.js +135 -22
- package/dist/modules/index.d.ts +326 -446
- package/dist/modules/init/index.d.ts +9 -9
- package/dist/modules/middleware/index.d.ts +2 -2
- package/dist/modules/notificationSettings/index.d.ts +3 -3
- package/dist/modules/plugins/index.d.ts +9 -8
- package/dist/modules/plugins/index.js +17 -6
- package/dist/modules/post/index.d.ts +29 -28
- package/dist/modules/post/index.js +47 -15
- package/dist/modules/resetTokenBucket/index.d.ts +1 -1
- package/dist/modules/resetTokenBucket/index.js +5 -2
- package/dist/modules/rest_api/index.d.ts +8 -8
- package/dist/modules/rest_api/index.js +7 -3
- package/dist/modules/update/index.d.ts +25 -25
- package/dist/modules/update/index.js +28 -10
- package/dist/modules/util/collectors.d.ts +14 -150
- package/dist/modules/util/collectors.js +41 -14
- package/dist/modules/util/folderTree.d.ts +4 -4
- package/dist/modules/util/folderTree.js +1 -1
- package/dist/modules/util/getFromNPM.d.ts +13 -5
- package/dist/modules/util/getFromNPM.js +8 -2
- package/dist/modules/util/index.d.ts +30 -166
- package/dist/modules/util/users.d.ts +7 -7
- package/dist/tables.d.ts +433 -0
- package/dist/tables.js +169 -0
- package/dist/types.d.ts +6 -7
- package/package.json +17 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* - Title: URL Mapping Table Migration
|
|
3
|
+
* - Created: 2025-12-21
|
|
4
|
+
* - Author: Adam Matthiesen
|
|
5
|
+
* - GitHub PR: #1085
|
|
6
|
+
* - Description: This migration creates the URL mapping table to manage URL mappings for the StudioCMS Storage Manager.
|
|
7
|
+
*/
|
|
8
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: Requirement from Kysely */
|
|
9
|
+
import type { Kysely } from '@withstudiocms/kysely/kysely';
|
|
10
|
+
import { type TableDefinition } from '@withstudiocms/kysely/utils/migrator';
|
|
11
|
+
export declare const schemaDefinition: TableDefinition[];
|
|
12
|
+
export declare function up(db: Kysely<any>): Promise<void>;
|
|
13
|
+
export declare function down(db: Kysely<any>): Promise<void>;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rollbackMigration,
|
|
3
|
+
syncDatabaseSchema
|
|
4
|
+
} from "@withstudiocms/kysely/utils/migrator";
|
|
5
|
+
import { schemaDefinition as previousSchema } from "./20251130T150847_drop_deprecated.js";
|
|
6
|
+
const schemaDefinition = [
|
|
7
|
+
{
|
|
8
|
+
name: "StudioCMSUsersTable",
|
|
9
|
+
columns: [
|
|
10
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
11
|
+
{ name: "url", type: "text" },
|
|
12
|
+
{ name: "name", type: "text", notNull: true },
|
|
13
|
+
{ name: "email", type: "text" },
|
|
14
|
+
{ name: "avatar", type: "text" },
|
|
15
|
+
{ name: "username", type: "text", notNull: true },
|
|
16
|
+
{ name: "password", type: "text" },
|
|
17
|
+
{ name: "updatedAt", type: "text", notNull: true },
|
|
18
|
+
{ name: "createdAt", type: "text", notNull: true, defaultSQL: "CURRENT_TIMESTAMP" },
|
|
19
|
+
{ name: "emailVerified", type: "integer", notNull: true, default: 0 },
|
|
20
|
+
{ name: "notifications", type: "text" }
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "StudioCMSOAuthAccounts",
|
|
25
|
+
columns: [
|
|
26
|
+
{ name: "providerUserId", type: "text", notNull: true },
|
|
27
|
+
{ name: "provider", type: "text", notNull: true },
|
|
28
|
+
{
|
|
29
|
+
name: "userId",
|
|
30
|
+
type: "text",
|
|
31
|
+
notNull: true,
|
|
32
|
+
references: { table: "StudioCMSUsersTable", column: "id" }
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "StudioCMSSessionTable",
|
|
38
|
+
columns: [
|
|
39
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
40
|
+
{
|
|
41
|
+
name: "userId",
|
|
42
|
+
type: "text",
|
|
43
|
+
notNull: true,
|
|
44
|
+
references: { table: "StudioCMSUsersTable", column: "id" }
|
|
45
|
+
},
|
|
46
|
+
{ name: "expiresAt", type: "text", notNull: true }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "StudioCMSPermissions",
|
|
51
|
+
columns: [
|
|
52
|
+
{
|
|
53
|
+
name: "user",
|
|
54
|
+
type: "text",
|
|
55
|
+
notNull: true,
|
|
56
|
+
references: { table: "StudioCMSUsersTable", column: "id" }
|
|
57
|
+
},
|
|
58
|
+
{ name: "rank", type: "text", notNull: true }
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "StudioCMSAPIKeys",
|
|
63
|
+
columns: [
|
|
64
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
65
|
+
{
|
|
66
|
+
name: "userId",
|
|
67
|
+
type: "text",
|
|
68
|
+
notNull: true,
|
|
69
|
+
references: { table: "StudioCMSUsersTable", column: "id" }
|
|
70
|
+
},
|
|
71
|
+
{ name: "key", type: "text", notNull: true },
|
|
72
|
+
{ name: "creationDate", type: "text", notNull: true },
|
|
73
|
+
{ name: "description", type: "text" }
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "StudioCMSUserResetTokens",
|
|
78
|
+
columns: [
|
|
79
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
80
|
+
{
|
|
81
|
+
name: "userId",
|
|
82
|
+
type: "text",
|
|
83
|
+
notNull: true,
|
|
84
|
+
references: { table: "StudioCMSUsersTable", column: "id" }
|
|
85
|
+
},
|
|
86
|
+
{ name: "token", type: "text", notNull: true }
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "StudioCMSPageFolderStructure",
|
|
91
|
+
columns: [
|
|
92
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
93
|
+
{ name: "name", type: "text", notNull: true },
|
|
94
|
+
{ name: "parent", type: "text" }
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "StudioCMSPageData",
|
|
99
|
+
columns: [
|
|
100
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
101
|
+
{ name: "package", type: "text", notNull: true },
|
|
102
|
+
{ name: "title", type: "text", notNull: true },
|
|
103
|
+
{ name: "description", type: "text", notNull: true },
|
|
104
|
+
{ name: "showOnNav", type: "integer", notNull: true, default: 0 },
|
|
105
|
+
{ name: "publishedAt", type: "text" },
|
|
106
|
+
{ name: "updatedAt", type: "text", notNull: true },
|
|
107
|
+
{ name: "slug", type: "text", notNull: true },
|
|
108
|
+
{ name: "contentLang", type: "text", notNull: true },
|
|
109
|
+
{ name: "heroImage", type: "text" },
|
|
110
|
+
{ name: "categories", type: "text", notNull: true, default: JSON.stringify([]) },
|
|
111
|
+
{ name: "tags", type: "text", notNull: true, default: JSON.stringify([]) },
|
|
112
|
+
{ name: "authorId", type: "text", notNull: true },
|
|
113
|
+
{ name: "contributorIds", type: "text", notNull: true, default: JSON.stringify([]) },
|
|
114
|
+
{ name: "showAuthor", type: "integer", notNull: true, default: 0 },
|
|
115
|
+
{ name: "showContributors", type: "integer", notNull: true, default: 0 },
|
|
116
|
+
{ name: "parentFolder", type: "text" },
|
|
117
|
+
{ name: "draft", type: "integer", notNull: true, default: 0 },
|
|
118
|
+
{ name: "augments", type: "text", notNull: true, default: JSON.stringify([]) }
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "StudioCMSDiffTracking",
|
|
123
|
+
columns: [
|
|
124
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
125
|
+
{
|
|
126
|
+
name: "pageId",
|
|
127
|
+
type: "text",
|
|
128
|
+
notNull: true,
|
|
129
|
+
references: { table: "StudioCMSPageData", column: "id" }
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "userId",
|
|
133
|
+
type: "text",
|
|
134
|
+
notNull: true,
|
|
135
|
+
references: { table: "StudioCMSUsersTable", column: "id" }
|
|
136
|
+
},
|
|
137
|
+
{ name: "timestamp", type: "text", notNull: true },
|
|
138
|
+
{ name: "pageMetaData", type: "text", notNull: true },
|
|
139
|
+
{ name: "pageContentStart", type: "text", notNull: true },
|
|
140
|
+
{ name: "diff", type: "text" }
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "StudioCMSPageDataTags",
|
|
145
|
+
columns: [
|
|
146
|
+
{ name: "id", type: "integer", primaryKey: true },
|
|
147
|
+
{ name: "description", type: "text", notNull: true },
|
|
148
|
+
{ name: "name", type: "text", notNull: true },
|
|
149
|
+
{ name: "slug", type: "text", notNull: true },
|
|
150
|
+
{ name: "meta", type: "text", notNull: true }
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "StudioCMSPageDataCategories",
|
|
155
|
+
columns: [
|
|
156
|
+
{ name: "id", type: "integer", primaryKey: true },
|
|
157
|
+
{ name: "parent", type: "integer" },
|
|
158
|
+
{ name: "description", type: "text", notNull: true },
|
|
159
|
+
{ name: "name", type: "text", notNull: true },
|
|
160
|
+
{ name: "slug", type: "text", notNull: true },
|
|
161
|
+
{ name: "meta", type: "text", notNull: true }
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "StudioCMSPageContent",
|
|
166
|
+
columns: [
|
|
167
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
168
|
+
{
|
|
169
|
+
name: "contentId",
|
|
170
|
+
type: "text",
|
|
171
|
+
notNull: true,
|
|
172
|
+
references: { table: "StudioCMSPageData", column: "id" }
|
|
173
|
+
},
|
|
174
|
+
{ name: "contentLang", type: "text", notNull: true },
|
|
175
|
+
{ name: "content", type: "text", notNull: true }
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "StudioCMSEmailVerificationTokens",
|
|
180
|
+
columns: [
|
|
181
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
182
|
+
{
|
|
183
|
+
name: "userId",
|
|
184
|
+
type: "text",
|
|
185
|
+
notNull: true,
|
|
186
|
+
references: { table: "StudioCMSUsersTable", column: "id" }
|
|
187
|
+
},
|
|
188
|
+
{ name: "token", type: "text", notNull: true },
|
|
189
|
+
{ name: "expiresAt", type: "text", notNull: true }
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "StudioCMSPluginData",
|
|
194
|
+
columns: [
|
|
195
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
196
|
+
{ name: "data", type: "text", notNull: true }
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "StudioCMSDynamicConfigSettings",
|
|
201
|
+
columns: [
|
|
202
|
+
{ name: "id", type: "text", primaryKey: true },
|
|
203
|
+
{ name: "data", type: "text", notNull: true }
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "StudioCMSStorageManagerUrlMappings",
|
|
208
|
+
columns: [
|
|
209
|
+
{ name: "identifier", type: "text", primaryKey: true },
|
|
210
|
+
{ name: "url", type: "text", notNull: true },
|
|
211
|
+
{ name: "isPermanent", type: "integer", notNull: true, default: 0 },
|
|
212
|
+
{ name: "expiresAt", type: "integer" },
|
|
213
|
+
{ name: "createdAt", type: "integer", notNull: true },
|
|
214
|
+
{ name: "updatedAt", type: "integer", notNull: true }
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
];
|
|
218
|
+
async function up(db) {
|
|
219
|
+
await syncDatabaseSchema(db, schemaDefinition, previousSchema);
|
|
220
|
+
}
|
|
221
|
+
async function down(db) {
|
|
222
|
+
await rollbackMigration(db, schemaDefinition, previousSchema);
|
|
223
|
+
}
|
|
224
|
+
export {
|
|
225
|
+
down,
|
|
226
|
+
schemaDefinition,
|
|
227
|
+
up
|
|
228
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: Kysely Requirement */
|
|
2
|
+
import type { Effect } from '@withstudiocms/effect';
|
|
3
|
+
import type { MigratorError } from '@withstudiocms/kysely/core/errors';
|
|
4
|
+
import type { Dialect, MigrationInfo, MigrationResultSet } from '@withstudiocms/kysely/kysely';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a live migrator instance bound to the package's migration folder.
|
|
7
|
+
*
|
|
8
|
+
* This convenience factory forwards the provided dialect to `makeMigratorLive`
|
|
9
|
+
* and binds the module's default `migrationFolder`, producing a migrator that
|
|
10
|
+
* runs migrations from the package's built-in migration directory.
|
|
11
|
+
*
|
|
12
|
+
* @template Schema - The database schema type; defaults to `StudioCMSDatabaseSchema`.
|
|
13
|
+
* @param dialect - The SQL dialect implementation to use (e.g. Postgres, MySQL, SQLite).
|
|
14
|
+
* @returns A migrator instance configured for the given dialect and the package migration folder.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const migrator = getMigratorLive<MySchema>(yourDriver);
|
|
18
|
+
* await migrator.migrateToLatest();
|
|
19
|
+
*/
|
|
20
|
+
export declare const getMigratorLive: <Schema>(dialect: Dialect) => Effect.Effect<{
|
|
21
|
+
readonly toLatest: Effect.Effect<MigrationResultSet, MigratorError, never>;
|
|
22
|
+
readonly down: Effect.Effect<MigrationResultSet, MigratorError, never>;
|
|
23
|
+
readonly up: Effect.Effect<MigrationResultSet, MigratorError, never>;
|
|
24
|
+
readonly status: Effect.Effect<readonly MigrationInfo[], MigratorError, never>;
|
|
25
|
+
}, MigratorError, never>;
|
package/dist/migrator.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeMigratorLive } from "@withstudiocms/kysely/core/migrator";
|
|
2
|
+
const importMigration = async (name) => {
|
|
3
|
+
if (import.meta.env?.VITEST) {
|
|
4
|
+
const migrations = import.meta.glob("../dist/migrations/*.js");
|
|
5
|
+
const migrationPath = `../dist/migrations/${name}.js`;
|
|
6
|
+
if (!migrations[migrationPath]) {
|
|
7
|
+
throw new Error(`Migration not found: ${name}`);
|
|
8
|
+
}
|
|
9
|
+
return await migrations[migrationPath]();
|
|
10
|
+
}
|
|
11
|
+
return await import(`./migrations/${name}.js`).then(({ up, down }) => ({ up, down }));
|
|
12
|
+
};
|
|
13
|
+
const migrationIndex = {
|
|
14
|
+
"20251025T040912_init": await importMigration("20251025T040912_init"),
|
|
15
|
+
"20251130T150847_drop_deprecated": await importMigration("20251130T150847_drop_deprecated"),
|
|
16
|
+
"20251221T002125_url-mapping": await importMigration("20251221T002125_url-mapping")
|
|
17
|
+
};
|
|
18
|
+
const getMigratorLive = (dialect) => makeMigratorLive(dialect, migrationIndex);
|
|
19
|
+
export {
|
|
20
|
+
getMigratorLive
|
|
21
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from '@withstudiocms/effect';
|
|
2
|
-
import {
|
|
2
|
+
import type { DBCallbackFailure } from '@withstudiocms/kysely/client';
|
|
3
3
|
import type { DatabaseError } from '@withstudiocms/kysely/core/errors';
|
|
4
4
|
import { DBClientLive, SDKDefaults } from '../../context.js';
|
|
5
5
|
import { type AuthDeletionResponse } from '../../types.js';
|
|
@@ -68,8 +68,9 @@ import { type AuthDeletionResponse } from '../../types.js';
|
|
|
68
68
|
* - Most DB operations will propagate DB-level failures as Effect errors that the caller
|
|
69
69
|
* can handle or map. Certain "delete" operations intentionally catch DB error tags and
|
|
70
70
|
* convert them to structured success/error result objects for convenience.
|
|
71
|
-
* - Insert/update operations
|
|
72
|
-
*
|
|
71
|
+
* - Insert/update operations execute within transactions, performing the write followed by
|
|
72
|
+
* a select of the affected row(s), ensuring atomicity and MySQL compatibility. Failed
|
|
73
|
+
* operations surface as runtime/DB errors within the Effect system.
|
|
73
74
|
*
|
|
74
75
|
* Usage notes
|
|
75
76
|
* - All exported operations are intended to be composed and executed inside the project's
|
|
@@ -97,8 +98,8 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
97
98
|
get: (input: string) => Effect.Effect<{
|
|
98
99
|
readonly id: string;
|
|
99
100
|
readonly userId: string;
|
|
100
|
-
readonly token: string;
|
|
101
101
|
readonly expiresAt: Date;
|
|
102
|
+
readonly token: string;
|
|
102
103
|
} | undefined, DBCallbackFailure | DatabaseError, never>;
|
|
103
104
|
/**
|
|
104
105
|
* Creates a new email verification token in the database.
|
|
@@ -109,8 +110,8 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
109
110
|
create: (userId: string) => Effect.Effect<{
|
|
110
111
|
readonly id: string;
|
|
111
112
|
readonly userId: string;
|
|
112
|
-
readonly token: string;
|
|
113
113
|
readonly expiresAt: Date;
|
|
114
|
+
readonly token: string;
|
|
114
115
|
}, DBCallbackFailure | DatabaseError | import("../util/generators.js").GeneratorError, never>;
|
|
115
116
|
/**
|
|
116
117
|
* Deletes an email verification token from the database.
|
|
@@ -227,17 +228,17 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
227
228
|
readonly expiresAt: Date;
|
|
228
229
|
};
|
|
229
230
|
user: {
|
|
230
|
-
readonly name: string;
|
|
231
231
|
readonly id: string;
|
|
232
|
-
readonly url
|
|
233
|
-
readonly
|
|
234
|
-
readonly
|
|
232
|
+
readonly url?: string | null | undefined;
|
|
233
|
+
readonly name: string;
|
|
234
|
+
readonly email?: string | null | undefined;
|
|
235
|
+
readonly avatar?: string | null | undefined;
|
|
235
236
|
readonly username: string;
|
|
236
|
-
readonly password
|
|
237
|
+
readonly password?: string | null | undefined;
|
|
237
238
|
readonly updatedAt: Date;
|
|
238
239
|
readonly createdAt: Date;
|
|
239
240
|
readonly emailVerified: boolean;
|
|
240
|
-
readonly notifications
|
|
241
|
+
readonly notifications?: string | null | undefined;
|
|
241
242
|
};
|
|
242
243
|
} | undefined, DBCallbackFailure | DatabaseError, never>;
|
|
243
244
|
/**
|
|
@@ -255,53 +256,7 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
255
256
|
*/
|
|
256
257
|
update: (input: {
|
|
257
258
|
readonly id: string;
|
|
258
|
-
readonly newDate:
|
|
259
|
-
toString: {};
|
|
260
|
-
toDateString: {};
|
|
261
|
-
toTimeString: {};
|
|
262
|
-
toLocaleString: {};
|
|
263
|
-
toLocaleDateString: {};
|
|
264
|
-
toLocaleTimeString: {};
|
|
265
|
-
valueOf: {};
|
|
266
|
-
getTime: {};
|
|
267
|
-
getFullYear: {};
|
|
268
|
-
getUTCFullYear: {};
|
|
269
|
-
getMonth: {};
|
|
270
|
-
getUTCMonth: {};
|
|
271
|
-
getDate: {};
|
|
272
|
-
getUTCDate: {};
|
|
273
|
-
getDay: {};
|
|
274
|
-
getUTCDay: {};
|
|
275
|
-
getHours: {};
|
|
276
|
-
getUTCHours: {};
|
|
277
|
-
getMinutes: {};
|
|
278
|
-
getUTCMinutes: {};
|
|
279
|
-
getSeconds: {};
|
|
280
|
-
getUTCSeconds: {};
|
|
281
|
-
getMilliseconds: {};
|
|
282
|
-
getUTCMilliseconds: {};
|
|
283
|
-
getTimezoneOffset: {};
|
|
284
|
-
setTime: {};
|
|
285
|
-
setMilliseconds: {};
|
|
286
|
-
setUTCMilliseconds: {};
|
|
287
|
-
setSeconds: {};
|
|
288
|
-
setUTCSeconds: {};
|
|
289
|
-
setMinutes: {};
|
|
290
|
-
setUTCMinutes: {};
|
|
291
|
-
setHours: {};
|
|
292
|
-
setUTCHours: {};
|
|
293
|
-
setDate: {};
|
|
294
|
-
setUTCDate: {};
|
|
295
|
-
setMonth: {};
|
|
296
|
-
setUTCMonth: {};
|
|
297
|
-
setFullYear: {};
|
|
298
|
-
setUTCFullYear: {};
|
|
299
|
-
toUTCString: {};
|
|
300
|
-
toISOString: {};
|
|
301
|
-
toJSON: {};
|
|
302
|
-
getVarDate: {};
|
|
303
|
-
[Symbol.toPrimitive]: {};
|
|
304
|
-
};
|
|
259
|
+
readonly newDate: Date;
|
|
305
260
|
}) => Effect.Effect<{
|
|
306
261
|
readonly id: string;
|
|
307
262
|
readonly userId: string;
|
|
@@ -317,29 +272,29 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
317
272
|
* @returns A promise that resolves to the created user.
|
|
318
273
|
*/
|
|
319
274
|
create: (userData: {
|
|
320
|
-
readonly name: string;
|
|
321
275
|
readonly id: string;
|
|
322
|
-
readonly url
|
|
323
|
-
readonly
|
|
324
|
-
readonly
|
|
276
|
+
readonly url?: string | null | undefined;
|
|
277
|
+
readonly name: string;
|
|
278
|
+
readonly email?: string | null | undefined;
|
|
279
|
+
readonly avatar?: string | null | undefined;
|
|
325
280
|
readonly username: string;
|
|
326
|
-
readonly password
|
|
281
|
+
readonly password?: string | null | undefined;
|
|
327
282
|
readonly updatedAt: string;
|
|
328
283
|
readonly createdAt: string | undefined;
|
|
329
284
|
readonly emailVerified: boolean;
|
|
330
|
-
readonly notifications
|
|
285
|
+
readonly notifications?: string | null | undefined;
|
|
331
286
|
}, rank: "owner" | "admin" | "editor" | "visitor" | "unknown") => Effect.Effect<{
|
|
332
|
-
readonly name: string;
|
|
333
287
|
readonly id: string;
|
|
334
|
-
readonly url
|
|
335
|
-
readonly
|
|
336
|
-
readonly
|
|
288
|
+
readonly url?: string | null | undefined;
|
|
289
|
+
readonly name: string;
|
|
290
|
+
readonly email?: string | null | undefined;
|
|
291
|
+
readonly avatar?: string | null | undefined;
|
|
337
292
|
readonly username: string;
|
|
338
|
-
readonly password
|
|
293
|
+
readonly password?: string | null | undefined;
|
|
339
294
|
readonly updatedAt: Date;
|
|
340
295
|
readonly createdAt: Date;
|
|
341
296
|
readonly emailVerified: boolean;
|
|
342
|
-
readonly notifications
|
|
297
|
+
readonly notifications?: string | null | undefined;
|
|
343
298
|
}, DBCallbackFailure | DatabaseError, never>;
|
|
344
299
|
/**
|
|
345
300
|
* Updates user data for a specified user.
|
|
@@ -350,29 +305,30 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
350
305
|
update: (input: {
|
|
351
306
|
readonly userId: string;
|
|
352
307
|
readonly userData: {
|
|
308
|
+
readonly id: string;
|
|
353
309
|
readonly url?: string | null | undefined;
|
|
310
|
+
readonly name: string;
|
|
354
311
|
readonly email?: string | null | undefined;
|
|
355
312
|
readonly avatar?: string | null | undefined;
|
|
356
|
-
readonly password?: string | null | undefined;
|
|
357
|
-
readonly notifications?: string | null | undefined;
|
|
358
|
-
readonly name: string;
|
|
359
|
-
readonly id: string;
|
|
360
313
|
readonly username: string;
|
|
314
|
+
readonly password?: string | null | undefined;
|
|
361
315
|
readonly updatedAt: string;
|
|
316
|
+
readonly createdAt: undefined;
|
|
362
317
|
readonly emailVerified: boolean;
|
|
318
|
+
readonly notifications?: string | null | undefined;
|
|
363
319
|
};
|
|
364
320
|
}) => Effect.Effect<{
|
|
365
|
-
readonly name: string;
|
|
366
321
|
readonly id: string;
|
|
367
|
-
readonly url
|
|
368
|
-
readonly
|
|
369
|
-
readonly
|
|
322
|
+
readonly url?: string | null | undefined;
|
|
323
|
+
readonly name: string;
|
|
324
|
+
readonly email?: string | null | undefined;
|
|
325
|
+
readonly avatar?: string | null | undefined;
|
|
370
326
|
readonly username: string;
|
|
371
|
-
readonly password
|
|
327
|
+
readonly password?: string | null | undefined;
|
|
372
328
|
readonly updatedAt: Date;
|
|
373
329
|
readonly createdAt: Date;
|
|
374
330
|
readonly emailVerified: boolean;
|
|
375
|
-
readonly notifications
|
|
331
|
+
readonly notifications?: string | null | undefined;
|
|
376
332
|
}, DBCallbackFailure | DatabaseError, never>;
|
|
377
333
|
/**
|
|
378
334
|
* Searches for users by username.
|
|
@@ -383,30 +339,30 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
383
339
|
*/
|
|
384
340
|
searchUsersForUsernameOrEmail: (username?: string | undefined, email?: string | undefined) => Effect.Effect<{
|
|
385
341
|
usernameSearch: {
|
|
386
|
-
readonly name: string;
|
|
387
342
|
readonly id: string;
|
|
388
|
-
readonly url
|
|
389
|
-
readonly
|
|
390
|
-
readonly
|
|
343
|
+
readonly url?: string | null | undefined;
|
|
344
|
+
readonly name: string;
|
|
345
|
+
readonly email?: string | null | undefined;
|
|
346
|
+
readonly avatar?: string | null | undefined;
|
|
391
347
|
readonly username: string;
|
|
392
|
-
readonly password
|
|
348
|
+
readonly password?: string | null | undefined;
|
|
393
349
|
readonly updatedAt: Date;
|
|
394
350
|
readonly createdAt: Date;
|
|
395
351
|
readonly emailVerified: boolean;
|
|
396
|
-
readonly notifications
|
|
352
|
+
readonly notifications?: string | null | undefined;
|
|
397
353
|
}[];
|
|
398
354
|
emailSearch: {
|
|
399
|
-
readonly name: string;
|
|
400
355
|
readonly id: string;
|
|
401
|
-
readonly url
|
|
402
|
-
readonly
|
|
403
|
-
readonly
|
|
356
|
+
readonly url?: string | null | undefined;
|
|
357
|
+
readonly name: string;
|
|
358
|
+
readonly email?: string | null | undefined;
|
|
359
|
+
readonly avatar?: string | null | undefined;
|
|
404
360
|
readonly username: string;
|
|
405
|
-
readonly password
|
|
361
|
+
readonly password?: string | null | undefined;
|
|
406
362
|
readonly updatedAt: Date;
|
|
407
363
|
readonly createdAt: Date;
|
|
408
364
|
readonly emailVerified: boolean;
|
|
409
|
-
readonly notifications
|
|
365
|
+
readonly notifications?: string | null | undefined;
|
|
410
366
|
}[];
|
|
411
367
|
}, DBCallbackFailure | DatabaseError, never>;
|
|
412
368
|
/**
|
|
@@ -427,17 +383,17 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
427
383
|
* @returns A promise that resolves to the ghost user.
|
|
428
384
|
*/
|
|
429
385
|
create: () => Effect.Effect<{
|
|
430
|
-
readonly name: string;
|
|
431
386
|
readonly id: string;
|
|
432
|
-
readonly url
|
|
433
|
-
readonly
|
|
434
|
-
readonly
|
|
387
|
+
readonly url?: string | null | undefined;
|
|
388
|
+
readonly name: string;
|
|
389
|
+
readonly email?: string | null | undefined;
|
|
390
|
+
readonly avatar?: string | null | undefined;
|
|
435
391
|
readonly username: string;
|
|
436
|
-
readonly password
|
|
392
|
+
readonly password?: string | null | undefined;
|
|
437
393
|
readonly updatedAt: Date;
|
|
438
394
|
readonly createdAt: Date;
|
|
439
395
|
readonly emailVerified: boolean;
|
|
440
|
-
readonly notifications
|
|
396
|
+
readonly notifications?: string | null | undefined;
|
|
441
397
|
}, DBCallbackFailure | DatabaseError, never>;
|
|
442
398
|
/**
|
|
443
399
|
* Retrieves the ghost user.
|
|
@@ -445,17 +401,17 @@ export declare const SDKAuthModule: Effect.Effect<{
|
|
|
445
401
|
* @returns A promise that resolves to the ghost user.
|
|
446
402
|
*/
|
|
447
403
|
get: () => Effect.Effect<{
|
|
448
|
-
readonly name: string;
|
|
449
404
|
readonly id: string;
|
|
450
|
-
readonly url
|
|
451
|
-
readonly
|
|
452
|
-
readonly
|
|
405
|
+
readonly url?: string | null | undefined;
|
|
406
|
+
readonly name: string;
|
|
407
|
+
readonly email?: string | null | undefined;
|
|
408
|
+
readonly avatar?: string | null | undefined;
|
|
453
409
|
readonly username: string;
|
|
454
|
-
readonly password
|
|
410
|
+
readonly password?: string | null | undefined;
|
|
455
411
|
readonly updatedAt: Date;
|
|
456
412
|
readonly createdAt: Date;
|
|
457
413
|
readonly emailVerified: boolean;
|
|
458
|
-
readonly notifications
|
|
414
|
+
readonly notifications?: string | null | undefined;
|
|
459
415
|
}, DBCallbackFailure | DatabaseError, never>;
|
|
460
416
|
};
|
|
461
417
|
};
|