@opfr/services 1.6.0 → 1.7.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.
Files changed (63) hide show
  1. package/dist/index.es.js +1140 -780
  2. package/dist/index.umd.js +1 -1
  3. package/dist/services/index.d.ts +2 -0
  4. package/dist/services/index.d.ts.map +1 -1
  5. package/dist/services/reminder/types.d.ts +1 -2
  6. package/dist/services/reminder/types.d.ts.map +1 -1
  7. package/dist/services/story/definition/model.d.ts +4 -0
  8. package/dist/services/story/definition/model.d.ts.map +1 -0
  9. package/dist/services/story/definition/schema.d.ts +13 -0
  10. package/dist/services/story/definition/schema.d.ts.map +1 -0
  11. package/dist/services/story/helper.d.ts +10 -0
  12. package/dist/services/story/helper.d.ts.map +1 -0
  13. package/dist/services/story/index.d.ts +3 -0
  14. package/dist/services/story/index.d.ts.map +1 -0
  15. package/dist/services/story/process/create.d.ts +3 -0
  16. package/dist/services/story/process/create.d.ts.map +1 -0
  17. package/dist/services/story/process/findMany.d.ts +5 -0
  18. package/dist/services/story/process/findMany.d.ts.map +1 -0
  19. package/dist/services/story/process/findOne.d.ts +4 -0
  20. package/dist/services/story/process/findOne.d.ts.map +1 -0
  21. package/dist/services/story/process/updateOne.d.ts +4 -0
  22. package/dist/services/story/process/updateOne.d.ts.map +1 -0
  23. package/dist/services/story/service.d.ts +15 -0
  24. package/dist/services/story/service.d.ts.map +1 -0
  25. package/dist/services/story/types.d.ts +11 -0
  26. package/dist/services/story/types.d.ts.map +1 -0
  27. package/dist/services/user-cooldown/definition/schema.d.ts.map +1 -1
  28. package/dist/services/user-cooldown/helper.d.ts +3 -3
  29. package/dist/services/user-cooldown/helper.d.ts.map +1 -1
  30. package/dist/services/user-cooldown/index.d.ts +0 -1
  31. package/dist/services/user-cooldown/index.d.ts.map +1 -1
  32. package/dist/services/user-cooldown/types.d.ts +1 -8
  33. package/dist/services/user-cooldown/types.d.ts.map +1 -1
  34. package/dist/services/user-settings/definition/schema.d.ts.map +1 -1
  35. package/dist/services/user-settings/types.d.ts +1 -6
  36. package/dist/services/user-settings/types.d.ts.map +1 -1
  37. package/dist/services/user-story/definition/model.d.ts +4 -0
  38. package/dist/services/user-story/definition/model.d.ts.map +1 -0
  39. package/dist/services/user-story/definition/schema.d.ts +13 -0
  40. package/dist/services/user-story/definition/schema.d.ts.map +1 -0
  41. package/dist/services/user-story/helper.d.ts +31 -0
  42. package/dist/services/user-story/helper.d.ts.map +1 -0
  43. package/dist/services/user-story/index.d.ts +3 -0
  44. package/dist/services/user-story/index.d.ts.map +1 -0
  45. package/dist/services/user-story/process/create.d.ts +4 -0
  46. package/dist/services/user-story/process/create.d.ts.map +1 -0
  47. package/dist/services/user-story/process/deleteOne.d.ts +3 -0
  48. package/dist/services/user-story/process/deleteOne.d.ts.map +1 -0
  49. package/dist/services/user-story/process/findMany.d.ts +5 -0
  50. package/dist/services/user-story/process/findMany.d.ts.map +1 -0
  51. package/dist/services/user-story/process/findOne.d.ts +5 -0
  52. package/dist/services/user-story/process/findOne.d.ts.map +1 -0
  53. package/dist/services/user-story/process/updateOne.d.ts +5 -0
  54. package/dist/services/user-story/process/updateOne.d.ts.map +1 -0
  55. package/dist/services/user-story/service.d.ts +15 -0
  56. package/dist/services/user-story/service.d.ts.map +1 -0
  57. package/dist/services/user-story/types.d.ts +43 -0
  58. package/dist/services/user-story/types.d.ts.map +1 -0
  59. package/dist/services/user-story/utils.d.ts +8 -0
  60. package/dist/services/user-story/utils.d.ts.map +1 -0
  61. package/package.json +3 -3
  62. package/dist/services/user-cooldown/constants.d.ts +0 -2
  63. package/dist/services/user-cooldown/constants.d.ts.map +0 -1
