shred-api-client 1.14.3 → 1.14.4-rc.2

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 (114) hide show
  1. package/dist/api/AppConfig.api.d.ts +2 -2
  2. package/dist/api/AppConfig.api.js +25 -2
  3. package/dist/api/Email.api.d.ts +3 -3
  4. package/dist/api/Email.api.js +25 -2
  5. package/dist/api/Goal.api.d.ts +10 -0
  6. package/dist/api/Goal.api.js +42 -0
  7. package/dist/api/Note.api.d.ts +0 -0
  8. package/dist/api/Note.api.js +1 -0
  9. package/dist/api/Notification.api.d.ts +8 -8
  10. package/dist/api/Notification.api.js +32 -9
  11. package/dist/api/Project.api.d.ts +8 -8
  12. package/dist/api/Project.api.js +38 -18
  13. package/dist/api/Prompt.api.d.ts +6 -6
  14. package/dist/api/Prompt.api.js +6 -6
  15. package/dist/api/Subscription.api.d.ts +6 -6
  16. package/dist/api/Subscription.api.js +12 -12
  17. package/dist/api/Tenant.api.d.ts +7 -7
  18. package/dist/api/Tenant.api.js +7 -7
  19. package/dist/api/Track.api.d.ts +3 -3
  20. package/dist/api/Track.api.js +2 -2
  21. package/dist/api/User.api.d.ts +6 -6
  22. package/dist/api/User.api.js +15 -15
  23. package/dist/index.d.ts +13 -5
  24. package/dist/index.js +26 -16
  25. package/dist/model/Api.d.ts +20 -39
  26. package/dist/model/Api.js +3 -1
  27. package/dist/model/app-config/AppConfig.api.d.ts +9 -0
  28. package/dist/model/{AppConfig.schema.js → app-config/AppConfig.api.js} +2 -3
  29. package/dist/model/app-config/index.d.ts +1 -0
  30. package/dist/model/app-config/index.js +17 -0
  31. package/dist/model/asset/index.d.ts +2 -0
  32. package/dist/model/asset/index.js +5 -0
  33. package/dist/model/core/APIResponse.d.ts +6 -0
  34. package/dist/model/core/APIResponse.js +2 -0
  35. package/dist/model/core/Query.d.ts +15 -0
  36. package/dist/model/core/Query.js +2 -0
  37. package/dist/model/core/index.d.ts +2 -0
  38. package/dist/model/core/index.js +18 -0
  39. package/dist/model/email/Email.api.d.ts +11 -0
  40. package/dist/model/{Email.schema.js → email/Email.api.js} +2 -3
  41. package/dist/model/email/Email.schema.d.ts +15 -0
  42. package/dist/model/email/Email.schema.js +9 -0
  43. package/dist/model/email/index.d.ts +3 -0
  44. package/dist/model/email/index.js +20 -0
  45. package/dist/model/exceptions/index.d.ts +3 -2
  46. package/dist/model/exceptions/index.js +2 -1
  47. package/dist/model/goal/Goal.api.d.ts +11 -0
  48. package/dist/model/goal/Goal.api.js +6 -0
  49. package/dist/model/goal/Goal.schema.d.ts +154 -0
  50. package/dist/model/goal/Goal.schema.js +26 -0
  51. package/dist/model/goal/index.d.ts +3 -0
  52. package/dist/model/goal/index.js +22 -0
  53. package/dist/model/note/Note.api.d.ts +26 -0
  54. package/dist/model/note/Note.api.js +21 -0
  55. package/dist/model/note/Note.schema.d.ts +141 -0
  56. package/dist/model/note/Note.schema.js +30 -0
  57. package/dist/model/note/index.d.ts +2 -0
  58. package/dist/model/note/index.js +6 -0
  59. package/dist/model/notification/Notification.api.d.ts +47 -0
  60. package/dist/model/notification/Notification.api.js +13 -0
  61. package/dist/model/notification/Notification.schema.d.ts +454 -0
  62. package/dist/model/notification/Notification.schema.js +111 -0
  63. package/dist/model/notification/index.d.ts +3 -0
  64. package/dist/model/notification/index.js +30 -0
  65. package/dist/model/project/Project.api.d.ts +66 -0
  66. package/dist/model/project/Project.api.js +20 -0
  67. package/dist/model/project/Project.schema.d.ts +206 -0
  68. package/dist/model/{Project.schema.js → project/Project.schema.js} +31 -52
  69. package/dist/model/project/index.d.ts +3 -0
  70. package/dist/model/project/index.js +24 -0
  71. package/dist/model/{Prompt.schema.d.ts → prompt/Prompt.api.d.ts} +4 -24
  72. package/dist/model/{Prompt.schema.js → prompt/Prompt.api.js} +2 -3
  73. package/dist/model/prompt/Prompt.schema.d.ts +165 -0
  74. package/dist/model/prompt/Prompt.schema.js +24 -0
  75. package/dist/model/prompt/index.d.ts +3 -0
  76. package/dist/model/prompt/index.js +22 -0
  77. package/dist/model/{Subscription.schema.d.ts → subscription/Subscription.api.d.ts} +4 -51
  78. package/dist/model/{Subscription.schema.js → subscription/Subscription.api.js} +2 -8
  79. package/dist/model/subscription/Subscription.schema.d.ts +314 -0
  80. package/dist/model/subscription/Subscription.schema.js +53 -0
  81. package/dist/model/subscription/index.d.ts +3 -0
  82. package/dist/model/subscription/index.js +25 -0
  83. package/dist/model/{Tenant.schema.d.ts → tenant/Tenant.api.d.ts} +4 -29
  84. package/dist/model/{Tenant.schema.js → tenant/Tenant.api.js} +2 -3
  85. package/dist/model/tenant/Tenant.schema.d.ts +342 -0
  86. package/dist/model/tenant/Tenant.schema.js +29 -0
  87. package/dist/model/tenant/index.d.ts +3 -0
  88. package/dist/model/tenant/index.js +21 -0
  89. package/dist/model/track/Track.api.d.ts +10 -0
  90. package/dist/model/{Track.schema.js → track/Track.api.js} +2 -3
  91. package/dist/model/track/Track.schema.d.ts +44 -0
  92. package/dist/model/track/Track.schema.js +14 -0
  93. package/dist/model/track/index.d.ts +3 -0
  94. package/dist/model/track/index.js +21 -0
  95. package/dist/model/user/User.api.d.ts +80 -0
  96. package/dist/model/user/User.api.js +20 -0
  97. package/dist/model/user/User.schema.d.ts +117 -0
  98. package/dist/model/user/User.schema.js +42 -0
  99. package/dist/model/user/index.d.ts +3 -0
  100. package/dist/model/user/index.js +23 -0
  101. package/dist/util/parseQuery.d.ts +2 -2
  102. package/package.json +1 -1
  103. package/dist/model/AppConfig.schema.d.ts +0 -10
  104. package/dist/model/Email.schema.d.ts +0 -17
  105. package/dist/model/Notification.schema.d.ts +0 -112
  106. package/dist/model/Notification.schema.js +0 -38
  107. package/dist/model/Project.schema.d.ts +0 -152
  108. package/dist/model/Track.schema.d.ts +0 -20
  109. package/dist/model/User.schema.d.ts +0 -253
  110. package/dist/model/User.schema.js +0 -97
  111. package/dist/namespace.d.ts +0 -259
  112. package/dist/namespace.js +0 -53
  113. package/dist/model/{Asset.schema.d.ts → asset/Asset.schema.d.ts} +4 -4
  114. /package/dist/model/{Asset.schema.js → asset/Asset.schema.js} +0 -0
