@tabsircg/fb-sdk 1.0.0 → 1.0.1

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 (49) hide show
  1. package/dist/client.d.ts +1691 -0
  2. package/dist/client.d.ts.map +1 -0
  3. package/dist/httpClient.d.ts +26 -0
  4. package/dist/httpClient.d.ts.map +1 -0
  5. package/dist/internal/error.d.ts +6 -0
  6. package/dist/internal/error.d.ts.map +1 -0
  7. package/dist/internal/fetchers.d.ts +18 -0
  8. package/dist/internal/fetchers.d.ts.map +1 -0
  9. package/dist/internal/poller.d.ts +15 -0
  10. package/dist/internal/poller.d.ts.map +1 -0
  11. package/dist/internal/utils.d.ts +2 -0
  12. package/dist/internal/utils.d.ts.map +1 -0
  13. package/dist/lib/transformCase.d.ts +15 -0
  14. package/dist/lib/transformCase.d.ts.map +1 -0
  15. package/dist/resources/InsightResource.d.ts +1632 -0
  16. package/dist/resources/InsightResource.d.ts.map +1 -0
  17. package/dist/resources/PageResource.d.ts +849 -0
  18. package/dist/resources/PageResource.d.ts.map +1 -0
  19. package/dist/resources/PostResource.d.ts +857 -0
  20. package/dist/resources/PostResource.d.ts.map +1 -0
  21. package/dist/resources/UserResource.d.ts +11 -0
  22. package/dist/resources/UserResource.d.ts.map +1 -0
  23. package/dist/resources/comment/CommentResource.d.ts +34 -0
  24. package/dist/resources/comment/CommentResource.d.ts.map +1 -0
  25. package/dist/resources/comment/PageCommentResouorce.d.ts +9 -0
  26. package/dist/resources/comment/PageCommentResouorce.d.ts.map +1 -0
  27. package/dist/store/memory.d.ts +3 -0
  28. package/dist/store/memory.d.ts.map +1 -0
  29. package/dist/store/redis.d.ts +9 -0
  30. package/dist/store/redis.d.ts.map +1 -0
  31. package/dist/store/types.d.ts +6 -0
  32. package/dist/store/types.d.ts.map +1 -0
  33. package/dist/types/facebookinsights.d.ts +136 -0
  34. package/dist/types/facebookinsights.d.ts.map +1 -0
  35. package/dist/types/facebookmedia.d.ts +117 -0
  36. package/dist/types/facebookmedia.d.ts.map +1 -0
  37. package/dist/types/facebookpage.d.ts +12 -0
  38. package/dist/types/facebookpage.d.ts.map +1 -0
  39. package/dist/types/facebookpost.d.ts +131 -0
  40. package/dist/types/facebookpost.d.ts.map +1 -0
  41. package/dist/types/facebookuser.d.ts +16 -0
  42. package/dist/types/facebookuser.d.ts.map +1 -0
  43. package/dist/types/shared.d.ts +78 -0
  44. package/dist/types/shared.d.ts.map +1 -0
  45. package/dist/types/webhook.d.ts +28 -0
  46. package/dist/types/webhook.d.ts.map +1 -0
  47. package/dist/webhook/handler.d.ts +26 -0
  48. package/dist/webhook/handler.d.ts.map +1 -0
  49. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ export interface WebhookEntry {
2
+ id: string;
3
+ time: number;
4
+ changes: WebhookChange[];
5
+ }
6
+ export interface WebhookChange {
7
+ field: string;
8
+ value: WebhookFeedValue;
9
+ }
10
+ export interface WebhookFeedValue {
11
+ from?: {
12
+ id: string;
13
+ name: string;
14
+ };
15
+ item: string;
16
+ verb: string;
17
+ post_id?: string;
18
+ comment_id?: string;
19
+ parent_id?: string;
20
+ created_time: number;
21
+ is_hidden?: boolean;
22
+ message?: string;
23
+ }
24
+ export interface WebhookPayload {
25
+ object: string;
26
+ entry: WebhookEntry[];
27
+ }
28
+ //# sourceMappingURL=webhook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/types/webhook.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB"}
@@ -0,0 +1,26 @@
1
+ import type { Store } from "../store/types.js";
2
+ import { WebhookPayload } from "../types/webhook.js";
3
+ interface VerifyRequest {
4
+ query: Record<string, string | string[] | undefined>;
5
+ }
6
+ interface EventRequest {
7
+ body: WebhookPayload;
8
+ headers: Record<string, string | string[] | undefined>;
9
+ rawBody?: Buffer | string;
10
+ }
11
+ interface Response {
12
+ status(code: number): Response;
13
+ send(body: string): void;
14
+ sendStatus?(code: number): void;
15
+ }
16
+ export interface WebhookHandlerConfig {
17
+ store: Store;
18
+ verifyToken: string;
19
+ appSecret: string;
20
+ }
21
+ export declare function createWebhookHandler(config: WebhookHandlerConfig): {
22
+ handleVerify: (req: VerifyRequest, res: Response) => void;
23
+ handleEvent: (req: EventRequest, res: Response) => Promise<void>;
24
+ };
25
+ export {};
26
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/webhook/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;CACtD;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,UAAU,QAAQ;IAChB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAID,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAgBD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB;wBAGpC,aAAa,OAAO,QAAQ;uBAYvB,YAAY,OAAO,QAAQ;EAoC5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tabsircg/fb-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",