codebase-models 3.1.4 → 3.1.6

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.
@@ -33,7 +33,6 @@ export interface IClient extends Document {
33
33
  organization: mongoose.Schema.Types.ObjectId;
34
34
  name: string;
35
35
  url: string;
36
- slug?: string;
37
36
  viewId?: string;
38
37
  portfolioClient?: boolean;
39
38
  gaproperties?: IProperty[];
@@ -48,6 +47,8 @@ export interface IClient extends Document {
48
47
  NDAStatus?: boolean;
49
48
  retainerValue: number;
50
49
  useIntraDayTable: boolean;
50
+ slug?: string;
51
+ onboardingCompleted: boolean;
51
52
  }
52
53
  declare const Client: mongoose.Model<any, {}, {}, {}, any, any>;
53
54
  export default Client;
@@ -87,6 +87,7 @@ const ClientSchema = new mongoose_1.Schema({
87
87
  NDAStatus: { type: Boolean, default: false },
88
88
  retainerValue: { type: Number },
89
89
  useIntraDayTable: { type: Boolean },
90
+ onboardingCompleted: { type: Boolean, default: false },
90
91
  }, {
91
92
  timestamps: true,
92
93
  });
@@ -32,7 +32,8 @@ const InvitationSchema = new mongoose_1.Schema({
32
32
  organization: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "organization", required: true },
33
33
  client: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "client" },
34
34
  role: { type: String, enum: ["owner", "admin", "member"], default: "member" },
35
- permissions: { type: mongoose_1.default.Schema.Types.Mixed, required: true, default: {
35
+ permissions: {
36
+ type: mongoose_1.default.Schema.Types.Mixed, required: true, default: {
36
37
  dashboard: true,
37
38
  reporting: false,
38
39
  insights: false,
@@ -42,9 +43,10 @@ const InvitationSchema = new mongoose_1.Schema({
42
43
  abTestingDefault: true,
43
44
  manageExperiments: false,
44
45
  preCalculations: false,
45
- } },
46
+ }
47
+ },
46
48
  token: { type: String, unique: true, required: true },
47
- status: { type: String, enum: ["pending", "accepted", "expired", "revoked"], default: "pending" },
49
+ status: { type: String, enum: ["pending", "accepted", "expired", "revoked", "declined"], default: "pending" },
48
50
  expiresAt: { type: Date, default: Date.now() + 1000 * 60 * 60 * 24 * 30 },
49
51
  }, {
50
52
  timestamps: true
@@ -25,7 +25,8 @@
25
25
  import mongoose, { Document } from "mongoose";
26
26
  export declare enum ProviderType {
27
27
  SHOPIFY = "shopify",
28
- BIGQUERY = "bigquery"
28
+ BIGQUERY = "bigquery",
29
+ GOOGLE_ANALYTICS = "google_analytics"
29
30
  }
30
31
  export interface IShopifyMetadata {
31
32
  apiKey: string;
@@ -31,7 +31,7 @@ var ProviderType;
31
31
  (function (ProviderType) {
32
32
  ProviderType["SHOPIFY"] = "shopify";
33
33
  ProviderType["BIGQUERY"] = "bigquery";
34
- // GOOGLE_ANALYTICS = "google_analytics",
34
+ ProviderType["GOOGLE_ANALYTICS"] = "google_analytics";
35
35
  // GOOGLE_TAG_MANAGER = "google_tag_manager",
36
36
  // GOOGLE_ADS = "google_ads",
37
37
  // GOOGLE_SEARCH_CONSOLE = "google_search_console",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-models",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "Common models for codebase",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -9,7 +9,6 @@ export interface IProperty extends Document {
9
9
  viewId: string;
10
10
  platform?: string;
11
11
  }
12
-
13
12
  const PropertySchema: Schema = new Schema<IProperty>({
14
13
  propertyname: { type: String, required: true },
15
14
  viewId: { type: String, required: true },
@@ -20,7 +19,6 @@ export interface IClient extends Document {
20
19
  organization: mongoose.Schema.Types.ObjectId;
21
20
  name: string;
22
21
  url: string;
23
- slug?: string;
24
22
  viewId?: string;
25
23
  portfolioClient?: boolean;
26
24
  gaproperties?: IProperty[];
@@ -35,6 +33,8 @@ export interface IClient extends Document {
35
33
  NDAStatus?: boolean;
36
34
  retainerValue: number;
37
35
  useIntraDayTable: boolean;
36
+ slug?: string;
37
+ onboardingCompleted: boolean;
38
38
  }
39
39
 
40
40
  const ClientSchema: Schema = new Schema<IClient>(
@@ -81,6 +81,7 @@ const ClientSchema: Schema = new Schema<IClient>(
81
81
  NDAStatus: { type: Boolean, default: false },
82
82
  retainerValue: { type: Number },
83
83
  useIntraDayTable: { type: Boolean },
84
+ onboardingCompleted: { type: Boolean, default: false },
84
85
  },
85
86
  {
86
87
  timestamps: true,
@@ -2,18 +2,18 @@ import mongoose, { Document, Schema, model } from "mongoose";
2
2
  import { generateRandomIID } from "../constant";
3
3
 
4
4
  export interface IInvitation extends Document {
5
- iid: string;
6
- email: string;
7
- invitedBy: mongoose.Types.ObjectId; // user who sent the invite
8
- organization: mongoose.Types.ObjectId;
9
- client?: mongoose.Types.ObjectId; // optional (invite to specific client)
10
- role?: string; // optional role name
11
- permissions?: mongoose.Schema.Types.Mixed;
12
- token: string;
13
- status: string;
14
- expiresAt: Date;
15
- createdAt: Date;
16
- updatedAt: Date;
5
+ iid: string;
6
+ email: string;
7
+ invitedBy: mongoose.Types.ObjectId; // user who sent the invite
8
+ organization: mongoose.Types.ObjectId;
9
+ client?: mongoose.Types.ObjectId; // optional (invite to specific client)
10
+ role?: string; // optional role name
11
+ permissions?: mongoose.Schema.Types.Mixed;
12
+ token: string;
13
+ status: string;
14
+ expiresAt: Date;
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
17
  }
18
18
  const InvitationSchema = new Schema<IInvitation>({
19
19
  iid: { type: String, unique: true, default: () => generateRandomIID() },
@@ -22,24 +22,26 @@ const InvitationSchema = new Schema<IInvitation>({
22
22
  organization: { type: mongoose.Schema.Types.ObjectId, ref: "organization", required: true },
23
23
  client: { type: mongoose.Schema.Types.ObjectId, ref: "client" },
24
24
  role: { type: String, enum: ["owner", "admin", "member"], default: "member" },
25
- permissions: { type: mongoose.Schema.Types.Mixed, required: true, default: {
26
- dashboard: true,
27
- reporting: false,
28
- insights: false,
29
- documentsAndLinks: false,
30
- cvrReports: false,
31
- abTesting: false,
32
- abTestingDefault: true,
33
- manageExperiments: false,
34
- preCalculations: false,
35
- } },
25
+ permissions: {
26
+ type: mongoose.Schema.Types.Mixed, required: true, default: {
27
+ dashboard: true,
28
+ reporting: false,
29
+ insights: false,
30
+ documentsAndLinks: false,
31
+ cvrReports: false,
32
+ abTesting: false,
33
+ abTestingDefault: true,
34
+ manageExperiments: false,
35
+ preCalculations: false,
36
+ }
37
+ },
36
38
  token: { type: String, unique: true, required: true },
37
- status: { type: String, enum: ["pending", "accepted", "expired", "revoked"], default: "pending" },
39
+ status: { type: String, enum: ["pending", "accepted", "expired", "revoked", "declined"], default: "pending" },
38
40
  expiresAt: { type: Date, default: Date.now() + 1000 * 60 * 60 * 24 * 30 },
39
41
  },
40
- {
42
+ {
41
43
  timestamps: true
42
- });
44
+ });
43
45
 
44
46
  InvitationSchema.index({ email: 1, organization: 1 });
45
47
  InvitationSchema.index({ token: 1 }, { unique: true });
@@ -5,7 +5,7 @@ import { generateRandomIID } from "../constant";
5
5
  export enum ProviderType {
6
6
  SHOPIFY = "shopify",
7
7
  BIGQUERY = "bigquery",
8
- // GOOGLE_ANALYTICS = "google_analytics",
8
+ GOOGLE_ANALYTICS = "google_analytics",
9
9
  // GOOGLE_TAG_MANAGER = "google_tag_manager",
10
10
  // GOOGLE_ADS = "google_ads",
11
11
  // GOOGLE_SEARCH_CONSOLE = "google_search_console",