@superdurable/connector-buffer 0.1.0 → 0.2.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.
- package/README.md +23 -1
- package/dex-connector.json +751 -2
- package/dist/chunk-Q62AX6CW.js +603 -0
- package/dist/connection-BmjeWE6m.d.ts +422 -0
- package/dist/index.d.ts +585 -5
- package/dist/index.js +896 -27
- package/dist/mock.d.ts +213 -5
- package/dist/mock.js +523 -7
- package/package.json +3 -3
- package/dist/chunk-VOOXKNLI.js +0 -106
- package/dist/connection-BRLi-NI_.d.ts +0 -72
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
// src/generated/models.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SecretString } from "@superdurable/connectors-sdk";
|
|
4
|
+
var nativeJSON = JSON;
|
|
5
|
+
var signedIntegerToken = /^-?(?:0|[1-9][0-9]*)$/;
|
|
6
|
+
var minimumSignedInteger = -(1n << 63n);
|
|
7
|
+
var maximumSignedInteger = (1n << 63n) - 1n;
|
|
8
|
+
function decodeSignedInteger(value) {
|
|
9
|
+
if (typeof value === "number" && Number.isSafeInteger(value)) return value === 0 ? 0 : value;
|
|
10
|
+
if (!nativeJSON.isRawJSON(value) || value.rawJSON.length > 20 || !signedIntegerToken.test(value.rawJSON)) {
|
|
11
|
+
throw new TypeError("expected a signed 64-bit integer");
|
|
12
|
+
}
|
|
13
|
+
const integer = BigInt(value.rawJSON);
|
|
14
|
+
if (integer < minimumSignedInteger || integer > maximumSignedInteger) throw new RangeError("signed 64-bit integer out of range");
|
|
15
|
+
const number = Number(integer);
|
|
16
|
+
return Number.isSafeInteger(number) ? number : value;
|
|
17
|
+
}
|
|
18
|
+
var signedIntegerSchema = z.unknown().transform((value, context) => {
|
|
19
|
+
try {
|
|
20
|
+
return decodeSignedInteger(value);
|
|
21
|
+
} catch {
|
|
22
|
+
context.addIssue({ code: "custom", message: "expected a signed 64-bit integer" });
|
|
23
|
+
return z.NEVER;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
function parseJSONNumberTokens(text) {
|
|
27
|
+
return JSON.parse(text, (_key, value, context) => typeof value === "number" && context?.source !== void 0 ? nativeJSON.rawJSON(context.source) : value);
|
|
28
|
+
}
|
|
29
|
+
function parseExactIntegerJSON(text) {
|
|
30
|
+
return JSON.parse(text, (_key, field, context) => typeof field === "number" && !Number.isSafeInteger(field) && context?.source && signedIntegerToken.test(context.source) ? nativeJSON.rawJSON(context.source) : field);
|
|
31
|
+
}
|
|
32
|
+
function exactIntegerJSONCodec(decode) {
|
|
33
|
+
return {
|
|
34
|
+
typeName: "json",
|
|
35
|
+
wireKind: "json",
|
|
36
|
+
encode(value) {
|
|
37
|
+
const data = JSON.stringify(value, (_key, field) => {
|
|
38
|
+
if (typeof field === "number" && Number.isInteger(field) && !Number.isSafeInteger(field)) {
|
|
39
|
+
throw new RangeError("use a raw JSON token for integers outside the safe number range");
|
|
40
|
+
}
|
|
41
|
+
return field;
|
|
42
|
+
});
|
|
43
|
+
if (data === void 0) throw new TypeError("value cannot be encoded as JSON");
|
|
44
|
+
return { kind: "json", data };
|
|
45
|
+
},
|
|
46
|
+
decode(wire) {
|
|
47
|
+
if (wire.kind !== "json" || typeof wire.data !== "string") throw new TypeError("expected Dex JSON wire data");
|
|
48
|
+
const value = parseExactIntegerJSON(wire.data);
|
|
49
|
+
return decode ? decode(value) : value;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var ConfigSchema = z.object({
|
|
54
|
+
"baseUrl": z.string().optional(),
|
|
55
|
+
"timeoutMs": z.number().int().optional(),
|
|
56
|
+
"maxResponseBytes": z.number().int().optional()
|
|
57
|
+
});
|
|
58
|
+
var CredentialMaterialError = class extends TypeError {
|
|
59
|
+
constructor(message) {
|
|
60
|
+
super(message);
|
|
61
|
+
this.name = "CredentialMaterialError";
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
|
|
65
|
+
"project credential decoding failed",
|
|
66
|
+
"shared project credential decoding failed",
|
|
67
|
+
"project credential decoding failed: this connector version does not support shared credentials"
|
|
68
|
+
]);
|
|
69
|
+
function isCredentialMaterialError(error) {
|
|
70
|
+
return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
|
|
71
|
+
}
|
|
72
|
+
function decodeCredentials(value) {
|
|
73
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
|
|
74
|
+
const fields = value;
|
|
75
|
+
const allowed = /* @__PURE__ */ new Set(["apiKey"]);
|
|
76
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
|
|
77
|
+
if (fields["apiKey"] != null && !(typeof fields["apiKey"] === "string")) throw new CredentialMaterialError("credential apiKey has an invalid type");
|
|
78
|
+
const credentials = {};
|
|
79
|
+
if (!fields["apiKey"]) throw new CredentialMaterialError("credential apiKey is required");
|
|
80
|
+
credentials.apiKey = new SecretString(fields["apiKey"] ?? "");
|
|
81
|
+
return credentials;
|
|
82
|
+
}
|
|
83
|
+
var CreateIdeaInputSchema = z.strictObject({
|
|
84
|
+
"organizationId": z.string(),
|
|
85
|
+
"title": z.string(),
|
|
86
|
+
"text": z.string()
|
|
87
|
+
});
|
|
88
|
+
var IdeaProfileSchema = z.strictObject({
|
|
89
|
+
"id": z.string(),
|
|
90
|
+
"title": z.string(),
|
|
91
|
+
"text": z.string()
|
|
92
|
+
});
|
|
93
|
+
var ListIdeasInputSchema = z.strictObject({
|
|
94
|
+
"organizationId": z.string(),
|
|
95
|
+
"first": z.number().int(),
|
|
96
|
+
"after": z.string().optional()
|
|
97
|
+
});
|
|
98
|
+
var IdeasPageSchema = z.strictObject({
|
|
99
|
+
"ideas": z.array(IdeaProfileSchema).nullable(),
|
|
100
|
+
"endCursor": z.string().optional(),
|
|
101
|
+
"hasNextPage": z.boolean()
|
|
102
|
+
});
|
|
103
|
+
var ListOrganizationsInputSchema = z.strictObject({});
|
|
104
|
+
var OrganizationIdentitySchema = z.strictObject({
|
|
105
|
+
"id": z.string(),
|
|
106
|
+
"name": z.string()
|
|
107
|
+
});
|
|
108
|
+
var OrganizationsListSchema = z.strictObject({
|
|
109
|
+
"organizations": z.array(OrganizationIdentitySchema).nullable()
|
|
110
|
+
});
|
|
111
|
+
var ListChannelsInputSchema = z.strictObject({
|
|
112
|
+
"organizationId": z.string()
|
|
113
|
+
});
|
|
114
|
+
var ChannelProfileSchema = z.strictObject({
|
|
115
|
+
"id": z.string(),
|
|
116
|
+
"name": z.string(),
|
|
117
|
+
"service": z.string()
|
|
118
|
+
});
|
|
119
|
+
var ChannelsListSchema = z.strictObject({
|
|
120
|
+
"channels": z.array(ChannelProfileSchema).nullable()
|
|
121
|
+
});
|
|
122
|
+
var GetPostInputSchema = z.strictObject({
|
|
123
|
+
"postId": z.string()
|
|
124
|
+
});
|
|
125
|
+
var PostProfileSchema = z.strictObject({
|
|
126
|
+
"id": z.string(),
|
|
127
|
+
"text": z.string(),
|
|
128
|
+
"channelId": z.string()
|
|
129
|
+
});
|
|
130
|
+
var ListPostsInputSchema = z.strictObject({
|
|
131
|
+
"organizationId": z.string(),
|
|
132
|
+
"first": z.number().int(),
|
|
133
|
+
"after": z.string().optional()
|
|
134
|
+
});
|
|
135
|
+
var PostsListSchema = z.strictObject({
|
|
136
|
+
"posts": z.array(PostProfileSchema).nullable(),
|
|
137
|
+
"endCursor": z.string().optional(),
|
|
138
|
+
"hasNextPage": z.boolean()
|
|
139
|
+
});
|
|
140
|
+
var PostAssetSchema = z.strictObject({
|
|
141
|
+
"type": z.string(),
|
|
142
|
+
"url": z.string(),
|
|
143
|
+
"thumbnailUrl": z.string().optional(),
|
|
144
|
+
"title": z.string().optional(),
|
|
145
|
+
"thumbnailOffsetMs": signedIntegerSchema.optional()
|
|
146
|
+
});
|
|
147
|
+
var CreatePostInputSchema = z.strictObject({
|
|
148
|
+
"channelId": z.string(),
|
|
149
|
+
"text": z.string(),
|
|
150
|
+
"assets": z.array(PostAssetSchema).optional()
|
|
151
|
+
});
|
|
152
|
+
var CreateScheduledPostInputSchema = z.strictObject({
|
|
153
|
+
"channelId": z.string(),
|
|
154
|
+
"text": z.string(),
|
|
155
|
+
"assets": z.array(PostAssetSchema).optional(),
|
|
156
|
+
"dueAt": z.string()
|
|
157
|
+
});
|
|
158
|
+
var PublishPostNowInputSchema = z.strictObject({
|
|
159
|
+
"channelId": z.string(),
|
|
160
|
+
"text": z.string(),
|
|
161
|
+
"assets": z.array(PostAssetSchema).optional()
|
|
162
|
+
});
|
|
163
|
+
var EditPostInputSchema = z.strictObject({
|
|
164
|
+
"postId": z.string(),
|
|
165
|
+
"text": z.string(),
|
|
166
|
+
"assets": z.array(PostAssetSchema).optional()
|
|
167
|
+
});
|
|
168
|
+
var DeletePostInputSchema = z.strictObject({
|
|
169
|
+
"postId": z.string()
|
|
170
|
+
});
|
|
171
|
+
var PostDeleteResultSchema = z.strictObject({
|
|
172
|
+
"id": z.string()
|
|
173
|
+
});
|
|
174
|
+
var GetChannelInputSchema = z.strictObject({
|
|
175
|
+
"channelId": z.string()
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// src/generated/definitions.ts
|
|
179
|
+
var ConnectorID = "buffer";
|
|
180
|
+
var ProviderID = "buffer";
|
|
181
|
+
var CreateIdeaBranch = {
|
|
182
|
+
Created: "created",
|
|
183
|
+
ProviderRejected: "providerRejected",
|
|
184
|
+
Uncertain: "uncertain",
|
|
185
|
+
Defect: "defect"
|
|
186
|
+
};
|
|
187
|
+
var CreateIdeaBranchCreated = CreateIdeaBranch.Created;
|
|
188
|
+
var CreateIdeaBranchProviderRejected = CreateIdeaBranch.ProviderRejected;
|
|
189
|
+
var CreateIdeaBranchUncertain = CreateIdeaBranch.Uncertain;
|
|
190
|
+
var CreateIdeaBranchDefect = CreateIdeaBranch.Defect;
|
|
191
|
+
var CreateIdeaDefinition = {
|
|
192
|
+
operation: { connectorId: ConnectorID, operationId: "createIdea" },
|
|
193
|
+
branches: [
|
|
194
|
+
{ id: "created", description: "Buffer created the idea." },
|
|
195
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the idea.", optional: true },
|
|
196
|
+
{ id: "uncertain", description: "An idea may have been created but cannot be confirmed.", optional: true },
|
|
197
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
198
|
+
],
|
|
199
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
|
|
200
|
+
repeatOnUnknown: "limited",
|
|
201
|
+
maxSends: 3
|
|
202
|
+
};
|
|
203
|
+
var CreateIdeaMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
204
|
+
var ListIdeasBranch = {
|
|
205
|
+
Listed: "listed",
|
|
206
|
+
ProviderRejected: "providerRejected",
|
|
207
|
+
InvalidResponse: "invalidResponse",
|
|
208
|
+
Defect: "defect"
|
|
209
|
+
};
|
|
210
|
+
var ListIdeasBranchListed = ListIdeasBranch.Listed;
|
|
211
|
+
var ListIdeasBranchProviderRejected = ListIdeasBranch.ProviderRejected;
|
|
212
|
+
var ListIdeasBranchInvalidResponse = ListIdeasBranch.InvalidResponse;
|
|
213
|
+
var ListIdeasBranchDefect = ListIdeasBranch.Defect;
|
|
214
|
+
var ListIdeasDefinition = {
|
|
215
|
+
operation: { connectorId: ConnectorID, operationId: "listIdeas" },
|
|
216
|
+
branches: [
|
|
217
|
+
{ id: "listed", description: "Buffer returned one idea page." },
|
|
218
|
+
{ id: "providerRejected", description: "Buffer rejected idea listing.", optional: true },
|
|
219
|
+
{ id: "invalidResponse", description: "Buffer returned an invalid idea page.", optional: true },
|
|
220
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
221
|
+
],
|
|
222
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
223
|
+
};
|
|
224
|
+
var ListIdeasMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
225
|
+
var ListOrganizationsBranch = {
|
|
226
|
+
Listed: "listed",
|
|
227
|
+
ProviderRejected: "providerRejected",
|
|
228
|
+
InvalidResponse: "invalidResponse",
|
|
229
|
+
Defect: "defect"
|
|
230
|
+
};
|
|
231
|
+
var ListOrganizationsBranchListed = ListOrganizationsBranch.Listed;
|
|
232
|
+
var ListOrganizationsBranchProviderRejected = ListOrganizationsBranch.ProviderRejected;
|
|
233
|
+
var ListOrganizationsBranchInvalidResponse = ListOrganizationsBranch.InvalidResponse;
|
|
234
|
+
var ListOrganizationsBranchDefect = ListOrganizationsBranch.Defect;
|
|
235
|
+
var ListOrganizationsDefinition = {
|
|
236
|
+
operation: { connectorId: ConnectorID, operationId: "listOrganizations" },
|
|
237
|
+
branches: [
|
|
238
|
+
{ id: "listed", description: "Buffer completed the operation." },
|
|
239
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the request.", optional: true },
|
|
240
|
+
{ id: "invalidResponse", description: "Buffer returned malformed or oversized JSON.", optional: true },
|
|
241
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
242
|
+
],
|
|
243
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
244
|
+
};
|
|
245
|
+
var ListOrganizationsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
246
|
+
var ListChannelsBranch = {
|
|
247
|
+
Listed: "listed",
|
|
248
|
+
ProviderRejected: "providerRejected",
|
|
249
|
+
InvalidResponse: "invalidResponse",
|
|
250
|
+
Defect: "defect"
|
|
251
|
+
};
|
|
252
|
+
var ListChannelsBranchListed = ListChannelsBranch.Listed;
|
|
253
|
+
var ListChannelsBranchProviderRejected = ListChannelsBranch.ProviderRejected;
|
|
254
|
+
var ListChannelsBranchInvalidResponse = ListChannelsBranch.InvalidResponse;
|
|
255
|
+
var ListChannelsBranchDefect = ListChannelsBranch.Defect;
|
|
256
|
+
var ListChannelsDefinition = {
|
|
257
|
+
operation: { connectorId: ConnectorID, operationId: "listChannels" },
|
|
258
|
+
branches: [
|
|
259
|
+
{ id: "listed", description: "Buffer completed the operation." },
|
|
260
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the request.", optional: true },
|
|
261
|
+
{ id: "invalidResponse", description: "Buffer returned malformed or oversized JSON.", optional: true },
|
|
262
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
263
|
+
],
|
|
264
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
265
|
+
};
|
|
266
|
+
var ListChannelsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
267
|
+
var GetPostBranch = {
|
|
268
|
+
Found: "found",
|
|
269
|
+
NotFound: "notFound",
|
|
270
|
+
ProviderRejected: "providerRejected",
|
|
271
|
+
InvalidResponse: "invalidResponse",
|
|
272
|
+
Defect: "defect"
|
|
273
|
+
};
|
|
274
|
+
var GetPostBranchFound = GetPostBranch.Found;
|
|
275
|
+
var GetPostBranchNotFound = GetPostBranch.NotFound;
|
|
276
|
+
var GetPostBranchProviderRejected = GetPostBranch.ProviderRejected;
|
|
277
|
+
var GetPostBranchInvalidResponse = GetPostBranch.InvalidResponse;
|
|
278
|
+
var GetPostBranchDefect = GetPostBranch.Defect;
|
|
279
|
+
var GetPostDefinition = {
|
|
280
|
+
operation: { connectorId: ConnectorID, operationId: "getPost" },
|
|
281
|
+
branches: [
|
|
282
|
+
{ id: "found", description: "Buffer completed the operation." },
|
|
283
|
+
{ id: "notFound", description: "Buffer did not find the post.", optional: true },
|
|
284
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the request.", optional: true },
|
|
285
|
+
{ id: "invalidResponse", description: "Buffer returned malformed or oversized JSON.", optional: true },
|
|
286
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
287
|
+
],
|
|
288
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
289
|
+
};
|
|
290
|
+
var GetPostMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
291
|
+
var ListPostsBranch = {
|
|
292
|
+
Listed: "listed",
|
|
293
|
+
ProviderRejected: "providerRejected",
|
|
294
|
+
InvalidResponse: "invalidResponse",
|
|
295
|
+
Defect: "defect"
|
|
296
|
+
};
|
|
297
|
+
var ListPostsBranchListed = ListPostsBranch.Listed;
|
|
298
|
+
var ListPostsBranchProviderRejected = ListPostsBranch.ProviderRejected;
|
|
299
|
+
var ListPostsBranchInvalidResponse = ListPostsBranch.InvalidResponse;
|
|
300
|
+
var ListPostsBranchDefect = ListPostsBranch.Defect;
|
|
301
|
+
var ListPostsDefinition = {
|
|
302
|
+
operation: { connectorId: ConnectorID, operationId: "listPosts" },
|
|
303
|
+
branches: [
|
|
304
|
+
{ id: "listed", description: "Buffer completed the operation." },
|
|
305
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the request.", optional: true },
|
|
306
|
+
{ id: "invalidResponse", description: "Buffer returned malformed or oversized JSON.", optional: true },
|
|
307
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
308
|
+
],
|
|
309
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
310
|
+
};
|
|
311
|
+
var ListPostsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
312
|
+
var CreatePostBranch = {
|
|
313
|
+
Created: "created",
|
|
314
|
+
ProviderRejected: "providerRejected",
|
|
315
|
+
Uncertain: "uncertain",
|
|
316
|
+
Defect: "defect"
|
|
317
|
+
};
|
|
318
|
+
var CreatePostBranchCreated = CreatePostBranch.Created;
|
|
319
|
+
var CreatePostBranchProviderRejected = CreatePostBranch.ProviderRejected;
|
|
320
|
+
var CreatePostBranchUncertain = CreatePostBranch.Uncertain;
|
|
321
|
+
var CreatePostBranchDefect = CreatePostBranch.Defect;
|
|
322
|
+
var CreatePostDefinition = {
|
|
323
|
+
operation: { connectorId: ConnectorID, operationId: "createPost" },
|
|
324
|
+
branches: [
|
|
325
|
+
{ id: "created", description: "Buffer completed the operation." },
|
|
326
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the request.", optional: true },
|
|
327
|
+
{ id: "uncertain", description: "A post may have been created but cannot be confirmed.", optional: true },
|
|
328
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
329
|
+
],
|
|
330
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
|
|
331
|
+
repeatOnUnknown: "limited",
|
|
332
|
+
maxSends: 3
|
|
333
|
+
};
|
|
334
|
+
var CreatePostMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
335
|
+
var CreateScheduledPostBranch = {
|
|
336
|
+
Created: "created",
|
|
337
|
+
ProviderRejected: "providerRejected",
|
|
338
|
+
Uncertain: "uncertain",
|
|
339
|
+
Defect: "defect"
|
|
340
|
+
};
|
|
341
|
+
var CreateScheduledPostBranchCreated = CreateScheduledPostBranch.Created;
|
|
342
|
+
var CreateScheduledPostBranchProviderRejected = CreateScheduledPostBranch.ProviderRejected;
|
|
343
|
+
var CreateScheduledPostBranchUncertain = CreateScheduledPostBranch.Uncertain;
|
|
344
|
+
var CreateScheduledPostBranchDefect = CreateScheduledPostBranch.Defect;
|
|
345
|
+
var CreateScheduledPostDefinition = {
|
|
346
|
+
operation: { connectorId: ConnectorID, operationId: "createScheduledPost" },
|
|
347
|
+
branches: [
|
|
348
|
+
{ id: "created", description: "Buffer scheduled the post." },
|
|
349
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the post.", optional: true },
|
|
350
|
+
{ id: "uncertain", description: "A scheduled post may have been created but cannot be confirmed.", optional: true },
|
|
351
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
352
|
+
],
|
|
353
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
|
|
354
|
+
repeatOnUnknown: "limited",
|
|
355
|
+
maxSends: 3
|
|
356
|
+
};
|
|
357
|
+
var CreateScheduledPostMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
358
|
+
var PublishPostNowBranch = {
|
|
359
|
+
Created: "created",
|
|
360
|
+
ProviderRejected: "providerRejected",
|
|
361
|
+
Uncertain: "uncertain",
|
|
362
|
+
Defect: "defect"
|
|
363
|
+
};
|
|
364
|
+
var PublishPostNowBranchCreated = PublishPostNowBranch.Created;
|
|
365
|
+
var PublishPostNowBranchProviderRejected = PublishPostNowBranch.ProviderRejected;
|
|
366
|
+
var PublishPostNowBranchUncertain = PublishPostNowBranch.Uncertain;
|
|
367
|
+
var PublishPostNowBranchDefect = PublishPostNowBranch.Defect;
|
|
368
|
+
var PublishPostNowDefinition = {
|
|
369
|
+
operation: { connectorId: ConnectorID, operationId: "publishPostNow" },
|
|
370
|
+
branches: [
|
|
371
|
+
{ id: "created", description: "Buffer accepted the post for immediate publishing." },
|
|
372
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the post.", optional: true },
|
|
373
|
+
{ id: "uncertain", description: "A post may have been published but cannot be confirmed.", optional: true },
|
|
374
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
375
|
+
],
|
|
376
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
|
|
377
|
+
repeatOnUnknown: "limited",
|
|
378
|
+
maxSends: 3
|
|
379
|
+
};
|
|
380
|
+
var PublishPostNowMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
381
|
+
var EditPostBranch = {
|
|
382
|
+
Updated: "updated",
|
|
383
|
+
ProviderRejected: "providerRejected",
|
|
384
|
+
InvalidResponse: "invalidResponse",
|
|
385
|
+
Defect: "defect"
|
|
386
|
+
};
|
|
387
|
+
var EditPostBranchUpdated = EditPostBranch.Updated;
|
|
388
|
+
var EditPostBranchProviderRejected = EditPostBranch.ProviderRejected;
|
|
389
|
+
var EditPostBranchInvalidResponse = EditPostBranch.InvalidResponse;
|
|
390
|
+
var EditPostBranchDefect = EditPostBranch.Defect;
|
|
391
|
+
var EditPostDefinition = {
|
|
392
|
+
operation: { connectorId: ConnectorID, operationId: "editPost" },
|
|
393
|
+
branches: [
|
|
394
|
+
{ id: "updated", description: "Buffer completed the operation." },
|
|
395
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the request.", optional: true },
|
|
396
|
+
{ id: "invalidResponse", description: "Buffer returned malformed or oversized JSON.", optional: true },
|
|
397
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
398
|
+
],
|
|
399
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
|
|
400
|
+
repeatOnUnknown: "safe"
|
|
401
|
+
};
|
|
402
|
+
var EditPostMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
403
|
+
var DeletePostBranch = {
|
|
404
|
+
Deleted: "deleted",
|
|
405
|
+
ProviderRejected: "providerRejected",
|
|
406
|
+
InvalidResponse: "invalidResponse",
|
|
407
|
+
Defect: "defect"
|
|
408
|
+
};
|
|
409
|
+
var DeletePostBranchDeleted = DeletePostBranch.Deleted;
|
|
410
|
+
var DeletePostBranchProviderRejected = DeletePostBranch.ProviderRejected;
|
|
411
|
+
var DeletePostBranchInvalidResponse = DeletePostBranch.InvalidResponse;
|
|
412
|
+
var DeletePostBranchDefect = DeletePostBranch.Defect;
|
|
413
|
+
var DeletePostDefinition = {
|
|
414
|
+
operation: { connectorId: ConnectorID, operationId: "deletePost" },
|
|
415
|
+
branches: [
|
|
416
|
+
{ id: "deleted", description: "Buffer completed the operation." },
|
|
417
|
+
{ id: "providerRejected", description: "Buffer conclusively rejected the request.", optional: true },
|
|
418
|
+
{ id: "invalidResponse", description: "Buffer returned malformed or oversized JSON.", optional: true },
|
|
419
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
420
|
+
],
|
|
421
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
|
|
422
|
+
repeatOnUnknown: "safe"
|
|
423
|
+
};
|
|
424
|
+
var DeletePostMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
425
|
+
var GetChannelBranch = {
|
|
426
|
+
Found: "found",
|
|
427
|
+
NotFound: "notFound",
|
|
428
|
+
ProviderRejected: "providerRejected",
|
|
429
|
+
InvalidResponse: "invalidResponse",
|
|
430
|
+
Defect: "defect"
|
|
431
|
+
};
|
|
432
|
+
var GetChannelBranchFound = GetChannelBranch.Found;
|
|
433
|
+
var GetChannelBranchNotFound = GetChannelBranch.NotFound;
|
|
434
|
+
var GetChannelBranchProviderRejected = GetChannelBranch.ProviderRejected;
|
|
435
|
+
var GetChannelBranchInvalidResponse = GetChannelBranch.InvalidResponse;
|
|
436
|
+
var GetChannelBranchDefect = GetChannelBranch.Defect;
|
|
437
|
+
var GetChannelDefinition = {
|
|
438
|
+
operation: { connectorId: ConnectorID, operationId: "getChannel" },
|
|
439
|
+
branches: [
|
|
440
|
+
{ id: "found", description: "Buffer returned the channel." },
|
|
441
|
+
{ id: "notFound", description: "Buffer did not expose a channel for this ID.", optional: true },
|
|
442
|
+
{ id: "providerRejected", description: "Buffer returned a definite GraphQL or HTTP rejection.", optional: true },
|
|
443
|
+
{ id: "invalidResponse", description: "Buffer returned malformed or oversized JSON.", optional: true },
|
|
444
|
+
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
445
|
+
],
|
|
446
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
447
|
+
};
|
|
448
|
+
var GetChannelMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
449
|
+
|
|
450
|
+
// src/generated/connection.ts
|
|
451
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
452
|
+
var Connection = class {
|
|
453
|
+
/** Stable provider and connection name. */
|
|
454
|
+
reference;
|
|
455
|
+
/** Bound provider operations. */
|
|
456
|
+
operations;
|
|
457
|
+
/** Validate a reference and bind operations. */
|
|
458
|
+
constructor(reference, operations) {
|
|
459
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
460
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
461
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
462
|
+
this.operations = operations;
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
function newConnection(client, reference) {
|
|
466
|
+
if (!client) throw new TypeError("connector client is required");
|
|
467
|
+
return new Connection(reference, client);
|
|
468
|
+
}
|
|
469
|
+
function newConnectionWithOperations(operations, reference) {
|
|
470
|
+
return new Connection(reference, operations);
|
|
471
|
+
}
|
|
472
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
473
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
474
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
475
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
476
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
477
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export {
|
|
481
|
+
decodeSignedInteger,
|
|
482
|
+
parseJSONNumberTokens,
|
|
483
|
+
parseExactIntegerJSON,
|
|
484
|
+
exactIntegerJSONCodec,
|
|
485
|
+
ConfigSchema,
|
|
486
|
+
CredentialMaterialError,
|
|
487
|
+
isCredentialMaterialError,
|
|
488
|
+
decodeCredentials,
|
|
489
|
+
CreateIdeaInputSchema,
|
|
490
|
+
IdeaProfileSchema,
|
|
491
|
+
ListIdeasInputSchema,
|
|
492
|
+
IdeasPageSchema,
|
|
493
|
+
ListOrganizationsInputSchema,
|
|
494
|
+
OrganizationIdentitySchema,
|
|
495
|
+
OrganizationsListSchema,
|
|
496
|
+
ListChannelsInputSchema,
|
|
497
|
+
ChannelProfileSchema,
|
|
498
|
+
ChannelsListSchema,
|
|
499
|
+
GetPostInputSchema,
|
|
500
|
+
PostProfileSchema,
|
|
501
|
+
ListPostsInputSchema,
|
|
502
|
+
PostsListSchema,
|
|
503
|
+
PostAssetSchema,
|
|
504
|
+
CreatePostInputSchema,
|
|
505
|
+
CreateScheduledPostInputSchema,
|
|
506
|
+
PublishPostNowInputSchema,
|
|
507
|
+
EditPostInputSchema,
|
|
508
|
+
DeletePostInputSchema,
|
|
509
|
+
PostDeleteResultSchema,
|
|
510
|
+
GetChannelInputSchema,
|
|
511
|
+
ConnectorID,
|
|
512
|
+
ProviderID,
|
|
513
|
+
CreateIdeaBranch,
|
|
514
|
+
CreateIdeaBranchCreated,
|
|
515
|
+
CreateIdeaBranchProviderRejected,
|
|
516
|
+
CreateIdeaBranchUncertain,
|
|
517
|
+
CreateIdeaBranchDefect,
|
|
518
|
+
CreateIdeaDefinition,
|
|
519
|
+
CreateIdeaMetadata,
|
|
520
|
+
ListIdeasBranch,
|
|
521
|
+
ListIdeasBranchListed,
|
|
522
|
+
ListIdeasBranchProviderRejected,
|
|
523
|
+
ListIdeasBranchInvalidResponse,
|
|
524
|
+
ListIdeasBranchDefect,
|
|
525
|
+
ListIdeasDefinition,
|
|
526
|
+
ListIdeasMetadata,
|
|
527
|
+
ListOrganizationsBranch,
|
|
528
|
+
ListOrganizationsBranchListed,
|
|
529
|
+
ListOrganizationsBranchProviderRejected,
|
|
530
|
+
ListOrganizationsBranchInvalidResponse,
|
|
531
|
+
ListOrganizationsBranchDefect,
|
|
532
|
+
ListOrganizationsDefinition,
|
|
533
|
+
ListOrganizationsMetadata,
|
|
534
|
+
ListChannelsBranch,
|
|
535
|
+
ListChannelsBranchListed,
|
|
536
|
+
ListChannelsBranchProviderRejected,
|
|
537
|
+
ListChannelsBranchInvalidResponse,
|
|
538
|
+
ListChannelsBranchDefect,
|
|
539
|
+
ListChannelsDefinition,
|
|
540
|
+
ListChannelsMetadata,
|
|
541
|
+
GetPostBranch,
|
|
542
|
+
GetPostBranchFound,
|
|
543
|
+
GetPostBranchNotFound,
|
|
544
|
+
GetPostBranchProviderRejected,
|
|
545
|
+
GetPostBranchInvalidResponse,
|
|
546
|
+
GetPostBranchDefect,
|
|
547
|
+
GetPostDefinition,
|
|
548
|
+
GetPostMetadata,
|
|
549
|
+
ListPostsBranch,
|
|
550
|
+
ListPostsBranchListed,
|
|
551
|
+
ListPostsBranchProviderRejected,
|
|
552
|
+
ListPostsBranchInvalidResponse,
|
|
553
|
+
ListPostsBranchDefect,
|
|
554
|
+
ListPostsDefinition,
|
|
555
|
+
ListPostsMetadata,
|
|
556
|
+
CreatePostBranch,
|
|
557
|
+
CreatePostBranchCreated,
|
|
558
|
+
CreatePostBranchProviderRejected,
|
|
559
|
+
CreatePostBranchUncertain,
|
|
560
|
+
CreatePostBranchDefect,
|
|
561
|
+
CreatePostDefinition,
|
|
562
|
+
CreatePostMetadata,
|
|
563
|
+
CreateScheduledPostBranch,
|
|
564
|
+
CreateScheduledPostBranchCreated,
|
|
565
|
+
CreateScheduledPostBranchProviderRejected,
|
|
566
|
+
CreateScheduledPostBranchUncertain,
|
|
567
|
+
CreateScheduledPostBranchDefect,
|
|
568
|
+
CreateScheduledPostDefinition,
|
|
569
|
+
CreateScheduledPostMetadata,
|
|
570
|
+
PublishPostNowBranch,
|
|
571
|
+
PublishPostNowBranchCreated,
|
|
572
|
+
PublishPostNowBranchProviderRejected,
|
|
573
|
+
PublishPostNowBranchUncertain,
|
|
574
|
+
PublishPostNowBranchDefect,
|
|
575
|
+
PublishPostNowDefinition,
|
|
576
|
+
PublishPostNowMetadata,
|
|
577
|
+
EditPostBranch,
|
|
578
|
+
EditPostBranchUpdated,
|
|
579
|
+
EditPostBranchProviderRejected,
|
|
580
|
+
EditPostBranchInvalidResponse,
|
|
581
|
+
EditPostBranchDefect,
|
|
582
|
+
EditPostDefinition,
|
|
583
|
+
EditPostMetadata,
|
|
584
|
+
DeletePostBranch,
|
|
585
|
+
DeletePostBranchDeleted,
|
|
586
|
+
DeletePostBranchProviderRejected,
|
|
587
|
+
DeletePostBranchInvalidResponse,
|
|
588
|
+
DeletePostBranchDefect,
|
|
589
|
+
DeletePostDefinition,
|
|
590
|
+
DeletePostMetadata,
|
|
591
|
+
GetChannelBranch,
|
|
592
|
+
GetChannelBranchFound,
|
|
593
|
+
GetChannelBranchNotFound,
|
|
594
|
+
GetChannelBranchProviderRejected,
|
|
595
|
+
GetChannelBranchInvalidResponse,
|
|
596
|
+
GetChannelBranchDefect,
|
|
597
|
+
GetChannelDefinition,
|
|
598
|
+
GetChannelMetadata,
|
|
599
|
+
Connection,
|
|
600
|
+
newConnection,
|
|
601
|
+
newConnectionWithOperations,
|
|
602
|
+
newProjectConnection
|
|
603
|
+
};
|