@cofondateurauchomage/libs 1.1.141 → 1.1.144

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";
2
+ export type CloudFunctionNames = "createProject" | "updateProject" | "deleteProject" | "createUser" | "updateUser" | "deleteUser" | "updateVisibility" | "addStripeId" | "updatePlan" | "addStatsAssociation" | "updateNewsletter" | "createProspect" | "getProspect" | "updateProspect" | "createReaction" | "deleteReaction" | "createBlogHtmlArticle";
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 & {
@@ -28,16 +28,6 @@ export type BodyForO<O extends CloudFunctionNames | RouteNames> = {
28
28
  email: string;
29
29
  plan: TPlan;
30
30
  };
31
- updateMetaStripe: {
32
- apiSecretKey: string;
33
- stripeId: string;
34
- stripeLastPaymentAt?: number;
35
- stripeSubscriptionEndedAt?: number | null;
36
- stripeCurrentPeriodEnd?: number | null;
37
- stripeNetSpendDeltaCents?: number;
38
- subscriptionCancellationFeedback?: string | null;
39
- subscriptionCancellationComment?: string | null;
40
- };
41
31
  addStatsAssociation: {};
42
32
  updateNewsletter: Omit<INewsletter, "new_profil_last_sent_date">;
43
33
  createProspect: Pick<IProspect, "email" | "referrer">;
@@ -89,7 +79,6 @@ export type ResponseForO<O extends CloudFunctionNames | RouteNames> = {
89
79
  updateVisibility: WriteResult;
90
80
  addStripeId: WriteResult;
91
81
  updatePlan: WriteResult;
92
- updateMetaStripe: WriteResult;
93
82
  addStatsAssociation: WriteResult;
94
83
  updateNewsletter: WriteResult;
95
84
  createProspect: {
@@ -165,16 +165,6 @@ const schemasForAllRoutes = {
165
165
  email: zod_1.z.string(),
166
166
  plan: zod_1.z.enum(["free", "pro", "premium"]),
167
167
  }),
168
- updateMetaStripe: zod_1.z.object({
169
- apiSecretKey: zod_1.z.string(),
170
- stripeId: zStrMax50,
171
- stripeLastPaymentAt: zod_1.z.number().optional(),
172
- stripeSubscriptionEndedAt: zod_1.z.union([zod_1.z.number(), zod_1.z.null()]).optional(),
173
- stripeCurrentPeriodEnd: zod_1.z.union([zod_1.z.number(), zod_1.z.null()]).optional(),
174
- stripeNetSpendDeltaCents: zod_1.z.number().int().optional(),
175
- subscriptionCancellationFeedback: zod_1.z.union([zod_1.z.string(), zod_1.z.null()]).optional(),
176
- subscriptionCancellationComment: zod_1.z.union([zod_1.z.string(), zod_1.z.null()]).optional(),
177
- }),
178
168
  addStatsAssociation: zod_1.z.object({}),
179
169
  updateNewsletter: zod_1.z.object({
180
170
  match: zod_1.z.boolean().optional(),
@@ -270,7 +260,7 @@ function validateBodyForO(route, body) {
270
260
  const input = body;
271
261
  const data = parsed.data;
272
262
  const result = {};
273
- for (const key of Object.keys(data)) {
263
+ for (const key of Object.keys(schema.shape)) {
274
264
  if (input[key] !== undefined) {
275
265
  result[key] = data[key];
276
266
  }
@@ -8,8 +8,7 @@ export declare enum Collections {
8
8
  prospects = "prospects",
9
9
  reactions = "reactions",
10
10
  visits = "visits",
11
- blogHtmlArticles = "blog_html_articles",
12
- crm_profiles = "crm_profiles"
11
+ blogHtmlArticles = "blog_html_articles"
13
12
  }
14
13
  export type TSkill = "Sales" | "Operation" | "Design" | "Marketing" | "Produit" | "Tech" | "Growth" | "Finance";
15
14
  export type TPlan = "free" | "pro" | "premium";
@@ -83,36 +82,6 @@ export interface IProject {
83
82
  partner_swanbase?: boolean;
84
83
  partner_iii?: boolean;
85
84
  }
86
- /**
87
- * CRM-side state: team actions, Stripe sync, billing overlay.
88
- * Document id = canonicalId: `user:{uid}` | `project:{uid}` | `prospect:{docId}` under collection `crm_profiles`.
89
- */
90
- export interface ICrmProfile {
91
- lastTeamCallAt?: number;
92
- foundPartner?: boolean;
93
- /** Stripe infos */
94
- /** First successful invoice payment tied to subscriptions (unix ms). */
95
- stripeFirstPaidAt?: number;
96
- /** Last successful invoice payment (unix ms). */
97
- stripeLastPaymentAt?: number;
98
- /** When the subscription last ended/churned (unix ms); cleared when a new subscription starts. */
99
- stripeSubscriptionEndedAt?: number;
100
- /** Stripe `current_period_end` for the active subscription (unix ms); cleared when no active sub. */
101
- stripeCurrentPeriodEnd?: number;
102
- /** Lifetime net cents (invoice payments − refunds handled via deltas from webhooks). */
103
- stripeNetSpendCents?: number;
104
- /** Stripe `cancellation_details.feedback`. */
105
- subscriptionCancellationFeedback?: string;
106
- subscriptionCancellationComment?: string;
107
- /** Team-granted Pro (unix ms); orthogonal to Stripe. */
108
- complimentaryProGrantedAt?: number;
109
- complimentaryProRevokedAt?: number;
110
- }
111
- export interface ICrmNote {
112
- text: string;
113
- createdAt: number;
114
- author: string;
115
- }
116
85
  export interface IContact {
117
86
  email: string;
118
87
  linkedin?: string;
package/build/db.model.js CHANGED
@@ -13,5 +13,4 @@ var Collections;
13
13
  Collections["reactions"] = "reactions";
14
14
  Collections["visits"] = "visits";
15
15
  Collections["blogHtmlArticles"] = "blog_html_articles";
16
- Collections["crm_profiles"] = "crm_profiles";
17
16
  })(Collections || (exports.Collections = Collections = {}));
package/build/regex.js CHANGED
@@ -6,7 +6,7 @@ const regex = {
6
6
  date: /^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$/,
7
7
  email: /^[\w.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
8
8
  /** Saisie tolérante (schéma / attribut HTML). La valeur canonique est produite par `normalizeLinkedInUrl`. */
9
- linkedin: /^(https?:\/\/)?(www\.)?([\w-]+\.)?linkedin\.com\/(pub|in|profile)\/.+$/i,
9
+ linkedin: /^(https?:\/\/)?(www\.)?([\w-]+\.)?linkedin\.com\/(pub|in|profile|company)\/.+$/i,
10
10
  name: /^(?=.*[A-Za-zÜ-ü])[A-Za-zÜ-ü\s\-]{1,50}$/,
11
11
  tel: /^([+][1-9]{2,3}[ .\-]?)?[0-9]{1,3}([ .\-]?[0-9]{2,3}){3,6}$/,
12
12
  };
@@ -37,7 +37,7 @@ function normalizeLinkedInUrl(raw) {
37
37
  /^[\w-]+\.linkedin\.com$/i.test(hn);
38
38
  if (!validHost)
39
39
  return null;
40
- if (!/^\/(in|pub|profile)\/.+/i.test(url.pathname)) {
40
+ if (!/^\/(in|pub|profile|company)\/.+/i.test(url.pathname)) {
41
41
  return null;
42
42
  }
43
43
  const path = url.pathname.endsWith("/")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofondateurauchomage/libs",
3
- "version": "1.1.141",
3
+ "version": "1.1.144",
4
4
  "description": "",
5
5
  "main": "build/index",
6
6
  "scripts": {