@terreno/api 56.0.0-beta.0 → 57.0.0-beta.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/CHANGELOG.md +2 -122
- package/LICENSE +21 -202
- package/dist/api.d.ts +3 -2
- package/dist/auth.js +21 -25
- package/dist/betterAuthSetup.d.ts +15 -1
- package/dist/betterAuthSetup.js +4 -6
- package/dist/configurationPlugin.js +2 -2
- package/dist/expressServer.js +11 -5
- package/dist/githubAuth.js +1 -4
- package/dist/plugins.d.ts +7 -6
- package/dist/plugins.js +24 -8
- package/dist/realtime/changeStreamWatcher.d.ts +1 -1
- package/dist/realtime/changeStreamWatcher.js +0 -2
- package/dist/realtime/realtimeApp.d.ts +1 -1
- package/dist/realtime/realtimeApp.js +16 -8
- package/dist/realtime/types.d.ts +14 -0
- package/dist/sync/executors.js +14 -14
- package/dist/sync/models.js +1 -1
- package/dist/sync/registry.d.ts +4 -4
- package/dist/sync/registry.js +1 -1
- package/dist/sync/socketHandlers.d.ts +1 -1
- package/dist/sync/syncSeqPlugin.js +25 -29
- package/dist/tests/models.d.ts +27 -11
- package/dist/tests/models.js +5 -3
- package/dist/tests/testHelper.d.ts +9 -3
- package/package.json +5 -6
- package/src/actions.test.ts +19 -12
- package/src/actions.ts +2 -2
- package/src/api.coverage.test.ts +7 -9
- package/src/api.errorPaths.test.ts +47 -1
- package/src/api.errors.test.ts +32 -23
- package/src/api.ts +22 -12
- package/src/auth.test.ts +251 -1
- package/src/auth.ts +25 -23
- package/src/betterAuthSetup.ts +7 -7
- package/src/configuration.test.ts +59 -38
- package/src/configurationPlugin.test.ts +72 -42
- package/src/configurationPlugin.ts +2 -2
- package/src/consentApp.test.ts +12 -12
- package/src/expressServer.ts +11 -5
- package/src/githubAuth.ts +1 -3
- package/src/middleware.test.ts +16 -0
- package/src/models/versionConfig.ts +1 -1
- package/src/openApiBuilder.test.ts +24 -9
- package/src/openApiValidator.test.ts +41 -0
- package/src/permissions.middleware.test.ts +73 -81
- package/src/permissions.test.ts +35 -25
- package/src/plugins.test.ts +74 -29
- package/src/plugins.ts +29 -11
- package/src/populate.test.ts +25 -16
- package/src/realtime/changeStreamWatcher.ts +1 -4
- package/src/realtime/realtime.test.ts +239 -0
- package/src/realtime/realtimeApp.ts +15 -8
- package/src/realtime/realtimeAppSetup.test.ts +159 -0
- package/src/realtime/types.ts +14 -0
- package/src/secretProvidersGcpClient.test.ts +66 -0
- package/src/sync/executors.ts +16 -14
- package/src/sync/models.ts +2 -1
- package/src/sync/registry.ts +6 -8
- package/src/sync/socketHandlers.ts +1 -3
- package/src/sync/syncFrontier.test.ts +2 -2
- package/src/sync/syncSeqPlugin.test.ts +446 -0
- package/src/sync/syncSeqPlugin.ts +43 -51
- package/src/tests/models.ts +8 -6
package/src/tests/models.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import mongoose, {type Model, model, Schema} from "mongoose";
|
|
1
|
+
import mongoose, {type Model, model, Schema, type StringSchemaDefinition} from "mongoose";
|
|
2
2
|
import passportLocalMongoose from "passport-local-mongoose";
|
|
3
3
|
|
|
4
4
|
import {createdUpdatedPlugin, DateOnly, isDisabledPlugin} from "../plugins";
|
|
@@ -41,11 +41,11 @@ export interface Food {
|
|
|
41
41
|
dateAdded?: string;
|
|
42
42
|
};
|
|
43
43
|
tags: string[];
|
|
44
|
-
eatenBy:
|
|
44
|
+
eatenBy: Array<mongoose.Types.ObjectId | User>;
|
|
45
45
|
lastEatenWith: {[name: string]: Date};
|
|
46
46
|
categories: FoodCategory[];
|
|
47
47
|
expiration: string;
|
|
48
|
-
likesIds: {userId: string; likes: boolean}[];
|
|
48
|
+
likesIds: {userId: mongoose.Types.ObjectId | string; likes: boolean}[];
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export interface RequiredField {
|
|
@@ -126,9 +126,11 @@ const foodSchema = new Schema<Food>(
|
|
|
126
126
|
type: Schema.Types.ObjectId,
|
|
127
127
|
},
|
|
128
128
|
],
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
expiration: {
|
|
130
|
+
description: "Expiration date of the food",
|
|
131
|
+
// DateOnly is a custom SchemaType registered on Schema.Types; it stores an ISO date string.
|
|
132
|
+
type: DateOnly as unknown as StringSchemaDefinition,
|
|
133
|
+
},
|
|
132
134
|
hidden: {
|
|
133
135
|
default: false,
|
|
134
136
|
description: "Whether this food is hidden from listings",
|