@n8n/api-types 0.33.0 → 0.35.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.
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { Z } from 'zod-class';
3
3
  export declare const MAX_ITEMS_PER_PAGE = 50;
4
- export declare const createTakeValidator: (maxItems: number) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>, number, string | undefined>, number, string | undefined>, number, string | undefined>;
4
+ export declare const createTakeValidator: (maxItems: number, allowInfinity?: boolean) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>, number, string | undefined>, number, string | undefined>, number, string | undefined>;
5
5
  export declare const paginationSchema: {
6
6
  skip: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>, number, string | undefined>, number, string | undefined>;
7
7
  take: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>, number, string | undefined>, number, string | undefined>, number, string | undefined>;
@@ -14,14 +14,18 @@ const skipValidator = zod_1.z
14
14
  .refine((val) => val >= 0, {
15
15
  message: 'Param `skip` must be a non-negative integer',
16
16
  });
17
- const createTakeValidator = (maxItems) => zod_1.z
17
+ const createTakeValidator = (maxItems, allowInfinity = false) => zod_1.z
18
18
  .string()
19
19
  .optional()
20
20
  .transform((val) => (val ? parseInt(val, 10) : 10))
21
21
  .refine((val) => !isNaN(val) && Number.isInteger(val), {
22
22
  message: 'Param `take` must be a valid integer',
23
23
  })
24
- .refine((val) => val >= 0, {
24
+ .refine((val) => {
25
+ if (!allowInfinity)
26
+ return val >= 0;
27
+ return true;
28
+ }, {
25
29
  message: 'Param `take` must be a non-negative integer',
26
30
  })
27
31
  .transform((val) => Math.min(val, maxItems));
@@ -1 +1 @@
1
- {"version":3,"file":"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E,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;IACtD,OAAO,EAAE,sCAAsC;CAC/C,CAAC;KACD,MAAM,CACN,CAAC,GAAG,EAAE,EAAE;IACP,IAAI,CAAC,aAAa;QAAE,OAAO,GAAG,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACb,CAAC,EACD;IACC,OAAO,EAAE,6CAA6C;CACtD,CACD;KACA,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;AAjBlC,QAAA,mBAAmB,uBAiBe;AAElC,QAAA,gBAAgB,GAAG;IAC/B,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,IAAA,2BAAmB,EAAC,0BAAkB,CAAC;CAC7C,CAAC;AAEF,MAAa,aAAc,SAAQ,aAAC,CAAC,KAAK,CAAC,wBAAgB,CAAC;CAAG;AAA/D,sCAA+D"}
@@ -13,6 +13,19 @@ declare const PushWorkFolderRequestDto_base: Z.Class<{
13
13
  conflict: z.ZodBoolean;
14
14
  updatedAt: z.ZodString;
15
15
  pushed: z.ZodOptional<z.ZodBoolean>;
16
+ owner: z.ZodOptional<z.ZodObject<{
17
+ type: z.ZodEnum<["personal", "team"]>;
18
+ projectId: z.ZodString;
19
+ projectName: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ type: "personal" | "team";
22
+ projectId: string;
23
+ projectName: string;
24
+ }, {
25
+ type: "personal" | "team";
26
+ projectId: string;
27
+ projectName: string;
28
+ }>>;
16
29
  }, "strip", z.ZodTypeAny, {
17
30
  type: "workflow" | "credential" | "file" | "tags" | "variables" | "folders";
18
31
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
@@ -23,6 +36,11 @@ declare const PushWorkFolderRequestDto_base: Z.Class<{
23
36
  conflict: boolean;
24
37
  updatedAt: string;
25
38
  pushed?: boolean | undefined;
39
+ owner?: {
40
+ type: "personal" | "team";
41
+ projectId: string;
42
+ projectName: string;
43
+ } | undefined;
26
44
  }, {
27
45
  type: "workflow" | "credential" | "file" | "tags" | "variables" | "folders";
28
46
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
@@ -33,6 +51,11 @@ declare const PushWorkFolderRequestDto_base: Z.Class<{
33
51
  conflict: boolean;
34
52
  updatedAt: string;
35
53
  pushed?: boolean | undefined;
54
+ owner?: {
55
+ type: "personal" | "team";
56
+ projectId: string;
57
+ projectName: string;
58
+ } | undefined;
36
59
  }>, "many">;
37
60
  }>;
38
61
  export declare class PushWorkFolderRequestDto extends PushWorkFolderRequestDto_base {
@@ -1,9 +1,19 @@
1
1
  import { z } from 'zod';
2
2
  import { Z } from 'zod-class';
3
3
  declare const UsersListFilterDto_base: Z.Class<{
4
- sortBy: z.ZodOptional<z.ZodEnum<["name:asc", "name:desc", "role:asc", "role:desc", "lastActive:asc", "lastActive:desc"]>>;
5
- skip: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>, number, string | undefined>, number, string | undefined>;
6
4
  take: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>, number, string | undefined>, number, string | undefined>, number, string | undefined>;
5
+ select: z.ZodOptional<z.ZodArray<z.ZodEnum<["id", "firstName", "lastName", "email", "disabled", "mfaEnabled", "role"]>, "many">>;
6
+ filter: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodString>, {
7
+ email?: string | undefined;
8
+ firstName?: string | undefined;
9
+ lastName?: string | undefined;
10
+ mfaEnabled?: boolean | undefined;
11
+ isOwner?: boolean | undefined;
12
+ fullText?: string | undefined;
13
+ } | undefined, string | undefined>>;
14
+ expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["projectRelations"]>, "many">>;
15
+ sortBy: z.ZodOptional<z.ZodArray<z.ZodEnum<["firstName:asc", "firstName:desc", "lastName:asc", "lastName:desc", "role:asc", "role:desc", "mfaEnabled:asc", "mfaEnabled:desc"]>, "many">>;
16
+ skip: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>, number, string | undefined>, number, string | undefined>;
7
17
  }>;
8
18
  export declare class UsersListFilterDto extends UsersListFilterDto_base {
9
19
  }
@@ -1,24 +1,70 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UsersListFilterDto = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
4
5
  const zod_1 = require("zod");
5
6
  const zod_class_1 = require("zod-class");
6
7
  const pagination_dto_1 = require("../pagination/pagination.dto");
7
8
  const USERS_LIST_SORT_OPTIONS = [
8
- 'name:asc',
9
- 'name:desc',
9
+ 'firstName:asc',
10
+ 'firstName:desc',
11
+ 'lastName:asc',
12
+ 'lastName:desc',
10
13
  'role:asc',
11
14
  'role:desc',
12
- 'lastActive:asc',
13
- 'lastActive:desc',
15
+ 'mfaEnabled:asc',
16
+ 'mfaEnabled:desc',
14
17
  ];
15
18
  const usersListSortByValidator = zod_1.z
16
- .enum(USERS_LIST_SORT_OPTIONS, {
19
+ .array(zod_1.z.enum(USERS_LIST_SORT_OPTIONS, {
17
20
  message: `sortBy must be one of: ${USERS_LIST_SORT_OPTIONS.join(', ')}`,
18
- })
21
+ }))
19
22
  .optional();
23
+ const userSelectSchema = zod_1.z.array(zod_1.z.enum(['id', 'firstName', 'lastName', 'email', 'disabled', 'mfaEnabled', 'role']));
24
+ const userFilterSchema = zod_1.z.object({
25
+ isOwner: zod_1.z.boolean().optional(),
26
+ firstName: zod_1.z.string().optional(),
27
+ lastName: zod_1.z.string().optional(),
28
+ email: zod_1.z.string().optional(),
29
+ mfaEnabled: zod_1.z.boolean().optional(),
30
+ fullText: zod_1.z.string().optional(),
31
+ });
32
+ const filterValidatorSchema = zod_1.z
33
+ .string()
34
+ .optional()
35
+ .transform((val, ctx) => {
36
+ if (!val)
37
+ return undefined;
38
+ try {
39
+ const parsed = (0, n8n_workflow_1.jsonParse)(val);
40
+ try {
41
+ return userFilterSchema.parse(parsed);
42
+ }
43
+ catch (e) {
44
+ ctx.addIssue({
45
+ code: zod_1.z.ZodIssueCode.custom,
46
+ message: 'Invalid filter fields',
47
+ path: ['filter'],
48
+ });
49
+ return zod_1.z.NEVER;
50
+ }
51
+ }
52
+ catch (e) {
53
+ ctx.addIssue({
54
+ code: zod_1.z.ZodIssueCode.custom,
55
+ message: 'Invalid filter format',
56
+ path: ['filter'],
57
+ });
58
+ return zod_1.z.NEVER;
59
+ }
60
+ });
61
+ const userExpandSchema = zod_1.z.array(zod_1.z.enum(['projectRelations']));
20
62
  class UsersListFilterDto extends zod_class_1.Z.class({
21
63
  ...pagination_dto_1.paginationSchema,
64
+ take: (0, pagination_dto_1.createTakeValidator)(50, true),
65
+ select: userSelectSchema.optional(),
66
+ filter: filterValidatorSchema.optional(),
67
+ expand: userExpandSchema.optional(),
22
68
  sortBy: usersListSortByValidator,
23
69
  }) {
24
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"users-list-filter.dto.js","sourceRoot":"","sources":["../../../src/dto/user/users-list-filter.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,yCAA8B;AAE9B,iEAAgE;AAEhE,MAAM,uBAAuB,GAAG;IAC/B,UAAU;IACV,WAAW;IACX,UAAU;IACV,WAAW;IACX,gBAAgB;IAChB,iBAAiB;CACR,CAAC;AAEX,MAAM,wBAAwB,GAAG,OAAC;KAChC,IAAI,CAAC,uBAAuB,EAAE;IAC9B,OAAO,EAAE,0BAA0B,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;CACvE,CAAC;KACD,QAAQ,EAAE,CAAC;AAEb,MAAa,kBAAmB,SAAQ,aAAC,CAAC,KAAK,CAAC;IAC/C,GAAG,iCAAgB;IA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AARL,gDAQK"}
@@ -3,6 +3,8 @@ import { type InsightsDateRange } from './schemas/insights.schema';
3
3
  export interface IVersionNotificationSettings {
4
4
  enabled: boolean;
5
5
  endpoint: string;
6
+ whatsNewEnabled: boolean;
7
+ whatsNewEndpoint: string;
6
8
  infoUrl: string;
7
9
  }
8
10
  export interface ITelemetryClientConfig {
@@ -184,13 +186,15 @@ export interface FrontendSettings {
184
186
  partialExecution: {
185
187
  version: 1 | 2;
186
188
  };
187
- insights: {
188
- enabled: boolean;
189
- summary: boolean;
190
- dashboard: boolean;
191
- dateRanges: InsightsDateRange[];
192
- };
193
189
  evaluation: {
194
190
  quota: number;
195
191
  };
192
+ activeModules: string[];
196
193
  }
194
+ export type FrontendModuleSettings = {
195
+ insights?: {
196
+ summary: boolean;
197
+ dashboard: boolean;
198
+ dateRanges: InsightsDateRange[];
199
+ };
200
+ };
package/dist/index.d.ts CHANGED
@@ -15,5 +15,5 @@ export { ViewableMimeTypes } from './schemas/binary-data.schema';
15
15
  export { passwordSchema } from './schemas/password.schema';
16
16
  export type { ProjectType, ProjectIcon, ProjectRelation, } from './schemas/project.schema';
17
17
  export { type SourceControlledFile, SOURCE_CONTROL_FILE_LOCATION, SOURCE_CONTROL_FILE_STATUS, SOURCE_CONTROL_FILE_TYPE, } from './schemas/source-controlled-file.schema';
18
- export { type InsightsSummaryType, type InsightsSummaryUnit, type InsightsSummary, type InsightsByWorkflow, type InsightsByTime, type InsightsDateRange, INSIGHTS_DATE_RANGE_KEYS, } from './schemas/insights.schema';
19
- export { ROLE, type Role, type UsersList, } from './schemas/user.schema';
18
+ export { type InsightsSummaryType, type InsightsSummaryUnit, type InsightsSummary, type InsightsByWorkflow, type InsightsByTime, type InsightsDateRange, } from './schemas/insights.schema';
19
+ export { ROLE, type Role, type User, type UsersList, usersListSchema, } from './schemas/user.schema';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ROLE = exports.INSIGHTS_DATE_RANGE_KEYS = exports.SOURCE_CONTROL_FILE_TYPE = exports.SOURCE_CONTROL_FILE_STATUS = exports.SOURCE_CONTROL_FILE_LOCATION = exports.passwordSchema = exports.ViewableMimeTypes = exports.heartbeatMessageSchema = exports.createHeartbeatMessage = void 0;
17
+ exports.usersListSchema = exports.ROLE = exports.SOURCE_CONTROL_FILE_TYPE = exports.SOURCE_CONTROL_FILE_STATUS = exports.SOURCE_CONTROL_FILE_LOCATION = exports.passwordSchema = exports.ViewableMimeTypes = exports.heartbeatMessageSchema = exports.createHeartbeatMessage = void 0;
18
18
  __exportStar(require("./dto"), exports);
19
19
  var heartbeat_1 = require("./push/heartbeat");
20
20
  Object.defineProperty(exports, "createHeartbeatMessage", { enumerable: true, get: function () { return heartbeat_1.createHeartbeatMessage; } });
@@ -27,8 +27,7 @@ var source_controlled_file_schema_1 = require("./schemas/source-controlled-file.
27
27
  Object.defineProperty(exports, "SOURCE_CONTROL_FILE_LOCATION", { enumerable: true, get: function () { return source_controlled_file_schema_1.SOURCE_CONTROL_FILE_LOCATION; } });
28
28
  Object.defineProperty(exports, "SOURCE_CONTROL_FILE_STATUS", { enumerable: true, get: function () { return source_controlled_file_schema_1.SOURCE_CONTROL_FILE_STATUS; } });
29
29
  Object.defineProperty(exports, "SOURCE_CONTROL_FILE_TYPE", { enumerable: true, get: function () { return source_controlled_file_schema_1.SOURCE_CONTROL_FILE_TYPE; } });
30
- var insights_schema_1 = require("./schemas/insights.schema");
31
- Object.defineProperty(exports, "INSIGHTS_DATE_RANGE_KEYS", { enumerable: true, get: function () { return insights_schema_1.INSIGHTS_DATE_RANGE_KEYS; } });
32
30
  var user_schema_1 = require("./schemas/user.schema");
33
31
  Object.defineProperty(exports, "ROLE", { enumerable: true, get: function () { return user_schema_1.ROLE; } });
32
+ Object.defineProperty(exports, "usersListSchema", { enumerable: true, get: function () { return user_schema_1.usersListSchema; } });
34
33
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,wCAAsB;AAUtB,8CAAkF;AAAzE,mHAAA,sBAAsB,OAAA;AAAE,mHAAA,sBAAsB,OAAA;AAIvD,mEAAiE;AAAxD,uHAAA,iBAAiB,OAAA;AAC1B,6DAA2D;AAAlD,iHAAA,cAAc,OAAA;AAQvB,yFAKiD;AAHhD,6IAAA,4BAA4B,OAAA;AAC5B,2IAAA,0BAA0B,OAAA;AAC1B,yIAAA,wBAAwB,OAAA;AAGzB,6DAQmC;AADlC,2HAAA,wBAAwB,OAAA;AAGzB,qDAI+B;AAH9B,mGAAA,IAAI,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,wCAAsB;AAUtB,8CAAkF;AAAzE,mHAAA,sBAAsB,OAAA;AAAE,mHAAA,sBAAsB,OAAA;AAIvD,mEAAiE;AAAxD,uHAAA,iBAAiB,OAAA;AAC1B,6DAA2D;AAAlD,iHAAA,cAAc,OAAA;AAQvB,yFAKiD;AAHhD,6IAAA,4BAA4B,OAAA;AAC5B,2IAAA,0BAA0B,OAAA;AAC1B,yIAAA,wBAAwB,OAAA;AAYzB,qDAM+B;AAL9B,mGAAA,IAAI,OAAA;AAIJ,8GAAA,eAAe,OAAA"}
@@ -372,7 +372,37 @@ export declare const insightsByTimeSchema: z.ZodObject<{
372
372
  date: string;
373
373
  }>;
374
374
  export type InsightsByTime = z.infer<typeof insightsByTimeSchema>;
375
- export declare const INSIGHTS_DATE_RANGE_KEYS: readonly ["day", "week", "2weeks", "month", "quarter", "6months", "year"];
375
+ export declare const restrictedInsightsByTimeDataSchema: {
376
+ readonly date: z.ZodEffects<z.ZodString, string, string>;
377
+ readonly values: z.ZodObject<{
378
+ timeSaved: z.ZodNumber;
379
+ }, "strict", z.ZodTypeAny, {
380
+ timeSaved: number;
381
+ }, {
382
+ timeSaved: number;
383
+ }>;
384
+ };
385
+ export declare const restrictedInsightsByTimeSchema: z.ZodObject<{
386
+ readonly date: z.ZodEffects<z.ZodString, string, string>;
387
+ readonly values: z.ZodObject<{
388
+ timeSaved: z.ZodNumber;
389
+ }, "strict", z.ZodTypeAny, {
390
+ timeSaved: number;
391
+ }, {
392
+ timeSaved: number;
393
+ }>;
394
+ }, "strict", z.ZodTypeAny, {
395
+ values: {
396
+ timeSaved: number;
397
+ };
398
+ date: string;
399
+ }, {
400
+ values: {
401
+ timeSaved: number;
402
+ };
403
+ date: string;
404
+ }>;
405
+ export type RestrictedInsightsByTime = z.infer<typeof restrictedInsightsByTimeSchema>;
376
406
  export declare const insightsDateRangeSchema: z.ZodObject<{
377
407
  key: z.ZodEnum<["day", "week", "2weeks", "month", "quarter", "6months", "year"]>;
378
408
  licensed: z.ZodBoolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insightsDateRangeSchema = exports.INSIGHTS_DATE_RANGE_KEYS = exports.insightsByTimeSchema = exports.insightsByTimeDataSchemas = exports.insightsByWorkflowSchema = exports.insightsByWorkflowDataSchemas = exports.insightsSummarySchema = exports.insightsSummaryDataSchemas = exports.insightsSummaryUnitSchema = exports.insightsSummaryTypeSchema = void 0;
3
+ exports.insightsDateRangeSchema = exports.restrictedInsightsByTimeSchema = exports.restrictedInsightsByTimeDataSchema = exports.insightsByTimeSchema = exports.insightsByTimeDataSchemas = exports.insightsByWorkflowSchema = exports.insightsByWorkflowDataSchemas = exports.insightsSummarySchema = exports.insightsSummaryDataSchemas = exports.insightsSummaryUnitSchema = exports.insightsSummaryTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.insightsSummaryTypeSchema = zod_1.z.enum([
6
6
  'total',
@@ -73,18 +73,20 @@ exports.insightsByTimeDataSchemas = {
73
73
  .strict(),
74
74
  };
75
75
  exports.insightsByTimeSchema = zod_1.z.object(exports.insightsByTimeDataSchemas).strict();
76
- exports.INSIGHTS_DATE_RANGE_KEYS = [
77
- 'day',
78
- 'week',
79
- '2weeks',
80
- 'month',
81
- 'quarter',
82
- '6months',
83
- 'year',
84
- ];
76
+ exports.restrictedInsightsByTimeDataSchema = {
77
+ date: zod_1.z.string().refine((val) => !isNaN(Date.parse(val)) && new Date(val).toISOString() === val, {
78
+ message: 'Invalid date format, must be ISO 8601 format',
79
+ }),
80
+ values: zod_1.z
81
+ .object({
82
+ timeSaved: zod_1.z.number(),
83
+ })
84
+ .strict(),
85
+ };
86
+ exports.restrictedInsightsByTimeSchema = zod_1.z.object(exports.restrictedInsightsByTimeDataSchema).strict();
85
87
  exports.insightsDateRangeSchema = zod_1.z
86
88
  .object({
87
- key: zod_1.z.enum(exports.INSIGHTS_DATE_RANGE_KEYS),
89
+ key: zod_1.z.enum(['day', 'week', '2weeks', 'month', 'quarter', '6months', 'year']),
88
90
  licensed: zod_1.z.boolean(),
89
91
  granularity: zod_1.z.enum(['hour', 'day', 'week']),
90
92
  })
@@ -1 +1 @@
1
- {"version":3,"file":"insights.schema.js","sourceRoot":"","sources":["../../src/schemas/insights.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,yBAAyB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC/C,OAAO;IACP,QAAQ;IACR,aAAa;IACb,WAAW;IACX,gBAAgB;CAChB,CAAC,CAAC;AAGU,QAAA,yBAAyB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGhF,QAAA,0BAA0B,GAAG;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;QACjB,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ZodBoolean>;
15
+ owner: z.ZodOptional<z.ZodObject<{
16
+ type: z.ZodEnum<["personal", "team"]>;
17
+ projectId: z.ZodString;
18
+ projectName: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ type: "personal" | "team";
21
+ projectId: string;
22
+ projectName: string;
23
+ }, {
24
+ type: "personal" | "team";
25
+ projectId: string;
26
+ projectName: string;
27
+ }>>;
15
28
  }, "strip", z.ZodTypeAny, {
16
29
  type: "workflow" | "credential" | "file" | "tags" | "variables" | "folders";
17
30
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
@@ -22,6 +35,11 @@ export declare const SourceControlledFileSchema: z.ZodObject<{
22
35
  conflict: boolean;
23
36
  updatedAt: string;
24
37
  pushed?: boolean | undefined;
38
+ owner?: {
39
+ type: "personal" | "team";
40
+ projectId: string;
41
+ projectName: string;
42
+ } | undefined;
25
43
  }, {
26
44
  type: "workflow" | "credential" | "file" | "tags" | "variables" | "folders";
27
45
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
@@ -32,5 +50,10 @@ export declare const SourceControlledFileSchema: z.ZodObject<{
32
50
  conflict: boolean;
33
51
  updatedAt: string;
34
52
  pushed?: boolean | undefined;
53
+ owner?: {
54
+ type: "personal" | "team";
55
+ projectId: string;
56
+ projectName: string;
57
+ } | undefined;
35
58
  }>;
36
59
  export type SourceControlledFile = z.infer<typeof SourceControlledFileSchema>;
@@ -18,6 +18,11 @@ const FileStatusSchema = zod_1.z.enum([
18
18
  exports.SOURCE_CONTROL_FILE_STATUS = FileStatusSchema.Values;
19
19
  const FileLocationSchema = zod_1.z.enum(['local', 'remote']);
20
20
  exports.SOURCE_CONTROL_FILE_LOCATION = FileLocationSchema.Values;
21
+ const ResourceOwnerSchema = zod_1.z.object({
22
+ type: zod_1.z.enum(['personal', 'team']),
23
+ projectId: zod_1.z.string(),
24
+ projectName: zod_1.z.string(),
25
+ });
21
26
  exports.SourceControlledFileSchema = zod_1.z.object({
22
27
  file: zod_1.z.string(),
23
28
  id: zod_1.z.string(),
@@ -28,5 +33,6 @@ exports.SourceControlledFileSchema = zod_1.z.object({
28
33
  conflict: zod_1.z.boolean(),
29
34
  updatedAt: zod_1.z.string(),
30
35
  pushed: zod_1.z.boolean().optional(),
36
+ owner: ResourceOwnerSchema.optional(),
31
37
  });
32
38
  //# sourceMappingURL=source-controlled-file.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-controlled-file.schema.js","sourceRoot":"","sources":["../../src/schemas/source-controlled-file.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AACrF,QAAA,wBAAwB,GAAG,cAAc,CAAC,MAAM,CAAC;AAE9D,MAAM,gBAAgB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC/B,KAAK;IACL,UAAU;IACV,SAAS;IACT,SAAS;IACT,SAAS;IACT,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,SAAS;CACT,CAAC,CAAC;AACU,QAAA,0BAA0B,GAAG,gBAAgB,CAAC,MAAM,CAAC;AAElE,MAAM,kBAAkB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC1C,QAAA,4BAA4B,GAAG,kBAAkB,CAAC,MAAM,CAAC;AAEzD,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC"}
1
+ {"version":3,"file":"source-controlled-file.schema.js","sourceRoot":"","sources":["../../src/schemas/source-controlled-file.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AACrF,QAAA,wBAAwB,GAAG,cAAc,CAAC,MAAM,CAAC;AAE9D,MAAM,gBAAgB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC/B,KAAK;IACL,UAAU;IACV,SAAS;IACT,SAAS;IACT,SAAS;IACT,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,SAAS;CACT,CAAC,CAAC;AACU,QAAA,0BAA0B,GAAG,gBAAgB,CAAC,MAAM,CAAC;AAElE,MAAM,kBAAkB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC1C,QAAA,4BAA4B,GAAG,kBAAkB,CAAC,MAAM,CAAC;AAEtE,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAClC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { z } from 'zod';
2
+ export declare const npsSurveyRespondedSchema: z.ZodObject<{
3
+ lastShownAt: z.ZodNumber;
4
+ responded: z.ZodLiteral<true>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ lastShownAt: number;
7
+ responded: true;
8
+ }, {
9
+ lastShownAt: number;
10
+ responded: true;
11
+ }>;
12
+ export declare const npsSurveyWaitingSchema: z.ZodObject<{
13
+ lastShownAt: z.ZodNumber;
14
+ waitingForResponse: z.ZodLiteral<true>;
15
+ ignoredCount: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ lastShownAt: number;
18
+ waitingForResponse: true;
19
+ ignoredCount: number;
20
+ }, {
21
+ lastShownAt: number;
22
+ waitingForResponse: true;
23
+ ignoredCount: number;
24
+ }>;
25
+ export declare const npsSurveySchema: z.ZodUnion<[z.ZodObject<{
26
+ lastShownAt: z.ZodNumber;
27
+ responded: z.ZodLiteral<true>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ lastShownAt: number;
30
+ responded: true;
31
+ }, {
32
+ lastShownAt: number;
33
+ responded: true;
34
+ }>, z.ZodObject<{
35
+ lastShownAt: z.ZodNumber;
36
+ waitingForResponse: z.ZodLiteral<true>;
37
+ ignoredCount: z.ZodNumber;
38
+ }, "strip", z.ZodTypeAny, {
39
+ lastShownAt: number;
40
+ waitingForResponse: true;
41
+ ignoredCount: number;
42
+ }, {
43
+ lastShownAt: number;
44
+ waitingForResponse: true;
45
+ ignoredCount: number;
46
+ }>]>;
47
+ export declare const userSettingsSchema: z.ZodObject<{
48
+ isOnboarded: z.ZodOptional<z.ZodBoolean>;
49
+ firstSuccessfulWorkflowId: z.ZodOptional<z.ZodString>;
50
+ userActivated: z.ZodOptional<z.ZodBoolean>;
51
+ userActivatedAt: z.ZodOptional<z.ZodNumber>;
52
+ allowSSOManualLogin: z.ZodOptional<z.ZodBoolean>;
53
+ npsSurvey: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
54
+ lastShownAt: z.ZodNumber;
55
+ responded: z.ZodLiteral<true>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ lastShownAt: number;
58
+ responded: true;
59
+ }, {
60
+ lastShownAt: number;
61
+ responded: true;
62
+ }>, z.ZodObject<{
63
+ lastShownAt: z.ZodNumber;
64
+ waitingForResponse: z.ZodLiteral<true>;
65
+ ignoredCount: z.ZodNumber;
66
+ }, "strip", z.ZodTypeAny, {
67
+ lastShownAt: number;
68
+ waitingForResponse: true;
69
+ ignoredCount: number;
70
+ }, {
71
+ lastShownAt: number;
72
+ waitingForResponse: true;
73
+ ignoredCount: number;
74
+ }>]>>;
75
+ easyAIWorkflowOnboarded: z.ZodOptional<z.ZodBoolean>;
76
+ userClaimedAiCredits: z.ZodOptional<z.ZodBoolean>;
77
+ dismissedCallouts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ userActivated?: boolean | undefined;
80
+ allowSSOManualLogin?: boolean | undefined;
81
+ easyAIWorkflowOnboarded?: boolean | undefined;
82
+ dismissedCallouts?: Record<string, boolean> | undefined;
83
+ isOnboarded?: boolean | undefined;
84
+ firstSuccessfulWorkflowId?: string | undefined;
85
+ userActivatedAt?: number | undefined;
86
+ npsSurvey?: {
87
+ lastShownAt: number;
88
+ responded: true;
89
+ } | {
90
+ lastShownAt: number;
91
+ waitingForResponse: true;
92
+ ignoredCount: number;
93
+ } | undefined;
94
+ userClaimedAiCredits?: boolean | undefined;
95
+ }, {
96
+ userActivated?: boolean | undefined;
97
+ allowSSOManualLogin?: boolean | undefined;
98
+ easyAIWorkflowOnboarded?: boolean | undefined;
99
+ dismissedCallouts?: Record<string, boolean> | undefined;
100
+ isOnboarded?: boolean | undefined;
101
+ firstSuccessfulWorkflowId?: string | undefined;
102
+ userActivatedAt?: number | undefined;
103
+ npsSurvey?: {
104
+ lastShownAt: number;
105
+ responded: true;
106
+ } | {
107
+ lastShownAt: number;
108
+ waitingForResponse: true;
109
+ ignoredCount: number;
110
+ } | undefined;
111
+ userClaimedAiCredits?: boolean | undefined;
112
+ }>;
113
+ export type UserSettings = z.infer<typeof userSettingsSchema>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userSettingsSchema = exports.npsSurveySchema = exports.npsSurveyWaitingSchema = exports.npsSurveyRespondedSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.npsSurveyRespondedSchema = zod_1.z.object({
6
+ lastShownAt: zod_1.z.number(),
7
+ responded: zod_1.z.literal(true),
8
+ });
9
+ exports.npsSurveyWaitingSchema = zod_1.z.object({
10
+ lastShownAt: zod_1.z.number(),
11
+ waitingForResponse: zod_1.z.literal(true),
12
+ ignoredCount: zod_1.z.number(),
13
+ });
14
+ exports.npsSurveySchema = zod_1.z.union([exports.npsSurveyRespondedSchema, exports.npsSurveyWaitingSchema]);
15
+ exports.userSettingsSchema = zod_1.z.object({
16
+ isOnboarded: zod_1.z.boolean().optional(),
17
+ firstSuccessfulWorkflowId: zod_1.z.string().optional(),
18
+ userActivated: zod_1.z.boolean().optional(),
19
+ userActivatedAt: zod_1.z.number().optional(),
20
+ allowSSOManualLogin: zod_1.z.boolean().optional(),
21
+ npsSurvey: exports.npsSurveySchema.optional(),
22
+ easyAIWorkflowOnboarded: zod_1.z.boolean().optional(),
23
+ userClaimedAiCredits: zod_1.z.boolean().optional(),
24
+ dismissedCallouts: zod_1.z.record(zod_1.z.boolean()).optional(),
25
+ });
26
+ //# sourceMappingURL=user-settings.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-settings.schema.js","sourceRoot":"","sources":["../../src/schemas/user-settings.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,SAAS,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CAC1B,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,kBAAkB,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACnC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,OAAC,CAAC,KAAK,CAAC,CAAC,gCAAwB,EAAE,8BAAsB,CAAC,CAAC,CAAC;AAE9E,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC,yBAAyB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChD,aAAa,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,mBAAmB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,SAAS,EAAE,uBAAe,CAAC,QAAQ,EAAE;IACrC,uBAAuB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/C,oBAAoB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5C,iBAAiB,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CA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