naystack 1.8.18 → 1.8.19

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.
@@ -727,21 +727,30 @@ function createPublisher(platform) {
727
727
  if (!containerID) return null;
728
728
  return platform.publish(token, containerID);
729
729
  },
730
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
730
+ /**
731
+ * Creates and awaits every carousel child **in parallel**, resolving to
732
+ * their ids in input order — or `null` if any failed.
733
+ *
734
+ * Parallel because each child is an independent create-then-poll and Meta
735
+ * spends ~5s accepting a single container, so ten sequential children cost
736
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
737
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
738
+ * order depends on.
739
+ */
731
740
  createChildren: async (token, items, wait, retry) => {
732
- const children = [];
733
- for (const item of items) {
734
- const childID = await createReady(
735
- token,
736
- { ...item, is_carousel_item: true },
737
- "carousel item",
738
- wait,
739
- retry
740
- );
741
- if (!childID) return null;
742
- children.push(childID);
743
- }
744
- return children;
741
+ const children = await Promise.all(
742
+ items.map(
743
+ (item) => createReady(
744
+ token,
745
+ { ...item, is_carousel_item: true },
746
+ "carousel item",
747
+ wait,
748
+ retry
749
+ )
750
+ )
751
+ );
752
+ const created = children.filter((childID) => childID !== null);
753
+ return created.length === children.length ? created : null;
745
754
  }
746
755
  };
747
756
  }
@@ -685,21 +685,30 @@ function createPublisher(platform) {
685
685
  if (!containerID) return null;
686
686
  return platform.publish(token, containerID);
687
687
  },
688
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
688
+ /**
689
+ * Creates and awaits every carousel child **in parallel**, resolving to
690
+ * their ids in input order — or `null` if any failed.
691
+ *
692
+ * Parallel because each child is an independent create-then-poll and Meta
693
+ * spends ~5s accepting a single container, so ten sequential children cost
694
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
695
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
696
+ * order depends on.
697
+ */
689
698
  createChildren: async (token, items, wait, retry) => {
690
- const children = [];
691
- for (const item of items) {
692
- const childID = await createReady(
693
- token,
694
- { ...item, is_carousel_item: true },
695
- "carousel item",
696
- wait,
697
- retry
698
- );
699
- if (!childID) return null;
700
- children.push(childID);
701
- }
702
- return children;
699
+ const children = await Promise.all(
700
+ items.map(
701
+ (item) => createReady(
702
+ token,
703
+ { ...item, is_carousel_item: true },
704
+ "carousel item",
705
+ wait,
706
+ retry
707
+ )
708
+ )
709
+ );
710
+ const created = children.filter((childID) => childID !== null);
711
+ return created.length === children.length ? created : null;
703
712
  }
704
713
  };
705
714
  }
@@ -250,21 +250,30 @@ function createPublisher(platform) {
250
250
  if (!containerID) return null;
251
251
  return platform.publish(token, containerID);
252
252
  },
253
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
253
+ /**
254
+ * Creates and awaits every carousel child **in parallel**, resolving to
255
+ * their ids in input order — or `null` if any failed.
256
+ *
257
+ * Parallel because each child is an independent create-then-poll and Meta
258
+ * spends ~5s accepting a single container, so ten sequential children cost
259
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
260
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
261
+ * order depends on.
262
+ */
254
263
  createChildren: async (token, items, wait, retry) => {
255
- const children = [];
256
- for (const item of items) {
257
- const childID = await createReady(
258
- token,
259
- { ...item, is_carousel_item: true },
260
- "carousel item",
261
- wait,
262
- retry
263
- );
264
- if (!childID) return null;
265
- children.push(childID);
266
- }
267
- return children;
264
+ const children = await Promise.all(
265
+ items.map(
266
+ (item) => createReady(
267
+ token,
268
+ { ...item, is_carousel_item: true },
269
+ "carousel item",
270
+ wait,
271
+ retry
272
+ )
273
+ )
274
+ );
275
+ const created = children.filter((childID) => childID !== null);
276
+ return created.length === children.length ? created : null;
268
277
  }
269
278
  };
270
279
  }
