@objectstack/plugin-auth 3.3.1 → 4.0.1
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +22 -0
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +22 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/objectql-adapter.test.ts +1 -1
- package/src/objectql-adapter.ts +22 -22
- package/tsconfig.json +12 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/plugin-auth@
|
|
2
|
+
> @objectstack/plugin-auth@4.0.1 build /home/runner/work/spec/spec/packages/plugins/plugin-auth
|
|
3
3
|
> tsup --config ../../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
╵ [32m~~~~~~~~~[0m
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
[32mCJS[39m [1mdist/index.js [22m[32m45.
|
|
70
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m94.
|
|
71
|
-
[32mCJS[39m ⚡️ Build success in
|
|
72
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m42.
|
|
73
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[32m93.
|
|
74
|
-
[32mESM[39m ⚡️ Build success in
|
|
69
|
+
[32mCJS[39m [1mdist/index.js [22m[32m45.60 KB[39m
|
|
70
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m94.42 KB[39m
|
|
71
|
+
[32mCJS[39m ⚡️ Build success in 77ms
|
|
72
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m42.11 KB[39m
|
|
73
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m93.90 KB[39m
|
|
74
|
+
[32mESM[39m ⚡️ Build success in 77ms
|
|
75
75
|
[34mDTS[39m Build start
|
|
76
|
-
[32mDTS[39m ⚡️ Build success in
|
|
76
|
+
[32mDTS[39m ⚡️ Build success in 9241ms
|
|
77
77
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m868.05 KB[39m
|
|
78
78
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m868.05 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e0b0a78: Deprecate DataEngineQueryOptions in favor of QueryAST-aligned EngineQueryOptions.
|
|
8
|
+
|
|
9
|
+
Engine, Protocol, and Client now use standard QueryAST parameter names:
|
|
10
|
+
|
|
11
|
+
- `filter` → `where`
|
|
12
|
+
- `select` → `fields`
|
|
13
|
+
- `sort` → `orderBy`
|
|
14
|
+
- `skip` → `offset`
|
|
15
|
+
- `populate` → `expand`
|
|
16
|
+
- `top` → `limit`
|
|
17
|
+
|
|
18
|
+
The old DataEngine\* schemas and types are preserved with `@deprecated` markers for backward compatibility.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [f08ffc3]
|
|
21
|
+
- Updated dependencies [e0b0a78]
|
|
22
|
+
- @objectstack/spec@4.0.0
|
|
23
|
+
- @objectstack/core@4.0.0
|
|
24
|
+
|
|
3
25
|
## 3.3.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2783,7 +2783,7 @@ declare const SysUser: Omit<{
|
|
|
2783
2783
|
summaryOperations?: {
|
|
2784
2784
|
object: string;
|
|
2785
2785
|
field: string;
|
|
2786
|
-
function: "
|
|
2786
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
2787
2787
|
} | undefined;
|
|
2788
2788
|
language?: string | undefined;
|
|
2789
2789
|
theme?: string | undefined;
|
|
@@ -4258,7 +4258,7 @@ declare const SysSession: Omit<{
|
|
|
4258
4258
|
summaryOperations?: {
|
|
4259
4259
|
object: string;
|
|
4260
4260
|
field: string;
|
|
4261
|
-
function: "
|
|
4261
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
4262
4262
|
} | undefined;
|
|
4263
4263
|
language?: string | undefined;
|
|
4264
4264
|
theme?: string | undefined;
|
|
@@ -5886,7 +5886,7 @@ declare const SysAccount: Omit<{
|
|
|
5886
5886
|
summaryOperations?: {
|
|
5887
5887
|
object: string;
|
|
5888
5888
|
field: string;
|
|
5889
|
-
function: "
|
|
5889
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
5890
5890
|
} | undefined;
|
|
5891
5891
|
language?: string | undefined;
|
|
5892
5892
|
theme?: string | undefined;
|
|
@@ -8301,7 +8301,7 @@ declare const SysVerification: Omit<{
|
|
|
8301
8301
|
summaryOperations?: {
|
|
8302
8302
|
object: string;
|
|
8303
8303
|
field: string;
|
|
8304
|
-
function: "
|
|
8304
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
8305
8305
|
} | undefined;
|
|
8306
8306
|
language?: string | undefined;
|
|
8307
8307
|
theme?: string | undefined;
|
|
@@ -9613,7 +9613,7 @@ declare const SysOrganization: Omit<{
|
|
|
9613
9613
|
summaryOperations?: {
|
|
9614
9614
|
object: string;
|
|
9615
9615
|
field: string;
|
|
9616
|
-
function: "
|
|
9616
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
9617
9617
|
} | undefined;
|
|
9618
9618
|
language?: string | undefined;
|
|
9619
9619
|
theme?: string | undefined;
|
|
@@ -11079,7 +11079,7 @@ declare const SysMember: Omit<{
|
|
|
11079
11079
|
summaryOperations?: {
|
|
11080
11080
|
object: string;
|
|
11081
11081
|
field: string;
|
|
11082
|
-
function: "
|
|
11082
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
11083
11083
|
} | undefined;
|
|
11084
11084
|
language?: string | undefined;
|
|
11085
11085
|
theme?: string | undefined;
|
|
@@ -12229,7 +12229,7 @@ declare const SysInvitation: Omit<{
|
|
|
12229
12229
|
summaryOperations?: {
|
|
12230
12230
|
object: string;
|
|
12231
12231
|
field: string;
|
|
12232
|
-
function: "
|
|
12232
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
12233
12233
|
} | undefined;
|
|
12234
12234
|
language?: string | undefined;
|
|
12235
12235
|
theme?: string | undefined;
|
|
@@ -14012,7 +14012,7 @@ declare const SysTeam: Omit<{
|
|
|
14012
14012
|
summaryOperations?: {
|
|
14013
14013
|
object: string;
|
|
14014
14014
|
field: string;
|
|
14015
|
-
function: "
|
|
14015
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
14016
14016
|
} | undefined;
|
|
14017
14017
|
language?: string | undefined;
|
|
14018
14018
|
theme?: string | undefined;
|
|
@@ -15162,7 +15162,7 @@ declare const SysTeamMember: Omit<{
|
|
|
15162
15162
|
summaryOperations?: {
|
|
15163
15163
|
object: string;
|
|
15164
15164
|
field: string;
|
|
15165
|
-
function: "
|
|
15165
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
15166
15166
|
} | undefined;
|
|
15167
15167
|
language?: string | undefined;
|
|
15168
15168
|
theme?: string | undefined;
|
|
@@ -16153,7 +16153,7 @@ declare const SysApiKey: Omit<{
|
|
|
16153
16153
|
summaryOperations?: {
|
|
16154
16154
|
object: string;
|
|
16155
16155
|
field: string;
|
|
16156
|
-
function: "
|
|
16156
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
16157
16157
|
} | undefined;
|
|
16158
16158
|
language?: string | undefined;
|
|
16159
16159
|
theme?: string | undefined;
|
|
@@ -18253,7 +18253,7 @@ declare const SysTwoFactor: Omit<{
|
|
|
18253
18253
|
summaryOperations?: {
|
|
18254
18254
|
object: string;
|
|
18255
18255
|
field: string;
|
|
18256
|
-
function: "
|
|
18256
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
18257
18257
|
} | undefined;
|
|
18258
18258
|
language?: string | undefined;
|
|
18259
18259
|
theme?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -2783,7 +2783,7 @@ declare const SysUser: Omit<{
|
|
|
2783
2783
|
summaryOperations?: {
|
|
2784
2784
|
object: string;
|
|
2785
2785
|
field: string;
|
|
2786
|
-
function: "
|
|
2786
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
2787
2787
|
} | undefined;
|
|
2788
2788
|
language?: string | undefined;
|
|
2789
2789
|
theme?: string | undefined;
|
|
@@ -4258,7 +4258,7 @@ declare const SysSession: Omit<{
|
|
|
4258
4258
|
summaryOperations?: {
|
|
4259
4259
|
object: string;
|
|
4260
4260
|
field: string;
|
|
4261
|
-
function: "
|
|
4261
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
4262
4262
|
} | undefined;
|
|
4263
4263
|
language?: string | undefined;
|
|
4264
4264
|
theme?: string | undefined;
|
|
@@ -5886,7 +5886,7 @@ declare const SysAccount: Omit<{
|
|
|
5886
5886
|
summaryOperations?: {
|
|
5887
5887
|
object: string;
|
|
5888
5888
|
field: string;
|
|
5889
|
-
function: "
|
|
5889
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
5890
5890
|
} | undefined;
|
|
5891
5891
|
language?: string | undefined;
|
|
5892
5892
|
theme?: string | undefined;
|
|
@@ -8301,7 +8301,7 @@ declare const SysVerification: Omit<{
|
|
|
8301
8301
|
summaryOperations?: {
|
|
8302
8302
|
object: string;
|
|
8303
8303
|
field: string;
|
|
8304
|
-
function: "
|
|
8304
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
8305
8305
|
} | undefined;
|
|
8306
8306
|
language?: string | undefined;
|
|
8307
8307
|
theme?: string | undefined;
|
|
@@ -9613,7 +9613,7 @@ declare const SysOrganization: Omit<{
|
|
|
9613
9613
|
summaryOperations?: {
|
|
9614
9614
|
object: string;
|
|
9615
9615
|
field: string;
|
|
9616
|
-
function: "
|
|
9616
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
9617
9617
|
} | undefined;
|
|
9618
9618
|
language?: string | undefined;
|
|
9619
9619
|
theme?: string | undefined;
|
|
@@ -11079,7 +11079,7 @@ declare const SysMember: Omit<{
|
|
|
11079
11079
|
summaryOperations?: {
|
|
11080
11080
|
object: string;
|
|
11081
11081
|
field: string;
|
|
11082
|
-
function: "
|
|
11082
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
11083
11083
|
} | undefined;
|
|
11084
11084
|
language?: string | undefined;
|
|
11085
11085
|
theme?: string | undefined;
|
|
@@ -12229,7 +12229,7 @@ declare const SysInvitation: Omit<{
|
|
|
12229
12229
|
summaryOperations?: {
|
|
12230
12230
|
object: string;
|
|
12231
12231
|
field: string;
|
|
12232
|
-
function: "
|
|
12232
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
12233
12233
|
} | undefined;
|
|
12234
12234
|
language?: string | undefined;
|
|
12235
12235
|
theme?: string | undefined;
|
|
@@ -14012,7 +14012,7 @@ declare const SysTeam: Omit<{
|
|
|
14012
14012
|
summaryOperations?: {
|
|
14013
14013
|
object: string;
|
|
14014
14014
|
field: string;
|
|
14015
|
-
function: "
|
|
14015
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
14016
14016
|
} | undefined;
|
|
14017
14017
|
language?: string | undefined;
|
|
14018
14018
|
theme?: string | undefined;
|
|
@@ -15162,7 +15162,7 @@ declare const SysTeamMember: Omit<{
|
|
|
15162
15162
|
summaryOperations?: {
|
|
15163
15163
|
object: string;
|
|
15164
15164
|
field: string;
|
|
15165
|
-
function: "
|
|
15165
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
15166
15166
|
} | undefined;
|
|
15167
15167
|
language?: string | undefined;
|
|
15168
15168
|
theme?: string | undefined;
|
|
@@ -16153,7 +16153,7 @@ declare const SysApiKey: Omit<{
|
|
|
16153
16153
|
summaryOperations?: {
|
|
16154
16154
|
object: string;
|
|
16155
16155
|
field: string;
|
|
16156
|
-
function: "
|
|
16156
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
16157
16157
|
} | undefined;
|
|
16158
16158
|
language?: string | undefined;
|
|
16159
16159
|
theme?: string | undefined;
|
|
@@ -18253,7 +18253,7 @@ declare const SysTwoFactor: Omit<{
|
|
|
18253
18253
|
summaryOperations?: {
|
|
18254
18254
|
object: string;
|
|
18255
18255
|
field: string;
|
|
18256
|
-
function: "
|
|
18256
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
18257
18257
|
} | undefined;
|
|
18258
18258
|
language?: string | undefined;
|
|
18259
18259
|
theme?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -116,34 +116,34 @@ function createObjectQLAdapterFactory(dataEngine) {
|
|
|
116
116
|
},
|
|
117
117
|
findOne: async ({ model, where, select, join: _join }) => {
|
|
118
118
|
const filter = convertWhere(where);
|
|
119
|
-
const result = await dataEngine.findOne(model, { filter, select });
|
|
119
|
+
const result = await dataEngine.findOne(model, { where: filter, fields: select });
|
|
120
120
|
return result ? result : null;
|
|
121
121
|
},
|
|
122
122
|
findMany: async ({ model, where, limit, offset, sortBy, join: _join }) => {
|
|
123
123
|
const filter = where ? convertWhere(where) : {};
|
|
124
|
-
const
|
|
124
|
+
const orderBy = sortBy ? [{ field: sortBy.field, order: sortBy.direction }] : void 0;
|
|
125
125
|
const results = await dataEngine.find(model, {
|
|
126
|
-
filter,
|
|
126
|
+
where: filter,
|
|
127
127
|
limit: limit || 100,
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
offset,
|
|
129
|
+
orderBy
|
|
130
130
|
});
|
|
131
131
|
return results;
|
|
132
132
|
},
|
|
133
133
|
count: async ({ model, where }) => {
|
|
134
134
|
const filter = where ? convertWhere(where) : {};
|
|
135
|
-
return await dataEngine.count(model, { filter });
|
|
135
|
+
return await dataEngine.count(model, { where: filter });
|
|
136
136
|
},
|
|
137
137
|
update: async ({ model, where, update }) => {
|
|
138
138
|
const filter = convertWhere(where);
|
|
139
|
-
const record = await dataEngine.findOne(model, { filter });
|
|
139
|
+
const record = await dataEngine.findOne(model, { where: filter });
|
|
140
140
|
if (!record) return null;
|
|
141
141
|
const result = await dataEngine.update(model, { ...update, id: record.id });
|
|
142
142
|
return result ? result : null;
|
|
143
143
|
},
|
|
144
144
|
updateMany: async ({ model, where, update }) => {
|
|
145
145
|
const filter = convertWhere(where);
|
|
146
|
-
const records = await dataEngine.find(model, { filter });
|
|
146
|
+
const records = await dataEngine.find(model, { where: filter });
|
|
147
147
|
for (const record of records) {
|
|
148
148
|
await dataEngine.update(model, { ...update, id: record.id });
|
|
149
149
|
}
|
|
@@ -151,15 +151,15 @@ function createObjectQLAdapterFactory(dataEngine) {
|
|
|
151
151
|
},
|
|
152
152
|
delete: async ({ model, where }) => {
|
|
153
153
|
const filter = convertWhere(where);
|
|
154
|
-
const record = await dataEngine.findOne(model, { filter });
|
|
154
|
+
const record = await dataEngine.findOne(model, { where: filter });
|
|
155
155
|
if (!record) return;
|
|
156
|
-
await dataEngine.delete(model, {
|
|
156
|
+
await dataEngine.delete(model, { where: { id: record.id } });
|
|
157
157
|
},
|
|
158
158
|
deleteMany: async ({ model, where }) => {
|
|
159
159
|
const filter = convertWhere(where);
|
|
160
|
-
const records = await dataEngine.find(model, { filter });
|
|
160
|
+
const records = await dataEngine.find(model, { where: filter });
|
|
161
161
|
for (const record of records) {
|
|
162
|
-
await dataEngine.delete(model, {
|
|
162
|
+
await dataEngine.delete(model, { where: { id: record.id } });
|
|
163
163
|
}
|
|
164
164
|
return records.length;
|
|
165
165
|
}
|
|
@@ -176,25 +176,25 @@ function createObjectQLAdapter(dataEngine) {
|
|
|
176
176
|
findOne: async ({ model, where, select, join: _join }) => {
|
|
177
177
|
const objectName = resolveProtocolName(model);
|
|
178
178
|
const filter = convertWhere(where);
|
|
179
|
-
const result = await dataEngine.findOne(objectName, { filter, select });
|
|
179
|
+
const result = await dataEngine.findOne(objectName, { where: filter, fields: select });
|
|
180
180
|
return result ? result : null;
|
|
181
181
|
},
|
|
182
182
|
findMany: async ({ model, where, limit, offset, sortBy, join: _join }) => {
|
|
183
183
|
const objectName = resolveProtocolName(model);
|
|
184
184
|
const filter = where ? convertWhere(where) : {};
|
|
185
|
-
const
|
|
186
|
-
const results = await dataEngine.find(objectName, { filter, limit: limit || 100,
|
|
185
|
+
const orderBy = sortBy ? [{ field: sortBy.field, order: sortBy.direction }] : void 0;
|
|
186
|
+
const results = await dataEngine.find(objectName, { where: filter, limit: limit || 100, offset, orderBy });
|
|
187
187
|
return results;
|
|
188
188
|
},
|
|
189
189
|
count: async ({ model, where }) => {
|
|
190
190
|
const objectName = resolveProtocolName(model);
|
|
191
191
|
const filter = where ? convertWhere(where) : {};
|
|
192
|
-
return await dataEngine.count(objectName, { filter });
|
|
192
|
+
return await dataEngine.count(objectName, { where: filter });
|
|
193
193
|
},
|
|
194
194
|
update: async ({ model, where, update }) => {
|
|
195
195
|
const objectName = resolveProtocolName(model);
|
|
196
196
|
const filter = convertWhere(where);
|
|
197
|
-
const record = await dataEngine.findOne(objectName, { filter });
|
|
197
|
+
const record = await dataEngine.findOne(objectName, { where: filter });
|
|
198
198
|
if (!record) return null;
|
|
199
199
|
const result = await dataEngine.update(objectName, { ...update, id: record.id });
|
|
200
200
|
return result ? result : null;
|
|
@@ -202,7 +202,7 @@ function createObjectQLAdapter(dataEngine) {
|
|
|
202
202
|
updateMany: async ({ model, where, update }) => {
|
|
203
203
|
const objectName = resolveProtocolName(model);
|
|
204
204
|
const filter = convertWhere(where);
|
|
205
|
-
const records = await dataEngine.find(objectName, { filter });
|
|
205
|
+
const records = await dataEngine.find(objectName, { where: filter });
|
|
206
206
|
for (const record of records) {
|
|
207
207
|
await dataEngine.update(objectName, { ...update, id: record.id });
|
|
208
208
|
}
|
|
@@ -211,16 +211,16 @@ function createObjectQLAdapter(dataEngine) {
|
|
|
211
211
|
delete: async ({ model, where }) => {
|
|
212
212
|
const objectName = resolveProtocolName(model);
|
|
213
213
|
const filter = convertWhere(where);
|
|
214
|
-
const record = await dataEngine.findOne(objectName, { filter });
|
|
214
|
+
const record = await dataEngine.findOne(objectName, { where: filter });
|
|
215
215
|
if (!record) return;
|
|
216
|
-
await dataEngine.delete(objectName, {
|
|
216
|
+
await dataEngine.delete(objectName, { where: { id: record.id } });
|
|
217
217
|
},
|
|
218
218
|
deleteMany: async ({ model, where }) => {
|
|
219
219
|
const objectName = resolveProtocolName(model);
|
|
220
220
|
const filter = convertWhere(where);
|
|
221
|
-
const records = await dataEngine.find(objectName, { filter });
|
|
221
|
+
const records = await dataEngine.find(objectName, { where: filter });
|
|
222
222
|
for (const record of records) {
|
|
223
|
-
await dataEngine.delete(objectName, {
|
|
223
|
+
await dataEngine.delete(objectName, { where: { id: record.id } });
|
|
224
224
|
}
|
|
225
225
|
return records.length;
|
|
226
226
|
}
|