@logto/connector-apple 1.0.0-beta.11 → 1.0.0-beta.12

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/lib/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 1743:
5
+ /***/ 375:
6
6
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
7
7
 
8
8
 
@@ -22,22 +22,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", ({ value: true }));
24
24
  exports.parseJson = exports.validateConfig = void 0;
25
- const types_1 = __nccwpck_require__(8053);
26
- __exportStar(__nccwpck_require__(8053), exports);
25
+ const types_js_1 = __nccwpck_require__(6309);
26
+ __exportStar(__nccwpck_require__(6309), exports);
27
27
  function validateConfig(config, guard) {
28
28
  const result = guard.safeParse(config);
29
29
  if (!result.success) {
30
- throw new types_1.ConnectorError(types_1.ConnectorErrorCodes.InvalidConfig, result.error);
30
+ throw new types_js_1.ConnectorError(types_js_1.ConnectorErrorCodes.InvalidConfig, result.error);
31
31
  }
32
32
  }
33
33
  exports.validateConfig = validateConfig;
34
- const parseJson = (jsonString, errorCode = types_1.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
34
+ const parseJson = (jsonString, errorCode = types_js_1.ConnectorErrorCodes.InvalidResponse, errorPayload) => {
35
35
  try {
36
36
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
37
37
  return JSON.parse(jsonString);
38
38
  }
39
39
  catch {
40
- throw new types_1.ConnectorError(errorCode, errorPayload ?? jsonString);
40
+ throw new types_js_1.ConnectorError(errorCode, errorPayload ?? jsonString);
41
41
  }
42
42
  };
43
43
  exports.parseJson = parseJson;
@@ -45,12 +45,13 @@ exports.parseJson = parseJson;
45
45
 
46
46
  /***/ }),
47
47
 
48
- /***/ 8053:
48
+ /***/ 6309:
49
49
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
50
50
 
51
51
 
52
52
  Object.defineProperty(exports, "__esModule", ({ value: true }));
53
- exports.messageTypesGuard = exports.MessageTypes = exports.ConnectorError = exports.ConnectorErrorCodes = exports.ConnectorPlatform = exports.ConnectorType = void 0;
53
+ exports.configurableConnectorMetadataGuard = exports.messageTypesGuard = exports.MessageTypes = exports.ConnectorError = exports.ConnectorErrorCodes = exports.i18nPhrasesGuard = exports.ConnectorPlatform = exports.ConnectorType = void 0;
54
+ const language_kit_1 = __nccwpck_require__(7266);
54
55
  const zod_1 = __nccwpck_require__(8062);
55
56
  // MARK: Foundation
56
57
  var ConnectorType;
@@ -65,6 +66,21 @@ var ConnectorPlatform;
65
66
  ConnectorPlatform["Universal"] = "Universal";
66
67
  ConnectorPlatform["Web"] = "Web";
67
68
  })(ConnectorPlatform = exports.ConnectorPlatform || (exports.ConnectorPlatform = {}));
69
+ exports.i18nPhrasesGuard = zod_1.z
70
+ .object({ en: zod_1.z.string() })
71
+ .and(zod_1.z.record(zod_1.z.string()))
72
+ .refine((i18nObject) => {
73
+ const keys = Object.keys(i18nObject);
74
+ if (!keys.includes('en')) {
75
+ return false;
76
+ }
77
+ for (const value of keys) {
78
+ if (!(0, language_kit_1.isLanguageTag)(value)) {
79
+ return false;
80
+ }
81
+ }
82
+ return true;
83
+ });
68
84
  var ConnectorErrorCodes;
69
85
  (function (ConnectorErrorCodes) {
70
86
  ConnectorErrorCodes["General"] = "general";
@@ -99,6 +115,213 @@ var MessageTypes;
99
115
  MessageTypes["Test"] = "Test";
100
116
  })(MessageTypes = exports.MessageTypes || (exports.MessageTypes = {}));
101
117
  exports.messageTypesGuard = zod_1.z.nativeEnum(MessageTypes);
118
+ const connectorMetadataGuard = zod_1.z.object({
119
+ id: zod_1.z.string(),
120
+ target: zod_1.z.string(),
121
+ platform: zod_1.z.nativeEnum(ConnectorPlatform).nullable(),
122
+ name: exports.i18nPhrasesGuard,
123
+ logo: zod_1.z.string(),
124
+ logoDark: zod_1.z.string().nullable(),
125
+ description: exports.i18nPhrasesGuard,
126
+ isStandard: zod_1.z.boolean().optional(),
127
+ readme: zod_1.z.string(),
128
+ configTemplate: zod_1.z.string(),
129
+ });
130
+ exports.configurableConnectorMetadataGuard = connectorMetadataGuard
131
+ .pick({
132
+ target: true,
133
+ name: true,
134
+ logo: true,
135
+ logoDark: true,
136
+ })
137
+ .partial();
138
+
139
+
140
+ /***/ }),
141
+
142
+ /***/ 6921:
143
+ /***/ ((__unused_webpack_module, exports) => {
144
+
145
+
146
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
147
+ exports.languages = void 0;
148
+ exports.languages = Object.freeze({
149
+ 'af-ZA': 'Afrikaans',
150
+ 'am-ET': 'አማርኛ',
151
+ 'ar-AR': 'العربية',
152
+ 'as-IN': 'অসমীয়া',
153
+ 'az-AZ': 'Azərbaycan dili',
154
+ 'be-BY': 'Беларуская',
155
+ 'bg-BG': 'Български',
156
+ 'bn-IN': 'বাংলা',
157
+ 'br-FR': 'Brezhoneg',
158
+ 'bs-BA': 'Bosanski',
159
+ 'ca-ES': 'Català',
160
+ 'cb-IQ': 'کوردیی ناوەندی',
161
+ 'co-FR': 'Corsu',
162
+ 'cs-CZ': 'Čeština',
163
+ 'cx-PH': 'Bisaya',
164
+ 'cy-GB': 'Cymraeg',
165
+ 'da-DK': 'Dansk',
166
+ de: 'Deutsch',
167
+ 'de-DE': 'Deutsch (Deutschland)',
168
+ 'el-GR': 'Ελληνικά',
169
+ en: 'English',
170
+ 'en-GB': 'English (UK)',
171
+ 'en-US': 'English (US)',
172
+ 'eo-EO': 'Esperanto',
173
+ es: 'Español',
174
+ 'es-ES': 'Español (España)',
175
+ 'es-419': 'Español (Latinoamérica)',
176
+ 'et-EE': 'Eesti',
177
+ 'eu-ES': 'Euskara',
178
+ 'fa-IR': 'فارسی',
179
+ 'ff-NG': 'Fula',
180
+ 'fi-FI': 'Suomi',
181
+ 'fo-FO': 'Føroyskt',
182
+ fr: 'Français',
183
+ 'fr-CA': 'Français (Canada)',
184
+ 'fr-FR': 'Français (France)',
185
+ 'fy-NL': 'Frysk',
186
+ 'ga-IE': 'Gaeilge',
187
+ 'gl-ES': 'Galego',
188
+ 'gn-PY': 'Guarani',
189
+ 'gu-IN': 'ગુજરાતી',
190
+ 'ha-NG': 'Hausa',
191
+ 'he-IL': 'עברית',
192
+ 'hi-IN': 'हिन्दी',
193
+ 'hr-HR': 'Hrvatski',
194
+ 'ht-HT': 'Kreyòl Ayisyen',
195
+ 'hu-HU': 'Magyar',
196
+ 'hy-AM': 'Հայերեն',
197
+ 'id-ID': 'Bahasa Indonesia',
198
+ 'ik-US': 'Iñupiatun',
199
+ 'is-IS': 'Íslenska',
200
+ it: 'Italiano',
201
+ 'it-IT': 'italiano (Italia)',
202
+ 'iu-CA': 'Inuktitut',
203
+ ja: '日本語',
204
+ 'ja-JP': '日本語',
205
+ 'ja-KS': '日本語(関西)',
206
+ 'jv-ID': 'Basa Jawa',
207
+ 'ka-GE': 'ქართული',
208
+ 'kk-KZ': 'Қазақша',
209
+ 'km-KH': 'ភាសាខ្មែរ',
210
+ 'kn-IN': 'ಕನ್ನಡ',
211
+ ko: '한국어',
212
+ 'ko-KR': '한국어',
213
+ 'ku-TR': 'Kurdî (Kurmancî)',
214
+ 'ky-KG': 'кыргызча',
215
+ 'lo-LA': 'ພາສາລາວ',
216
+ 'lt-LT': 'Lietuvių',
217
+ 'lv-LV': 'Latviešu',
218
+ 'mg-MG': 'Malagasy',
219
+ 'mk-MK': 'Македонски',
220
+ 'ml-IN': 'മലയാളം',
221
+ 'mn-MN': 'Монгол',
222
+ 'mr-IN': 'मराठी',
223
+ 'ms-MY': 'Bahasa Melayu',
224
+ 'mt-MT': 'Malti',
225
+ 'my-MM': 'မြန်မာဘာသာ',
226
+ 'nb-NO': 'Norsk (bokmål)',
227
+ 'ne-NP': 'नेपाली',
228
+ 'nl-BE': 'Vlaams',
229
+ 'nl-NL': 'Nederlands',
230
+ 'nn-NO': 'Norsk (nynorsk)',
231
+ 'or-IN': 'ଓଡ଼ିଆ',
232
+ 'pa-IN': 'ਪੰਜਾਬੀ',
233
+ 'pl-PL': 'Polski',
234
+ 'ps-AF': 'پښتو',
235
+ pt: 'português',
236
+ 'pt-BR': 'Português (Brasil)',
237
+ 'pt-PT': 'português (Portugal)',
238
+ 'ro-RO': 'Română',
239
+ ru: 'Русский',
240
+ 'ru-RU': 'Русский',
241
+ 'rw-RW': 'Ikinyarwanda',
242
+ 'sc-IT': 'Sardu',
243
+ 'si-LK': 'සිංහල',
244
+ 'sk-SK': 'Slovenčina',
245
+ 'sl-SI': 'Slovenščina',
246
+ 'sn-ZW': 'Shona',
247
+ 'sq-AL': 'Shqip',
248
+ 'sr-RS': 'Српски',
249
+ 'sv-SE': 'Svenska',
250
+ 'sw-KE': 'Kiswahili',
251
+ 'sy-SY': 'ܣܘܪܝܝܐ',
252
+ 'sz-PL': 'ślōnskŏ gŏdka',
253
+ 'ta-IN': 'தமிழ்',
254
+ 'te-IN': 'తెలుగు',
255
+ 'tg-TJ': 'Тоҷикӣ',
256
+ 'th-TH': 'ภาษาไทย',
257
+ 'tl-PH': 'Filipino',
258
+ tr: 'Türkçe',
259
+ 'tr-TR': 'Türkçe',
260
+ 'tt-RU': 'Татарча',
261
+ 'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ',
262
+ 'uk-UA': 'Українська',
263
+ 'ur-PK': 'اردو',
264
+ 'uz-UZ': "O'zbek",
265
+ 'vi-VN': 'Tiếng Việt',
266
+ zh: '中文',
267
+ 'zh-CN': '简体中文',
268
+ 'zh-HK': '繁體中文(香港)',
269
+ 'zh-MO': '繁體中文(澳門)',
270
+ 'zh-TW': '繁體中文(台灣)',
271
+ 'zz-TR': 'Zaza',
272
+ });
273
+
274
+
275
+ /***/ }),
276
+
277
+ /***/ 7266:
278
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
279
+
280
+
281
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
282
+ if (k2 === undefined) k2 = k;
283
+ var desc = Object.getOwnPropertyDescriptor(m, k);
284
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
285
+ desc = { enumerable: true, get: function() { return m[k]; } };
286
+ }
287
+ Object.defineProperty(o, k2, desc);
288
+ }) : (function(o, m, k, k2) {
289
+ if (k2 === undefined) k2 = k;
290
+ o[k2] = m[k];
291
+ }));
292
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
293
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
294
+ };
295
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
296
+ __exportStar(__nccwpck_require__(6921), exports);
297
+ __exportStar(__nccwpck_require__(9962), exports);
298
+ __exportStar(__nccwpck_require__(9715), exports);
299
+
300
+
301
+ /***/ }),
302
+
303
+ /***/ 9962:
304
+ /***/ ((__unused_webpack_module, exports) => {
305
+
306
+
307
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
308
+
309
+
310
+ /***/ }),
311
+
312
+ /***/ 9715:
313
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
314
+
315
+
316
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
317
+ exports.languageTagGuard = exports.isLanguageTag = void 0;
318
+ const zod_1 = __nccwpck_require__(8062);
319
+ const const_1 = __nccwpck_require__(6921);
320
+ const isLanguageTag = (value) => typeof value === 'string' && value in const_1.languages;
321
+ exports.isLanguageTag = isLanguageTag;
322
+ exports.languageTagGuard = zod_1.z
323
+ .any()
324
+ .refine((value) => (0, exports.isLanguageTag)(value));
102
325
 
