Skip to content

Commit 4efa5f5

Browse files
Merge pull request #13 from Frontify/feat/update-to-custom-metadata
feat: replace metadata with customMetadata
2 parents 88e9ac9 + 6271cb5 commit 4efa5f5

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

src/Api.ts

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { version } from '../package.json';
12
import { FinderError } from './Exception';
23
import { logMessage } from './Logger';
34
import { httpCall } from './Utils';
4-
import { version } from '../package.json';
55

66
type Options = {
77
domain: string;
@@ -64,13 +64,21 @@ export type FrontifyAsset = {
6464
value: string;
6565
source: string;
6666
};
67-
metadataValues?: {
68-
value: string | number;
69-
metadataField: {
67+
customMetadata: {
68+
property: {
7069
id: string;
71-
label: string;
70+
name: string;
71+
type: {
72+
name: string;
73+
};
7274
};
73-
};
75+
value?: {
76+
value: string | { optionId: string; text: string };
77+
};
78+
values?: {
79+
value: { optionId: string; text: string };
80+
}[];
81+
}[];
7482
filename: string;
7583
extension: string;
7684
size: number;
@@ -113,11 +121,19 @@ fragment withMetadata on Asset {
113121
value
114122
source
115123
}
116-
metadataValues {
117-
value
118-
metadataField {
124+
customMetadata {
125+
property {
119126
id
120-
label
127+
name
128+
type {
129+
name
130+
}
131+
}
132+
... on CustomMetadataValue {
133+
value
134+
}
135+
... on CustomMetadataValues {
136+
values
121137
}
122138
}
123139
copyright {

0 commit comments

Comments
 (0)