@@ -0,0 +1,206 @@
1
+ import { z } from "zod";
2
+ export declare enum Status {
3
+ SUBMITTED = 0,
4
+ EDITING = 1,
5
+ COMPLETED = 2,
6
+ WAITING_APPROVE = 3,
7
+ DENIED = 4,
8
+ REVISIONING = 5,
9
+ CANCELLED = 6,
10
+ SCHEDULED = 7
11
+ }
12
+ export declare enum CaptionStyle {
13
+ ONE_LINE = 1,
14
+ ONE_LINE_EMOJIS = 2,
15
+ TWO_LINES = 5,
16
+ TWO_LINES_EMOJIS = 3,
17
+ HOME_HIGHLIGHT = 4
18
+ }
19
+ export declare const StatusSchema: z.ZodNativeEnum<typeof Status>;
20
+ export declare const CaptionStyleStatus: z.ZodNativeEnum<typeof CaptionStyle>;
21
+ export declare const Styles: Style[];
22
+ export type Style = {
23
+ value: CaptionStyle;
24
+ label: string;
25
+ };
26
+ export declare const TimelineItemSchema: z.ZodObject<{
27
+ status: z.ZodNativeEnum<typeof Status>;
28
+ title: z.ZodString;
29
+ description: z.ZodString;
30
+ timestamp: z.ZodNumber;
31
+ metadata: z.ZodRecord<z.ZodString, z.ZodAny>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ title: string;
34
+ status: Status;
35
+ metadata: Record<string, any>;
36
+ description: string;
37
+ timestamp: number;
38
+ }, {
39
+ title: string;
40
+ status: Status;
41
+ metadata: Record<string, any>;
42
+ description: string;
43
+ timestamp: number;
44
+ }>;
45
+ export declare const ProjectSchema: z.ZodObject<{
46
+ id: z.ZodString;
47
+ title: z.ZodString;
48
+ instructions: z.ZodString;
49
+ submitMonth: z.ZodString;
50
+ captionStyle: z.ZodNativeEnum<typeof CaptionStyle>;
51
+ finalVideoId: z.ZodOptional<z.ZodString>;
52
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
53
+ modified: z.ZodNumber;
54
+ captionSuggestion: z.ZodOptional<z.ZodString>;
55
+ editorId: z.ZodString;
56
+ userId: z.ZodString;
57
+ assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
+ assetId: z.ZodString;
59
+ fileName: z.ZodString;
60
+ extension: z.ZodString;
61
+ fileSize: z.ZodNumber;
62
+ assetUrl: z.ZodString;
63
+ thumbnailUrl: z.ZodString;
64
+ type: z.ZodString;
65
+ duration: z.ZodOptional<z.ZodNumber>;
66
+ progress: z.ZodOptional<z.ZodNumber>;
67
+ error: z.ZodOptional<z.ZodString>;
68
+ authorId: z.ZodString;
69
+ uploadedAt: z.ZodNumber;
70
+ }, "strip", z.ZodTypeAny, {
71
+ type: string;
72
+ assetId: string;
73
+ fileName: string;
74
+ extension: string;
75
+ fileSize: number;
76
+ assetUrl: string;
77
+ thumbnailUrl: string;
78
+ authorId: string;
79
+ uploadedAt: number;
80
+ error?: string | undefined;
81
+ duration?: number | undefined;
82
+ progress?: number | undefined;
83
+ }, {
84
+ type: string;
85
+ assetId: string;
86
+ fileName: string;
87
+ extension: string;
88
+ fileSize: number;
89
+ assetUrl: string;
90
+ thumbnailUrl: string;
91
+ authorId: string;
92
+ uploadedAt: number;
93
+ error?: string | undefined;
94
+ duration?: number | undefined;
95
+ progress?: number | undefined;
96
+ }>, "many">>;
97
+ expirationTimestamp: z.ZodNumber;
98
+ timeline: z.ZodArray<z.ZodObject<{
99
+ status: z.ZodNativeEnum<typeof Status>;
100
+ title: z.ZodString;
101
+ description: z.ZodString;
102
+ timestamp: z.ZodNumber;
103
+ metadata: z.ZodRecord<z.ZodString, z.ZodAny>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ title: string;
106
+ status: Status;
107
+ metadata: Record<string, any>;
108
+ description: string;
109
+ timestamp: number;
110
+ }, {
111
+ title: string;
112
+ status: Status;
113
+ metadata: Record<string, any>;
114
+ description: string;
115
+ timestamp: number;
116
+ }>, "many">;
117
+ submitTimestamp: z.ZodNumber;
118
+ tenantId: z.ZodOptional<z.ZodString>;
119
+ status: z.ZodNativeEnum<typeof Status>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ id: string;
122
+ userId: string;
123
+ title: string;
124
+ status: Status;
125
+ modified: number;
126
+ editorId: string;
127
+ instructions: string;
128
+ submitMonth: string;
129
+ captionStyle: CaptionStyle;
130
+ expirationTimestamp: number;
131
+ timeline: {
132
+ title: string;
133
+ status: Status;
134
+ metadata: Record<string, any>;
135
+ description: string;
136
+ timestamp: number;
137
+ }[];
138
+ submitTimestamp: number;
139
+ tenantId?: string | undefined;
140
+ thumbnailUrl?: string | undefined;
141
+ finalVideoId?: string | undefined;
142
+ captionSuggestion?: string | undefined;
143
+ assets?: {
144
+ type: string;
145
+ assetId: string;
146
+ fileName: string;
147
+ extension: string;
148
+ fileSize: number;
149
+ assetUrl: string;
150
+ thumbnailUrl: string;
151
+ authorId: string;
152
+ uploadedAt: number;
153
+ error?: string | undefined;
154
+ duration?: number | undefined;
155
+ progress?: number | undefined;
156
+ }[] | undefined;
157
+ }, {
158
+ id: string;
159
+ userId: string;
160
+ title: string;
161
+ status: Status;
162
+ modified: number;
163
+ editorId: string;
164
+ instructions: string;
165
+ submitMonth: string;
166
+ captionStyle: CaptionStyle;
167
+ expirationTimestamp: number;
168
+ timeline: {
169
+ title: string;
170
+ status: Status;
171
+ metadata: Record<string, any>;
172
+ description: string;
173
+ timestamp: number;
174
+ }[];
175
+ submitTimestamp: number;
176
+ tenantId?: string | undefined;
177
+ thumbnailUrl?: string | undefined;
178
+ finalVideoId?: string | undefined;
179
+ captionSuggestion?: string | undefined;
180
+ assets?: {
181
+ type: string;
182
+ assetId: string;
183
+ fileName: string;
184
+ extension: string;
185
+ fileSize: number;
186
+ assetUrl: string;
187
+ thumbnailUrl: string;
188
+ authorId: string;
189
+ uploadedAt: number;
190
+ error?: string | undefined;
191
+ duration?: number | undefined;
192
+ progress?: number | undefined;
193
+ }[] | undefined;
194
+ }>;
195
+ export type ProjectCreation = Pick<Project, "title" | "instructions" | "captionStyle" | "assets">;
196
+ export type SendToApproval = {
197
+ video: string;
198
+ thumbnail: string;
199
+ captionSuggestion: string;
200
+ };
201
+ export type Approve = {
202
+ scheduleTime?: number;
203
+ captionSuggestion: string;
204
+ };
205
+ export type Project = z.infer<typeof ProjectSchema>;
206
+ export type TimelineItem = z.infer<typeof TimelineItemSchema>;
@@ -1,57 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProjectEndpoints = exports.Styles = exports.CaptionStyle = exports.Status = void 0;
4
- const ProjectEndpoints = {
5
- List: {
6
- uri: "/projects/list",
7
- method: "GET",
8
- },
9
- CreateProject: {
10
- uri: "/projects/create",
11
- method: "POST",
12
- },
13
- FindOne: {
14
- uri: `/projects/:projectId/`,
15
- method: "GET",
16
- },
17
- GetGoals: {
18
- uri: `/projects/goals/list/`,
19
- method: "GET",
20
- },
21
- Review: {
22
- uri: "/projects/:projectId/review/",
23
- method: "POST",
24
- },
25
- Cancel: {
26
- uri: "/projects/:projectId/cancel/",
27
- method: "DELETE",
28
- },
29
- StartEdition: {
30
- uri: "/projects/:projectId/start/",
31
- method: "PUT",
32
- },
33
- SendToApproval: {
34
- uri: "/projects/:projectId/sendToApproval/",
35
- method: "PUT",
36
- },
37
- Approve: {
38
- uri: "/projects/:projectId/approve/",
39
- method: "POST",
40
- },
41
- Unschedule: {
42
- uri: "/projects/:projectId/unschedule/",
43
- method: "POST",
44
- },
45
- Rollback: {
46
- uri: "/projects/:projectId/rollback/",
47
- method: "POST",
48
- },
49
- Deny: {
50
- uri: "/projects/:projectId/deny/",
51
- method: "POST",
52
- },
53
- };
54
- exports.ProjectEndpoints = ProjectEndpoints;
3
+ exports.ProjectSchema = exports.TimelineItemSchema = exports.Styles = exports.CaptionStyleStatus = exports.StatusSchema = exports.CaptionStyle = exports.Status = void 0;
4
+ const zod_1 = require("zod");
5
+ const asset_1 = require("../asset");
55
6
  var Status;
