@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.
package/dist/mock.js ADDED
@@ -0,0 +1,179 @@
1
+ import {
2
+ ListScheduledPostsDefinition,
3
+ ListScheduledPostsInputSchema,
4
+ ListSocialProfilesDefinition,
5
+ ListSocialProfilesInputSchema,
6
+ ProviderID,
7
+ SchedulePostDefinition,
8
+ SchedulePostInputSchema,
9
+ ScheduledPostReceiptSchema,
10
+ ScheduledPostSchema,
11
+ ScheduledPostsPageSchema,
12
+ SocialProfileSchema,
13
+ SocialProfilesPageSchema,
14
+ newConnectionWithOperations
15
+ } from "./chunk-LBB5UANL.js";
16
+
17
+ // src/generated/mock.ts
18
+ import { branchCase, retryCase, uncertainCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
19
+ var emptyListSocialProfilesInput = ListSocialProfilesInputSchema.parse({});
20
+ var emptySocialProfile = SocialProfileSchema.parse({
21
+ "id": "",
22
+ "type": "",
23
+ "username": ""
24
+ });
25
+ var emptySocialProfilesPage = SocialProfilesPageSchema.parse({
26
+ "profiles": []
27
+ });
28
+ var emptyListScheduledPostsInput = ListScheduledPostsInputSchema.parse({
29
+ "startTime": "",
30
+ "endTime": ""
31
+ });
32
+ var emptyScheduledPost = ScheduledPostSchema.parse({
33
+ "id": "",
34
+ "state": "",
35
+ "socialProfileId": "",
36
+ "scheduledSendTime": ""
37
+ });
38
+ var emptyScheduledPostsPage = ScheduledPostsPageSchema.parse({
39
+ "posts": [],
40
+ "nextCursor": ""
41
+ });
42
+ var emptySchedulePostInput = SchedulePostInputSchema.parse({
43
+ "text": "",
44
+ "socialProfileId": "",
45
+ "scheduledSendTime": ""
46
+ });
47
+ var emptyScheduledPostReceipt = ScheduledPostReceiptSchema.parse({
48
+ "id": "",
49
+ "state": "",
50
+ "socialProfileId": ""
51
+ });
52
+ function listSocialProfilesListed(value, failure) {
53
+ return branchCase("listed", value, failure);
54
+ }
55
+ function listSocialProfilesProviderRejected(value, failure) {
56
+ return branchCase("providerRejected", value, failure);
57
+ }
58
+ function listSocialProfilesInvalidResponse(value, failure) {
59
+ return branchCase("invalidResponse", value, failure);
60
+ }
61
+ function listSocialProfilesDefect(value, failure) {
62
+ return branchCase("defect", value, failure);
63
+ }
64
+ function listSocialProfilesRetry(failure, retryAfterMs = 0) {
65
+ return retryCase(failure, retryAfterMs);
66
+ }
67
+ function listSocialProfilesListedDefault() {
68
+ const value = SocialProfilesPageSchema.parse({ "profiles": [{ "id": "115185509", "type": "FACEBOOK", "username": "Example Page" }] });
69
+ return branchCase("listed", value);
70
+ }
71
+ function listSocialProfilesDefault() {
72
+ return listSocialProfilesListedDefault();
73
+ }
74
+ function listScheduledPostsListed(value, failure) {
75
+ return branchCase("listed", value, failure);
76
+ }
77
+ function listScheduledPostsProviderRejected(value, failure) {
78
+ return branchCase("providerRejected", value, failure);
79
+ }
80
+ function listScheduledPostsInvalidResponse(value, failure) {
81
+ return branchCase("invalidResponse", value, failure);
82
+ }
83
+ function listScheduledPostsDefect(value, failure) {
84
+ return branchCase("defect", value, failure);
85
+ }
86
+ function listScheduledPostsRetry(failure, retryAfterMs = 0) {
87
+ return retryCase(failure, retryAfterMs);
88
+ }
89
+ function listScheduledPostsListedDefault() {
90
+ const value = ScheduledPostsPageSchema.parse({ "nextCursor": "", "posts": [{ "id": "4138476039", "scheduledSendTime": "2026-11-15T14:00:00Z", "socialProfileId": "115185509", "state": "SCHEDULED" }] });
91
+ return branchCase("listed", value);
92
+ }
93
+ function listScheduledPostsDefault() {
94
+ return listScheduledPostsListedDefault();
95
+ }
96
+ function schedulePostScheduled(value, failure) {
97
+ return branchCase("scheduled", value, failure);
98
+ }
99
+ function schedulePostProviderRejected(value, failure) {
100
+ return branchCase("providerRejected", value, failure);
101
+ }
102
+ function schedulePostDefect(value, failure) {
103
+ return branchCase("defect", value, failure);
104
+ }
105
+ function schedulePostRetry(failure, retryAfterMs = 0) {
106
+ return retryCase(failure, retryAfterMs);
107
+ }
108
+ function schedulePostUncertain(value, failure) {
109
+ return uncertainCase(value, failure);
110
+ }
111
+ function schedulePostScheduledDefault() {
112
+ const value = ScheduledPostReceiptSchema.parse({ "id": "4138476039", "socialProfileId": "115185509", "state": "SCHEDULED" });
113
+ return branchCase("scheduled", value);
114
+ }
115
+ function schedulePostDefault() {
116
+ return schedulePostScheduledDefault();
117
+ }
118
+ var GeneratedMock = class {
119
+ #listSocialProfiles;
120
+ #listScheduledPosts;
121
+ #schedulePost;
122
+ #connection;
123
+ constructor(connectionName) {
124
+ this.#listSocialProfiles = newQuery(ListSocialProfilesDefinition).default(listSocialProfilesDefault());
125
+ this.#listScheduledPosts = newQuery(ListScheduledPostsDefinition).default(listScheduledPostsDefault());
126
+ this.#schedulePost = newMutation(SchedulePostDefinition).default(schedulePostDefault());
127
+ this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
128
+ }
129
+ connection() {
130
+ return this.#connection;
131
+ }
132
+ listSocialProfiles() {
133
+ return this.#listSocialProfiles;
134
+ }
135
+ listScheduledPosts() {
136
+ return this.#listScheduledPosts;
137
+ }
138
+ schedulePost() {
139
+ return this.#schedulePost;
140
+ }
141
+ assertNoFailures() {
142
+ this.#listSocialProfiles.assertNoFailures();
143
+ this.#listScheduledPosts.assertNoFailures();
144
+ this.#schedulePost.assertNoFailures();
145
+ }
146
+ };
147
+ export {
148
+ GeneratedMock,
149
+ GeneratedMock as Mock,
150
+ emptyListScheduledPostsInput,
151
+ emptyListSocialProfilesInput,
152
+ emptySchedulePostInput,
153
+ emptyScheduledPost,
154
+ emptyScheduledPostReceipt,
155
+ emptyScheduledPostsPage,
156
+ emptySocialProfile,
157
+ emptySocialProfilesPage,
158
+ listScheduledPostsDefault,
159
+ listScheduledPostsDefect,
160
+ listScheduledPostsInvalidResponse,
161
+ listScheduledPostsListed,
162
+ listScheduledPostsListedDefault,
163
+ listScheduledPostsProviderRejected,
164
+ listScheduledPostsRetry,
165
+ listSocialProfilesDefault,
166
+ listSocialProfilesDefect,
167
+ listSocialProfilesInvalidResponse,
168
+ listSocialProfilesListed,
169
+ listSocialProfilesListedDefault,
170
+ listSocialProfilesProviderRejected,
171
+ listSocialProfilesRetry,
172
+ schedulePostDefault,
173
+ schedulePostDefect,
174
+ schedulePostProviderRejected,
175
+ schedulePostRetry,
176
+ schedulePostScheduled,
177
+ schedulePostScheduledDefault,
178
+ schedulePostUncertain
179
+ };
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@superdurable/connector-hootsuite",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "description": "Hootsuite connector for Dex TypeScript applications",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/superdurable/dex-connectors-library.git",
9
+ "directory": "connectors/hootsuite/typescript"
10
+ },
11
+ "type": "module",
12
+ "engines": {
13
+ "node": "^22.0.0 || ^24.0.0"
14
+ },
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ },
22
+ "./mock": {
23
+ "types": "./dist/mock.d.ts",
24
+ "import": "./dist/mock.js"
25
+ },
26
+ "./dex-connector.json": "./dex-connector.json"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "README.md",
31
+ "LICENSE",
32
+ "dex-connector.json"
33
+ ],
34
+ "scripts": {
35
+ "prepack": "npm run build",
36
+ "build": "tsup src/index.ts src/mock.ts --format esm --dts --clean",
37
+ "typecheck": "tsc --noEmit",
38
+ "lint": "eslint src test examples",
39
+ "test": "vitest run --exclude 'test/integration/**'",
40
+ "test:integration": "vitest run test/integration/*.integration.test.ts",
41
+ "example:worker": "tsx examples/social-profiles/worker.ts",
42
+ "example:start": "tsx examples/social-profiles/start.ts",
43
+ "check": "npm run typecheck && npm run lint && npm test && npm run build"
44
+ },
45
+ "dependencies": {
46
+ "@superdurable/connectors-sdk": "0.7.0",
47
+ "@superdurable/dex": ">=1.28.0",
48
+ "zod": "^4.1.0"
49
+ },
50
+ "devDependencies": {
51
+ "@eslint/js": "^9.0.0",
52
+ "@types/node": "^22.0.0",
53
+ "eslint": "^9.0.0",
54
+ "tsup": "^8.0.0",
55
+ "tsx": "^4.23.15",
56
+ "typescript": "^5.9.0",
57
+ "typescript-eslint": "^8.0.0",
58
+ "vitest": "^3.0.0",
59
+ "yaml": "^2.9.1"
60
+ }
61
+ }