@cofondateurauchomage/libs 1.1.169 → 1.1.171

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/build/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IBlogHtmlArticle, IContact, INewsletter, IProject, IProspect, IReactionStatus, IUser, TPlan, TPlanOption, TVisibility } from "./db.model";
2
- export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "createUser" | "updateUser" | "deleteUser" | "updateVisibility" | "addStripeId" | "updatePlan" | "updateMetaStripe" | "addStatsAssociation" | "updateNewsletter" | "createProspect" | "getProspect" | "updateProspect" | "createReaction" | "deleteReaction" | "createBlogHtmlArticle" | "syncCrmProfiles" | "migrateCrmNotes";
2
+ export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "createUser" | "updateUser" | "deleteUser" | "updateVisibility" | "addStripeId" | "updatePlan" | "updateMetaStripe" | "addStatsAssociation" | "updateNewsletter" | "createProspect" | "getProspect" | "updateProspect" | "createReaction" | "deleteReaction" | "createBlogHtmlArticle" | "syncCrmProfiles";
3
3
  export type RouteNames = "checkout_session" | "delete_customer" | "portal_session" | "webhook";
4
4
  export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
5
5
  createProject: Omit<IProject, "id" | "plan" | "visibility" | "clicks" | "creationDate" | "lastConnection" | "stripeId" | "referrer" | "postedOnLinkedInAt"> & IContact & {
@@ -58,8 +58,6 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
58
58
  };
59
59
  /** Admin-only: rebuild all `crm_profiles` from source collections. */
60
60
  syncCrmProfiles: Record<string, never>;
61
- /** Admin-only: lift `notes` subcollections onto parent `crm_profiles` docs. */
62
- migrateCrmNotes: Record<string, never>;
63
61
  checkout_session: {
64
62
  customer: {
65
63
  email: string;
@@ -114,12 +112,6 @@ export type ResponseForO<O extends CloudFunctionNames | RouteNames> = {
114
112
  synced: number;
115
113
  failed: number;
116
114
  };
117
- migrateCrmNotes: {
118
- migrated: number;
119
- skipped: number;
120
- deletedSubdocs: number;
121
- failed: number;
122
- };
123
115
  checkout_session: {
124
116
  sessionId: string;
125
117
  };
@@ -237,7 +237,6 @@ const schemasForAllRoutes = {
237
237
  toc: zod_1.z.string().optional(),
238
238
  }),
239
239
  syncCrmProfiles: zod_1.z.object({}),
240
- migrateCrmNotes: zod_1.z.object({}),
241
240
  checkout_session: zod_1.z.object({
242
241
  customer: zod_1.z.object({
243
242
  email: zod_1.z.string(),
@@ -1,5 +1,4 @@
1
1
  import type { ICrmNote } from "../db.model";
2
- export declare const MAX_CRM_NOTES = 20;
3
2
  export declare function hasCrmNotes(notes: ICrmNote[] | undefined): boolean;
4
3
  export declare function sortCrmNotesDesc(notes: ICrmNote[]): ICrmNote[];
5
4
  export declare function appendCrmNote(existing: ICrmNote[] | undefined, note: ICrmNote): ICrmNote[];
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MAX_CRM_NOTES = void 0;
4
3
  exports.hasCrmNotes = hasCrmNotes;
5
4
  exports.sortCrmNotesDesc = sortCrmNotesDesc;
6
5
  exports.appendCrmNote = appendCrmNote;
7
- exports.MAX_CRM_NOTES = 20;
8
6
  function hasCrmNotes(notes) {
9
7
  return (notes?.length ?? 0) > 0;
10
8
  }
@@ -12,5 +10,5 @@ function sortCrmNotesDesc(notes) {
12
10
  return [...notes].sort((a, b) => (b.createdAt ?? 0) - (a.createdAt ?? 0));
13
11
  }
14
12
  function appendCrmNote(existing, note) {
15
- return sortCrmNotesDesc([note, ...(existing ?? [])]).slice(0, exports.MAX_CRM_NOTES);
13
+ return sortCrmNotesDesc([note, ...(existing ?? [])]);
16
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofondateurauchomage/libs",
3
- "version": "1.1.169",
3
+ "version": "1.1.171",
4
4
  "description": "",
5
5
  "main": "build/index",
6
6
  "scripts": {