@superdurable/connector-jotform 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.
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "connectorId": "jotform",
3
- "releaseTag": "connectors/jotform/go/v0.1.0",
3
+ "releaseTag": "connectors/jotform/go/v0.2.0",
4
4
  "package": {
5
5
  "ecosystem": "npm",
6
6
  "name": "@superdurable/connector-jotform",
7
- "version": "0.1.0"
7
+ "version": "0.2.0"
8
8
  },
9
9
  "factories": [
10
10
  {
@@ -54,9 +54,6 @@
54
54
  "type": "integer"
55
55
  }
56
56
  },
57
- "required": [
58
- "offset"
59
- ],
60
57
  "type": "object"
61
58
  }
62
59
  },
@@ -18,7 +18,7 @@ function decodeCredentials(value) {
18
18
  return credentials;
19
19
  }
20
20
  var ListFormsInputSchema = z.strictObject({
21
- "offset": z.number().int(),
21
+ "offset": z.number().int().optional(),
22
22
  "limit": z.number().int().optional()
23
23
  });
24
24
  var FormMetadataSchema = z.strictObject({
@@ -28,7 +28,7 @@ type CredentialSource = CredentialProvider<Credentials>;
28
28
  /** ListFormsInput selects a zero-based page of at most 100 forms. */
29
29
  interface ListFormsInput {
30
30
  /** Offset is the zero-based form offset; zero starts the first page. */
31
- "offset": number;
31
+ "offset"?: number | undefined;
32
32
  /** Limit is the maximum form count; zero defaults to 20. */
33
33
  "limit"?: number | undefined;
34
34
  }
@@ -68,7 +68,7 @@ interface SubmissionMetadata {
68
68
  }
69
69
  /** Runtime validator for ListFormsInput. */
70
70
  declare const ListFormsInputSchema: z.ZodObject<{
71
- offset: z.ZodNumber;
71
+ offset: z.ZodOptional<z.ZodNumber>;
72
72
  limit: z.ZodOptional<z.ZodNumber>;
73
73
  }, z.core.$strict>;
74
74
  /** Runtime validator for FormMetadata. */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { G as GetSubmissionInput, S as SubmissionMetadata, C as Connection, L as ListFormsInput, F as FormsPage, O as Operations, a as Config, b as Credentials } from './connection-D-MiEsWp.js';
2
- export { c as ConfigSchema, d as CredentialSource, e as FormMetadata, f as FormMetadataSchema, g as FormsPageSchema, h as GetSubmissionInputSchema, i as ListFormsInputSchema, j as SubmissionMetadataSchema, k as decodeCredentials, n as newConnection, l as newConnectionWithOperations } from './connection-D-MiEsWp.js';
1
+ import { G as GetSubmissionInput, S as SubmissionMetadata, C as Connection, L as ListFormsInput, F as FormsPage, O as Operations, a as Config, b as Credentials } from './connection-IhwnNHil.js';
2
+ export { c as ConfigSchema, d as CredentialSource, e as FormMetadata, f as FormMetadataSchema, g as FormsPageSchema, h as GetSubmissionInputSchema, i as ListFormsInputSchema, j as SubmissionMetadataSchema, k as decodeCredentials, n as newConnection, l as newConnectionWithOperations } from './connection-IhwnNHil.js';
3
3
  import { QueryDefinition, QueryStepConfig, Query, QueryResult, QueryStep, CredentialProvider, Call, QueryAttempt, Failure } from '@superdurable/connectors-sdk';
4
4
  import { StepTarget } from '@superdurable/dex';
5
5
  import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  newConnection,
28
28
  newConnectionWithOperations,
29
29
  newProjectConnection
30
- } from "./chunk-ZKAGZX4P.js";
30
+ } from "./chunk-7W5UGRPC.js";
31
31
 
32
32
  // src/generated/steps.ts
33
33
  import { goToBranch, newQueryStep } from "@superdurable/connectors-sdk";
@@ -138,11 +138,12 @@ var ListFormsOperation = class {
138
138
  }
139
139
  /** Read one page or select a Go-compatible optional branch. */
140
140
  async invoke(call, input) {
141
- if (!input || !Number.isSafeInteger(input.offset) || input.offset < 0 || input.limit !== void 0 && (!Number.isSafeInteger(input.limit) || input.limit < 0 || input.limit > 100)) {
141
+ const offset = input?.offset ?? 0;
142
+ if (!input || !Number.isSafeInteger(offset) || offset < 0 || input.limit !== void 0 && (!Number.isSafeInteger(input.limit) || input.limit < 0 || input.limit > 100)) {
142
143
  return terminal("listForms", "defect", "VALIDATION", "offset or limit is invalid", emptyPage());
143
144
  }
144
145
  const limit = input.limit || 20;
145
- const path = `/user/forms?${new URLSearchParams({ offset: String(input.offset), limit: String(limit) })}`;
146
+ const path = `/user/forms?${new URLSearchParams({ offset: String(offset), limit: String(limit) })}`;
146
147
  const result = await this.client.exchange(call, "listForms", path, false);
147
148
  if (result.retry) return newQueryRetry(result.failure, result.retryAfterMs);
148
149
  if (result.failure) return newQueryBranch(result.branch, emptyPage(), {}, result.failure);
@@ -156,7 +157,7 @@ var ListFormsOperation = class {
156
157
  if (!isObject(item) || typeof item.id !== "string" || !numericID.test(item.id) || typeof item.title !== "string" || !item.title || item.status != null && typeof item.status !== "string") return invalid("listForms", emptyPage());
157
158
  forms.push({ id: item.id, title: item.title, status: item.status ?? "" });
158
159
  }
159
- return newQueryBranch("listed", { forms, offset: input.offset, limit });
160
+ return newQueryBranch("listed", { forms, offset, limit });
160
161
  }
161
162
  };
162
163
  var GetSubmissionOperation = class {
package/dist/mock.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { MockQuery, Case } from '@superdurable/connectors-sdk/connectormock';
2
2
  import { Failure } from '@superdurable/connectors-sdk';
3
- import { O as Operations, C as Connection, L as ListFormsInput, F as FormsPage, G as GetSubmissionInput, S as SubmissionMetadata, e as FormMetadata } from './connection-D-MiEsWp.js';
3
+ import { O as Operations, C as Connection, L as ListFormsInput, F as FormsPage, G as GetSubmissionInput, S as SubmissionMetadata, e as FormMetadata } from './connection-IhwnNHil.js';
4
4
  import 'zod';
5
5
 
6
6
  /** Go zero value for ListFormsInput in scripted cases. */
package/dist/mock.js CHANGED
@@ -8,13 +8,11 @@ import {
8
8
  ProviderID,
9
9
  SubmissionMetadataSchema,
10
10
  newConnectionWithOperations
11
- } from "./chunk-ZKAGZX4P.js";
11
+ } from "./chunk-7W5UGRPC.js";
12
12
 
13
13
  // src/generated/mock.ts
14
14
  import { branchCase, retryCase, newQuery } from "@superdurable/connectors-sdk/connectormock";
15
- var emptyListFormsInput = ListFormsInputSchema.parse({
16
- "offset": 0
17
- });
15
+ var emptyListFormsInput = ListFormsInputSchema.parse({});
18
16
  var emptyFormMetadata = FormMetadataSchema.parse({
19
17
  "id": "",
20
18
  "title": "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdurable/connector-jotform",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "description": "Jotform connector for Dex TypeScript applications",
6
6
  "repository": {