@remnawave/backend-contract 2.1.70 → 2.1.71

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 (53) hide show
  1. package/build/backend/api/controllers/index.d.ts +1 -0
  2. package/build/backend/api/controllers/index.d.ts.map +1 -1
  3. package/build/backend/api/controllers/index.js +1 -0
  4. package/build/backend/api/controllers/snippets.d.ts +8 -0
  5. package/build/backend/api/controllers/snippets.d.ts.map +1 -0
  6. package/build/backend/api/controllers/snippets.js +10 -0
  7. package/build/backend/api/controllers-info.d.ts +4 -0
  8. package/build/backend/api/controllers-info.d.ts.map +1 -1
  9. package/build/backend/api/controllers-info.js +4 -0
  10. package/build/backend/api/routes.d.ts +6 -0
  11. package/build/backend/api/routes.d.ts.map +1 -1
  12. package/build/backend/api/routes.js +6 -0
  13. package/build/backend/commands/index.d.ts +1 -0
  14. package/build/backend/commands/index.d.ts.map +1 -1
  15. package/build/backend/commands/index.js +1 -0
  16. package/build/backend/commands/snippets/create-snippet.command.d.ts +66 -0
  17. package/build/backend/commands/snippets/create-snippet.command.d.ts.map +1 -0
  18. package/build/backend/commands/snippets/create-snippet.command.js +27 -0
  19. package/build/backend/commands/snippets/delete-snippet.command.d.ts +59 -0
  20. package/build/backend/commands/snippets/delete-snippet.command.d.ts.map +1 -0
  21. package/build/backend/commands/snippets/delete-snippet.command.js +26 -0
  22. package/build/backend/commands/snippets/get-snippets.command.d.ts +51 -0
  23. package/build/backend/commands/snippets/get-snippets.command.d.ts.map +1 -0
  24. package/build/backend/commands/snippets/get-snippets.command.js +19 -0
  25. package/build/backend/commands/snippets/index.d.ts +5 -0
  26. package/build/backend/commands/snippets/index.d.ts.map +1 -0
  27. package/build/backend/commands/snippets/index.js +20 -0
  28. package/build/backend/commands/snippets/update-snippets.command.d.ts +66 -0
  29. package/build/backend/commands/snippets/update-snippets.command.d.ts.map +1 -0
  30. package/build/backend/commands/snippets/update-snippets.command.js +27 -0
  31. package/build/backend/constants/errors/errors.d.ts +25 -0
  32. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  33. package/build/backend/constants/errors/errors.js +25 -0
  34. package/build/backend/models/index.d.ts +1 -0
  35. package/build/backend/models/index.d.ts.map +1 -1
  36. package/build/backend/models/index.js +1 -0
  37. package/build/backend/models/snippets.schema.d.ts +12 -0
  38. package/build/backend/models/snippets.schema.d.ts.map +1 -0
  39. package/build/backend/models/snippets.schema.js +8 -0
  40. package/build/frontend/api/controllers/index.js +1 -0
  41. package/build/frontend/api/controllers/snippets.js +10 -0
  42. package/build/frontend/api/controllers-info.js +4 -0
  43. package/build/frontend/api/routes.js +6 -0
  44. package/build/frontend/commands/index.js +1 -0
  45. package/build/frontend/commands/snippets/create-snippet.command.js +27 -0
  46. package/build/frontend/commands/snippets/delete-snippet.command.js +26 -0
  47. package/build/frontend/commands/snippets/get-snippets.command.js +19 -0
  48. package/build/frontend/commands/snippets/index.js +20 -0
  49. package/build/frontend/commands/snippets/update-snippets.command.js +27 -0
  50. package/build/frontend/constants/errors/errors.js +25 -0
  51. package/build/frontend/models/index.js +1 -0
  52. package/build/frontend/models/snippets.schema.js +8 -0
  53. package/package.json +1 -1
@@ -7,6 +7,7 @@ export * from './infra-billing';
7
7
  export * from './internal-squads';
8
8
  export * from './keygen';
9
9
  export * from './nodes';
10
+ export * from './snippets';
10
11
  export * from './subscription';
11
12
  export * from './subscription-request-history';
12
13
  export * from './subscription-settings';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -23,6 +23,7 @@ __exportStar(require("./infra-billing"), exports);
23
23
  __exportStar(require("./internal-squads"), exports);
