@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.
Files changed (113) hide show
  1. package/.changeset/config.json +11 -0
  2. package/.github/workflows/workflow.yml +47 -0
  3. package/.prettierrc +7 -0
  4. package/README.md +3 -0
  5. package/dist/index.cjs +3660 -0
  6. package/dist/index.d.cts +32181 -0
  7. package/dist/index.d.ts +32181 -0
  8. package/dist/index.js +3385 -0
  9. package/eslint.config.js +37 -0
  10. package/package.json +48 -0
  11. package/src/activatable-integration-data-schemas.ts +50 -0
  12. package/src/activatable-integration-types.ts +17 -0
  13. package/src/activatable-integration.ts +86 -0
  14. package/src/activation-request.ts +53 -0
  15. package/src/cancellation-request-types.ts +34 -0
  16. package/src/cancellation-request.ts +21 -0
  17. package/src/index.ts +9 -0
  18. package/src/integration-schemas.ts +31 -0
  19. package/src/requests/DeleteIntegration.ts +27 -0
  20. package/src/requests/GetIntegrationDetails.ts +30 -0
  21. package/src/requests/GetIntegrations.ts +63 -0
  22. package/src/requests/UpdateIntegration.ts +36 -0
  23. package/src/requests/activation-requests/ActivateIntegrationActivationRequest.ts +38 -0
  24. package/src/requests/activation-requests/AnnotateIntegrationActivationRequest.ts +46 -0
  25. package/src/requests/activation-requests/CreateIntegrationActivationRequest.ts +80 -0
  26. package/src/requests/activation-requests/DeleteIntegrationActivationRequest.ts +27 -0
  27. package/src/requests/activation-requests/GetIntegrationActivationRequestDetails.ts +37 -0
  28. package/src/requests/activation-requests/GetIntegrationActivationRequests.ts +86 -0
  29. package/src/requests/activation-requests/RespondIntegrationActivationRequest.ts +58 -0
  30. package/src/requests/activation-requests/SendIntegrationActivationRequestToPartner.ts +38 -0
  31. package/src/requests/activation-requests/UpdateIntegrationActivationRequest.ts +91 -0
  32. package/src/requests/activation-requests/index.ts +9 -0
  33. package/src/requests/cancellation-requests/CancelIntegrationCancellationRequest.ts +38 -0
  34. package/src/requests/cancellation-requests/CreateIntegrationCancellationRequest.ts +41 -0
  35. package/src/requests/cancellation-requests/DeleteIntegrationCancellationRequest.ts +27 -0
  36. package/src/requests/cancellation-requests/GetIntegrationCancellationRequestDetails.ts +37 -0
  37. package/src/requests/cancellation-requests/GetIntegrationCancellationRequests.ts +72 -0
  38. package/src/requests/cancellation-requests/index.ts +5 -0
  39. package/src/requests/index.ts +7 -0
  40. package/src/requests/services/cassa_in_cloud/CreateIntegrationCassaInCloud.ts +42 -0
  41. package/src/requests/services/cassa_in_cloud/DeleteIntegrationCassaInCloud.ts +27 -0
  42. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudClientLogRequestDetails.ts +40 -0
  43. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudClientLogRequests.ts +64 -0
  44. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudDetails.ts +36 -0
  45. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudList.ts +61 -0
  46. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudSyncMenuProcessDetails.ts +40 -0
  47. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudSyncMenuProcesses.ts +69 -0
  48. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudWebHookEventDetails.ts +40 -0
  49. package/src/requests/services/cassa_in_cloud/GetIntegrationCassaInCloudWebHookEvents.ts +69 -0
  50. package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncCustomers.ts +27 -0
  51. package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncOrganizations.ts +27 -0
  52. package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncProducts.ts +27 -0
  53. package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncSalesModes.ts +27 -0
  54. package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncStock.ts +27 -0
  55. package/src/requests/services/cassa_in_cloud/IntegrationCassaInCloudSyncTimetables.ts +27 -0
  56. package/src/requests/services/cassa_in_cloud/UpdateIntegrationCassaInCloud.ts +39 -0
  57. package/src/requests/services/cassa_in_cloud/index.ts +17 -0
  58. package/src/requests/services/deliveroo/CreateIntegrationDeliveroo.ts +40 -0
  59. package/src/requests/services/deliveroo/DeleteIntegrationDeliveroo.ts +27 -0
  60. package/src/requests/services/deliveroo/GetIntegrationDeliverooClientLogRequestDetails.ts +40 -0
  61. package/src/requests/services/deliveroo/GetIntegrationDeliverooClientLogRequests.ts +64 -0
  62. package/src/requests/services/deliveroo/GetIntegrationDeliverooDetails.ts +36 -0
  63. package/src/requests/services/deliveroo/GetIntegrationDeliverooList.ts +61 -0
  64. package/src/requests/services/deliveroo/GetIntegrationDeliverooMenuVersionDetails.ts +35 -0
  65. package/src/requests/services/deliveroo/GetIntegrationDeliverooMenuVersions.ts +62 -0
  66. package/src/requests/services/deliveroo/GetIntegrationDeliverooSyncMenuProcessDetails.ts +40 -0
  67. package/src/requests/services/deliveroo/GetIntegrationDeliverooSyncMenuProcesses.ts +69 -0
  68. package/src/requests/services/deliveroo/GetIntegrationDeliverooWebhookEventDetails.ts +40 -0
  69. package/src/requests/services/deliveroo/GetIntegrationDeliverooWebhookEvents.ts +69 -0
  70. package/src/requests/services/deliveroo/IntegrationDeliverooSyncMenu.ts +27 -0
  71. package/src/requests/services/deliveroo/IntegrationDeliverooSyncOpeningHours.ts +27 -0
  72. package/src/requests/services/deliveroo/UpdateIntegrationDeliveroo.ts +39 -0
  73. package/src/requests/services/deliveroo/UpdateIntegrationDeliverooSiteStatus.ts +43 -0
  74. package/src/requests/services/deliveroo/index.ts +16 -0
  75. package/src/requests/services/glovo/CreateIntegrationGlovo.ts +39 -0
  76. package/src/requests/services/glovo/DeleteIntegrationGlovo.ts +27 -0
  77. package/src/requests/services/glovo/GetIntegrationGlovoClientLogRequestDetails.ts +39 -0
  78. package/src/requests/services/glovo/GetIntegrationGlovoClientLogRequests.ts +64 -0
  79. package/src/requests/services/glovo/GetIntegrationGlovoDetails.ts +36 -0
  80. package/src/requests/services/glovo/GetIntegrationGlovoList.ts +55 -0
  81. package/src/requests/services/glovo/GetIntegrationGlovoMenuUpdateDetails.ts +39 -0
  82. package/src/requests/services/glovo/GetIntegrationGlovoMenuUpdates.ts +66 -0
  83. package/src/requests/services/glovo/GetIntegrationGlovoMenuVersionDetails.ts +35 -0
  84. package/src/requests/services/glovo/GetIntegrationGlovoMenuVersions.ts +62 -0
  85. package/src/requests/services/glovo/GetIntegrationGlovoWebhookEventDetails.ts +39 -0
  86. package/src/requests/services/glovo/GetIntegrationGlovoWebhookEvents.ts +68 -0
  87. package/src/requests/services/glovo/IntegrationGlovoSyncMenu.ts +27 -0
  88. package/src/requests/services/glovo/UpdateIntegrationGlovo.ts +39 -0
  89. package/src/requests/services/glovo/UpdateIntegrationGlovoStoreStatus.ts +43 -0
  90. package/src/requests/services/glovo/index.ts +15 -0
  91. package/src/requests/services/index.ts +4 -0
  92. package/src/requests/services/justeat/CreateIntegrationJustEat.ts +39 -0
  93. package/src/requests/services/justeat/DeleteIntegrationJustEat.ts +27 -0
  94. package/src/requests/services/justeat/GetIntegrationJustEatClientLogRequestDetails.ts +40 -0
  95. package/src/requests/services/justeat/GetIntegrationJustEatClientLogRequests.ts +64 -0
  96. package/src/requests/services/justeat/GetIntegrationJustEatDetails.ts +36 -0
  97. package/src/requests/services/justeat/GetIntegrationJustEatList.ts +60 -0
  98. package/src/requests/services/justeat/GetIntegrationJustEatMenuVersionDetails.ts +35 -0
  99. package/src/requests/services/justeat/GetIntegrationJustEatMenuVersions.ts +62 -0
  100. package/src/requests/services/justeat/GetIntegrationJustEatSyncMenuProcessDetails.ts +40 -0
  101. package/src/requests/services/justeat/GetIntegrationJustEatSyncMenuProcesses.ts +69 -0
  102. package/src/requests/services/justeat/IntegrationJustEatSyncMenu.ts +27 -0
  103. package/src/requests/services/justeat/IntegrationJustEatSyncOpeningTimes.ts +27 -0
  104. package/src/requests/services/justeat/UpdateIntegrationJustEat.ts +39 -0
  105. package/src/requests/services/justeat/UpdateIntegrationJustEatRestaurantStatus.ts +44 -0
  106. package/src/requests/services/justeat/index.ts +14 -0
  107. package/src/schemas.ts +97 -0
  108. package/src/service-schemas/cassa_in_cloud.ts +154 -0
  109. package/src/service-schemas/deliveroo.ts +159 -0
  110. package/src/service-schemas/glovo.ts +153 -0
  111. package/src/service-schemas/justeat.ts +121 -0
  112. package/src/types.ts +227 -0
  113. package/tsconfig.json +15 -0