56
7
  (function (Status) {
57
8
  Status[Status["SUBMITTED"] = 0] = "SUBMITTED";
@@ -71,6 +22,8 @@ var CaptionStyle;
71
22
  CaptionStyle[CaptionStyle["TWO_LINES_EMOJIS"] = 3] = "TWO_LINES_EMOJIS";
72
23
  CaptionStyle[CaptionStyle["HOME_HIGHLIGHT"] = 4] = "HOME_HIGHLIGHT";
73
24
  })(CaptionStyle || (exports.CaptionStyle = CaptionStyle = {}));
25
+ exports.StatusSchema = zod_1.z.nativeEnum(Status);
26
+ exports.CaptionStyleStatus = zod_1.z.nativeEnum(CaptionStyle);
74
27
  exports.Styles = [
75
28
  { value: CaptionStyle.ONE_LINE, label: "One Line" },
76
29
  { value: CaptionStyle.ONE_LINE_EMOJIS, label: "One Line + Emojis" },
@@ -78,3 +31,29 @@ exports.Styles = [
78
31
  { value: CaptionStyle.TWO_LINES_EMOJIS, label: "Two Lines + Emojis" },
79
32
  { value: CaptionStyle.HOME_HIGHLIGHT, label: "Home Tour" },
80
33
  ];
34
+ exports.TimelineItemSchema = zod_1.z.object({
35
+ status: zod_1.z.nativeEnum(Status),
36
+ title: zod_1.z.string(),
37
+ description: zod_1.z.string(),
38
+ timestamp: zod_1.z.number(),
39
+ metadata: zod_1.z.record(zod_1.z.any()),
40
+ });
41
+ exports.ProjectSchema = zod_1.z.object({
42
+ id: zod_1.z.string(),
43
+ title: zod_1.z.string(),
44
+ instructions: zod_1.z.string(),
45
+ submitMonth: zod_1.z.string(),
46
+ captionStyle: zod_1.z.nativeEnum(CaptionStyle),
47
+ finalVideoId: zod_1.z.string().optional(),
48
+ thumbnailUrl: zod_1.z.string().optional(),
49
+ modified: zod_1.z.number(),
50
+ captionSuggestion: zod_1.z.string().optional(),
51
+ editorId: zod_1.z.string(),
52
+ userId: zod_1.z.string(),
53
+ assets: zod_1.z.array(asset_1.AssetSchema).optional(),
54
+ expirationTimestamp: zod_1.z.number(),
55
+ timeline: zod_1.z.array(exports.TimelineItemSchema),
56
+ submitTimestamp: zod_1.z.number(),
57
+ tenantId: zod_1.z.string().optional(),
58
+ status: zod_1.z.nativeEnum(Status),
59
+ });
@@ -0,0 +1,3 @@
1
+ export type { Project as Entity, Approve, Style, ProjectCreation, SendToApproval, TimelineItem, } from "./Project.schema";
2
+ export { ProjectSchema, Status, CaptionStyle, Styles, TimelineItemSchema, } from "./Project.schema";
3
+ export * from "./Project.api";
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.TimelineItemSchema = exports.Styles = exports.CaptionStyle = exports.Status = exports.ProjectSchema = void 0;
18
+ var Project_schema_1 = require("./Project.schema");
19
+ Object.defineProperty(exports, "ProjectSchema", { enumerable: true, get: function () { return Project_schema_1.ProjectSchema; } });
20
+ Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return Project_schema_1.Status; } });
21
+ Object.defineProperty(exports, "CaptionStyle", { enumerable: true, get: function () { return Project_schema_1.CaptionStyle; } });
22
+ Object.defineProperty(exports, "Styles", { enumerable: true, get: function () { return Project_schema_1.Styles; } });
23
+ Object.defineProperty(exports, "TimelineItemSchema", { enumerable: true, get: function () { return Project_schema_1.TimelineItemSchema; } });
24
+ __exportStar(require("./Project.api"), exports);
@@ -1,12 +1,13 @@
1
- import Context from "./Context";
2
- interface PromptAPISchema {
1
+ import Context from "../Context";
2
+ import { Prompt, Script } from "./Prompt.schema";
3
+ export interface IAPI {
3
4
  getPrompt: (c: Context) => Promise<Prompt>;
4
5
  addScript: (c: Context, script: Partial<Script>) => Promise<Script>;
5
6
  deleteScript: (c: Context, id: string) => Promise<boolean>;
6
7
  getScripts: (c: Context) => Promise<Script[]>;
7
8
  updateScript: (c: Context, id: string, script: Partial<Script>) => Promise<boolean>;
8
9
  }
9
- declare const PromptEndpoints: {
10
+ export declare const Endpoints: {
10
11
  GetPrompt: {
11
12
  uri: string;
12
13
  method: string;
@@ -28,24 +29,3 @@ declare const PromptEndpoints: {
28
29
  method: string;
29
30
  };
30
31
  };
31
- type Script = {
32
- id: string;
33
- title: string;
34
- content: string;
35
- tags?: string[];
36
- userId?: string;
37
- };
38
- type Category = {
39
- id: string;
40
- title: string;
41
- pictureUrl: string;
42
- backgroundColor: string;
43
- active: boolean;
44
- scripts: Script[];
45
- };
46
- type Prompt = {
47
- id: string;
48
- tenantId: string;
49
- categories: Category[];
50
- };
51
- export { PromptAPISchema, Prompt, Script, Category, PromptEndpoints };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PromptEndpoints = void 0;
4
- const PromptEndpoints = {
3
+ exports.Endpoints = void 0;
4
+ exports.Endpoints = {
5
5
  GetPrompt: {
6
6
  uri: "/prompts/getPrompt",
7
7
  method: "GET",
@@ -23,4 +23,3 @@ const PromptEndpoints = {
23
23
  method: "PUT",
24
24
  },
25
25
  };
26
- exports.PromptEndpoints = PromptEndpoints;
@@ -0,0 +1,165 @@
1
+ import { z } from "zod";
2
+ export declare const ScriptSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ title: z.ZodString;
5
+ content: z.ZodString;
6
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
+ userId: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ id: string;
10
+ title: string;
11
+ content: string;
12
+ userId?: string | undefined;
13
+ tags?: string[] | undefined;
14
+ }, {
15
+ id: string;
16
+ title: string;
17
+ content: string;
18
+ userId?: string | undefined;
19
+ tags?: string[] | undefined;
20
+ }>;
21
+ export declare const CategorySchema: z.ZodObject<{
22
+ id: z.ZodString;
23
+ title: z.ZodString;
24
+ pictureUrl: z.ZodString;
25
+ backgroundColor: z.ZodString;
26
+ active: z.ZodBoolean;
27
+ scripts: z.ZodArray<z.ZodObject<{
28
+ id: z.ZodString;
29
+ title: z.ZodString;
30
+ content: z.ZodString;
31
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
32
+ userId: z.ZodOptional<z.ZodString>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ id: string;
35
+ title: string;
36
+ content: string;
37
+ userId?: string | undefined;
38
+ tags?: string[] | undefined;
39
+ }, {
40
+ id: string;
41
+ title: string;
42
+ content: string;
43
+ userId?: string | undefined;
44
+ tags?: string[] | undefined;
45
+ }>, "many">;
46
+ }, "strip", z.ZodTypeAny, {
47
+ active: boolean;
48
+ id: string;
49
+ title: string;
50
+ pictureUrl: string;
51
+ backgroundColor: string;
52
+ scripts: {
53
+ id: string;
54
+ title: string;
55
+ content: string;
56
+ userId?: string | undefined;
57
+ tags?: string[] | undefined;
58
+ }[];
59
+ }, {
60
+ active: boolean;
61
+ id: string;
62
+ title: string;
63
+ pictureUrl: string;
64
+ backgroundColor: string;
65
+ scripts: {
66
+ id: string;
67
+ title: string;
68
+ content: string;
69
+ userId?: string | undefined;
70
+ tags?: string[] | undefined;
71
+ }[];
72
+ }>;
73
+ export declare const PromptSchema: z.ZodObject<{
74
+ id: z.ZodString;
75
+ tenantId: z.ZodString;
76
+ categories: z.ZodArray<z.ZodObject<{
77
+ id: z.ZodString;
78
+ title: z.ZodString;
79
+ pictureUrl: z.ZodString;
80
+ backgroundColor: z.ZodString;
81
+ active: z.ZodBoolean;
82
+ scripts: z.ZodArray<z.ZodObject<{
83
+ id: z.ZodString;
84
+ title: z.ZodString;
85
+ content: z.ZodString;
86
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
87
+ userId: z.ZodOptional<z.ZodString>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ id: string;
90
+ title: string;
91
+ content: string;
92
+ userId?: string | undefined;
93
+ tags?: string[] | undefined;
94
+ }, {
95
+ id: string;
96
+ title: string;
97
+ content: string;
98
+ userId?: string | undefined;
99
+ tags?: string[] | undefined;
100
+ }>, "many">;
101
+ }, "strip", z.ZodTypeAny, {
102
+ active: boolean;
103
+ id: string;
104
+ title: string;
105
+ pictureUrl: string;
106
+ backgroundColor: string;
107
+ scripts: {
108
+ id: string;
109
+ title: string;
110
+ content: string;
111
+ userId?: string | undefined;
112
+ tags?: string[] | undefined;
113
+ }[];
114
+ }, {
115
+ active: boolean;
116
+ id: string;
117
+ title: string;
118
+ pictureUrl: string;
119
+ backgroundColor: string;
120
+ scripts: {
121
+ id: string;
122
+ title: string;
123
+ content: string;
124
+ userId?: string | undefined;
125
+ tags?: string[] | undefined;
126
+ }[];
127
+ }>, "many">;
128
+ }, "strip", z.ZodTypeAny, {
129
+ id: string;
130
+ tenantId: string;
131
+ categories: {
132
+ active: boolean;
133
+ id: string;
134
+ title: string;
135
+ pictureUrl: string;
136
+ backgroundColor: string;
137
+ scripts: {
138
+ id: string;
139
+ title: string;
140
+ content: string;
141
+ userId?: string | undefined;
142
+ tags?: string[] | undefined;
143
+ }[];
144
+ }[];
145
+ }, {
146
+ id: string;
147
+ tenantId: string;
148
+ categories: {
149
+ active: boolean;
150
+ id: string;
151
+ title: string;
152
+ pictureUrl: string;
153
+ backgroundColor: string;
154
+ scripts: {
155
+ id: string;
156
+ title: string;
157
+ content: string;
158
+ userId?: string | undefined;
159
+ tags?: string[] | undefined;
160
+ }[];
161
+ }[];
162
+ }>;
163
+ export type Script = z.infer<typeof ScriptSchema>;
164
+ export type Category = z.infer<typeof CategorySchema>;
165
+ export type Prompt = z.infer<typeof PromptSchema>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PromptSchema = exports.CategorySchema = exports.ScriptSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ScriptSchema = zod_1.z.object({
6
+ id: zod_1.z.string(),
7
+ title: zod_1.z.string(),
8
+ content: zod_1.z.string(),
9
+ tags: zod_1.z.array(zod_1.z.string()).optional(),
10
+ userId: zod_1.z.string().optional(),
11
+ });
12
+ exports.CategorySchema = zod_1.z.object({
13
+ id: zod_1.z.string(),
14
+ title: zod_1.z.string(),
15
+ pictureUrl: zod_1.z.string().url(),
16
+ backgroundColor: zod_1.z.string(),
17
+ active: zod_1.z.boolean(),
18
+ scripts: zod_1.z.array(exports.ScriptSchema),
19
+ });
20
+ exports.PromptSchema = zod_1.z.object({
21
+ id: zod_1.z.string(),
22
+ tenantId: zod_1.z.string(),
23
+ categories: zod_1.z.array(exports.CategorySchema),
24
+ });
@@ -0,0 +1,3 @@
1
+ export { PromptSchema, ScriptSchema, CategorySchema } from "./Prompt.schema";
2
+ export type { Prompt as Entity, Script, Category } from "./Prompt.schema";
3
+ export * from "./Prompt.api";
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.CategorySchema = exports.ScriptSchema = exports.PromptSchema = void 0;
18
+ var Prompt_schema_1 = require("./Prompt.schema");
19
+ Object.defineProperty(exports, "PromptSchema", { enumerable: true, get: function () { return Prompt_schema_1.PromptSchema; } });
20
+ Object.defineProperty(exports, "ScriptSchema", { enumerable: true, get: function () { return Prompt_schema_1.ScriptSchema; } });
21
+ Object.defineProperty(exports, "CategorySchema", { enumerable: true, get: function () { return Prompt_schema_1.CategorySchema; } });
22
+ __exportStar(require("./Prompt.api"), exports);
@@ -1,5 +1,6 @@
1
- import Context from "./Context";
2
- interface SubscriptionAPISchema {
1
+ import Context from "../Context";
2
+ import { Charge, Product, Subscription } from "./Subscription.schema";
3
+ export interface IAPI {
3
4
  getCharges: (ctx: Context) => Promise<Charge[]>;
4
5
  getSubscription: (context: Context, userId?: string) => Promise<Subscription | null>;
5
6
  getProduct: (id: string, context?: Context) => Promise<Product>;
@@ -10,7 +11,7 @@ interface SubscriptionAPISchema {
10
11
  updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
11
12
  createCheckout: (planId: string | null, ctx: Context) => Promise<string>;
12
13
  }
13
- declare const SubscriptionEndpoints: {
14
+ export declare const Endpoints: {
14
15
  GetProduct: {
15
16
  uri: string;
16
17
  method: string;
@@ -56,51 +57,3 @@ declare const SubscriptionEndpoints: {
56
57
  method: string;
57
58
  };
58
59
  };
59
- type Plan = {
60
- id: string;
61
- currency: string;
62
- price: string;
63
- interval: string;
64
- metadata: Record<string, string>;
65
- subscriptionItemId: string;
66
- };
67
- type Description = {
68
- description: string;
69
- subtitle: string;
70
- };
71
- type Product = {
72
- id: string;
73
- name: string;
74
- descriptions: Description[];
75
- metadata: any;
76
- plans: Plan[];
77
- };
78
- export declare enum SubscriptionType {
79
- CUSTOMER_SUBSCRIPTION = 0,
80
- TENANT_SUBSCRIPTION = 1
81
- }
82
- type Subscription = {
83
- id: string;
84
- status: string;
85
- startDate?: number;
86
- daysUntilDue?: number;
87
- renewAutomatically?: boolean;
88
- currentPeriodStart?: number;
89
- currentPeriodEnd?: number;
90
- paymentMethodId?: string;
91
- product: Product;
92
- type?: SubscriptionType;
93
- plan?: Plan;
94
- };
95
- type Charge = {
96
- id: number;
97
- created: number;
98
- paid: boolean;
99
- receiptUrl: string;
100
- status: string;
101
- price: string;
102
- paymentType: string;
103
- last4?: string;
104
- brand?: string;
105
- };
106
- export { SubscriptionAPISchema, Product, Subscription, SubscriptionEndpoints, Charge, Plan, };