From ed70d3b9734043b5f2cb23a4188fac7b0cba5411 Mon Sep 17 00:00:00 2001 From: Patrick Thornton Date: Wed, 12 Mar 2025 12:01:21 -0400 Subject: [PATCH 1/9] custom_attributes schema revert version --- fern/fern.config.json | 2 +- fern/openapi-overrides.yml | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fern/fern.config.json b/fern/fern.config.json index 125dea6..4ba539d 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "intercom", "version": "0.46.20" -} \ No newline at end of file +} diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index 562b8be..5652b4c 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -1370,11 +1370,10 @@ components: required: - user_id merge_contacts_request: - properties: - from: - x-fern-property-name: lead_id - into: - x-fern-property-name: contact_id + custom_attributes: + title: Custom atttributes + type: object + description: Custom data set for this data. securitySchemes: bearerAuth: x-fern-bearer: From a8d2f04764ca0907c4c769d627a1d8fa1f8cfc57 Mon Sep 17 00:00:00 2001 From: Patrick Thornton Date: Wed, 12 Mar 2025 15:18:06 -0400 Subject: [PATCH 2/9] rename teammates.teammates to teammates.admins --- fern/openapi-overrides.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index 5652b4c..c1bcafb 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -1374,6 +1374,18 @@ components: title: Custom atttributes type: object description: Custom data set for this data. + conversation_teammates: + properties: + teammates: null + admins: + type: array + description: The list of teammates who participated in the conversation + (wrote at least one conversation part). + items: + "$ref": "#/components/schemas/reference" + required: + - type + - admins securitySchemes: bearerAuth: x-fern-bearer: From e108da98830542c53c12f3abb723b789dcacf19a Mon Sep 17 00:00:00 2001 From: Patrick Thornton Date: Wed, 12 Mar 2025 15:22:10 -0400 Subject: [PATCH 3/9] restore dropped properties --- fern/openapi-overrides.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index c1bcafb..d4ee7a5 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -1370,6 +1370,11 @@ components: required: - user_id merge_contacts_request: + properties: + from: + x-fern-property-name: lead_id + into: + x-fern-property-name: contact_id custom_attributes: title: Custom atttributes type: object From c70254c8a902a679b0457b325e7a861e1a8cb986 Mon Sep 17 00:00:00 2001 From: Patrick Thornton Date: Wed, 12 Mar 2025 15:36:52 -0400 Subject: [PATCH 4/9] add preview sdks github action --- .github/workflows/preview_sdks.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/preview_sdks.yml diff --git a/.github/workflows/preview_sdks.yml b/.github/workflows/preview_sdks.yml new file mode 100644 index 0000000..a79e9fd --- /dev/null +++ b/.github/workflows/preview_sdks.yml @@ -0,0 +1,33 @@ +name: Preview SDKs + +on: + pull_request: + paths: + - 'fern/**' + +jobs: + preview-typescript: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v3 + + - name: Download Fern + run: npm install -g fern-api + + - name: Generate Preview + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + fern generate --group ts-sdk --preview --log-level debug + + - name: Compile + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + cd fern/.preview/fern-typescript-node-sdk + yarn install + yarn build From e820ed970212883a0ea7ad564e06dee6bc8addab Mon Sep 17 00:00:00 2001 From: Patrick Thornton Date: Wed, 12 Mar 2025 16:21:40 -0400 Subject: [PATCH 5/9] adding github token try github token directly --- .github/workflows/preview_sdks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/preview_sdks.yml b/.github/workflows/preview_sdks.yml index a79e9fd..51ef494 100644 --- a/.github/workflows/preview_sdks.yml +++ b/.github/workflows/preview_sdks.yml @@ -27,6 +27,7 @@ jobs: - name: Compile env: FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd fern/.preview/fern-typescript-node-sdk yarn install From 85306acdb51adc4f7a9d01106d32f21883ba5cb0 Mon Sep 17 00:00:00 2001 From: patrickthornton Date: Wed, 12 Mar 2025 16:52:07 -0400 Subject: [PATCH 6/9] separate out teammates PR --- fern/openapi-overrides.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index d4ee7a5..06d7b8a 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -1379,18 +1379,6 @@ components: title: Custom atttributes type: object description: Custom data set for this data. - conversation_teammates: - properties: - teammates: null - admins: - type: array - description: The list of teammates who participated in the conversation - (wrote at least one conversation part). - items: - "$ref": "#/components/schemas/reference" - required: - - type - - admins securitySchemes: bearerAuth: x-fern-bearer: From ab190234e0c47efd3557432442b9844f43d94c48 Mon Sep 17 00:00:00 2001 From: patrick thornton Date: Wed, 12 Mar 2025 17:30:25 -0400 Subject: [PATCH 7/9] adding enums wherever possible --- fern/openapi-overrides.yml | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index 06d7b8a..62f645d 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -1379,6 +1379,71 @@ components: title: Custom atttributes type: object description: Custom data set for this data. + + # enum additions + contact: + properties: + type: + enum: + - contact + avatar: + properties: + type: + enum: + - avatar + conversation_teammates: + properties: + type: + enum: + - admin.list + create_article_request: + properties: + parent_type: + enum: + - collection + - section + error: + properties: + type: + enum: + - error.list + social_profile: + properties: + type: + enum: + - social_profile + subscription_type: + properties: + type: + enum: + - subscription + tag: + properties: + type: + enum: + - tag + ticket_type_attribute: + properties: + data_type: + enum: + - string + - list + - integer + - decimal + - boolean + - datetime + - files + update_article_request_body: + properties: + parent_type: + enum: + - collection + - section + visitor: + properties: + type: + enum: + - visitor securitySchemes: bearerAuth: x-fern-bearer: From 0718fcea51220ae2412d57ad87e012df45a36706 Mon Sep 17 00:00:00 2001 From: patrick thornton Date: Wed, 12 Mar 2025 19:40:29 -0400 Subject: [PATCH 8/9] operator/value combined to filter discriminated union using oneOf adds strict typechecks for single filter queries --- fern/openapi-overrides.yml | 97 ++++++++++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 8 deletions(-) diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index cf44bf2..31aa14c 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -787,21 +787,76 @@ components: intercom_version: x-fern-ignore: true single_filter_search_request: + properties: + operator: null + value: null + filter: + description: Filter with operator determining the valid value type + type: object + oneOf: + - "$ref": '#/components/schemas/equality_filter' + - "$ref": '#/components/schemas/collection_filter' + - "$ref": '#/components/schemas/string_filter' + - "$ref": '#/components/schemas/comparison_filter' + + # equality operators (=, !=) can work with strings or integers + equality_filter: + type: object properties: operator: + type: string + enum: + - "=" + - "!=" x-fern-enum: "=": name: Equals "!=": name: NotEquals + value: + oneOf: + - type: string + - type: integer + required: + - operator + - value + + # collection operators (IN, NIN) require arrays + collection_filter: + type: object + properties: + operator: + type: string + enum: + - IN + - NIN + x-fern-enum: IN: name: In NIN: name: NotIn - "<": - name: LessThan - ">": - name: GreaterThan + value: + type: array + items: + oneOf: + - type: string + - type: integer + required: + - operator + - value + + # string matching operators (~, !~, ^, $) require string values + string_filter: + type: object + properties: + operator: + type: string + enum: + - "~" + - "!~" + - "^" + - "$" + x-fern-enum: "~": name: Contains "!~": @@ -810,6 +865,34 @@ components: name: StartsWith "$": name: EndsWith + value: + type: string + required: + - operator + - value + + # comparison operators (<, >) work with integers or strings (dates) + comparison_filter: + type: object + properties: + operator: + type: string + enum: + - "<" + - ">" + x-fern-enum: + "<": + name: LessThan + ">": + name: GreaterThan + value: + oneOf: + - type: string + - type: integer + required: + - operator + - value + create_contact_request: properties: null anyOf: @@ -1436,6 +1519,8 @@ components: - section visitor: properties: + custom_attributes: + additionalProperties: true type: enum: - visitor @@ -1466,10 +1551,6 @@ components: properties: custom_attributes: additionalProperties: true - visitor: - properties: - custom_attributes: - additionalProperties: true securitySchemes: bearerAuth: From e088355ba1177bc7ebfac2a636a320a405da4cf5 Mon Sep 17 00:00:00 2001 From: patrick thornton Date: Wed, 12 Mar 2025 19:49:00 -0400 Subject: [PATCH 9/9] change equality to work for any type --- fern/openapi-overrides.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index 75caa1d..7d7e0bf 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -799,7 +799,7 @@ components: - "$ref": '#/components/schemas/string_filter' - "$ref": '#/components/schemas/comparison_filter' - # equality operators (=, !=) can work with strings or integers + # equality operators (=, !=) can work with any type equality_filter: type: object properties: @@ -817,6 +817,11 @@ components: oneOf: - type: string - type: integer + - type: array + items: + oneOf: + - type: string + - type: integer required: - operator - value