Upsert a C3Type file via the Console


I have a C3 Type file contents.
How can I create a type from it and upsert via Console (not via tools)?


You can use TagMetadataStore.upsertType, it does the job but it’s a manual process.
For example, to create the following type from console:

type {
  a: int

Do the following:


Create c3Typ dynamically

Is there a way to upsert related .js functions as well?


Once you’ve upserted your type as above:

function myFunc() {
  // function body
//see the path of the *c3typ and update the following accordingly
var path = 'meta://customer/..../src/TypeName.js';
var content = myFunc.toString();

You shouldn’t have to insert your type and JS implementation like this, you have to provision your code instead.


Thanks! Completely agreed. NOT best practice.