103
326
 
104
327
  /***/ }),
@@ -8142,7 +8365,7 @@ exports.oboolean = oboolean;
8142
8365
 
8143
8366
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8144
8367
  exports.defaultTimeout = exports.defaultMetadata = exports.scope = exports.jwksUri = exports.accessTokenEndpoint = exports.authorizationEndpoint = exports.issuer = void 0;
8145
- const connector_kit_1 = __nccwpck_require__(1743);
8368
+ const connector_kit_1 = __nccwpck_require__(375);
8146
8369
  // https://appleid.apple.com/.well-known/openid-configuration
8147
8370
  exports.issuer = 'https://appleid.apple.com';
8148
8371
  exports.authorizationEndpoint = `${exports.issuer}/auth/authorize`;
@@ -8287,7 +8510,7 @@ var __webpack_exports__ = {};
8287
8510
  var exports = __webpack_exports__;
8288
8511
 
8289
8512
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8290
- const connector_kit_1 = __nccwpck_require__(1743);
8513
+ const connector_kit_1 = __nccwpck_require__(375);
8291
8514
  const jose_1 = __nccwpck_require__(4974);
8292
8515
  const constant_1 = __nccwpck_require__(87);
8293
8516
  const types_1 = __nccwpck_require__(7760);
@@ -1,4 +1,4 @@
1
- import { ConnectorMetadata } from '@logto/connector-kit';
1
+ import type { ConnectorMetadata } from '@logto/connector-kit';
2
2
  export declare const issuer = "https://appleid.apple.com";
3
3
  export declare const authorizationEndpoint: string;
4
4
  export declare const accessTokenEndpoint: string;
@@ -1,3 +1,3 @@
1
- import { CreateConnector, SocialConnector } from '@logto/connector-kit';
1
+ import type { CreateConnector, SocialConnector } from '@logto/connector-kit';
2
2
  declare const createAppleConnector: CreateConnector<SocialConnector>;
3
3
  export default createAppleConnector;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/connector-apple",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "Apple web connector implementation.",
5
5
  "main": "./lib/index.js",
6
6
  "exports": "./lib/index.js",
@@ -24,17 +24,17 @@
24
24
  "prepack": "pnpm build"
25
25
  },
26
26
  "dependencies": {
27
- "@logto/connector-kit": "^1.0.0-beta.20",
27
+ "@logto/connector-kit": "^1.0.0-beta.26",
28
28
  "@silverhand/essentials": "^1.2.0",
29
- "@silverhand/jest-config": "1.0.0",
29
+ "@silverhand/jest-config": "1.2.2",
30
30
  "got": "^11.8.2",
31
31
  "jose": "^4.3.8",
32
32
  "zod": "^3.14.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@jest/types": "^28.1.3",
36
- "@silverhand/eslint-config": "1.0.0",
37
- "@silverhand/ts-config": "1.0.0",
36
+ "@silverhand/eslint-config": "1.3.0",
37
+ "@silverhand/ts-config": "1.2.1",
38
38
  "@types/jest": "^28.1.6",
39
39
  "@types/node": "^16.3.1",
40
40
  "@vercel/ncc": "^0.34.0",
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "62c344b3983e465958ff1210cc9e0ea959002510"
59
+ "gitHead": "4644de2adacd83128a38f923df19c5b1767901e0"
60
60
  }