@eide/uniformgen 0.1.0
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/README.md +356 -0
- package/dist/auth/credentials.d.ts +58 -0
- package/dist/auth/credentials.d.ts.map +1 -0
- package/dist/auth/credentials.js +107 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +563 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +113 -0
- package/dist/commands/login.d.ts +9 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +158 -0
- package/dist/commands/logout.d.ts +5 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +13 -0
- package/dist/commands/push.d.ts +13 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +328 -0
- package/dist/commands/scaffold.d.ts +19 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +366 -0
- package/dist/commands/seed.d.ts +20 -0
- package/dist/commands/seed.d.ts.map +1 -0
- package/dist/commands/seed.js +380 -0
- package/dist/commands/select-project.d.ts +10 -0
- package/dist/commands/select-project.d.ts.map +1 -0
- package/dist/commands/select-project.js +277 -0
- package/dist/commands/setup.d.ts +5 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +51 -0
- package/dist/commands/sync.d.ts +13 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +318 -0
- package/dist/commands/whoami.d.ts +5 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +31 -0
- package/dist/config/load-config.d.ts +6 -0
- package/dist/config/load-config.d.ts.map +1 -0
- package/dist/config/load-config.js +103 -0
- package/dist/config/settings.d.ts +20 -0
- package/dist/config/settings.d.ts.map +1 -0
- package/dist/config/settings.js +64 -0
- package/dist/config/types.d.ts +152 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +94 -0
- package/dist/fetcher/fetch-schemas.d.ts +140 -0
- package/dist/fetcher/fetch-schemas.d.ts.map +1 -0
- package/dist/fetcher/fetch-schemas.js +223 -0
- package/dist/fetcher/fetch-workflows.d.ts +53 -0
- package/dist/fetcher/fetch-workflows.d.ts.map +1 -0
- package/dist/fetcher/fetch-workflows.js +164 -0
- package/dist/generated/hooks/customer-detail.d.ts +74 -0
- package/dist/generated/hooks/customer-detail.d.ts.map +1 -0
- package/dist/generated/hooks/customer-detail.js +113 -0
- package/dist/generated/hooks/design-system.d.ts +74 -0
- package/dist/generated/hooks/design-system.d.ts.map +1 -0
- package/dist/generated/hooks/design-system.js +109 -0
- package/dist/generated/hooks/index.d.ts +16 -0
- package/dist/generated/hooks/index.d.ts.map +1 -0
- package/dist/generated/hooks/index.js +14 -0
- package/dist/generated/hooks/shopify-collection.d.ts +74 -0
- package/dist/generated/hooks/shopify-collection.d.ts.map +1 -0
- package/dist/generated/hooks/shopify-collection.js +113 -0
- package/dist/generated/hooks/shopify-market.d.ts +74 -0
- package/dist/generated/hooks/shopify-market.d.ts.map +1 -0
- package/dist/generated/hooks/shopify-market.js +109 -0
- package/dist/generated/hooks/shopify-product.d.ts +74 -0
- package/dist/generated/hooks/shopify-product.d.ts.map +1 -0
- package/dist/generated/hooks/shopify-product.js +113 -0
- package/dist/generated/hooks/shopify-variant.d.ts +74 -0
- package/dist/generated/hooks/shopify-variant.d.ts.map +1 -0
- package/dist/generated/hooks/shopify-variant.js +113 -0
- package/dist/generated/hooks/template.d.ts +74 -0
- package/dist/generated/hooks/template.d.ts.map +1 -0
- package/dist/generated/hooks/template.js +107 -0
- package/dist/generated/types/config.d.ts +88 -0
- package/dist/generated/types/config.d.ts.map +1 -0
- package/dist/generated/types/config.js +14 -0
- package/dist/generated/types/data-models/index.d.ts +7 -0
- package/dist/generated/types/data-models/index.d.ts.map +1 -0
- package/dist/generated/types/data-models/index.js +6 -0
- package/dist/generated/types/data-models/test.d.ts +29 -0
- package/dist/generated/types/data-models/test.d.ts.map +1 -0
- package/dist/generated/types/data-models/test.js +1 -0
- package/dist/generated/types/data-models/watch.d.ts +26 -0
- package/dist/generated/types/data-models/watch.d.ts.map +1 -0
- package/dist/generated/types/data-models/watch.js +1 -0
- package/dist/generated/types/field-types.d.ts +255 -0
- package/dist/generated/types/field-types.d.ts.map +1 -0
- package/dist/generated/types/field-types.js +35 -0
- package/dist/generated/types/hooks.d.ts +106 -0
- package/dist/generated/types/hooks.d.ts.map +1 -0
- package/dist/generated/types/hooks.js +9 -0
- package/dist/generated/types/index.d.ts +10 -0
- package/dist/generated/types/index.d.ts.map +1 -0
- package/dist/generated/types/index.js +9 -0
- package/dist/generated/types/models/button-variant.d.ts +16 -0
- package/dist/generated/types/models/button-variant.d.ts.map +1 -0
- package/dist/generated/types/models/button-variant.js +1 -0
- package/dist/generated/types/models/color-palette.d.ts +27 -0
- package/dist/generated/types/models/color-palette.d.ts.map +1 -0
- package/dist/generated/types/models/color-palette.js +1 -0
- package/dist/generated/types/models/color-with-scale.d.ts +15 -0
- package/dist/generated/types/models/color-with-scale.d.ts.map +1 -0
- package/dist/generated/types/models/color-with-scale.js +1 -0
- package/dist/generated/types/models/context.d.ts +53 -0
- package/dist/generated/types/models/context.d.ts.map +1 -0
- package/dist/generated/types/models/context.js +51 -0
- package/dist/generated/types/models/customer-detail.d.ts +32 -0
- package/dist/generated/types/models/customer-detail.d.ts.map +1 -0
- package/dist/generated/types/models/customer-detail.js +26 -0
- package/dist/generated/types/models/design-system-badges.d.ts +16 -0
- package/dist/generated/types/models/design-system-badges.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-badges.js +1 -0
- package/dist/generated/types/models/design-system-buttons.d.ts +17 -0
- package/dist/generated/types/models/design-system-buttons.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-buttons.js +1 -0
- package/dist/generated/types/models/design-system-cards.d.ts +16 -0
- package/dist/generated/types/models/design-system-cards.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-cards.js +1 -0
- package/dist/generated/types/models/design-system-colors.d.ts +12 -0
- package/dist/generated/types/models/design-system-colors.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-colors.js +1 -0
- package/dist/generated/types/models/design-system-dark-mode.d.ts +13 -0
- package/dist/generated/types/models/design-system-dark-mode.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-dark-mode.js +1 -0
- package/dist/generated/types/models/design-system-focus-ring.d.ts +14 -0
- package/dist/generated/types/models/design-system-focus-ring.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-focus-ring.js +1 -0
- package/dist/generated/types/models/design-system-grid.d.ts +18 -0
- package/dist/generated/types/models/design-system-grid.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-grid.js +1 -0
- package/dist/generated/types/models/design-system-inputs.d.ts +26 -0
- package/dist/generated/types/models/design-system-inputs.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-inputs.js +1 -0
- package/dist/generated/types/models/design-system-links.d.ts +16 -0
- package/dist/generated/types/models/design-system-links.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-links.js +1 -0
- package/dist/generated/types/models/design-system-shadows.d.ts +20 -0
- package/dist/generated/types/models/design-system-shadows.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-shadows.js +1 -0
- package/dist/generated/types/models/design-system-spacing.d.ts +13 -0
- package/dist/generated/types/models/design-system-spacing.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-spacing.js +1 -0
- package/dist/generated/types/models/design-system-transitions.d.ts +15 -0
- package/dist/generated/types/models/design-system-transitions.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-transitions.js +1 -0
- package/dist/generated/types/models/design-system-typography.d.ts +21 -0
- package/dist/generated/types/models/design-system-typography.d.ts.map +1 -0
- package/dist/generated/types/models/design-system-typography.js +1 -0
- package/dist/generated/types/models/design-system.d.ts +138 -0
- package/dist/generated/types/models/design-system.d.ts.map +1 -0
- package/dist/generated/types/models/design-system.js +64 -0
- package/dist/generated/types/models/experiment.d.ts +57 -0
- package/dist/generated/types/models/experiment.d.ts.map +1 -0
- package/dist/generated/types/models/experiment.js +55 -0
- package/dist/generated/types/models/font-file.d.ts +16 -0
- package/dist/generated/types/models/font-file.d.ts.map +1 -0
- package/dist/generated/types/models/font-file.js +1 -0
- package/dist/generated/types/models/index.d.ts +38 -0
- package/dist/generated/types/models/index.d.ts.map +1 -0
- package/dist/generated/types/models/index.js +12 -0
- package/dist/generated/types/models/integration.d.ts +32 -0
- package/dist/generated/types/models/integration.d.ts.map +1 -0
- package/dist/generated/types/models/integration.js +26 -0
- package/dist/generated/types/models/route-tree.d.ts +43 -0
- package/dist/generated/types/models/route-tree.d.ts.map +1 -0
- package/dist/generated/types/models/route-tree.js +39 -0
- package/dist/generated/types/models/segment.d.ts +57 -0
- package/dist/generated/types/models/segment.d.ts.map +1 -0
- package/dist/generated/types/models/segment.js +55 -0
- package/dist/generated/types/models/shopify-collection.d.ts +32 -0
- package/dist/generated/types/models/shopify-collection.d.ts.map +1 -0
- package/dist/generated/types/models/shopify-collection.js +26 -0
- package/dist/generated/types/models/shopify-market.d.ts +32 -0
- package/dist/generated/types/models/shopify-market.d.ts.map +1 -0
- package/dist/generated/types/models/shopify-market.js +26 -0
- package/dist/generated/types/models/shopify-product.d.ts +32 -0
- package/dist/generated/types/models/shopify-product.d.ts.map +1 -0
- package/dist/generated/types/models/shopify-product.js +26 -0
- package/dist/generated/types/models/shopify-variant.d.ts +32 -0
- package/dist/generated/types/models/shopify-variant.d.ts.map +1 -0
- package/dist/generated/types/models/shopify-variant.js +26 -0
- package/dist/generated/types/models/template.d.ts +53 -0
- package/dist/generated/types/models/template.d.ts.map +1 -0
- package/dist/generated/types/models/template.js +40 -0
- package/dist/generated/types/models/typography-variant.d.ts +15 -0
- package/dist/generated/types/models/typography-variant.d.ts.map +1 -0
- package/dist/generated/types/models/typography-variant.js +1 -0
- package/dist/generated/types/scalars.d.ts +56 -0
- package/dist/generated/types/scalars.d.ts.map +1 -0
- package/dist/generated/types/scalars.js +6 -0
- package/dist/generators/admin/index.d.ts +32 -0
- package/dist/generators/admin/index.d.ts.map +1 -0
- package/dist/generators/admin/index.js +219 -0
- package/dist/generators/admin/mutations.d.ts +23 -0
- package/dist/generators/admin/mutations.d.ts.map +1 -0
- package/dist/generators/admin/mutations.js +424 -0
- package/dist/generators/admin/queries.d.ts +20 -0
- package/dist/generators/admin/queries.d.ts.map +1 -0
- package/dist/generators/admin/queries.js +476 -0
- package/dist/generators/admin/types.d.ts +28 -0
- package/dist/generators/admin/types.d.ts.map +1 -0
- package/dist/generators/admin/types.js +254 -0
- package/dist/generators/cms/index.d.ts +29 -0
- package/dist/generators/cms/index.d.ts.map +1 -0
- package/dist/generators/cms/index.js +126 -0
- package/dist/generators/cms/route.d.ts +27 -0
- package/dist/generators/cms/route.d.ts.map +1 -0
- package/dist/generators/cms/route.js +409 -0
- package/dist/generators/cms/types.d.ts +15 -0
- package/dist/generators/cms/types.d.ts.map +1 -0
- package/dist/generators/cms/types.js +137 -0
- package/dist/generators/contexts/index.d.ts +25 -0
- package/dist/generators/contexts/index.d.ts.map +1 -0
- package/dist/generators/contexts/index.js +591 -0
- package/dist/generators/documents/data-models.d.ts +6 -0
- package/dist/generators/documents/data-models.d.ts.map +1 -0
- package/dist/generators/documents/data-models.js +61 -0
- package/dist/generators/documents/entity-models.d.ts +7 -0
- package/dist/generators/documents/entity-models.d.ts.map +1 -0
- package/dist/generators/documents/entity-models.js +87 -0
- package/dist/generators/documents/workflows.d.ts +11 -0
- package/dist/generators/documents/workflows.d.ts.map +1 -0
- package/dist/generators/documents/workflows.js +101 -0
- package/dist/generators/filters/index.d.ts +16 -0
- package/dist/generators/filters/index.d.ts.map +1 -0
- package/dist/generators/filters/index.js +384 -0
- package/dist/generators/hooks/agnostic.d.ts +16 -0
- package/dist/generators/hooks/agnostic.d.ts.map +1 -0
- package/dist/generators/hooks/agnostic.js +248 -0
- package/dist/generators/hooks/index.d.ts +9 -0
- package/dist/generators/hooks/index.d.ts.map +1 -0
- package/dist/generators/hooks/index.js +8 -0
- package/dist/generators/hooks/react.d.ts +16 -0
- package/dist/generators/hooks/react.d.ts.map +1 -0
- package/dist/generators/hooks/react.js +394 -0
- package/dist/generators/hooks/remix.d.ts +16 -0
- package/dist/generators/hooks/remix.d.ts.map +1 -0
- package/dist/generators/hooks/remix.js +349 -0
- package/dist/generators/hooks/workflows.d.ts +23 -0
- package/dist/generators/hooks/workflows.d.ts.map +1 -0
- package/dist/generators/hooks/workflows.js +312 -0
- package/dist/generators/resolve/index.d.ts +13 -0
- package/dist/generators/resolve/index.d.ts.map +1 -0
- package/dist/generators/resolve/index.js +13 -0
- package/dist/generators/resolve/platform.d.ts +29 -0
- package/dist/generators/resolve/platform.d.ts.map +1 -0
- package/dist/generators/resolve/platform.js +479 -0
- package/dist/generators/types/config.d.ts +7 -0
- package/dist/generators/types/config.d.ts.map +1 -0
- package/dist/generators/types/config.js +113 -0
- package/dist/generators/types/data-models.d.ts +10 -0
- package/dist/generators/types/data-models.d.ts.map +1 -0
- package/dist/generators/types/data-models.js +100 -0
- package/dist/generators/types/entity-models.d.ts +13 -0
- package/dist/generators/types/entity-models.d.ts.map +1 -0
- package/dist/generators/types/entity-models.js +241 -0
- package/dist/generators/types/field-types.d.ts +9 -0
- package/dist/generators/types/field-types.d.ts.map +1 -0
- package/dist/generators/types/field-types.js +651 -0
- package/dist/generators/types/hooks.d.ts +7 -0
- package/dist/generators/types/hooks.d.ts.map +1 -0
- package/dist/generators/types/hooks.js +132 -0
- package/dist/generators/types/scalars.d.ts +6 -0
- package/dist/generators/types/scalars.d.ts.map +1 -0
- package/dist/generators/types/scalars.js +68 -0
- package/dist/generators/types/user-details.d.ts +6 -0
- package/dist/generators/types/user-details.d.ts.map +1 -0
- package/dist/generators/types/user-details.js +60 -0
- package/dist/generators/types/workflows.d.ts +15 -0
- package/dist/generators/types/workflows.d.ts.map +1 -0
- package/dist/generators/types/workflows.js +163 -0
- package/dist/graphql/generated/gql.d.ts +47 -0
- package/dist/graphql/generated/gql.d.ts.map +1 -0
- package/dist/graphql/generated/gql.js +10 -0
- package/dist/graphql/generated/graphql.d.ts +8455 -0
- package/dist/graphql/generated/graphql.d.ts.map +1 -0
- package/dist/graphql/generated/graphql.js +573 -0
- package/dist/graphql/generated/index.d.ts +2 -0
- package/dist/graphql/generated/index.d.ts.map +1 -0
- package/dist/graphql/generated/index.js +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/schema/define-entity-model.d.ts +122 -0
- package/dist/schema/define-entity-model.d.ts.map +1 -0
- package/dist/schema/define-entity-model.js +59 -0
- package/dist/schema/schema-loader.d.ts +10 -0
- package/dist/schema/schema-loader.d.ts.map +1 -0
- package/dist/schema/schema-loader.js +91 -0
- package/dist/utils/field-mapping.d.ts +83 -0
- package/dist/utils/field-mapping.d.ts.map +1 -0
- package/dist/utils/field-mapping.js +334 -0
- package/dist/writer/write-files.d.ts +12 -0
- package/dist/writer/write-files.d.ts.map +1 -0
- package/dist/writer/write-files.js +35 -0
- package/package.json +70 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify Collection - React Hooks
|
|
3
|
+
*
|
|
4
|
+
* @generated by UniformGen - DO NOT EDIT MANUALLY
|
|
5
|
+
*/
|
|
6
|
+
import { useQuery, useMutation, } from '@apollo/client';
|
|
7
|
+
import { GetShopifyCollectionDocument, ListShopifyCollectionsDocument, CreateShopifyCollectionDocument, UpdateShopifyCollectionDocument, DeleteShopifyCollectionDocument, PublishShopifyCollectionDocument, UnpublishShopifyCollectionDocument, } from '../documents/shopify-collection.js';
|
|
8
|
+
/** Parse raw entity to typed record */
|
|
9
|
+
function parseShopifyCollection(entity) {
|
|
10
|
+
return {
|
|
11
|
+
...entity,
|
|
12
|
+
modelKey: 'shopify-collection',
|
|
13
|
+
data: entity.data,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fetch a single Shopify Collection by ID
|
|
18
|
+
*/
|
|
19
|
+
export function useShopifyCollection(id, options) {
|
|
20
|
+
const { preview, ...queryOptions } = options ?? {};
|
|
21
|
+
const result = useQuery(GetShopifyCollectionDocument, {
|
|
22
|
+
...queryOptions,
|
|
23
|
+
variables: { id, preview },
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
...result,
|
|
27
|
+
shopifyCollection: result.data?.entity ? parseShopifyCollection(result.data.entity) : undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fetch a list of Shopify Collection records
|
|
32
|
+
*/
|
|
33
|
+
export function useShopifyCollections(options) {
|
|
34
|
+
const { queryOptions, ...variables } = options ?? {};
|
|
35
|
+
const result = useQuery(ListShopifyCollectionsDocument, {
|
|
36
|
+
...queryOptions,
|
|
37
|
+
variables,
|
|
38
|
+
});
|
|
39
|
+
const typedResult = result.data?.entities
|
|
40
|
+
? {
|
|
41
|
+
items: result.data.entities.items.map(parseShopifyCollection),
|
|
42
|
+
total: result.data.entities.total,
|
|
43
|
+
hasMore: result.data.entities.hasMore,
|
|
44
|
+
}
|
|
45
|
+
: undefined;
|
|
46
|
+
return {
|
|
47
|
+
...result,
|
|
48
|
+
shopifyCollections: typedResult,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a new Shopify Collection
|
|
53
|
+
*/
|
|
54
|
+
export function useCreateShopifyCollection(options) {
|
|
55
|
+
const [mutate, result] = useMutation(CreateShopifyCollectionDocument, options);
|
|
56
|
+
const createShopifyCollection = async (data) => {
|
|
57
|
+
const response = await mutate({ variables: { data } });
|
|
58
|
+
return response.data?.createEntity
|
|
59
|
+
? parseShopifyCollection(response.data.createEntity)
|
|
60
|
+
: undefined;
|
|
61
|
+
};
|
|
62
|
+
return [createShopifyCollection, result];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Update an existing Shopify Collection
|
|
66
|
+
*/
|
|
67
|
+
export function useUpdateShopifyCollection(options) {
|
|
68
|
+
const [mutate, result] = useMutation(UpdateShopifyCollectionDocument, options);
|
|
69
|
+
const updateShopifyCollection = async (id, data) => {
|
|
70
|
+
const response = await mutate({ variables: { id, data } });
|
|
71
|
+
return response.data?.updateEntity
|
|
72
|
+
? parseShopifyCollection(response.data.updateEntity)
|
|
73
|
+
: undefined;
|
|
74
|
+
};
|
|
75
|
+
return [updateShopifyCollection, result];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Delete a Shopify Collection
|
|
79
|
+
*/
|
|
80
|
+
export function useDeleteShopifyCollection(options) {
|
|
81
|
+
const [mutate, result] = useMutation(DeleteShopifyCollectionDocument, options);
|
|
82
|
+
const deleteShopifyCollection = async (id) => {
|
|
83
|
+
const response = await mutate({ variables: { id } });
|
|
84
|
+
return response.data?.deleteEntity;
|
|
85
|
+
};
|
|
86
|
+
return [deleteShopifyCollection, result];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Publish a Shopify Collection
|
|
90
|
+
*/
|
|
91
|
+
export function usePublishShopifyCollection(options) {
|
|
92
|
+
const [mutate, result] = useMutation(PublishShopifyCollectionDocument, options);
|
|
93
|
+
const publishShopifyCollection = async (id, versionId) => {
|
|
94
|
+
const response = await mutate({ variables: { id, versionId } });
|
|
95
|
+
return response.data?.publishEntity
|
|
96
|
+
? parseShopifyCollection(response.data.publishEntity)
|
|
97
|
+
: undefined;
|
|
98
|
+
};
|
|
99
|
+
return [publishShopifyCollection, result];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Unpublish a Shopify Collection
|
|
103
|
+
*/
|
|
104
|
+
export function useUnpublishShopifyCollection(options) {
|
|
105
|
+
const [mutate, result] = useMutation(UnpublishShopifyCollectionDocument, options);
|
|
106
|
+
const unpublishShopifyCollection = async (id) => {
|
|
107
|
+
const response = await mutate({ variables: { id } });
|
|
108
|
+
return response.data?.unpublishEntity
|
|
109
|
+
? parseShopifyCollection(response.data.unpublishEntity)
|
|
110
|
+
: undefined;
|
|
111
|
+
};
|
|
112
|
+
return [unpublishShopifyCollection, result];
|
|
113
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify Market - React Hooks
|
|
3
|
+
*
|
|
4
|
+
* @generated by UniformGen - DO NOT EDIT MANUALLY
|
|
5
|
+
*/
|
|
6
|
+
import { type QueryHookOptions, type MutationHookOptions } from '@apollo/client';
|
|
7
|
+
import type { ShopifyMarketData } from '../types/models/shopify-market.js';
|
|
8
|
+
/** Typed Shopify Market record */
|
|
9
|
+
export interface ShopifyMarketRecord {
|
|
10
|
+
id: string;
|
|
11
|
+
modelKey: 'shopify-market';
|
|
12
|
+
naturalKey?: string;
|
|
13
|
+
data: ShopifyMarketData;
|
|
14
|
+
versionNumber: number;
|
|
15
|
+
publishedVersionNumber?: number;
|
|
16
|
+
status: 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
/** Typed list result */
|
|
21
|
+
export interface ShopifyMarketListResult {
|
|
22
|
+
items: ShopifyMarketRecord[];
|
|
23
|
+
total: number;
|
|
24
|
+
hasMore: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Filter input for list queries */
|
|
27
|
+
export interface FilterInput {
|
|
28
|
+
field: string;
|
|
29
|
+
operator: string;
|
|
30
|
+
value: string | number | boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Sort input for list queries */
|
|
33
|
+
export interface SortInput {
|
|
34
|
+
field: string;
|
|
35
|
+
direction: 'ASC' | 'DESC';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fetch a single Shopify Market by ID
|
|
39
|
+
*/
|
|
40
|
+
export declare function useShopifyMarket(id: string, options?: Omit<QueryHookOptions, 'variables'> & {
|
|
41
|
+
preview?: boolean;
|
|
42
|
+
}): any;
|
|
43
|
+
/**
|
|
44
|
+
* Fetch a list of Shopify Market records
|
|
45
|
+
*/
|
|
46
|
+
export declare function useShopifyMarkets(options?: {
|
|
47
|
+
limit?: number;
|
|
48
|
+
offset?: number;
|
|
49
|
+
filters?: FilterInput[];
|
|
50
|
+
sort?: SortInput;
|
|
51
|
+
preview?: boolean;
|
|
52
|
+
queryOptions?: Omit<QueryHookOptions, 'variables'>;
|
|
53
|
+
}): any;
|
|
54
|
+
/**
|
|
55
|
+
* Create a new Shopify Market
|
|
56
|
+
*/
|
|
57
|
+
export declare function useCreateShopifyMarket(options?: MutationHookOptions): readonly [(data: ShopifyMarketData) => Promise<ShopifyMarketRecord | undefined>, any];
|
|
58
|
+
/**
|
|
59
|
+
* Update an existing Shopify Market
|
|
60
|
+
*/
|
|
61
|
+
export declare function useUpdateShopifyMarket(options?: MutationHookOptions): readonly [(id: string, data: Partial<ShopifyMarketData>) => Promise<ShopifyMarketRecord | undefined>, any];
|
|
62
|
+
/**
|
|
63
|
+
* Delete a Shopify Market
|
|
64
|
+
*/
|
|
65
|
+
export declare function useDeleteShopifyMarket(options?: MutationHookOptions): readonly [(id: string) => Promise<any>, any];
|
|
66
|
+
/**
|
|
67
|
+
* Publish a Shopify Market
|
|
68
|
+
*/
|
|
69
|
+
export declare function usePublishShopifyMarket(options?: MutationHookOptions): readonly [(id: string, versionId?: string) => Promise<ShopifyMarketRecord | undefined>, any];
|
|
70
|
+
/**
|
|
71
|
+
* Unpublish a Shopify Market
|
|
72
|
+
*/
|
|
73
|
+
export declare function useUnpublishShopifyMarket(options?: MutationHookOptions): readonly [(id: string) => Promise<ShopifyMarketRecord | undefined>, any];
|
|
74
|
+
//# sourceMappingURL=shopify-market.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopify-market.d.ts","sourceRoot":"","sources":["../../../src/generated/hooks/shopify-market.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OA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,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;CACpD,OAmBA;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,mBAAmB,oBAGzB,iBAAiB,oDAM3D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,QAAQ,OAAO,CAAC,iBAAiB,CAAC,oDAMhF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,wBAM9C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,cAAc,MAAM,oDAQnE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,oDAQjD"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify Market - React Hooks
|
|
3
|
+
*
|
|
4
|
+
* @generated by UniformGen - DO NOT EDIT MANUALLY
|
|
5
|
+
*/
|
|
6
|
+
import { useQuery, useMutation, } from '@apollo/client';
|
|
7
|
+
import { GetShopifyMarketDocument, ListShopifyMarketsDocument, CreateShopifyMarketDocument, UpdateShopifyMarketDocument, DeleteShopifyMarketDocument, PublishShopifyMarketDocument, UnpublishShopifyMarketDocument, } from '../documents/shopify-market.js';
|
|
8
|
+
/** Parse raw entity to typed record */
|
|
9
|
+
function parseShopifyMarket(entity) {
|
|
10
|
+
return {
|
|
11
|
+
...entity,
|
|
12
|
+
modelKey: 'shopify-market',
|
|
13
|
+
data: entity.data,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fetch a single Shopify Market by ID
|
|
18
|
+
*/
|
|
19
|
+
export function useShopifyMarket(id, options) {
|
|
20
|
+
const { preview, ...queryOptions } = options ?? {};
|
|
21
|
+
const result = useQuery(GetShopifyMarketDocument, {
|
|
22
|
+
...queryOptions,
|
|
23
|
+
variables: { id, preview },
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
...result,
|
|
27
|
+
shopifyMarket: result.data?.entity ? parseShopifyMarket(result.data.entity) : undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fetch a list of Shopify Market records
|
|
32
|
+
*/
|
|
33
|
+
export function useShopifyMarkets(options) {
|
|
34
|
+
const { queryOptions, ...variables } = options ?? {};
|
|
35
|
+
const result = useQuery(ListShopifyMarketsDocument, {
|
|
36
|
+
...queryOptions,
|
|
37
|
+
variables,
|
|
38
|
+
});
|
|
39
|
+
const typedResult = result.data?.entities
|
|
40
|
+
? {
|
|
41
|
+
items: result.data.entities.items.map(parseShopifyMarket),
|
|
42
|
+
total: result.data.entities.total,
|
|
43
|
+
hasMore: result.data.entities.hasMore,
|
|
44
|
+
}
|
|
45
|
+
: undefined;
|
|
46
|
+
return {
|
|
47
|
+
...result,
|
|
48
|
+
shopifyMarkets: typedResult,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a new Shopify Market
|
|
53
|
+
*/
|
|
54
|
+
export function useCreateShopifyMarket(options) {
|
|
55
|
+
const [mutate, result] = useMutation(CreateShopifyMarketDocument, options);
|
|
56
|
+
const createShopifyMarket = async (data) => {
|
|
57
|
+
const response = await mutate({ variables: { data } });
|
|
58
|
+
return response.data?.createEntity ? parseShopifyMarket(response.data.createEntity) : undefined;
|
|
59
|
+
};
|
|
60
|
+
return [createShopifyMarket, result];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Update an existing Shopify Market
|
|
64
|
+
*/
|
|
65
|
+
export function useUpdateShopifyMarket(options) {
|
|
66
|
+
const [mutate, result] = useMutation(UpdateShopifyMarketDocument, options);
|
|
67
|
+
const updateShopifyMarket = async (id, data) => {
|
|
68
|
+
const response = await mutate({ variables: { id, data } });
|
|
69
|
+
return response.data?.updateEntity ? parseShopifyMarket(response.data.updateEntity) : undefined;
|
|
70
|
+
};
|
|
71
|
+
return [updateShopifyMarket, result];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Delete a Shopify Market
|
|
75
|
+
*/
|
|
76
|
+
export function useDeleteShopifyMarket(options) {
|
|
77
|
+
const [mutate, result] = useMutation(DeleteShopifyMarketDocument, options);
|
|
78
|
+
const deleteShopifyMarket = async (id) => {
|
|
79
|
+
const response = await mutate({ variables: { id } });
|
|
80
|
+
return response.data?.deleteEntity;
|
|
81
|
+
};
|
|
82
|
+
return [deleteShopifyMarket, result];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Publish a Shopify Market
|
|
86
|
+
*/
|
|
87
|
+
export function usePublishShopifyMarket(options) {
|
|
88
|
+
const [mutate, result] = useMutation(PublishShopifyMarketDocument, options);
|
|
89
|
+
const publishShopifyMarket = async (id, versionId) => {
|
|
90
|
+
const response = await mutate({ variables: { id, versionId } });
|
|
91
|
+
return response.data?.publishEntity
|
|
92
|
+
? parseShopifyMarket(response.data.publishEntity)
|
|
93
|
+
: undefined;
|
|
94
|
+
};
|
|
95
|
+
return [publishShopifyMarket, result];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Unpublish a Shopify Market
|
|
99
|
+
*/
|
|
100
|
+
export function useUnpublishShopifyMarket(options) {
|
|
101
|
+
const [mutate, result] = useMutation(UnpublishShopifyMarketDocument, options);
|
|
102
|
+
const unpublishShopifyMarket = async (id) => {
|
|
103
|
+
const response = await mutate({ variables: { id } });
|
|
104
|
+
return response.data?.unpublishEntity
|
|
105
|
+
? parseShopifyMarket(response.data.unpublishEntity)
|
|
106
|
+
: undefined;
|
|
107
|
+
};
|
|
108
|
+
return [unpublishShopifyMarket, result];
|
|
109
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify Product - React Hooks
|
|
3
|
+
*
|
|
4
|
+
* @generated by UniformGen - DO NOT EDIT MANUALLY
|
|
5
|
+
*/
|
|
6
|
+
import { type QueryHookOptions, type MutationHookOptions } from '@apollo/client';
|
|
7
|
+
import type { ShopifyProductData } from '../types/models/shopify-product.js';
|
|
8
|
+
/** Typed Shopify Product record */
|
|
9
|
+
export interface ShopifyProductRecord {
|
|
10
|
+
id: string;
|
|
11
|
+
modelKey: 'shopify-product';
|
|
12
|
+
naturalKey?: string;
|
|
13
|
+
data: ShopifyProductData;
|
|
14
|
+
versionNumber: number;
|
|
15
|
+
publishedVersionNumber?: number;
|
|
16
|
+
status: 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
/** Typed list result */
|
|
21
|
+
export interface ShopifyProductListResult {
|
|
22
|
+
items: ShopifyProductRecord[];
|
|
23
|
+
total: number;
|
|
24
|
+
hasMore: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Filter input for list queries */
|
|
27
|
+
export interface FilterInput {
|
|
28
|
+
field: string;
|
|
29
|
+
operator: string;
|
|
30
|
+
value: string | number | boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Sort input for list queries */
|
|
33
|
+
export interface SortInput {
|
|
34
|
+
field: string;
|
|
35
|
+
direction: 'ASC' | 'DESC';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fetch a single Shopify Product by ID
|
|
39
|
+
*/
|
|
40
|
+
export declare function useShopifyProduct(id: string, options?: Omit<QueryHookOptions, 'variables'> & {
|
|
41
|
+
preview?: boolean;
|
|
42
|
+
}): any;
|
|
43
|
+
/**
|
|
44
|
+
* Fetch a list of Shopify Product records
|
|
45
|
+
*/
|
|
46
|
+
export declare function useShopifyProducts(options?: {
|
|
47
|
+
limit?: number;
|
|
48
|
+
offset?: number;
|
|
49
|
+
filters?: FilterInput[];
|
|
50
|
+
sort?: SortInput;
|
|
51
|
+
preview?: boolean;
|
|
52
|
+
queryOptions?: Omit<QueryHookOptions, 'variables'>;
|
|
53
|
+
}): any;
|
|
54
|
+
/**
|
|
55
|
+
* Create a new Shopify Product
|
|
56
|
+
*/
|
|
57
|
+
export declare function useCreateShopifyProduct(options?: MutationHookOptions): readonly [(data: ShopifyProductData) => Promise<ShopifyProductRecord | undefined>, any];
|
|
58
|
+
/**
|
|
59
|
+
* Update an existing Shopify Product
|
|
60
|
+
*/
|
|
61
|
+
export declare function useUpdateShopifyProduct(options?: MutationHookOptions): readonly [(id: string, data: Partial<ShopifyProductData>) => Promise<ShopifyProductRecord | undefined>, any];
|
|
62
|
+
/**
|
|
63
|
+
* Delete a Shopify Product
|
|
64
|
+
*/
|
|
65
|
+
export declare function useDeleteShopifyProduct(options?: MutationHookOptions): readonly [(id: string) => Promise<any>, any];
|
|
66
|
+
/**
|
|
67
|
+
* Publish a Shopify Product
|
|
68
|
+
*/
|
|
69
|
+
export declare function usePublishShopifyProduct(options?: MutationHookOptions): readonly [(id: string, versionId?: string) => Promise<ShopifyProductRecord | undefined>, any];
|
|
70
|
+
/**
|
|
71
|
+
* Unpublish a Shopify Product
|
|
72
|
+
*/
|
|
73
|
+
export declare function useUnpublishShopifyProduct(options?: MutationHookOptions): readonly [(id: string) => Promise<ShopifyProductRecord | undefined>, any];
|
|
74
|
+
//# sourceMappingURL=shopify-product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopify-product.d.ts","sourceRoot":"","sources":["../../../src/generated/hooks/shopify-product.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC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AE,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;CACpD,OAmBA;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,mBAAmB,oBAGzB,kBAAkB,qDAQ7D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,QAAQ,OAAO,CAAC,kBAAkB,CAAC,qDAQlF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,wBAM/C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,cAAc,MAAM,qDAQpE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,qDAQlD"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify Product - React Hooks
|
|
3
|
+
*
|
|
4
|
+
* @generated by UniformGen - DO NOT EDIT MANUALLY
|
|
5
|
+
*/
|
|
6
|
+
import { useQuery, useMutation, } from '@apollo/client';
|
|
7
|
+
import { GetShopifyProductDocument, ListShopifyProductsDocument, CreateShopifyProductDocument, UpdateShopifyProductDocument, DeleteShopifyProductDocument, PublishShopifyProductDocument, UnpublishShopifyProductDocument, } from '../documents/shopify-product.js';
|
|
8
|
+
/** Parse raw entity to typed record */
|
|
9
|
+
function parseShopifyProduct(entity) {
|
|
10
|
+
return {
|
|
11
|
+
...entity,
|
|
12
|
+
modelKey: 'shopify-product',
|
|
13
|
+
data: entity.data,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fetch a single Shopify Product by ID
|
|
18
|
+
*/
|
|
19
|
+
export function useShopifyProduct(id, options) {
|
|
20
|
+
const { preview, ...queryOptions } = options ?? {};
|
|
21
|
+
const result = useQuery(GetShopifyProductDocument, {
|
|
22
|
+
...queryOptions,
|
|
23
|
+
variables: { id, preview },
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
...result,
|
|
27
|
+
shopifyProduct: result.data?.entity ? parseShopifyProduct(result.data.entity) : undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fetch a list of Shopify Product records
|
|
32
|
+
*/
|
|
33
|
+
export function useShopifyProducts(options) {
|
|
34
|
+
const { queryOptions, ...variables } = options ?? {};
|
|
35
|
+
const result = useQuery(ListShopifyProductsDocument, {
|
|
36
|
+
...queryOptions,
|
|
37
|
+
variables,
|
|
38
|
+
});
|
|
39
|
+
const typedResult = result.data?.entities
|
|
40
|
+
? {
|
|
41
|
+
items: result.data.entities.items.map(parseShopifyProduct),
|
|
42
|
+
total: result.data.entities.total,
|
|
43
|
+
hasMore: result.data.entities.hasMore,
|
|
44
|
+
}
|
|
45
|
+
: undefined;
|
|
46
|
+
return {
|
|
47
|
+
...result,
|
|
48
|
+
shopifyProducts: typedResult,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a new Shopify Product
|
|
53
|
+
*/
|
|
54
|
+
export function useCreateShopifyProduct(options) {
|
|
55
|
+
const [mutate, result] = useMutation(CreateShopifyProductDocument, options);
|
|
56
|
+
const createShopifyProduct = async (data) => {
|
|
57
|
+
const response = await mutate({ variables: { data } });
|
|
58
|
+
return response.data?.createEntity
|
|
59
|
+
? parseShopifyProduct(response.data.createEntity)
|
|
60
|
+
: undefined;
|
|
61
|
+
};
|
|
62
|
+
return [createShopifyProduct, result];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Update an existing Shopify Product
|
|
66
|
+
*/
|
|
67
|
+
export function useUpdateShopifyProduct(options) {
|
|
68
|
+
const [mutate, result] = useMutation(UpdateShopifyProductDocument, options);
|
|
69
|
+
const updateShopifyProduct = async (id, data) => {
|
|
70
|
+
const response = await mutate({ variables: { id, data } });
|
|
71
|
+
return response.data?.updateEntity
|
|
72
|
+
? parseShopifyProduct(response.data.updateEntity)
|
|
73
|
+
: undefined;
|
|
74
|
+
};
|
|
75
|
+
return [updateShopifyProduct, result];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Delete a Shopify Product
|
|
79
|
+
*/
|
|
80
|
+
export function useDeleteShopifyProduct(options) {
|
|
81
|
+
const [mutate, result] = useMutation(DeleteShopifyProductDocument, options);
|
|
82
|
+
const deleteShopifyProduct = async (id) => {
|
|
83
|
+
const response = await mutate({ variables: { id } });
|
|
84
|
+
return response.data?.deleteEntity;
|
|
85
|
+
};
|
|
86
|
+
return [deleteShopifyProduct, result];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Publish a Shopify Product
|
|
90
|
+
*/
|
|
91
|
+
export function usePublishShopifyProduct(options) {
|
|
92
|
+
const [mutate, result] = useMutation(PublishShopifyProductDocument, options);
|
|
93
|
+
const publishShopifyProduct = async (id, versionId) => {
|
|
94
|
+
const response = await mutate({ variables: { id, versionId } });
|
|
95
|
+
return response.data?.publishEntity
|
|
96
|
+
? parseShopifyProduct(response.data.publishEntity)
|
|
97
|
+
: undefined;
|
|
98
|
+
};
|
|
99
|
+
return [publishShopifyProduct, result];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Unpublish a Shopify Product
|
|
103
|
+
*/
|
|
104
|
+
export function useUnpublishShopifyProduct(options) {
|
|
105
|
+
const [mutate, result] = useMutation(UnpublishShopifyProductDocument, options);
|
|
106
|
+
const unpublishShopifyProduct = async (id) => {
|
|
107
|
+
const response = await mutate({ variables: { id } });
|
|
108
|
+
return response.data?.unpublishEntity
|
|
109
|
+
? parseShopifyProduct(response.data.unpublishEntity)
|
|
110
|
+
: undefined;
|
|
111
|
+
};
|
|
112
|
+
return [unpublishShopifyProduct, result];
|
|
113
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify Variant - React Hooks
|
|
3
|
+
*
|
|
4
|
+
* @generated by UniformGen - DO NOT EDIT MANUALLY
|
|
5
|
+
*/
|
|
6
|
+
import { type QueryHookOptions, type MutationHookOptions } from '@apollo/client';
|
|
7
|
+
import type { ShopifyVariantData } from '../types/models/shopify-variant.js';
|
|
8
|
+
/** Typed Shopify Variant record */
|
|
9
|
+
export interface ShopifyVariantRecord {
|
|
10
|
+
id: string;
|
|
11
|
+
modelKey: 'shopify-variant';
|
|
12
|
+
naturalKey?: string;
|
|
13
|
+
data: ShopifyVariantData;
|
|
14
|
+
versionNumber: number;
|
|
15
|
+
publishedVersionNumber?: number;
|
|
16
|
+
status: 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
/** Typed list result */
|
|
21
|
+
export interface ShopifyVariantListResult {
|
|
22
|
+
items: ShopifyVariantRecord[];
|
|
23
|
+
total: number;
|
|
24
|
+
hasMore: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Filter input for list queries */
|
|
27
|
+
export interface FilterInput {
|
|
28
|
+
field: string;
|
|
29
|
+
operator: string;
|
|
30
|
+
value: string | number | boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Sort input for list queries */
|
|
33
|
+
export interface SortInput {
|
|
34
|
+
field: string;
|
|
35
|
+
direction: 'ASC' | 'DESC';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fetch a single Shopify Variant by ID
|
|
39
|
+
*/
|
|
40
|
+
export declare function useShopifyVariant(id: string, options?: Omit<QueryHookOptions, 'variables'> & {
|
|
41
|
+
preview?: boolean;
|
|
42
|
+
}): any;
|
|
43
|
+
/**
|
|
44
|
+
* Fetch a list of Shopify Variant records
|
|
45
|
+
*/
|
|
46
|
+
export declare function useShopifyVariants(options?: {
|
|
47
|
+
limit?: number;
|
|
48
|
+
offset?: number;
|
|
49
|
+
filters?: FilterInput[];
|
|
50
|
+
sort?: SortInput;
|
|
51
|
+
preview?: boolean;
|
|
52
|
+
queryOptions?: Omit<QueryHookOptions, 'variables'>;
|
|
53
|
+
}): any;
|
|
54
|
+
/**
|
|
55
|
+
* Create a new Shopify Variant
|
|
56
|
+
*/
|
|
57
|
+
export declare function useCreateShopifyVariant(options?: MutationHookOptions): readonly [(data: ShopifyVariantData) => Promise<ShopifyVariantRecord | undefined>, any];
|
|
58
|
+
/**
|
|
59
|
+
* Update an existing Shopify Variant
|
|
60
|
+
*/
|
|
61
|
+
export declare function useUpdateShopifyVariant(options?: MutationHookOptions): readonly [(id: string, data: Partial<ShopifyVariantData>) => Promise<ShopifyVariantRecord | undefined>, any];
|
|
62
|
+
/**
|
|
63
|
+
* Delete a Shopify Variant
|
|
64
|
+
*/
|
|
65
|
+
export declare function useDeleteShopifyVariant(options?: MutationHookOptions): readonly [(id: string) => Promise<any>, any];
|
|
66
|
+
/**
|
|
67
|
+
* Publish a Shopify Variant
|
|
68
|
+
*/
|
|
69
|
+
export declare function usePublishShopifyVariant(options?: MutationHookOptions): readonly [(id: string, versionId?: string) => Promise<ShopifyVariantRecord | undefined>, any];
|
|
70
|
+
/**
|
|
71
|
+
* Unpublish a Shopify Variant
|
|
72
|
+
*/
|
|
73
|
+
export declare function useUnpublishShopifyVariant(options?: MutationHookOptions): readonly [(id: string) => Promise<ShopifyVariantRecord | undefined>, any];
|
|
74
|
+
//# sourceMappingURL=shopify-variant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopify-variant.d.ts","sourceRoot":"","sources":["../../../src/generated/hooks/shopify-variant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,EAAE,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AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,mBAAmB,oBAGzB,kBAAkB,qDAQ7D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,QAAQ,OAAO,CAAC,kBAAkB,CAAC,qDAQlF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,wBAM/C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,cAAc,MAAM,qDAQpE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,mBAAmB,kBAG3B,MAAM,qDAQlD"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify Variant - React Hooks
|
|
3
|
+
*
|
|
4
|
+
* @generated by UniformGen - DO NOT EDIT MANUALLY
|
|
5
|
+
*/
|
|
6
|
+
import { useQuery, useMutation, } from '@apollo/client';
|
|
7
|
+
import { GetShopifyVariantDocument, ListShopifyVariantsDocument, CreateShopifyVariantDocument, UpdateShopifyVariantDocument, DeleteShopifyVariantDocument, PublishShopifyVariantDocument, UnpublishShopifyVariantDocument, } from '../documents/shopify-variant.js';
|
|
8
|
+
/** Parse raw entity to typed record */
|
|
9
|
+
function parseShopifyVariant(entity) {
|
|
10
|
+
return {
|
|
11
|
+
...entity,
|
|
12
|
+
modelKey: 'shopify-variant',
|
|
13
|
+
data: entity.data,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Fetch a single Shopify Variant by ID
|
|
18
|
+
*/
|
|
19
|
+
export function useShopifyVariant(id, options) {
|
|
20
|
+
const { preview, ...queryOptions } = options ?? {};
|
|
21
|
+
const result = useQuery(GetShopifyVariantDocument, {
|
|
22
|
+
...queryOptions,
|
|
23
|
+
variables: { id, preview },
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
...result,
|
|
27
|
+
shopifyVariant: result.data?.entity ? parseShopifyVariant(result.data.entity) : undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fetch a list of Shopify Variant records
|
|
32
|
+
*/
|
|
33
|
+
export function useShopifyVariants(options) {
|
|
34
|
+
const { queryOptions, ...variables } = options ?? {};
|
|
35
|
+
const result = useQuery(ListShopifyVariantsDocument, {
|
|
36
|
+
...queryOptions,
|
|
37
|
+
variables,
|
|
38
|
+
});
|
|
39
|
+
const typedResult = result.data?.entities
|
|
40
|
+
? {
|
|
41
|
+
items: result.data.entities.items.map(parseShopifyVariant),
|
|
42
|
+
total: result.data.entities.total,
|
|
43
|
+
hasMore: result.data.entities.hasMore,
|
|
44
|
+
}
|
|
45
|
+
: undefined;
|
|
46
|
+
return {
|
|
47
|
+
...result,
|
|
48
|
+
shopifyVariants: typedResult,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a new Shopify Variant
|
|
53
|
+
*/
|
|
54
|
+
export function useCreateShopifyVariant(options) {
|
|
55
|
+
const [mutate, result] = useMutation(CreateShopifyVariantDocument, options);
|
|
56
|
+
const createShopifyVariant = async (data) => {
|
|
57
|
+
const response = await mutate({ variables: { data } });
|
|
58
|
+
return response.data?.createEntity
|
|
59
|
+
? parseShopifyVariant(response.data.createEntity)
|
|
60
|
+
: undefined;
|
|
61
|
+
};
|
|
62
|
+
return [createShopifyVariant, result];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Update an existing Shopify Variant
|
|
66
|
+
*/
|
|
67
|
+
export function useUpdateShopifyVariant(options) {
|
|
68
|
+
const [mutate, result] = useMutation(UpdateShopifyVariantDocument, options);
|
|
69
|
+
const updateShopifyVariant = async (id, data) => {
|
|
70
|
+
const response = await mutate({ variables: { id, data } });
|
|
71
|
+
return response.data?.updateEntity
|
|
72
|
+
? parseShopifyVariant(response.data.updateEntity)
|
|
73
|
+
: undefined;
|
|
74
|
+
};
|
|
75
|
+
return [updateShopifyVariant, result];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Delete a Shopify Variant
|
|
79
|
+
*/
|
|
80
|
+
export function useDeleteShopifyVariant(options) {
|
|
81
|
+
const [mutate, result] = useMutation(DeleteShopifyVariantDocument, options);
|
|
82
|
+
const deleteShopifyVariant = async (id) => {
|
|
83
|
+
const response = await mutate({ variables: { id } });
|
|
84
|
+
return response.data?.deleteEntity;
|
|
85
|
+
};
|
|
86
|
+
return [deleteShopifyVariant, result];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Publish a Shopify Variant
|
|
90
|
+
*/
|
|
91
|
+
export function usePublishShopifyVariant(options) {
|
|
92
|
+
const [mutate, result] = useMutation(PublishShopifyVariantDocument, options);
|
|
93
|
+
const publishShopifyVariant = async (id, versionId) => {
|
|
94
|
+
const response = await mutate({ variables: { id, versionId } });
|
|
95
|
+
return response.data?.publishEntity
|
|
96
|
+
? parseShopifyVariant(response.data.publishEntity)
|
|
97
|
+
: undefined;
|
|
98
|
+
};
|
|
99
|
+
return [publishShopifyVariant, result];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Unpublish a Shopify Variant
|
|
103
|
+
*/
|
|
104
|
+
export function useUnpublishShopifyVariant(options) {
|
|
105
|
+
const [mutate, result] = useMutation(UnpublishShopifyVariantDocument, options);
|
|
106
|
+
const unpublishShopifyVariant = async (id) => {
|
|
107
|
+
const response = await mutate({ variables: { id } });
|
|
108
|
+
return response.data?.unpublishEntity
|
|
109
|
+
? parseShopifyVariant(response.data.unpublishEntity)
|
|
110
|
+
: undefined;
|
|
111
|
+
};
|
|
112
|
+
return [unpublishShopifyVariant, result];
|
|
113
|
+
}
|