0.28.0 • Published 6 months ago

@trendhim/data-plans v0.28.0

Weekly downloads
53
License
-
Repository
-
Last release
6 months ago

Data Plans

Source of truth for Trendhim's data plans. Helps generate data-plans for mparticle, and typescript definitions for nodejs projects.

For more information about how mParticle uses data-plans to ensure data consistency, click here.

Folder structure

src
├── data-plans.ts             defines active data-plans
└── example-data-plan
    ├── event-type
    │   ├── base.ts           attribute definitions applied to all events of event-type
    │   ├── index.ts          defines active events of event-type
    │   └── example_event.ts  attribute definitions applied to example-event
    ├── base.ts               attribute definitions applied to all events
    ├── index.ts              exports properties matching the DataPlanExport interface mentioned below
    ├── user_attributes.ts    attribute definitions for user attributes (optional)
    ├── v1.ts                 event definition for data-plan version 1
    └── vX.ts                 event definition for data-plan version X (optional)

Creating a new data plan

Create a new directory in src with the name of the data-plan being the directory name.

Create src/<data-plan>/index.ts and ensure it exports the DataPlanExport interface. Add an import for your new data-plan in src/data-plans.ts, and to the default export.

Data plan events

Data plans support multiple versions of the same plan, and we intend to always introduce a new version, if we make a breaking change to a given data-plan. A breaking change can be, but is not limited to; removing attributes, changing attribute types, or adding new required attributes.

Create event

Add a new file to the relevant event-type-folder, and name it the same as your event. Ensure it imports and re-exports the base attributes of the event-type, as seen in the folder structure. Add an import for your new event in src/<data-plan>/<event-type>/index.ts, and re-export it accordingly.

Publish

mparticle

  1. Ensure you have configured your environment variables either directly, or through a .env-file. Needed variables: MPARTICLE_CLIENT_ID, MPARTICLE_CLIENT_SECRET and MPARTICLE_WORKSPACE_ID.
  2. Run npm run publish:data-plans

npm

  1. Bump the version in package.json
  2. Run npm publish --access public
0.28.0

6 months ago

0.27.0

7 months ago

0.26.0

7 months ago

0.25.0

8 months ago

0.24.0

9 months ago

0.23.0

10 months ago

0.21.0

1 year ago

0.20.0

1 year ago

0.19.0

1 year ago

0.17.0

2 years ago

0.18.0

1 year ago

0.15.0

2 years ago

0.16.0

2 years ago

0.14.0

2 years ago

0.13.0

2 years ago

0.12.0

2 years ago

0.10.0

2 years ago

0.11.0

2 years ago

0.9.0

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago