diff --git a/.github/workflows/preview_sdks.yml b/.github/workflows/preview_sdks.yml index 1c52a11..84d055c 100644 --- a/.github/workflows/preview_sdks.yml +++ b/.github/workflows/preview_sdks.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v4 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 - name: Download Fern run: npm install -g fern-api @@ -24,14 +24,19 @@ jobs: run: | fern generate --group ts-sdk --preview --log-level debug + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + package_json_file: fern/.preview/fern-typescript-sdk/package.json + - name: Compile env: FERN_TOKEN: ${{ secrets.FERN_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cd fern/.preview/fern-typescript-node-sdk - yarn install - yarn build + cd fern/.preview/fern-typescript-sdk + pnpm install --frozen-lockfile + pnpm build preview-java: runs-on: ubuntu-latest @@ -60,3 +65,65 @@ jobs: run: | cd fern/.preview/fern-java-sdk ./gradlew assemble + + preview-python: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + + - name: Download Fern + run: npm install -g fern-api + + - name: Generate Preview + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + fern generate --group python-sdk --preview --log-level debug + + - name: Build + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + cd fern/.preview/fern-python-sdk + poetry install + poetry run mypy . + + preview-php: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + + - name: Download Fern + run: npm install -g fern-api + + - name: Generate Preview + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + fern generate --group php-sdk --preview --log-level debug + + - name: Build + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + cd fern/.preview/fern-php-sdk + composer install + composer build + composer analyze \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4ae2088..45e924f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ compiled/ # Fern preview files /fern/.preview +/fern/.definition \ No newline at end of file diff --git a/descriptions/2.14/api.intercom.io.yaml b/descriptions/2.14/api.intercom.io.yaml index 7a74041..8d1cf48 100644 --- a/descriptions/2.14/api.intercom.io.yaml +++ b/descriptions/2.14/api.intercom.io.yaml @@ -3400,7 +3400,7 @@ paths: required: true description: The unique identifier for the contact which is given by Intercom schema: - type: integer + type: string tags: - Companies - Contacts @@ -18687,7 +18687,7 @@ components: description: The data export api is used to view all message sent & viewed in a given timeframe. properties: - job_identfier: + job_identifier: type: string description: The identifier for your job. example: orzzsbd7hk67xyu diff --git a/fern/fern.config.json b/fern/fern.config.json index 15b79fd..13afb57 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "intercom", - "version": "0.70.1" -} \ No newline at end of file + "version": "3.0.2" +} diff --git a/fern/generators.yml b/fern/generators.yml index 98dd1c9..5a409ee 100644 --- a/fern/generators.yml +++ b/fern/generators.yml @@ -6,17 +6,33 @@ api: settings: title-as-schema-name: false inline-path-parameters: true + type-dates-as-strings: true + object-query-parameters: false + idiomatic-request-names: false + respect-nullable-schemas: false + wrap-references-to-nullable-in-optional: true + coerce-optional-schemas-to-nullable: true + coerce-enums-to-literals: true - openapi: ../descriptions/0/api.intercom.io.yaml overrides: ./unstable-openapi-overrides.yml namespace: unstable settings: title-as-schema-name: false inline-path-parameters: true + type-dates-as-strings: true + object-query-parameters: false + idiomatic-request-names: false + respect-nullable-schemas: false + wrap-references-to-nullable-in-optional: true + coerce-optional-schemas-to-nullable: true + coerce-enums-to-literals: true + settings: + path-parameter-order: spec-order groups: ts-sdk: generators: - - name: fernapi/fern-typescript-node-sdk - version: 0.51.7 + - name: fernapi/fern-typescript-sdk + version: 3.35.8 output: location: npm package-name: intercom-client @@ -46,7 +62,7 @@ groups: java-sdk: generators: - name: fernapi/fern-java-sdk - version: 2.37.0 + version: 3.21.0 output: location: maven coordinate: io.intercom:intercom-java @@ -64,11 +80,13 @@ groups: client-class-name: Intercom inline-path-parameters: true enable-forward-compatible-enums: true + enable-wire-tests: false + smart-casing: false python-sdk: generators: - name: fernapi/fern-python-sdk - version: 4.22.0 + version: 4.41.8 github: mode: pull-request repository: intercom/python-intercom @@ -80,11 +98,12 @@ groups: location: pypi package-name: 'python-intercom' token: ${FERN_PYPI_TOKEN} + smart-casing: false php-sdk: generators: - name: fernapi/fern-php-sdk - version: 1.16.7 + version: 1.25.0 github: mode: pull-request repository: intercom/intercom-php diff --git a/fern/openapi-overrides.yml b/fern/openapi-overrides.yml index 365d2d6..561c4cf 100644 --- a/fern/openapi-overrides.yml +++ b/fern/openapi-overrides.yml @@ -525,11 +525,58 @@ paths: - conversations x-fern-sdk-method-name: find x-fern-request-name: FindConversationRequest + # conversation_id is incorrectly typed as an integer in the spec, but is actually a string. + parameters: + - name: Intercom-Version + in: header + schema: + "$ref": "#/components/schemas/intercom_version" + - name: conversation_id + in: path + required: true + description: The id of the conversation to target + example: '123' + schema: + type: string + - name: display_as + in: query + required: false + description: Set to plaintext to retrieve conversation messages in plain text. + example: plaintext + schema: + type: string + - name: include_translations + in: query + required: false + description: If set to true, conversation parts will be translated to the detected language of the conversation. + example: true + schema: + type: boolean put: x-fern-sdk-group-name: - conversations x-fern-sdk-method-name: update x-fern-request-name: UpdateConversationRequest + # conversation_id is incorrectly typed as an integer in the spec, but is actually a string. + parameters: + - name: Intercom-Version + in: header + schema: + "$ref": "#/components/schemas/intercom_version" + - name: conversation_id + in: path + required: true + description: The id of the conversation to target + example: 123 + schema: + type: string + - name: display_as + in: query + required: false + description: Set to plaintext to retrieve conversation messages in plain text. + example: plaintext + schema: + type: string /conversations/{conversation_id}/reply: post: requestBody: @@ -558,6 +605,156 @@ paths: - conversations x-fern-sdk-method-name: runAssignmentRules x-fern-request-name: AutoAssignConversationRequest + summary: Run Assignment Rules on a conversation + parameters: + - name: Intercom-Version + in: header + schema: + "$ref": "#/components/schemas/intercom_version" + - name: conversation_id + in: path + required: true + description: The identifier for the conversation as given by Intercom. + example: '123' + schema: + type: string + tags: + - Conversations + operationId: autoAssignConversation + description: | + {% admonition type="danger" name="Deprecation of Run Assignment Rules" %} + Run assignment rules is now deprecated in version 2.12 and future versions and will be permanently removed on December 31, 2026. After this date, any requests made to this endpoint will fail. + {% /admonition %} + You can let a conversation be automatically assigned following assignment rules. + {% admonition type="warning" name="When using workflows" %} + It is not possible to use this endpoint with Workflows. + {% /admonition %} + responses: + '200': + description: Assign a conversation using assignment rules + content: + application/json: + examples: + Assign a conversation using assignment rules: + value: + type: conversation + id: '409' + created_at: 1719492880 + updated_at: 1719492881 + waiting_since: + snoozed_until: + source: + type: conversation + id: '403918285' + delivered_as: admin_initiated + subject: '' + body: "
this is the message body
" + author: + type: admin + id: '991267623' + name: Ciaran197 Lee + email: admin197@email.com + attachments: [] + url: + redacted: false + contacts: + type: contact.list + contacts: + - type: contact + id: 667d61108a68186f43bafe09 + external_id: '70' + first_contact_reply: + admin_assignee_id: + team_assignee_id: + open: false + state: closed + read: false + tags: + type: tag.list + tags: [] + priority: not_priority + sla_applied: + statistics: + conversation_rating: + teammates: + title: + custom_attributes: {} + topics: {} + ticket: + linked_objects: + type: list + data: [] + total_count: 0 + has_more: false + ai_agent: + ai_agent_participated: false + conversation_parts: + type: conversation_part.list + conversation_parts: + - type: conversation_part + id: '107' + part_type: default_assignment + body: + created_at: 1719492881 + updated_at: 1719492881 + notified_at: 1719492881 + assigned_to: + type: nobody_admin + id: + author: + id: '991267624' + type: bot + name: Operator + email: operator+this_is_an_id364_that_should_be_at_least_@intercom.io + attachments: [] + external_id: + redacted: false + total_count: 1 + schema: + "$ref": "#/components/schemas/conversation" + '404': + description: Not found + content: + application/json: + examples: + Not found: + value: + type: error.list + request_id: 9d88a5a7-6df9-42ff-b324-2387db7be984 + errors: + - code: not_found + message: Resource Not Found + schema: + "$ref": "#/components/schemas/error" + '401': + description: Unauthorized + content: + application/json: + examples: + Unauthorized: + value: + type: error.list + request_id: 8aeac960-c7fb-41f7-8cc9-cd3d62f6ff92 + errors: + - code: unauthorized + message: Access Token Invalid + schema: + "$ref": "#/components/schemas/error" + '403': + description: API plan restricted + content: + application/json: + examples: + API plan restricted: + value: + type: error.list + request_id: '037980c4-84cb-4d3a-ad64-66e4e563a275' + errors: + - code: api_plan_restricted + message: Active subscription needed. + schema: + "$ref": "#/components/schemas/error" + /conversations/{conversation_id}/customers: post: x-fern-sdk-group-name: @@ -1800,7 +1997,70 @@ components: - away_mode_reassign - has_inbox_seat - team_ids - # The spec incorrectly labels default_locale and translated_content as required + # The spec incorrectly labels default_locale, translated_content, and job_title as required + properties: + type: + type: string + description: String representing the object's type. Always has the value + `admin`. + example: admin + id: + type: string + description: The id representing the admin. + example: '1295' + name: + type: string + description: The name of the admin. + example: Joe Example + email: + type: string + description: The email of the admin. + example: jdoe@example.com + job_title: + type: string + description: The job title of the admin. + example: Associate + away_mode_enabled: + type: boolean + description: Identifies if this admin is currently set in away mode. + example: false + away_mode_reassign: + type: boolean + description: Identifies if this admin is set to automatically reassign new + conversations to the apps default inbox. + example: false + away_status_reason_id: + type: integer + nullable: true + description: The unique identifier of the away status reason + example: 12345 + has_inbox_seat: + type: boolean + description: Identifies if this admin has a paid inbox seat to restrict/allow + features that require them. + example: true + team_ids: + type: array + description: This object represents the avatar associated with the admin. + example: + - 814865 + items: + type: integer + # The spec incorrectly labels avatar as a string type, while server responses show it as an object. + avatar: + type: object + nullable: true + description: The avatar object associated with the admin + properties: + image_url: + type: string + format: uri + description: URL of the admin's avatar image + example: https://example.org/128Wash.jpg + required: + - image_url + team_priority_level: + "$ref": "#/components/schemas/team_priority_level" article_list_item: required: - id diff --git a/fern/unstable-openapi-overrides.yml b/fern/unstable-openapi-overrides.yml index 6192450..7e57f0a 100644 --- a/fern/unstable-openapi-overrides.yml +++ b/fern/unstable-openapi-overrides.yml @@ -136,6 +136,10 @@ paths: components: schemas: + intercom_version: + x-fern-ignore: true + intercom_version_unstable: + x-fern-ignore: true create_data_attribute_request: x-fern-type-name: CreateDataAttributeRequest update_data_attribute_request: