Skip to content

TypeScript API / laikacms/json-api / AtomicOperationSchema

Variable: AtomicOperationSchema ​

ts
const AtomicOperationSchema: StandardSchemaV1<
  | {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id?: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "add";
}
  | {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "update";
}
  | {
  op: "remove";
  ref: {
     id: string;
     type: string;
  };
}, 
  | {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id?: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "add";
}
  | {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "update";
}
  | {
  op: "remove";
  ref: {
     id: string;
     type: string;
  };
}> & Union<readonly [StandardSchemaV1<{
  data: {
     attributes?: {
      [key: string]: any;
     };
     id?: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "add";
}, {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id?: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "add";
}> & Struct<{
  data: Struct<{
     attributes: optional<$Record<String, Any>>;
     id: optional<String>;
     relationships: optional<$Record<String, Any>>;
     type: String;
  }>;
  op: Literal<"add">;
}>, StandardSchemaV1<{
  data: {
     attributes?: {
      [key: string]: any;
     };
     id: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "update";
}, {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "update";
}> & Struct<{
  data: Struct<{
     attributes: optional<$Record<String, Any>>;
     id: String;
     relationships: optional<$Record<String, Any>>;
     type: String;
  }>;
  op: Literal<"update">;
}>, StandardSchemaV1<{
  op: "remove";
  ref: {
     id: string;
     type: string;
  };
}, {
  op: "remove";
  ref: {
     id: string;
     type: string;
  };
}> & Struct<{
  op: Literal<"remove">;
  ref: Struct<{
     id: String;
     type: String;
  }>;
}>]>;

Released under the MIT License.