@@ -222,21 +222,30 @@ function createPublisher(platform) {
222
222
  if (!containerID) return null;
223
223
  return platform.publish(token, containerID);
224
224
  },
225
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
225
+ /**
226
+ * Creates and awaits every carousel child **in parallel**, resolving to
227
+ * their ids in input order — or `null` if any failed.
228
+ *
229
+ * Parallel because each child is an independent create-then-poll and Meta
230
+ * spends ~5s accepting a single container, so ten sequential children cost
231
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
232
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
233
+ * order depends on.
234
+ */
226
235
  createChildren: async (token, items, wait, retry) => {
227
- const children = [];
228
- for (const item of items) {
229
- const childID = await createReady(
230
- token,
231
- { ...item, is_carousel_item: true },
232
- "carousel item",
233
- wait,
234
- retry
235
- );
236
- if (!childID) return null;
237
- children.push(childID);
238
- }
239
- return children;
236
+ const children = await Promise.all(
237
+ items.map(
238
+ (item) => createReady(
239
+ token,
240
+ { ...item, is_carousel_item: true },
241
+ "carousel item",
242
+ wait,
243
+ retry
244
+ )
245
+ )
246
+ );
247
+ const created = children.filter((childID) => childID !== null);
248
+ return created.length === children.length ? created : null;
240
249
  }
241
250
  };
242
251
  }
@@ -239,21 +239,30 @@ function createPublisher(platform) {
239
239
  if (!containerID) return null;
240
240
  return platform.publish(token, containerID);
241
241
  },
242
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
242
+ /**
243
+ * Creates and awaits every carousel child **in parallel**, resolving to
244
+ * their ids in input order — or `null` if any failed.
245
+ *
246
+ * Parallel because each child is an independent create-then-poll and Meta
247
+ * spends ~5s accepting a single container, so ten sequential children cost
248
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
249
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
250
+ * order depends on.
251
+ */
243
252
  createChildren: async (token, items, wait, retry) => {
244
- const children = [];
245
- for (const item of items) {
246
- const childID = await createReady(
247
- token,
248
- { ...item, is_carousel_item: true },
249
- "carousel item",
250
- wait,
251
- retry
252
- );
253
- if (!childID) return null;
254
- children.push(childID);
255
- }
256
- return children;
253
+ const children = await Promise.all(
254
+ items.map(
255
+ (item) => createReady(
256
+ token,
257
+ { ...item, is_carousel_item: true },
258
+ "carousel item",
259
+ wait,
260
+ retry
261
+ )
262
+ )
263
+ );
264
+ const created = children.filter((childID) => childID !== null);
265
+ return created.length === children.length ? created : null;
257
266
  }
258
267
  };
259
268
  }
@@ -215,21 +215,30 @@ function createPublisher(platform) {
215
215
  if (!containerID) return null;
216
216
  return platform.publish(token, containerID);
217
217
  },
218
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
218
+ /**
219
+ * Creates and awaits every carousel child **in parallel**, resolving to
220
+ * their ids in input order — or `null` if any failed.
221
+ *
222
+ * Parallel because each child is an independent create-then-poll and Meta
223
+ * spends ~5s accepting a single container, so ten sequential children cost
224
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
225
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
226
+ * order depends on.
227
+ */
219
228
  createChildren: async (token, items, wait, retry) => {
220
- const children = [];
221
- for (const item of items) {
222
- const childID = await createReady(
223
- token,
224
- { ...item, is_carousel_item: true },
225
- "carousel item",
226
- wait,
227
- retry
228
- );
229
- if (!childID) return null;
230
- children.push(childID);
231
- }
232
- return children;
229
+ const children = await Promise.all(
230
+ items.map(
231
+ (item) => createReady(
232
+ token,
233
+ { ...item, is_carousel_item: true },
234
+ "carousel item",
235
+ wait,
236
+ retry
237
+ )
238
+ )
239
+ );
240
+ const created = children.filter((childID) => childID !== null);
241
+ return created.length === children.length ? created : null;
233
242
  }
234
243
  };
235
244
  }
@@ -235,21 +235,30 @@ function createPublisher(platform) {
235
235
  if (!containerID) return null;
236
236
  return platform.publish(token, containerID);
237
237
  },
