tinacms 1.5.6 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -255,10 +255,8 @@ mutation addPendingDocumentMutation(
255
255
  }
256
256
  return json.data;
257
257
  }
258
- async syncTinaMedia() {
259
- const res = await this.fetchWithToken(`${this.contentApiBase}/assets/${this.clientId}/sync/${this.branch}`, { method: "POST" });
260
- const jsonRes = await res.json();
261
- return jsonRes;
258
+ get appDashboardLink() {
259
+ return `${this.frontendUrl}/projects/${this.clientId}`;
262
260
  }
263
261
  async checkSyncStatus({
264
262
  assetsSyncing
@@ -290,6 +288,12 @@ mutation addPendingDocumentMutation(
290
288
  }).join(""));
291
289
  return JSON.parse(jsonPayload);
292
290
  }
291
+ async getProject() {
292
+ const res = await this.fetchWithToken(`${this.identityApiUrl}/v2/apps/${this.clientId}`, {
293
+ method: "GET"
294
+ });
295
+ return res.json();
296
+ }
293
297
  async getRefreshedToken(tokens) {
294
298
  const { access_token, id_token, refresh_token } = JSON.parse(tokens);
295
299
  const { exp, iss, client_id } = this.parseJwt(access_token);
@@ -3205,9 +3209,10 @@ const useCollectionFolder = () => {
3205
3209
  const loc = useLocation();
3206
3210
  useEffect(() => {
3207
3211
  const match = loc.pathname.match(folderRegex);
3212
+ const folderName = match ? decodeURIComponent(match[1]) : "";
3208
3213
  const update = {
3209
- name: match ? match[1] : "",
3210
- fullyQualifiedName: match ? match[1] ? `~/${match[1]}` : "~" : "",
3214
+ name: folderName,
3215
+ fullyQualifiedName: match ? folderName ? `~/${folderName}` : "~" : "",
3211
3216
  loading: false,
3212
3217
  parentName: ""
3213
3218
  };
package/dist/index.js CHANGED
@@ -270,10 +270,8 @@ mutation addPendingDocumentMutation(
270
270
  }
271
271
  return json.data;
272
272
  }
273
- async syncTinaMedia() {
274
- const res = await this.fetchWithToken(`${this.contentApiBase}/assets/${this.clientId}/sync/${this.branch}`, { method: "POST" });
275
- const jsonRes = await res.json();
276
- return jsonRes;
273
+ get appDashboardLink() {
274
+ return `${this.frontendUrl}/projects/${this.clientId}`;
277
275
  }
278
276
  async checkSyncStatus({
279
277
  assetsSyncing
@@ -305,6 +303,12 @@ mutation addPendingDocumentMutation(
305
303
  }).join(""));
306
304
  return JSON.parse(jsonPayload);
307
305
  }
306
+ async getProject() {
307
+ const res = await this.fetchWithToken(`${this.identityApiUrl}/v2/apps/${this.clientId}`, {
308
+ method: "GET"
309
+ });
310
+ return res.json();
311
+ }
308
312
  async getRefreshedToken(tokens) {
309
313
  const { access_token, id_token, refresh_token } = JSON.parse(tokens);
310
314
  const { exp, iss, client_id } = this.parseJwt(access_token);
@@ -3220,9 +3224,10 @@ This will work when developing locally but NOT when deployed to production.
3220
3224
  const loc = reactRouterDom.useLocation();
3221
3225
  React.useEffect(() => {
3222
3226
  const match = loc.pathname.match(folderRegex);
3227
+ const folderName = match ? decodeURIComponent(match[1]) : "";
3223
3228
  const update = {
3224
- name: match ? match[1] : "",
3225
- fullyQualifiedName: match ? match[1] ? `~/${match[1]}` : "~" : "",
3229
+ name: folderName,
3230
+ fullyQualifiedName: match ? folderName ? `~/${folderName}` : "~" : "",
3226
3231
  loading: false,
3227
3232
  parentName: ""
3228
3233
  };
@@ -160,9 +160,7 @@ export declare class Client {
160
160
  request<ReturnType>(query: ((gqlTag: typeof gql) => DocumentNode) | string, { variables }: {
161
161
  variables: object;
162
162
  }): Promise<ReturnType>;
163
- syncTinaMedia(): Promise<{
164
- assetsSyncing: string[];
165
- }>;
163
+ get appDashboardLink(): string;
166
164
  checkSyncStatus({ assetsSyncing, }: {
167
165
  assetsSyncing: string[];
168
166
  }): Promise<{
@@ -179,6 +177,7 @@ export declare class Client {
179
177
  cursor?: string;
180
178
  }>;
181
179
  parseJwt(token: any): any;
180
+ getProject(): Promise<any>;
182
181
  getRefreshedToken(tokens: string): Promise<TokenObject>;
183
182
  isAuthorized(): Promise<boolean>;
184
183
  isAuthenticated(): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "exports": {
@@ -58,7 +58,7 @@
58
58
  "@react-hook/window-size": "^3.0.7",
59
59
  "@tinacms/schema-tools": "1.4.4",
60
60
  "@tinacms/sharedctx": "1.0.1",
61
- "@tinacms/toolkit": "1.7.2",
61
+ "@tinacms/toolkit": "1.7.4",
62
62
  "crypto-js": "^4.0.0",
63
63
  "encoding": "0.1.13",
64
64
  "fetch-ponyfill": "^7.1.0",