24
24
  __exportStar(require("./keygen"), exports);
25
25
  __exportStar(require("./nodes"), exports);
26
+ __exportStar(require("./snippets"), exports);
26
27
  __exportStar(require("./subscription"), exports);
27
28
  __exportStar(require("./subscription-request-history"), exports);
28
29
  __exportStar(require("./subscription-settings"), exports);
@@ -0,0 +1,8 @@
1
+ export declare const SNIPPETS_CONTROLLER: "snippets";
2
+ export declare const SNIPPETS_ROUTES: {
3
+ readonly GET: "";
4
+ readonly CREATE: "";
5
+ readonly UPDATE: "";
6
+ readonly DELETE: "";
7
+ };
8
+ //# sourceMappingURL=snippets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../../../../api/controllers/snippets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,EAAG,UAAmB,CAAC;AAEvD,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SNIPPETS_ROUTES = exports.SNIPPETS_CONTROLLER = void 0;
4
+ exports.SNIPPETS_CONTROLLER = 'snippets';
5
+ exports.SNIPPETS_ROUTES = {
6
+ GET: '', // Get list of all snippets // get
7
+ CREATE: '', // Create new snippet // post
8
+ UPDATE: '', // Update snippet by name // patch
9
+ DELETE: '', // Delete snippet by name // delete
10
+ };
@@ -79,5 +79,9 @@ export declare const CONTROLLERS_INFO: {
79
79
  readonly tag: "Subscription Request History Controller";
80
80
  readonly description: "";
81
81
  };
82
+ readonly SNIPPETS: {
83
+ readonly tag: "Snippets Controller";
84
+ readonly description: "";
85
+ };
82
86
  };
83
87
  //# sourceMappingURL=controllers-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"controllers-info.d.ts","sourceRoot":"","sources":["../../../api/controllers-info.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFnB,CAAC"}
1
+ {"version":3,"file":"controllers-info.d.ts","sourceRoot":"","sources":["../../../api/controllers-info.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFnB,CAAC"}
@@ -82,4 +82,8 @@ exports.CONTROLLERS_INFO = {
82
82
  tag: 'Subscription Request History Controller',
83
83
  description: '',
84
84
  },
85
+ SNIPPETS: {
86
+ tag: 'Snippets Controller',
87
+ description: '',
88
+ },
85
89
  };
@@ -183,5 +183,11 @@ export declare const REST_API: {
183
183
  readonly GET: "/api/subscription-request-history/";
184
184
  readonly STATS: "/api/subscription-request-history/stats";
185
185
  };
186
+ readonly SNIPPETS: {
187
+ readonly GET: "/api/snippets/";
188
+ readonly CREATE: "/api/snippets/";
189
+ readonly UPDATE: "/api/snippets/";
190
+ readonly DELETE: "/api/snippets/";
191
+ };
186
192
  };
187
193
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;gCAcE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;gCAWvB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;gDAmBU,MAAM;;;;;;;kCAWpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAgCD,MAAM;;;;;;;;;;mDAaQ,MAAM;;;;;;;;0CAWf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;;;;;qCAUlB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;;;;;;;qCAUvB,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;yCASP,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;CAOnC,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;gCAcE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;gCAWvB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;gDAmBU,MAAM;;;;;;;kCAWpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAgCD,MAAM;;;;;;;;;;mDAaQ,MAAM;;;;;;;;0CAWf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;;;;;qCAUlB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;;;;;;;qCAUvB,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;yCASP,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;;;;;;;CAanC,CAAC"}
@@ -220,4 +220,10 @@ exports.REST_API = {
220
220
  GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_ROUTES.GET}`,
221
221
  STATS: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_ROUTES.STATS}`,
222
222
  },
223
+ SNIPPETS: {
224
+ GET: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.GET}`,
225
+ CREATE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.CREATE}`,
226
+ UPDATE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.UPDATE}`,
227
+ DELETE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.DELETE}`,
228
+ },
223
229
  };
@@ -7,6 +7,7 @@ export * from './infra-billing';
7
7
  export * from './internal-squads';
8
8
  export * from './keygen';
9
9
  export * from './nodes';
10
+ export * from './snippets';
10
11
  export * from './subscription';
11
12
  export * from './subscription-request-history';