238
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
238
+ /**
239
+ * Creates and awaits every carousel child **in parallel**, resolving to
240
+ * their ids in input order — or `null` if any failed.
241
+ *
242
+ * Parallel because each child is an independent create-then-poll and Meta
243
+ * spends ~5s accepting a single container, so ten sequential children cost
244
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
245
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
246
+ * order depends on.
247
+ */
239
248
  createChildren: async (token, items, wait, retry) => {
240
- const children = [];
241
- for (const item of items) {
242
- const childID = await createReady(
243
- token,
244
- { ...item, is_carousel_item: true },
245
- "carousel item",
246
- wait,
247
- retry
248
- );
249
- if (!childID) return null;
250
- children.push(childID);
251
- }
252
- return children;
249
+ const children = await Promise.all(
250
+ items.map(
251
+ (item) => createReady(
252
+ token,
253
+ { ...item, is_carousel_item: true },
254
+ "carousel item",
255
+ wait,
256
+ retry
257
+ )
258
+ )
259
+ );
260
+ const created = children.filter((childID) => childID !== null);
261
+ return created.length === children.length ? created : null;
253
262
  }
254
263
  };
255
264
  }
@@ -188,21 +188,30 @@ function createPublisher(platform) {
188
188
  if (!containerID) return null;
189
189
  return platform.publish(token, containerID);
190
190
  },
191
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
191
+ /**
192
+ * Creates and awaits every carousel child **in parallel**, resolving to
193
+ * their ids in input order — or `null` if any failed.
194
+ *
195
+ * Parallel because each child is an independent create-then-poll and Meta
196
+ * spends ~5s accepting a single container, so ten sequential children cost
197
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
198
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
199
+ * order depends on.
200
+ */
192
201
  createChildren: async (token, items, wait, retry) => {
193
- const children = [];
194
- for (const item of items) {
195
- const childID = await createReady(
196
- token,
197
- { ...item, is_carousel_item: true },
198
- "carousel item",
199
- wait,
200
- retry
201
- );
202
- if (!childID) return null;
203
- children.push(childID);
204
- }
205
- return children;
202
+ const children = await Promise.all(
203
+ items.map(
204
+ (item) => createReady(
205
+ token,
206
+ { ...item, is_carousel_item: true },
207
+ "carousel item",
208
+ wait,
209
+ retry
210
+ )
211
+ )
212
+ );
213
+ const created = children.filter((childID) => childID !== null);
214
+ return created.length === children.length ? created : null;
206
215
  }
207
216
  };
208
217
  }
@@ -129,21 +129,30 @@ function createPublisher(platform) {
129
129
  if (!containerID) return null;
130
130
  return platform.publish(token, containerID);
131
131
  },
132
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
132
+ /**
133
+ * Creates and awaits every carousel child **in parallel**, resolving to
134
+ * their ids in input order — or `null` if any failed.
135
+ *
136
+ * Parallel because each child is an independent create-then-poll and Meta
137
+ * spends ~5s accepting a single container, so ten sequential children cost
138
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
139
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
140
+ * order depends on.
141
+ */
133
142
  createChildren: async (token, items, wait, retry) => {
134
- const children = [];
135
- for (const item of items) {
136
- const childID = await createReady(
137
- token,
138
- { ...item, is_carousel_item: true },
139
- "carousel item",
140
- wait,
141
- retry
142
- );
143
- if (!childID) return null;
144
- children.push(childID);
145
- }
146
- return children;
143
+ const children = await Promise.all(
144
+ items.map(
145
+ (item) => createReady(
146
+ token,
147
+ { ...item, is_carousel_item: true },
148
+ "carousel item",
149
+ wait,
150
+ retry
151
+ )
152
+ )
153
+ );
154
+ const created = children.filter((childID) => childID !== null);
155
+ return created.length === children.length ? created : null;
147
156
  }
148
157
  };
149
158
  }
@@ -101,21 +101,30 @@ function createPublisher(platform) {
101
101
  if (!containerID) return null;
102
102
  return platform.publish(token, containerID);
103
103
  },
