@superdurable/connector-hootsuite 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,205 @@
1
+ import { L as ListScheduledPostsInput, S as ScheduledPostsPage, C as Connection, a as ListSocialProfilesInput, b as SocialProfilesPage, c as SchedulePostInput, d as ScheduledPostReceipt, e as Config, f as Credentials, O as Operations } from './connection-CArKfYhH.js';
2
+ export { g as ConfigSchema, h as CredentialSource, i as ListScheduledPostsInputSchema, j as ListSocialProfilesInputSchema, k as SchedulePostInputSchema, l as ScheduledPost, m as ScheduledPostReceiptSchema, n as ScheduledPostSchema, o as ScheduledPostsPageSchema, p as SocialProfile, q as SocialProfileSchema, r as SocialProfilesPageSchema, s as decodeCredentials, t as decodeSharedCredentials, u as newConnection, v as newConnectionWithOperations } from './connection-CArKfYhH.js';
3
+ import { QueryDefinition, MutationDefinition, QueryStepConfig, Query, QueryResult, MutationStepConfig, Mutation, MutationResult, QueryStep, MutationStep, CredentialProvider, CredentialRefreshDriver, Call, QueryAttempt, CallID, MutationAttempt } from '@superdurable/connectors-sdk';
4
+ import { StepTarget } from '@superdurable/dex';
5
+ import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
6
+ import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
7
+ import 'zod';
8
+
9
+ /** Stable connector identity. */
10
+ declare const ConnectorID = "hootsuite";
11
+ /** Provider identity for named connections. */
12
+ declare const ProviderID = "hootsuite";
13
+ /** Branch IDs for listSocialProfiles. */
14
+ declare const ListSocialProfilesBranch: {
15
+ readonly Listed: "listed";
16
+ readonly ProviderRejected: "providerRejected";
17
+ readonly InvalidResponse: "invalidResponse";
18
+ readonly Defect: "defect";
19
+ };
20
+ /** Hootsuite returned the visible profiles. */
21
+ declare const ListSocialProfilesBranchListed: "listed";
22
+ /** Hootsuite definitively rejected the lookup. */
23
+ declare const ListSocialProfilesBranchProviderRejected: "providerRejected";
24
+ /** Hootsuite returned malformed or oversized JSON. */
25
+ declare const ListSocialProfilesBranchInvalidResponse: "invalidResponse";
26
+ /** Local connection credentials are invalid. */
27
+ declare const ListSocialProfilesBranchDefect: "defect";
28
+ /** Manifest definition for listSocialProfiles. */
29
+ declare const ListSocialProfilesDefinition: QueryDefinition;
30
+ /** Manifest metadata for listSocialProfiles. */
31
+ declare const ListSocialProfilesMetadata: {
32
+ readonly kind: "query";
33
+ readonly idempotency: "none";
34
+ readonly authorization: "required";
35
+ };
36
+ /** Branch IDs for listScheduledPosts. */
37
+ declare const ListScheduledPostsBranch: {
38
+ readonly Listed: "listed";
39
+ readonly ProviderRejected: "providerRejected";
40
+ readonly InvalidResponse: "invalidResponse";
41
+ readonly Defect: "defect";
42
+ };
43
+ /** Hootsuite returned one scheduled message page. */
44
+ declare const ListScheduledPostsBranchListed: "listed";
45
+ /** Hootsuite definitively rejected the lookup. */
46
+ declare const ListScheduledPostsBranchProviderRejected: "providerRejected";
47
+ /** Hootsuite returned malformed or oversized JSON. */
48
+ declare const ListScheduledPostsBranchInvalidResponse: "invalidResponse";
49
+ /** Local input or connection credentials are invalid. */
50
+ declare const ListScheduledPostsBranchDefect: "defect";
51
+ /** Manifest definition for listScheduledPosts. */
52
+ declare const ListScheduledPostsDefinition: QueryDefinition;
53
+ /** Manifest metadata for listScheduledPosts. */
54
+ declare const ListScheduledPostsMetadata: {
55
+ readonly kind: "query";
56
+ readonly idempotency: "none";
57
+ readonly authorization: "required";
58
+ };
59
+ /** Branch IDs for schedulePost. */
60
+ declare const SchedulePostBranch: {
61
+ readonly Scheduled: "scheduled";
62
+ readonly ProviderRejected: "providerRejected";
63
+ readonly Uncertain: "uncertain";
64
+ readonly Defect: "defect";
65
+ };
66
+ /** Hootsuite accepted the scheduled message and returned its ID. */
67
+ declare const SchedulePostBranchScheduled: "scheduled";
68
+ /** Hootsuite definitively rejected the schedule request. */
69
+ declare const SchedulePostBranchProviderRejected: "providerRejected";
70
+ /** The request may have reached Hootsuite but no message ID was confirmed; inspect Planner before resending. */
71
+ declare const SchedulePostBranchUncertain: "uncertain";
72
+ /** Local post input, credentials, or dispatch checkpoint is invalid. */
73
+ declare const SchedulePostBranchDefect: "defect";
74
+ /** Manifest definition for schedulePost. */
75
+ declare const SchedulePostDefinition: MutationDefinition;
76
+ /** Manifest metadata for schedulePost. */
77
+ declare const SchedulePostMetadata: {
78
+ readonly kind: "mutation";
79
+ readonly idempotency: "required";
80
+ readonly authorization: "required";
81
+ };
82
+
83
+ /** Configuration for the listSocialProfiles connector Step. */
84
+ interface ListSocialProfilesStepConfig<StepInput, OperationInput = ListSocialProfilesInput, OperationOutput = SocialProfilesPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
85
+ /** Named connection supplying this operation. */
86
+ connection: Connection<{
87
+ listSocialProfiles(): Query<OperationInput, OperationOutput>;
88
+ }>;
89
+ /** Name matching the bound connection. */
90
+ connectionName: string;
91
+ /** Hootsuite returned the visible profiles. */
92
+ listed: StepTarget<QueryResult<OperationOutput>>;
93
+ /** Hootsuite definitively rejected the lookup. */
94
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
95
+ /** Hootsuite returned malformed or oversized JSON. */
96
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
97
+ /** Local connection credentials are invalid. */
98
+ defect?: StepTarget<QueryResult<OperationOutput>>;
99
+ }
100
+ /** Build the listSocialProfiles Step from a named connection. */
101
+ declare function newListSocialProfilesStep<StepInput, OperationInput = ListSocialProfilesInput, OperationOutput = SocialProfilesPage>(configuration: ListSocialProfilesStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
102
+ /** Configuration for the listScheduledPosts connector Step. */
103
+ interface ListScheduledPostsStepConfig<StepInput, OperationInput = ListScheduledPostsInput, OperationOutput = ScheduledPostsPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
104
+ /** Named connection supplying this operation. */
105
+ connection: Connection<{
106
+ listScheduledPosts(): Query<OperationInput, OperationOutput>;
107
+ }>;
108
+ /** Name matching the bound connection. */
109
+ connectionName: string;
110
+ /** Hootsuite returned one scheduled message page. */
111
+ listed: StepTarget<QueryResult<OperationOutput>>;
112
+ /** Hootsuite definitively rejected the lookup. */
113
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
114
+ /** Hootsuite returned malformed or oversized JSON. */
115
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
116
+ /** Local input or connection credentials are invalid. */
117
+ defect?: StepTarget<QueryResult<OperationOutput>>;
118
+ }
119
+ /** Build the listScheduledPosts Step from a named connection. */
120
+ declare function newListScheduledPostsStep<StepInput, OperationInput = ListScheduledPostsInput, OperationOutput = ScheduledPostsPage>(configuration: ListScheduledPostsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
121
+ /** Configuration for the schedulePost connector Step. */
122
+ interface SchedulePostStepConfig<StepInput, OperationInput = SchedulePostInput, OperationOutput = ScheduledPostReceipt> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
123
+ /** Named connection supplying this operation. */
124
+ connection: Connection<{
125
+ schedulePost(): Mutation<OperationInput, OperationOutput>;
126
+ }>;
127
+ /** Name matching the bound connection. */
128
+ connectionName: string;
129
+ /** Hootsuite accepted the scheduled message and returned its ID. */
130
+ scheduled: StepTarget<MutationResult<OperationOutput>>;
131
+ /** Hootsuite definitively rejected the schedule request. */
132
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
133
+ /** The request may have reached Hootsuite but no message ID was confirmed; inspect Planner before resending. */
134
+ uncertain?: StepTarget<MutationResult<OperationOutput>>;
135
+ /** Local post input, credentials, or dispatch checkpoint is invalid. */
136
+ defect?: StepTarget<MutationResult<OperationOutput>>;
137
+ }
138
+ /** Build the schedulePost Step from a named connection. */
139
+ declare function newSchedulePostStep<StepInput, OperationInput = SchedulePostInput, OperationOutput = ScheduledPostReceipt>(configuration: SchedulePostStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
140
+
141
+ /** Injectable transport and OAuth refresh dependencies. */
142
+ interface HootsuiteClientOptions {
143
+ /** Provider sender; omitted uses the SDK HTTP transport. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
144
+ /** Refresh driver; omitted uses the manifest declaration. */ refreshDriver?: CredentialRefreshDriver<Credentials>;
145
+ /** Clock used to interpret HTTP Retry-After dates. */ now?: () => Date;
146
+ }
147
+ /** One bounded Hootsuite exchange with positive send evidence. */
148
+ interface HootsuiteExchange {
149
+ /** Provider HTTP status, or zero before response headers. */ status: number;
150
+ /** Bounded response body retained only in process memory. */ body: Uint8Array;
151
+ /** Provider Retry-After delay in milliseconds. */ retryAfterMs: number;
152
+ /** Safe local error class. */ error?: 'credential' | 'refresh' | 'request' | 'tooLarge';
153
+ /** Whether request bytes may have reached Hootsuite. */ requestSent: boolean;
154
+ }
155
+ /** Hootsuite client with call-time OAuth resolution and bounded responses. */
156
+ declare class HootsuiteClient {
157
+ private readonly credentials;
158
+ private readonly baseURL;
159
+ private readonly timeoutMs;
160
+ private readonly maxResponseBytes;
161
+ private readonly refreshDriver;
162
+ private readonly sendRequest;
163
+ private readonly now;
164
+ /** Validate configuration without contacting Hootsuite. */
165
+ constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: HootsuiteClientOptions);
166
+ /** Bind the social profile Query. */ listSocialProfiles(): ListSocialProfilesOperation;
167
+ /** Bind the scheduled message Query. */ listScheduledPosts(): ListScheduledPostsOperation;
168
+ /** Bind the scheduled message Mutation. */ schedulePost(): SchedulePostOperation;
169
+ /** Resolve a header-safe access token for the current call. */
170
+ resolveToken(call: Call): Promise<string | HootsuiteExchange>;
171
+ /** Read one bounded provider response for a Query. */
172
+ get(call: Call, path: string): Promise<HootsuiteExchange>;
173
+ /** Send one authenticated request; the caller owns dispatch fencing for writes. */
174
+ send(method: string, path: string, token: string, signal: AbortSignal, body?: Uint8Array): Promise<HootsuiteExchange>;
175
+ }
176
+ /** Read visible Hootsuite social profile identities. */
177
+ declare class ListSocialProfilesOperation implements Query<ListSocialProfilesInput, SocialProfilesPage> {
178
+ private readonly client;
179
+ /** Bind the provider client. */ constructor(client: HootsuiteClient);
180
+ /** Return the generated Query definition. */ definition(): QueryDefinition;
181
+ /** Project one bounded provider response. */
182
+ invoke(call: Call, input: ListSocialProfilesInput): Promise<QueryAttempt<SocialProfilesPage>>;
183
+ }
184
+ /** Read one page of scheduled outbound messages. */
185
+ declare class ListScheduledPostsOperation implements Query<ListScheduledPostsInput, ScheduledPostsPage> {
186
+ private readonly client;
187
+ /** Bind the provider client. */ constructor(client: HootsuiteClient);
188
+ /** Return the generated Query definition. */ definition(): QueryDefinition;
189
+ /** Read one UTC interval of at most four weeks. */
190
+ invoke(call: Call, input: ListScheduledPostsInput): Promise<QueryAttempt<ScheduledPostsPage>>;
191
+ }
192
+ /** Schedule one text post behind a durable single-dispatch fence. */
193
+ declare class SchedulePostOperation implements Mutation<SchedulePostInput, ScheduledPostReceipt> {
194
+ private readonly client;
195
+ /** Bind the provider client. */ constructor(client: HootsuiteClient);
196
+ /** Return the generated Mutation definition. */ definition(): MutationDefinition;
197
+ /** Record the Call ID; Hootsuite does not deduplicate this key. */ idempotencyKey(callID: CallID): string;
198
+ /** Send once, returning uncertainty when the provider may have accepted the post. */
199
+ invoke(call: Call, input: SchedulePostInput): Promise<MutationAttempt<ScheduledPostReceipt>>;
200
+ }
201
+
202
+ /** Open a statically named renewable Hootsuite connection from Dex project configuration. */
203
+ declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: HootsuiteClientOptions): Connection<Operations>;
204
+
205
+ export { Config, Connection, ConnectorID, Credentials, HootsuiteClient, type HootsuiteClientOptions, ListScheduledPostsBranch, ListScheduledPostsBranchDefect, ListScheduledPostsBranchInvalidResponse, ListScheduledPostsBranchListed, ListScheduledPostsBranchProviderRejected, ListScheduledPostsDefinition, ListScheduledPostsInput, ListScheduledPostsMetadata, ListScheduledPostsOperation, type ListScheduledPostsStepConfig, ListSocialProfilesBranch, ListSocialProfilesBranchDefect, ListSocialProfilesBranchInvalidResponse, ListSocialProfilesBranchListed, ListSocialProfilesBranchProviderRejected, ListSocialProfilesDefinition, ListSocialProfilesInput, ListSocialProfilesMetadata, ListSocialProfilesOperation, type ListSocialProfilesStepConfig, ProviderID, SchedulePostBranch, SchedulePostBranchDefect, SchedulePostBranchProviderRejected, SchedulePostBranchScheduled, SchedulePostBranchUncertain, SchedulePostDefinition, SchedulePostInput, SchedulePostMetadata, SchedulePostOperation, type SchedulePostStepConfig, ScheduledPostReceipt, ScheduledPostsPage, SocialProfilesPage, newListScheduledPostsStep, newListSocialProfilesStep, newProjectConnection, newSchedulePostStep };