rasp-feedback 1.0.1 → 1.0.3

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 (29) hide show
  1. package/dist/nextjs/components/MainViewHandler.d.ts +10 -0
  2. package/dist/nextjs/components/MainViewHandler.d.ts.map +1 -0
  3. package/dist/nextjs/components/MainViewHandler.js +17 -0
  4. package/dist/nextjs/components/PostItem.d.ts +7 -0
  5. package/dist/nextjs/components/PostItem.d.ts.map +1 -0
  6. package/dist/nextjs/components/PostItem.js +34 -0
  7. package/dist/nextjs/components/Posttem.d.ts +7 -0
  8. package/dist/nextjs/components/Posttem.d.ts.map +1 -0
  9. package/dist/nextjs/components/Posttem.js +14 -0
  10. package/dist/nextjs/components/RaspForm.d.ts.map +1 -1
  11. package/dist/nextjs/components/RaspForm.js +11 -0
  12. package/dist/nextjs/components/RaspProvider.d.ts.map +1 -1
  13. package/dist/nextjs/components/RaspProvider.js +220 -49
  14. package/dist/nextjs/components/StaticFormComponent.d.ts.map +1 -1
  15. package/dist/nextjs/components/StaticFormComponent.js +31 -12
  16. package/dist/nextjs/functions/functionsexp.d.ts +3 -0
  17. package/dist/nextjs/functions/functionsexp.d.ts.map +1 -1
  18. package/dist/nextjs/functions/functionsexp.js +71 -0
  19. package/dist/vue/components/PostItem.vue.d.ts +20 -0
  20. package/dist/vue/components/PostItem.vue.d.ts.map +1 -0
  21. package/dist/vue/components/RaspProvider.vue.d.ts.map +1 -1
  22. package/dist/vue/components/StaticFormComponent.vue.d.ts.map +1 -1
  23. package/dist/vue/functions/functionsexp.d.ts +3 -0
  24. package/dist/vue/functions/functionsexp.d.ts.map +1 -1
  25. package/dist/vue/index.js +692 -299
  26. package/dist/vue/index.umd.cjs +1 -1
  27. package/package.json +97 -73
  28. package/dist/nextjs/images/rasp_logo.png +0 -0
  29. package/dist/vue/images/rasp_logo.png +0 -0
@@ -94,3 +94,74 @@ export async function getFormTheme(formId) {
94
94
  throw error;
95
95
  }
96
96
  }