12
13
  export * from './subscription-settings';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -23,6 +23,7 @@ __exportStar(require("./infra-billing"), exports);
23
23
  __exportStar(require("./internal-squads"), exports);
24
24
  __exportStar(require("./keygen"), exports);
25
25
  __exportStar(require("./nodes"), exports);
26
+ __exportStar(require("./snippets"), exports);
26
27
  __exportStar(require("./subscription"), exports);
27
28
  __exportStar(require("./subscription-request-history"), exports);
28
29
  __exportStar(require("./subscription-settings"), exports);
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ export declare namespace CreateSnippetCommand {
3
+ const url: "/api/snippets/";
4
+ const TSQ_url: "/api/snippets/";
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const RequestSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ snippet: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ name: string;
11
+ snippet: {} & {
12
+ [k: string]: unknown;
13
+ };
14
+ }, {
15
+ name: string;
16
+ snippet: {} & {
17
+ [k: string]: unknown;
18
+ };
19
+ }>;
20
+ type Request = z.infer<typeof RequestSchema>;
21
+ const ResponseSchema: z.ZodObject<{
22
+ response: z.ZodObject<{
23
+ total: z.ZodNumber;
24
+ snippets: z.ZodArray<z.ZodObject<{
25
+ name: z.ZodString;
26
+ snippet: z.ZodUnknown;
27
+ }, "strip", z.ZodTypeAny, {
28
+ name: string;
29
+ snippet?: unknown;
30
+ }, {
31
+ name: string;
32
+ snippet?: unknown;
33
+ }>, "many">;
34
+ }, "strip", z.ZodTypeAny, {
35
+ snippets: {
36
+ name: string;
37
+ snippet?: unknown;
38
+ }[];
39
+ total: number;
40
+ }, {
41
+ snippets: {
42
+ name: string;
43
+ snippet?: unknown;
44
+ }[];
45
+ total: number;
46
+ }>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ response: {
49
+ snippets: {
50
+ name: string;
51
+ snippet?: unknown;
52
+ }[];
53
+ total: number;
54
+ };
55
+ }, {
56
+ response: {
57
+ snippets: {
58
+ name: string;
59
+ snippet?: unknown;
60
+ }[];
61
+ total: number;
62
+ };
63
+ }>;
64
+ type Response = z.infer<typeof ResponseSchema>;
65
+ }
66
+ //# sourceMappingURL=create-snippet.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-snippet.command.d.ts","sourceRoot":"","sources":["../../../../commands/snippets/create-snippet.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,kBAA2B,CAAC;IACrC,MAAM,OAAO,kBAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;;MAUxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateSnippetCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var CreateSnippetCommand;
9
+ (function (CreateSnippetCommand) {
10
+ CreateSnippetCommand.url = api_1.REST_API.SNIPPETS.CREATE;
11
+ CreateSnippetCommand.TSQ_url = CreateSnippetCommand.url;
12
+ CreateSnippetCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.CREATE, 'post', 'Create snippet');
13
+ CreateSnippetCommand.RequestSchema = zod_1.z.object({
14
+ name: zod_1.z
15
+ .string()
16
+ .min(2, 'Name must be at least 2 characters')
17
+ .max(255, 'Name must be less than 255 characters')
18
+ .regex(/^[A-Za-z0-9_\s-]+$/, 'Name can only contain letters, numbers, underscores, dashes and spaces'),
19
+ snippet: zod_1.z.object({}).passthrough(),
20
+ });
21
+ CreateSnippetCommand.ResponseSchema = zod_1.z.object({
22
+ response: zod_1.z.object({
23
+ total: zod_1.z.number(),
24
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
25
+ }),
26
+ });
27
+ })(CreateSnippetCommand || (exports.CreateSnippetCommand = CreateSnippetCommand = {}));
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+ export declare namespace DeleteSnippetCommand {
3
+ const url: "/api/snippets/";
4
+ const TSQ_url: "/api/snippets/";
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const RequestSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ name: string;
10
+ }, {
11
+ name: string;
12
+ }>;
13
+ type Request = z.infer<typeof RequestSchema>;
14
+ const ResponseSchema: z.ZodObject<{
15
+ response: z.ZodObject<{
16
+ total: z.ZodNumber;
17
+ snippets: z.ZodArray<z.ZodObject<{
18
+ name: z.ZodString;
19
+ snippet: z.ZodUnknown;
20
+ }, "strip", z.ZodTypeAny, {
21
+ name: string;
22
+ snippet?: unknown;
23
+ }, {
24
+ name: string;
25
+ snippet?: unknown;
26
+ }>, "many">;
27
+ }, "strip", z.ZodTypeAny, {
28
+ snippets: {
29
+ name: string;
30
+ snippet?: unknown;
31
+ }[];
32
+ total: number;
33
+ }, {
34
+ snippets: {
35
+ name: string;
36
+ snippet?: unknown;
37
+ }[];
38
+ total: number;
39
+ }>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ response: {
42
+ snippets: {
43
+ name: string;
44
+ snippet?: unknown;
45
+ }[];
46
+ total: number;
47
+ };
48
+ }, {
49
+ response: {
50
+ snippets: {
51
+ name: string;
52
+ snippet?: unknown;
53
+ }[];
54
+ total: number;
55
+ };
56
+ }>;
57
+ type Response = z.infer<typeof ResponseSchema>;
58
+ }
59
+ //# sourceMappingURL=delete-snippet.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-snippet.command.d.ts","sourceRoot":"","sources":["../../../../commands/snippets/delete-snippet.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,kBAA2B,CAAC;IACrC,MAAM,OAAO,kBAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MASxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteSnippetCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var DeleteSnippetCommand;
9
+ (function (DeleteSnippetCommand) {
10
+ DeleteSnippetCommand.url = api_1.REST_API.SNIPPETS.DELETE;
11
+ DeleteSnippetCommand.TSQ_url = DeleteSnippetCommand.url;
12
+ DeleteSnippetCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.DELETE, 'delete', 'Delete snippet');
13
+ DeleteSnippetCommand.RequestSchema = zod_1.z.object({
14
+ name: zod_1.z
15
+ .string()
16
+ .min(2, 'Name must be at least 2 characters')
17
+ .max(255, 'Name must be less than 255 characters')
18
+ .regex(/^[A-Za-z0-9_\s-]+$/, 'Name can only contain letters, numbers, underscores, dashes and spaces'),
19
+ });
20
+ DeleteSnippetCommand.ResponseSchema = zod_1.z.object({
21
+ response: zod_1.z.object({
22
+ total: zod_1.z.number(),
23
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
24
+ }),
25
+ });
26
+ })(DeleteSnippetCommand || (exports.DeleteSnippetCommand = DeleteSnippetCommand = {}));
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetSnippetsCommand {
3
+ const url: "/api/snippets/";
4
+ const TSQ_url: "/api/snippets/";
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const ResponseSchema: z.ZodObject<{
7
+ response: z.ZodObject<{
8
+ total: z.ZodNumber;
9
+ snippets: z.ZodArray<z.ZodObject<{
10
+ name: z.ZodString;
11
+ snippet: z.ZodUnknown;
12
+ }, "strip", z.ZodTypeAny, {
13
+ name: string;
14
+ snippet?: unknown;
15
+ }, {
16
+ name: string;
17
+ snippet?: unknown;
18
+ }>, "many">;
19
+ }, "strip", z.ZodTypeAny, {
20
+ snippets: {
21
+ name: string;
22
+ snippet?: unknown;
23
+ }[];
24
+ total: number;
25
+ }, {
26
+ snippets: {
27
+ name: string;
28
+ snippet?: unknown;
29
+ }[];
30
+ total: number;
31
+ }>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ response: {
34
+ snippets: {
35
+ name: string;
36
+ snippet?: unknown;
37
+ }[];
38
+ total: number;
39
+ };
40
+ }, {
41
+ response: {
42
+ snippets: {
43
+ name: string;
44
+ snippet?: unknown;
45
+ }[];
46
+ total: number;
47
+ };
48
+ }>;
49
+ type Response = z.infer<typeof ResponseSchema>;
50
+ }
51
+ //# sourceMappingURL=get-snippets.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-snippets.command.d.ts","sourceRoot":"","sources":["../../../../commands/snippets/get-snippets.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,GAAG,kBAAwB,CAAC;IAClC,MAAM,OAAO,kBAAM,CAAC;IAEpB,MAAM,eAAe,2CAAiE,CAAC;IAEvF,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetSnippetsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var GetSnippetsCommand;
9
+ (function (GetSnippetsCommand) {
10
+ GetSnippetsCommand.url = api_1.REST_API.SNIPPETS.GET;
11
+ GetSnippetsCommand.TSQ_url = GetSnippetsCommand.url;
12
+ GetSnippetsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.GET, 'get', 'Get snippets');
13
+ GetSnippetsCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ total: zod_1.z.number(),
16
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
17
+ }),
18
+ });
19
+ })(GetSnippetsCommand || (exports.GetSnippetsCommand = GetSnippetsCommand = {}));
@@ -0,0 +1,5 @@
1
+ export * from './create-snippet.command';
2
+ export * from './delete-snippet.command';
3
+ export * from './get-snippets.command';
4
+ export * from './update-snippets.command';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/snippets/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,20 @@
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
+ __exportStar(require("./create-snippet.command"), exports);
18
+ __exportStar(require("./delete-snippet.command"), exports);
19
+ __exportStar(require("./get-snippets.command"), exports);
20
+ __exportStar(require("./update-snippets.command"), exports);
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ export declare namespace UpdateSnippetCommand {
3
+ const url: "/api/snippets/";
4
+ const TSQ_url: "/api/snippets/";
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const RequestSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ snippet: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ name: string;
11
+ snippet: {} & {
12
+ [k: string]: unknown;
13
+ };
14
+ }, {
15
+ name: string;
16
+ snippet: {} & {
17
+ [k: string]: unknown;
18
+ };
19
+ }>;
20
+ type Request = z.infer<typeof RequestSchema>;
21
+ const ResponseSchema: z.ZodObject<{
22
+ response: z.ZodObject<{
23
+ total: z.ZodNumber;
24
+ snippets: z.ZodArray<z.ZodObject<{
25
+ name: z.ZodString;
26
+ snippet: z.ZodUnknown;
27
+ }, "strip", z.ZodTypeAny, {
28
+ name: string;
29
+ snippet?: unknown;
30
+ }, {
31
+ name: string;
32
+ snippet?: unknown;
33
+ }>, "many">;
34
+ }, "strip", z.ZodTypeAny, {
35
+ snippets: {
36
+ name: string;
37
+ snippet?: unknown;
38
+ }[];
39
+ total: number;
40
+ }, {
41
+ snippets: {
42
+ name: string;
43
+ snippet?: unknown;
44
+ }[];
45
+ total: number;
46
+ }>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ response: {
49
+ snippets: {
50
+ name: string;
51
+ snippet?: unknown;
52
+ }[];
53
+ total: number;
54
+ };
55
+ }, {
56
+ response: {
57
+ snippets: {
58
+ name: string;
59
+ snippet?: unknown;
60
+ }[];
61
+ total: number;
62
+ };
63
+ }>;
64
+ type Response = z.infer<typeof ResponseSchema>;
65
+ }
66
+ //# sourceMappingURL=update-snippets.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-snippets.command.d.ts","sourceRoot":"","sources":["../../../../commands/snippets/update-snippets.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,GAAG,kBAA2B,CAAC;IACrC,MAAM,OAAO,kBAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;;;;;;;;MAUxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateSnippetCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var UpdateSnippetCommand;
9
+ (function (UpdateSnippetCommand) {
10
+ UpdateSnippetCommand.url = api_1.REST_API.SNIPPETS.UPDATE;
11
+ UpdateSnippetCommand.TSQ_url = UpdateSnippetCommand.url;
12
+ UpdateSnippetCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.UPDATE, 'patch', 'Update snippet');
13
+ UpdateSnippetCommand.RequestSchema = zod_1.z.object({
14
+ name: zod_1.z
15
+ .string()
16
+ .min(2, 'Name must be at least 2 characters')
17
+ .max(255, 'Name must be less than 255 characters')
18
+ .regex(/^[A-Za-z0-9_\s-]+$/, 'Name can only contain letters, numbers, underscores, dashes and spaces'),
19
+ snippet: zod_1.z.object({}).passthrough(),
20
+ });
21
+ UpdateSnippetCommand.ResponseSchema = zod_1.z.object({
22
+ response: zod_1.z.object({
23
+ total: zod_1.z.number(),
24
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
25
+ }),
26
+ });
27
+ })(UpdateSnippetCommand || (exports.UpdateSnippetCommand = UpdateSnippetCommand = {}));
@@ -829,5 +829,30 @@ export declare const ERRORS: {
829
829
  readonly message: "Get user subscription request history stats error";
830
830
  readonly httpCode: 500;
831
831
  };