@@ -0,0 +1,13 @@
1
+ import { Schema } from 'mongoose';
2
+ import type { UserStoryDocument } from '../types';
3
+ declare const userStorySchema: Schema<UserStoryDocument, import("mongoose").Model<UserStoryDocument, any, any, any, import("mongoose").Document<unknown, any, UserStoryDocument, any, {}> & UserStoryDocument & Required<{
4
+ _id: import("mongoose").Types.ObjectId;
5
+ }> & {
6
+ __v: number;
7
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, UserStoryDocument, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<UserStoryDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<UserStoryDocument> & Required<{
8
+ _id: import("mongoose").Types.ObjectId;
9
+ }> & {
10
+ __v: number;
11
+ }>;
12
+ export { userStorySchema };
13
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/services/user-story/definition/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAYlD,QAAA,MAAM,eAAe;;;;;;;;EAqBnB,CAAC;AAIH,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { Types } from 'mongoose';
2
+ import type { ChapterId, SceneId } from '@opfr/definitions';
3
+ import { AbstractCachedServiceWithFetchMany } from '../AbstractCachedService';
4
+ import type { AdvanceResult, ResolvedSceneStep, UserStory, UserStoryDocument, UserStoryFilter } from './types';
5
+ export declare abstract class UserStoryHelper extends AbstractCachedServiceWithFetchMany<UserStory, UserStoryDocument, UserStoryFilter> {
6
+ getCurrentStep(user: Types.ObjectId, storyId: string): Promise<import("@opfr/definitions").StoryStep | null>;
7
+ getSceneSteps(user: Types.ObjectId, storyId: string, chapterId: ChapterId, sceneId: SceneId): Promise<ResolvedSceneStep[] | null>;
8
+ start(user: Types.ObjectId, storyId: string): Promise<(import("mongoose").FlattenMaps<UserStoryDocument> & Required<{
9
+ _id: Types.ObjectId;
10
+ }> & {
11
+ __v: number;
12
+ }) | null>;
13
+ advanceToNext(user: Types.ObjectId, storyId: string): Promise<AdvanceResult>;
14
+ advanceToNextScene(user: Types.ObjectId, storyId: string): Promise<(import("mongoose").FlattenMaps<UserStoryDocument> & Required<{
15
+ _id: Types.ObjectId;
16
+ }> & {
17
+ __v: number;
18
+ }) | null>;
19
+ validateCommandAndAdvance(user: Types.ObjectId, storyId: string, commandId: string): Promise<(import("mongoose").FlattenMaps<UserStoryDocument> & Required<{
20
+ _id: Types.ObjectId;
21
+ }> & {
22
+ __v: number;
23
+ }) | null>;
24
+ validateActionAndAdvance(user: Types.ObjectId, storyId: string, actionId: string): Promise<(import("mongoose").FlattenMaps<UserStoryDocument> & Required<{
25
+ _id: Types.ObjectId;
26
+ }> & {
27
+ __v: number;
28
+ }) | null>;
29
+ private advanceTo;
30
+ }
31
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/services/user-story/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAU,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAO9E,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,SAAS,EAET,iBAAiB,EACjB,eAAe,EAChB,MAAM,SAAS,CAAC;AAGjB,8BAAsB,eAAgB,SAAQ,kCAAkC,CAC9E,SAAS,EACT,iBAAiB,EACjB,eAAe,CAChB;IACc,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM;IAUpD,aAAa,CACxB,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC;IA2BzB,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM;;;;;IA0B3C,aAAa,CACxB,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC;IAqCZ,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM;;;;;IA2BxD,yBAAyB,CACpC,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM;;;;;IAyBN,wBAAwB,CACnC,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM;;;;;YA8BJ,SAAS;CAiCxB"}
@@ -0,0 +1,3 @@
1
+ export type * from './types';
2
+ export * from './service';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/user-story/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAC;AAE7B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Types } from 'mongoose';
2
+ import type { UserStoryDocument } from '../types';
3
+ export declare const createUserStory: (user: Types.ObjectId, storyId: string, entryChapterId: string, entrySceneId: string, entryStepId: string) => Promise<UserStoryDocument>;
4
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/services/user-story/process/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,eAAe,GAC1B,MAAM,KAAK,CAAC,QAAQ,EACpB,SAAS,MAAM,EACf,gBAAgB,MAAM,EACtB,cAAc,MAAM,EACpB,aAAa,MAAM,KAClB,OAAO,CAAC,iBAAiB,CAS3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Types } from 'mongoose';
2
+ export declare const deleteUserStory: (user: Types.ObjectId, storyId: string) => Promise<void>;
3
+ //# sourceMappingURL=deleteOne.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteOne.d.ts","sourceRoot":"","sources":["../../../../src/services/user-story/process/deleteOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAItC,eAAO,MAAM,eAAe,GAC1B,MAAM,KAAK,CAAC,QAAQ,EACpB,SAAS,MAAM,KACd,OAAO,CAAC,IAAI,CAEd,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { QueryOptions, RootFilterQuery } from 'mongoose';
2
+ import type { Lean } from '../../types';
3
+ import type { UserStoryDocument } from '../types';
4
+ export declare const findUserStories: (filter: RootFilterQuery<UserStoryDocument>, options?: QueryOptions<UserStoryDocument>) => Promise<Lean<UserStoryDocument>[]>;
5
+ //# sourceMappingURL=findMany.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findMany.d.ts","sourceRoot":"","sources":["../../../../src/services/user-story/process/findMany.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,eAAe,GAC1B,QAAQ,eAAe,CAAC,iBAAiB,CAAC,EAC1C,UAAS,YAAY,CAAC,iBAAiB,CAAM,KAC5C,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAEnC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Types } from 'mongoose';
2
+ import type { Lean } from '../../types';
3
+ import type { UserStoryDocument } from '../types';
4
+ export declare const findUserStory: (user: Types.ObjectId, storyId: string) => Promise<Lean<UserStoryDocument> | null>;
5
+ //# sourceMappingURL=findOne.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../../src/services/user-story/process/findOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,aAAa,GACxB,MAAM,KAAK,CAAC,QAAQ,EACpB,SAAS,MAAM,KACd,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAExC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { RootFilterQuery } from 'mongoose';
2
+ import type { Lean, MongooseUpdate } from '../../types';
3
+ import type { UserStoryDocument } from '../types';
4
+ export declare const updateUserStory: (filter: RootFilterQuery<UserStoryDocument>, update: MongooseUpdate<UserStoryDocument>) => Promise<Lean<UserStoryDocument> | null>;
5
+ //# sourceMappingURL=updateOne.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateOne.d.ts","sourceRoot":"","sources":["../../../../src/services/user-story/process/updateOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,eAAe,GAC1B,QAAQ,eAAe,CAAC,iBAAiB,CAAC,EAC1C,QAAQ,cAAc,CAAC,iBAAiB,CAAC,KACxC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAMxC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { QueryOptions, RootFilterQuery } from 'mongoose';
2
+ import type { Lean, MongooseUpdate } from '../types';
3
+ import { UserStoryHelper } from './helper';
4
+ import type { UserStoryDocument, UserStoryFilter } from './types';
5
+ declare class UserStoryService extends UserStoryHelper {
6
+ constructor();
7
+ protected normalizeKey(key: UserStoryFilter): string;
8
+ protected getKey(e: Lean<UserStoryDocument>): UserStoryFilter;
9
+ protected fetchFromDb(filter: UserStoryFilter): Promise<Lean<UserStoryDocument> | null>;
10
+ protected fetchManyFromDb(filter: RootFilterQuery<UserStoryDocument>, options: QueryOptions<UserStoryDocument>): Promise<Lean<UserStoryDocument>[]>;
11
+ protected updateInDb(filter: RootFilterQuery<UserStoryDocument>, update: MongooseUpdate<UserStoryDocument>): Promise<Lean<UserStoryDocument> | null>;
12
+ }
13
+ export declare const userStoryService: UserStoryService;
14
+ export {};
15
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/user-story/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAElE,cAAM,gBAAiB,SAAQ,eAAe;;IAK5C,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM;IAIpD,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,eAAe;IAI7D,SAAS,CAAC,WAAW,CACnB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAI1C,SAAS,CAAC,eAAe,CACvB,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,EAC1C,OAAO,EAAE,YAAY,CAAC,iBAAiB,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAIrC,SAAS,CAAC,UAAU,CAClB,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,EAC1C,MAAM,EAAE,cAAc,CAAC,iBAAiB,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;CAG3C;AAED,eAAO,MAAM,gBAAgB,kBAAyB,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { Document, Types } from 'mongoose';
2
+ import type { ChapterId, SceneId, StepId, StoryButtonAction, StoryButtonChoiceActionStep, StoryStep } from '@opfr/definitions';
3
+ export type UserStoryStatus = 'in_progress' | 'completed';
4
+ export type ResolvedSceneStep = {
5
+ step: StoryStep;
6
+ } | {
7
+ step: StoryButtonChoiceActionStep;
8
+ selectedAction: StoryButtonAction;
9
+ };
10
+ export interface UserStoryChoice {
11
+ chapterId: ChapterId;
12
+ sceneId: SceneId;
13
+ stepId: StepId;
14
+ value: string;
15
+ }
16
+ export interface UserStory {
17
+ user: Types.ObjectId;
18
+ storyId: string;
19
+ currentChapterId: ChapterId;
20
+ currentSceneId: SceneId;
21
+ currentStepId: StepId;
22
+ status: UserStoryStatus;
23
+ choices: UserStoryChoice[];
24
+ }
25
+ export interface UserStoryDocument extends Document, UserStory {
26
+ }
27
+ export type UserStoryFilter = {
28
+ user: Types.ObjectId;
29
+ storyId: string;
30
+ };
31
+ export type AdvanceResult = {
32
+ status: 'advanced';
33
+ data: UserStory;
34
+ } | {
35
+ status: 'action_required';
36
+ } | {
37
+ status: 'scene_ended';
38
+ } | {
39
+ status: 'completed';
40
+ } | {
41
+ status: 'error';
42
+ };
43
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/user-story/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,2BAA2B,EAC3B,SAAS,EACV,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,WAAW,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,2BAA2B,CAAC;IAAC,cAAc,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,SAAS,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,EAAE,SAAS;CAAG;AAEjE,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,iBAAiB,CAAA;CAAE,GAC7B;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,GACzB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ChapterId, SceneId, StepId, StoryScene, StoryStep } from '@opfr/definitions';
2
+ import type { StoryDocument } from '../story';
3
+ import type { Lean } from '../types';
4
+ import type { ResolvedSceneStep, UserStoryChoice, UserStoryDocument } from './types';
5
+ export declare const resolveNextPosition: (story: Lean<StoryDocument>, chapterId: ChapterId, sceneId: SceneId, nextStepId: StepId) => Omit<UserStoryChoice, "value"> | null;
6
+ export declare const getCurrentStep: (story: Lean<StoryDocument>, userStory: Lean<UserStoryDocument>) => StoryStep | null;
7
+ export declare const walkSceneSteps: (scene: StoryScene, choices: UserStoryChoice[], chapterId: ChapterId, sceneId: SceneId, stopAtStepId?: StepId) => ResolvedSceneStep[];
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/services/user-story/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,mBAAmB,GAC9B,OAAO,IAAI,CAAC,aAAa,CAAC,EAC1B,WAAW,SAAS,EACpB,SAAS,OAAO,EAChB,YAAY,MAAM,KACjB,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG,IAqCnC,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,OAAO,IAAI,CAAC,aAAa,CAAC,EAC1B,WAAW,IAAI,CAAC,iBAAiB,CAAC,KACjC,SAAS,GAAG,IAQd,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,OAAO,UAAU,EACjB,SAAS,eAAe,EAAE,EAC1B,WAAW,SAAS,EACpB,SAAS,OAAO,EAChB,eAAe,MAAM,KACpB,iBAAiB,EAqDnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opfr/services",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "private": false,
5
5
  "description": "OPFR services",
6
6
  "author": "Matthieu VEIGA",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@faker-js/faker": "10.1.0",
23
- "@opfr/definitions": "^1.7.0",
23
+ "@opfr/definitions": "^1.8.0",
24
24
  "@opfr/utils-lang": "^1.1.1",
25
25
  "@opfr/utils-type": "^1.1.0",
26
26
  "mongodb-memory-server": "11.0.1",
@@ -46,5 +46,5 @@
46
46
  "node_modules",
47
47
  "dist"
48
48
  ],
49
- "gitHead": "415ffc7bbbf05e8f88f7f87296c9dd81a227edbd"
49
+ "gitHead": "de020619b61917c338996a67c13a8bb2d11c8e59"
50
50
  }
@@ -1,2 +0,0 @@
1
- export declare const COOLDOWN_COMMANDS: readonly ["work", "dice", "rps", "doubleOrQuit", "blackJack", "priceIsRight"];
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/services/user-cooldown/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,+EAAmC,CAAC"}