@zapier/zapier-sdk 0.84.3 → 0.85.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/index.mjs CHANGED
@@ -408,51 +408,36 @@ function decodeConcatCursor(incoming) {
408
408
  }
409
409
  return { index: 0, cursor: incoming };
410
410
  }
411
- function concatPaginated({
411
+ async function concatLists({
412
412
  sources,
413
413
  pageSize = 100,
414
414
  cursor
415
415
  }) {
416
416
  if (sources.length === 0) {
417
- const empty = { data: [] };
418
- return Object.assign(Promise.resolve(empty), {
419
- [Symbol.asyncIterator]: async function* () {
420
- yield empty;
421
- }
422
- });
417
+ return { data: [] };
423
418
  }
424
419
  const pageFunction = async (options) => {
425
- let { index, cursor: sourceCursor } = decodeConcatCursor(options.cursor);
420
+ let { index, cursor: listCursor } = decodeConcatCursor(options.cursor);
426
421
  while (index < sources.length) {
427
- const page = await sources[index]({ cursor: sourceCursor });
428
- const hasMoreInSource = page.nextCursor != null;
429
- if (page.data.length === 0 && !hasMoreInSource) {
422
+ const page = await sources[index]({ cursor: listCursor });
423
+ const hasMoreInList = page.nextCursor != null;
424
+ if (page.data.length === 0 && !hasMoreInList) {
430
425
  index++;
431
- sourceCursor = void 0;
426
+ listCursor = void 0;
432
427
  continue;
433
428
  }
434
429
  return {
435
430
  data: page.data,
436
- nextCursor: hasMoreInSource ? encodeConcatCursor(index, page.nextCursor) : index < sources.length - 1 ? encodeConcatCursor(index + 1, void 0) : void 0
431
+ nextCursor: hasMoreInList ? encodeConcatCursor(index, page.nextCursor) : index < sources.length - 1 ? encodeConcatCursor(index + 1, void 0) : void 0
437
432
  };
438
433
  }
439
434
  return { data: [] };
440
435
  };
441
- const iterator = paginateBuffered(pageFunction, { pageSize, cursor });
442
- const firstPagePromise = iterator.next().then((result) => {
443
- if (result.done) {
444
- return { data: [] };
445
- }
446
- return result.value;
447
- });
448
- return Object.assign(firstPagePromise, {
449
- [Symbol.asyncIterator]: async function* () {
450
- yield await firstPagePromise;
451
- for await (const page of { [Symbol.asyncIterator]: () => iterator }) {
452
- yield page;
453
- }
454
- }
455
- });
436
+ const result = await paginateBuffered(pageFunction, {
437
+ pageSize,
438
+ cursor
439
+ }).next();
440
+ return result.done ? { data: [] } : result.value;
456
441
  }
457
442
  var parseOrThrow = (schema, input, { adaptError } = {}) => {
458
443
  const result = schema.safeParse(input);
@@ -787,6 +772,13 @@ function createPaginatedFunction(coreFn, options) {
787
772
  [Symbol.asyncIterator]() {
788
773
  return pageStream;
789
774
  },
775
+ pages: function() {
776
+ return {
777
+ [Symbol.asyncIterator]() {
778
+ return pageStream;
779
+ }
780
+ };
781
+ },
790
782
  items: function() {
791
783
  return {
792
784
  [Symbol.asyncIterator]: async function* () {
@@ -5427,7 +5419,7 @@ function parseDeprecationDate(value) {
5427
5419
  }
5428
5420
 
5429
5421
  // src/sdk-version.ts
5430
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.3" : void 0) || "unknown";
5422
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.85.0" : void 0) || "unknown";
5431
5423
 
5432
5424
  // src/utils/open-url.ts
5433
5425
  var nodePrefix = "node:";
@@ -7004,6 +6996,7 @@ function transformConnectionItem(item) {
7004
6996
  is_private: item.is_private,
7005
6997
  shared_with_all: item.shared_with_all,
7006
6998
  title: item.title,
6999
+ slug: item.slug,
7007
7000
  lastchanged: item.lastchanged,
7008
7001
  is_stale: item.is_stale,
7009
7002
  is_shared: item.is_shared,
@@ -8575,13 +8568,13 @@ var tableIdResolver = defineResolver({
8575
8568
  listItems: ({ imports, context, cursor }) => {
8576
8569
  const includeShared = context?.includeShared;
8577
8570
  if (includeShared) {
8578
- return concatPaginated({
8571
+ return concatLists({
8579
8572
  sources: [
8580
- ({ cursor: sourceCursor }) => imports.listTablesInternal({ cursor: sourceCursor }),
8581
- ({ cursor: sourceCursor }) => imports.listTablesInternal({
8573
+ ({ cursor: listCursor }) => imports.listTablesInternal({ cursor: listCursor }),
8574
+ ({ cursor: listCursor }) => imports.listTablesInternal({
8582
8575
  includeShared: true,
8583
8576
  includePersonal: false,
8584
- cursor: sourceCursor
8577
+ cursor: listCursor
8585
8578
  })
8586
8579
  ],
8587
8580
  cursor
@@ -10658,6 +10651,11 @@ var ConnectionItemSchema = ConnectionItemSchema$1;
10658
10651
  // src/formatters/connection.ts
10659
10652
  function formatConnectionItem(item) {
10660
10653
  const details = [];
10654
+ const appKey = item.app_key ?? "unknown";
10655
+ details.push({
10656
+ text: item.slug ? `App: ${appKey} | App Slug: ${item.slug}` : `App: ${appKey}`,
10657
+ style: "accent"
10658
+ });
10661
10659
  if (item.identifier) {
10662
10660
  details.push({
10663
10661
  text: `Identifier: ${item.identifier}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.84.3",
3
+ "version": "0.85.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -87,7 +87,7 @@
87
87
  "dependencies": {
88
88
  "@zapier/policy-context": "1.2.2",
89
89
  "@zapier/policy-schema": "0.15.0",
90
- "@zapier/zapier-sdk-core": "0.12.0",
90
+ "@zapier/zapier-sdk-core": "0.15.1",
91
91
  "zod": "4.3.6"
92
92
  },
93
93
  "devDependencies": {
@@ -95,7 +95,7 @@
95
95
  "tsup": "^8.5.0",
96
96
  "typescript": "^5.8.3",
97
97
  "vitest": "^4.1.4",
98
- "@zapier/kitcore": "0.7.0"
98
+ "@zapier/kitcore": "0.8.0"
99
99
  },
100
100
  "scripts": {
101
101
  "build": "tsup",