104
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
104
+ /**
105
+ * Creates and awaits every carousel child **in parallel**, resolving to
106
+ * their ids in input order — or `null` if any failed.
107
+ *
108
+ * Parallel because each child is an independent create-then-poll and Meta
109
+ * spends ~5s accepting a single container, so ten sequential children cost
110
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
111
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
112
+ * order depends on.
113
+ */
105
114
  createChildren: async (token, items, wait, retry) => {
106
- const children = [];
107
- for (const item of items) {
108
- const childID = await createReady(
109
- token,
110
- { ...item, is_carousel_item: true },
111
- "carousel item",
112
- wait,
113
- retry
114
- );
115
- if (!childID) return null;
116
- children.push(childID);
117
- }
118
- return children;
115
+ const children = await Promise.all(
116
+ items.map(
117
+ (item) => createReady(
118
+ token,
119
+ { ...item, is_carousel_item: true },
120
+ "carousel item",
121
+ wait,
122
+ retry
123
+ )
124
+ )
125
+ );
126
+ const created = children.filter((childID) => childID !== null);
127
+ return created.length === children.length ? created : null;
119
128
  }
120
129
  };
121
130
  }
@@ -80,21 +80,30 @@ function createPublisher(platform) {
80
80
  if (!containerID) return null;
81
81
  return platform.publish(token, containerID);
82
82
  },
83
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
83
+ /**
84
+ * Creates and awaits every carousel child **in parallel**, resolving to
85
+ * their ids in input order — or `null` if any failed.
86
+ *
87
+ * Parallel because each child is an independent create-then-poll and Meta
88
+ * spends ~5s accepting a single container, so ten sequential children cost
89
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
90
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
91
+ * order depends on.
92
+ */
84
93
  createChildren: async (token, items, wait, retry) => {
85
- const children = [];
86
- for (const item of items) {
87
- const childID = await createReady(
88
- token,
89
- { ...item, is_carousel_item: true },
90
- "carousel item",
91
- wait,
92
- retry
93
- );
94
- if (!childID) return null;
95
- children.push(childID);
96
- }
97
- return children;
94
+ const children = await Promise.all(
95
+ items.map(
96
+ (item) => createReady(
97
+ token,
98
+ { ...item, is_carousel_item: true },
99
+ "carousel item",
100
+ wait,
101
+ retry
102
+ )
103
+ )
104
+ );
105
+ const created = children.filter((childID) => childID !== null);
106
+ return created.length === children.length ? created : null;
98
107
  }
99
108
  };
100
109
  }
@@ -49,7 +49,16 @@ declare function createPublisher(platform: {
49
49
  }): {
50
50
  /** Creates a container, waits for it to finish processing, then publishes it. */
51
51
  publish: (token: string, params: GraphParams, wait?: WaitForContainerOptions, retry?: RetryOptions) => Promise<string | null>;
52
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
52
+ /**
53
+ * Creates and awaits every carousel child **in parallel**, resolving to
54
+ * their ids in input order — or `null` if any failed.
55
+ *
56
+ * Parallel because each child is an independent create-then-poll and Meta
57
+ * spends ~5s accepting a single container, so ten sequential children cost
58
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
59
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
60
+ * order depends on.
61
+ */
53
62
  createChildren: (token: string, items: GraphParams[], wait?: WaitForContainerOptions, retry?: RetryOptions) => Promise<string[] | null>;
54
63
  };
55
64
 
@@ -49,7 +49,16 @@ declare function createPublisher(platform: {
49
49
  }): {
50
50
  /** Creates a container, waits for it to finish processing, then publishes it. */
51
51
  publish: (token: string, params: GraphParams, wait?: WaitForContainerOptions, retry?: RetryOptions) => Promise<string | null>;
52
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
52
+ /**
53
+ * Creates and awaits every carousel child **in parallel**, resolving to
54
+ * their ids in input order — or `null` if any failed.
55
+ *
56
+ * Parallel because each child is an independent create-then-poll and Meta
57
+ * spends ~5s accepting a single container, so ten sequential children cost
58
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
59
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
60
+ * order depends on.
61
+ */
53
62
  createChildren: (token: string, items: GraphParams[], wait?: WaitForContainerOptions, retry?: RetryOptions) => Promise<string[] | null>;
54
63
  };
55
64
 