832
+ readonly GET_SNIPPETS_ERROR: {
833
+ readonly code: "A161";
834
+ readonly message: "Get snippets error";
835
+ readonly httpCode: 500;
836
+ };
837
+ readonly SNIPPET_NOT_FOUND: {
838
+ readonly code: "A162";
839
+ readonly message: "Snippet not found";
840
+ readonly httpCode: 404;
841
+ };
842
+ readonly DELETE_SNIPPET_BY_NAME_ERROR: {
843
+ readonly code: "A163";
844
+ readonly message: "Delete snippet by name error";
845
+ readonly httpCode: 500;
846
+ };
847
+ readonly SNIPPET_NAME_ALREADY_EXISTS: {
848
+ readonly code: "A164";
849
+ readonly message: "Snippet name already exists";
850
+ readonly httpCode: 400;
851
+ };
852
+ readonly UPDATE_SNIPPET_ERROR: {
853
+ readonly code: "A165";
854
+ readonly message: "Update snippet error";
855
+ readonly httpCode: 500;
856
+ };
832
857
  };
833
858
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmf3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4gB3B,CAAC"}
@@ -800,4 +800,29 @@ exports.ERRORS = {
800
800
  message: 'Get user subscription request history stats error',
801
801
  httpCode: 500,
802
802
  },
