Merge branch 'main' into feat/sdk
This commit is contained in:
commit
55d28d9815
|
|
@ -249,7 +249,16 @@ export const ManageModal: FC<AddEditModalProps> = (props) => {
|
|||
value: post.values.map((value: any) => ({
|
||||
...(value.id ? { id: value.id } : {}),
|
||||
content: value.content.slice(0, post.maximumCharacters || 1000000),
|
||||
image: value.media.map(({ id, path, alt, thumbnail, thumbnailTimestamp }: any) => ({ id, path, alt, thumbnail, thumbnailTimestamp })) || [],
|
||||
image:
|
||||
(value?.media || []).map(
|
||||
({ id, path, alt, thumbnail, thumbnailTimestamp }: any) => ({
|
||||
id,
|
||||
path,
|
||||
alt,
|
||||
thumbnail,
|
||||
thumbnailTimestamp,
|
||||
})
|
||||
) || [],
|
||||
})),
|
||||
})),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { timer } from '@gitroom/helpers/utils/timer';
|
||||
import pThrottle from 'p-throttle';
|
||||
|
||||
export class RefreshToken {
|
||||
constructor(
|
||||
|
|
@ -19,15 +20,24 @@ export class NotEnoughScopes {
|
|||
constructor(public message = 'Not enough scopes') {}
|
||||
}
|
||||
|
||||
const pThrottleInstance = pThrottle({
|
||||
limit: 1,
|
||||
interval: 2000
|
||||
});
|
||||
|
||||
export abstract class SocialAbstract {
|
||||
private fetchInstance = pThrottleInstance(
|
||||
(url: RequestInfo, options?: RequestInit) => fetch(url, options)
|
||||
);
|
||||
|
||||
async fetch(
|
||||
url: string,
|
||||
options: RequestInit = {},
|
||||
identifier = '',
|
||||
totalRetries = 0
|
||||
): Promise<Response> {
|
||||
const request = await fetch(url, options);
|
||||
``
|
||||
const request = await this.fetchInstance(url, options);
|
||||
|
||||
if (request.status === 200 || request.status === 201) {
|
||||
return request;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ export class InstagramProvider
|
|||
`https://${type}/v20.0/${photoId}?access_token=${accessToken}&fields=status_code`
|
||||
)
|
||||
).json();
|
||||
await timer(3000);
|
||||
await timer(10000);
|
||||
status = status_code;
|
||||
}
|
||||
console.log('in progress3');
|
||||
|
|
@ -320,7 +320,7 @@ export class InstagramProvider
|
|||
`https://${type}/v20.0/${containerId}?fields=status_code&access_token=${accessToken}`
|
||||
)
|
||||
).json();
|
||||
await timer(3000);
|
||||
await timer(10000);
|
||||
status = status_code;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@
|
|||
"nx": "19.7.2",
|
||||
"openai": "^4.47.1",
|
||||
"p-limit": "^3.1.0",
|
||||
"p-throttle": "4.1.1",
|
||||
"polotno": "^2.10.5",
|
||||
"posthog-js": "^1.178.0",
|
||||
"react": "18.3.1",
|
||||
|
|
|
|||
|
|
@ -390,6 +390,9 @@ importers:
|
|||
p-limit:
|
||||
specifier: ^3.1.0
|
||||
version: 3.1.0
|
||||
p-throttle:
|
||||
specifier: 4.1.1
|
||||
version: 4.1.1
|
||||
polotno:
|
||||
specifier: ^2.10.5
|
||||
version: 2.25.1(@types/react@18.3.1)(@types/sortablejs@1.15.8)(react-dom@18.3.1(react@18.3.1))(react-native@0.80.1(@babel/core@7.28.0)(@types/react@18.3.1)(bufferutil@4.0.9)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)
|
||||
|
|
@ -12367,6 +12370,10 @@ packages:
|
|||
resolution: {integrity: sha512-hEt02O4hUct5wtwg4H4KcWgDdm+l1bOaEy/hWzd8xtXB9BqxTWBBhb+2ImAtH4Cv4rPjV76xN3Zumqk3k3AhhQ==}
|
||||
engines: {node: '>=16.17'}
|
||||
|
||||
p-throttle@4.1.1:
|
||||
resolution: {integrity: sha512-TuU8Ato+pRTPJoDzYD4s7ocJYcNSEZRvlxoq3hcPI2kZDZ49IQ1Wkj7/gDJc3X7XiEAAvRGtDzdXJI0tC3IL1g==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
p-timeout@3.2.0:
|
||||
resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==}
|
||||
engines: {node: '>=8'}
|
||||
|
|
@ -31944,6 +31951,8 @@ snapshots:
|
|||
is-network-error: 1.1.0
|
||||
retry: 0.13.1
|
||||
|
||||
p-throttle@4.1.1: {}
|
||||
|
||||
p-timeout@3.2.0:
|
||||
dependencies:
|
||||
p-finally: 1.0.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue