@huckleberry-inc/address-consts 4.2.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 ADDED
@@ -0,0 +1,17 @@
1
+ # `@shopify/address-consts`
2
+
3
+ > [!CAUTION]
4
+ >
5
+ > `@shopify/address-consts` is deprecated.
6
+ >
7
+ > Shopifolk, see
8
+ > [Shopify/quilt-internal](https://github.com/shopify/quilt-internal) for
9
+ > information on the latest packages available for use internally.
10
+
11
+ [![Build Status](https://github.com/Shopify/quilt/workflows/Node-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ANode-CI)
12
+ [![Build Status](https://github.com/Shopify/quilt/workflows/Ruby-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ARuby-CI)
13
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md) [![npm version](https://badge.fury.io/js/%40shopify%2Faddress-consts.svg)](https://badge.fury.io/js/%40shopify%2Faddress-consts.svg)
14
+
15
+ Constants and types relating to `@shopify/address`.
16
+
17
+ This package is not meant for direct consumption, rather it contains dependencies that both `@shopify/address` and `@shopify/address-mocks` require.
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ exports.FieldName = void 0;
6
+ (function (FieldName) {
7
+ FieldName["FirstName"] = "firstName";
8
+ FieldName["LastName"] = "lastName";
9
+ FieldName["Country"] = "country";
10
+ FieldName["City"] = "city";
11
+ FieldName["PostalCode"] = "zip";
12
+ FieldName["Zone"] = "province";
13
+ FieldName["Address1"] = "address1";
14
+ FieldName["Address2"] = "address2";
15
+ FieldName["Phone"] = "phone";
16
+ FieldName["Company"] = "company";
17
+ })(exports.FieldName || (exports.FieldName = {}));
18
+ const GRAPHQL_ENDPOINT = 'https://atlas.shopifysvc.com/graphql';
19
+ exports.GraphqlOperationName = void 0;
20
+
21
+ /* eslint-disable @typescript-eslint/naming-convention */
22
+ (function (GraphqlOperationName) {
23
+ GraphqlOperationName["Countries"] = "getCountries";
24
+ GraphqlOperationName["Country"] = "getCountry";
25
+ })(exports.GraphqlOperationName || (exports.GraphqlOperationName = {}));
26
+ const HEADERS = {
27
+ 'Content-Type': 'application/json',
28
+ 'Access-Control-Allow-Origin': '*'
29
+ };
30
+ /* eslint-enable @typescript-eslint/naming-convention */
31
+
32
+ exports.GRAPHQL_ENDPOINT = GRAPHQL_ENDPOINT;
33
+ exports.HEADERS = HEADERS;
@@ -0,0 +1,28 @@
1
+ let FieldName;
2
+ (function (FieldName) {
3
+ FieldName["FirstName"] = "firstName";
4
+ FieldName["LastName"] = "lastName";
5
+ FieldName["Country"] = "country";
6
+ FieldName["City"] = "city";
7
+ FieldName["PostalCode"] = "zip";
8
+ FieldName["Zone"] = "province";
9
+ FieldName["Address1"] = "address1";
10
+ FieldName["Address2"] = "address2";
11
+ FieldName["Phone"] = "phone";
12
+ FieldName["Company"] = "company";
13
+ })(FieldName || (FieldName = {}));
14
+ const GRAPHQL_ENDPOINT = 'https://atlas.shopifysvc.com/graphql';
15
+ let GraphqlOperationName;
16
+
17
+ /* eslint-disable @typescript-eslint/naming-convention */
18
+ (function (GraphqlOperationName) {
19
+ GraphqlOperationName["Countries"] = "getCountries";
20
+ GraphqlOperationName["Country"] = "getCountry";
21
+ })(GraphqlOperationName || (GraphqlOperationName = {}));
22
+ const HEADERS = {
23
+ 'Content-Type': 'application/json',
24
+ 'Access-Control-Allow-Origin': '*'
25
+ };
26
+ /* eslint-enable @typescript-eslint/naming-convention */
27
+
28
+ export { FieldName, GRAPHQL_ENDPOINT, GraphqlOperationName, HEADERS };
@@ -0,0 +1,28 @@
1
+ let FieldName;
2
+ (function (FieldName) {
3
+ FieldName["FirstName"] = "firstName";
4
+ FieldName["LastName"] = "lastName";
5
+ FieldName["Country"] = "country";
6
+ FieldName["City"] = "city";
7
+ FieldName["PostalCode"] = "zip";
8
+ FieldName["Zone"] = "province";
9
+ FieldName["Address1"] = "address1";
10
+ FieldName["Address2"] = "address2";
11
+ FieldName["Phone"] = "phone";
12
+ FieldName["Company"] = "company";
13
+ })(FieldName || (FieldName = {}));
14
+ const GRAPHQL_ENDPOINT = 'https://atlas.shopifysvc.com/graphql';
15
+ let GraphqlOperationName;
16
+
17
+ /* eslint-disable @typescript-eslint/naming-convention */
18
+ (function (GraphqlOperationName) {
19
+ GraphqlOperationName["Countries"] = "getCountries";
20
+ GraphqlOperationName["Country"] = "getCountry";
21
+ })(GraphqlOperationName || (GraphqlOperationName = {}));
22
+ const HEADERS = {
23
+ 'Content-Type': 'application/json',
24
+ 'Access-Control-Allow-Origin': '*'
25
+ };
26
+ /* eslint-enable @typescript-eslint/naming-convention */
27
+
28
+ export { FieldName, GRAPHQL_ENDPOINT, GraphqlOperationName, HEADERS };
@@ -0,0 +1,91 @@
1
+ export declare enum FieldName {
2
+ FirstName = "firstName",
3
+ LastName = "lastName",
4
+ Country = "country",
5
+ City = "city",
6
+ PostalCode = "zip",
7
+ Zone = "province",
8
+ Address1 = "address1",
9
+ Address2 = "address2",
10
+ Phone = "phone",
11
+ Company = "company"
12
+ }
13
+ export type ZoneKey = 'COUNTY' | 'EMIRATE' | 'GOVERNORATE' | 'PREFECTURE' | 'PROVINCE' | 'REGION' | 'STATE_AND_TERRITORY' | 'STATE';
14
+ export interface Address {
15
+ company?: string;
16
+ firstName?: string;
17
+ lastName?: string;
18
+ address1: string;
19
+ address2: string;
20
+ city: string;
21
+ province?: string;
22
+ zip: string;
23
+ country: string;
24
+ phone?: string;
25
+ }
26
+ export interface Zone {
27
+ code: string;
28
+ name: string;
29
+ }
30
+ export interface LoadCountriesResponse {
31
+ data: {
32
+ countries: Country[];
33
+ };
34
+ errors?: GraphQlError[];
35
+ }
36
+ export interface LoadCountryResponse {
37
+ data: {
38
+ country: Country;
39
+ };
40
+ errors?: GraphQlError[];
41
+ }
42
+ export interface Country {
43
+ name: string;
44
+ code: string;
45
+ continent: string;
46
+ phoneNumberPrefix: number;
47
+ autocompletionField: string;
48
+ provinceKey: ZoneKey;
49
+ labels: {
50
+ address1: string;
51
+ address2: string;
52
+ city: string;
53
+ company: string;
54
+ country: string;
55
+ firstName: string;
56
+ lastName: string;
57
+ phone: string;
58
+ postalCode: string;
59
+ zone: string;
60
+ };
61
+ optionalLabels: {
62
+ address2: string;
63
+ };
64
+ formatting: {
65
+ edit: string;
66
+ show: string;
67
+ };
68
+ zones: Zone[];
69
+ }
70
+ export interface ResponseError {
71
+ errors: GraphQlError[];
72
+ }
73
+ export interface GraphQlError {
74
+ message: string;
75
+ locations?: {
76
+ column: number;
77
+ line: number;
78
+ }[];
79
+ path?: any[];
80
+ extensions?: object;
81
+ }
82
+ export declare const GRAPHQL_ENDPOINT = "https://atlas.shopifysvc.com/graphql";
83
+ export declare enum GraphqlOperationName {
84
+ Countries = "getCountries",
85
+ Country = "getCountry"
86
+ }
87
+ export declare const HEADERS: {
88
+ 'Content-Type': string;
89
+ 'Access-Control-Allow-Origin': string;
90
+ };
91
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,UAAU,QAAQ;IAClB,IAAI,aAAa;IACjB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,OAAO,GACf,QAAQ,GACR,SAAS,GACT,aAAa,GACb,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,qBAAqB,GACrB,OAAO,CAAC;AAEZ,MAAM,WAAW,OAAO;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EA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AAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,yCAAyC,CAAC;AACvE,oBAAY,oBAAoB;IAC9B,SAAS,iBAAiB;IAC1B,OAAO,eAAe;CACvB;AAGD,eAAO,MAAM,OAAO;;;CAGnB,CAAC"}
package/index.esnext ADDED
@@ -0,0 +1 @@
1
+ export * from "./build/esnext/index.esnext";
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require("./build/cjs/index.js");
package/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export * from "./build/esm/index.mjs";
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@huckleberry-inc/address-consts",
3
+ "version": "4.2.0",
4
+ "license": "MIT",
5
+ "description": "Constants and types relating to `@shopify/address`",
6
+ "main": "index.js",
7
+ "types": "./build/ts/index.d.ts",
8
+ "sideEffects": false,
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "@shopify:registry": "https://registry.npmjs.org"
12
+ },
13
+ "author": "Shopify Inc.",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/Shopify/quilt.git",
17
+ "directory": "packages/address-consts"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/Shopify/quilt/issues"
21
+ },
22
+ "homepage": "https://github.com/Shopify/quilt/blob/main/packages/address-consts/README.md",
23
+ "engines": {
24
+ "node": ">=18.12.0"
25
+ },
26
+ "files": [
27
+ "build/",
28
+ "!build/*.tsbuildinfo",
29
+ "!build/ts/**/tests/",
30
+ "index.js",
31
+ "index.mjs",
32
+ "index.esnext"
33
+ ],
34
+ "module": "index.mjs",
35
+ "esnext": "index.esnext",
36
+ "exports": {
37
+ ".": {
38
+ "types": "./build/ts/index.d.ts",
39
+ "esnext": "./index.esnext",
40
+ "import": "./index.mjs",
41
+ "require": "./index.js"
42
+ }
43
+ }
44
+ }