@deliverart/sdk-js-integration 0.0.1
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/.changeset/config.json +11 -0
- package/.github/workflows/workflow.yml +47 -0
- package/.prettierrc +7 -0
- package/README.md +3 -0
- package/dist/index.cjs +3660 -0
- package/dist/index.d.cts +32181 -0
- package/dist/index.d.ts +32181 -0
- package/dist/index.js +3385 -0
- package/eslint.config.js +37 -0
- package/package.json +48 -0
- package/src/activatable-integration-data-schemas.ts +50 -0
- package/src/activatable-integration-types.ts +17 -0
- package/src/activatable-integration.ts +86 -0
- package/src/activation-request.ts +53 -0
- package/src/cancellation-request-types.ts +34 -0
- package/src/cancellation-request.ts +21 -0
- package/src/index.ts +9 -0
- package/src/integration-schemas.ts +31 -0
- package/src/requests/DeleteIntegration.ts +27 -0
- package/src/requests/GetIntegrationDetails.ts +30 -0
- package/src/requests/GetIntegrations.ts +63 -0
- package/src/requests/UpdateIntegration.ts +36 -0
- package/src/requests/activation-requests/ActivateIntegrationActivationRequest.ts +38 -0
- package/src/requests/activation-requests/AnnotateIntegrationActivationRequest.ts +46 -0
- package/src/requests/activation-requests/CreateIntegrationActivationRequest.ts +80 -0
- package/src/requests/activation-requests/DeleteIntegrationActivationRequest.ts +27 -0
- package/src/requests/activation-requests/GetIntegrationActivationRequestDetails.ts +37 -0
- package/src/requests/activation-requests/GetIntegrationActivationRequests.ts +86 -0
- package/src/requests/activation-requests/RespondIntegrationActivationRequest.ts +58 -0
- package/src/requests/activation-requests/SendIntegrationActivationRequestToPartner.ts +38 -0
- package/src/requests/activation-requests/UpdateIntegrationActivationRequest.ts +91 -0
- package/src/requests/activation-requests/index.ts +9 -0
- package/src/requests/cancellation-requests/CancelIntegrationCancellationRequest.ts +38 -0
- package/src/requests/cancellation-requests/CreateIntegrationCancellationRequest.ts +41 -0
- package/src/requests/cancellation-requests/DeleteIntegrationCancellationRequest.ts +27 -0
- package/src/requests/cancellation-requests/GetIntegrationCancellationRequestDetails.ts +37 -0
- package/src/requests/cancellation-requests/GetIntegrationCancellationRequests.ts +72 -0
- package/src/requests/cancellation-requests/index.ts +5 -0
- package/src/requests/index.ts +7 -0
- package/src/requests/services/cassa_in_cloud/CreateIntegrationCassaInCloud.ts +42 -0
- package/src/requests/services/cassa_in_cloud/DeleteIntegrationCassaInCloud.ts +27 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudClientLogRequestDetails.ts +40 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudClientLogRequests.ts +64 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudDetails.ts +36 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudList.ts +61 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudSyncMenuProcessDetails.ts +40 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudSyncMenuProcesses.ts +69 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudWebHookEventDetails.ts +40 -0
- package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudWebHookEvents.ts +69 -0
- package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncCustomers.ts +27 -0
- package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncOrganizations.ts +27 -0
- package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncProducts.ts +27 -0
- package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncSalesModes.ts +27 -0
- package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncStock.ts +27 -0
- package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncTimetables.ts +27 -0
- package/src/requests/services/cassa_in_cloud/UpdateIntegrationCassaInCloud.ts +39 -0
- package/src/requests/services/cassa_in_cloud/index.ts +17 -0
- package/src/requests/services/deliveroo/CreateIntegrationDeliveroo.ts +40 -0
- package/src/requests/services/deliveroo/DeleteIntegrationDeliveroo.ts +27 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooClientLogRequestDetails.ts +40 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooClientLogRequests.ts +64 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooDetails.ts +36 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooList.ts +61 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooMenuVersionDetails.ts +35 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooMenuVersions.ts +62 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooSyncMenuProcessDetails.ts +40 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooSyncMenuProcesses.ts +69 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooWebhookEventDetails.ts +40 -0
- package/src/requests/services/deliveroo/GetIntegrationDeliverooWebhookEvents.ts +69 -0
- package/src/requests/services/deliveroo/IntegrationDeliverooSyncMenu.ts +27 -0
- package/src/requests/services/deliveroo/IntegrationDeliverooSyncOpeningHours.ts +27 -0
- package/src/requests/services/deliveroo/UpdateIntegrationDeliveroo.ts +39 -0
- package/src/requests/services/deliveroo/UpdateIntegrationDeliverooSiteStatus.ts +43 -0
- package/src/requests/services/deliveroo/index.ts +16 -0
- package/src/requests/services/glovo/CreateIntegrationGlovo.ts +39 -0
- package/src/requests/services/glovo/DeleteIntegrationGlovo.ts +27 -0
- package/src/requests/services/glovo/GetIntegrationGlovoClientLogRequestDetails.ts +39 -0
- package/src/requests/services/glovo/GetIntegrationGlovoClientLogRequests.ts +64 -0
- package/src/requests/services/glovo/GetIntegrationGlovoDetails.ts +36 -0
- package/src/requests/services/glovo/GetIntegrationGlovoList.ts +55 -0
- package/src/requests/services/glovo/GetIntegrationGlovoMenuUpdateDetails.ts +39 -0
- package/src/requests/services/glovo/GetIntegrationGlovoMenuUpdates.ts +66 -0
- package/src/requests/services/glovo/GetIntegrationGlovoMenuVersionDetails.ts +35 -0
- package/src/requests/services/glovo/GetIntegrationGlovoMenuVersions.ts +62 -0
- package/src/requests/services/glovo/GetIntegrationGlovoWebhookEventDetails.ts +39 -0
- package/src/requests/services/glovo/GetIntegrationGlovoWebhookEvents.ts +68 -0
- package/src/requests/services/glovo/IntegrationGlovoSyncMenu.ts +27 -0
- package/src/requests/services/glovo/UpdateIntegrationGlovo.ts +39 -0
- package/src/requests/services/glovo/UpdateIntegrationGlovoStoreStatus.ts +43 -0
- package/src/requests/services/glovo/index.ts +15 -0
- package/src/requests/services/index.ts +4 -0
- package/src/requests/services/justeat/CreateIntegrationJustEat.ts +39 -0
- package/src/requests/services/justeat/DeleteIntegrationJustEat.ts +27 -0
- package/src/requests/services/justeat/GetIntegrationJustEatClientLogRequestDetails.ts +40 -0
- package/src/requests/services/justeat/GetIntegrationJustEatClientLogRequests.ts +64 -0
- package/src/requests/services/justeat/GetIntegrationJustEatDetails.ts +36 -0
- package/src/requests/services/justeat/GetIntegrationJustEatList.ts +60 -0
- package/src/requests/services/justeat/GetIntegrationJustEatMenuVersionDetails.ts +35 -0
- package/src/requests/services/justeat/GetIntegrationJustEatMenuVersions.ts +62 -0
- package/src/requests/services/justeat/GetIntegrationJustEatSyncMenuProcessDetails.ts +40 -0
- package/src/requests/services/justeat/GetIntegrationJustEatSyncMenuProcesses.ts +69 -0
- package/src/requests/services/justeat/IntegrationJustEatSyncMenu.ts +27 -0
- package/src/requests/services/justeat/IntegrationJustEatSyncOpeningTimes.ts +27 -0
- package/src/requests/services/justeat/UpdateIntegrationJustEat.ts +39 -0
- package/src/requests/services/justeat/UpdateIntegrationJustEatRestaurantStatus.ts +44 -0
- package/src/requests/services/justeat/index.ts +14 -0
- package/src/schemas.ts +97 -0
- package/src/service-schemas/cassa_in_cloud.ts +154 -0
- package/src/service-schemas/deliveroo.ts +159 -0
- package/src/service-schemas/glovo.ts +153 -0
- package/src/service-schemas/justeat.ts +121 -0
- package/src/types.ts +227 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { pointOfSalePathSchema } from '@deliverart/sdk-js-point-of-sale'
|
|
3
|
+
import { z } from 'zod'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
integrationCassaInCloudDataSchema,
|
|
7
|
+
integrationDeliverooDataSchema,
|
|
8
|
+
integrationGlovoDataSchema,
|
|
9
|
+
integrationJustEatDataSchema,
|
|
10
|
+
} from '../../activatable-integration-data-schemas'
|
|
11
|
+
import {
|
|
12
|
+
IntegrationActivationRequestDetails,
|
|
13
|
+
integrationActivationRequestDetailsSchema,
|
|
14
|
+
} from '../../activation-request'
|
|
15
|
+
import { integrationProviderSchema } from '../../types'
|
|
16
|
+
|
|
17
|
+
const writableIntegrationActivationRequestBaseSchema = z.object({
|
|
18
|
+
name: z.string(),
|
|
19
|
+
provider: integrationProviderSchema,
|
|
20
|
+
pointOfSale: pointOfSalePathSchema,
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
export const createIntegrationActivationRequestInputSchema = z.discriminatedUnion('service', [
|
|
24
|
+
z
|
|
25
|
+
.object({
|
|
26
|
+
service: z.literal('deliveroo'),
|
|
27
|
+
data: integrationDeliverooDataSchema,
|
|
28
|
+
})
|
|
29
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
30
|
+
|
|
31
|
+
z
|
|
32
|
+
.object({
|
|
33
|
+
service: z.literal('glovo'),
|
|
34
|
+
data: integrationGlovoDataSchema,
|
|
35
|
+
})
|
|
36
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
37
|
+
|
|
38
|
+
z
|
|
39
|
+
.object({
|
|
40
|
+
service: z.literal('justeat'),
|
|
41
|
+
data: integrationJustEatDataSchema,
|
|
42
|
+
})
|
|
43
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
44
|
+
|
|
45
|
+
z
|
|
46
|
+
.object({
|
|
47
|
+
service: z.literal('cassa_in_cloud'),
|
|
48
|
+
data: integrationCassaInCloudDataSchema,
|
|
49
|
+
})
|
|
50
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
51
|
+
])
|
|
52
|
+
export type CreateIntegrationActivationRequestInput = z.infer<
|
|
53
|
+
typeof createIntegrationActivationRequestInputSchema
|
|
54
|
+
>
|
|
55
|
+
|
|
56
|
+
export const createIntegrationActivationRequestResponseSchema =
|
|
57
|
+
integrationActivationRequestDetailsSchema
|
|
58
|
+
export type CreateIntegrationActivationRequestResponse = IntegrationActivationRequestDetails
|
|
59
|
+
|
|
60
|
+
export class CreateIntegrationActivationRequest extends AbstractApiRequest<
|
|
61
|
+
CreateIntegrationActivationRequestInput,
|
|
62
|
+
CreateIntegrationActivationRequestResponse
|
|
63
|
+
> {
|
|
64
|
+
readonly method = 'POST'
|
|
65
|
+
readonly contentType = 'application/json'
|
|
66
|
+
readonly accept = 'application/json'
|
|
67
|
+
|
|
68
|
+
readonly inputSchema = createIntegrationActivationRequestInputSchema
|
|
69
|
+
readonly outputSchema = createIntegrationActivationRequestResponseSchema
|
|
70
|
+
readonly querySchema = undefined
|
|
71
|
+
readonly headersSchema = undefined
|
|
72
|
+
|
|
73
|
+
constructor(input: CreateIntegrationActivationRequestInput) {
|
|
74
|
+
super(input)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
getPath(): string {
|
|
78
|
+
return '/integrations/activation_requests'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
export const deleteIntegrationActivationRequestInputSchema = z.undefined()
|
|
5
|
+
export const deleteIntegrationActivationRequestResponseSchema = z.undefined()
|
|
6
|
+
|
|
7
|
+
export class DeleteIntegrationActivationRequest extends AbstractApiRequest<void, void> {
|
|
8
|
+
readonly method = 'DELETE'
|
|
9
|
+
readonly contentType = 'application/json'
|
|
10
|
+
readonly accept = 'application/json'
|
|
11
|
+
|
|
12
|
+
readonly inputSchema = deleteIntegrationActivationRequestInputSchema
|
|
13
|
+
readonly outputSchema = deleteIntegrationActivationRequestResponseSchema
|
|
14
|
+
readonly querySchema = undefined
|
|
15
|
+
readonly headersSchema = undefined
|
|
16
|
+
|
|
17
|
+
private readonly integrationActivationRequestId: string
|
|
18
|
+
|
|
19
|
+
constructor(integrationActivationRequestId: string) {
|
|
20
|
+
super()
|
|
21
|
+
this.integrationActivationRequestId = integrationActivationRequestId
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getPath(): string {
|
|
25
|
+
return `/integrations/activation_requests/${this.integrationActivationRequestId}`
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IntegrationActivationRequestDetails,
|
|
6
|
+
integrationActivationRequestDetailsSchema,
|
|
7
|
+
} from '../../activation-request'
|
|
8
|
+
|
|
9
|
+
export const getIntegrationActivationRequestDetailsInputSchema = z.undefined()
|
|
10
|
+
|
|
11
|
+
export const getIntegrationActivationRequestDetailsResponseSchema =
|
|
12
|
+
integrationActivationRequestDetailsSchema
|
|
13
|
+
export type GetIntegrationActivationRequestDetailsResponse = IntegrationActivationRequestDetails
|
|
14
|
+
|
|
15
|
+
export class GetIntegrationActivationRequestDetails extends AbstractApiRequest<
|
|
16
|
+
void,
|
|
17
|
+
GetIntegrationActivationRequestDetailsResponse
|
|
18
|
+
> {
|
|
19
|
+
readonly method = 'GET'
|
|
20
|
+
readonly contentType = 'application/json'
|
|
21
|
+
readonly accept = 'application/json'
|
|
22
|
+
readonly inputSchema = getIntegrationActivationRequestDetailsInputSchema
|
|
23
|
+
readonly outputSchema = getIntegrationActivationRequestDetailsResponseSchema
|
|
24
|
+
readonly querySchema = undefined
|
|
25
|
+
readonly headersSchema = undefined
|
|
26
|
+
|
|
27
|
+
private readonly integrationActivationRequestId: string
|
|
28
|
+
|
|
29
|
+
constructor(integrationActivationRequestId: string) {
|
|
30
|
+
super()
|
|
31
|
+
this.integrationActivationRequestId = integrationActivationRequestId
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
getPath(): string {
|
|
35
|
+
return `/integrations/activation_requests/${this.integrationActivationRequestId}`
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import {
|
|
3
|
+
createPaginatedSchema,
|
|
4
|
+
Paginated,
|
|
5
|
+
responseToPagination,
|
|
6
|
+
sortDirSchema,
|
|
7
|
+
timestampsFilterSchema,
|
|
8
|
+
} from '@deliverart/sdk-js-global-types'
|
|
9
|
+
import { AxiosResponse } from 'axios'
|
|
10
|
+
import { z } from 'zod'
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
activatableIntegrationHealthStatusSchema,
|
|
14
|
+
activatableIntegrationStatusSchema,
|
|
15
|
+
} from '../../activatable-integration-types'
|
|
16
|
+
import {
|
|
17
|
+
IntegrationActivationRequest,
|
|
18
|
+
integrationActivationRequestSchema,
|
|
19
|
+
} from '../../activation-request'
|
|
20
|
+
import { integrationProviderSchema, integrationServiceSchema } from '../../types'
|
|
21
|
+
|
|
22
|
+
export const getIntegrationActivationRequestsQuerySchema = z
|
|
23
|
+
.object({
|
|
24
|
+
'order[service]': sortDirSchema.optional(),
|
|
25
|
+
'order[status]': sortDirSchema.optional(),
|
|
26
|
+
'order[createdAt]': sortDirSchema.optional(),
|
|
27
|
+
'order[updatedAt]': sortDirSchema.optional(),
|
|
28
|
+
service: integrationServiceSchema.optional(),
|
|
29
|
+
'service[]': z.array(integrationServiceSchema).optional(),
|
|
30
|
+
provider: integrationProviderSchema.optional(),
|
|
31
|
+
'provider[]': z.array(integrationProviderSchema).optional(),
|
|
32
|
+
status: activatableIntegrationStatusSchema.optional(),
|
|
33
|
+
'status[]': z.array(activatableIntegrationStatusSchema).optional(),
|
|
34
|
+
healthStatus: activatableIntegrationHealthStatusSchema.optional(),
|
|
35
|
+
'healthStatus[]': z.array(activatableIntegrationHealthStatusSchema).optional(),
|
|
36
|
+
connectionId: z.string().optional(),
|
|
37
|
+
'connectionId[]': z.array(z.string()).optional(),
|
|
38
|
+
page: z.coerce.number().optional(),
|
|
39
|
+
})
|
|
40
|
+
.merge(timestampsFilterSchema)
|
|
41
|
+
export type GetIntegrationActivationRequestsQueryParams = z.infer<
|
|
42
|
+
typeof getIntegrationActivationRequestsQuerySchema
|
|
43
|
+
>
|
|
44
|
+
|
|
45
|
+
export const getIntegrationActivationRequestsResponseSchema = createPaginatedSchema(
|
|
46
|
+
integrationActivationRequestSchema,
|
|
47
|
+
)
|
|
48
|
+
export type GetIntegrationActivationRequestsResponse = z.infer<
|
|
49
|
+
typeof getIntegrationActivationRequestsResponseSchema
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
export const getIntegrationActivationRequestsInputSchema = z.undefined()
|
|
53
|
+
|
|
54
|
+
export class GetIntegrationActivationRequests extends AbstractApiRequest<
|
|
55
|
+
void,
|
|
56
|
+
GetIntegrationActivationRequestsResponse,
|
|
57
|
+
GetIntegrationActivationRequestsQueryParams
|
|
58
|
+
> {
|
|
59
|
+
readonly method = 'GET'
|
|
60
|
+
readonly contentType = 'application/json'
|
|
61
|
+
readonly accept = 'application/json'
|
|
62
|
+
|
|
63
|
+
readonly inputSchema = getIntegrationActivationRequestsInputSchema
|
|
64
|
+
readonly outputSchema = getIntegrationActivationRequestsResponseSchema
|
|
65
|
+
readonly querySchema = getIntegrationActivationRequestsQuerySchema
|
|
66
|
+
readonly headersSchema = undefined
|
|
67
|
+
|
|
68
|
+
constructor(options?: { query?: GetIntegrationActivationRequestsQueryParams }) {
|
|
69
|
+
super(undefined, options)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
getPath(): string {
|
|
73
|
+
return '/integrations/activation_requests'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
parseResponse(
|
|
77
|
+
data: unknown,
|
|
78
|
+
rawResponse: AxiosResponse,
|
|
79
|
+
): Paginated<IntegrationActivationRequest> {
|
|
80
|
+
const integrations = z.array(integrationActivationRequestSchema).parse(data)
|
|
81
|
+
return this.validateOutput({
|
|
82
|
+
data: integrations,
|
|
83
|
+
pagination: responseToPagination(rawResponse),
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
integrationCassaInCloudDataSchema,
|
|
6
|
+
integrationDeliverooDataSchema,
|
|
7
|
+
integrationGlovoDataSchema,
|
|
8
|
+
integrationJustEatDataSchema,
|
|
9
|
+
} from '../../activatable-integration-data-schemas'
|
|
10
|
+
import {
|
|
11
|
+
IntegrationActivationRequestDetails,
|
|
12
|
+
integrationActivationRequestDetailsSchema,
|
|
13
|
+
} from '../../activation-request'
|
|
14
|
+
|
|
15
|
+
export const respondIntegrationActivationRequestInputSchema = z.object({
|
|
16
|
+
message: z.string().min(1, 'Message is required'),
|
|
17
|
+
data: z.union([
|
|
18
|
+
integrationDeliverooDataSchema,
|
|
19
|
+
integrationGlovoDataSchema,
|
|
20
|
+
integrationJustEatDataSchema,
|
|
21
|
+
integrationCassaInCloudDataSchema,
|
|
22
|
+
]),
|
|
23
|
+
})
|
|
24
|
+
export type RespondIntegrationActivationRequestInput = z.infer<
|
|
25
|
+
typeof respondIntegrationActivationRequestInputSchema
|
|
26
|
+
>
|
|
27
|
+
|
|
28
|
+
export const respondIntegrationActivationRequestResponseSchema =
|
|
29
|
+
integrationActivationRequestDetailsSchema
|
|
30
|
+
export type RespondIntegrationActivationRequestResponse = IntegrationActivationRequestDetails
|
|
31
|
+
|
|
32
|
+
export class RespondIntegrationActivationRequest extends AbstractApiRequest<
|
|
33
|
+
RespondIntegrationActivationRequestInput,
|
|
34
|
+
RespondIntegrationActivationRequestResponse
|
|
35
|
+
> {
|
|
36
|
+
readonly method = 'POST'
|
|
37
|
+
readonly contentType = 'application/json'
|
|
38
|
+
readonly accept = 'application/json'
|
|
39
|
+
|
|
40
|
+
readonly inputSchema = respondIntegrationActivationRequestInputSchema
|
|
41
|
+
readonly outputSchema = respondIntegrationActivationRequestResponseSchema
|
|
42
|
+
readonly querySchema = undefined
|
|
43
|
+
readonly headersSchema = undefined
|
|
44
|
+
|
|
45
|
+
private readonly integrationActivationRequestId: string
|
|
46
|
+
|
|
47
|
+
constructor(
|
|
48
|
+
integrationActivationRequestId: string,
|
|
49
|
+
input: RespondIntegrationActivationRequestInput,
|
|
50
|
+
) {
|
|
51
|
+
super(input)
|
|
52
|
+
this.integrationActivationRequestId = integrationActivationRequestId
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
getPath(): string {
|
|
56
|
+
return `/integrations/activation_requests/${this.integrationActivationRequestId}/respond`
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IntegrationActivationRequestDetails,
|
|
6
|
+
integrationActivationRequestDetailsSchema,
|
|
7
|
+
} from '../../activation-request'
|
|
8
|
+
|
|
9
|
+
export const sendIntegrationActivationRequestToPartnerInputSchema = z.undefined()
|
|
10
|
+
|
|
11
|
+
export const sendIntegrationActivationRequestToPartnerResponseSchema =
|
|
12
|
+
integrationActivationRequestDetailsSchema
|
|
13
|
+
export type SendIntegrationActivationRequestToPartnerResponse = IntegrationActivationRequestDetails
|
|
14
|
+
|
|
15
|
+
export class SendIntegrationActivationRequestToPartner extends AbstractApiRequest<
|
|
16
|
+
void,
|
|
17
|
+
SendIntegrationActivationRequestToPartnerResponse
|
|
18
|
+
> {
|
|
19
|
+
readonly method = 'POST'
|
|
20
|
+
readonly contentType = 'application/json'
|
|
21
|
+
readonly accept = 'application/json'
|
|
22
|
+
|
|
23
|
+
readonly inputSchema = sendIntegrationActivationRequestToPartnerInputSchema
|
|
24
|
+
readonly outputSchema = sendIntegrationActivationRequestToPartnerResponseSchema
|
|
25
|
+
readonly querySchema = undefined
|
|
26
|
+
readonly headersSchema = undefined
|
|
27
|
+
|
|
28
|
+
private readonly integrationActivationRequestId: string
|
|
29
|
+
|
|
30
|
+
constructor(integrationActivationRequestId: string) {
|
|
31
|
+
super()
|
|
32
|
+
this.integrationActivationRequestId = integrationActivationRequestId
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getPath(): string {
|
|
36
|
+
return `/integrations/activation_requests/${this.integrationActivationRequestId}/send-partner`
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { pointOfSalePathSchema } from '@deliverart/sdk-js-point-of-sale'
|
|
3
|
+
import { z } from 'zod'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
integrationCassaInCloudDataSchema,
|
|
7
|
+
integrationDeliverooDataSchema,
|
|
8
|
+
integrationGlovoDataSchema,
|
|
9
|
+
integrationJustEatDataSchema,
|
|
10
|
+
} from '../../activatable-integration-data-schemas'
|
|
11
|
+
import { activatableIntegrationHealthStatusSchema } from '../../activatable-integration-types'
|
|
12
|
+
import {
|
|
13
|
+
IntegrationActivationRequestDetails,
|
|
14
|
+
integrationActivationRequestDetailsSchema,
|
|
15
|
+
} from '../../activation-request'
|
|
16
|
+
import { integrationProviderSchema } from '../../types'
|
|
17
|
+
|
|
18
|
+
const writableIntegrationActivationRequestBaseSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
healthStatus: activatableIntegrationHealthStatusSchema,
|
|
21
|
+
provider: integrationProviderSchema,
|
|
22
|
+
pointOfSale: pointOfSalePathSchema,
|
|
23
|
+
name: z.string(),
|
|
24
|
+
internalNotes: z.string().nullable(),
|
|
25
|
+
})
|
|
26
|
+
.partial()
|
|
27
|
+
|
|
28
|
+
export const updateIntegrationActivationRequestInputSchema = z.discriminatedUnion('service', [
|
|
29
|
+
z
|
|
30
|
+
.object({
|
|
31
|
+
service: z.literal('deliveroo'),
|
|
32
|
+
data: integrationDeliverooDataSchema.optional(),
|
|
33
|
+
})
|
|
34
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
35
|
+
|
|
36
|
+
z
|
|
37
|
+
.object({
|
|
38
|
+
service: z.literal('glovo'),
|
|
39
|
+
data: integrationGlovoDataSchema.optional(),
|
|
40
|
+
})
|
|
41
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
42
|
+
|
|
43
|
+
z
|
|
44
|
+
.object({
|
|
45
|
+
service: z.literal('justeat'),
|
|
46
|
+
data: integrationJustEatDataSchema.optional(),
|
|
47
|
+
})
|
|
48
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
49
|
+
|
|
50
|
+
z
|
|
51
|
+
.object({
|
|
52
|
+
service: z.literal('cassa_in_cloud'),
|
|
53
|
+
data: integrationCassaInCloudDataSchema.optional(),
|
|
54
|
+
})
|
|
55
|
+
.merge(writableIntegrationActivationRequestBaseSchema),
|
|
56
|
+
])
|
|
57
|
+
export type UpdateIntegrationActivationRequestInput = z.infer<
|
|
58
|
+
typeof updateIntegrationActivationRequestInputSchema
|
|
59
|
+
>
|
|
60
|
+
|
|
61
|
+
export const updateIntegrationActivationRequestResponseSchema =
|
|
62
|
+
integrationActivationRequestDetailsSchema
|
|
63
|
+
export type UpdateIntegrationActivationRequestResponse = IntegrationActivationRequestDetails
|
|
64
|
+
|
|
65
|
+
export class UpdateIntegrationActivationRequest extends AbstractApiRequest<
|
|
66
|
+
UpdateIntegrationActivationRequestInput,
|
|
67
|
+
UpdateIntegrationActivationRequestResponse
|
|
68
|
+
> {
|
|
69
|
+
readonly method = 'PATCH'
|
|
70
|
+
readonly contentType = 'application/merge-patch+json'
|
|
71
|
+
readonly accept = 'application/json'
|
|
72
|
+
|
|
73
|
+
readonly inputSchema = updateIntegrationActivationRequestInputSchema
|
|
74
|
+
readonly outputSchema = updateIntegrationActivationRequestResponseSchema
|
|
75
|
+
readonly querySchema = undefined
|
|
76
|
+
readonly headersSchema = undefined
|
|
77
|
+
|
|
78
|
+
private readonly integrationActivationRequestId: string
|
|
79
|
+
|
|
80
|
+
constructor(
|
|
81
|
+
integrationActivationRequestId: string,
|
|
82
|
+
input: UpdateIntegrationActivationRequestInput,
|
|
83
|
+
) {
|
|
84
|
+
super(input)
|
|
85
|
+
this.integrationActivationRequestId = integrationActivationRequestId
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
getPath(): string {
|
|
89
|
+
return `/integrations/activation_requests/${this.integrationActivationRequestId}`
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './ActivateIntegrationActivationRequest'
|
|
2
|
+
export * from './AnnotateIntegrationActivationRequest'
|
|
3
|
+
export * from './CreateIntegrationActivationRequest'
|
|
4
|
+
export * from './DeleteIntegrationActivationRequest'
|
|
5
|
+
export * from './GetIntegrationActivationRequestDetails'
|
|
6
|
+
export * from './GetIntegrationActivationRequests'
|
|
7
|
+
export * from './RespondIntegrationActivationRequest'
|
|
8
|
+
export * from './SendIntegrationActivationRequestToPartner'
|
|
9
|
+
export * from './UpdateIntegrationActivationRequest'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IntegrationCancellationRequestDetails,
|
|
6
|
+
integrationCancellationRequestDetailsSchema,
|
|
7
|
+
} from '../../cancellation-request'
|
|
8
|
+
|
|
9
|
+
export const cancelIntegrationCancellationRequestInputSchema = z.undefined()
|
|
10
|
+
|
|
11
|
+
export const cancelIntegrationCancellationRequestResponseSchema =
|
|
12
|
+
integrationCancellationRequestDetailsSchema
|
|
13
|
+
export type CancelIntegrationCancellationRequestResponse = IntegrationCancellationRequestDetails
|
|
14
|
+
|
|
15
|
+
export class CancelIntegrationCancellationRequest extends AbstractApiRequest<
|
|
16
|
+
void,
|
|
17
|
+
CancelIntegrationCancellationRequestResponse
|
|
18
|
+
> {
|
|
19
|
+
readonly method = 'POST'
|
|
20
|
+
readonly contentType = 'application/json'
|
|
21
|
+
readonly accept = 'application/json'
|
|
22
|
+
|
|
23
|
+
readonly inputSchema = cancelIntegrationCancellationRequestInputSchema
|
|
24
|
+
readonly outputSchema = cancelIntegrationCancellationRequestResponseSchema
|
|
25
|
+
readonly querySchema = undefined
|
|
26
|
+
readonly headersSchema = undefined
|
|
27
|
+
|
|
28
|
+
private readonly integrationCancellationRequestId: string
|
|
29
|
+
|
|
30
|
+
constructor(integrationCancellationRequestId: string) {
|
|
31
|
+
super()
|
|
32
|
+
this.integrationCancellationRequestId = integrationCancellationRequestId
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getPath(): string {
|
|
36
|
+
return `/integrations/cancellation_requests/${this.integrationCancellationRequestId}/cancel`
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IntegrationCancellationRequestDetails,
|
|
6
|
+
integrationCancellationRequestDetailsSchema,
|
|
7
|
+
} from '../../cancellation-request'
|
|
8
|
+
import { integrationPathSchema } from '../../types'
|
|
9
|
+
|
|
10
|
+
export const createIntegrationCancellationRequestInputSchema = z.object({
|
|
11
|
+
integration: integrationPathSchema,
|
|
12
|
+
})
|
|
13
|
+
export type CreateIntegrationCancellationRequestInput = z.infer<
|
|
14
|
+
typeof createIntegrationCancellationRequestInputSchema
|
|
15
|
+
>
|
|
16
|
+
|
|
17
|
+
export const createIntegrationCancellationRequestResponseSchema =
|
|
18
|
+
integrationCancellationRequestDetailsSchema
|
|
19
|
+
export type CreateIntegrationCancellationRequestResponse = IntegrationCancellationRequestDetails
|
|
20
|
+
|
|
21
|
+
export class CreateIntegrationCancellationRequest extends AbstractApiRequest<
|
|
22
|
+
CreateIntegrationCancellationRequestInput,
|
|
23
|
+
CreateIntegrationCancellationRequestResponse
|
|
24
|
+
> {
|
|
25
|
+
readonly method = 'POST'
|
|
26
|
+
readonly contentType = 'application/json'
|
|
27
|
+
readonly accept = 'application/json'
|
|
28
|
+
|
|
29
|
+
readonly inputSchema = createIntegrationCancellationRequestInputSchema
|
|
30
|
+
readonly outputSchema = createIntegrationCancellationRequestResponseSchema
|
|
31
|
+
readonly querySchema = undefined
|
|
32
|
+
readonly headersSchema = undefined
|
|
33
|
+
|
|
34
|
+
constructor(input: CreateIntegrationCancellationRequestInput) {
|
|
35
|
+
super(input)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getPath(): string {
|
|
39
|
+
return '/integrations/cancellation_requests'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
export const deleteIntegrationCancellationRequestInputSchema = z.undefined()
|
|
5
|
+
export const deleteIntegrationCancellationRequestResponseSchema = z.undefined()
|
|
6
|
+
|
|
7
|
+
export class DeleteIntegrationCancellationRequest extends AbstractApiRequest<void, void> {
|
|
8
|
+
readonly method = 'DELETE'
|
|
9
|
+
readonly contentType = 'application/json'
|
|
10
|
+
readonly accept = 'application/json'
|
|
11
|
+
|
|
12
|
+
readonly inputSchema = deleteIntegrationCancellationRequestInputSchema
|
|
13
|
+
readonly outputSchema = deleteIntegrationCancellationRequestResponseSchema
|
|
14
|
+
readonly querySchema = undefined
|
|
15
|
+
readonly headersSchema = undefined
|
|
16
|
+
|
|
17
|
+
private readonly integrationCancellationRequestId: string
|
|
18
|
+
|
|
19
|
+
constructor(integrationCancellationRequestId: string) {
|
|
20
|
+
super()
|
|
21
|
+
this.integrationCancellationRequestId = integrationCancellationRequestId
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getPath(): string {
|
|
25
|
+
return `/integrations/cancellation_requests/${this.integrationCancellationRequestId}`
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IntegrationCancellationRequestDetails,
|
|
6
|
+
integrationCancellationRequestDetailsSchema,
|
|
7
|
+
} from '../../cancellation-request'
|
|
8
|
+
|
|
9
|
+
export const getIntegrationCancellationRequestDetailsInputSchema = z.undefined()
|
|
10
|
+
|
|
11
|
+
export const getIntegrationCancellationRequestDetailsResponseSchema =
|
|
12
|
+
integrationCancellationRequestDetailsSchema
|
|
13
|
+
export type GetIntegrationCancellationRequestDetailsResponse = IntegrationCancellationRequestDetails
|
|
14
|
+
|
|
15
|
+
export class GetIntegrationCancellationRequestDetails extends AbstractApiRequest<
|
|
16
|
+
void,
|
|
17
|
+
GetIntegrationCancellationRequestDetailsResponse
|
|
18
|
+
> {
|
|
19
|
+
readonly method = 'GET'
|
|
20
|
+
readonly contentType = 'application/json'
|
|
21
|
+
readonly accept = 'application/json'
|
|
22
|
+
readonly inputSchema = getIntegrationCancellationRequestDetailsInputSchema
|
|
23
|
+
readonly outputSchema = getIntegrationCancellationRequestDetailsResponseSchema
|
|
24
|
+
readonly querySchema = undefined
|
|
25
|
+
readonly headersSchema = undefined
|
|
26
|
+
|
|
27
|
+
private readonly integrationCancellationRequestId: string
|
|
28
|
+
|
|
29
|
+
constructor(integrationCancellationRequestId: string) {
|
|
30
|
+
super()
|
|
31
|
+
this.integrationCancellationRequestId = integrationCancellationRequestId
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
getPath(): string {
|
|
35
|
+
return `/integrations/cancellation_requests/${this.integrationCancellationRequestId}`
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
+
import {
|
|
3
|
+
createPaginatedSchema,
|
|
4
|
+
Paginated,
|
|
5
|
+
responseToPagination,
|
|
6
|
+
sortDirSchema,
|
|
7
|
+
timestampsFilterSchema,
|
|
8
|
+
} from '@deliverart/sdk-js-global-types'
|
|
9
|
+
import { AxiosResponse } from 'axios'
|
|
10
|
+
import { z } from 'zod'
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
IntegrationCancellationRequest,
|
|
14
|
+
integrationCancellationRequestSchema,
|
|
15
|
+
} from '../../cancellation-request'
|
|
16
|
+
import { integrationCancellationRequestStatusSchema } from '../../cancellation-request-types'
|
|
17
|
+
|
|
18
|
+
export const getIntegrationCancellationRequestsQuerySchema = z
|
|
19
|
+
.object({
|
|
20
|
+
'order[createdAt]': sortDirSchema.optional(),
|
|
21
|
+
'order[updatedAt]': sortDirSchema.optional(),
|
|
22
|
+
status: integrationCancellationRequestStatusSchema.optional(),
|
|
23
|
+
'status[]': z.array(integrationCancellationRequestStatusSchema).optional(),
|
|
24
|
+
page: z.coerce.number().optional(),
|
|
25
|
+
})
|
|
26
|
+
.merge(timestampsFilterSchema)
|
|
27
|
+
export type GetIntegrationCancellationRequestsQueryParams = z.infer<
|
|
28
|
+
typeof getIntegrationCancellationRequestsQuerySchema
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
export const getIntegrationCancellationRequestsResponseSchema = createPaginatedSchema(
|
|
32
|
+
integrationCancellationRequestSchema,
|
|
33
|
+
)
|
|
34
|
+
export type GetIntegrationCancellationRequestsResponse = z.infer<
|
|
35
|
+
typeof getIntegrationCancellationRequestsResponseSchema
|
|
36
|
+
>
|
|
37
|
+
|
|
38
|
+
export const getIntegrationCancellationRequestsInputSchema = z.undefined()
|
|
39
|
+
|
|
40
|
+
export class GetIntegrationCancellationRequests extends AbstractApiRequest<
|
|
41
|
+
void,
|
|
42
|
+
GetIntegrationCancellationRequestsResponse,
|
|
43
|
+
GetIntegrationCancellationRequestsQueryParams
|
|
44
|
+
> {
|
|
45
|
+
readonly method = 'GET'
|
|
46
|
+
readonly contentType = 'application/json'
|
|
47
|
+
readonly accept = 'application/json'
|
|
48
|
+
|
|
49
|
+
readonly inputSchema = getIntegrationCancellationRequestsInputSchema
|
|
50
|
+
readonly outputSchema = getIntegrationCancellationRequestsResponseSchema
|
|
51
|
+
readonly querySchema = getIntegrationCancellationRequestsQuerySchema
|
|
52
|
+
readonly headersSchema = undefined
|
|
53
|
+
|
|
54
|
+
constructor(options?: { query?: GetIntegrationCancellationRequestsQueryParams }) {
|
|
55
|
+
super(undefined, options)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
getPath(): string {
|
|
59
|
+
return '/integrations/cancellation_requests'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
parseResponse(
|
|
63
|
+
data: unknown,
|
|
64
|
+
rawResponse: AxiosResponse,
|
|
65
|
+
): Paginated<IntegrationCancellationRequest> {
|
|
66
|
+
const integrations = z.array(integrationCancellationRequestSchema).parse(data)
|
|
67
|
+
return this.validateOutput({
|
|
68
|
+
data: integrations,
|
|
69
|
+
pagination: responseToPagination(rawResponse),
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './CancelIntegrationCancellationRequest'
|
|
2
|
+
export * from './CreateIntegrationCancellationRequest'
|
|
3
|
+
export * from './DeleteIntegrationCancellationRequest'
|
|
4
|
+
export * from './GetIntegrationCancellationRequestDetails'
|
|
5
|
+
export * from './GetIntegrationCancellationRequests'
|