naystack 1.8.13 → 1.8.14

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.
@@ -247,11 +247,11 @@ var publisher = createPublisher({
247
247
  )
248
248
  });
249
249
  var mediaParams = (media) => ({
250
- media_type: media.type === "video" ? "VIDEO" : void 0,
251
- image_url: media.type === "image" ? media.url : void 0,
252
- video_url: media.type === "video" ? media.url : void 0,
250
+ media_type: media.type === "video" /* Video */ ? "VIDEO" : void 0,
251
+ image_url: media.type === "photo" /* Photo */ ? media.url : void 0,
252
+ video_url: media.type === "video" /* Video */ ? media.url : void 0,
253
253
  // Instagram accepts alt text on images only.
254
- alt_text: media.type === "image" ? media.altText : void 0
254
+ alt_text: media.type === "photo" /* Photo */ ? media.altText : void 0
255
255
  });
256
256
  var createInstagramPost = async (token, input) => {
257
257
  const media = [input.media].flat();
@@ -290,7 +290,7 @@ var createInstagramPost = async (token, input) => {
290
290
  input.wait
291
291
  );
292
292
  }
293
- if (first.type === "video") {
293
+ if (first.type === "video" /* Video */) {
294
294
  return publisher.publish(
295
295
  token,
296
296
  {
@@ -402,9 +402,9 @@ var publisher2 = createPublisher({
402
402
  )
403
403
  });
404
404
  var mediaParams2 = (media) => ({
405
- media_type: media ? media.type === "video" ? "VIDEO" : "IMAGE" : "TEXT",
406
- image_url: media?.type === "image" ? media.url : void 0,
407
- video_url: media?.type === "video" ? media.url : void 0,
405
+ media_type: media ? media.type === "video" /* Video */ ? "VIDEO" : "IMAGE" : "TEXT",
406
+ image_url: media?.type === "photo" /* Photo */ ? media.url : void 0,
407
+ video_url: media?.type === "video" /* Video */ ? media.url : void 0,
408
408
  alt_text: media?.altText
409
409
  });
410
410
  var createThreadsPost = async (token, input, replyToID) => {
@@ -3,7 +3,7 @@ export { createInstagramPost, sendInstagramMessage } from './instagram/setters.m
3
3
  export { InstagramConversation, InstagramMedia, InstagramMessage, InstagramPostInput, InstagramPostMedia, InstagramUser } from './instagram/types.mjs';
4
4
  export { setupInstagramWebhook } from './instagram/webhook.mjs';
5
5
  export { WaitForContainerOptions } from './meta/container.mjs';
6
- export { GraphError } from './meta/types.mjs';
6
+ export { GraphError, MetaMediaType } from './meta/types.mjs';
7
7
  export { getThread, getThreads, getThreadsReplies } from './threads/getters.mjs';
8
8
  export { createThread, createThreadsPost } from './threads/setters.mjs';
9
9
  export { ThreadsPost, ThreadsPostInput, ThreadsPostMedia } from './threads/types.mjs';
@@ -3,7 +3,7 @@ export { createInstagramPost, sendInstagramMessage } from './instagram/setters.j
3
3
  export { InstagramConversation, InstagramMedia, InstagramMessage, InstagramPostInput, InstagramPostMedia, InstagramUser } from './instagram/types.js';
4
4
  export { setupInstagramWebhook } from './instagram/webhook.js';
5
5
  export { WaitForContainerOptions } from './meta/container.js';
6
- export { GraphError } from './meta/types.js';
6
+ export { GraphError, MetaMediaType } from './meta/types.js';
7
7
  export { getThread, getThreads, getThreadsReplies } from './threads/getters.js';
8
8
  export { createThread, createThreadsPost } from './threads/setters.js';
9
9
  export { ThreadsPost, ThreadsPostInput, ThreadsPostMedia } from './threads/types.js';
@@ -205,11 +205,11 @@ var publisher = createPublisher({
205
205
  )
206
206
  });
207
207
  var mediaParams = (media) => ({
208
- media_type: media.type === "video" ? "VIDEO" : void 0,
209
- image_url: media.type === "image" ? media.url : void 0,
210
- video_url: media.type === "video" ? media.url : void 0,
208
+ media_type: media.type === "video" /* Video */ ? "VIDEO" : void 0,
209
+ image_url: media.type === "photo" /* Photo */ ? media.url : void 0,
210
+ video_url: media.type === "video" /* Video */ ? media.url : void 0,
211
211
  // Instagram accepts alt text on images only.
212
- alt_text: media.type === "image" ? media.altText : void 0
212
+ alt_text: media.type === "photo" /* Photo */ ? media.altText : void 0
213
213
  });
214
214
  var createInstagramPost = async (token, input) => {
215
215
  const media = [input.media].flat();
@@ -248,7 +248,7 @@ var createInstagramPost = async (token, input) => {
248
248
  input.wait
249
249
  );
250
250
  }
251
- if (first.type === "video") {
251
+ if (first.type === "video" /* Video */) {
252
252
  return publisher.publish(
253
253
  token,
254
254
  {
@@ -360,9 +360,9 @@ var publisher2 = createPublisher({
360
360
  )
361
361
  });
362
362
  var mediaParams2 = (media) => ({
363
- media_type: media ? media.type === "video" ? "VIDEO" : "IMAGE" : "TEXT",
364
- image_url: media?.type === "image" ? media.url : void 0,
365
- video_url: media?.type === "video" ? media.url : void 0,
363
+ media_type: media ? media.type === "video" /* Video */ ? "VIDEO" : "IMAGE" : "TEXT",
364
+ image_url: media?.type === "photo" /* Photo */ ? media.url : void 0,
365
+ video_url: media?.type === "video" /* Video */ ? media.url : void 0,
366
366
  alt_text: media?.altText
367
367
  });
368
368
  var createThreadsPost = async (token, input, replyToID) => {
@@ -145,11 +145,11 @@ var publisher = createPublisher({
145
145
  )
146
146
  });
147
147
  var mediaParams = (media) => ({
148
- media_type: media.type === "video" ? "VIDEO" : void 0,
149
- image_url: media.type === "image" ? media.url : void 0,
150
- video_url: media.type === "video" ? media.url : void 0,
148
+ media_type: media.type === "video" /* Video */ ? "VIDEO" : void 0,
149
+ image_url: media.type === "photo" /* Photo */ ? media.url : void 0,
150
+ video_url: media.type === "video" /* Video */ ? media.url : void 0,
151
151
  // Instagram accepts alt text on images only.
152
- alt_text: media.type === "image" ? media.altText : void 0
152
+ alt_text: media.type === "photo" /* Photo */ ? media.altText : void 0
153
153
  });
154
154
  var createInstagramPost = async (token, input) => {
155
155
  const media = [input.media].flat();
@@ -188,7 +188,7 @@ var createInstagramPost = async (token, input) => {
188
188
  input.wait
189
189
  );
190
190
  }
191
- if (first.type === "video") {
191
+ if (first.type === "video" /* Video */) {
192
192
  return publisher.publish(
193
193
  token,
194
194
  {
@@ -118,11 +118,11 @@ var publisher = createPublisher({
118
118
  )
119
119
  });
120
120
  var mediaParams = (media) => ({
121
- media_type: media.type === "video" ? "VIDEO" : void 0,
122
- image_url: media.type === "image" ? media.url : void 0,
123
- video_url: media.type === "video" ? media.url : void 0,
121
+ media_type: media.type === "video" /* Video */ ? "VIDEO" : void 0,
122
+ image_url: media.type === "photo" /* Photo */ ? media.url : void 0,
123
+ video_url: media.type === "video" /* Video */ ? media.url : void 0,
124
124
  // Instagram accepts alt text on images only.
125
- alt_text: media.type === "image" ? media.altText : void 0
125
+ alt_text: media.type === "photo" /* Photo */ ? media.altText : void 0
126
126
  });
127
127
  var createInstagramPost = async (token, input) => {
128
128
  const media = [input.media].flat();
@@ -161,7 +161,7 @@ var createInstagramPost = async (token, input) => {
161
161
  input.wait
162
162
  );
163
163
  }
164
- if (first.type === "video") {
164
+ if (first.type === "video" /* Video */) {
165
165
  return publisher.publish(
166
166
  token,
167
167
  {
@@ -1,5 +1,5 @@
1
1
  import { WaitForContainerOptions } from '../meta/container.mjs';
2
- import '../meta/types.mjs';
2
+ import { MetaMediaType } from '../meta/types.mjs';
3
3
 
4
4
  /**
5
5
  * Instagram Messaging API message shape.
@@ -98,7 +98,7 @@ type InstagramConversation = {
98
98
  */
99
99
  type InstagramPostMedia = {
100
100
  url: string;
101
- type: "image" | "video";
101
+ type: MetaMediaType;
102
102
  altText?: string;
103
103
  };
104
104
  /**
@@ -1,5 +1,5 @@
1
1
  import { WaitForContainerOptions } from '../meta/container.js';
2
- import '../meta/types.js';
2
+ import { MetaMediaType } from '../meta/types.js';
3
3
 
4
4
  /**
5
5
  * Instagram Messaging API message shape.
@@ -98,7 +98,7 @@ type InstagramConversation = {
98
98
  */
99
99
  type InstagramPostMedia = {
100
100
  url: string;
101
- type: "image" | "video";
101
+ type: MetaMediaType;
102
102
  altText?: string;
103
103
  };
104
104
  /**
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -15,4 +19,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
19
 
16
20
  // src/socials/meta/types.ts
17
21
  var types_exports = {};
22
+ __export(types_exports, {
23
+ MetaMediaType: () => MetaMediaType
24
+ });
18
25
  module.exports = __toCommonJS(types_exports);
26
+ var MetaMediaType = /* @__PURE__ */ ((MetaMediaType2) => {
27
+ MetaMediaType2["Photo"] = "photo";
28
+ MetaMediaType2["Video"] = "video";
29
+ return MetaMediaType2;
30
+ })(MetaMediaType || {});
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ MetaMediaType
34
+ });
@@ -43,5 +43,9 @@ type ContainerState = {
43
43
  status: ContainerStatus;
44
44
  error?: string;
45
45
  };
46
+ declare enum MetaMediaType {
47
+ Photo = "photo",
48
+ Video = "video"
49
+ }
46
50
 
47
- export type { ContainerState, ContainerStatus, GraphError, GraphParams };
51
+ export { type ContainerState, type ContainerStatus, type GraphError, type GraphParams, MetaMediaType };
@@ -43,5 +43,9 @@ type ContainerState = {
43
43
  status: ContainerStatus;
44
44
  error?: string;
45
45
  };
46
+ declare enum MetaMediaType {
47
+ Photo = "photo",
48
+ Video = "video"
49
+ }
46
50
 
47
- export type { ContainerState, ContainerStatus, GraphError, GraphParams };
51
+ export { type ContainerState, type ContainerStatus, type GraphError, type GraphParams, MetaMediaType };
@@ -0,0 +1,9 @@
1
+ // src/socials/meta/types.ts
2
+ var MetaMediaType = /* @__PURE__ */ ((MetaMediaType2) => {
3
+ MetaMediaType2["Photo"] = "photo";
4
+ MetaMediaType2["Video"] = "video";
5
+ return MetaMediaType2;
6
+ })(MetaMediaType || {});
7
+ export {
8
+ MetaMediaType
9
+ };
@@ -142,9 +142,9 @@ var publisher = createPublisher({
142
142
  )
143
143
  });
144
144
  var mediaParams = (media) => ({
145
- media_type: media ? media.type === "video" ? "VIDEO" : "IMAGE" : "TEXT",
146
- image_url: media?.type === "image" ? media.url : void 0,
147
- video_url: media?.type === "video" ? media.url : void 0,
145
+ media_type: media ? media.type === "video" /* Video */ ? "VIDEO" : "IMAGE" : "TEXT",
146
+ image_url: media?.type === "photo" /* Photo */ ? media.url : void 0,
147
+ video_url: media?.type === "video" /* Video */ ? media.url : void 0,
148
148
  alt_text: media?.altText
149
149
  });
150
150
  var createThreadsPost = async (token, input, replyToID) => {
@@ -115,9 +115,9 @@ var publisher = createPublisher({
115
115
  )
116
116
  });
117
117
  var mediaParams = (media) => ({
118
- media_type: media ? media.type === "video" ? "VIDEO" : "IMAGE" : "TEXT",
119
- image_url: media?.type === "image" ? media.url : void 0,
120
- video_url: media?.type === "video" ? media.url : void 0,
118
+ media_type: media ? media.type === "video" /* Video */ ? "VIDEO" : "IMAGE" : "TEXT",
119
+ image_url: media?.type === "photo" /* Photo */ ? media.url : void 0,
120
+ video_url: media?.type === "video" /* Video */ ? media.url : void 0,
121
121
  alt_text: media?.altText
122
122
  });
123
123
  var createThreadsPost = async (token, input, replyToID) => {
@@ -1,5 +1,5 @@
1
1
  import { WaitForContainerOptions } from '../meta/container.mjs';
2
- import '../meta/types.mjs';
2
+ import { MetaMediaType } from '../meta/types.mjs';
3
3
 
4
4
  /**
5
5
  * Threads post (single post or reply).
@@ -27,7 +27,7 @@ type ThreadsPost = {
27
27
  */
28
28
  type ThreadsPostMedia = {
29
29
  url: string;
30
- type: "image" | "video";
30
+ type: MetaMediaType;
31
31
  altText?: string;
32
32
  };
33
33
  /**
@@ -1,5 +1,5 @@
1
1
  import { WaitForContainerOptions } from '../meta/container.js';
2
- import '../meta/types.js';
2
+ import { MetaMediaType } from '../meta/types.js';
3
3
 
4
4
  /**
5
5
  * Threads post (single post or reply).
@@ -27,7 +27,7 @@ type ThreadsPost = {
27
27
  */
28
28
  type ThreadsPostMedia = {
29
29
  url: string;
30
- type: "image" | "video";
30
+ type: MetaMediaType;
31
31
  altText?: string;
32
32
  };
33
33
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.8.13",
3
+ "version": "1.8.14",
4
4
  "description": "A stack built with Next + GraphQL + S3 + Auth",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",