jourycms-sdk 1.1.31 → 1.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jourycms-sdk",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "description": "Sdk for Joury CMS",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -0,0 +1,129 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Content {
5
+ export namespace Api {
6
+ export namespace FormEntries {
7
+ /**
8
+ * --------------------------------------------------------------------------
9
+ * Create
10
+ * --------------------------------------------------------------------------
11
+ * @link https://gateway.com/cm/api/form-entries
12
+ * @fires FormEntriesService.create
13
+ * @param {Levelup.CMS.V1.Api.FormEntries.Create.Request} body
14
+ * @returns {Levelup.CMS.V1.Api.FormEntries.Create.Response}
15
+ * @method POST
16
+ *
17
+ */
18
+ export namespace Create {
19
+ export type Request = Utils.Api.Request.Build<{
20
+ data: Partial<Entity.FormEntry>;
21
+ }>;
22
+ export type Response<T extends Entity.FormEntry = Entity.FormEntry> =
23
+ Utils.Api.Response.BuildSingleItemResponse<T>;
24
+ }
25
+ /**
26
+ * --------------------------------------------------------------------------
27
+ * Update
28
+ * --------------------------------------------------------------------------
29
+ * @link http://gateway.com/cm/api/form-entries/:id
30
+ * @fires FormEntriesService.update
31
+ * @param {Levelup.CMS.V1.Api.FormEntries.Update.Request} body
32
+ * @returns {Levelup.CMS.V1.Api.FormEntries.Update.Response}
33
+ * @method PUT
34
+ *
35
+ */
36
+ export namespace Update {
37
+ export type Request = Utils.Api.Request.Build<{
38
+ data: Partial<Entity.FormEntry>;
39
+ }>;
40
+ export type Response<T extends Entity.FormEntry = Entity.FormEntry> =
41
+ Utils.Api.Response.BuildSingleItemResponse<T>;
42
+ }
43
+
44
+ /**
45
+ * --------------------------------------------------------------------------
46
+ * Delete
47
+ * --------------------------------------------------------------------------
48
+ * @link http://gateway.com/cm/api/form-entries/:id
49
+ * @fires FormEntriesService.delete
50
+ * @param {Levelup.CMS.V1.Api.FormEntries.Delete.Request} query
51
+ * @returns {Levelup.CMS.V1.Api.FormEntries.Delete.Response}
52
+ * @method DELETE
53
+ *
54
+ */
55
+ export namespace Delete {
56
+ export type Request = Utils.Api.Request.Build<{}>;
57
+ export type Response = Utils.Api.Response.DefaultDeleteResponse;
58
+ }
59
+
60
+ /**
61
+ * --------------------------------------------------------------------------
62
+ * One
63
+ * --------------------------------------------------------------------------
64
+ * @link http://gateway.com/cm/api/form-entries/:id
65
+ * @fires FormEntriesService.getById
66
+ * @link http://gateway.com/cm/api/form-entries/by-slug/:id
67
+ * @fires FormEntriesService.getBySlug
68
+ * @param {Levelup.CMS.V1.Api.FormEntries.GetOne.Request} query
69
+ * @returns {Levelup.CMS.V1.Api.FormEntries.GetOne.Response}
70
+ * @method PUT
71
+ *
72
+ */
73
+ export namespace GetOne {
74
+ export type Request = Utils.Api.Request.Build<{}>;
75
+ export type Response<T extends Entity.FormEntry = Entity.FormEntry> =
76
+ Utils.Api.Response.BuildSingleItemResponse<T, 'users' | 'forms'>;
77
+ }
78
+
79
+ /**
80
+ * --------------------------------------------------------------------------
81
+ * List
82
+ * --------------------------------------------------------------------------
83
+ * @link
84
+ * @fires FormEntriesService.List
85
+ * @param {Levelup.CMS.V1.Api.FormEntries.List.Request} query
86
+ * @returns {Levelup.CMS.V1.Api.FormEntries.List.Response}
87
+ * @method GET
88
+ *
89
+ */
90
+ export namespace List {
91
+ type Scope = "listing" | "ids" | "trackings";
92
+
93
+ export type Request =
94
+ Utils.Api.Request.BuildSearchablePagedSortableFilterableProjectable<
95
+ Entity.FormEntry
96
+ >;
97
+ export type Response<T extends Entity.FormEntry = Entity.FormEntry> =
98
+ Utils.Api.Response.BuildListResponse<T, 'users' | 'forms'>;
99
+ }
100
+
101
+ /**
102
+ * --------------------------------------------------------------------------
103
+ * aggregateByTypes
104
+ * --------------------------------------------------------------------------
105
+ * @link
106
+ * @fires FormEntriesService.aggregateByTypes
107
+ * @param {Levelup.CMS.V1.Api.FormEntries.AggregateByTypes.Request} query
108
+ * @returns {Levelup.CMS.V1.Api.FormEntries.AggregateByTypes.Response}
109
+ * @method GET
110
+ *
111
+ */
112
+ export namespace AggregateByTypes {
113
+ export type Request = Utils.Api.Request.Build<{}>;
114
+ export type Response =Utils.Api.Response.BuildListResponse<{
115
+ form: string;
116
+ count: number;
117
+ },
118
+ 'forms'
119
+ >;
120
+ }
121
+
122
+
123
+
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,108 @@
1
+ declare module Levelup {
2
+ namespace CMS {
3
+ namespace V1 {
4
+ namespace Content {
5
+ export namespace Api {
6
+ export namespace Forms {
7
+ /**
8
+ * --------------------------------------------------------------------------
9
+ * Create
10
+ * --------------------------------------------------------------------------
11
+ * @link https://gateway.com/cm/api/forms
12
+ * @fires FormsService.create
13
+ * @param {Levelup.CMS.V1.Api.Forms.Create.Request} body
14
+ * @returns {Levelup.CMS.V1.Api.Forms.Create.Response}
15
+ * @method POST
16
+ *
17
+ */
18
+ export namespace Create {
19
+ export type Request = Utils.Api.Request.Build<{
20
+ data: Partial<Entity.Form>;
21
+ }>;
22
+ export type Response<T extends Entity.Form = Entity.Form> =
23
+ Utils.Api.Response.BuildSingleItemResponse<T>;
24
+ }
25
+ /**
26
+ * --------------------------------------------------------------------------
27
+ * Update
28
+ * --------------------------------------------------------------------------
29
+ * @link http://gateway.com/cm/api/forms/:id
30
+ * @fires FormsService.update
31
+ * @param {Levelup.CMS.V1.Api.Forms.Update.Request} body
32
+ * @returns {Levelup.CMS.V1.Api.Forms.Update.Response}
33
+ * @method PUT
34
+ *
35
+ */
36
+ export namespace Update {
37
+ export type Request = Utils.Api.Request.Build<{
38
+ data: Partial<Entity.Form>;
39
+ }>;
40
+ export type Response<T extends Entity.Form = Entity.Form> =
41
+ Utils.Api.Response.BuildSingleItemResponse<T>;
42
+ }
43
+
44
+ /**
45
+ * --------------------------------------------------------------------------
46
+ * Delete
47
+ * --------------------------------------------------------------------------
48
+ * @link http://gateway.com/cm/api/forms/:id
49
+ * @fires FormsService.delete
50
+ * @param {Levelup.CMS.V1.Api.Forms.Delete.Request} query
51
+ * @returns {Levelup.CMS.V1.Api.Forms.Delete.Response}
52
+ * @method DELETE
53
+ *
54
+ */
55
+ export namespace Delete {
56
+ export type Request = Utils.Api.Request.Build<{}>;
57
+ export type Response = Utils.Api.Response.DefaultDeleteResponse;
58
+ }
59
+
60
+ /**
61
+ * --------------------------------------------------------------------------
62
+ * One
63
+ * --------------------------------------------------------------------------
64
+ * @link http://gateway.com/cm/api/forms/:id
65
+ * @fires FormsService.getById
66
+ * @link http://gateway.com/cm/api/forms/by-slug/:id
67
+ * @fires FormsService.getBySlug
68
+ * @param {Levelup.CMS.V1.Api.Forms.GetOne.Request} query
69
+ * @returns {Levelup.CMS.V1.Api.Forms.GetOne.Response}
70
+ * @method PUT
71
+ *
72
+ */
73
+ export namespace GetOne {
74
+ export type Request = Utils.Api.Request.Build<{}>;
75
+ export type Response<T extends Entity.Form = Entity.Form> =
76
+ Utils.Api.Response.BuildSingleItemResponse<T, 'users'>;
77
+ }
78
+
79
+ /**
80
+ * --------------------------------------------------------------------------
81
+ * List
82
+ * --------------------------------------------------------------------------
83
+ * @link
84
+ * @fires FormsService.List
85
+ * @param {Levelup.CMS.V1.Api.Forms.List.Request} query
86
+ * @returns {Levelup.CMS.V1.Api.Forms.List.Response}
87
+ * @method GET
88
+ *
89
+ */
90
+ export namespace List {
91
+ type Scope = "listing" | "ids" | "trackings";
92
+
93
+ export type Request =
94
+ Utils.Api.Request.BuildSearchablePagedSortableFilterableProjectable<
95
+ Entity.Form
96
+ >;
97
+ export type Response<T extends Entity.Form = Entity.Form> =
98
+ Utils.Api.Response.BuildListResponse<T, 'users'>;
99
+ }
100
+
101
+
102
+
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
@@ -9,4 +9,6 @@ export * from "./term.d.ts";
9
9
  export * from "./review.d.ts";
10
10
  export * from "./comment.d.ts";
11
11
  export * from "./article.d.ts";
12
- export * from "./article-type.d.ts";
12
+ export * from "./article-type.d.ts";
13
+ export * from "./form.d.ts";
14
+ export * from "./form-entry.d.ts";
@@ -3,19 +3,18 @@ declare module Levelup {
3
3
  namespace V1 {
4
4
  namespace Content {
5
5
  export namespace Entity {
6
- export interface IFormContentSnapshots {
6
+ export interface IFormEntrySnapshots {
7
7
  created_by: Utils.Entity.Snapshots.Auth.User | null;
8
8
  }
9
9
 
10
- export interface FormContent
10
+ export interface FormEntry
11
11
  extends Utils.Entity.General.ICreatable,
12
12
  Utils.Entity.General.IHasSearchMeta {
13
- _type: Utils.Common.ID | null;
14
13
  _id: Utils.Common.ID;
15
14
  slug: string;
16
15
  form: Utils.Common.ID;
17
16
  data: { [Key: string]: any };
18
- snapshots: IFormContentSnapshots;
17
+ snapshots: IFormEntrySnapshots;
19
18
  }
20
19
  }
21
20
  }
@@ -25,6 +25,7 @@ declare module Levelup {
25
25
  fields: ICustomMetaField[];
26
26
 
27
27
  insights: IFromInsights;
28
+ snapshots: IFromSnapshots;
28
29
  }
29
30
  }
30
31
  }
@@ -5,7 +5,7 @@ export * from "./translation.namespace.d.ts";
5
5
  export * from "./translation.item.d.ts";
6
6
  export * from "./taxonomy.d.ts";
7
7
  export * from "./form.d.ts";
8
- export * from "./form-content.d.ts";
8
+ export * from "./form-entry.d.ts";
9
9
  export * from "./term.d.ts";
10
10
  export * from "./review.d.ts";
11
11
  export * from "./comment.d.ts";
@@ -0,0 +1,19 @@
1
+ import { Document, Model as MongooseModel } from "mongoose";
2
+
3
+ /**
4
+ * @description global here is very important because we have imported from another module
5
+ */
6
+ declare global {
7
+ declare module Levelup {
8
+ namespace CMS {
9
+ namespace V1 {
10
+ namespace Content {
11
+ export namespace Model {
12
+ export type FormEntryDocument = Entity.FormEntry & Document;
13
+ export type FormEntry = MongooseModel<FormEntryDocument>;
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ import { Document, Model as MongooseModel } from "mongoose";
2
+
3
+ /**
4
+ * @description global here is very important because we have imported from another module
5
+ */
6
+ declare global {
7
+ declare module Levelup {
8
+ namespace CMS {
9
+ namespace V1 {
10
+ namespace Content {
11
+ export namespace Model {
12
+ export type FormDocument = Entity.Form & Document;
13
+ export type Form = MongooseModel<FormDocument>;
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
19
+ }
@@ -8,4 +8,7 @@ export * from "./term.d.ts";
8
8
  export * from "./review.d.ts";
9
9
  export * from "./comment.d.ts";
10
10
  export * from "./article.d.ts";
11
- export * from "./article-type.d.ts";
11
+ export * from "./article-type.d.ts";
12
+ export * from "./form.d.ts";
13
+ export * from "./form-entry.d.ts";
14
+