@tabsircg/fb-sdk 1.0.0 → 1.0.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.
- package/dist/client.d.ts +1691 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/httpClient.d.ts +26 -0
- package/dist/httpClient.d.ts.map +1 -0
- package/dist/internal/error.d.ts +6 -0
- package/dist/internal/error.d.ts.map +1 -0
- package/dist/internal/fetchers.d.ts +18 -0
- package/dist/internal/fetchers.d.ts.map +1 -0
- package/dist/internal/poller.d.ts +15 -0
- package/dist/internal/poller.d.ts.map +1 -0
- package/dist/internal/utils.d.ts +2 -0
- package/dist/internal/utils.d.ts.map +1 -0
- package/dist/lib/transformCase.d.ts +15 -0
- package/dist/lib/transformCase.d.ts.map +1 -0
- package/dist/resources/InsightResource.d.ts +1632 -0
- package/dist/resources/InsightResource.d.ts.map +1 -0
- package/dist/resources/PageResource.d.ts +849 -0
- package/dist/resources/PageResource.d.ts.map +1 -0
- package/dist/resources/PostResource.d.ts +857 -0
- package/dist/resources/PostResource.d.ts.map +1 -0
- package/dist/resources/UserResource.d.ts +11 -0
- package/dist/resources/UserResource.d.ts.map +1 -0
- package/dist/resources/comment/CommentResource.d.ts +34 -0
- package/dist/resources/comment/CommentResource.d.ts.map +1 -0
- package/dist/resources/comment/PageCommentResouorce.d.ts +9 -0
- package/dist/resources/comment/PageCommentResouorce.d.ts.map +1 -0
- package/dist/store/memory.d.ts +3 -0
- package/dist/store/memory.d.ts.map +1 -0
- package/dist/store/redis.d.ts +9 -0
- package/dist/store/redis.d.ts.map +1 -0
- package/dist/store/types.d.ts +6 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/types/facebookinsights.d.ts +136 -0
- package/dist/types/facebookinsights.d.ts.map +1 -0
- package/dist/types/facebookmedia.d.ts +117 -0
- package/dist/types/facebookmedia.d.ts.map +1 -0
- package/dist/types/facebookpage.d.ts +12 -0
- package/dist/types/facebookpage.d.ts.map +1 -0
- package/dist/types/facebookpost.d.ts +131 -0
- package/dist/types/facebookpost.d.ts.map +1 -0
- package/dist/types/facebookuser.d.ts +16 -0
- package/dist/types/facebookuser.d.ts.map +1 -0
- package/dist/types/shared.d.ts +78 -0
- package/dist/types/shared.d.ts.map +1 -0
- package/dist/types/webhook.d.ts +28 -0
- package/dist/types/webhook.d.ts.map +1 -0
- package/dist/webhook/handler.d.ts +26 -0
- package/dist/webhook/handler.d.ts.map +1 -0
- package/package.json +6 -5
|
@@ -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,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tabsircg/fb-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "./dist/
|
|
6
|
-
"types": "./dist/
|
|
5
|
+
"main": "./dist/client.js",
|
|
6
|
+
"types": "./dist/client.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./dist/
|
|
9
|
+
"import": "./dist/client.js",
|
|
10
|
+
"types": "./dist/client.d.ts"
|
|
10
11
|
}
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"build": "tsc",
|
|
17
|
-
"dev": "tsx src/tests/
|
|
18
|
+
"dev": "tsx src/tests/client.ts",
|
|
18
19
|
"prepublishOnly": "npm run build"
|
|
19
20
|
},
|
|
20
21
|
"keywords": [],
|