@opencoredev/social-sdk 0.1.2 → 0.2.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.
- package/README.md +6 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.js +234 -0
- package/dist/cloud/common.d.ts +25 -0
- package/dist/cloud/common.js +334 -0
- package/dist/cloud/lifecycle.d.ts +10 -0
- package/dist/cloud/lifecycle.js +112 -0
- package/dist/cloud/media.d.ts +23 -0
- package/dist/cloud/media.js +100 -0
- package/dist/cloud/outcomes.d.ts +9 -0
- package/dist/cloud/outcomes.js +195 -0
- package/dist/cloud/post-for-me.d.ts +69 -0
- package/dist/cloud/post-for-me.js +396 -0
- package/dist/cloud/zernio.d.ts +111 -0
- package/dist/cloud/zernio.js +632 -0
- package/dist/core/adapter.d.ts +158 -0
- package/dist/core/adapter.js +3 -0
- package/dist/core/client.d.ts +141 -0
- package/dist/core/client.js +1285 -0
- package/dist/core/concurrency.d.ts +9 -0
- package/dist/core/concurrency.js +79 -0
- package/dist/core/errors.d.ts +44 -0
- package/dist/core/errors.js +50 -0
- package/dist/core/idempotency.d.ts +33 -0
- package/dist/core/idempotency.js +58 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +6 -0
- package/dist/core/pagination.d.ts +11 -0
- package/dist/core/pagination.js +81 -0
- package/dist/core/types.d.ts +396 -0
- package/dist/core/types.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/platforms/bluesky.d.ts +261 -0
- package/dist/platforms/bluesky.js +1776 -0
- package/dist/platforms/instagram.d.ts +129 -0
- package/dist/platforms/instagram.js +1031 -0
- package/dist/platforms/linkedin.d.ts +108 -0
- package/dist/platforms/linkedin.js +890 -0
- package/dist/platforms/threads.d.ts +134 -0
- package/dist/platforms/threads.js +945 -0
- package/dist/platforms/tiktok.d.ts +31 -0
- package/dist/platforms/tiktok.js +593 -0
- package/dist/platforms/x-engagement.d.ts +16 -0
- package/dist/platforms/x-engagement.js +50 -0
- package/dist/platforms/x-text.d.ts +2 -0
- package/dist/platforms/x-text.js +123 -0
- package/dist/platforms/x-tlds.d.ts +1 -0
- package/dist/platforms/x-tlds.js +2 -0
- package/dist/platforms/x.d.ts +299 -0
- package/dist/platforms/x.js +1287 -0
- package/dist/platforms/youtube-upload.d.ts +32 -0
- package/dist/platforms/youtube-upload.js +296 -0
- package/dist/platforms/youtube.d.ts +108 -0
- package/dist/platforms/youtube.js +1100 -0
- package/dist/server/connections.d.ts +123 -0
- package/dist/server/connections.js +335 -0
- package/dist/server/credentials.d.ts +51 -0
- package/dist/server/credentials.js +108 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +4 -0
- package/dist/server/oauth.d.ts +52 -0
- package/dist/server/oauth.js +553 -0
- package/dist/server/webhooks.d.ts +57 -0
- package/dist/server/webhooks.js +204 -0
- package/dist/testing/index.d.ts +46 -0
- package/dist/testing/index.js +564 -0
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +1 -0
- package/dist/transport/binary.d.ts +2 -0
- package/dist/transport/binary.js +29 -0
- package/dist/transport/budget.d.ts +3 -0
- package/dist/transport/budget.js +26 -0
- package/dist/transport/http.d.ts +44 -0
- package/dist/transport/http.js +259 -0
- package/dist/transport/json.d.ts +8 -0
- package/dist/transport/json.js +16 -0
- package/dist/transport/upload.d.ts +25 -0
- package/dist/transport/upload.js +153 -0
- package/dist/transport/validation.d.ts +5 -0
- package/dist/transport/validation.js +24 -0
- package/package.json +2 -7
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { type AdapterOperationContext, type DeliveryOutcome, type JsonObject, type SocialAdapter, type ConnectedAccountRef } from "../core/index.js";
|
|
2
|
+
export interface ThreadsAuthorization {
|
|
3
|
+
readonly userId: string;
|
|
4
|
+
readonly accessToken: string;
|
|
5
|
+
readonly handle?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ThreadsWorkflow {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly backend: string;
|
|
10
|
+
readonly accountId: string;
|
|
11
|
+
readonly childIds: readonly string[];
|
|
12
|
+
readonly parentId?: string;
|
|
13
|
+
readonly nativeId?: string;
|
|
14
|
+
readonly caption: string;
|
|
15
|
+
readonly options: JsonObject;
|
|
16
|
+
readonly stage: "children" | "parent" | "published" | "unknown";
|
|
17
|
+
readonly backendState?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ThreadsWorkflowStore {
|
|
20
|
+
create(input: Omit<ThreadsWorkflow, "id">): Promise<ThreadsWorkflow>;
|
|
21
|
+
get(id: string): Promise<ThreadsWorkflow | undefined>;
|
|
22
|
+
update(id: string, update: Partial<ThreadsWorkflow>): Promise<ThreadsWorkflow>;
|
|
23
|
+
claim(id: string): Promise<boolean>;
|
|
24
|
+
release?(id: string): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export interface ThreadsSearchInput {
|
|
27
|
+
readonly account: ConnectedAccountRef;
|
|
28
|
+
readonly query: string;
|
|
29
|
+
readonly cursor?: string;
|
|
30
|
+
readonly searchType?: "TOP" | "RECENT";
|
|
31
|
+
readonly searchMode?: "KEYWORD" | "TAG";
|
|
32
|
+
readonly mediaType?: "TEXT" | "IMAGE" | "VIDEO";
|
|
33
|
+
readonly since?: string;
|
|
34
|
+
readonly until?: string;
|
|
35
|
+
readonly limit?: number;
|
|
36
|
+
readonly authorUsername?: string;
|
|
37
|
+
readonly context: AdapterOperationContext;
|
|
38
|
+
}
|
|
39
|
+
export declare class MemoryThreadsWorkflowStore implements ThreadsWorkflowStore {
|
|
40
|
+
private readonly rows;
|
|
41
|
+
private readonly claims;
|
|
42
|
+
create(input: Omit<ThreadsWorkflow, "id">): Promise<{
|
|
43
|
+
id: string;
|
|
44
|
+
options: JsonObject;
|
|
45
|
+
accountId: string;
|
|
46
|
+
backend: string;
|
|
47
|
+
backendState?: string;
|
|
48
|
+
caption: string;
|
|
49
|
+
parentId?: string;
|
|
50
|
+
childIds: readonly string[];
|
|
51
|
+
nativeId?: string;
|
|
52
|
+
stage: "children" | "parent" | "published" | "unknown";
|
|
53
|
+
}>;
|
|
54
|
+
get(id: string): Promise<ThreadsWorkflow | undefined>;
|
|
55
|
+
update(id: string, update: Partial<ThreadsWorkflow>): Promise<{
|
|
56
|
+
id: string;
|
|
57
|
+
backend: string;
|
|
58
|
+
accountId: string;
|
|
59
|
+
childIds: readonly string[];
|
|
60
|
+
parentId?: string;
|
|
61
|
+
nativeId?: string;
|
|
62
|
+
caption: string;
|
|
63
|
+
options: JsonObject;
|
|
64
|
+
stage: "children" | "parent" | "published" | "unknown";
|
|
65
|
+
backendState?: string;
|
|
66
|
+
}>;
|
|
67
|
+
claim(id: string): Promise<boolean>;
|
|
68
|
+
release(id: string): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
export interface ThreadsOptions {
|
|
71
|
+
readonly auth: ThreadsAuthorization;
|
|
72
|
+
readonly backend?: string;
|
|
73
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
74
|
+
readonly graphVersion?: string;
|
|
75
|
+
readonly workflowStore?: ThreadsWorkflowStore;
|
|
76
|
+
readonly clock?: () => Date;
|
|
77
|
+
}
|
|
78
|
+
export interface ThreadsNative {
|
|
79
|
+
readonly getPost: (id: string, context: AdapterOperationContext) => Promise<JsonObject>;
|
|
80
|
+
readonly getContainer: (id: string, context: AdapterOperationContext) => Promise<JsonObject>;
|
|
81
|
+
readonly resumePublication: (account: ConnectedAccountRef, workflowId: string, context: AdapterOperationContext) => Promise<DeliveryOutcome>;
|
|
82
|
+
readonly quotePost: (input: {
|
|
83
|
+
readonly account: ConnectedAccountRef;
|
|
84
|
+
readonly postId: string;
|
|
85
|
+
readonly text: string;
|
|
86
|
+
readonly context: AdapterOperationContext;
|
|
87
|
+
}) => Promise<JsonObject>;
|
|
88
|
+
readonly repost: (input: {
|
|
89
|
+
readonly account: ConnectedAccountRef;
|
|
90
|
+
readonly postId: string;
|
|
91
|
+
readonly context: AdapterOperationContext;
|
|
92
|
+
}) => Promise<JsonObject>;
|
|
93
|
+
readonly deletePost: (input: {
|
|
94
|
+
readonly account: ConnectedAccountRef;
|
|
95
|
+
readonly postId: string;
|
|
96
|
+
readonly context: AdapterOperationContext;
|
|
97
|
+
}) => Promise<void>;
|
|
98
|
+
readonly search: (input: ThreadsSearchInput) => Promise<JsonObject>;
|
|
99
|
+
readonly mentions: (input: {
|
|
100
|
+
readonly account: ConnectedAccountRef;
|
|
101
|
+
readonly cursor?: string;
|
|
102
|
+
readonly context: AdapterOperationContext;
|
|
103
|
+
}) => Promise<JsonObject>;
|
|
104
|
+
readonly getProfile: (input: {
|
|
105
|
+
readonly account: ConnectedAccountRef;
|
|
106
|
+
readonly context: AdapterOperationContext;
|
|
107
|
+
}) => Promise<JsonObject>;
|
|
108
|
+
readonly hideReply: (input: {
|
|
109
|
+
readonly account: ConnectedAccountRef;
|
|
110
|
+
readonly replyId: string;
|
|
111
|
+
readonly hide: boolean;
|
|
112
|
+
readonly context: AdapterOperationContext;
|
|
113
|
+
}) => Promise<JsonObject>;
|
|
114
|
+
readonly listConversation: (input: {
|
|
115
|
+
readonly account: ConnectedAccountRef;
|
|
116
|
+
readonly mediaId: string;
|
|
117
|
+
readonly cursor?: string;
|
|
118
|
+
readonly context: AdapterOperationContext;
|
|
119
|
+
}) => Promise<JsonObject>;
|
|
120
|
+
readonly listPendingReplies: (input: {
|
|
121
|
+
readonly account: ConnectedAccountRef;
|
|
122
|
+
readonly mediaId: string;
|
|
123
|
+
readonly cursor?: string;
|
|
124
|
+
readonly approvalStatus?: "pending" | "ignored";
|
|
125
|
+
readonly context: AdapterOperationContext;
|
|
126
|
+
}) => Promise<JsonObject>;
|
|
127
|
+
readonly managePendingReply: (input: {
|
|
128
|
+
readonly account: ConnectedAccountRef;
|
|
129
|
+
readonly replyId: string;
|
|
130
|
+
readonly approve: boolean;
|
|
131
|
+
readonly context: AdapterOperationContext;
|
|
132
|
+
}) => Promise<JsonObject>;
|
|
133
|
+
}
|
|
134
|
+
export declare function threads(options: ThreadsOptions): SocialAdapter<ThreadsNative>;
|