@@ -0,0 +1,27 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ export const integrationDeliverooSyncOpeningHoursInputSchema = z.undefined()
5
+ export const integrationDeliverooSyncOpeningHoursResponseSchema = z.undefined()
6
+
7
+ export class IntegrationDeliverooSyncOpeningHours extends AbstractApiRequest<void, void> {
8
+ readonly method = 'POST'
9
+ readonly contentType = 'application/json'
10
+ readonly accept = 'application/json'
11
+
12
+ readonly inputSchema = integrationDeliverooSyncOpeningHoursInputSchema
13
+ readonly outputSchema = integrationDeliverooSyncOpeningHoursResponseSchema
14
+ readonly querySchema = undefined
15
+ readonly headersSchema = undefined
16
+
17
+ private readonly integrationDeliverooId: string
18
+
19
+ constructor(integrationDeliverooId: string) {
20
+ super()
21
+ this.integrationDeliverooId = integrationDeliverooId
22
+ }
23
+
24
+ getPath(): string {
25
+ return `/integrations/deliveroo/${this.integrationDeliverooId}/sync/opening_hours`
26
+ }
27
+ }
@@ -0,0 +1,39 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+
3
+ import {
4
+ IntegrationDeliverooDetails,
5
+ integrationDeliverooDetailsSchema,
6
+ IntegrationDeliverooEditableFields,
7
+ integrationDeliverooEditableFieldsSchema,
8
+ } from '../../../service-schemas/deliveroo'
9
+
10
+ export const updateIntegrationDeliverooInputSchema = integrationDeliverooEditableFieldsSchema
11
+ export type UpdateIntegrationDeliverooInput = IntegrationDeliverooEditableFields
12
+
13
+ export const updateIntegrationDeliverooResponseSchema = integrationDeliverooDetailsSchema
14
+ export type UpdateIntegrationDeliverooResponse = IntegrationDeliverooDetails
15
+
16
+ export class UpdateIntegrationDeliveroo extends AbstractApiRequest<
17
+ UpdateIntegrationDeliverooInput,
18
+ UpdateIntegrationDeliverooResponse
19
+ > {
20
+ readonly method = 'PATCH'
21
+ readonly contentType = 'application/merge-patch+json'
22
+ readonly accept = 'application/json'
23
+
24
+ readonly inputSchema = updateIntegrationDeliverooInputSchema
25
+ readonly outputSchema = updateIntegrationDeliverooResponseSchema
26
+ readonly querySchema = undefined
27
+ readonly headersSchema = undefined
28
+
29
+ private readonly integrationDeliverooId: string
30
+
31
+ constructor(integrationDeliverooId: string, input: UpdateIntegrationDeliverooInput) {
32
+ super(input)
33
+ this.integrationDeliverooId = integrationDeliverooId
34
+ }
35
+
36
+ getPath(): string {
37
+ return `/integrations/deliveroo/${this.integrationDeliverooId}`
38
+ }
39
+ }
@@ -0,0 +1,43 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ import {
5
+ IntegrationDeliverooDetails,
6
+ integrationDeliverooDetailsSchema,
7
+ } from '../../../service-schemas/deliveroo'
8
+ import { integrationDeliverooSiteStatusSchema } from '../../../types'
9
+
10
+ export const updateIntegrationDeliverooSiteStatusInputSchema = z.object({
11
+ status: integrationDeliverooSiteStatusSchema,
12
+ })
13
+ export type UpdateIntegrationDeliverooSiteStatusInput = z.infer<
14
+ typeof updateIntegrationDeliverooSiteStatusInputSchema
15
+ >
16
+
17
+ export const updateIntegrationDeliverooSiteStatusResponseSchema = integrationDeliverooDetailsSchema
18
+ export type UpdateIntegrationDeliverooSiteStatusResponse = IntegrationDeliverooDetails
19
+
20
+ export class UpdateIntegrationDeliverooSiteStatus extends AbstractApiRequest<
21
+ UpdateIntegrationDeliverooSiteStatusInput,
22
+ UpdateIntegrationDeliverooSiteStatusResponse
23
+ > {
24
+ readonly method = 'POST'
25
+ readonly contentType = 'application/json'
26
+ readonly accept = 'application/json'
27
+
28
+ readonly inputSchema = updateIntegrationDeliverooSiteStatusInputSchema
29
+ readonly outputSchema = updateIntegrationDeliverooSiteStatusResponseSchema
30
+ readonly querySchema = undefined
31
+ readonly headersSchema = undefined
32
+
33
+ private readonly integrationDeliverooId: string
34
+
35
+ constructor(integrationDeliverooId: string, input: UpdateIntegrationDeliverooSiteStatusInput) {
36
+ super(input)
37
+ this.integrationDeliverooId = integrationDeliverooId
38
+ }
39
+
40
+ getPath(): string {
41
+ return `/integrations/deliveroo/${this.integrationDeliverooId}/site/status`
42
+ }
43
+ }
@@ -0,0 +1,16 @@
1
+ export * from './CreateIntegrationDeliveroo'
2
+ export * from './DeleteIntegrationDeliveroo'
3
+ export * from './GetIntegrationDeliverooClientLogRequestDetails'
4
+ export * from './GetIntegrationDeliverooClientLogRequests'
5
+ export * from './GetIntegrationDeliverooDetails'
6
+ export * from './GetIntegrationDeliverooList'
7
+ export * from './GetIntegrationDeliverooMenuVersionDetails'
8
+ export * from './GetIntegrationDeliverooMenuVersions'
9
+ export * from './GetIntegrationDeliverooSyncMenuProcessDetails'
10
+ export * from './GetIntegrationDeliverooSyncMenuProcesses'
11
+ export * from './GetIntegrationDeliverooWebhookEventDetails'
12
+ export * from './GetIntegrationDeliverooWebhookEvents'
13
+ export * from './IntegrationDeliverooSyncMenu'
14
+ export * from './IntegrationDeliverooSyncOpeningHours'
15
+ export * from './UpdateIntegrationDeliveroo'
16
+ export * from './UpdateIntegrationDeliverooSiteStatus'
@@ -0,0 +1,39 @@
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
+ IntegrationGlovoDetails,
7
+ integrationGlovoDetailsSchema,
8
+ integrationGlovoEditableFieldsSchema,
9
+ } from '../../../service-schemas/glovo'
10
+
11
+ export const createIntegrationGlovoInputSchema = integrationGlovoEditableFieldsSchema.extend({
12
+ pointOfSale: pointOfSalePathSchema,
13
+ })
14
+ export type CreateIntegrationGlovoInput = z.infer<typeof createIntegrationGlovoInputSchema>
15
+
16
+ export const createIntegrationGlovoResponseSchema = integrationGlovoDetailsSchema
17
+ export type CreateIntegrationGlovoResponse = IntegrationGlovoDetails
18
+
19
+ export class CreateIntegrationGlovo extends AbstractApiRequest<
20
+ CreateIntegrationGlovoInput,
21
+ CreateIntegrationGlovoResponse
22
+ > {
23
+ readonly method = 'POST'
24
+ readonly contentType = 'application/json'
25
+ readonly accept = 'application/json'
26
+
27
+ readonly inputSchema = createIntegrationGlovoInputSchema
28
+ readonly outputSchema = createIntegrationGlovoResponseSchema
29
+ readonly querySchema = undefined
30
+ readonly headersSchema = undefined
31
+
32
+ constructor(input: CreateIntegrationGlovoInput) {
33
+ super(input)
34
+ }
35
+
36
+ getPath(): string {
37
+ return '/integrations/glovo'
38
+ }
39
+ }
@@ -0,0 +1,27 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ export const deleteIntegrationGlovoInputSchema = z.undefined()
5
+ export const deleteIntegrationGlovoResponseSchema = z.undefined()
6
+
7
+ export class DeleteIntegrationGlovo extends AbstractApiRequest<void, void> {
8
+ readonly method = 'DELETE'
9
+ readonly contentType = 'application/json'
10
+ readonly accept = 'application/json'
11
+
12
+ readonly inputSchema = deleteIntegrationGlovoInputSchema
13
+ readonly outputSchema = deleteIntegrationGlovoResponseSchema
14
+ readonly querySchema = undefined
15
+ readonly headersSchema = undefined
16
+
17
+ private readonly integrationGlovoId: string
18
+
19
+ constructor(integrationGlovoId: string) {
20
+ super()
21
+ this.integrationGlovoId = integrationGlovoId
22
+ }
23
+
24
+ getPath(): string {
25
+ return `/integrations/glovo/${this.integrationGlovoId}`
26
+ }
27
+ }
@@ -0,0 +1,39 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ import {
5
+ IntegrationClientLogRequestDetails,
6
+ integrationClientLogRequestDetailsSchema,
7
+ } from '../../../schemas'
8
+
9
+ export const getIntegrationGlovoClientLogRequestDetailsInputSchema = z.undefined()
10
+
11
+ export const getIntegrationGlovoClientLogRequestDetailsResponseSchema =
12
+ integrationClientLogRequestDetailsSchema
13
+ export type GetIntegrationGlovoClientLogRequestDetailsResponse = IntegrationClientLogRequestDetails
14
+
15
+ export class GetIntegrationGlovoClientLogRequestDetails extends AbstractApiRequest<
16
+ void,
17
+ GetIntegrationGlovoClientLogRequestDetailsResponse
18
+ > {
19
+ readonly method = 'GET'
20
+ readonly contentType = 'application/json'
21
+ readonly accept = 'application/json'
22
+ readonly inputSchema = getIntegrationGlovoClientLogRequestDetailsInputSchema
23
+ readonly outputSchema = getIntegrationGlovoClientLogRequestDetailsResponseSchema
24
+ readonly querySchema = undefined
25
+ readonly headersSchema = undefined
26
+
27
+ private readonly integrationGlovoId: string
28
+ private readonly requestId: string
29
+
30
+ constructor(integrationGlovoId: string, requestId: string) {
31
+ super()
32
+ this.integrationGlovoId = integrationGlovoId
33
+ this.requestId = requestId
34
+ }
35
+
36
+ getPath(): string {
37
+ return `/integrations/glovo/${this.integrationGlovoId}/client_log_requests/${this.requestId}`
38
+ }
39
+ }
@@ -0,0 +1,64 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import {
3
+ createPaginatedSchema,
4
+ Paginated,
5
+ responseToPagination,
6
+ } from '@deliverart/sdk-js-global-types'
7
+ import { AxiosResponse } from 'axios'
8
+ import { z } from 'zod'
9
+
10
+ import {
11
+ ClientLogRequestQuery,
12
+ clientLogRequestQuerySchema,
13
+ IntegrationClientLogRequest,
14
+ integrationClientLogRequestSchema,
15
+ } from '../../../schemas'
16
+
17
+ export const getIntegrationGlovoClientLogRequestsQuerySchema = clientLogRequestQuerySchema
18
+ export type GetIntegrationGlovoClientLogRequestsQueryParams = ClientLogRequestQuery
19
+
20
+ export const getIntegrationGlovoClientLogRequestsResponseSchema = createPaginatedSchema(
21
+ integrationClientLogRequestSchema,
22
+ )
23
+ export type GetIntegrationGlovoClientLogRequestsResponse = z.infer<
24
+ typeof getIntegrationGlovoClientLogRequestsResponseSchema
25
+ >
26
+
27
+ export const getIntegrationGlovoClientLogRequestsInputSchema = z.undefined()
28
+
29
+ export class GetIntegrationGlovoClientLogRequests extends AbstractApiRequest<
30
+ void,
31
+ GetIntegrationGlovoClientLogRequestsResponse,
32
+ GetIntegrationGlovoClientLogRequestsQueryParams
33
+ > {
34
+ readonly method = 'GET'
35
+ readonly contentType = 'application/json'
36
+ readonly accept = 'application/json'
37
+
38
+ readonly inputSchema = getIntegrationGlovoClientLogRequestsInputSchema
39
+ readonly outputSchema = getIntegrationGlovoClientLogRequestsResponseSchema
40
+ readonly querySchema = getIntegrationGlovoClientLogRequestsQuerySchema
41
+ readonly headersSchema = undefined
42
+
43
+ private readonly integrationGlovoId: string
44
+
45
+ constructor(
46
+ integrationGlovoId: string,
47
+ options?: { query?: GetIntegrationGlovoClientLogRequestsQueryParams },
48
+ ) {
49
+ super(undefined, options)
50
+ this.integrationGlovoId = integrationGlovoId
51
+ }
52
+
53
+ getPath(): string {
54
+ return `/integrations/glovo/${this.integrationGlovoId}/client_log_requests`
55
+ }
56
+
57
+ parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<IntegrationClientLogRequest> {
58
+ const integrations = z.array(integrationClientLogRequestSchema).parse(data)
59
+ return this.validateOutput({
60
+ data: integrations,
61
+ pagination: responseToPagination(rawResponse),
62
+ })
63
+ }
64
+ }
@@ -0,0 +1,36 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ import {
5
+ IntegrationGlovoDetails,
6
+ integrationGlovoDetailsSchema,
7
+ } from '../../../service-schemas/glovo'
8
+
9
+ export const getIntegrationGlovoDetailsInputSchema = z.undefined()
10
+
11
+ export const getIntegrationGlovoDetailsResponseSchema = integrationGlovoDetailsSchema
12
+ export type GetIntegrationGlovoDetailsResponse = IntegrationGlovoDetails
13
+
14
+ export class GetIntegrationGlovoDetails extends AbstractApiRequest<
15
+ void,
16
+ GetIntegrationGlovoDetailsResponse
17
+ > {
18
+ readonly method = 'GET'
19
+ readonly contentType = 'application/json'
20
+ readonly accept = 'application/json'
21
+ readonly inputSchema = getIntegrationGlovoDetailsInputSchema
22
+ readonly outputSchema = getIntegrationGlovoDetailsResponseSchema
23
+ readonly querySchema = undefined
24
+ readonly headersSchema = undefined
25
+
26
+ private readonly integrationGlovoId: string
27
+
28
+ constructor(integrationGlovoId: string) {
29
+ super()
30
+ this.integrationGlovoId = integrationGlovoId
31
+ }
32
+
33
+ getPath(): string {
34
+ return `/integrations/glovo/${this.integrationGlovoId}`
35
+ }
36
+ }
@@ -0,0 +1,55 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import {
3
+ createPaginatedSchema,
4
+ Paginated,
5
+ responseToPagination,
6
+ } from '@deliverart/sdk-js-global-types'
7
+ import { AxiosResponse } from 'axios'
8
+ import { z } from 'zod'
9
+
10
+ import {
11
+ IntegrationGlovo,
12
+ integrationGlovoSchema,
13
+ integrationsGlovoQuerySchema,
14
+ } from '../../../service-schemas/glovo'
15
+
16
+ export const getIntegrationGlovoListQuerySchema = integrationsGlovoQuerySchema.omit({
17
+ service: true,
18
+ })
19
+ export type GetIntegrationGlovoListQueryParams = z.infer<typeof getIntegrationGlovoListQuerySchema>
20
+
21
+ export const getIntegrationGlovoListResponseSchema = createPaginatedSchema(integrationGlovoSchema)
22
+ export type GetIntegrationGlovoListResponse = z.infer<typeof getIntegrationGlovoListResponseSchema>
23
+
24
+ export const getIntegrationGlovoListInputSchema = z.undefined()
25
+
26
+ export class GetIntegrationGlovoList extends AbstractApiRequest<
27
+ void,
28
+ GetIntegrationGlovoListResponse,
29
+ GetIntegrationGlovoListQueryParams
30
+ > {
31
+ readonly method = 'GET'
32
+ readonly contentType = 'application/json'
33
+ readonly accept = 'application/json'
34
+
35
+ readonly inputSchema = getIntegrationGlovoListInputSchema
36
+ readonly outputSchema = getIntegrationGlovoListResponseSchema
37
+ readonly querySchema = getIntegrationGlovoListQuerySchema
38
+ readonly headersSchema = undefined
39
+
40
+ constructor(options?: { query?: GetIntegrationGlovoListQueryParams }) {
41
+ super(undefined, options)
42
+ }
43
+
44
+ getPath(): string {
45
+ return '/integrations/glovo'
46
+ }
47
+
48
+ parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<IntegrationGlovo> {
49
+ const integrations = z.array(integrationGlovoSchema).parse(data)
50
+ return this.validateOutput({
51
+ data: integrations,
52
+ pagination: responseToPagination(rawResponse),
53
+ })
54
+ }
55
+ }
@@ -0,0 +1,39 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ import {
5
+ IntegrationGlovoMenuUpdateDetails,
6
+ integrationGlovoMenuUpdateDetailsSchema,
7
+ } from '../../../service-schemas/glovo'
8
+
9
+ export const getIntegrationGlovoMenuUpdateDetailsInputSchema = z.undefined()
10
+
11
+ export const getIntegrationGlovoMenuUpdateDetailsResponseSchema =
12
+ integrationGlovoMenuUpdateDetailsSchema
13
+ export type GetIntegrationGlovoMenuUpdateDetailsResponse = IntegrationGlovoMenuUpdateDetails
14
+
15
+ export class GetIntegrationGlovoMenuUpdateDetails extends AbstractApiRequest<
16
+ void,
17
+ GetIntegrationGlovoMenuUpdateDetailsResponse
18
+ > {
19
+ readonly method = 'GET'
20
+ readonly contentType = 'application/json'
21
+ readonly accept = 'application/json'
22
+ readonly inputSchema = getIntegrationGlovoMenuUpdateDetailsInputSchema
23
+ readonly outputSchema = getIntegrationGlovoMenuUpdateDetailsResponseSchema
24
+ readonly querySchema = undefined
25
+ readonly headersSchema = undefined
26
+
27
+ private readonly integrationGlovoId: string
28
+ private readonly processId: string
29
+
30
+ constructor(integrationGlovoId: string, processId: string) {
31
+ super()
32
+ this.integrationGlovoId = integrationGlovoId
33
+ this.processId = processId
34
+ }
35
+
36
+ getPath(): string {
37
+ return `/integrations/glovo/${this.integrationGlovoId}/menu_updates/${this.processId}`
38
+ }
39
+ }
@@ -0,0 +1,66 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import {
3
+ createPaginatedSchema,
4
+ Paginated,
5
+ responseToPagination,
6
+ } from '@deliverart/sdk-js-global-types'
7
+ import { AxiosResponse } from 'axios'
8
+ import { z } from 'zod'
9
+
10
+ import {
11
+ IntegrationGlovoMenuUpdate,
12
+ integrationGlovoMenuUpdateSchema,
13
+ } from '../../../service-schemas/glovo'
14
+
15
+ export const getIntegrationGlovoMenuUpdatesQuerySchema = z.object({
16
+ page: z.number().optional(),
17
+ })
18
+ export type GetIntegrationGlovoMenuUpdatesQueryParams = z.infer<
19
+ typeof getIntegrationGlovoMenuUpdatesQuerySchema
20
+ >
21
+
22
+ export const getIntegrationGlovoMenuUpdatesResponseSchema = createPaginatedSchema(
23
+ integrationGlovoMenuUpdateSchema,
24
+ )
25
+ export type GetIntegrationGlovoMenuUpdatesResponse = z.infer<
26
+ typeof getIntegrationGlovoMenuUpdatesResponseSchema
27
+ >
28
+
29
+ export const getIntegrationGlovoMenuUpdatesInputSchema = z.undefined()
30
+
31
+ export class GetIntegrationGlovoMenuUpdates extends AbstractApiRequest<
32
+ void,
33
+ GetIntegrationGlovoMenuUpdatesResponse,
34
+ GetIntegrationGlovoMenuUpdatesQueryParams
35
+ > {
36
+ readonly method = 'GET'
37
+ readonly contentType = 'application/json'
38
+ readonly accept = 'application/json'
39
+
40
+ readonly inputSchema = getIntegrationGlovoMenuUpdatesInputSchema
41
+ readonly outputSchema = getIntegrationGlovoMenuUpdatesResponseSchema
42
+ readonly querySchema = getIntegrationGlovoMenuUpdatesQuerySchema
43
+ readonly headersSchema = undefined
44
+
45
+ private readonly integrationId: string
46
+
47
+ constructor(
48
+ integrationId: string,
49
+ options?: { query?: GetIntegrationGlovoMenuUpdatesQueryParams },
50
+ ) {
51
+ super(undefined, options)
52
+ this.integrationId = integrationId
53
+ }
54
+
55
+ getPath(): string {
56
+ return `/integrations/glovo/${this.integrationId}/menu_updates`
57
+ }
58
+
59
+ parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<IntegrationGlovoMenuUpdate> {
60
+ const integrations = z.array(integrationGlovoMenuUpdateSchema).parse(data)
61
+ return this.validateOutput({
62
+ data: integrations,
63
+ pagination: responseToPagination(rawResponse),
64
+ })
65
+ }
66
+ }
@@ -0,0 +1,35 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ import { MenuVersionDetails, menuVersionDetailsSchema } from '../../../schemas'
5
+
6
+ export const getIntegrationGlovoMenuVersionDetailsInputSchema = z.undefined()
7
+
8
+ export const getIntegrationGlovoMenuVersionDetailsResponseSchema = menuVersionDetailsSchema
9
+ export type GetIntegrationGlovoMenuVersionDetailsResponse = MenuVersionDetails
10
+
11
+ export class GetIntegrationGlovoMenuVersionDetails extends AbstractApiRequest<
12
+ void,
13
+ GetIntegrationGlovoMenuVersionDetailsResponse
14
+ > {
15
+ readonly method = 'GET'
16
+ readonly contentType = 'application/json'
17
+ readonly accept = 'application/json'
18
+ readonly inputSchema = getIntegrationGlovoMenuVersionDetailsInputSchema
19
+ readonly outputSchema = getIntegrationGlovoMenuVersionDetailsResponseSchema
20
+ readonly querySchema = undefined
21
+ readonly headersSchema = undefined
22
+
23
+ private readonly integrationGlovoId: string
24
+ private readonly versionId: string
25
+
26
+ constructor(integrationGlovoId: string, versionId: string) {
27
+ super()
28
+ this.integrationGlovoId = integrationGlovoId
29
+ this.versionId = versionId
30
+ }
31
+
32
+ getPath(): string {
33
+ return `/integrations/glovo/${this.integrationGlovoId}/menu_versions/${this.versionId}`
34
+ }
35
+ }
@@ -0,0 +1,62 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import {
3
+ createPaginatedSchema,
4
+ Paginated,
5
+ responseToPagination,
6
+ } from '@deliverart/sdk-js-global-types'
7
+ import { AxiosResponse } from 'axios'
8
+ import { z } from 'zod'
9
+
10
+ import { MenuVersion, menuVersionSchema } from '../../../schemas'
11
+
12
+ export const getIntegrationGlovoMenuVersionsQuerySchema = z.object({
13
+ page: z.number().optional(),
14
+ })
15
+ export type GetIntegrationGlovoMenuVersionsQueryParams = z.infer<
16
+ typeof getIntegrationGlovoMenuVersionsQuerySchema
17
+ >
18
+
19
+ export const getIntegrationGlovoMenuVersionsResponseSchema =
20
+ createPaginatedSchema(menuVersionSchema)
21
+ export type GetIntegrationGlovoMenuVersionsResponse = z.infer<
22
+ typeof getIntegrationGlovoMenuVersionsResponseSchema
23
+ >
24
+
25
+ export const getIntegrationGlovoMenuVersionsInputSchema = z.undefined()
26
+
27
+ export class GetIntegrationGlovoMenuVersions extends AbstractApiRequest<
28
+ void,
29
+ GetIntegrationGlovoMenuVersionsResponse,
30
+ GetIntegrationGlovoMenuVersionsQueryParams
31
+ > {
32
+ readonly method = 'GET'
33
+ readonly contentType = 'application/json'
34
+ readonly accept = 'application/json'
35
+
36
+ readonly inputSchema = getIntegrationGlovoMenuVersionsInputSchema
37
+ readonly outputSchema = getIntegrationGlovoMenuVersionsResponseSchema
38
+ readonly querySchema = getIntegrationGlovoMenuVersionsQuerySchema
39
+ readonly headersSchema = undefined
40
+
41
+ private readonly integrationGlovoId: string
42
+
43
+ constructor(
44
+ integrationGlovoId: string,
45
+ options?: { query?: GetIntegrationGlovoMenuVersionsQueryParams },
46
+ ) {
47
+ super(undefined, options)
48
+ this.integrationGlovoId = integrationGlovoId
49
+ }
50
+
51
+ getPath(): string {
52
+ return `/integrations/glovo/${this.integrationGlovoId}/menu_versions`
53
+ }
54
+
55
+ parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<MenuVersion> {
56
+ const integrations = z.array(menuVersionSchema).parse(data)
57
+ return this.validateOutput({
58
+ data: integrations,
59
+ pagination: responseToPagination(rawResponse),
60
+ })
61
+ }
62
+ }
@@ -0,0 +1,39 @@
1
+ import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
+ import { z } from 'zod'
3
+
4
+ import {
5
+ IntegrationGlovoWebhookEventDetails,
6
+ integrationGlovoWebhookEventDetailsSchema,
7
+ } from '../../../service-schemas/glovo'
8
+
9
+ export const getIntegrationGlovoWebhookEventDetailsInputSchema = z.undefined()
10
+
11
+ export const getIntegrationGlovoWebhookEventDetailsResponseSchema =
12
+ integrationGlovoWebhookEventDetailsSchema
13
+ export type GetIntegrationGlovoWebhookEventDetailsResponse = IntegrationGlovoWebhookEventDetails
14
+
15
+ export class GetIntegrationGlovoWebhookEventDetails extends AbstractApiRequest<
16
+ void,
17
+ GetIntegrationGlovoWebhookEventDetailsResponse
18
+ > {
19
+ readonly method = 'GET'
20
+ readonly contentType = 'application/json'
21
+ readonly accept = 'application/json'
22
+ readonly inputSchema = getIntegrationGlovoWebhookEventDetailsInputSchema
23
+ readonly outputSchema = getIntegrationGlovoWebhookEventDetailsResponseSchema
24
+ readonly querySchema = undefined
25
+ readonly headersSchema = undefined
26
+
27
+ private readonly integrationGlovoId: string
28
+ private readonly eventId: string
29
+
30
+ constructor(integrationGlovoId: string, eventId: string) {
31
+ super()
32
+ this.integrationGlovoId = integrationGlovoId
33
+ this.eventId = eventId
34
+ }
35
+
36
+ getPath(): string {
37
+ return `/integrations/glovo/${this.integrationGlovoId}/webhook_events/${this.eventId}`
38
+ }
39
+ }