803
+ GET_SNIPPETS_ERROR: {
804
+ code: 'A161',
805
+ message: 'Get snippets error',
806
+ httpCode: 500,
807
+ },
808
+ SNIPPET_NOT_FOUND: {
809
+ code: 'A162',
810
+ message: 'Snippet not found',
811
+ httpCode: 404,
812
+ },
813
+ DELETE_SNIPPET_BY_NAME_ERROR: {
814
+ code: 'A163',
815
+ message: 'Delete snippet by name error',
816
+ httpCode: 500,
817
+ },
818
+ SNIPPET_NAME_ALREADY_EXISTS: {
819
+ code: 'A164',
820
+ message: 'Snippet name already exists',
821
+ httpCode: 400,
822
+ },
823
+ UPDATE_SNIPPET_ERROR: {
824
+ code: 'A165',
825
+ message: 'Update snippet error',
826
+ httpCode: 500,
827
+ },
803
828
  };
@@ -15,6 +15,7 @@ export * from './infra-provider.schema';
15
15
  export * from './internal-squad.schema';
16
16
  export * from './last-connected-node.schema';
17
17
  export * from './nodes.schema';
18
+ export * from './snippets.schema';
18
19
  export * from './subscription-info.schema';
19
20
  export * from './subscription-request-history.schema';