97
+ // Get all board posts for a company
98
+ export async function getBoardPosts(companyId) {
99
+ // Add validation
100
+ if (!companyId || companyId.trim() === '') {
101
+ console.error("Invalid companyId provided");
102
+ return null;
103
+ }
104
+ try {
105
+ const response = await fetch(`https://disciplined-wombat-944.convex.site/posts?companyId=${encodeURIComponent(companyId)}`, {
106
+ method: "GET",
107
+ headers: { "Content-Type": "application/json" },
108
+ });
109
+ //console.log("Response status:", response.status);
110
+ if (!response.ok) {
111
+ const errorText = await response.text();
112
+ //console.error(`Error fetching posts! status: ${response.status}, message: ${errorText}`);
113
+ // If 404, return empty array instead of throwing
114
+ if (response.status === 404) {
115
+ console.log("No posts found, returning empty array");
116
+ return [];
117
+ }
118
+ throw new Error(`Error fetching posts! status: ${response.status}, message: ${errorText}`);
119
+ }
120
+ const posts = await response.json();
121
+ //console.log("Posts fetched successfully:", posts);
122
+ return posts;
123
+ }
124
+ catch (error) {
125
+ console.error("Exception in getBoardPosts:", error);
126
+ // Return empty array instead of throwing to prevent null
127
+ return [];
128
+ }
129
+ }
130
+ // Upvote a board post
131
+ export async function upvoteBoardPost(postId) {
132
+ try {
133
+ const response = await fetch(`https://disciplined-wombat-944.convex.site/posts/upvote`, {
134
+ method: "POST",
135
+ headers: { "Content-Type": "application/json" },
136
+ body: JSON.stringify({ postId })
137
+ });
138
+ if (!response.ok) {
139
+ const errorText = await response.text();
140
+ throw new Error(`Error upvoting post! status: ${response.status}, message: ${errorText}`);
141
+ }
142
+ const result = await response.json();
143
+ return result; // Returns { success: true, newCount: number }
144
+ }
145
+ catch (error) {
146
+ throw error;
147
+ }
148
+ }
149
+ // Downvote a board post
150
+ export async function downvoteBoardPost(postId) {
151
+ try {
152
+ const response = await fetch(`https://disciplined-wombat-944.convex.site/posts/downvote`, {
153
+ method: "POST",
154
+ headers: { "Content-Type": "application/json" },
155
+ body: JSON.stringify({ postId })
156
+ });
157
+ if (!response.ok) {
158
+ const errorText = await response.text();
159
+ throw new Error(`Error downvoting post! status: ${response.status}, message: ${errorText}`);
160
+ }
161
+ const result = await response.json();
162
+ return result; // Returns { success: true, newCount: number }
163
+ }
164
+ catch (error) {
165
+ throw error;
166
+ }
167
+ }
@@ -0,0 +1,20 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ post: {
5
+ type: ObjectConstructor;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:currentPost": (...args: any[]) => void;
10
+ "update:showVoteUI": (...args: any[]) => void;
11
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ post: {
13
+ type: ObjectConstructor;
14
+ required: true;
15
+ };
16
+ }>> & Readonly<{
17
+ "onUpdate:currentPost"?: ((...args: any[]) => any) | undefined;
18
+ "onUpdate:showVoteUI"?: ((...args: any[]) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
20
+ //# sourceMappingURL=PostItem.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostItem.vue.d.ts","sourceRoot":"","sources":["../../../src/vue/components/PostItem.vue"],"names":[],"mappings":"wBA8LqB,OAAO,YAAY;;AATxC;;;;;;;;;;;;;;;;kFAQG"}
@@ -1 +1 @@
1
- {"version":3,"file":"RaspProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/vue/components/RaspProvider.vue"],"names":[],"mappings":"AA4QA,OAAO,cAAc,CAAC;AAItB,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuVD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE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ACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StaticFormComponent.vue.d.ts","sourceRoot":"","sources":["../../../src/vue/components/StaticFormComponent.vue"],"names":[],"mappings":"AA+OA,UAAU,KAAK;IACb,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,EAAE,CAAC;CACf;AAmOD,QAAA,MAAM,YAAY,sRAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"StaticFormComponent.vue.d.ts","sourceRoot":"","sources":["../../../src/vue/components/StaticFormComponent.vue"],"names":[],"mappings":"AAsQA,UAAU,KAAK;IACb,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,EAAE,CAAC;CACf;AAmPD,QAAA,MAAM,YAAY,sRAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,4 +2,7 @@ export declare function addFeedback(companyId: string, formId: string, fieldsRes
2
2
  export declare function getFormByDomainOrCompany(companyId: string, domainUrl: string): Promise<any>;
3
3
  export declare function getBrandTheme(companyId: string): Promise<any>;
4
4
  export declare function getFormTheme(formId: string): Promise<any>;
5
+ export declare function getBoardPosts(companyId: string): Promise<any>;
6
+ export declare function upvoteBoardPost(postId: string): Promise<any>;
7
+ export declare function downvoteBoardPost(postId: string): Promise<any>;
5
8
  //# sourceMappingURL=functionsexp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"functionsexp.d.ts","sourceRoot":"","sources":["../../../src/vue/functions/functionsexp.ts"],"names":[],"mappings":"AAAA,wBAAsB,WAAW,CAC/B,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,MAAM,EACb,iBAAiB,EAAC,GAAG,gBAqCtB;AAED,wBAAsB,wBAAwB,CAC5C,SAAS,EAAC,MAAM,EAChB,SAAS,EAAC,MAAM,gBAqCjB;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAC,MAAM,gBAqBnD;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAC,MAAM,gBAuB/C"}
1
+ {"version":3,"file":"functionsexp.d.ts","sourceRoot":"","sources":["../../../src/vue/functions/functionsexp.ts"],"names":[],"mappings":"AAAA,wBAAsB,WAAW,CAC/B,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,MAAM,EACb,iBAAiB,EAAC,GAAG,gBAqCtB;AAED,wBAAsB,wBAAwB,CAC5C,SAAS,EAAC,MAAM,EAChB,SAAS,EAAC,MAAM,gBAqCjB;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAC,MAAM,gBAqBnD;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAC,MAAM,gBAuB/C;AAGD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,gBAwCpD;AAGD,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,gBAqBnD;AAGD,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,gBAqBrD"}