@@ -56,21 +56,30 @@ function createPublisher(platform) {
56
56
  if (!containerID) return null;
57
57
  return platform.publish(token, containerID);
58
58
  },
59
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
59
+ /**
60
+ * Creates and awaits every carousel child **in parallel**, resolving to
61
+ * their ids in input order — or `null` if any failed.
62
+ *
63
+ * Parallel because each child is an independent create-then-poll and Meta
64
+ * spends ~5s accepting a single container, so ten sequential children cost
65
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
66
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
67
+ * order depends on.
68
+ */
60
69
  createChildren: async (token, items, wait, retry) => {
61
- const children = [];
62
- for (const item of items) {
63
- const childID = await createReady(
64
- token,
65
- { ...item, is_carousel_item: true },
66
- "carousel item",
67
- wait,
68
- retry
69
- );
70
- if (!childID) return null;
71
- children.push(childID);
72
- }
73
- return children;
70
+ const children = await Promise.all(
71
+ items.map(
72
+ (item) => createReady(
73
+ token,
74
+ { ...item, is_carousel_item: true },
75
+ "carousel item",
76
+ wait,
77
+ retry
78
+ )
79
+ )
80
+ );
81
+ const created = children.filter((childID) => childID !== null);
82
+ return created.length === children.length ? created : null;
74
83
  }
75
84
  };
76
85
  }
@@ -83,21 +83,30 @@ function createPublisher(platform) {
83
83
  if (!containerID) return null;
84
84
  return platform.publish(token, containerID);
85
85
  },
86
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
86
+ /**
87
+ * Creates and awaits every carousel child **in parallel**, resolving to
88
+ * their ids in input order — or `null` if any failed.
89
+ *
90
+ * Parallel because each child is an independent create-then-poll and Meta
91
+ * spends ~5s accepting a single container, so ten sequential children cost
92
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
93
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
94
+ * order depends on.
95
+ */
87
96
  createChildren: async (token, items, wait, retry) => {
88
- const children = [];
89
- for (const item of items) {
90
- const childID = await createReady(
91
- token,
92
- { ...item, is_carousel_item: true },
93
- "carousel item",
94
- wait,
95
- retry
96
- );
97
- if (!childID) return null;
98
- children.push(childID);
99
- }
100
- return children;
97
+ const children = await Promise.all(
98
+ items.map(
99
+ (item) => createReady(
100
+ token,
101
+ { ...item, is_carousel_item: true },
102
+ "carousel item",
103
+ wait,
104
+ retry
105
+ )
106
+ )
107
+ );
108
+ const created = children.filter((childID) => childID !== null);
109
+ return created.length === children.length ? created : null;
101
110
  }
102
111
  };
103
112
  }
@@ -56,21 +56,30 @@ function createPublisher(platform) {
56
56
  if (!containerID) return null;
57
57
  return platform.publish(token, containerID);
58
58
  },
59
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
59
+ /**
60
+ * Creates and awaits every carousel child **in parallel**, resolving to
61
+ * their ids in input order — or `null` if any failed.
62
+ *
63
+ * Parallel because each child is an independent create-then-poll and Meta
64
+ * spends ~5s accepting a single container, so ten sequential children cost
65
+ * ~50s of mostly waiting — past what a serverless caller can fit in its
66
+ * timeout. `Promise.all` preserves input order, which the carousel's slide
67
+ * order depends on.
68
+ */
60
69
  createChildren: async (token, items, wait, retry) => {
61
- const children = [];
62
- for (const item of items) {
63
- const childID = await createReady(
64
- token,
65
- { ...item, is_carousel_item: true },
66
- "carousel item",
67
- wait,
68
- retry
69
- );
70
- if (!childID) return null;
71
- children.push(childID);
72
- }
73
- return children;
70
+ const children = await Promise.all(
71
+ items.map(
72
+ (item) => createReady(
73
+ token,
74
+ { ...item, is_carousel_item: true },
75
+ "carousel item",
76
+ wait,
77
+ retry
78
+ )
79
+ )
80
+ );
81
+ const created = children.filter((childID) => childID !== null);
82
+ return created.length === children.length ? created : null;
74
83
  }
75
84
  };
76
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.8.18",
3
+ "version": "1.8.19",
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",