diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..cec8d2b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,58 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + SEMVER_TYPE: + description: 'Semver type' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + +jobs: + publish-npm: + environment: Public NPM registry + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@v6 + with: + ssh-key: ${{ secrets.DEPLOY_KEY }} + - name: Check if on main branch + run: | + if [[ $GITHUB_REF != 'refs/heads/main' ]]; then + echo "This workflow must run on the 'main' branch." + exit 1 + fi + - uses: actions/setup-node@v6 + with: + node-version: 'lts/*' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + scope: '@workfront' + - run: npm ci --no-fund --no-audit + - name: Bump package version + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + echo "Bumping version as ${{ github.event.inputs.SEMVER_TYPE }}" + npm version --no-commit-hooks ${{ github.event.inputs.SEMVER_TYPE }} + git push origin main --follow-tags + - name: Publish to NPM + run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Draft release + run: | + VERSION=$(node -p "require('./package.json').version") + gh release create v$VERSION --generate-notes --draft --verify-tag --fail-on-no-commits + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ inputs.next_version }} diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..5dcb48a --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,24 @@ +name: Verify + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: lts/* + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + scope: '@workfront' + - run: npm ci --no-fund --no-audit + - run: npm run build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a2f00b1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: node_js - -sudo: false - -notifications: - email: - on_failure: always - on_success: change - -node_js: - - "lts/*" - - "8" - - "6" diff --git a/README.md b/README.md index 8d9c4d3..d2c9bb0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# workfront-objcodes +# @workfront/objcodes -[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![Apache v2 License][license-image]][license-url] [![Build Status][travis-image]][travis-url] +[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![Apache v2 License][license-image]][license-url] Definitions for object codes to be used with Workfront API @@ -20,14 +20,14 @@ The code inside `dist/objcodes.js` is in ES5, so you don't need transpilers to u ### Examples ```javascript -import {Baseline} from 'workfront-objcodes' +import {Baseline} from '@workfront/objcodes' // output 'BLIN' console.log(Baseline) ``` ```javascript -import * as ObjCodes from 'workfront-objcodes' +import * as ObjCodes from '@workfront/objcodes' // outputs 'BLIN' console.log(ObjCodes.Baseline) @@ -35,7 +35,7 @@ console.log(ObjCodes.Baseline) ```typescript // TypeScript type definitions are bundled -import {TObjCode, OpTask} from 'workfront-objcodes' +import {TObjCode, OpTask} from '@workfront/objcodes' // TS2322: Type '"FOO"' is not assignable to type 'TObjCode' const myObjCode: TObjCode = 'FOO' @@ -65,9 +65,6 @@ See the top-level file `LICENSE` and [license-image]: http://img.shields.io/badge/license-APv2-blue.svg?style=flat [license-url]: LICENSE -[npm-url]: https://www.npmjs.org/package/workfront-objcodes -[npm-version-image]: https://img.shields.io/npm/v/workfront-objcodes.svg?style=flat -[npm-downloads-image]: https://img.shields.io/npm/dm/workfront-objcodes.svg?style=flat - -[travis-url]: https://travis-ci.org/Workfront/workfront-objcodes -[travis-image]: https://img.shields.io/travis/Workfront/workfront-objcodes.svg?style=flat +[npm-url]: https://www.npmjs.org/package/@workfront/objcodes +[npm-version-image]: https://img.shields.io/npm/v/@workfront/objcodes.svg?style=flat +[npm-downloads-image]: https://img.shields.io/npm/dm/@workfront/objcodes.svg?style=flat diff --git a/package-lock.json b/package-lock.json index 35764a3..3e1d101 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,24 @@ { - "name": "workfront-objcodes", - "version": "1.27.0", + "name": "@workfront/objcodes", + "version": "2.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "workfront-objcodes", - "version": "1.27.0", + "name": "@workfront/objcodes", + "version": "2.6.0", "license": "Apache-2.0", "devDependencies": { - "typescript": "5.8.2" + "typescript": "5.9.3" }, "engines": { "node": ">=8" } }, "node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 4997cf9..cbdba2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "workfront-objcodes", - "version": "1.27.0", + "name": "@workfront/objcodes", + "version": "2.6.0", "description": "Definitions for all constants which can be used to interact with Workfront API", "main": "dist/umd/objcodes.js", "module": "dist/objcodes.js", @@ -12,7 +12,7 @@ ], "sideEffects": false, "devDependencies": { - "typescript": "5.8.2" + "typescript": "5.9.3" }, "scripts": { "prepublishOnly": "npm run build", @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/Workfront/workfront-objcodes.git" + "url": "git+https://github.com/Workfront/workfront-objcodes.git" }, "keywords": [ "Workfront", diff --git a/src/objcodes.ts b/src/objcodes.ts index fbdae8d..dcd3970 100644 --- a/src/objcodes.ts +++ b/src/objcodes.ts @@ -117,6 +117,7 @@ export const ExternalSection = 'EXTSEC' as const export const Favorite = 'FVRITE' as const export const Feature = 'FEATR' as const export const FinancialData = 'FINDAT' as const +export const FormulaConstant = 'FCONST' as const export const Goal = 'GOAL' as const export const Group = 'GROUP' as const export const Hour = 'HOUR' as const @@ -154,6 +155,7 @@ export const OpTask = 'OPTASK' as const export const OpTaskBack = 'OPTASKBACK' as const export const Parameter = 'PARAM' as const export const ParameterDescriptiveText = 'PRMDTX' as const +export const ParameterFilter = "PARMFT" as const export const ParameterGroup = 'PGRP' as const export const ParameterOption = 'POPT' as const export const ParameterValue = 'PVAL' as const @@ -179,6 +181,7 @@ export const QueueTopic = 'QUET' as const export const QueueTopicGroup = 'QUETGP' as const export const Rate = 'RATE' as const export const RateCard = 'RTCRD' as const +export const RateAttributes = 'RTATTR' as const export const Recent = 'RECENT' as const export const RecentMenuItem = 'RECENTMENUITEM' as const export const RecentUpdate = 'RUPDTE' as const @@ -217,9 +220,11 @@ export const SecurityAncestor = 'SECANC' as const export const Sequence = 'SEQ' as const export const SharingSettings = 'SHRSET' as const export const StaffingPlan = 'STAFFP' as const +export const StaffingPlanTemplate = "SPTMPL" as const export const StepApprover = 'SPAPVR' as const export const Task = 'TASK' as const export const TaskBack = 'TASKBACK' as const +export const TaskDef = 'TSKDEF' as const export const Team = 'TEAMOB' as const export const TeamMember = 'TEAMMB' as const export const TeamMemberRole = 'TEAMMR' as const @@ -236,6 +241,7 @@ export const TimesheetProfile = 'TSPRO' as const export const TimesheetTemplate = 'TSHTMP' as const export const UIFilter = 'UIFT' as const export const UIGroupBy = 'UIGB' as const +export const UIGView = 'UIGVW' as const export const UITemplate = 'UITMPL' as const export const UIView = 'UIVW' as const export const Update = 'UPDATE' as const @@ -268,6 +274,7 @@ export type TObjCode = | typeof Acknowledgement | typeof Activity | typeof AgileColumn + | typeof AgileColumnField | typeof AgileView | typeof Announcement | typeof AnnouncementAttachment @@ -358,6 +365,7 @@ export type TObjCode = | typeof Favorite | typeof Feature | typeof FinancialData + | typeof FormulaConstant | typeof Group | typeof Goal | typeof Hour @@ -392,8 +400,10 @@ export type TObjCode = | typeof NotificationRecord | typeof ObjectCategory | typeof OpTask + | typeof OpTaskBack | typeof Parameter | typeof ParameterDescriptiveText + | typeof ParameterFilter | typeof ParameterGroup | typeof ParameterOption | typeof ParameterValue @@ -419,6 +429,7 @@ export type TObjCode = | typeof QueueTopicGroup | typeof Rate | typeof RateCard + | typeof RateAttributes | typeof Recent | typeof RecentMenuItem | typeof RecentUpdate @@ -457,8 +468,11 @@ export type TObjCode = | typeof Sequence | typeof SharingSettings | typeof StaffingPlan + | typeof StaffingPlanTemplate | typeof StepApprover | typeof Task + | typeof TaskBack + | typeof TaskDef | typeof Team | typeof TeamMember | typeof TeamMemberRole @@ -475,6 +489,7 @@ export type TObjCode = | typeof TimesheetTemplate | typeof UIFilter | typeof UIGroupBy + | typeof UIGView | typeof UITemplate | typeof UIView | typeof Update