20
21
  export * from './subscription-settings.schema';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
@@ -31,6 +31,7 @@ __exportStar(require("./infra-provider.schema"), exports);
31
31
  __exportStar(require("./internal-squad.schema"), exports);
32
32
  __exportStar(require("./last-connected-node.schema"), exports);
33
33
  __exportStar(require("./nodes.schema"), exports);
34
+ __exportStar(require("./snippets.schema"), exports);
34
35
  __exportStar(require("./subscription-info.schema"), exports);
35
36
  __exportStar(require("./subscription-request-history.schema"), exports);
36
37
  __exportStar(require("./subscription-settings.schema"), exports);
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export declare const SnippetsSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ snippet: z.ZodUnknown;
5
+ }, "strip", z.ZodTypeAny, {
6
+ name: string;
7
+ snippet?: unknown;
8
+ }, {
9
+ name: string;
10
+ snippet?: unknown;
11
+ }>;
12
+ //# sourceMappingURL=snippets.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippets.schema.d.ts","sourceRoot":"","sources":["../../../models/snippets.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SnippetsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.SnippetsSchema = zod_1.z.object({
6
+ name: zod_1.z.string(),
7
+ snippet: zod_1.z.unknown(),
8
+ });
@@ -23,6 +23,7 @@ __exportStar(require("./infra-billing"), exports);
23
23
  __exportStar(require("./internal-squads"), exports);
24
24
  __exportStar(require("./keygen"), exports);
25
25
  __exportStar(require("./nodes"), exports);
26
+ __exportStar(require("./snippets"), exports);
26
27
  __exportStar(require("./subscription"), exports);
27
28
  __exportStar(require("./subscription-request-history"), exports);
28
29
  __exportStar(require("./subscription-settings"), exports);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SNIPPETS_ROUTES = exports.SNIPPETS_CONTROLLER = void 0;
4
+ exports.SNIPPETS_CONTROLLER = 'snippets';
5
+ exports.SNIPPETS_ROUTES = {
6
+ GET: '', // Get list of all snippets // get
7
+ CREATE: '', // Create new snippet // post
8
+ UPDATE: '', // Update snippet by name // patch
9
+ DELETE: '', // Delete snippet by name // delete
10
+ };
@@ -82,4 +82,8 @@ exports.CONTROLLERS_INFO = {
82
82
  tag: 'Subscription Request History Controller',
83
83
  description: '',
84
84
  },
85
+ SNIPPETS: {
86
+ tag: 'Snippets Controller',
87
+ description: '',
88
+ },
85
89
  };
@@ -220,4 +220,10 @@ exports.REST_API = {
220
220
  GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_ROUTES.GET}`,
221
221
  STATS: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_REQUEST_HISTORY_ROUTES.STATS}`,
222
222
  },
223
+ SNIPPETS: {
224
+ GET: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.GET}`,
225
+ CREATE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.CREATE}`,
226
+ UPDATE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.UPDATE}`,
227
+ DELETE: `${exports.ROOT}/${CONTROLLERS.SNIPPETS_CONTROLLER}/${CONTROLLERS.SNIPPETS_ROUTES.DELETE}`,
228
+ },
223
229
  };
@@ -23,6 +23,7 @@ __exportStar(require("./infra-billing"), exports);
23
23
  __exportStar(require("./internal-squads"), exports);
24
24
  __exportStar(require("./keygen"), exports);
25
25
  __exportStar(require("./nodes"), exports);
26
+ __exportStar(require("./snippets"), exports);
26
27
  __exportStar(require("./subscription"), exports);
27
28
  __exportStar(require("./subscription-request-history"), exports);
28
29
  __exportStar(require("./subscription-settings"), exports);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateSnippetCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var CreateSnippetCommand;
9
+ (function (CreateSnippetCommand) {
10
+ CreateSnippetCommand.url = api_1.REST_API.SNIPPETS.CREATE;
11
+ CreateSnippetCommand.TSQ_url = CreateSnippetCommand.url;
12
+ CreateSnippetCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.CREATE, 'post', 'Create snippet');
13
+ CreateSnippetCommand.RequestSchema = zod_1.z.object({
14
+ name: zod_1.z
15
+ .string()
16
+ .min(2, 'Name must be at least 2 characters')
17
+ .max(255, 'Name must be less than 255 characters')
18
+ .regex(/^[A-Za-z0-9_\s-]+$/, 'Name can only contain letters, numbers, underscores, dashes and spaces'),
19
+ snippet: zod_1.z.object({}).passthrough(),
20
+ });
21
+ CreateSnippetCommand.ResponseSchema = zod_1.z.object({
22
+ response: zod_1.z.object({
23
+ total: zod_1.z.number(),
24
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
25
+ }),
26
+ });
27
+ })(CreateSnippetCommand || (exports.CreateSnippetCommand = CreateSnippetCommand = {}));
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteSnippetCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var DeleteSnippetCommand;
9
+ (function (DeleteSnippetCommand) {
10
+ DeleteSnippetCommand.url = api_1.REST_API.SNIPPETS.DELETE;
11
+ DeleteSnippetCommand.TSQ_url = DeleteSnippetCommand.url;
12
+ DeleteSnippetCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.DELETE, 'delete', 'Delete snippet');
13
+ DeleteSnippetCommand.RequestSchema = zod_1.z.object({
14
+ name: zod_1.z
15
+ .string()
16
+ .min(2, 'Name must be at least 2 characters')
17
+ .max(255, 'Name must be less than 255 characters')
18
+ .regex(/^[A-Za-z0-9_\s-]+$/, 'Name can only contain letters, numbers, underscores, dashes and spaces'),
19
+ });
20
+ DeleteSnippetCommand.ResponseSchema = zod_1.z.object({
21
+ response: zod_1.z.object({
22
+ total: zod_1.z.number(),
23
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
24
+ }),
25
+ });
26
+ })(DeleteSnippetCommand || (exports.DeleteSnippetCommand = DeleteSnippetCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetSnippetsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var GetSnippetsCommand;
9
+ (function (GetSnippetsCommand) {
10
+ GetSnippetsCommand.url = api_1.REST_API.SNIPPETS.GET;
11
+ GetSnippetsCommand.TSQ_url = GetSnippetsCommand.url;
12
+ GetSnippetsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.GET, 'get', 'Get snippets');
13
+ GetSnippetsCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ total: zod_1.z.number(),
16
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
17
+ }),
18
+ });
19
+ })(GetSnippetsCommand || (exports.GetSnippetsCommand = GetSnippetsCommand = {}));
@@ -0,0 +1,20 @@
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
+ __exportStar(require("./create-snippet.command"), exports);
18
+ __exportStar(require("./delete-snippet.command"), exports);
19
+ __exportStar(require("./get-snippets.command"), exports);
20
+ __exportStar(require("./update-snippets.command"), exports);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateSnippetCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const models_1 = require("../../models");
8
+ var UpdateSnippetCommand;
9
+ (function (UpdateSnippetCommand) {
10
+ UpdateSnippetCommand.url = api_1.REST_API.SNIPPETS.UPDATE;
11
+ UpdateSnippetCommand.TSQ_url = UpdateSnippetCommand.url;
12
+ UpdateSnippetCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SNIPPETS_ROUTES.UPDATE, 'patch', 'Update snippet');
13
+ UpdateSnippetCommand.RequestSchema = zod_1.z.object({
14
+ name: zod_1.z
15
+ .string()
16
+ .min(2, 'Name must be at least 2 characters')
17
+ .max(255, 'Name must be less than 255 characters')
18
+ .regex(/^[A-Za-z0-9_\s-]+$/, 'Name can only contain letters, numbers, underscores, dashes and spaces'),
19
+ snippet: zod_1.z.object({}).passthrough(),
20
+ });
21
+ UpdateSnippetCommand.ResponseSchema = zod_1.z.object({
22
+ response: zod_1.z.object({
23
+ total: zod_1.z.number(),
24
+ snippets: zod_1.z.array(models_1.SnippetsSchema),
25
+ }),
26
+ });
27
+ })(UpdateSnippetCommand || (exports.UpdateSnippetCommand = UpdateSnippetCommand = {}));
@@ -800,4 +800,29 @@ exports.ERRORS = {
800
800
  message: 'Get user subscription request history stats error',
801
801
  httpCode: 500,
802
802
  },
803
+ GET_SNIPPETS_ERROR: {
804
+ code: 'A161',
805
+ message: 'Get snippets error',
806
+ httpCode: 500,
807
+ },
808
+ SNIPPET_NOT_FOUND: {
809
+ code: 'A162',
810
+ message: 'Snippet not found',
811
+ httpCode: 404,
812
+ },
813
+ DELETE_SNIPPET_BY_NAME_ERROR: {
814
+ code: 'A163',
815
+ message: 'Delete snippet by name error',
816
+ httpCode: 500,
817
+ },
818
+ SNIPPET_NAME_ALREADY_EXISTS: {
819
+ code: 'A164',
820
+ message: 'Snippet name already exists',
821
+ httpCode: 400,
822
+ },
823
+ UPDATE_SNIPPET_ERROR: {
824
+ code: 'A165',
825
+ message: 'Update snippet error',
826
+ httpCode: 500,
827
+ },
803
828
  };
@@ -31,6 +31,7 @@ __exportStar(require("./infra-provider.schema"), exports);
31
31
  __exportStar(require("./internal-squad.schema"), exports);
32
32
  __exportStar(require("./last-connected-node.schema"), exports);
33
33
  __exportStar(require("./nodes.schema"), exports);
34
+ __exportStar(require("./snippets.schema"), exports);
34
35
  __exportStar(require("./subscription-info.schema"), exports);
35
36
  __exportStar(require("./subscription-request-history.schema"), exports);
36
37
  __exportStar(require("./subscription-settings.schema"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SnippetsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.SnippetsSchema = zod_1.z.object({
6
+ name: zod_1.z.string(),
7
+ snippet: zod_1.z.unknown(),
8
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.1.70",
3
+ "version": "2.1.71",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",